diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc index c8d0fdbf08..56332eeea9 100644 --- a/src/arm/lithium-arm.cc +++ b/src/arm/lithium-arm.cc @@ -2431,14 +2431,6 @@ LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { } -LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { - LOperand* object = UseFixed(instr->object(), r0); - LOperand* key = UseFixed(instr->key(), r1); - LDeleteProperty* result = new(zone()) LDeleteProperty(object, key); - return MarkAsCall(DefineFixed(result, r0), instr); -} - - LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { ASSERT(argument_count_ == 0); allocator_->MarkAsOsrEntry(); @@ -2611,14 +2603,6 @@ LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { } -LInstruction* LChunkBuilder::DoIn(HIn* instr) { - LOperand* key = UseRegisterAtStart(instr->key()); - LOperand* object = UseRegisterAtStart(instr->object()); - LIn* result = new(zone()) LIn(key, object); - return MarkAsCall(DefineFixed(result, r0), instr); -} - - LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { LOperand* object = UseFixed(instr->enumerable(), r0); LForInPrepareMap* result = new(zone()) LForInPrepareMap(object); diff --git a/src/arm/lithium-arm.h b/src/arm/lithium-arm.h index 4adf02657d..b91288d940 100644 --- a/src/arm/lithium-arm.h +++ b/src/arm/lithium-arm.h @@ -92,7 +92,6 @@ class LCodeGen; V(Context) \ V(DebugBreak) \ V(DeclareGlobals) \ - V(DeleteProperty) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ @@ -106,7 +105,6 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ - V(In) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ @@ -2566,20 +2564,6 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { }; -class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { - public: - LDeleteProperty(LOperand* object, LOperand* key) { - inputs_[0] = object; - inputs_[1] = key; - } - - LOperand* object() { return inputs_[0]; } - LOperand* key() { return inputs_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") -}; - - class LOsrEntry: public LTemplateInstruction<0, 0, 0> { public: LOsrEntry() {} @@ -2601,20 +2585,6 @@ class LStackCheck: public LTemplateInstruction<0, 0, 0> { }; -class LIn: public LTemplateInstruction<1, 2, 0> { - public: - LIn(LOperand* key, LOperand* object) { - inputs_[0] = key; - inputs_[1] = object; - } - - LOperand* key() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(In, "in") -}; - - class LForInPrepareMap: public LTemplateInstruction<1, 1, 0> { public: explicit LForInPrepareMap(LOperand* object) { diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc index d4b90869fb..a07bbcde37 100644 --- a/src/arm/lithium-codegen-arm.cc +++ b/src/arm/lithium-codegen-arm.cc @@ -5731,33 +5731,6 @@ void LCodeGen::DoDummyUse(LDummyUse* instr) { } -void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { - Register object = ToRegister(instr->object()); - Register key = ToRegister(instr->key()); - Register strict = scratch0(); - __ mov(strict, Operand(Smi::FromInt(strict_mode_flag()))); - __ Push(object, key, strict); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - SafepointGenerator safepoint_generator( - this, pointers, Safepoint::kLazyDeopt); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); -} - - -void LCodeGen::DoIn(LIn* instr) { - Register obj = ToRegister(instr->object()); - Register key = ToRegister(instr->key()); - __ Push(key, obj); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - SafepointGenerator safepoint_generator(this, pointers, Safepoint::kLazyDeopt); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); -} - - void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); __ CallRuntimeSaveDoubles(Runtime::kStackGuard); diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 5ba4298c22..bd5f97a9c4 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -3130,11 +3130,6 @@ HType HInstanceOf::CalculateInferredType() { } -HType HDeleteProperty::CalculateInferredType() { - return HType::Boolean(); -} - - HType HInstanceOfKnownGlobal::CalculateInferredType() { return HType::Boolean(); } @@ -3651,13 +3646,6 @@ HInstruction* HShr::New( #undef H_CONSTANT_DOUBLE -void HIn::PrintDataTo(StringStream* stream) { - key()->PrintNameTo(stream); - stream->Add(" "); - object()->PrintNameTo(stream); -} - - void HBitwise::PrintDataTo(StringStream* stream) { stream->Add(Token::Name(op_)); stream->Add(" "); diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 9e8ba76654..687f3b924e 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -105,7 +105,6 @@ class LChunkBuilder; V(Context) \ V(DebugBreak) \ V(DeclareGlobals) \ - V(DeleteProperty) \ V(Deoptimize) \ V(Div) \ V(DummyUse) \ @@ -121,7 +120,6 @@ class LChunkBuilder; V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ V(InductionVariableAnnotation) \ - V(In) \ V(InnerAllocatedObject) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ @@ -6532,55 +6530,6 @@ class HSeqStringSetChar: public HTemplateInstruction<3> { }; -class HDeleteProperty: public HBinaryOperation { - public: - HDeleteProperty(HValue* context, HValue* obj, HValue* key) - : HBinaryOperation(context, obj, key) { - set_representation(Representation::Tagged()); - SetAllSideEffects(); - } - - virtual Representation RequiredInputRepresentation(int index) { - return Representation::Tagged(); - } - - virtual HType CalculateInferredType(); - - DECLARE_CONCRETE_INSTRUCTION(DeleteProperty) - - HValue* object() { return left(); } - HValue* key() { return right(); } -}; - - -class HIn: public HTemplateInstruction<3> { - public: - HIn(HValue* context, HValue* key, HValue* object) { - SetOperandAt(0, context); - SetOperandAt(1, key); - SetOperandAt(2, object); - set_representation(Representation::Tagged()); - SetAllSideEffects(); - } - - HValue* context() { return OperandAt(0); } - HValue* key() { return OperandAt(1); } - HValue* object() { return OperandAt(2); } - - virtual Representation RequiredInputRepresentation(int index) { - return Representation::Tagged(); - } - - virtual HType CalculateInferredType() { - return HType::Boolean(); - } - - virtual void PrintDataTo(StringStream* stream); - - DECLARE_CONCRETE_INSTRUCTION(In) -}; - - class HCheckMapValue: public HTemplateInstruction<2> { public: HCheckMapValue(HValue* value, diff --git a/src/hydrogen.cc b/src/hydrogen.cc index fa6dd72ec0..074ca17fe1 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -1957,7 +1957,7 @@ HStoreNamedField* HGraphBuilder::AddStoreMapConstant(HValue *object, HValue* HGraphBuilder::AddLoadJSBuiltin(Builtins::JavaScript builtin, - HContext* context) { + HValue* context) { HGlobalObject* global_object = Add(context); HObjectAccess access = HObjectAccess::ForJSObjectOffset( GlobalObject::kBuiltinsOffset); @@ -7628,7 +7628,13 @@ void HOptimizedGraphBuilder::VisitDelete(UnaryOperation* expr) { HValue* key = Pop(); HValue* obj = Pop(); HValue* context = environment()->LookupContext(); - HDeleteProperty* instr = new(zone()) HDeleteProperty(context, obj, key); + HValue* function = AddLoadJSBuiltin(Builtins::DELETE, context); + Add(obj); + Add(key); + Add(Add(function_strict_mode_flag())); + // TODO(olivf) InvokeFunction produces a check for the parameter count, + // even though we are certain to pass the correct number of arguments here. + HInstruction* instr = new(zone()) HInvokeFunction(context, function, 3); return ast_context()->ReturnInstruction(instr, expr->id()); } else if (proxy != NULL) { Variable* var = proxy->var(); @@ -8441,7 +8447,12 @@ void HOptimizedGraphBuilder::VisitCompareOperation(CompareOperation* expr) { // Code below assumes that we don't fall through. UNREACHABLE(); } else if (op == Token::IN) { - HIn* result = new(zone()) HIn(context, left, right); + HValue* function = AddLoadJSBuiltin(Builtins::IN, context); + Add(left); + Add(right); + // TODO(olivf) InvokeFunction produces a check for the parameter count, + // even though we are certain to pass the correct number of arguments here. + HInstruction* result = new(zone()) HInvokeFunction(context, function, 2); result->set_position(expr->position()); return ast_context()->ReturnInstruction(result, expr->id()); } diff --git a/src/hydrogen.h b/src/hydrogen.h index 0a2ca08aae..4194b6d460 100644 --- a/src/hydrogen.h +++ b/src/hydrogen.h @@ -1115,7 +1115,7 @@ class HGraphBuilder { HLoadNamedField* AddLoadFixedArrayLength(HValue *object); - HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin, HContext* context); + HValue* AddLoadJSBuiltin(Builtins::JavaScript builtin, HValue* context); enum SoftDeoptimizeMode { MUST_EMIT_SOFT_DEOPT, diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index f5c9ff04b6..ac82dcfd41 100644 --- a/src/ia32/lithium-codegen-ia32.cc +++ b/src/ia32/lithium-codegen-ia32.cc @@ -6376,24 +6376,6 @@ void LCodeGen::DoDummyUse(LDummyUse* instr) { } -void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { - LOperand* obj = instr->object(); - LOperand* key = instr->key(); - __ push(ToOperand(obj)); - EmitPushTaggedOperand(key); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - // Create safepoint generator that will also ensure enough space in the - // reloc info for patching in deoptimization (since this is invoking a - // builtin) - SafepointGenerator safepoint_generator( - this, pointers, Safepoint::kLazyDeopt); - __ push(Immediate(Smi::FromInt(strict_mode_flag()))); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); -} - - void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { PushSafepointRegistersScope scope(this); __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); @@ -6474,20 +6456,6 @@ void LCodeGen::DoOsrEntry(LOsrEntry* instr) { } -void LCodeGen::DoIn(LIn* instr) { - LOperand* obj = instr->object(); - LOperand* key = instr->key(); - EmitPushTaggedOperand(key); - EmitPushTaggedOperand(obj); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - SafepointGenerator safepoint_generator( - this, pointers, Safepoint::kLazyDeopt); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); -} - - void LCodeGen::DoForInPrepareMap(LForInPrepareMap* instr) { __ cmp(eax, isolate()->factory()->undefined_value()); DeoptimizeIf(equal, instr->environment()); diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc index 7357b30b61..a8905b45cb 100644 --- a/src/ia32/lithium-ia32.cc +++ b/src/ia32/lithium-ia32.cc @@ -2580,15 +2580,6 @@ LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { } -LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { - LOperand* context = UseFixed(instr->context(), esi); - LOperand* object = UseAtStart(instr->object()); - LOperand* key = UseOrConstantAtStart(instr->key()); - LDeleteProperty* result = new(zone()) LDeleteProperty(context, object, key); - return MarkAsCall(DefineFixed(result, eax), instr); -} - - LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { ASSERT(argument_count_ == 0); allocator_->MarkAsOsrEntry(); @@ -2769,15 +2760,6 @@ LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { } -LInstruction* LChunkBuilder::DoIn(HIn* instr) { - LOperand* context = UseFixed(instr->context(), esi); - LOperand* key = UseOrConstantAtStart(instr->key()); - LOperand* object = UseOrConstantAtStart(instr->object()); - LIn* result = new(zone()) LIn(context, key, object); - return MarkAsCall(DefineFixed(result, eax), instr); -} - - LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { LOperand* context = UseFixed(instr->context(), esi); LOperand* object = UseFixed(instr->enumerable(), eax); diff --git a/src/ia32/lithium-ia32.h b/src/ia32/lithium-ia32.h index 7b332d2948..4efde2e0d8 100644 --- a/src/ia32/lithium-ia32.h +++ b/src/ia32/lithium-ia32.h @@ -87,7 +87,6 @@ class LCodeGen; V(Context) \ V(DebugBreak) \ V(DeclareGlobals) \ - V(DeleteProperty) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ @@ -101,7 +100,6 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ - V(In) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ @@ -2691,22 +2689,6 @@ class LTypeofIsAndBranch: public LControlInstruction<1, 0> { }; -class LDeleteProperty: public LTemplateInstruction<1, 3, 0> { - public: - LDeleteProperty(LOperand* context, LOperand* obj, LOperand* key) { - inputs_[0] = context; - inputs_[1] = obj; - inputs_[2] = key; - } - - LOperand* context() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - LOperand* key() { return inputs_[2]; } - - DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") -}; - - class LOsrEntry: public LTemplateInstruction<0, 0, 0> { public: LOsrEntry() {} @@ -2734,22 +2716,6 @@ class LStackCheck: public LTemplateInstruction<0, 1, 0> { }; -class LIn: public LTemplateInstruction<1, 3, 0> { - public: - LIn(LOperand* context, LOperand* key, LOperand* object) { - inputs_[0] = context; - inputs_[1] = key; - inputs_[2] = object; - } - - LOperand* context() { return inputs_[0]; } - LOperand* key() { return inputs_[1]; } - LOperand* object() { return inputs_[2]; } - - DECLARE_CONCRETE_INSTRUCTION(In, "in") -}; - - class LForInPrepareMap: public LTemplateInstruction<1, 2, 0> { public: LForInPrepareMap(LOperand* context, LOperand* object) { diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc index c0c1422a04..9dfc972bd9 100644 --- a/src/x64/lithium-codegen-x64.cc +++ b/src/x64/lithium-codegen-x64.cc @@ -5472,38 +5472,6 @@ void LCodeGen::DoDummyUse(LDummyUse* instr) { } -void LCodeGen::DoDeleteProperty(LDeleteProperty* instr) { - LOperand* obj = instr->object(); - LOperand* key = instr->key(); - EmitPushTaggedOperand(obj); - EmitPushTaggedOperand(key); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - // Create safepoint generator that will also ensure enough space in the - // reloc info for patching in deoptimization (since this is invoking a - // builtin) - SafepointGenerator safepoint_generator( - this, pointers, Safepoint::kLazyDeopt); - __ Push(Smi::FromInt(strict_mode_flag())); - __ InvokeBuiltin(Builtins::DELETE, CALL_FUNCTION, safepoint_generator); -} - - -void LCodeGen::DoIn(LIn* instr) { - LOperand* obj = instr->object(); - LOperand* key = instr->key(); - EmitPushTaggedOperand(key); - EmitPushTaggedOperand(obj); - ASSERT(instr->HasPointerMap()); - LPointerMap* pointers = instr->pointer_map(); - RecordPosition(pointers->position()); - SafepointGenerator safepoint_generator( - this, pointers, Safepoint::kLazyDeopt); - __ InvokeBuiltin(Builtins::IN, CALL_FUNCTION, safepoint_generator); -} - - void LCodeGen::DoDeferredStackCheck(LStackCheck* instr) { PushSafepointRegistersScope scope(this); __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); diff --git a/src/x64/lithium-x64.cc b/src/x64/lithium-x64.cc index 950bf4d761..4fa0683a02 100644 --- a/src/x64/lithium-x64.cc +++ b/src/x64/lithium-x64.cc @@ -2367,14 +2367,6 @@ LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { } -LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { - LOperand* object = UseAtStart(instr->object()); - LOperand* key = UseOrConstantAtStart(instr->key()); - LDeleteProperty* result = new(zone()) LDeleteProperty(object, key); - return MarkAsCall(DefineFixed(result, rax), instr); -} - - LInstruction* LChunkBuilder::DoOsrEntry(HOsrEntry* instr) { ASSERT(argument_count_ == 0); allocator_->MarkAsOsrEntry(); @@ -2548,14 +2540,6 @@ LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { } -LInstruction* LChunkBuilder::DoIn(HIn* instr) { - LOperand* key = UseOrConstantAtStart(instr->key()); - LOperand* object = UseOrConstantAtStart(instr->object()); - LIn* result = new(zone()) LIn(key, object); - return MarkAsCall(DefineFixed(result, rax), instr); -} - - LInstruction* LChunkBuilder::DoForInPrepareMap(HForInPrepareMap* instr) { LOperand* object = UseFixed(instr->enumerable(), rax); LForInPrepareMap* result = new(zone()) LForInPrepareMap(object); diff --git a/src/x64/lithium-x64.h b/src/x64/lithium-x64.h index 6efa9d3255..b065c8ccfe 100644 --- a/src/x64/lithium-x64.h +++ b/src/x64/lithium-x64.h @@ -92,7 +92,6 @@ class LCodeGen; V(Context) \ V(DebugBreak) \ V(DeclareGlobals) \ - V(DeleteProperty) \ V(Deoptimize) \ V(DivI) \ V(DoubleToI) \ @@ -107,7 +106,6 @@ class LCodeGen; V(Goto) \ V(HasCachedArrayIndexAndBranch) \ V(HasInstanceTypeAndBranch) \ - V(In) \ V(InstanceOf) \ V(InstanceOfKnownGlobal) \ V(InstanceSize) \ @@ -1033,20 +1031,6 @@ class LCmpT: public LTemplateInstruction<1, 2, 0> { }; -class LIn: public LTemplateInstruction<1, 2, 0> { - public: - LIn(LOperand* key, LOperand* object) { - inputs_[0] = key; - inputs_[1] = object; - } - - LOperand* key() { return inputs_[0]; } - LOperand* object() { return inputs_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(In, "in") -}; - - class LInstanceOf: public LTemplateInstruction<1, 2, 0> { public: LInstanceOf(LOperand* left, LOperand* right) { @@ -2481,20 +2465,6 @@ class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { }; -class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { - public: - LDeleteProperty(LOperand* obj, LOperand* key) { - inputs_[0] = obj; - inputs_[1] = key; - } - - LOperand* object() { return inputs_[0]; } - LOperand* key() { return inputs_[1]; } - - DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") -}; - - class LOsrEntry: public LTemplateInstruction<0, 0, 0> { public: LOsrEntry() {}