Skip to content

Commit

Permalink
Revert "Upgrade V8 to 2.0.5"
Browse files Browse the repository at this point in the history
This reverts commit 20b945d.

Broken on Hagen's Macintosh. Don't have time to investigate.
  • Loading branch information
ry committed Dec 19, 2009
1 parent 0981e7f commit a98afdf
Show file tree
Hide file tree
Showing 108 changed files with 1,615 additions and 7,621 deletions.
1 change: 0 additions & 1 deletion deps/v8/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
*.pdb
#*#
*~
.cpplint-cache
d8
d8_g
shell
Expand Down
3 changes: 1 addition & 2 deletions deps/v8/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ Daniel James <dnljms@gmail.com>
Jan de Mooij <jandemooij@gmail.com>
Jay Freeman <saurik@saurik.com>
Joel Stanley <joel.stan@gmail.com>
John Jozwiak <jjozwiak@codeaurora.org>
Matt Hanselman <mjhanselman@gmail.com>
Paolo Giarrusso <p.giarrusso@gmail.com>
Rafal Krypa <rafal@krypa.net>
Rene Rebe <rene@exactcode.de>
Ryan Dahl <coldredlemur@gmail.com>
Patrick Gansterer <paroga@paroga.com>
Subrato K De <subratokde@codeaurora.org>
John Jozwiak <jjozwiak@codeaurora.org>
50 changes: 9 additions & 41 deletions deps/v8/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
2009-12-18: Version 2.0.5

Extended to upper limit of map space to allow for 7 times as many map
to be allocated (issue 524).

Improved performance of code using closures.

Improved performance of some binary operations involving doubles.


2009-12-16: Version 2.0.4

Added ECMAScript 5 Object.create.

Improved performance of Math.max and Math.min.

Optimized adding of strings on 64-bit platforms.

Improved handling of external strings by using a separate table
instead of weak handles. This improves garbage collection
performance and uses less memory.

Changed code generation for object and array literals in toplevel
code to be more compact by doing more work in the runtime.

Fixed a crash bug triggered when garbage collection happened during
generation of a callback load inline cache stub.

Fixed crash bug sometimes triggered when local variables shadowed
parameters in functions that used the arguments object.


2009-12-03: Version 2.0.3

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


2009-11-18: Version 2.0.0

Added support for VFP on ARM.
Expand Down Expand Up @@ -112,7 +80,7 @@


2009-10-16: Version 1.3.16

X64: Convert smis to holding 32 bits of payload.

Introduce v8::Integer::NewFromUnsigned method.
Expand Down Expand Up @@ -257,7 +225,7 @@
notifications when V8 has not yet been initialized.

Fixed ARM simulator compilation problem on Windows.


2009-08-25: Version 1.3.7

Expand Down Expand Up @@ -372,9 +340,9 @@
function is a built-in.

Initial implementation of constructor heap profile for JS objects.

More fine grained control of profiling aspects through the API.

Optimized the called as constructor check for API calls.


Expand All @@ -399,8 +367,8 @@
Added an external allocation limit to avoid issues where small V8
objects would hold on to large amounts of external memory without
causing garbage collections.

Finished more of the inline caching stubs for x64 targets.
Finished more of the inline caching stubs for x64 targets.


2009-07-13: Version 1.2.14
Expand Down Expand Up @@ -480,9 +448,9 @@
Fixed a bug in the string type inference.

Fixed a bug in the handling of 'constant function' properties.

Improved overall performance.


2009-06-16: Version 1.2.8

Expand Down
19 changes: 0 additions & 19 deletions deps/v8/SConstruct
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ LIBRARY_FLAGS = {
},
'os:macos': {
'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'],
'library:shared': {
'CPPDEFINES': ['V8_SHARED']
}
},
'os:freebsd': {
'CPPPATH' : ['/usr/local/include'],
Expand Down Expand Up @@ -181,12 +178,6 @@ LIBRARY_FLAGS = {
'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32']
},
'armvariant:thumb2': {
'CPPDEFINES': ['V8_ARM_VARIANT_THUMB']
},
'armvariant:arm': {
'CPPDEFINES': ['V8_ARM_VARIANT_ARM']
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
'CCFLAGS': ['-m64'],
Expand Down Expand Up @@ -252,7 +243,6 @@ V8_EXTRA_FLAGS = {
'gcc': {
'all': {
'WARNINGFLAGS': ['-Wall',
'-Werror',
'-W',
'-Wno-unused-parameter',
'-Wnon-virtual-dtor']
Expand Down Expand Up @@ -665,11 +655,6 @@ SIMPLE_OPTIONS = {
'values': ['default', 'hidden'],
'default': 'hidden',
'help': 'shared library symbol visibility'
},
'armvariant': {
'values': ['arm', 'thumb2', 'none'],
'default': 'none',
'help': 'generate thumb2 instructions instead of arm instructions (default)'
}
}

Expand Down Expand Up @@ -853,10 +838,6 @@ def PostprocessOptions(options):
# Print a warning if profiling is enabled without profiling support
print "Warning: forcing profilingsupport on when prof is on"
options['profilingsupport'] = 'on'
if (options['armvariant'] == 'none' and options['arch'] == 'arm'):
options['armvariant'] = 'arm'
if (options['armvariant'] != 'none' and options['arch'] != 'arm'):
options['armvariant'] = 'none'


def ParseEnvOverrides(arg, imports):
Expand Down
26 changes: 10 additions & 16 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -833,26 +833,13 @@ class V8EXPORT String : public Primitive {
* Returns true if the string is both external and ascii
*/
bool IsExternalAscii() const;

class V8EXPORT ExternalStringResourceBase {
public:
virtual ~ExternalStringResourceBase() {}
protected:
ExternalStringResourceBase() {}
private:
// Disallow copying and assigning.
ExternalStringResourceBase(const ExternalStringResourceBase&);
void operator=(const ExternalStringResourceBase&);
};

/**
* An ExternalStringResource is a wrapper around a two-byte string
* buffer that resides outside V8's heap. Implement an
* ExternalStringResource to manage the life cycle of the underlying
* buffer. Note that the string data must be immutable.
*/
class V8EXPORT ExternalStringResource
: public ExternalStringResourceBase {
class V8EXPORT ExternalStringResource { // NOLINT
public:
/**
* Override the destructor to manage the life cycle of the underlying
Expand All @@ -865,6 +852,10 @@ class V8EXPORT String : public Primitive {
virtual size_t length() const = 0;
protected:
ExternalStringResource() {}
private:
// Disallow copying and assigning.
ExternalStringResource(const ExternalStringResource&);
void operator=(const ExternalStringResource&);
};

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

class V8EXPORT ExternalAsciiStringResource
: public ExternalStringResourceBase {
class V8EXPORT ExternalAsciiStringResource { // NOLINT
public:
/**
* Override the destructor to manage the life cycle of the underlying
Expand All @@ -892,6 +882,10 @@ class V8EXPORT String : public Primitive {
virtual size_t length() const = 0;
protected:
ExternalAsciiStringResource() {}
private:
// Disallow copying and assigning.
ExternalAsciiStringResource(const ExternalAsciiStringResource&);
void operator=(const ExternalAsciiStringResource&);
};

/**
Expand Down
7 changes: 1 addition & 6 deletions deps/v8/src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ SOURCES = {
zone.cc
"""),
'arch:arm': Split("""
arm/assembler-arm.cc
arm/builtins-arm.cc
arm/codegen-arm.cc
arm/constants-arm.cc
Expand All @@ -122,12 +123,6 @@ SOURCES = {
arm/stub-cache-arm.cc
arm/virtual-frame-arm.cc
"""),
'armvariant:arm': Split("""
arm/assembler-arm.cc
"""),
'armvariant:thumb2': Split("""
arm/assembler-thumb2.cc
"""),
'arch:ia32': Split("""
ia32/assembler-ia32.cc
ia32/builtins-ia32.cc
Expand Down
94 changes: 90 additions & 4 deletions deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3082,13 +3082,81 @@ i::Handle<i::String> NewExternalAsciiStringHandle(
}


static void DisposeExternalString(v8::Persistent<v8::Value> obj,
void* parameter) {
ENTER_V8;
i::ExternalTwoByteString* str =
i::ExternalTwoByteString::cast(*Utils::OpenHandle(*obj));

// External symbols are deleted when they are pruned out of the symbol
// table. Generally external symbols are not registered with the weak handle
// callbacks unless they are upgraded to a symbol after being externalized.
if (!str->IsSymbol()) {
v8::String::ExternalStringResource* resource =
reinterpret_cast<v8::String::ExternalStringResource*>(parameter);
if (resource != NULL) {
const int total_size =
static_cast<int>(resource->length() * sizeof(*resource->data()));
i::Counters::total_external_string_memory.Decrement(total_size);

// The object will continue to live in the JavaScript heap until the
// handle is entirely cleaned out by the next GC. For example the
// destructor for the resource below could bring it back to life again.
// Which is why we make sure to not have a dangling pointer here.
str->set_resource(NULL);
delete resource;
}
}

// In any case we do not need this handle any longer.
obj.Dispose();
}


static void DisposeExternalAsciiString(v8::Persistent<v8::Value> obj,
void* parameter) {
ENTER_V8;
i::ExternalAsciiString* str =
i::ExternalAsciiString::cast(*Utils::OpenHandle(*obj));

// External symbols are deleted when they are pruned out of the symbol
// table. Generally external symbols are not registered with the weak handle
// callbacks unless they are upgraded to a symbol after being externalized.
if (!str->IsSymbol()) {
v8::String::ExternalAsciiStringResource* resource =
reinterpret_cast<v8::String::ExternalAsciiStringResource*>(parameter);
if (resource != NULL) {
const int total_size =
static_cast<int>(resource->length() * sizeof(*resource->data()));
i::Counters::total_external_string_memory.Decrement(total_size);

// The object will continue to live in the JavaScript heap until the
// handle is entirely cleaned out by the next GC. For example the
// destructor for the resource below could bring it back to life again.
// Which is why we make sure to not have a dangling pointer here.
str->set_resource(NULL);
delete resource;
}
}

// In any case we do not need this handle any longer.
obj.Dispose();
}


Local<String> v8::String::NewExternal(
v8::String::ExternalStringResource* resource) {
EnsureInitialized("v8::String::NewExternal()");
LOG_API("String::NewExternal");
ENTER_V8;
const int total_size =
static_cast<int>(resource->length() * sizeof(*resource->data()));
i::Counters::total_external_string_memory.Increment(total_size);
i::Handle<i::String> result = NewExternalStringHandle(resource);
i::ExternalStringTable::AddString(*result);
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
i::GlobalHandles::MakeWeak(handle.location(),
resource,
&DisposeExternalString);
return Utils::ToLocal(result);
}

Expand All @@ -3100,7 +3168,13 @@ bool v8::String::MakeExternal(v8::String::ExternalStringResource* resource) {
i::Handle<i::String> obj = Utils::OpenHandle(this);
bool result = obj->MakeExternal(resource);
if (result && !obj->IsSymbol()) {
i::ExternalStringTable::AddString(*obj);
// Operation was successful and the string is not a symbol. In this case
// we need to make sure that the we call the destructor for the external
// resource when no strong references to the string remain.
i::Handle<i::Object> handle = i::GlobalHandles::Create(*obj);
i::GlobalHandles::MakeWeak(handle.location(),
resource,
&DisposeExternalString);
}
return result;
}
Expand All @@ -3111,8 +3185,14 @@ Local<String> v8::String::NewExternal(
EnsureInitialized("v8::String::NewExternal()");
LOG_API("String::NewExternal");
ENTER_V8;
const int total_size =
static_cast<int>(resource->length() * sizeof(*resource->data()));
i::Counters::total_external_string_memory.Increment(total_size);
i::Handle<i::String> result = NewExternalAsciiStringHandle(resource);
i::ExternalStringTable::AddString(*result);
i::Handle<i::Object> handle = i::GlobalHandles::Create(*result);
i::GlobalHandles::MakeWeak(handle.location(),
resource,
&DisposeExternalAsciiString);
return Utils::ToLocal(result);
}

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

0 comments on commit a98afdf

Please sign in to comment.