OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 V(ToFastProperties) \ | 165 V(ToFastProperties) \ |
166 V(TransitionElementsKind) \ | 166 V(TransitionElementsKind) \ |
167 V(Typeof) \ | 167 V(Typeof) \ |
168 V(TypeofIsAndBranch) \ | 168 V(TypeofIsAndBranch) \ |
169 V(UnaryMathOperation) \ | 169 V(UnaryMathOperation) \ |
170 V(UnknownOSRValue) \ | 170 V(UnknownOSRValue) \ |
171 V(ValueOf) \ | 171 V(ValueOf) \ |
172 V(ForInPrepareMap) \ | 172 V(ForInPrepareMap) \ |
173 V(ForInCacheArray) \ | 173 V(ForInCacheArray) \ |
174 V(CheckMapValue) \ | 174 V(CheckMapValue) \ |
175 V(LoadFieldByIndex) | 175 V(LoadFieldByIndex) \ |
| 176 V(WrapReceiver) |
176 | 177 |
177 | 178 |
178 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 179 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
179 virtual Opcode opcode() const { return LInstruction::k##type; } \ | 180 virtual Opcode opcode() const { return LInstruction::k##type; } \ |
180 virtual void CompileToNative(LCodeGen* generator); \ | 181 virtual void CompileToNative(LCodeGen* generator); \ |
181 virtual const char* Mnemonic() const { return mnemonic; } \ | 182 virtual const char* Mnemonic() const { return mnemonic; } \ |
182 static L##type* cast(LInstruction* instr) { \ | 183 static L##type* cast(LInstruction* instr) { \ |
183 ASSERT(instr->Is##type()); \ | 184 ASSERT(instr->Is##type()); \ |
184 return reinterpret_cast<L##type*>(instr); \ | 185 return reinterpret_cast<L##type*>(instr); \ |
185 } | 186 } |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } | 449 int true_block_id() { return hydrogen()->SuccessorAt(0)->block_id(); } |
449 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } | 450 int false_block_id() { return hydrogen()->SuccessorAt(1)->block_id(); } |
450 | 451 |
451 private: | 452 private: |
452 HControlInstruction* hydrogen() { | 453 HControlInstruction* hydrogen() { |
453 return HControlInstruction::cast(this->hydrogen_value()); | 454 return HControlInstruction::cast(this->hydrogen_value()); |
454 } | 455 } |
455 }; | 456 }; |
456 | 457 |
457 | 458 |
458 class LApplyArguments: public LTemplateInstruction<1, 4, 1> { | 459 class LWrapReceiver: public LTemplateInstruction<1, 2, 1> { |
| 460 public: |
| 461 LWrapReceiver(LOperand* receiver, |
| 462 LOperand* function, |
| 463 LOperand* temp) { |
| 464 inputs_[0] = receiver; |
| 465 inputs_[1] = function; |
| 466 temps_[0] = temp; |
| 467 } |
| 468 |
| 469 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") |
| 470 |
| 471 LOperand* receiver() { return inputs_[0]; } |
| 472 LOperand* function() { return inputs_[1]; } |
| 473 }; |
| 474 |
| 475 |
| 476 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { |
459 public: | 477 public: |
460 LApplyArguments(LOperand* function, | 478 LApplyArguments(LOperand* function, |
461 LOperand* receiver, | 479 LOperand* receiver, |
462 LOperand* length, | 480 LOperand* length, |
463 LOperand* elements, | 481 LOperand* elements) { |
464 LOperand* temp) { | |
465 inputs_[0] = function; | 482 inputs_[0] = function; |
466 inputs_[1] = receiver; | 483 inputs_[1] = receiver; |
467 inputs_[2] = length; | 484 inputs_[2] = length; |
468 inputs_[3] = elements; | 485 inputs_[3] = elements; |
469 temps_[0] = temp; | |
470 } | 486 } |
471 | 487 |
472 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") | 488 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") |
473 | 489 |
474 LOperand* function() { return inputs_[0]; } | 490 LOperand* function() { return inputs_[0]; } |
475 LOperand* receiver() { return inputs_[1]; } | 491 LOperand* receiver() { return inputs_[1]; } |
476 LOperand* length() { return inputs_[2]; } | 492 LOperand* length() { return inputs_[2]; } |
477 LOperand* elements() { return inputs_[3]; } | 493 LOperand* elements() { return inputs_[3]; } |
478 }; | 494 }; |
479 | 495 |
(...skipping 1994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2474 | 2490 |
2475 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2491 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2476 }; | 2492 }; |
2477 | 2493 |
2478 #undef DECLARE_HYDROGEN_ACCESSOR | 2494 #undef DECLARE_HYDROGEN_ACCESSOR |
2479 #undef DECLARE_CONCRETE_INSTRUCTION | 2495 #undef DECLARE_CONCRETE_INSTRUCTION |
2480 | 2496 |
2481 } } // namespace v8::internal | 2497 } } // namespace v8::internal |
2482 | 2498 |
2483 #endif // V8_IA32_LITHIUM_IA32_H_ | 2499 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |