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

Commit

Permalink
Browse files Browse the repository at this point in the history
Upgrade V8 to 3.9.5
  • Loading branch information
isaacs committed Feb 13, 2012
1 parent 09ccbef commit 68a0c56
Show file tree
Hide file tree
Showing 112 changed files with 3,880 additions and 2,281 deletions.
24 changes: 24 additions & 0 deletions deps/v8/ChangeLog
@@ -1,3 +1,27 @@
2012-02-09: Version 3.9.5

Removed unused command line flags.

Performance and stability improvements on all platforms.


2012-02-08: Version 3.9.4

Properly initialize element-transitioning array literals on ARM.
(issue 1930)

Bug fixes on all platforms.


2012-02-07: Version 3.9.3

When rethrowing an exception, print the stack trace of its original
site instead of rethrow site (Chromium issue 60240).

Increased size of small stacks from 32k to 64k to avoid hitting limits
in Chromium (Chromium issue 112843).


2012-02-06: Version 3.9.2

Add timestamp to --trace-gc output. (issue 1932)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/SConstruct
Expand Up @@ -128,7 +128,7 @@ LIBRARY_FLAGS = {
'CPPDEFINES': ['__C99FEATURES__'],
'CPPPATH' : [src_dir, '/usr/local/include'],
'LIBPATH' : ['/usr/local/lib'],
'CCFLAGS': ['-ansi', '-fno-omit-frame-pointer'],
'CCFLAGS': ['-ansi'],
},
'os:netbsd': {
'CPPPATH' : [src_dir, '/usr/pkg/include'],
Expand Down
26 changes: 26 additions & 0 deletions deps/v8/build/common.gypi
Expand Up @@ -169,6 +169,28 @@
'V8_TARGET_ARCH_MIPS',
],
'conditions': [
[ 'target_arch=="mips"', {
'target_conditions': [
['_toolset=="target"', {
'cflags': ['-EL'],
'ldflags': ['-EL'],
'conditions': [
[ 'v8_use_mips_abi_hardfloat=="true"', {
'cflags': ['-mhard-float'],
'ldflags': ['-mhard-float'],
}, {
'cflags': ['-msoft-float'],
'ldflags': ['-msoft-float'],
}],
['mips_arch_variant=="mips32r2"', {
'cflags': ['-mips32r2', '-Wa,-mips32r2'],
}, {
'cflags': ['-mips32', '-Wa,-mips32'],
}],
],
}],
],
}],
[ 'v8_can_use_fpu_instructions=="true"', {
'defines': [
'CAN_USE_FPU_INSTRUCTIONS',
Expand All @@ -184,6 +206,9 @@
'__mips_soft_float=1'
],
}],
['mips_arch_variant=="mips32r2"', {
'defines': ['_MIPS_ARCH_MIPS32R2',],
}],
# The MIPS assembler assumes the host is 32 bits,
# so force building 32-bit host tools.
['host_arch=="x64"', {
Expand Down Expand Up @@ -327,6 +352,7 @@
}], # OS=="mac"
['OS=="win"', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)',
'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
'CharacterSet': '1',
},
Expand Down
1 change: 1 addition & 0 deletions deps/v8/build/mipsu.gypi
Expand Up @@ -29,5 +29,6 @@
'variables': {
'target_arch': 'ia32',
'v8_target_arch': 'mips',
'mips_arch_variant': 'mips32r2',
},
}
4 changes: 3 additions & 1 deletion deps/v8/include/v8-profiler.h
Expand Up @@ -255,7 +255,9 @@ class V8EXPORT HeapGraphNode {
kClosure = 5, // Function closure.
kRegExp = 6, // RegExp.
kHeapNumber = 7, // Number stored in the heap.
kNative = 8 // Native object (not from V8 heap).
kNative = 8, // Native object (not from V8 heap).
kSynthetic = 9 // Synthetic object, usualy used for grouping
// snapshot items together.
};

/** Returns node type (see HeapGraphNode::Type). */
Expand Down
9 changes: 2 additions & 7 deletions deps/v8/src/api.cc
Expand Up @@ -6088,9 +6088,7 @@ static void SetFlagsFromString(const char* flags) {

void Testing::PrepareStressRun(int run) {
static const char* kLazyOptimizations =
"--prepare-always-opt --nolimit-inlining "
"--noalways-opt --noopt-eagerly";
static const char* kEagerOptimizations = "--opt-eagerly";
"--prepare-always-opt --nolimit-inlining --noalways-opt";
static const char* kForcedOptimizations = "--always-opt";

// If deoptimization stressed turn on frequent deoptimization. If no value
Expand All @@ -6107,15 +6105,12 @@ void Testing::PrepareStressRun(int run) {
if (run == GetStressRuns() - 1) {
SetFlagsFromString(kForcedOptimizations);
} else {
SetFlagsFromString(kEagerOptimizations);
SetFlagsFromString(kLazyOptimizations);
}
#else
if (run == GetStressRuns() - 1) {
SetFlagsFromString(kForcedOptimizations);
} else if (run == GetStressRuns() - 2) {
SetFlagsFromString(kEagerOptimizations);
} else {
} else if (run != GetStressRuns() - 2) {
SetFlagsFromString(kLazyOptimizations);
}
#endif
Expand Down
38 changes: 11 additions & 27 deletions deps/v8/src/arm/builtins-arm.cc
Expand Up @@ -895,23 +895,15 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
// r4: JSObject
__ bind(&allocated);
__ push(r4);
__ push(r4);

// Push the function and the allocated receiver from the stack.
// sp[0]: receiver (newly allocated object)
// sp[1]: constructor function
// sp[2]: number of arguments (smi-tagged)
__ ldr(r1, MemOperand(sp, kPointerSize));
__ push(r1); // Constructor function.
__ push(r4); // Receiver.

// Reload the number of arguments from the stack.
// r1: constructor function
// Reload the number of arguments and the constructor from the stack.
// sp[0]: receiver
// sp[1]: constructor function
// sp[2]: receiver
// sp[3]: constructor function
// sp[4]: number of arguments (smi-tagged)
__ ldr(r3, MemOperand(sp, 4 * kPointerSize));
// sp[1]: receiver
// sp[2]: constructor function
// sp[3]: number of arguments (smi-tagged)
__ ldr(r1, MemOperand(sp, 2 * kPointerSize));
__ ldr(r3, MemOperand(sp, 3 * kPointerSize));

// Set up pointer to last argument.
__ add(r2, fp, Operand(StandardFrameConstants::kCallerSPOffset));
Expand All @@ -921,14 +913,13 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,

// Copy arguments and receiver to the expression stack.
// r0: number of arguments
// r2: address of last argument (caller sp)
// r1: constructor function
// r2: address of last argument (caller sp)
// r3: number of arguments (smi-tagged)
// sp[0]: receiver
// sp[1]: constructor function
// sp[2]: receiver
// sp[3]: constructor function
// sp[4]: number of arguments (smi-tagged)
// sp[1]: receiver
// sp[2]: constructor function
// sp[3]: number of arguments (smi-tagged)
Label loop, entry;
__ b(&entry);
__ bind(&loop);
Expand All @@ -954,13 +945,6 @@ static void Generate_JSConstructStubHelper(MacroAssembler* masm,
NullCallWrapper(), CALL_AS_METHOD);
}

// Pop the function from the stack.
// sp[0]: constructor function
// sp[2]: receiver
// sp[3]: constructor function
// sp[4]: number of arguments (smi-tagged)
__ pop();

// Restore context from the frame.
// r0: result
// sp[0]: receiver
Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/arm/code-stubs-arm.cc
Expand Up @@ -3964,7 +3964,7 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// handler block in this code object, so its index is 0.
__ bind(&invoke);
// Must preserve r0-r4, r5-r7 are available.
__ PushTryHandler(IN_JS_ENTRY, JS_ENTRY_HANDLER, 0);
__ PushTryHandler(StackHandler::JS_ENTRY, 0);
// If an exception not caught by another handler occurs, this handler
// returns control to the code after the bl(&invoke) above, which
// restores all kCalleeSaved registers (including cp and fp) to their
Expand Down Expand Up @@ -7358,7 +7358,7 @@ void StoreArrayLiteralElementStub::Generate(MacroAssembler* masm) {
// Array literal has ElementsKind of FAST_DOUBLE_ELEMENTS.
__ bind(&double_elements);
__ ldr(r5, FieldMemOperand(r1, JSObject::kElementsOffset));
__ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r10,
__ StoreNumberToDoubleElements(r0, r3, r1, r5, r6, r7, r9, r2,
&slow_elements);
__ Ret();
}
Expand Down
35 changes: 26 additions & 9 deletions deps/v8/src/arm/full-codegen-arm.cc
@@ -1,4 +1,4 @@
// Copyright 2011 the V8 project authors. All rights reserved.
// Copyright 2012 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
Expand Down Expand Up @@ -139,6 +139,27 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
}
#endif

// We can optionally optimize based on counters rather than statistical
// sampling.
if (info->ShouldSelfOptimize()) {
if (FLAG_trace_opt) {
PrintF("[adding self-optimization header to %s]\n",
*info->function()->debug_name()->ToCString());
}
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
JSGlobalPropertyCell* cell;
if (maybe_cell->To(&cell)) {
__ mov(r2, Operand(Handle<JSGlobalPropertyCell>(cell)));
__ ldr(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
__ sub(r3, r3, Operand(Smi::FromInt(1)), SetCC);
__ str(r3, FieldMemOperand(r2, JSGlobalPropertyCell::kValueOffset));
Handle<Code> compile_stub(
isolate()->builtins()->builtin(Builtins::kLazyRecompile));
__ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
}
}

// Strict mode functions and builtins need to replace the receiver
// with undefined when called as functions (without an explicit
// receiver object). r5 is zero for method calls and non-zero for
Expand Down Expand Up @@ -265,11 +286,11 @@ void FullCodeGenerator::Generate(CompilationInfo* info) {
// For named function expressions, declare the function name as a
// constant.
if (scope()->is_function_scope() && scope()->function() != NULL) {
int ignored = 0;
VariableProxy* proxy = scope()->function();
ASSERT(proxy->var()->mode() == CONST ||
proxy->var()->mode() == CONST_HARMONY);
EmitDeclaration(proxy, proxy->var()->mode(), NULL, &ignored);
ASSERT(proxy->var()->location() != Variable::UNALLOCATED);
EmitDeclaration(proxy, proxy->var()->mode(), NULL);
}
VisitDeclarations(scope()->declarations());
}
Expand Down Expand Up @@ -706,8 +727,7 @@ void FullCodeGenerator::PrepareForBailoutBeforeSplit(Expression* expr,

void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy,
VariableMode mode,
FunctionLiteral* function,
int* global_count) {
FunctionLiteral* function) {
// If it was not possible to allocate the variable at compile time, we
// need to "declare" it at runtime to make sure it actually exists in the
// local context.
Expand All @@ -716,7 +736,7 @@ void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy,
(mode == CONST || mode == CONST_HARMONY || mode == LET);
switch (variable->location()) {
case Variable::UNALLOCATED:
++(*global_count);
++global_count_;
break;

case Variable::PARAMETER:
Expand Down Expand Up @@ -801,9 +821,6 @@ void FullCodeGenerator::EmitDeclaration(VariableProxy* proxy,
}


void FullCodeGenerator::VisitDeclaration(Declaration* decl) { }


void FullCodeGenerator::DeclareGlobals(Handle<FixedArray> pairs) {
// Call the runtime to declare the globals.
// The context is the first argument.
Expand Down
1 change: 0 additions & 1 deletion deps/v8/src/arm/lithium-codegen-arm.cc
Expand Up @@ -673,7 +673,6 @@ void LCodeGen::DeoptimizeIf(Condition cc, LEnvironment* environment) {
void LCodeGen::PopulateDeoptimizationData(Handle<Code> code) {
int length = deoptimizations_.length();
if (length == 0) return;
ASSERT(FLAG_deopt);
Handle<DeoptimizationInputData> data =
factory()->NewDeoptimizationInputData(length, TENURED);

Expand Down
25 changes: 8 additions & 17 deletions deps/v8/src/arm/macro-assembler-arm.cc
Expand Up @@ -1188,8 +1188,7 @@ void MacroAssembler::DebugBreak() {
#endif


void MacroAssembler::PushTryHandler(CodeLocation try_location,
HandlerType type,
void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
int handler_index) {
// Adjust this code if not the case.
STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
Expand All @@ -1201,28 +1200,20 @@ void MacroAssembler::PushTryHandler(CodeLocation try_location,

// For the JSEntry handler, we must preserve r0-r4, r5-r7 are available.
// We will build up the handler from the bottom by pushing on the stack.
// First compute the state.
unsigned state = StackHandler::OffsetField::encode(handler_index);
if (try_location == IN_JAVASCRIPT) {
state |= (type == TRY_CATCH_HANDLER)
? StackHandler::KindField::encode(StackHandler::TRY_CATCH)
: StackHandler::KindField::encode(StackHandler::TRY_FINALLY);
} else {
ASSERT(try_location == IN_JS_ENTRY);
state |= StackHandler::KindField::encode(StackHandler::ENTRY);
}

// Set up the code object (r5) and the state (r6) for pushing.
unsigned state =
StackHandler::IndexField::encode(handler_index) |
StackHandler::KindField::encode(kind);
mov(r5, Operand(CodeObject()));
mov(r6, Operand(state));

// Push the frame pointer, context, state, and code object.
if (try_location == IN_JAVASCRIPT) {
stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | fp.bit());
} else {
if (kind == StackHandler::JS_ENTRY) {
mov(r7, Operand(Smi::FromInt(0))); // Indicates no context.
mov(ip, Operand(0, RelocInfo::NONE)); // NULL frame pointer.
stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | ip.bit());
} else {
stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | fp.bit());
}

// Link the current handler as the next handler.
Expand Down Expand Up @@ -1330,7 +1321,7 @@ void MacroAssembler::ThrowUncatchable(UncatchableExceptionType type,
ldr(sp, MemOperand(sp, StackHandlerConstants::kNextOffset));

bind(&check_kind);
STATIC_ASSERT(StackHandler::ENTRY == 0);
STATIC_ASSERT(StackHandler::JS_ENTRY == 0);
ldr(r2, MemOperand(sp, StackHandlerConstants::kStateOffset));
tst(r2, Operand(StackHandler::KindField::kMask));
b(ne, &fetch_next);
Expand Down
7 changes: 3 additions & 4 deletions deps/v8/src/arm/macro-assembler-arm.h
Expand Up @@ -582,9 +582,7 @@ class MacroAssembler: public Assembler {
// Exception handling

// Push a new try handler and link into try handler chain.
void PushTryHandler(CodeLocation try_location,
HandlerType type,
int handler_index);
void PushTryHandler(StackHandler::Kind kind, int handler_index);

// Unlink the stack handler on top of the stack from the try handler chain.
// Must preserve the result register.
Expand Down Expand Up @@ -803,7 +801,8 @@ class MacroAssembler: public Assembler {

// Check to see if maybe_number can be stored as a double in
// FastDoubleElements. If it can, store it at the index specified by key in
// the FastDoubleElements array elements, otherwise jump to fail.
// the FastDoubleElements array elements. Otherwise jump to fail, in which
// case scratch2, scratch3 and scratch4 are unmodified.
void StoreNumberToDoubleElements(Register value_reg,
Register key_reg,
Register receiver_reg,
Expand Down

0 comments on commit 68a0c56

Please sign in to comment.