Skip to content

Commit 20b945d

Browse files
committed
Upgrade V8 to 2.0.5
1 parent 164ce76 commit 20b945d

File tree

108 files changed

+7621
-1615
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

+7621
-1615
lines changed

deps/v8/.gitignore

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

deps/v8/AUTHORS

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ 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]>
1617
Matt Hanselman <[email protected]>
1718
Paolo Giarrusso <[email protected]>
1819
Rafal Krypa <[email protected]>
1920
Rene Rebe <[email protected]>
2021
Ryan Dahl <[email protected]>
2122
Patrick Gansterer <[email protected]>
22-
John Jozwiak <jjozwiak@codeaurora.org>
23+
Subrato K De <subratokde@codeaurora.org>

deps/v8/ChangeLog

+41-9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
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+
133
2009-12-03: Version 2.0.3
234

335
Optimized handling and adding of strings, for-in and Array.join.
@@ -35,7 +67,7 @@
3567
Reverted a change which caused Chromium interactive ui test
3668
failures.
3769

38-
70+
3971
2009-11-18: Version 2.0.0
4072

4173
Added support for VFP on ARM.
@@ -80,7 +112,7 @@
80112

81113

82114
2009-10-16: Version 1.3.16
83-
115+
84116
X64: Convert smis to holding 32 bits of payload.
85117

86118
Introduce v8::Integer::NewFromUnsigned method.
@@ -225,7 +257,7 @@
225257
notifications when V8 has not yet been initialized.
226258

227259
Fixed ARM simulator compilation problem on Windows.
228-
260+
229261

230262
2009-08-25: Version 1.3.7
231263

@@ -340,9 +372,9 @@
340372
function is a built-in.
341373

342374
Initial implementation of constructor heap profile for JS objects.
343-
375+
344376
More fine grained control of profiling aspects through the API.
345-
377+
346378
Optimized the called as constructor check for API calls.
347379

348380

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

373405

374406
2009-07-13: Version 1.2.14
@@ -448,9 +480,9 @@
448480
Fixed a bug in the string type inference.
449481

450482
Fixed a bug in the handling of 'constant function' properties.
451-
483+
452484
Improved overall performance.
453-
485+
454486

455487
2009-06-16: Version 1.2.8
456488

deps/v8/SConstruct

100755100644
+19
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ LIBRARY_FLAGS = {
143143
},
144144
'os:macos': {
145145
'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'],
146+
'library:shared': {
147+
'CPPDEFINES': ['V8_SHARED']
148+
}
146149
},
147150
'os:freebsd': {
148151
'CPPPATH' : ['/usr/local/include'],
@@ -178,6 +181,12 @@ LIBRARY_FLAGS = {
178181
'CCFLAGS': ['-m32'],
179182
'LINKFLAGS': ['-m32']
180183
},
184+
'armvariant:thumb2': {
185+
'CPPDEFINES': ['V8_ARM_VARIANT_THUMB']
186+
},
187+
'armvariant:arm': {
188+
'CPPDEFINES': ['V8_ARM_VARIANT_ARM']
189+
},
181190
'arch:x64': {
182191
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
183192
'CCFLAGS': ['-m64'],
@@ -243,6 +252,7 @@ V8_EXTRA_FLAGS = {
243252
'gcc': {
244253
'all': {
245254
'WARNINGFLAGS': ['-Wall',
255+
'-Werror',
246256
'-W',
247257
'-Wno-unused-parameter',
248258
'-Wnon-virtual-dtor']
@@ -655,6 +665,11 @@ SIMPLE_OPTIONS = {
655665
'values': ['default', 'hidden'],
656666
'default': 'hidden',
657667
'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)'
658673
}
659674
}
660675

@@ -838,6 +853,10 @@ def PostprocessOptions(options):
838853
# Print a warning if profiling is enabled without profiling support
839854
print "Warning: forcing profilingsupport on when prof is on"
840855
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'
841860

842861

843862
def ParseEnvOverrides(arg, imports):

deps/v8/include/v8.h

+16-10
Original file line numberDiff line numberDiff line change
@@ -833,13 +833,26 @@ 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+
836848
/**
837849
* An ExternalStringResource is a wrapper around a two-byte string
838850
* buffer that resides outside V8's heap. Implement an
839851
* ExternalStringResource to manage the life cycle of the underlying
840852
* buffer. Note that the string data must be immutable.
841853
*/
842-
class V8EXPORT ExternalStringResource { // NOLINT
854+
class V8EXPORT ExternalStringResource
855+
: public ExternalStringResourceBase {
843856
public:
844857
/**
845858
* Override the destructor to manage the life cycle of the underlying
@@ -852,10 +865,6 @@ class V8EXPORT String : public Primitive {
852865
virtual size_t length() const = 0;
853866
protected:
854867
ExternalStringResource() {}
855-
private:
856-
// Disallow copying and assigning.
857-
ExternalStringResource(const ExternalStringResource&);
858-
void operator=(const ExternalStringResource&);
859868
};
860869

861870
/**
@@ -869,7 +878,8 @@ class V8EXPORT String : public Primitive {
869878
* Use String::New or convert to 16 bit data for non-ASCII.
870879
*/
871880

872-
class V8EXPORT ExternalAsciiStringResource { // NOLINT
881+
class V8EXPORT ExternalAsciiStringResource
882+
: public ExternalStringResourceBase {
873883
public:
874884
/**
875885
* Override the destructor to manage the life cycle of the underlying
@@ -882,10 +892,6 @@ class V8EXPORT String : public Primitive {
882892
virtual size_t length() const = 0;
883893
protected:
884894
ExternalAsciiStringResource() {}
885-
private:
886-
// Disallow copying and assigning.
887-
ExternalAsciiStringResource(const ExternalAsciiStringResource&);
888-
void operator=(const ExternalAsciiStringResource&);
889895
};
890896

891897
/**

deps/v8/src/SConscript

+6-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ SOURCES = {
106106
zone.cc
107107
"""),
108108
'arch:arm': Split("""
109-
arm/assembler-arm.cc
110109
arm/builtins-arm.cc
111110
arm/codegen-arm.cc
112111
arm/constants-arm.cc
@@ -123,6 +122,12 @@ SOURCES = {
123122
arm/stub-cache-arm.cc
124123
arm/virtual-frame-arm.cc
125124
"""),
125+
'armvariant:arm': Split("""
126+
arm/assembler-arm.cc
127+
"""),
128+
'armvariant:thumb2': Split("""
129+
arm/assembler-thumb2.cc
130+
"""),
126131
'arch:ia32': Split("""
127132
ia32/assembler-ia32.cc
128133
ia32/builtins-ia32.cc

deps/v8/src/api.cc

+4-90
Original file line numberDiff line numberDiff line change
@@ -3082,81 +3082,13 @@ 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-
31473085
Local<String> v8::String::NewExternal(
31483086
v8::String::ExternalStringResource* resource) {
31493087
EnsureInitialized("v8::String::NewExternal()");
31503088
LOG_API("String::NewExternal");
31513089
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);
31553090
i::Handle<i::String> result = NewExternalStringHandle(resource);
3156-
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
3157-
i::GlobalHandles::MakeWeak(handle.location(),
3158-
resource,
3159-
&DisposeExternalString);
3091+
i::ExternalStringTable::AddString(*result);
31603092
return Utils::ToLocal(result);
31613093
}
31623094

@@ -3168,13 +3100,7 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
31683100
i::Handle<i::String> obj = Utils::OpenHandle(this);
31693101
bool result = obj->MakeExternal(resource);
31703102
if (result && !obj->IsSymbol()) {
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);
3103+
i::ExternalStringTable::AddString(*obj);
31783104
}
31793105
return result;
31803106
}
@@ -3185,14 +3111,8 @@ Local<String> v8::String::NewExternal(
31853111
EnsureInitialized("v8::String::NewExternal()");
31863112
LOG_API("String::NewExternal");
31873113
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);
31913114
i::Handle<i::String> result = NewExternalAsciiStringHandle(resource);
3192-
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
3193-
i::GlobalHandles::MakeWeak(handle.location(),
3194-
resource,
3195-
&DisposeExternalAsciiString);
3115+
i::ExternalStringTable::AddString(*result);
31963116
return Utils::ToLocal(result);
31973117
}
31983118

@@ -3205,13 +3125,7 @@ bool v8::String::MakeExternal(
32053125
i::Handle<i::String> obj = Utils::OpenHandle(this);
32063126
bool result = obj->MakeExternal(resource);
32073127
if (result && !obj->IsSymbol()) {
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);
3128+
i::ExternalStringTable::AddString(*obj);
32153129
}
32163130
return result;
32173131
}

0 commit comments

Comments
 (0)