Skip to content

Commit

Permalink
Revert "Upgrade V8 to 3.7.1"
Browse files Browse the repository at this point in the history
This reverts commit 92f5a5d.

V8 3.7.1 in debug mode on ia32 has a curious race-like bug where an fs.Stats
object is not fully formed until some time after it's created. This is easy
to demonstrate by running `make test-debug`.

V8 3.7.0 does not exhibit this behaviour so back we go.

Fixes nodejs#1981.
  • Loading branch information
bnoordhuis committed Nov 2, 2011
1 parent cc92234 commit edea412
Show file tree
Hide file tree
Showing 224 changed files with 6,958 additions and 13,984 deletions.
45 changes: 0 additions & 45 deletions deps/v8/ChangeLog
@@ -1,48 +1,3 @@
2011-10-26: Version 3.7.1

Achieved 33% speedup in debug-mode tests.

Removed special casing of calls to RegExp test and exec methods with no
argument. Now matches new JSC behaviour. crbug.com/75740.

Return the empty string on cyclic references in toString (ES5
conformance).

Fixed bug triggered by JSBeautifier. crbug.com/100409.

Made Math.random state per-context instead of per-process (issue 864).

Fixed stack traces to skip native functions.

Make snapshots (new contexts) smaller and faster.

Fixed handling of Function.apply for non-array arguments.

Fixed evaluation order in defineProperties to match FireFox.

Fixed handling of non-object receivers for array builtins,
crbug.com/100702.

Multiple fixes to improve compliance with test262.

Fixed compatibility with older Android releases.

Fixed compilation with gcc-4.5.3.

Improved performance of WriteUtf8, issue 1665.

Made native syntax an early error in the preparser.

Fixed issues 793 and 893 relating to Function.prototype.bind.

Improved let, const, Set and Map support and other Harmony features
(behind the --harmony flag).

Changed evaluation order for > and <= to match ES5 instead of ES3.

Bug fixes and performance improvements on all platforms.


2011-10-13: Version 3.7.0

Fixed array handling for Object.defineOwnProperty (ES5 conformance).
Expand Down
35 changes: 23 additions & 12 deletions deps/v8/preparser/preparser-process.cc
Expand Up @@ -267,22 +267,34 @@ void CheckException(v8::PreParserData* data,


ExceptionExpectation ParseExpectation(int argc, const char* argv[]) {
// Parse ["throws" [<exn-type> [<start> [<end>]]]].
ExceptionExpectation expects;

// Parse exception expectations from (the remainder of) the command line.
int arg_index = 0;
while (argc > arg_index && strncmp("throws", argv[arg_index], 7)) {
arg_index++;
}
// Skip any flags.
while (argc > arg_index && IsFlag(argv[arg_index])) arg_index++;
if (argc > arg_index) {
if (strncmp("throws", argv[arg_index], 7)) {
// First argument after filename, if present, must be the verbatim
// "throws", marking that the preparsing should fail with an exception.
fail(NULL, "ERROR: Extra arguments not prefixed by \"throws\".\n");
}
expects.throws = true;
arg_index++;
if (argc > arg_index && !IsFlag(argv[arg_index])) {
expects.type = argv[arg_index];
do {
arg_index++;
if (argc > arg_index && !IsFlag(argv[arg_index])) {
expects.beg_pos = atoi(argv[arg_index]); // NOLINT
} while (argc > arg_index && IsFlag(argv[arg_index]));
if (argc > arg_index) {
// Next argument is the exception type identifier.
expects.type = argv[arg_index];
do {
arg_index++;
if (argc > arg_index && !IsFlag(argv[arg_index])) {
} while (argc > arg_index && IsFlag(argv[arg_index]));
if (argc > arg_index) {
expects.beg_pos = atoi(argv[arg_index]); // NOLINT
do {
arg_index++;
} while (argc > arg_index && IsFlag(argv[arg_index]));
if (argc > arg_index) {
expects.end_pos = atoi(argv[arg_index]); // NOLINT
}
}
Expand All @@ -296,8 +308,7 @@ int main(int argc, const char* argv[]) {
// Parse command line.
// Format: preparser (<scriptfile> | -e "<source>")
// ["throws" [<exn-type> [<start> [<end>]]]]
// Any flags (except an initial -e) are ignored.
// Flags must not separate "throws" and its arguments.
// Any flags (except an initial -s) are ignored.

// Check for mandatory filename argument.
int arg_index = 1;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/SConscript
Expand Up @@ -321,7 +321,7 @@ debug-debugger.js

EXPERIMENTAL_LIBRARY_FILES = '''
proxy.js
collection.js
weakmap.js
'''.split()


Expand Down
11 changes: 2 additions & 9 deletions deps/v8/src/accessors.cc
Expand Up @@ -527,9 +527,7 @@ MaybeObject* Accessors::FunctionGetLength(Object* object, void*) {
// correctly yet. Compile it now and return the right length.
HandleScope scope;
Handle<JSFunction> handle(function);
if (!JSFunction::CompileLazy(handle, KEEP_EXCEPTION)) {
return Failure::Exception();
}
if (!CompileLazy(handle, KEEP_EXCEPTION)) return Failure::Exception();
return Smi::FromInt(handle->shared()->length());
} else {
return Smi::FromInt(function->shared()->length());
Expand Down Expand Up @@ -761,12 +759,7 @@ MaybeObject* Accessors::FunctionGetCaller(Object* object, void*) {
caller = potential_caller;
potential_caller = it.next();
}
// If caller is bound, return null. This is compatible with JSC, and
// allows us to make bound functions use the strict function map
// and its associated throwing caller and arguments.
if (caller->shared()->bound()) {
return isolate->heap()->null_value();
}

return CheckNonStrictCallerOrThrow(isolate, caller);
}

Expand Down
57 changes: 11 additions & 46 deletions deps/v8/src/api.cc
Expand Up @@ -2794,7 +2794,7 @@ Local<Value> v8::Object::Get(uint32_t index) {
ENTER_V8(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
EXCEPTION_PREAMBLE(isolate);
i::Handle<i::Object> result = i::Object::GetElement(self, index);
i::Handle<i::Object> result = i::GetElement(self, index);
has_pending_exception = result.is_null();
EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
return Utils::ToLocal(result);
Expand Down Expand Up @@ -2874,10 +2874,8 @@ Local<Array> v8::Object::GetPropertyNames() {
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
bool threw = false;
i::Handle<i::FixedArray> value =
i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS, &threw);
if (threw) return Local<v8::Array>();
i::GetKeysInFixedArrayFor(self, i::INCLUDE_PROTOS);
// Because we use caching to speed up enumeration it is important
// to never change the result of the basic enumeration function so
// we clone the result.
Expand All @@ -2895,10 +2893,8 @@ Local<Array> v8::Object::GetOwnPropertyNames() {
ENTER_V8(isolate);
i::HandleScope scope(isolate);
i::Handle<i::JSObject> self = Utils::OpenHandle(this);
bool threw = false;
i::Handle<i::FixedArray> value =
i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY, &threw);
if (threw) return Local<v8::Array>();
i::GetKeysInFixedArrayFor(self, i::LOCAL_ONLY);
// Because we use caching to speed up enumeration it is important
// to never change the result of the basic enumeration function so
// we clone the result.
Expand Down Expand Up @@ -3097,10 +3093,7 @@ static Local<Value> GetPropertyByLookup(i::Isolate* isolate,
// If the property being looked up is a callback, it can throw
// an exception.
EXCEPTION_PREAMBLE(isolate);
PropertyAttributes ignored;
i::Handle<i::Object> result =
i::Object::GetProperty(receiver, receiver, lookup, name,
&ignored);
i::Handle<i::Object> result = i::GetProperty(receiver, name, lookup);
has_pending_exception = result.is_null();
EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());

Expand All @@ -3117,7 +3110,7 @@ Local<Value> v8::Object::GetRealNamedPropertyInPrototypeChain(
ENTER_V8(isolate);
i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
i::LookupResult lookup(isolate);
i::LookupResult lookup;
self_obj->LookupRealNamedPropertyInPrototypes(*key_obj, &lookup);
return GetPropertyByLookup(isolate, self_obj, key_obj, &lookup);
}
Expand All @@ -3130,7 +3123,7 @@ Local<Value> v8::Object::GetRealNamedProperty(Handle<String> key) {
ENTER_V8(isolate);
i::Handle<i::JSObject> self_obj = Utils::OpenHandle(this);
i::Handle<i::String> key_obj = Utils::OpenHandle(*key);
i::LookupResult lookup(isolate);
i::LookupResult lookup;
self_obj->LookupRealNamedProperty(*key_obj, &lookup);
return GetPropertyByLookup(isolate, self_obj, key_obj, &lookup);
}
Expand Down Expand Up @@ -3641,30 +3634,13 @@ int String::WriteUtf8(char* buffer,
if (IsDeadCheck(isolate, "v8::String::WriteUtf8()")) return 0;
LOG_API(isolate, "String::WriteUtf8");
ENTER_V8(isolate);
i::Handle<i::String> str = Utils::OpenHandle(this);
if (str->IsAsciiRepresentation()) {
int len;
if (capacity == -1) {
capacity = str->length() + 1;
len = str->length();
} else {
len = i::Min(capacity, str->length());
}
i::String::WriteToFlat(*str, buffer, 0, len);
if (nchars_ref != NULL) *nchars_ref = len;
if (!(options & NO_NULL_TERMINATION) && capacity > len) {
buffer[len] = '\0';
return len + 1;
}
return len;
}

i::StringInputBuffer& write_input_buffer = *isolate->write_input_buffer();
i::Handle<i::String> str = Utils::OpenHandle(this);
isolate->string_tracker()->RecordWrite(str);
if (options & HINT_MANY_WRITES_EXPECTED) {
// Flatten the string for efficiency. This applies whether we are
// using StringInputBuffer or Get(i) to access the characters.
FlattenString(str);
str->TryFlatten();
}
write_input_buffer.Reset(0, *str);
int len = str->length();
Expand Down Expand Up @@ -3985,15 +3961,6 @@ HeapStatistics::HeapStatistics(): total_heap_size_(0),


void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
if (!i::Isolate::Current()->IsInitialized()) {
// Isolate is unitialized thus heap is not configured yet.
heap_statistics->set_total_heap_size(0);
heap_statistics->set_total_heap_size_executable(0);
heap_statistics->set_used_heap_size(0);
heap_statistics->set_heap_size_limit(0);
return;
}

i::Heap* heap = i::Isolate::Current()->heap();
heap_statistics->set_total_heap_size(heap->CommittedMemory());
heap_statistics->set_total_heap_size_executable(
Expand All @@ -4006,15 +3973,14 @@ void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
bool v8::V8::IdleNotification() {
// Returning true tells the caller that it need not
// continue to call IdleNotification.
i::Isolate* isolate = i::Isolate::Current();
if (isolate == NULL || !isolate->IsInitialized()) return true;
if (!i::Isolate::Current()->IsInitialized()) return true;
return i::V8::IdleNotification();
}


void v8::V8::LowMemoryNotification() {
i::Isolate* isolate = i::Isolate::Current();
if (isolate == NULL || !isolate->IsInitialized()) return;
if (!isolate->IsInitialized()) return;
isolate->heap()->CollectAllAvailableGarbage();
}

Expand Down Expand Up @@ -4109,9 +4075,8 @@ Persistent<Context> v8::Context::New(
}
// Leave V8.

if (env.is_null()) {
if (env.is_null())
return Persistent<Context>();
}
return Persistent<Context>(Utils::ToLocal(env));
}

Expand Down
15 changes: 6 additions & 9 deletions deps/v8/src/arm/assembler-arm-inl.h
Expand Up @@ -74,10 +74,10 @@ int RelocInfo::target_address_size() {
}


void RelocInfo::set_target_address(Address target, WriteBarrierMode mode) {
void RelocInfo::set_target_address(Address target) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY);
Assembler::set_target_address_at(pc_, target);
if (mode == UPDATE_WRITE_BARRIER && host() != NULL && IsCodeTarget(rmode_)) {
if (host() != NULL && IsCodeTarget(rmode_)) {
Object* target_code = Code::GetCodeFromTargetAddress(target);
host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(
host(), this, HeapObject::cast(target_code));
Expand All @@ -103,12 +103,10 @@ Object** RelocInfo::target_object_address() {
}


void RelocInfo::set_target_object(Object* target, WriteBarrierMode mode) {
void RelocInfo::set_target_object(Object* target) {
ASSERT(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT);
Assembler::set_target_address_at(pc_, reinterpret_cast<Address>(target));
if (mode == UPDATE_WRITE_BARRIER &&
host() != NULL &&
target->IsHeapObject()) {
if (host() != NULL && target->IsHeapObject()) {
host()->GetHeap()->incremental_marking()->RecordWrite(
host(), &Memory::Object_at(pc_), HeapObject::cast(target));
}
Expand Down Expand Up @@ -138,12 +136,11 @@ JSGlobalPropertyCell* RelocInfo::target_cell() {
}


void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell,
WriteBarrierMode mode) {
void RelocInfo::set_target_cell(JSGlobalPropertyCell* cell) {
ASSERT(rmode_ == RelocInfo::GLOBAL_PROPERTY_CELL);
Address address = cell->address() + JSGlobalPropertyCell::kValueOffset;
Memory::Address_at(pc_) = address;
if (mode == UPDATE_WRITE_BARRIER && host() != NULL) {
if (host() != NULL) {
// TODO(1550) We are passing NULL as a slot because cell can never be on
// evacuation candidate.
host()->GetHeap()->incremental_marking()->RecordWrite(
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/arm/assembler-arm.h
Expand Up @@ -304,9 +304,9 @@ const DwVfpRegister d14 = { 14 };
const DwVfpRegister d15 = { 15 };

// Aliases for double registers.
static const DwVfpRegister& kFirstCalleeSavedDoubleReg = d8;
static const DwVfpRegister& kLastCalleeSavedDoubleReg = d15;
static const DwVfpRegister& kDoubleRegZero = d14;
const DwVfpRegister kFirstCalleeSavedDoubleReg = d8;
const DwVfpRegister kLastCalleeSavedDoubleReg = d15;
const DwVfpRegister kDoubleRegZero = d14;


// Coprocessor register
Expand Down

0 comments on commit edea412

Please sign in to comment.