Browse Source

Upgrade V8 to 3.1.0

v0.7.4-release
Ryan Dahl 14 years ago
parent
commit
0634e3a8bc
  1. 4
      deps/v8/ChangeLog
  2. 2
      deps/v8/SConstruct
  3. 17
      deps/v8/include/v8.h
  4. 8
      deps/v8/src/arm/assembler-arm.cc
  5. 3
      deps/v8/src/arm/assembler-arm.h
  6. 20
      deps/v8/src/arm/code-stubs-arm.cc
  7. 3
      deps/v8/src/arm/disasm-arm.cc
  8. 8
      deps/v8/src/arm/full-codegen-arm.cc
  9. 66
      deps/v8/src/arm/lithium-codegen-arm.cc
  10. 18
      deps/v8/src/arm/macro-assembler-arm.cc
  11. 3
      deps/v8/src/arm/macro-assembler-arm.h
  12. 5
      deps/v8/src/arm/simulator-arm.cc
  13. 14
      deps/v8/src/code-stubs.h
  14. 4
      deps/v8/src/date.js
  15. 23
      deps/v8/src/extensions/experimental/i18n-extension.cc
  16. 22
      deps/v8/src/ia32/code-stubs-ia32.cc
  17. 8
      deps/v8/src/ia32/full-codegen-ia32.cc
  18. 6
      deps/v8/src/json.js
  19. 52
      deps/v8/src/messages.js
  20. 40
      deps/v8/src/mirror-debugger.js
  21. 2
      deps/v8/src/regexp.js
  22. 44
      deps/v8/src/runtime.cc
  23. 6
      deps/v8/src/version.cc
  24. 22
      deps/v8/src/x64/code-stubs-x64.cc
  25. 8
      deps/v8/src/x64/full-codegen-x64.cc
  26. 30
      deps/v8/test/cctest/test-api.cc
  27. 15
      deps/v8/test/cctest/test-assembler-arm.cc
  28. 5
      deps/v8/test/cctest/test-disasm-arm.cc
  29. 6
      deps/v8/test/mjsunit/debug-backtrace-text.js

4
deps/v8/ChangeLog

@ -1,3 +1,7 @@
2011-01=31: Version 3.1.0
Performance improvements on all platforms.
2011-01-28: Version 3.0.12 2011-01-28: Version 3.0.12
Added support for strict mode parameter and object property Added support for strict mode parameter and object property

2
deps/v8/SConstruct

@ -136,7 +136,7 @@ LIBRARY_FLAGS = {
'gcc': { 'gcc': {
'all': { 'all': {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions', '-fno-builtin-memcpy'], 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'],
}, },
'visibility:hidden': { 'visibility:hidden': {
# Use visibility=default to disable this. # Use visibility=default to disable this.

17
deps/v8/include/v8.h

@ -3053,7 +3053,22 @@ class V8EXPORT ExtensionConfiguration {
*/ */
class V8EXPORT Context { class V8EXPORT Context {
public: public:
/** Returns the global object of the context. */ /**
* Returns the global proxy object or global object itself for
* detached contexts.
*
* Global proxy object is a thin wrapper whose prototype points to
* actual context's global object with the properties like Object, etc.
* This is done that way for security reasons (for more details see
* https://wiki.mozilla.org/Gecko:SplitWindow).
*
* Please note that changes to global proxy object prototype most probably
* would break VM---v8 expects only global object as a prototype of
* global proxy object.
*
* If DetachGlobal() has been invoked, Global() would return actual global
* object until global is reattached with ReattachGlobal().
*/
Local<Object> Global(); Local<Object> Global();
/** /**

8
deps/v8/src/arm/assembler-arm.cc

@ -2228,6 +2228,14 @@ void Assembler::vcvt_f32_f64(const SwVfpRegister dst,
} }
void Assembler::vabs(const DwVfpRegister dst,
const DwVfpRegister src,
const Condition cond) {
emit(cond | 0xE*B24 | 0xB*B20 | dst.code()*B12 |
0x5*B9 | B8 | 0x3*B6 | src.code());
}
void Assembler::vadd(const DwVfpRegister dst, void Assembler::vadd(const DwVfpRegister dst,
const DwVfpRegister src1, const DwVfpRegister src1,
const DwVfpRegister src2, const DwVfpRegister src2,

3
deps/v8/src/arm/assembler-arm.h

@ -975,6 +975,9 @@ class Assembler : public Malloced {
ConversionMode mode = RoundToZero, ConversionMode mode = RoundToZero,
const Condition cond = al); const Condition cond = al);
void vabs(const DwVfpRegister dst,
const DwVfpRegister src,
const Condition cond = al);
void vadd(const DwVfpRegister dst, void vadd(const DwVfpRegister dst,
const DwVfpRegister src1, const DwVfpRegister src1,
const DwVfpRegister src2, const DwVfpRegister src2,

20
deps/v8/src/arm/code-stubs-arm.cc

@ -55,6 +55,26 @@ static void EmitStrictTwoHeapObjectCompare(MacroAssembler* masm,
Register rhs); Register rhs);
void ToNumberStub::Generate(MacroAssembler* masm) {
// The ToNumber stub takes one argument in eax.
Label check_heap_number, call_builtin;
__ tst(r0, Operand(kSmiTagMask));
__ b(ne, &check_heap_number);
__ Ret();
__ bind(&check_heap_number);
__ ldr(r1, FieldMemOperand(r0, HeapObject::kMapOffset));
__ LoadRoot(ip, Heap::kHeapNumberMapRootIndex);
__ cmp(r1, ip);
__ b(ne, &call_builtin);
__ Ret();
__ bind(&call_builtin);
__ push(r0);
__ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_JS);
}
void FastNewClosureStub::Generate(MacroAssembler* masm) { void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Create a new closure from the given function info in new // Create a new closure from the given function info in new
// space. Set the context to the current context in cp. // space. Set the context to the current context in cp.

3
deps/v8/src/arm/disasm-arm.cc

@ -1064,6 +1064,9 @@ void Decoder::DecodeTypeVFP(Instruction* instr) {
} else { } else {
Format(instr, "vmov.f32'cond 'Sd, 'Sm"); Format(instr, "vmov.f32'cond 'Sd, 'Sm");
} }
} else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) {
// vabs
Format(instr, "vabs'cond 'Dd, 'Dm");
} else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) { } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) {
DecodeVCVTBetweenDoubleAndSingle(instr); DecodeVCVTBetweenDoubleAndSingle(instr);
} else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) { } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) {

8
deps/v8/src/arm/full-codegen-arm.cc

@ -3057,8 +3057,8 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
Label no_conversion; Label no_conversion;
__ tst(result_register(), Operand(kSmiTagMask)); __ tst(result_register(), Operand(kSmiTagMask));
__ b(eq, &no_conversion); __ b(eq, &no_conversion);
__ push(r0); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
context()->Plug(result_register()); context()->Plug(result_register());
break; break;
@ -3177,8 +3177,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
// Call ToNumber only if operand is not a smi. // Call ToNumber only if operand is not a smi.
Label no_conversion; Label no_conversion;
__ JumpIfSmi(r0, &no_conversion); __ JumpIfSmi(r0, &no_conversion);
__ push(r0); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_JS); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
// Save result for postfix expressions. // Save result for postfix expressions.

66
deps/v8/src/arm/lithium-codegen-arm.cc

@ -1174,8 +1174,7 @@ void LCodeGen::DoDeferredGenericBinaryStub(LTemplateInstruction<1, 2, T>* instr,
0, 0,
Safepoint::kNoDeoptimizationIndex); Safepoint::kNoDeoptimizationIndex);
// Overwrite the stored value of r0 with the result of the stub. // Overwrite the stored value of r0 with the result of the stub.
__ str(r0, MemOperand(sp, DwVfpRegister::kNumAllocatableRegisters * __ StoreToSafepointRegistersAndDoublesSlot(r0);
kDoubleSize));
__ PopSafepointRegistersAndDoubles(); __ PopSafepointRegistersAndDoubles();
} }
@ -2525,6 +2524,7 @@ void LCodeGen::DoCallConstantFunction(LCallConstantFunction* instr) {
void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) { void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
ASSERT(instr->InputAt(0)->Equals(instr->result()));
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->InputAt(0));
Register scratch = scratch0(); Register scratch = scratch0();
@ -2535,28 +2535,32 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
DeoptimizeIf(ne, instr->environment()); DeoptimizeIf(ne, instr->environment());
Label done; Label done;
Register exponent = scratch0();
Label negative; scratch = no_reg;
__ ldr(scratch, FieldMemOperand(input, HeapNumber::kExponentOffset)); __ ldr(exponent, FieldMemOperand(input, HeapNumber::kExponentOffset));
// Check the sign of the argument. If the argument is positive, just // Check the sign of the argument. If the argument is positive, just
// return it. We do not need to patch the stack since |input| and // return it. We do not need to patch the stack since |input| and
// |result| are the same register and |input| will be restored // |result| are the same register and |input| would be restored
// unchanged by popping safepoint registers. // unchanged by popping safepoint registers.
__ tst(scratch, Operand(HeapNumber::kSignMask)); __ tst(exponent, Operand(HeapNumber::kSignMask));
__ b(ne, &negative); __ b(eq, &done);
__ jmp(&done);
__ bind(&negative); // Input is negative. Reverse its sign.
// Preserve the value of all registers. // Preserve the value of all registers.
__ PushSafepointRegisters(); __ PushSafepointRegisters();
Register tmp = input.is(r0) ? r1 : r0; // Registers were saved at the safepoint, so we can use
Register tmp2 = input.is(r2) ? r3 : r2; // many scratch registers.
Register tmp3 = input.is(r4) ? r5 : r4; Register tmp1 = input.is(r1) ? r0 : r1;
Register tmp2 = input.is(r2) ? r0 : r2;
Register tmp3 = input.is(r3) ? r0 : r3;
Register tmp4 = input.is(r4) ? r0 : r4;
// exponent: floating point exponent value.
Label allocated, slow; Label allocated, slow;
__ LoadRoot(scratch, Heap::kHeapNumberMapRootIndex); __ LoadRoot(tmp4, Heap::kHeapNumberMapRootIndex);
__ AllocateHeapNumber(tmp, tmp2, tmp3, scratch, &slow); __ AllocateHeapNumber(tmp1, tmp2, tmp3, tmp4, &slow);
__ b(&allocated); __ b(&allocated);
// Slow case: Call the runtime system to do the number allocation. // Slow case: Call the runtime system to do the number allocation.
@ -2566,20 +2570,20 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
RecordSafepointWithRegisters( RecordSafepointWithRegisters(
instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex); instr->pointer_map(), 0, Safepoint::kNoDeoptimizationIndex);
// Set the pointer to the new heap number in tmp. // Set the pointer to the new heap number in tmp.
if (!tmp.is(r0)) __ mov(tmp, Operand(r0)); if (!tmp1.is(r0)) __ mov(tmp1, Operand(r0));
// Restore input_reg after call to runtime. // Restore input_reg after call to runtime.
MemOperand input_register_slot = masm()->SafepointRegisterSlot(input); __ LoadFromSafepointRegisterSlot(input);
__ ldr(input, input_register_slot); __ ldr(exponent, FieldMemOperand(input, HeapNumber::kExponentOffset));
__ bind(&allocated); __ bind(&allocated);
__ ldr(tmp2, FieldMemOperand(input, HeapNumber::kExponentOffset)); // exponent: floating point exponent value.
__ bic(tmp2, tmp2, Operand(HeapNumber::kSignMask)); // tmp1: allocated heap number.
__ str(tmp2, FieldMemOperand(tmp, HeapNumber::kExponentOffset)); __ bic(exponent, exponent, Operand(HeapNumber::kSignMask));
__ str(exponent, FieldMemOperand(tmp1, HeapNumber::kExponentOffset));
__ ldr(tmp2, FieldMemOperand(input, HeapNumber::kMantissaOffset)); __ ldr(tmp2, FieldMemOperand(input, HeapNumber::kMantissaOffset));
__ str(tmp2, FieldMemOperand(tmp, HeapNumber::kMantissaOffset)); __ str(tmp2, FieldMemOperand(tmp1, HeapNumber::kMantissaOffset));
__ str(tmp, input_register_slot); __ str(tmp1, masm()->SafepointRegisterSlot(input));
__ PopSafepointRegisters(); __ PopSafepointRegisters();
__ bind(&done); __ bind(&done);
@ -2587,15 +2591,14 @@ void LCodeGen::DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr) {
void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) { void LCodeGen::EmitIntegerMathAbs(LUnaryMathOperation* instr) {
Label is_positive;
uint32_t kSignMask = 0x80000000u;
Register input = ToRegister(instr->InputAt(0)); Register input = ToRegister(instr->InputAt(0));
__ tst(input, Operand(kSignMask)); __ cmp(input, Operand(0));
__ b(eq, &is_positive); // We can make rsb conditional because the previous cmp instruction
__ rsb(input, input, Operand(0), SetCC); // will clear the V (overflow) flag and rsb won't set this flag
// if input is positive.
__ rsb(input, input, Operand(0), SetCC, mi);
// Deoptimize on overflow. // Deoptimize on overflow.
DeoptimizeIf(vs, instr->environment()); DeoptimizeIf(vs, instr->environment());
__ bind(&is_positive);
} }
@ -2617,8 +2620,7 @@ void LCodeGen::DoMathAbs(LUnaryMathOperation* instr) {
Representation r = instr->hydrogen()->value()->representation(); Representation r = instr->hydrogen()->value()->representation();
if (r.IsDouble()) { if (r.IsDouble()) {
DwVfpRegister input = ToDoubleRegister(instr->InputAt(0)); DwVfpRegister input = ToDoubleRegister(instr->InputAt(0));
// __ vabs(input, input); __ vabs(input, input);
Abort("Double DoMathAbs unimplemented");
} else if (r.IsInteger32()) { } else if (r.IsInteger32()) {
EmitIntegerMathAbs(instr); EmitIntegerMathAbs(instr);
} else { } else {

18
deps/v8/src/arm/macro-assembler-arm.cc

@ -485,11 +485,21 @@ void MacroAssembler::PopSafepointRegistersAndDoubles() {
PopSafepointRegisters(); PopSafepointRegisters();
} }
void MacroAssembler::StoreToSafepointRegistersAndDoublesSlot(Register reg) {
str(reg, SafepointRegistersAndDoublesSlot(reg));
}
void MacroAssembler::StoreToSafepointRegisterSlot(Register reg) { void MacroAssembler::StoreToSafepointRegisterSlot(Register reg) {
str(reg, SafepointRegisterSlot(reg)); str(reg, SafepointRegisterSlot(reg));
} }
void MacroAssembler::LoadFromSafepointRegisterSlot(Register reg) {
ldr(reg, SafepointRegisterSlot(reg));
}
int MacroAssembler::SafepointRegisterStackIndex(int reg_code) { int MacroAssembler::SafepointRegisterStackIndex(int reg_code) {
// The registers are pushed starting with the highest encoding, // The registers are pushed starting with the highest encoding,
// which means that lowest encodings are closest to the stack pointer. // which means that lowest encodings are closest to the stack pointer.
@ -503,6 +513,14 @@ MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) {
} }
MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) {
// General purpose registers are pushed last on the stack.
int doubles_size = DwVfpRegister::kNumAllocatableRegisters * kDoubleSize;
int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize;
return MemOperand(sp, doubles_size + register_offset);
}
void MacroAssembler::Ldrd(Register dst1, Register dst2, void MacroAssembler::Ldrd(Register dst1, Register dst2,
const MemOperand& src, Condition cond) { const MemOperand& src, Condition cond) {
ASSERT(src.rm().is(no_reg)); ASSERT(src.rm().is(no_reg));

3
deps/v8/src/arm/macro-assembler-arm.h

@ -235,8 +235,11 @@ class MacroAssembler: public Assembler {
void PushSafepointRegistersAndDoubles(); void PushSafepointRegistersAndDoubles();
void PopSafepointRegistersAndDoubles(); void PopSafepointRegistersAndDoubles();
void StoreToSafepointRegisterSlot(Register reg); void StoreToSafepointRegisterSlot(Register reg);
void StoreToSafepointRegistersAndDoublesSlot(Register reg);
void LoadFromSafepointRegisterSlot(Register reg);
static int SafepointRegisterStackIndex(int reg_code); static int SafepointRegisterStackIndex(int reg_code);
static MemOperand SafepointRegisterSlot(Register reg); static MemOperand SafepointRegisterSlot(Register reg);
static MemOperand SafepointRegistersAndDoublesSlot(Register reg);
// Load two consecutive registers with two consecutive memory locations. // Load two consecutive registers with two consecutive memory locations.
void Ldrd(Register dst1, void Ldrd(Register dst1,

5
deps/v8/src/arm/simulator-arm.cc

@ -2445,6 +2445,11 @@ void Simulator::DecodeTypeVFP(Instruction* instr) {
int d = instr->VFPDRegValue(kSinglePrecision); int d = instr->VFPDRegValue(kSinglePrecision);
set_s_register_from_float(d, get_float_from_s_register(m)); set_s_register_from_float(d, get_float_from_s_register(m));
} }
} else if ((instr->Opc2Value() == 0x0) && (instr->Opc3Value() == 0x3)) {
// vabs
double dm_value = get_double_from_d_register(vm);
double dd_value = fabs(dm_value);
set_d_register_from_double(vd, dd_value);
} else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) { } else if ((instr->Opc2Value() == 0x7) && (instr->Opc3Value() == 0x3)) {
DecodeVCVTBetweenDoubleAndSingle(instr); DecodeVCVTBetweenDoubleAndSingle(instr);
} else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) { } else if ((instr->Opc2Value() == 0x8) && (instr->Opc3Value() & 0x1)) {

14
deps/v8/src/code-stubs.h

@ -59,6 +59,7 @@ namespace internal {
V(GenericUnaryOp) \ V(GenericUnaryOp) \
V(RevertToNumber) \ V(RevertToNumber) \
V(ToBoolean) \ V(ToBoolean) \
V(ToNumber) \
V(CounterOp) \ V(CounterOp) \
V(ArgumentsAccess) \ V(ArgumentsAccess) \
V(RegExpExec) \ V(RegExpExec) \
@ -260,6 +261,19 @@ class StackCheckStub : public CodeStub {
}; };
class ToNumberStub: public CodeStub {
public:
ToNumberStub() { }
void Generate(MacroAssembler* masm);
private:
Major MajorKey() { return ToNumber; }
int MinorKey() { return 0; }
const char* GetName() { return "ToNumberStub"; }
};
class FastNewClosureStub : public CodeStub { class FastNewClosureStub : public CodeStub {
public: public:
void Generate(MacroAssembler* masm); void Generate(MacroAssembler* masm);

4
deps/v8/src/date.js

@ -605,7 +605,7 @@ function DateToTimeString() {
// ECMA 262 - 15.9.5.5 // ECMA 262 - 15.9.5.5
function DateToLocaleString() { function DateToLocaleString() {
return DateToString.call(this); return %_CallFunction(this, DateToString);
} }
@ -973,7 +973,7 @@ function DateSetYear(year) {
// do that either. Instead, we create a new function whose name // do that either. Instead, we create a new function whose name
// property will return toGMTString. // property will return toGMTString.
function DateToGMTString() { function DateToGMTString() {
return DateToUTCString.call(this); return %_CallFunction(this, DateToUTCString);
} }

23
deps/v8/src/extensions/experimental/i18n-extension.cc

@ -39,8 +39,9 @@ namespace internal {
I18NExtension* I18NExtension::extension_ = NULL; I18NExtension* I18NExtension::extension_ = NULL;
// TODO(cira): maybe move JS code to a .js file and generata cc files from it? // TODO(cira): maybe move JS code to a .js file and generata cc files from it?
// TODO(cira): Remove v8 prefix from v8Locale once we have stable API.
const char* const I18NExtension::kSource = const char* const I18NExtension::kSource =
"Locale = function(optLocale) {" "v8Locale = function(optLocale) {"
" native function NativeJSLocale();" " native function NativeJSLocale();"
" var properties = NativeJSLocale(optLocale);" " var properties = NativeJSLocale(optLocale);"
" this.locale = properties.locale;" " this.locale = properties.locale;"
@ -48,41 +49,41 @@ const char* const I18NExtension::kSource =
" this.script = properties.script;" " this.script = properties.script;"
" this.region = properties.region;" " this.region = properties.region;"
"};" "};"
"Locale.availableLocales = function() {" "v8Locale.availableLocales = function() {"
" native function NativeJSAvailableLocales();" " native function NativeJSAvailableLocales();"
" return NativeJSAvailableLocales();" " return NativeJSAvailableLocales();"
"};" "};"
"Locale.prototype.maximizedLocale = function() {" "v8Locale.prototype.maximizedLocale = function() {"
" native function NativeJSMaximizedLocale();" " native function NativeJSMaximizedLocale();"
" return new Locale(NativeJSMaximizedLocale(this.locale));" " return new v8Locale(NativeJSMaximizedLocale(this.locale));"
"};" "};"
"Locale.prototype.minimizedLocale = function() {" "v8Locale.prototype.minimizedLocale = function() {"
" native function NativeJSMinimizedLocale();" " native function NativeJSMinimizedLocale();"
" return new Locale(NativeJSMinimizedLocale(this.locale));" " return new v8Locale(NativeJSMinimizedLocale(this.locale));"
"};" "};"
"Locale.prototype.displayLocale_ = function(displayLocale) {" "v8Locale.prototype.displayLocale_ = function(displayLocale) {"
" var result = this.locale;" " var result = this.locale;"
" if (displayLocale !== undefined) {" " if (displayLocale !== undefined) {"
" result = displayLocale.locale;" " result = displayLocale.locale;"
" }" " }"
" return result;" " return result;"
"};" "};"
"Locale.prototype.displayLanguage = function(optDisplayLocale) {" "v8Locale.prototype.displayLanguage = function(optDisplayLocale) {"
" var displayLocale = this.displayLocale_(optDisplayLocale);" " var displayLocale = this.displayLocale_(optDisplayLocale);"
" native function NativeJSDisplayLanguage();" " native function NativeJSDisplayLanguage();"
" return NativeJSDisplayLanguage(this.locale, displayLocale);" " return NativeJSDisplayLanguage(this.locale, displayLocale);"
"};" "};"
"Locale.prototype.displayScript = function(optDisplayLocale) {" "v8Locale.prototype.displayScript = function(optDisplayLocale) {"
" var displayLocale = this.displayLocale_(optDisplayLocale);" " var displayLocale = this.displayLocale_(optDisplayLocale);"
" native function NativeJSDisplayScript();" " native function NativeJSDisplayScript();"
" return NativeJSDisplayScript(this.locale, displayLocale);" " return NativeJSDisplayScript(this.locale, displayLocale);"
"};" "};"
"Locale.prototype.displayRegion = function(optDisplayLocale) {" "v8Locale.prototype.displayRegion = function(optDisplayLocale) {"
" var displayLocale = this.displayLocale_(optDisplayLocale);" " var displayLocale = this.displayLocale_(optDisplayLocale);"
" native function NativeJSDisplayRegion();" " native function NativeJSDisplayRegion();"
" return NativeJSDisplayRegion(this.locale, displayLocale);" " return NativeJSDisplayRegion(this.locale, displayLocale);"
"};" "};"
"Locale.prototype.displayName = function(optDisplayLocale) {" "v8Locale.prototype.displayName = function(optDisplayLocale) {"
" var displayLocale = this.displayLocale_(optDisplayLocale);" " var displayLocale = this.displayLocale_(optDisplayLocale);"
" native function NativeJSDisplayName();" " native function NativeJSDisplayName();"
" return NativeJSDisplayName(this.locale, displayLocale);" " return NativeJSDisplayName(this.locale, displayLocale);"

22
deps/v8/src/ia32/code-stubs-ia32.cc

@ -38,6 +38,28 @@ namespace v8 {
namespace internal { namespace internal {
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void ToNumberStub::Generate(MacroAssembler* masm) {
// The ToNumber stub takes one argument in eax.
NearLabel check_heap_number, call_builtin;
__ test(eax, Immediate(kSmiTagMask));
__ j(not_zero, &check_heap_number);
__ ret(0);
__ bind(&check_heap_number);
__ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
__ cmp(Operand(ebx), Immediate(Factory::heap_number_map()));
__ j(not_equal, &call_builtin);
__ ret(0);
__ bind(&call_builtin);
__ pop(ecx); // Pop return address.
__ push(eax);
__ push(ecx); // Push return address.
__ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION);
}
void FastNewClosureStub::Generate(MacroAssembler* masm) { void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Create a new closure from the given function info in new // Create a new closure from the given function info in new
// space. Set the context to the current context in esi. // space. Set the context to the current context in esi.

8
deps/v8/src/ia32/full-codegen-ia32.cc

@ -3747,8 +3747,8 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
Label no_conversion; Label no_conversion;
__ test(result_register(), Immediate(kSmiTagMask)); __ test(result_register(), Immediate(kSmiTagMask));
__ j(zero, &no_conversion); __ j(zero, &no_conversion);
__ push(result_register()); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
context()->Plug(result_register()); context()->Plug(result_register());
break; break;
@ -3868,8 +3868,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ test(eax, Immediate(kSmiTagMask)); __ test(eax, Immediate(kSmiTagMask));
__ j(zero, &no_conversion); __ j(zero, &no_conversion);
} }
__ push(eax); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
// Save result for postfix expressions. // Save result for postfix expressions.

6
deps/v8/src/json.js

@ -38,7 +38,7 @@ function Revive(holder, name, reviver) {
} }
} else { } else {
for (var p in val) { for (var p in val) {
if (ObjectHasOwnProperty.call(val, p)) { if (%_CallFunction(val, p, ObjectHasOwnProperty)) {
var newElement = Revive(val, p, reviver); var newElement = Revive(val, p, reviver);
if (IS_UNDEFINED(newElement)) { if (IS_UNDEFINED(newElement)) {
delete val[p]; delete val[p];
@ -101,7 +101,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
if (IS_ARRAY(replacer)) { if (IS_ARRAY(replacer)) {
var length = replacer.length; var length = replacer.length;
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
if (ObjectHasOwnProperty.call(replacer, i)) { if (%_CallFunction(replacer, i, ObjectHasOwnProperty)) {
var p = replacer[i]; var p = replacer[i];
var strP = JSONSerialize(p, value, replacer, stack, indent, gap); var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
if (!IS_UNDEFINED(strP)) { if (!IS_UNDEFINED(strP)) {
@ -114,7 +114,7 @@ function SerializeObject(value, replacer, stack, indent, gap) {
} }
} else { } else {
for (var p in value) { for (var p in value) {
if (ObjectHasOwnProperty.call(value, p)) { if (%_CallFunction(value, p, ObjectHasOwnProperty)) {
var strP = JSONSerialize(p, value, replacer, stack, indent, gap); var strP = JSONSerialize(p, value, replacer, stack, indent, gap);
if (!IS_UNDEFINED(strP)) { if (!IS_UNDEFINED(strP)) {
var member = %QuoteJSONString(p) + ":"; var member = %QuoteJSONString(p) + ":";

52
deps/v8/src/messages.js

@ -50,33 +50,10 @@ var kNoLineNumberInfo = 0;
// message on access. // message on access.
var kAddMessageAccessorsMarker = { }; var kAddMessageAccessorsMarker = { };
function GetInstanceName(cons) {
if (cons.length == 0) {
return "";
}
var first = %StringToLowerCase(StringCharAt.call(cons, 0));
if (kVowelSounds === 0) {
kVowelSounds = {a: true, e: true, i: true, o: true, u: true, y: true};
kCapitalVowelSounds = {a: true, e: true, i: true, o: true, u: true, h: true,
f: true, l: true, m: true, n: true, r: true, s: true, x: true, y: true};
}
var vowel_mapping = kVowelSounds;
if (cons.length > 1 && (StringCharAt.call(cons, 0) != first)) {
// First char is upper case
var second = %StringToLowerCase(StringCharAt.call(cons, 1));
// Second char is upper case
if (StringCharAt.call(cons, 1) != second) {
vowel_mapping = kCapitalVowelSounds;
}
}
var s = vowel_mapping[first] ? "an " : "a ";
return s + cons;
}
var kMessages = 0; var kMessages = 0;
var kReplacementMarkers =
[ "%0", "%1", "%2", "%3", "%4", "%5", "%6", "%7", "%8", "%9", "%10" ];
function FormatString(format, args) { function FormatString(format, args) {
var result = format; var result = format;
@ -87,7 +64,9 @@ function FormatString(format, args) {
} catch (e) { } catch (e) {
str = "#<error>"; str = "#<error>";
} }
result = ArrayJoin.call(StringSplit.call(result, "%" + i), str); var replacement_marker = kReplacementMarkers[i];
var split = %_CallFunction(result, replacement_marker, StringSplit);
result = %_CallFunction(split, str, ArrayJoin);
} }
return result; return result;
} }
@ -130,7 +109,7 @@ function ToDetailString(obj) {
if (!constructorName || !IS_STRING(constructorName)) { if (!constructorName || !IS_STRING(constructorName)) {
return ToStringCheckErrorObject(obj); return ToStringCheckErrorObject(obj);
} }
return "#<" + GetInstanceName(constructorName) + ">"; return "#<" + constructorName + ">";
} else { } else {
return ToStringCheckErrorObject(obj); return ToStringCheckErrorObject(obj);
} }
@ -352,7 +331,7 @@ Script.prototype.locationFromPosition = function (position,
var line_ends = this.line_ends; var line_ends = this.line_ends;
var start = line == 0 ? 0 : line_ends[line - 1] + 1; var start = line == 0 ? 0 : line_ends[line - 1] + 1;
var end = line_ends[line]; var end = line_ends[line];
if (end > 0 && StringCharAt.call(this.source, end - 1) == '\r') end--; if (end > 0 && %_CallFunction(this.source, end - 1, StringCharAt) == '\r') end--;
var column = position - start; var column = position - start;
// Adjust according to the offset within the resource. // Adjust according to the offset within the resource.
@ -467,7 +446,7 @@ Script.prototype.sourceLine = function (opt_line) {
var line_ends = this.line_ends; var line_ends = this.line_ends;
var start = line == 0 ? 0 : line_ends[line - 1] + 1; var start = line == 0 ? 0 : line_ends[line - 1] + 1;
var end = line_ends[line]; var end = line_ends[line];
return StringSubstring.call(this.source, start, end); return %_CallFunction(this.source, start, end, StringSubstring);
} }
@ -595,7 +574,7 @@ SourceLocation.prototype.restrict = function (opt_limit, opt_before) {
* Source text for this location. * Source text for this location.
*/ */
SourceLocation.prototype.sourceText = function () { SourceLocation.prototype.sourceText = function () {
return StringSubstring.call(this.script.source, this.start, this.end); return %_CallFunction(this.script.source, this.start, this.end, StringSubstring);
}; };
@ -632,7 +611,10 @@ function SourceSlice(script, from_line, to_line, from_position, to_position) {
* the line terminating characters (if any) * the line terminating characters (if any)
*/ */
SourceSlice.prototype.sourceText = function () { SourceSlice.prototype.sourceText = function () {
return StringSubstring.call(this.script.source, this.from_position, this.to_position); return %_CallFunction(this.script.source,
this.from_position,
this.to_position,
StringSubstring);
}; };
@ -707,10 +689,10 @@ CallSite.prototype.getThis = function () {
CallSite.prototype.getTypeName = function () { CallSite.prototype.getTypeName = function () {
var constructor = this.receiver.constructor; var constructor = this.receiver.constructor;
if (!constructor) if (!constructor)
return $Object.prototype.toString.call(this.receiver); return %_CallFunction(this.receiver, ObjectToString);
var constructorName = constructor.name; var constructorName = constructor.name;
if (!constructorName) if (!constructorName)
return $Object.prototype.toString.call(this.receiver); return %_CallFunction(this.receiver, ObjectToString);
return constructorName; return constructorName;
}; };
@ -759,8 +741,8 @@ CallSite.prototype.getMethodName = function () {
// this function. // this function.
var ownName = this.fun.name; var ownName = this.fun.name;
if (ownName && this.receiver && if (ownName && this.receiver &&
(ObjectLookupGetter.call(this.receiver, ownName) === this.fun || (%_CallFunction(this.receiver, ownName, ObjectLookupGetter) === this.fun ||
ObjectLookupSetter.call(this.receiver, ownName) === this.fun || %_CallFunction(this.receiver, ownName, ObjectLookupSetter) === this.fun ||
this.receiver[ownName] === this.fun)) { this.receiver[ownName] === this.fun)) {
// To handle DontEnum properties we guess that the method has // To handle DontEnum properties we guess that the method has
// the same name as the function. // the same name as the function.

40
deps/v8/src/mirror-debugger.js

@ -411,7 +411,7 @@ Mirror.prototype.allocateTransientHandle_ = function() {
Mirror.prototype.toText = function() { Mirror.prototype.toText = function() {
// Simpel to text which is used when on specialization in subclass. // Simpel to text which is used when on specialization in subclass.
return "#<" + builtins.GetInstanceName(this.constructor.name) + ">"; return "#<" + this.constructor.name + ">";
} }
@ -425,7 +425,7 @@ Mirror.prototype.toText = function() {
* @extends Mirror * @extends Mirror
*/ */
function ValueMirror(type, value, transient) { function ValueMirror(type, value, transient) {
Mirror.call(this, type); %_CallFunction(this, type, Mirror);
this.value_ = value; this.value_ = value;
if (!transient) { if (!transient) {
this.allocateHandle_(); this.allocateHandle_();
@ -470,7 +470,7 @@ ValueMirror.prototype.value = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function UndefinedMirror() { function UndefinedMirror() {
ValueMirror.call(this, UNDEFINED_TYPE, void 0); %_CallFunction(this, UNDEFINED_TYPE, void 0, ValueMirror);
} }
inherits(UndefinedMirror, ValueMirror); inherits(UndefinedMirror, ValueMirror);
@ -486,7 +486,7 @@ UndefinedMirror.prototype.toText = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function NullMirror() { function NullMirror() {
ValueMirror.call(this, NULL_TYPE, null); %_CallFunction(this, NULL_TYPE, null, ValueMirror);
} }
inherits(NullMirror, ValueMirror); inherits(NullMirror, ValueMirror);
@ -503,7 +503,7 @@ NullMirror.prototype.toText = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function BooleanMirror(value) { function BooleanMirror(value) {
ValueMirror.call(this, BOOLEAN_TYPE, value); %_CallFunction(this, BOOLEAN_TYPE, value, ValueMirror);
} }
inherits(BooleanMirror, ValueMirror); inherits(BooleanMirror, ValueMirror);
@ -520,7 +520,7 @@ BooleanMirror.prototype.toText = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function NumberMirror(value) { function NumberMirror(value) {
ValueMirror.call(this, NUMBER_TYPE, value); %_CallFunction(this, NUMBER_TYPE, value, ValueMirror);
} }
inherits(NumberMirror, ValueMirror); inherits(NumberMirror, ValueMirror);
@ -537,7 +537,7 @@ NumberMirror.prototype.toText = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function StringMirror(value) { function StringMirror(value) {
ValueMirror.call(this, STRING_TYPE, value); %_CallFunction(this, STRING_TYPE, value, ValueMirror);
} }
inherits(StringMirror, ValueMirror); inherits(StringMirror, ValueMirror);
@ -568,7 +568,7 @@ StringMirror.prototype.toText = function() {
* @extends ValueMirror * @extends ValueMirror
*/ */
function ObjectMirror(value, type, transient) { function ObjectMirror(value, type, transient) {
ValueMirror.call(this, type || OBJECT_TYPE, value, transient); %_CallFunction(this, type || OBJECT_TYPE, value, transient, ValueMirror);
} }
inherits(ObjectMirror, ValueMirror); inherits(ObjectMirror, ValueMirror);
@ -767,7 +767,7 @@ ObjectMirror.prototype.toText = function() {
name = this.className(); name = this.className();
} }
} }
return '#<' + builtins.GetInstanceName(name) + '>'; return '#<' + name + '>';
}; };
@ -778,7 +778,7 @@ ObjectMirror.prototype.toText = function() {
* @extends ObjectMirror * @extends ObjectMirror
*/ */
function FunctionMirror(value) { function FunctionMirror(value) {
ObjectMirror.call(this, value, FUNCTION_TYPE); %_CallFunction(this, value, FUNCTION_TYPE, ObjectMirror);
this.resolved_ = true; this.resolved_ = true;
} }
inherits(FunctionMirror, ObjectMirror); inherits(FunctionMirror, ObjectMirror);
@ -908,7 +908,7 @@ FunctionMirror.prototype.toText = function() {
function UnresolvedFunctionMirror(value) { function UnresolvedFunctionMirror(value) {
// Construct this using the ValueMirror as an unresolved function is not a // Construct this using the ValueMirror as an unresolved function is not a
// real object but just a string. // real object but just a string.
ValueMirror.call(this, FUNCTION_TYPE, value); %_CallFunction(this, FUNCTION_TYPE, value, ValueMirror);
this.propertyCount_ = 0; this.propertyCount_ = 0;
this.elementCount_ = 0; this.elementCount_ = 0;
this.resolved_ = false; this.resolved_ = false;
@ -958,7 +958,7 @@ UnresolvedFunctionMirror.prototype.propertyNames = function(kind, limit) {
* @extends ObjectMirror * @extends ObjectMirror
*/ */
function ArrayMirror(value) { function ArrayMirror(value) {
ObjectMirror.call(this, value); %_CallFunction(this, value, ObjectMirror);
} }
inherits(ArrayMirror, ObjectMirror); inherits(ArrayMirror, ObjectMirror);
@ -994,7 +994,7 @@ ArrayMirror.prototype.indexedPropertiesFromRange = function(opt_from_index, opt_
* @extends ObjectMirror * @extends ObjectMirror
*/ */
function DateMirror(value) { function DateMirror(value) {
ObjectMirror.call(this, value); %_CallFunction(this, value, ObjectMirror);
} }
inherits(DateMirror, ObjectMirror); inherits(DateMirror, ObjectMirror);
@ -1012,7 +1012,7 @@ DateMirror.prototype.toText = function() {
* @extends ObjectMirror * @extends ObjectMirror
*/ */
function RegExpMirror(value) { function RegExpMirror(value) {
ObjectMirror.call(this, value, REGEXP_TYPE); %_CallFunction(this, value, REGEXP_TYPE, ObjectMirror);
} }
inherits(RegExpMirror, ObjectMirror); inherits(RegExpMirror, ObjectMirror);
@ -1066,7 +1066,7 @@ RegExpMirror.prototype.toText = function() {
* @extends ObjectMirror * @extends ObjectMirror
*/ */
function ErrorMirror(value) { function ErrorMirror(value) {
ObjectMirror.call(this, value, ERROR_TYPE); %_CallFunction(this, value, ERROR_TYPE, ObjectMirror);
} }
inherits(ErrorMirror, ObjectMirror); inherits(ErrorMirror, ObjectMirror);
@ -1101,7 +1101,7 @@ ErrorMirror.prototype.toText = function() {
* @extends Mirror * @extends Mirror
*/ */
function PropertyMirror(mirror, name, details) { function PropertyMirror(mirror, name, details) {
Mirror.call(this, PROPERTY_TYPE); %_CallFunction(this, PROPERTY_TYPE, Mirror);
this.mirror_ = mirror; this.mirror_ = mirror;
this.name_ = name; this.name_ = name;
this.value_ = details[0]; this.value_ = details[0];
@ -1397,7 +1397,7 @@ FrameDetails.prototype.scopeCount = function() {
* @extends Mirror * @extends Mirror
*/ */
function FrameMirror(break_id, index) { function FrameMirror(break_id, index) {
Mirror.call(this, FRAME_TYPE); %_CallFunction(this, FRAME_TYPE, Mirror);
this.break_id_ = break_id; this.break_id_ = break_id;
this.index_ = index; this.index_ = index;
this.details_ = new FrameDetails(break_id, index); this.details_ = new FrameDetails(break_id, index);
@ -1712,7 +1712,7 @@ ScopeDetails.prototype.object = function() {
* @extends Mirror * @extends Mirror
*/ */
function ScopeMirror(frame, index) { function ScopeMirror(frame, index) {
Mirror.call(this, SCOPE_TYPE); %_CallFunction(this, SCOPE_TYPE, Mirror);
this.frame_index_ = frame.index_; this.frame_index_ = frame.index_;
this.scope_index_ = index; this.scope_index_ = index;
this.details_ = new ScopeDetails(frame, index); this.details_ = new ScopeDetails(frame, index);
@ -1752,7 +1752,7 @@ ScopeMirror.prototype.scopeObject = function() {
* @extends Mirror * @extends Mirror
*/ */
function ScriptMirror(script) { function ScriptMirror(script) {
Mirror.call(this, SCRIPT_TYPE); %_CallFunction(this, SCRIPT_TYPE, Mirror);
this.script_ = script; this.script_ = script;
this.context_ = new ContextMirror(script.context_data); this.context_ = new ContextMirror(script.context_data);
this.allocateHandle_(); this.allocateHandle_();
@ -1868,7 +1868,7 @@ ScriptMirror.prototype.toText = function() {
* @extends Mirror * @extends Mirror
*/ */
function ContextMirror(data) { function ContextMirror(data) {
Mirror.call(this, CONTEXT_TYPE); %_CallFunction(this, CONTEXT_TYPE, Mirror);
this.data_ = data; this.data_ = data;
this.allocateHandle_(); this.allocateHandle_();
} }

2
deps/v8/src/regexp.js

@ -52,7 +52,7 @@ function DoConstructRegExp(object, pattern, flags) {
var multiline = false; var multiline = false;
for (var i = 0; i < flags.length; i++) { for (var i = 0; i < flags.length; i++) {
var c = StringCharAt.call(flags, i); var c = %_CallFunction(flags, i, StringCharAt);
switch (c) { switch (c) {
case 'g': case 'g':
// Allow duplicate flags to be consistent with JSC and others. // Allow duplicate flags to be consistent with JSC and others.

44
deps/v8/src/runtime.cc

@ -745,35 +745,31 @@ static MaybeObject* Runtime_GetOwnProperty(Arguments args) {
if (!result.IsProperty()) { if (!result.IsProperty()) {
return Heap::undefined_value(); return Heap::undefined_value();
} }
if (result.type() == CALLBACKS) {
Object* structure = result.GetCallbackObject(); elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!result.IsDontEnum()));
if (structure->IsProxy() || structure->IsAccessorInfo()) { elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!result.IsDontDelete()));
// Property that is internally implemented as a callback or
// an API defined callback. bool is_js_accessor = (result.type() == CALLBACKS) &&
Object* value; (result.GetCallbackObject()->IsFixedArray());
{ MaybeObject* maybe_value = obj->GetPropertyWithCallback(
*obj, structure, *name, result.holder()); if (is_js_accessor) {
if (!maybe_value->ToObject(&value)) return maybe_value; // __defineGetter__/__defineSetter__ callback.
} FixedArray* structure = FixedArray::cast(result.GetCallbackObject());
elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); elms->set(IS_ACCESSOR_INDEX, Heap::true_value());
elms->set(VALUE_INDEX, value); elms->set(GETTER_INDEX, structure->get(0));
elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly())); elms->set(SETTER_INDEX, structure->get(1));
} else if (structure->IsFixedArray()) {
// __defineGetter__/__defineSetter__ callback.
elms->set(IS_ACCESSOR_INDEX, Heap::true_value());
elms->set(GETTER_INDEX, FixedArray::cast(structure)->get(0));
elms->set(SETTER_INDEX, FixedArray::cast(structure)->get(1));
} else {
return Heap::undefined_value();
}
} else { } else {
elms->set(IS_ACCESSOR_INDEX, Heap::false_value()); elms->set(IS_ACCESSOR_INDEX, Heap::false_value());
elms->set(VALUE_INDEX, result.GetLazyValue());
elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly())); elms->set(WRITABLE_INDEX, Heap::ToBoolean(!result.IsReadOnly()));
PropertyAttributes attrs;
Object* value;
{ MaybeObject* maybe_value = obj->GetProperty(*obj, &result, *name, &attrs);
if (!maybe_value->ToObject(&value)) return maybe_value;
}
elms->set(VALUE_INDEX, value);
} }
elms->set(ENUMERABLE_INDEX, Heap::ToBoolean(!result.IsDontEnum()));
elms->set(CONFIGURABLE_INDEX, Heap::ToBoolean(!result.IsDontDelete()));
return *desc; return *desc;
} }

6
deps/v8/src/version.cc

@ -33,9 +33,9 @@
// NOTE these macros are used by the SCons build script so their names // NOTE these macros are used by the SCons build script so their names
// cannot be changed without changing the SCons build script. // cannot be changed without changing the SCons build script.
#define MAJOR_VERSION 3 #define MAJOR_VERSION 3
#define MINOR_VERSION 0 #define MINOR_VERSION 1
#define BUILD_NUMBER 12 #define BUILD_NUMBER 0
#define PATCH_LEVEL 0 #define PATCH_LEVEL 1
#define CANDIDATE_VERSION false #define CANDIDATE_VERSION false
// Define SONAME to have the SCons build the put a specific SONAME into the // Define SONAME to have the SCons build the put a specific SONAME into the

22
deps/v8/src/x64/code-stubs-x64.cc

@ -37,6 +37,28 @@ namespace v8 {
namespace internal { namespace internal {
#define __ ACCESS_MASM(masm) #define __ ACCESS_MASM(masm)
void ToNumberStub::Generate(MacroAssembler* masm) {
// The ToNumber stub takes one argument in eax.
NearLabel check_heap_number, call_builtin;
__ SmiTest(rax);
__ j(not_zero, &check_heap_number);
__ Ret();
__ bind(&check_heap_number);
__ Move(rbx, Factory::heap_number_map());
__ cmpq(rbx, FieldOperand(rax, HeapObject::kMapOffset));
__ j(not_equal, &call_builtin);
__ Ret();
__ bind(&call_builtin);
__ pop(rcx); // Pop return address.
__ push(rax);
__ push(rcx); // Push return address.
__ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION);
}
void FastNewClosureStub::Generate(MacroAssembler* masm) { void FastNewClosureStub::Generate(MacroAssembler* masm) {
// Create a new closure from the given function info in new // Create a new closure from the given function info in new
// space. Set the context to the current context in rsi. // space. Set the context to the current context in rsi.

8
deps/v8/src/x64/full-codegen-x64.cc

@ -3063,8 +3063,8 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
Label no_conversion; Label no_conversion;
Condition is_smi = masm_->CheckSmi(result_register()); Condition is_smi = masm_->CheckSmi(result_register());
__ j(is_smi, &no_conversion); __ j(is_smi, &no_conversion);
__ push(result_register()); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
context()->Plug(result_register()); context()->Plug(result_register());
break; break;
@ -3180,8 +3180,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
Condition is_smi; Condition is_smi;
is_smi = masm_->CheckSmi(rax); is_smi = masm_->CheckSmi(rax);
__ j(is_smi, &no_conversion); __ j(is_smi, &no_conversion);
__ push(rax); ToNumberStub convert_stub;
__ InvokeBuiltin(Builtins::TO_NUMBER, CALL_FUNCTION); __ CallStub(&convert_stub);
__ bind(&no_conversion); __ bind(&no_conversion);
// Save result for postfix expressions. // Save result for postfix expressions.

30
deps/v8/test/cctest/test-api.cc

@ -2376,6 +2376,8 @@ TEST(APIThrowMessageOverwrittenToString) {
v8::HandleScope scope; v8::HandleScope scope;
v8::V8::AddMessageListener(check_reference_error_message); v8::V8::AddMessageListener(check_reference_error_message);
LocalContext context; LocalContext context;
CompileRun("Number.prototype.toString = function f() { return 'Yikes'; }");
CompileRun("String.prototype.toString = function f() { return 'Yikes'; }");
CompileRun("ReferenceError.prototype.toString =" CompileRun("ReferenceError.prototype.toString ="
" function() { return 'Whoops' }"); " function() { return 'Whoops' }");
CompileRun("asdf;"); CompileRun("asdf;");
@ -5371,37 +5373,45 @@ THREADED_TEST(AccessControl) {
v8::Handle<Value> value; v8::Handle<Value> value;
// Access blocked property // Access blocked property
value = v8_compile("other.blocked_prop = 1")->Run(); value = CompileRun("other.blocked_prop = 1");
value = v8_compile("other.blocked_prop")->Run(); value = CompileRun("other.blocked_prop");
CHECK(value->IsUndefined()); CHECK(value->IsUndefined());
value = v8_compile("propertyIsEnumerable.call(other, 'blocked_prop')")->Run(); value = CompileRun(
"Object.getOwnPropertyDescriptor(other, 'blocked_prop').value");
CHECK(value->IsUndefined());
value = CompileRun("propertyIsEnumerable.call(other, 'blocked_prop')");
CHECK(value->IsFalse()); CHECK(value->IsFalse());
// Access accessible property // Access accessible property
value = v8_compile("other.accessible_prop = 3")->Run(); value = CompileRun("other.accessible_prop = 3");
CHECK(value->IsNumber()); CHECK(value->IsNumber());
CHECK_EQ(3, value->Int32Value()); CHECK_EQ(3, value->Int32Value());
CHECK_EQ(3, g_echo_value); CHECK_EQ(3, g_echo_value);
value = v8_compile("other.accessible_prop")->Run(); value = CompileRun("other.accessible_prop");
CHECK(value->IsNumber()); CHECK(value->IsNumber());
CHECK_EQ(3, value->Int32Value()); CHECK_EQ(3, value->Int32Value());
value = value = CompileRun(
v8_compile("propertyIsEnumerable.call(other, 'accessible_prop')")->Run(); "Object.getOwnPropertyDescriptor(other, 'accessible_prop').value");
CHECK(value->IsNumber());
CHECK_EQ(3, value->Int32Value());
value = CompileRun("propertyIsEnumerable.call(other, 'accessible_prop')");
CHECK(value->IsTrue()); CHECK(value->IsTrue());
// Enumeration doesn't enumerate accessors from inaccessible objects in // Enumeration doesn't enumerate accessors from inaccessible objects in
// the prototype chain even if the accessors are in themselves accessible. // the prototype chain even if the accessors are in themselves accessible.
Local<Value> result = value =
CompileRun("(function(){var obj = {'__proto__':other};" CompileRun("(function(){var obj = {'__proto__':other};"
"for (var p in obj)" "for (var p in obj)"
" if (p == 'accessible_prop' || p == 'blocked_prop') {" " if (p == 'accessible_prop' || p == 'blocked_prop') {"
" return false;" " return false;"
" }" " }"
"return true;})()"); "return true;})()");
CHECK(result->IsTrue()); CHECK(value->IsTrue());
context1->Exit(); context1->Exit();
context0->Exit(); context0->Exit();
@ -6246,7 +6256,7 @@ THREADED_TEST(FunctionDescriptorException) {
" var str = String(e);" " var str = String(e);"
" if (str.indexOf('TypeError') == -1) return 1;" " if (str.indexOf('TypeError') == -1) return 1;"
" if (str.indexOf('[object Fun]') != -1) return 2;" " if (str.indexOf('[object Fun]') != -1) return 2;"
" if (str.indexOf('#<a Fun>') == -1) return 3;" " if (str.indexOf('#<Fun>') == -1) return 3;"
" return 0;" " return 0;"
" }" " }"
" return 4;" " return 4;"

15
deps/v8/test/cctest/test-assembler-arm.cc

@ -229,6 +229,8 @@ TEST(4) {
double d; double d;
double e; double e;
double f; double f;
double g;
double h;
int i; int i;
float x; float x;
float y; float y;
@ -286,6 +288,15 @@ TEST(4) {
__ vmov(s31, lr); __ vmov(s31, lr);
__ vcvt_f64_s32(d4, s31); __ vcvt_f64_s32(d4, s31);
__ vstr(d4, r4, OFFSET_OF(T, f)); __ vstr(d4, r4, OFFSET_OF(T, f));
// Test vabs.
__ vldr(d1, r4, OFFSET_OF(T, g));
__ vabs(d0, d1);
__ vstr(d0, r4, OFFSET_OF(T, g));
__ vldr(d2, r4, OFFSET_OF(T, h));
__ vabs(d0, d2);
__ vstr(d0, r4, OFFSET_OF(T, h));
__ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit());
CodeDesc desc; CodeDesc desc;
@ -305,6 +316,8 @@ TEST(4) {
t.d = 0.0; t.d = 0.0;
t.e = 0.0; t.e = 0.0;
t.f = 0.0; t.f = 0.0;
t.g = -2718.2818;
t.h = 31415926.5;
t.i = 0; t.i = 0;
t.x = 4.5; t.x = 4.5;
t.y = 9.0; t.y = 9.0;
@ -313,6 +326,8 @@ TEST(4) {
CHECK_EQ(4.5, t.y); CHECK_EQ(4.5, t.y);
CHECK_EQ(9.0, t.x); CHECK_EQ(9.0, t.x);
CHECK_EQ(2, t.i); CHECK_EQ(2, t.i);
CHECK_EQ(2718.2818, t.g);
CHECK_EQ(31415926.5, t.h);
CHECK_EQ(42.0, t.f); CHECK_EQ(42.0, t.f);
CHECK_EQ(1.0, t.e); CHECK_EQ(1.0, t.e);
CHECK_EQ(1.000000059604644775390625, t.d); CHECK_EQ(1.000000059604644775390625, t.d);

5
deps/v8/test/cctest/test-disasm-arm.cc

@ -435,6 +435,11 @@ TEST(Vfp) {
COMPARE(vmov(s31, r10), COMPARE(vmov(s31, r10),
"ee0faa90 vmov s31, r10"); "ee0faa90 vmov s31, r10");
COMPARE(vabs(d0, d1),
"eeb00bc1 vabs d0, d1");
COMPARE(vabs(d3, d4, mi),
"4eb03bc4 vabsmi d3, d4");
COMPARE(vadd(d0, d1, d2), COMPARE(vadd(d0, d1, d2),
"ee310b02 vadd.f64 d0, d1, d2"); "ee310b02 vadd.f64 d0, d1, d2");
COMPARE(vadd(d3, d4, d5, mi), COMPARE(vadd(d3, d4, d5, mi),

6
deps/v8/test/mjsunit/debug-backtrace-text.js

@ -80,9 +80,9 @@ function listener(event, exec_state, event_data, data) {
// 1: Call distance on Point where distance is a direct property // 1: Call distance on Point where distance is a direct property
// 2: Call on function an array element 2 // 2: Call on function an array element 2
// 3: [anonymous] // 3: [anonymous]
assertEquals("#<a Point>.distanceTo(p=#<a Point>)", exec_state.frame(0).invocationText()); assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(0).invocationText());
assertEquals("#<a Point>.distanceTo(p=#<a Point>)", exec_state.frame(1).invocationText()); assertEquals("#<Point>.distanceTo(p=#<Point>)", exec_state.frame(1).invocationText());
assertEquals("#<an Array>[2](aka distance)(p=#<a Point>, q=#<a Point>)", exec_state.frame(2).invocationText()); assertEquals("#<Array>[2](aka distance)(p=#<Point>, q=#<Point>)", exec_state.frame(2).invocationText());
assertEquals("[anonymous]()", exec_state.frame(3).invocationText()); assertEquals("[anonymous]()", exec_state.frame(3).invocationText());
listenerCalled = true; listenerCalled = true;
} else { } else {

Loading…
Cancel
Save