From 0cd558a35544694d8d155c7502ea49f7d025574b Mon Sep 17 00:00:00 2001 From: "sgjesse@chromium.org" Date: Wed, 5 Jan 2011 12:01:53 +0000 Subject: [PATCH] Fix the build breakge on x64 and ARM after r6173 The instanceof changes was not fully ported to x64 and ARM. Review URL: http://codereview.chromium.org/6031013 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6175 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/arm/code-stubs-arm.cc | 16 ++++++++-------- src/arm/lithium-arm.cc | 8 ++++++++ src/arm/lithium-arm.h | 15 +++++++++++++++ src/arm/lithium-codegen-arm.cc | 4 ++++ src/code-stubs.cc | 30 ++++++++++++++++++++++++++++++ src/ia32/code-stubs-ia32.cc | 30 ------------------------------ 6 files changed, 65 insertions(+), 38 deletions(-) diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc index 577ac63..9e5cc37 100644 --- a/src/arm/code-stubs-arm.cc +++ b/src/arm/code-stubs-arm.cc @@ -2905,7 +2905,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { const Register prototype = r4; // Prototype of the function. const Register scratch = r2; Label slow, loop, is_instance, is_not_instance, not_js_object; - if (!args_in_registers()) { + if (!HasArgsInRegisters()) { __ ldr(object, MemOperand(sp, 1 * kPointerSize)); __ ldr(function, MemOperand(sp, 0)); } @@ -2923,7 +2923,7 @@ void InstanceofStub::Generate(MacroAssembler* masm) { __ cmp(map, ip); __ b(ne, &miss); __ LoadRoot(r0, Heap::kInstanceofCacheAnswerRootIndex); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); __ bind(&miss); __ TryGetFunctionPrototype(function, prototype, scratch, &slow); @@ -2953,12 +2953,12 @@ void InstanceofStub::Generate(MacroAssembler* masm) { __ bind(&is_instance); __ mov(r0, Operand(Smi::FromInt(0))); __ StoreRoot(r0, Heap::kInstanceofCacheAnswerRootIndex); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); __ bind(&is_not_instance); __ mov(r0, Operand(Smi::FromInt(1))); __ StoreRoot(r0, Heap::kInstanceofCacheAnswerRootIndex); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); Label object_not_null, object_not_null_or_smi; __ bind(¬_js_object); @@ -2972,22 +2972,22 @@ void InstanceofStub::Generate(MacroAssembler* masm) { __ cmp(scratch, Operand(Factory::null_value())); __ b(ne, &object_not_null); __ mov(r0, Operand(Smi::FromInt(1))); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); __ bind(&object_not_null); // Smi values are not instances of anything. __ BranchOnNotSmi(object, &object_not_null_or_smi); __ mov(r0, Operand(Smi::FromInt(1))); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); __ bind(&object_not_null_or_smi); // String values are not instances of anything. __ IsObjectJSStringType(object, scratch, &slow); __ mov(r0, Operand(Smi::FromInt(1))); - __ Ret(args_in_registers() ? 0 : 2); + __ Ret(HasArgsInRegisters() ? 0 : 2); // Slow-case. Tail call builtin. - if (args_in_registers()) { + if (HasArgsInRegisters()) { __ Push(r0, r1); } __ bind(&slow); diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index 87efc92..4ab918d 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -1306,6 +1306,14 @@ LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { } +LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( + HInstanceOfKnownGlobal* instr) { + LInstruction* result = + new LInstanceOfKnownGlobal(UseFixed(instr->value(), r0)); + return MarkAsCall(DefineFixed(result, r0), instr); +} + + LInstruction* LChunkBuilder::DoApplyArguments(HApplyArguments* instr) { LOperand* function = UseFixed(instr->function(), r1); LOperand* receiver = UseFixed(instr->receiver(), r0); diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 2f8cc1c..cc461d0 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -62,6 +62,7 @@ class Translation; // LDivI // LInstanceOf // LInstanceOfAndBranch +// LInstanceOfKnownGlobal // LLoadKeyedFastElement // LLoadKeyedGeneric // LModI @@ -204,6 +205,7 @@ class Translation; V(Goto) \ V(InstanceOf) \ V(InstanceOfAndBranch) \ + V(InstanceOfKnownGlobal) \ V(Integer32ToDouble) \ V(IsNull) \ V(IsNullAndBranch) \ @@ -993,6 +995,19 @@ class LInstanceOfAndBranch: public LInstanceOf { }; +class LInstanceOfKnownGlobal: public LUnaryOperation { + public: + explicit LInstanceOfKnownGlobal(LOperand* left) + : LUnaryOperation(left) { } + + DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, + "instance-of-known-global") + DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) + + Handle function() const { return hydrogen()->function(); } +}; + + class LBoundsCheck: public LBinaryOperation { public: LBoundsCheck(LOperand* index, LOperand* length) diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index bb2461c..711d0ca 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -1431,6 +1431,10 @@ void LCodeGen::DoInstanceOfAndBranch(LInstanceOfAndBranch* instr) { } +void LCodeGen::DoInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr) { + Abort("DoInstanceOfKnownGlobal unimplemented."); +} + static Condition ComputeCompareCondition(Token::Value op) { switch (op) { diff --git a/src/code-stubs.cc b/src/code-stubs.cc index 1b0d8b0..1552b7a 100644 --- a/src/code-stubs.cc +++ b/src/code-stubs.cc @@ -197,4 +197,34 @@ void ICCompareStub::Generate(MacroAssembler* masm) { } +const char* InstanceofStub::GetName() { + if (name_ != NULL) return name_; + const int kMaxNameLength = 100; + name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); + if (name_ == NULL) return "OOM"; + + const char* args = ""; + if (HasArgsInRegisters()) { + args = "_REGS"; + } + + const char* inline_check = ""; + if (HasCallSiteInlineCheck()) { + inline_check = "_INLINE"; + } + + const char* return_true_false_object = ""; + if (ReturnTrueFalseObject()) { + return_true_false_object = "_TRUEFALSE"; + } + + OS::SNPrintF(Vector(name_, kMaxNameLength), + "InstanceofStub%s%s%s", + args, + inline_check, + return_true_false_object); + return name_; +} + + } } // namespace v8::internal diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc index e51a673..f14013d 100644 --- a/src/ia32/code-stubs-ia32.cc +++ b/src/ia32/code-stubs-ia32.cc @@ -5182,36 +5182,6 @@ Register InstanceofStub::left() { return eax; } Register InstanceofStub::right() { return edx; } -const char* InstanceofStub::GetName() { - if (name_ != NULL) return name_; - const int kMaxNameLength = 100; - name_ = Bootstrapper::AllocateAutoDeletedArray(kMaxNameLength); - if (name_ == NULL) return "OOM"; - - const char* args = ""; - if (HasArgsInRegisters()) { - args = "_REGS"; - } - - const char* inline_check = ""; - if (HasCallSiteInlineCheck()) { - inline_check = "_INLINE"; - } - - const char* return_true_false_object = ""; - if (ReturnTrueFalseObject()) { - return_true_false_object = "_TRUEFALSE"; - } - - OS::SNPrintF(Vector(name_, kMaxNameLength), - "InstanceofStub%s%s%s", - args, - inline_check, - return_true_false_object); - return name_; -} - - int CompareStub::MinorKey() { // Encode the three parameters in a unique 16 bit value. To avoid duplicate // stubs the never NaN NaN condition is only taken into account if the -- 2.7.4