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
This commit is contained in:
sgjesse@chromium.org 2011-01-05 12:01:53 +00:00
parent 83c7c699eb
commit 0cd558a355
6 changed files with 65 additions and 38 deletions

View File

@ -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(&not_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);

View File

@ -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);

View File

@ -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<JSFunction> function() const { return hydrogen()->function(); }
};
class LBoundsCheck: public LBinaryOperation {
public:
LBoundsCheck(LOperand* index, LOperand* length)

View File

@ -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) {

View File

@ -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<char>(name_, kMaxNameLength),
"InstanceofStub%s%s%s",
args,
inline_check,
return_true_false_object);
return name_;
}
} } // namespace v8::internal

View File

@ -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<char>(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