Skip to content

Commit a98afdf

Browse files
committed
Revert "Upgrade V8 to 2.0.5"
This reverts commit 20b945d. Broken on Hagen's Macintosh. Don't have time to investigate.
1 parent 0981e7f commit a98afdf

File tree

108 files changed

+1615
-7621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1615
-7621
lines changed

deps/v8/.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*.pdb
1515
#*#
1616
*~
17-
.cpplint-cache
1817
d8
1918
d8_g
2019
shell

deps/v8/AUTHORS

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ Daniel James <[email protected]>
1313
Jan de Mooij <[email protected]>
1414
Jay Freeman <[email protected]>
1515
Joel Stanley <[email protected]>
16-
John Jozwiak <[email protected]>
1716
Matt Hanselman <[email protected]>
1817
Paolo Giarrusso <[email protected]>
1918
Rafal Krypa <[email protected]>
2019
Rene Rebe <[email protected]>
2120
Ryan Dahl <[email protected]>
2221
Patrick Gansterer <[email protected]>
23-
Subrato K De <subratokde@codeaurora.org>
22+
John Jozwiak <jjozwiak@codeaurora.org>

deps/v8/ChangeLog

+9-41
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,3 @@
1-
2009-12-18: Version 2.0.5
2-
3-
Extended to upper limit of map space to allow for 7 times as many map
4-
to be allocated (issue 524).
5-
6-
Improved performance of code using closures.
7-
8-
Improved performance of some binary operations involving doubles.
9-
10-
11-
2009-12-16: Version 2.0.4
12-
13-
Added ECMAScript 5 Object.create.
14-
15-
Improved performance of Math.max and Math.min.
16-
17-
Optimized adding of strings on 64-bit platforms.
18-
19-
Improved handling of external strings by using a separate table
20-
instead of weak handles. This improves garbage collection
21-
performance and uses less memory.
22-
23-
Changed code generation for object and array literals in toplevel
24-
code to be more compact by doing more work in the runtime.
25-
26-
Fixed a crash bug triggered when garbage collection happened during
27-
generation of a callback load inline cache stub.
28-
29-
Fixed crash bug sometimes triggered when local variables shadowed
30-
parameters in functions that used the arguments object.
31-
32-
331
2009-12-03: Version 2.0.3
342

353
Optimized handling and adding of strings, for-in and Array.join.
@@ -67,7 +35,7 @@
6735
Reverted a change which caused Chromium interactive ui test
6836
failures.
6937

70-
38+
7139
2009-11-18: Version 2.0.0
7240

7341
Added support for VFP on ARM.
@@ -112,7 +80,7 @@
11280

11381

11482
2009-10-16: Version 1.3.16
115-
83+
11684
X64: Convert smis to holding 32 bits of payload.
11785

11886
Introduce v8::Integer::NewFromUnsigned method.
@@ -257,7 +225,7 @@
257225
notifications when V8 has not yet been initialized.
258226

259227
Fixed ARM simulator compilation problem on Windows.
260-
228+
261229

262230
2009-08-25: Version 1.3.7
263231

@@ -372,9 +340,9 @@
372340
function is a built-in.
373341

374342
Initial implementation of constructor heap profile for JS objects.
375-
343+
376344
More fine grained control of profiling aspects through the API.
377-
345+
378346
Optimized the called as constructor check for API calls.
379347

380348

@@ -399,8 +367,8 @@
399367
Added an external allocation limit to avoid issues where small V8
400368
objects would hold on to large amounts of external memory without
401369
causing garbage collections.
402-
403-
Finished more of the inline caching stubs for x64 targets.
370+
371+
Finished more of the inline caching stubs for x64 targets.
404372

405373

406374
2009-07-13: Version 1.2.14
@@ -480,9 +448,9 @@
480448
Fixed a bug in the string type inference.
481449

482450
Fixed a bug in the handling of 'constant function' properties.
483-
451+
484452
Improved overall performance.
485-
453+
486454

487455
2009-06-16: Version 1.2.8
488456

deps/v8/SConstruct

100644100755
-19
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ LIBRARY_FLAGS = {
143143
},
144144
'os:macos': {
145145
'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'],
146-
'library:shared': {
147-
'CPPDEFINES': ['V8_SHARED']
148-
}
149146
},
150147
'os:freebsd': {
151148
'CPPPATH' : ['/usr/local/include'],
@@ -181,12 +178,6 @@ LIBRARY_FLAGS = {
181178
'CCFLAGS': ['-m32'],
182179
'LINKFLAGS': ['-m32']
183180
},
184-
'armvariant:thumb2': {
185-
'CPPDEFINES': ['V8_ARM_VARIANT_THUMB']
186-
},
187-
'armvariant:arm': {
188-
'CPPDEFINES': ['V8_ARM_VARIANT_ARM']
189-
},
190181
'arch:x64': {
191182
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
192183
'CCFLAGS': ['-m64'],
@@ -252,7 +243,6 @@ V8_EXTRA_FLAGS = {
252243
'gcc': {
253244
'all': {
254245
'WARNINGFLAGS': ['-Wall',
255-
'-Werror',
256246
'-W',
257247
'-Wno-unused-parameter',
258248
'-Wnon-virtual-dtor']
@@ -665,11 +655,6 @@ SIMPLE_OPTIONS = {
665655
'values': ['default', 'hidden'],
666656
'default': 'hidden',
667657
'help': 'shared library symbol visibility'
668-
},
669-
'armvariant': {
670-
'values': ['arm', 'thumb2', 'none'],
671-
'default': 'none',
672-
'help': 'generate thumb2 instructions instead of arm instructions (default)'
673658
}
674659
}
675660

@@ -853,10 +838,6 @@ def PostprocessOptions(options):
853838
# Print a warning if profiling is enabled without profiling support
854839
print "Warning: forcing profilingsupport on when prof is on"
855840
options['profilingsupport'] = 'on'
856-
if (options['armvariant'] == 'none' and options['arch'] == 'arm'):
857-
options['armvariant'] = 'arm'
858-
if (options['armvariant'] != 'none' and options['arch'] != 'arm'):
859-
options['armvariant'] = 'none'
860841

861842

862843
def ParseEnvOverrides(arg, imports):

deps/v8/include/v8.h

+10-16
Original file line numberDiff line numberDiff line change
@@ -833,26 +833,13 @@ class V8EXPORT String : public Primitive {
833833
* Returns true if the string is both external and ascii
834834
*/
835835
bool IsExternalAscii() const;
836-
837-
class V8EXPORT ExternalStringResourceBase {
838-
public:
839-
virtual ~ExternalStringResourceBase() {}
840-
protected:
841-
ExternalStringResourceBase() {}
842-
private:
843-
// Disallow copying and assigning.
844-
ExternalStringResourceBase(const ExternalStringResourceBase&);
845-
void operator=(const ExternalStringResourceBase&);
846-
};
847-
848836
/**
849837
* An ExternalStringResource is a wrapper around a two-byte string
850838
* buffer that resides outside V8's heap. Implement an
851839
* ExternalStringResource to manage the life cycle of the underlying
852840
* buffer. Note that the string data must be immutable.
853841
*/
854-
class V8EXPORT ExternalStringResource
855-
: public ExternalStringResourceBase {
842+
class V8EXPORT ExternalStringResource { // NOLINT
856843
public:
857844
/**
858845
* Override the destructor to manage the life cycle of the underlying
@@ -865,6 +852,10 @@ class V8EXPORT String : public Primitive {
865852
virtual size_t length() const = 0;
866853
protected:
867854
ExternalStringResource() {}
855+
private:
856+
// Disallow copying and assigning.
857+
ExternalStringResource(const ExternalStringResource&);
858+
void operator=(const ExternalStringResource&);
868859
};
869860

870861
/**
@@ -878,8 +869,7 @@ class V8EXPORT String : public Primitive {
878869
* Use String::New or convert to 16 bit data for non-ASCII.
879870
*/
880871

881-
class V8EXPORT ExternalAsciiStringResource
882-
: public ExternalStringResourceBase {
872+
class V8EXPORT ExternalAsciiStringResource { // NOLINT
883873
public:
884874
/**
885875
* Override the destructor to manage the life cycle of the underlying
@@ -892,6 +882,10 @@ class V8EXPORT String : public Primitive {
892882
virtual size_t length() const = 0;
893883
protected:
894884
ExternalAsciiStringResource() {}
885+
private:
886+
// Disallow copying and assigning.
887+
ExternalAsciiStringResource(const ExternalAsciiStringResource&);
888+
void operator=(const ExternalAsciiStringResource&);
895889
};
896890

897891
/**

deps/v8/src/SConscript

+1-6
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ SOURCES = {
106106
zone.cc
107107
"""),
108108
'arch:arm': Split("""
109+
arm/assembler-arm.cc
109110
arm/builtins-arm.cc
110111
arm/codegen-arm.cc
111112
arm/constants-arm.cc
@@ -122,12 +123,6 @@ SOURCES = {
122123
arm/stub-cache-arm.cc
123124
arm/virtual-frame-arm.cc
124125
"""),
125-
'armvariant:arm': Split("""
126-
arm/assembler-arm.cc
127-
"""),
128-
'armvariant:thumb2': Split("""
129-
arm/assembler-thumb2.cc
130-
"""),
131126
'arch:ia32': Split("""
132127
ia32/assembler-ia32.cc
133128
ia32/builtins-ia32.cc

deps/v8/src/api.cc

+90-4
Original file line numberDiff line numberDiff line change
@@ -3082,13 +3082,81 @@ i::Handle<i::String> NewExternalAsciiStringHandle(
30823082
}
30833083

30843084

3085+
static void DisposeExternalString(v8::Persistent<v8::Value> obj,
3086+
void* parameter) {
3087+
ENTER_V8;
3088+
i::ExternalTwoByteString* str =
3089+
i::ExternalTwoByteString::cast(*Utils::OpenHandle(*obj));
3090+
3091+
// External symbols are deleted when they are pruned out of the symbol
3092+
// table. Generally external symbols are not registered with the weak handle
3093+
// callbacks unless they are upgraded to a symbol after being externalized.
3094+
if (!str->IsSymbol()) {
3095+
v8::String::ExternalStringResource* resource =
3096+
reinterpret_cast<v8::String::ExternalStringResource*>(parameter);
3097+
if (resource != NULL) {
3098+
const int total_size =
3099+
static_cast<int>(resource->length() * sizeof(*resource->data()));
3100+
i::Counters::total_external_string_memory.Decrement(total_size);
3101+
3102+
// The object will continue to live in the JavaScript heap until the
3103+
// handle is entirely cleaned out by the next GC. For example the
3104+
// destructor for the resource below could bring it back to life again.
3105+
// Which is why we make sure to not have a dangling pointer here.
3106+
str->set_resource(NULL);
3107+
delete resource;
3108+
}
3109+
}
3110+
3111+
// In any case we do not need this handle any longer.
3112+
obj.Dispose();
3113+
}
3114+
3115+
3116+
static void DisposeExternalAsciiString(v8::Persistent<v8::Value> obj,
3117+
void* parameter) {
3118+
ENTER_V8;
3119+
i::ExternalAsciiString* str =
3120+
i::ExternalAsciiString::cast(*Utils::OpenHandle(*obj));
3121+
3122+
// External symbols are deleted when they are pruned out of the symbol
3123+
// table. Generally external symbols are not registered with the weak handle
3124+
// callbacks unless they are upgraded to a symbol after being externalized.
3125+
if (!str->IsSymbol()) {
3126+
v8::String::ExternalAsciiStringResource* resource =
3127+
reinterpret_cast<v8::String::ExternalAsciiStringResource*>(parameter);
3128+
if (resource != NULL) {
3129+
const int total_size =
3130+
static_cast<int>(resource->length() * sizeof(*resource->data()));
3131+
i::Counters::total_external_string_memory.Decrement(total_size);
3132+
3133+
// The object will continue to live in the JavaScript heap until the
3134+
// handle is entirely cleaned out by the next GC. For example the
3135+
// destructor for the resource below could bring it back to life again.
3136+
// Which is why we make sure to not have a dangling pointer here.
3137+
str->set_resource(NULL);
3138+
delete resource;
3139+
}
3140+
}
3141+
3142+
// In any case we do not need this handle any longer.
3143+
obj.Dispose();
3144+
}
3145+
3146+
30853147
Local<String> v8::String::NewExternal(
30863148
v8::String::ExternalStringResource* resource) {
30873149
EnsureInitialized("v8::String::NewExternal()");
30883150
LOG_API("String::NewExternal");
30893151
ENTER_V8;
3152+
const int total_size =
3153+
static_cast<int>(resource->length() * sizeof(*resource->data()));
3154+
i::Counters::total_external_string_memory.Increment(total_size);
30903155
i::Handle<i::String> result = NewExternalStringHandle(resource);
3091-
i::ExternalStringTable::AddString(*result);
3156+
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
3157+
i::GlobalHandles::MakeWeak(handle.location(),
3158+
resource,
3159+
&DisposeExternalString);
30923160
return Utils::ToLocal(result);
30933161
}
30943162

@@ -3100,7 +3168,13 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
31003168
i::Handle<i::String> obj = Utils::OpenHandle(this);
31013169
bool result = obj->MakeExternal(resource);
31023170
if (result && !obj->IsSymbol()) {
3103-
i::ExternalStringTable::AddString(*obj);
3171+
// Operation was successful and the string is not a symbol. In this case
3172+
// we need to make sure that the we call the destructor for the external
3173+
// resource when no strong references to the string remain.
3174+
i::Handle<i::Object> handle = i::GlobalHandles::Create(*obj);
3175+
i::GlobalHandles::MakeWeak(handle.location(),
3176+
resource,
3177+
&DisposeExternalString);
31043178
}
31053179
return result;
31063180
}
@@ -3111,8 +3185,14 @@ Local<String> v8::String::NewExternal(
31113185
EnsureInitialized("v8::String::NewExternal()");
31123186
LOG_API("String::NewExternal");
31133187
ENTER_V8;
3188+
const int total_size =
3189+
static_cast<int>(resource->length() * sizeof(*resource->data()));
3190+
i::Counters::total_external_string_memory.Increment(total_size);
31143191
i::Handle<i::String> result = NewExternalAsciiStringHandle(resource);
3115-
i::ExternalStringTable::AddString(*result);
3192+
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
3193+
i::GlobalHandles::MakeWeak(handle.location(),
3194+
resource,
3195+
&DisposeExternalAsciiString);
31163196
return Utils::ToLocal(result);
31173197
}
31183198

@@ -3125,7 +3205,13 @@ bool v8::String::MakeExternal(
31253205
i::Handle<i::String> obj = Utils::OpenHandle(this);
31263206
bool result = obj->MakeExternal(resource);
31273207
if (result && !obj->IsSymbol()) {
3128-
i::ExternalStringTable::AddString(*obj);
3208+
// Operation was successful and the string is not a symbol. In this case
3209+
// we need to make sure that the we call the destructor for the external
3210+
// resource when no strong references to the string remain.
3211+
i::Handle<i::Object> handle = i::GlobalHandles::Create(*obj);
3212+
i::GlobalHandles::MakeWeak(handle.location(),
3213+
resource,
3214+
&DisposeExternalAsciiString);
31293215
}
31303216
return result;
31313217
}

0 commit comments

Comments
 (0)