| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 24 matching lines...) Expand all Loading... |
| 35 namespace internal { | 35 namespace internal { |
| 36 | 36 |
| 37 | 37 |
| 38 #define DEFINE_COMPILE(type) \ | 38 #define DEFINE_COMPILE(type) \ |
| 39 void L##type::CompileToNative(LCodeGen* generator) { \ | 39 void L##type::CompileToNative(LCodeGen* generator) { \ |
| 40 generator->Do##type(this); \ | 40 generator->Do##type(this); \ |
| 41 } | 41 } |
| 42 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) | 42 LITHIUM_CONCRETE_INSTRUCTION_LIST(DEFINE_COMPILE) |
| 43 #undef DEFINE_COMPILE | 43 #undef DEFINE_COMPILE |
| 44 | 44 |
| 45 #ifdef DEBUG |
| 46 void LInstruction::VerifyCall() { |
| 47 // Call instructions can use only fixed registers as temporaries and |
| 48 // outputs because all registers are blocked by the calling convention. |
| 49 // Inputs operands must use a fixed register or use-at-start policy or |
| 50 // a non-register policy. |
| 51 ASSERT(Output() == NULL || |
| 52 LUnallocated::cast(Output())->HasFixedPolicy() || |
| 53 !LUnallocated::cast(Output())->HasRegisterPolicy()); |
| 54 for (UseIterator it(this); !it.Done(); it.Advance()) { |
| 55 LUnallocated* operand = LUnallocated::cast(it.Current()); |
| 56 ASSERT(operand->HasFixedPolicy() || |
| 57 operand->IsUsedAtStart()); |
| 58 } |
| 59 for (TempIterator it(this); !it.Done(); it.Advance()) { |
| 60 LUnallocated* operand = LUnallocated::cast(it.Current()); |
| 61 ASSERT(operand->HasFixedPolicy() ||!operand->HasRegisterPolicy()); |
| 62 } |
| 63 } |
| 64 #endif |
| 65 |
| 45 | 66 |
| 46 void LLabel::PrintDataTo(StringStream* stream) { | 67 void LLabel::PrintDataTo(StringStream* stream) { |
| 47 LGap::PrintDataTo(stream); | 68 LGap::PrintDataTo(stream); |
| 48 LLabel* rep = replacement(); | 69 LLabel* rep = replacement(); |
| 49 if (rep != NULL) { | 70 if (rep != NULL) { |
| 50 stream->Add(" Dead block replaced with B%d", rep->block_id()); | 71 stream->Add(" Dead block replaced with B%d", rep->block_id()); |
| 51 } | 72 } |
| 52 } | 73 } |
| 53 | 74 |
| 54 | 75 |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 LInstruction* LChunkBuilder::DefineFixedDouble( | 500 LInstruction* LChunkBuilder::DefineFixedDouble( |
| 480 LTemplateInstruction<1, I, T>* instr, DoubleRegister reg) { | 501 LTemplateInstruction<1, I, T>* instr, DoubleRegister reg) { |
| 481 return Define(instr, ToUnallocated(reg)); | 502 return Define(instr, ToUnallocated(reg)); |
| 482 } | 503 } |
| 483 | 504 |
| 484 | 505 |
| 485 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, | 506 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| 486 HInstruction* hinstr, | 507 HInstruction* hinstr, |
| 487 CanDeoptimize can_deoptimize) { | 508 CanDeoptimize can_deoptimize) { |
| 488 info()->MarkAsNonDeferredCalling(); | 509 info()->MarkAsNonDeferredCalling(); |
| 489 // TODO(all): Verify call in debug mode. | 510 #ifdef DEBUG |
| 511 instr->VerifyCall(); |
| 512 #endif |
| 490 instr->MarkAsCall(); | 513 instr->MarkAsCall(); |
| 491 instr = AssignPointerMap(instr); | 514 instr = AssignPointerMap(instr); |
| 492 | 515 |
| 493 if (hinstr->HasObservableSideEffects()) { | 516 if (hinstr->HasObservableSideEffects()) { |
| 494 ASSERT(hinstr->next()->IsSimulate()); | 517 ASSERT(hinstr->next()->IsSimulate()); |
| 495 HSimulate* sim = HSimulate::cast(hinstr->next()); | 518 HSimulate* sim = HSimulate::cast(hinstr->next()); |
| 496 ASSERT(instruction_pending_deoptimization_environment_ == NULL); | 519 ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| 497 ASSERT(pending_deoptimization_ast_id_.IsNone()); | 520 ASSERT(pending_deoptimization_ast_id_.IsNone()); |
| 498 instruction_pending_deoptimization_environment_ = instr; | 521 instruction_pending_deoptimization_environment_ = instr; |
| 499 pending_deoptimization_ast_id_ = sim->ast_id(); | 522 pending_deoptimization_ast_id_ = sim->ast_id(); |
| (...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { | 2529 LInstruction* LChunkBuilder::DoWrapReceiver(HWrapReceiver* instr) { |
| 2507 LOperand* receiver = UseRegister(instr->receiver()); | 2530 LOperand* receiver = UseRegister(instr->receiver()); |
| 2508 LOperand* function = UseRegisterAtStart(instr->function()); | 2531 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2509 LOperand* temp = TempRegister(); | 2532 LOperand* temp = TempRegister(); |
| 2510 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); | 2533 LWrapReceiver* result = new(zone()) LWrapReceiver(receiver, function, temp); |
| 2511 return AssignEnvironment(DefineAsRegister(result)); | 2534 return AssignEnvironment(DefineAsRegister(result)); |
| 2512 } | 2535 } |
| 2513 | 2536 |
| 2514 | 2537 |
| 2515 } } // namespace v8::internal | 2538 } } // namespace v8::internal |
| OLD | NEW |