| 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 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2478 | 2478 |
| 2479 | 2479 |
| 2480 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( | 2480 LInstruction* LChunkBuilder::DoIsConstructCallAndBranch( |
| 2481 HIsConstructCallAndBranch* instr) { | 2481 HIsConstructCallAndBranch* instr) { |
| 2482 return new(zone()) LIsConstructCallAndBranch(TempRegister()); | 2482 return new(zone()) LIsConstructCallAndBranch(TempRegister()); |
| 2483 } | 2483 } |
| 2484 | 2484 |
| 2485 | 2485 |
| 2486 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { | 2486 LInstruction* LChunkBuilder::DoSimulate(HSimulate* instr) { |
| 2487 HEnvironment* env = current_block_->last_environment(); | 2487 HEnvironment* env = current_block_->last_environment(); |
| 2488 ASSERT(env != NULL); | 2488 instr->ReplayEnvironment(env); |
| 2489 | |
| 2490 env->set_ast_id(instr->ast_id()); | |
| 2491 | |
| 2492 env->Drop(instr->pop_count()); | |
| 2493 for (int i = instr->values()->length() - 1; i >= 0; --i) { | |
| 2494 HValue* value = instr->values()->at(i); | |
| 2495 if (instr->HasAssignedIndexAt(i)) { | |
| 2496 env->Bind(instr->GetAssignedIndexAt(i), value); | |
| 2497 } else { | |
| 2498 env->Push(value); | |
| 2499 } | |
| 2500 } | |
| 2501 | 2489 |
| 2502 // If there is an instruction pending deoptimization environment create a | 2490 // If there is an instruction pending deoptimization environment create a |
| 2503 // lazy bailout instruction to capture the environment. | 2491 // lazy bailout instruction to capture the environment. |
| 2504 if (pending_deoptimization_ast_id_ == instr->ast_id()) { | 2492 if (pending_deoptimization_ast_id_ == instr->ast_id()) { |
| 2505 LInstruction* result = new(zone()) LLazyBailout; | 2493 LInstruction* result = new(zone()) LLazyBailout; |
| 2506 result = AssignEnvironment(result); | 2494 result = AssignEnvironment(result); |
| 2507 // Store the lazy deopt environment with the instruction if needed. Right | 2495 // Store the lazy deopt environment with the instruction if needed. Right |
| 2508 // now it is only used for LInstanceOfKnownGlobal. | 2496 // now it is only used for LInstanceOfKnownGlobal. |
| 2509 instruction_pending_deoptimization_environment_-> | 2497 instruction_pending_deoptimization_environment_-> |
| 2510 SetDeferredLazyDeoptimizationEnvironment(result->environment()); | 2498 SetDeferredLazyDeoptimizationEnvironment(result->environment()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2587 | 2575 |
| 2588 | 2576 |
| 2589 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2577 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2590 LOperand* object = UseRegister(instr->object()); | 2578 LOperand* object = UseRegister(instr->object()); |
| 2591 LOperand* index = UseRegister(instr->index()); | 2579 LOperand* index = UseRegister(instr->index()); |
| 2592 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2580 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2593 } | 2581 } |
| 2594 | 2582 |
| 2595 | 2583 |
| 2596 } } // namespace v8::internal | 2584 } } // namespace v8::internal |
| OLD | NEW |