| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 | 648 |
| 649 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { | 649 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
| 650 HEnvironment* hydrogen_env = current_block_->last_environment(); | 650 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 651 instr->set_environment(CreateEnvironment(hydrogen_env)); | 651 instr->set_environment(CreateEnvironment(hydrogen_env)); |
| 652 return instr; | 652 return instr; |
| 653 } | 653 } |
| 654 | 654 |
| 655 | 655 |
| 656 LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment( | 656 LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment( |
| 657 LInstruction* instr, int ast_id) { | 657 LInstruction* instr, int ast_id) { |
| 658 ASSERT(instructions_pending_deoptimization_environment_ == NULL); | 658 ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| 659 ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber); | 659 ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber); |
| 660 instructions_pending_deoptimization_environment_ = instr; | 660 instruction_pending_deoptimization_environment_ = instr; |
| 661 pending_deoptimization_ast_id_ = ast_id; | 661 pending_deoptimization_ast_id_ = ast_id; |
| 662 return instr; | 662 return instr; |
| 663 } | 663 } |
| 664 | 664 |
| 665 | 665 |
| 666 void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() { | 666 void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() { |
| 667 instructions_pending_deoptimization_environment_ = NULL; | 667 instruction_pending_deoptimization_environment_ = NULL; |
| 668 pending_deoptimization_ast_id_ = AstNode::kNoNumber; | 668 pending_deoptimization_ast_id_ = AstNode::kNoNumber; |
| 669 } | 669 } |
| 670 | 670 |
| 671 | 671 |
| 672 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, | 672 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| 673 HInstruction* hinstr, | 673 HInstruction* hinstr, |
| 674 CanDeoptimize can_deoptimize) { | 674 CanDeoptimize can_deoptimize) { |
| 675 allocator_->MarkAsCall(); | 675 allocator_->MarkAsCall(); |
| 676 instr = AssignPointerMap(instr); | 676 instr = AssignPointerMap(instr); |
| 677 | 677 |
| (...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 return AssignEnvironment(DefineSameAsFirst(result)); | 1456 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1457 } | 1457 } |
| 1458 | 1458 |
| 1459 | 1459 |
| 1460 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1460 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
| 1461 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), | 1461 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), |
| 1462 UseRegister(instr->length()))); | 1462 UseRegister(instr->length()))); |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 | 1465 |
| 1466 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { |
| 1467 // The control instruction marking the end of a block that completed |
| 1468 // abruptly (e.g., threw an exception). There is nothing specific to do. |
| 1469 return NULL; |
| 1470 } |
| 1471 |
| 1472 |
| 1466 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { | 1473 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
| 1467 LOperand* value = UseFixed(instr->value(), r0); | 1474 LOperand* value = UseFixed(instr->value(), r0); |
| 1468 return MarkAsCall(new LThrow(value), instr); | 1475 return MarkAsCall(new LThrow(value), instr); |
| 1469 } | 1476 } |
| 1470 | 1477 |
| 1471 | 1478 |
| 1472 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1479 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
| 1473 Representation from = instr->from(); | 1480 Representation from = instr->from(); |
| 1474 Representation to = instr->to(); | 1481 Representation to = instr->to(); |
| 1475 if (from.IsTagged()) { | 1482 if (from.IsTagged()) { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 } | 1837 } |
| 1831 } | 1838 } |
| 1832 | 1839 |
| 1833 ASSERT(env->length() == instr->environment_length()); | 1840 ASSERT(env->length() == instr->environment_length()); |
| 1834 | 1841 |
| 1835 // If there is an instruction pending deoptimization environment create a | 1842 // If there is an instruction pending deoptimization environment create a |
| 1836 // lazy bailout instruction to capture the environment. | 1843 // lazy bailout instruction to capture the environment. |
| 1837 if (pending_deoptimization_ast_id_ == instr->ast_id()) { | 1844 if (pending_deoptimization_ast_id_ == instr->ast_id()) { |
| 1838 LInstruction* result = new LLazyBailout; | 1845 LInstruction* result = new LLazyBailout; |
| 1839 result = AssignEnvironment(result); | 1846 result = AssignEnvironment(result); |
| 1840 instructions_pending_deoptimization_environment_-> | 1847 instruction_pending_deoptimization_environment_-> |
| 1841 set_deoptimization_environment(result->environment()); | 1848 set_deoptimization_environment(result->environment()); |
| 1842 ClearInstructionPendingDeoptimizationEnvironment(); | 1849 ClearInstructionPendingDeoptimizationEnvironment(); |
| 1843 return result; | 1850 return result; |
| 1844 } | 1851 } |
| 1845 | 1852 |
| 1846 return NULL; | 1853 return NULL; |
| 1847 } | 1854 } |
| 1848 | 1855 |
| 1849 | 1856 |
| 1850 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { | 1857 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1866 | 1873 |
| 1867 | 1874 |
| 1868 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1875 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 1869 HEnvironment* outer = current_block_->last_environment()->outer(); | 1876 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 1870 current_block_->UpdateEnvironment(outer); | 1877 current_block_->UpdateEnvironment(outer); |
| 1871 return NULL; | 1878 return NULL; |
| 1872 } | 1879 } |
| 1873 | 1880 |
| 1874 | 1881 |
| 1875 } } // namespace v8::internal | 1882 } } // namespace v8::internal |
| OLD | NEW |