Chromium Code Reviews| Index: src/ia32/lithium-ia32.cc |
| diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
| index 1bece63f476332a011417ff6e37a3d61ae6963ad..795f4e82f491814cd19b2c3e66b02d47544e36ca 100644 |
| --- a/src/ia32/lithium-ia32.cc |
| +++ b/src/ia32/lithium-ia32.cc |
| @@ -824,9 +824,10 @@ LInstruction* LChunkBuilder::DoBit(Token::Value op, |
| ASSERT(instr->left()->representation().IsTagged()); |
| ASSERT(instr->right()->representation().IsTagged()); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* left = UseFixed(instr->left(), edx); |
| LOperand* right = UseFixed(instr->right(), eax); |
| - LArithmeticT* result = new LArithmeticT(op, left, right); |
| + LArithmeticT* result = new LArithmeticT(op, context, left, right); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| } |
| @@ -838,18 +839,19 @@ LInstruction* LChunkBuilder::DoShift(Token::Value op, |
| ASSERT(instr->left()->representation().IsTagged()); |
| ASSERT(instr->right()->representation().IsTagged()); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* left = UseFixed(instr->left(), edx); |
| LOperand* right = UseFixed(instr->right(), eax); |
| - LArithmeticT* result = new LArithmeticT(op, left, right); |
| + LArithmeticT* result = new LArithmeticT(op, context, left, right); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| ASSERT(instr->representation().IsInteger32()); |
| - ASSERT(instr->OperandAt(0)->representation().IsInteger32()); |
| - ASSERT(instr->OperandAt(1)->representation().IsInteger32()); |
| - LOperand* left = UseRegisterAtStart(instr->OperandAt(0)); |
| + ASSERT(instr->left()->representation().IsInteger32()); |
| + ASSERT(instr->right()->representation().IsInteger32()); |
| + LOperand* left = UseRegisterAtStart(instr->left()); |
| - HValue* right_value = instr->OperandAt(1); |
| + HValue* right_value = instr->right(); |
| LOperand* right = NULL; |
| int constant_value = 0; |
| if (right_value->IsConstant()) { |
| @@ -903,12 +905,15 @@ LInstruction* LChunkBuilder::DoArithmeticT(Token::Value op, |
| HValue* right = instr->right(); |
| ASSERT(left->representation().IsTagged()); |
| ASSERT(right->representation().IsTagged()); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* left_operand = UseFixed(left, edx); |
| LOperand* right_operand = UseFixed(right, eax); |
| - LArithmeticT* result = new LArithmeticT(op, left_operand, right_operand); |
| + LArithmeticT* result = |
| + new LArithmeticT(op, context, left_operand, right_operand); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| + |
| void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |
| ASSERT(is_building()); |
| current_block_ = block; |
| @@ -1155,7 +1160,8 @@ LInstruction* LChunkBuilder::DoInstanceOfKnownGlobal( |
| HInstanceOfKnownGlobal* instr) { |
| LInstanceOfKnownGlobal* result = |
| new LInstanceOfKnownGlobal( |
| - UseFixed(instr->value(), InstanceofStub::left()), |
| + UseFixed(instr->context(), esi), |
| + UseFixed(instr->left(), InstanceofStub::left()), |
| FixedTemp(edi)); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| @@ -1232,16 +1238,19 @@ LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
| if (op == kMathLog) { |
| ASSERT(instr->representation().IsDouble()); |
| ASSERT(instr->value()->representation().IsDouble()); |
| + LOperand* context = UseAny(instr->context()); // Not actually used. |
| LOperand* input = UseRegisterAtStart(instr->value()); |
| - LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| + LUnaryMathOperation* result = new LUnaryMathOperation(context, input); |
| return DefineSameAsFirst(result); |
| } else if (op == kMathSin || op == kMathCos) { |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* input = UseFixedDouble(instr->value(), xmm1); |
| - LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| + LUnaryMathOperation* result = new LUnaryMathOperation(context, input); |
| return MarkAsCall(DefineFixedDouble(result, xmm1), instr); |
| } else { |
| LOperand* input = UseRegisterAtStart(instr->value()); |
| - LUnaryMathOperation* result = new LUnaryMathOperation(input); |
| + LOperand* context = UseAny(instr->context()); // Deferred use by MathAbs. |
| + LUnaryMathOperation* result = new LUnaryMathOperation(context, input); |
| switch (op) { |
| case kMathAbs: |
| return AssignEnvironment(AssignPointerMap(DefineSameAsFirst(result))); |
| @@ -1312,7 +1321,8 @@ LInstruction* LChunkBuilder::DoCallFunction(HCallFunction* instr) { |
| LInstruction* LChunkBuilder::DoCallRuntime(HCallRuntime* instr) { |
| argument_count_ -= instr->argument_count(); |
| - return MarkAsCall(DefineFixed(new LCallRuntime, eax), instr); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| + return MarkAsCall(DefineFixed(new LCallRuntime(context), eax), instr); |
| } |
| @@ -1511,9 +1521,10 @@ LInstruction* LChunkBuilder::DoCompare(HCompare* instr) { |
| ASSERT(instr->left()->representation().IsTagged()); |
| ASSERT(instr->right()->representation().IsTagged()); |
| bool reversed = (op == Token::GT || op == Token::LTE); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* left = UseFixed(instr->left(), reversed ? eax : edx); |
| LOperand* right = UseFixed(instr->right(), reversed ? edx : eax); |
| - LCmpT* result = new LCmpT(left, right); |
| + LCmpT* result = new LCmpT(context, left, right); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| } |
| @@ -1646,8 +1657,9 @@ LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { |
| LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* value = UseFixed(instr->value(), eax); |
| - return MarkAsCall(new LThrow(value), instr); |
| + return MarkAsCall(new LThrow(context, value), instr); |
| } |
| @@ -1905,13 +1917,16 @@ LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
| LInstruction* LChunkBuilder::DoLoadNamedFieldPolymorphic( |
| HLoadNamedFieldPolymorphic* instr) { |
| ASSERT(instr->representation().IsTagged()); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| if (instr->need_generic()) { |
| LOperand* obj = UseFixed(instr->object(), eax); |
| - LLoadNamedFieldPolymorphic* result = new LLoadNamedFieldPolymorphic(obj); |
| + LLoadNamedFieldPolymorphic* result = |
| + new LLoadNamedFieldPolymorphic(context,obj); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } else { |
| LOperand* obj = UseRegisterAtStart(instr->object()); |
| - LLoadNamedFieldPolymorphic* result = new LLoadNamedFieldPolymorphic(obj); |
| + LLoadNamedFieldPolymorphic* result = |
| + new LLoadNamedFieldPolymorphic(context, obj); |
| return AssignEnvironment(DefineAsRegister(result)); |
| } |
| } |
| @@ -2092,23 +2107,27 @@ LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
| LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| + LOperand* context = UseFixed(instr->context(), esi); |
| LOperand* left = UseOrConstantAtStart(instr->left()); |
| LOperand* right = UseOrConstantAtStart(instr->right()); |
| - return MarkAsCall(DefineFixed(new LStringAdd(left, right), eax), instr); |
| + LStringAdd* string_add = new LStringAdd(context, left, right); |
| + return MarkAsCall(DefineFixed(string_add, eax), instr); |
| } |
| LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
| LOperand* string = UseRegister(instr->string()); |
| LOperand* index = UseRegisterOrConstant(instr->index()); |
| - LStringCharCodeAt* result = new LStringCharCodeAt(string, index); |
| + LOperand* context = UseAny(instr->context()); |
| + LStringCharCodeAt* result = new LStringCharCodeAt(context, string, index); |
| return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| } |
| LInstruction* LChunkBuilder::DoStringCharFromCode(HStringCharFromCode* instr) { |
| LOperand* char_code = UseRegister(instr->value()); |
| - LStringCharFromCode* result = new LStringCharFromCode(char_code); |
| + LOperand* context = UseAny(instr->context()); |
| + LStringCharFromCode* result = new LStringCharFromCode(context, char_code); |
| return AssignPointerMap(DefineAsRegister(result)); |
| } |
| @@ -2120,7 +2139,8 @@ LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { |
| LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
| - return MarkAsCall(DefineFixed(new LArrayLiteral, eax), instr); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| + return MarkAsCall(DefineFixed(new LArrayLiteral(context), eax), instr); |
| } |
| @@ -2131,18 +2151,21 @@ LInstruction* LChunkBuilder::DoObjectLiteral(HObjectLiteral* instr) { |
| LInstruction* LChunkBuilder::DoRegExpLiteral(HRegExpLiteral* instr) { |
| - return MarkAsCall(DefineFixed(new LRegExpLiteral, eax), instr); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| + return MarkAsCall(DefineFixed(new LRegExpLiteral(context), eax), instr); |
| } |
| LInstruction* LChunkBuilder::DoFunctionLiteral(HFunctionLiteral* instr) { |
| - return MarkAsCall(DefineFixed(new LFunctionLiteral, eax), instr); |
| + LOperand* context = UseFixed(instr->context(), esi); |
| + return MarkAsCall(DefineFixed(new LFunctionLiteral(context), eax), instr); |
| } |
| LInstruction* LChunkBuilder::DoDeleteProperty(HDeleteProperty* instr) { |
| LDeleteProperty* result = |
| - new LDeleteProperty(UseAtStart(instr->object()), |
| + new LDeleteProperty(UseFixed(instr->context(), esi), |
|
Kevin Millikin (Chromium)
2011/06/29 08:36:20
I like to name these UseXXX subexpressions and lin
William Hesse
2011/06/29 10:30:21
Done.
|
| + UseAtStart(instr->object()), |
| UseOrConstantAtStart(instr->key())); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| @@ -2205,7 +2228,8 @@ LInstruction* LChunkBuilder::DoToFastProperties(HToFastProperties* instr) { |
| LInstruction* LChunkBuilder::DoTypeof(HTypeof* instr) { |
| - LTypeof* result = new LTypeof(UseAtStart(instr->value())); |
| + LTypeof* result = new LTypeof(UseFixed(instr->context(), esi), |
| + UseAtStart(instr->value())); |
| return MarkAsCall(DefineFixed(result, eax), instr); |
| } |
| @@ -2254,10 +2278,11 @@ LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { |
| LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { |
| if (instr->is_function_entry()) { |
| - return MarkAsCall(new LStackCheck, instr); |
| + return MarkAsCall(new LStackCheck(UseFixed(instr->context(), esi)), instr); |
| } else { |
| ASSERT(instr->is_backwards_branch()); |
| - return AssignEnvironment(AssignPointerMap(new LStackCheck)); |
| + return AssignEnvironment(AssignPointerMap( |
| + new LStackCheck(UseAny(instr->context())))); |
| } |
| } |