Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Upgrade V8 to 3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Feb 6, 2012
1 parent 23514fc commit 8be6994
Show file tree
Hide file tree
Showing 130 changed files with 4,435 additions and 1,705 deletions.
1 change: 1 addition & 0 deletions deps/v8/AUTHORS
Expand Up @@ -8,6 +8,7 @@ Sigma Designs Inc.
ARM Ltd.
Hewlett-Packard Development Company, LP
Igalia, S.L.
Joyent, Inc.

Akinori MUSHA <knu@FreeBSD.org>
Alexander Botero-Lowry <alexbl@FreeBSD.org>
Expand Down
29 changes: 29 additions & 0 deletions deps/v8/ChangeLog
@@ -1,3 +1,32 @@
2012-02-06: Version 3.9.2

Add timestamp to --trace-gc output. (issue 1932)

Heap profiler reports implicit references.

Optionally export metadata with libv8 to enable debuggers to inspect V8
state.


2012-02-02: Version 3.9.1

Fixed memory leak in NativeObjectsExplorer::FindOrAddGroupInfo
(Chromium issue 112315).

Fixed a crash in dev tools (Chromium issue 107996).

Added 'dependencies_traverse': 1 to v8 GYP target.

Performance and stability improvements on all platforms.


2012-02-01: Version 3.9.0

Reduce memory use immediately after starting V8.

Stability fixes and performance improvements on all platforms.


2012-01-26: Version 3.8.9

Flush number string cache on GC (issue 1605).
Expand Down
6 changes: 6 additions & 0 deletions deps/v8/build/common.gypi
Expand Up @@ -85,6 +85,11 @@
'v8_use_liveobjectlist%': 'false',
'werror%': '-Werror',

# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
'v8_postmortem_support%': 'false',

# For a shared library build, results in "libv8-<(soname_version).so".
'soname_version%': '',
},
Expand Down Expand Up @@ -322,6 +327,7 @@
}], # OS=="mac"
['OS=="win"', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
Expand Down
13 changes: 12 additions & 1 deletion deps/v8/include/v8-profiler.h
Expand Up @@ -476,11 +476,22 @@ class V8EXPORT RetainedObjectInfo { // NOLINT
virtual intptr_t GetHash() = 0;

/**
* Returns human-readable label. It must be a NUL-terminated UTF-8
* Returns human-readable label. It must be a null-terminated UTF-8
* encoded string. V8 copies its contents during a call to GetLabel.
*/
virtual const char* GetLabel() = 0;

/**
* Returns human-readable group label. It must be a null-terminated UTF-8
* encoded string. V8 copies its contents during a call to GetGroupLabel.
* Heap snapshot generator will collect all the group names, create
* top level entries with these names and attach the objects to the
* corresponding top level group objects. There is a default
* implementation which is required because embedders don't have their
* own implementation yet.
*/
virtual const char* GetGroupLabel() { return GetLabel(); }

/**
* Returns element count in case if a global handle retains
* a subgraph by holding one of its nodes.
Expand Down
6 changes: 6 additions & 0 deletions deps/v8/include/v8.h
Expand Up @@ -3538,6 +3538,12 @@ class V8EXPORT Context {
*/
void AllowCodeGenerationFromStrings(bool allow);

/**
* Returns true if code generation from strings is allowed for the context.
* For more details see AllowCodeGenerationFromStrings(bool) documentation.
*/
bool IsCodeGenerationFromStringsAllowed();

/**
* Stack-allocated class which sets the execution context for all
* operations executed within a local scope.
Expand Down
10 changes: 0 additions & 10 deletions deps/v8/src/accessors.cc
Expand Up @@ -487,16 +487,6 @@ MaybeObject* Accessors::FunctionSetPrototype(JSObject* object,
NONE);
}

if (function->has_initial_map()) {
// If the function has allocated the initial map
// replace it with a copy containing the new prototype.
Object* new_map;
{ MaybeObject* maybe_new_map =
function->initial_map()->CopyDropTransitions();
if (!maybe_new_map->ToObject(&new_map)) return maybe_new_map;
}
function->set_initial_map(Map::cast(new_map));
}
Object* prototype;
{ MaybeObject* maybe_prototype = function->SetPrototype(value);
if (!maybe_prototype->ToObject(&prototype)) return maybe_prototype;
Expand Down
16 changes: 15 additions & 1 deletion deps/v8/src/api.cc
Expand Up @@ -4077,7 +4077,7 @@ bool v8::V8::IdleNotification(int hint) {
void v8::V8::LowMemoryNotification() {
i::Isolate* isolate = i::Isolate::Current();
if (isolate == NULL || !isolate->IsInitialized()) return;
isolate->heap()->CollectAllAvailableGarbage();
isolate->heap()->CollectAllAvailableGarbage("low memory notification");
}


Expand Down Expand Up @@ -4313,6 +4313,20 @@ void Context::AllowCodeGenerationFromStrings(bool allow) {
}


bool Context::IsCodeGenerationFromStringsAllowed() {
i::Isolate* isolate = i::Isolate::Current();
if (IsDeadCheck(isolate,
"v8::Context::IsCodeGenerationFromStringsAllowed()")) {
return false;
}
ENTER_V8(isolate);
i::Object** ctx = reinterpret_cast<i::Object**>(this);
i::Handle<i::Context> context =
i::Handle<i::Context>::cast(i::Handle<i::Object>(ctx));
return !context->allow_code_gen_from_strings()->IsFalse();
}


void V8::SetWrapperClassId(i::Object** global_handle, uint16_t class_id) {
i::GlobalHandles::SetWrapperClassId(global_handle, class_id);
}
Expand Down
53 changes: 8 additions & 45 deletions deps/v8/src/arm/builtins-arm.cc
Expand Up @@ -114,9 +114,7 @@ static void AllocateEmptyJSArray(MacroAssembler* masm,
Label* gc_required) {
const int initial_capacity = JSArray::kPreallocatedArrayElements;
STATIC_ASSERT(initial_capacity >= 0);
// Load the initial map from the array function.
__ ldr(scratch1, FieldMemOperand(array_function,
JSFunction::kPrototypeOrInitialMapOffset));
__ LoadInitialArrayMap(array_function, scratch2, scratch1);

// Allocate the JSArray object together with space for a fixed array with the
// requested elements.
Expand Down Expand Up @@ -210,9 +208,7 @@ static void AllocateJSArray(MacroAssembler* masm,
bool fill_with_hole,
Label* gc_required) {
// Load the initial map from the array function.
__ ldr(elements_array_storage,
FieldMemOperand(array_function,
JSFunction::kPrototypeOrInitialMapOffset));
__ LoadInitialArrayMap(array_function, scratch2, elements_array_storage);

if (FLAG_debug_code) { // Assert that array size is not zero.
__ tst(array_size, array_size);
Expand Down Expand Up @@ -667,50 +663,16 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
}


void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool count_constructions) {
// ----------- S t a t e -------------
// -- r0 : number of arguments
// -- r1 : constructor function
// -- lr : return address
// -- sp[...]: constructor arguments
// -----------------------------------

Label slow, non_function_call;
// Check that the function is not a smi.
__ JumpIfSmi(r1, &non_function_call);
// Check that the function is a JSFunction.
__ CompareObjectType(r1, r2, r2, JS_FUNCTION_TYPE);
__ b(ne, &slow);

// Jump to the function-specific construct stub.
__ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
__ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kConstructStubOffset));
__ add(pc, r2, Operand(Code::kHeaderSize - kHeapObjectTag));

// r0: number of arguments
// r1: called object
// r2: object type
Label do_call;
__ bind(&slow);
__ cmp(r2, Operand(JS_FUNCTION_PROXY_TYPE));
__ b(ne, &non_function_call);
__ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR);
__ jmp(&do_call);

__ bind(&non_function_call);
__ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
__ bind(&do_call);
// Set expected number of arguments to zero (not changing r0).
__ mov(r2, Operand(0, RelocInfo::NONE));
__ SetCallKind(r5, CALL_AS_METHOD);
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
RelocInfo::CODE_TARGET);
}


static void Generate_JSConstructStubHelper(MacroAssembler* masm,
bool is_api_function,
bool count_constructions) {
// Should never count constructions for api objects.
ASSERT(!is_api_function || !count_constructions);

Expand Down Expand Up @@ -1117,7 +1079,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
// Invoke the code and pass argc as r0.
__ mov(r0, Operand(r3));
if (is_construct) {
__ Call(masm->isolate()->builtins()->JSConstructCall());
CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
__ CallStub(&stub);
} else {
ParameterCount actual(r0);
__ InvokeFunction(r1, actual, CALL_FUNCTION,
Expand Down Expand Up @@ -1297,7 +1260,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
// 1. Make sure we have at least one argument.
// r0: actual number of arguments
{ Label done;
__ tst(r0, Operand(r0));
__ cmp(r0, Operand(0));
__ b(ne, &done);
__ LoadRoot(r2, Heap::kUndefinedValueRootIndex);
__ push(r2);
Expand Down

0 comments on commit 8be6994

Please sign in to comment.