| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 | 651 |
| 652 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { | 652 LInstruction* LChunkBuilder::AssignEnvironment(LInstruction* instr) { |
| 653 HEnvironment* hydrogen_env = current_block_->last_environment(); | 653 HEnvironment* hydrogen_env = current_block_->last_environment(); |
| 654 instr->set_environment(CreateEnvironment(hydrogen_env)); | 654 instr->set_environment(CreateEnvironment(hydrogen_env)); |
| 655 return instr; | 655 return instr; |
| 656 } | 656 } |
| 657 | 657 |
| 658 | 658 |
| 659 LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment( | 659 LInstruction* LChunkBuilder::SetInstructionPendingDeoptimizationEnvironment( |
| 660 LInstruction* instr, int ast_id) { | 660 LInstruction* instr, int ast_id) { |
| 661 ASSERT(instructions_pending_deoptimization_environment_ == NULL); | 661 ASSERT(instruction_pending_deoptimization_environment_ == NULL); |
| 662 ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber); | 662 ASSERT(pending_deoptimization_ast_id_ == AstNode::kNoNumber); |
| 663 instructions_pending_deoptimization_environment_ = instr; | 663 instruction_pending_deoptimization_environment_ = instr; |
| 664 pending_deoptimization_ast_id_ = ast_id; | 664 pending_deoptimization_ast_id_ = ast_id; |
| 665 return instr; | 665 return instr; |
| 666 } | 666 } |
| 667 | 667 |
| 668 | 668 |
| 669 void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() { | 669 void LChunkBuilder::ClearInstructionPendingDeoptimizationEnvironment() { |
| 670 instructions_pending_deoptimization_environment_ = NULL; | 670 instruction_pending_deoptimization_environment_ = NULL; |
| 671 pending_deoptimization_ast_id_ = AstNode::kNoNumber; | 671 pending_deoptimization_ast_id_ = AstNode::kNoNumber; |
| 672 } | 672 } |
| 673 | 673 |
| 674 | 674 |
| 675 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, | 675 LInstruction* LChunkBuilder::MarkAsCall(LInstruction* instr, |
| 676 HInstruction* hinstr, | 676 HInstruction* hinstr, |
| 677 CanDeoptimize can_deoptimize) { | 677 CanDeoptimize can_deoptimize) { |
| 678 allocator_->MarkAsCall(); | 678 allocator_->MarkAsCall(); |
| 679 instr = AssignPointerMap(instr); | 679 instr = AssignPointerMap(instr); |
| 680 | 680 |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 return AssignEnvironment(DefineSameAsFirst(result)); | 1500 return AssignEnvironment(DefineSameAsFirst(result)); |
| 1501 } | 1501 } |
| 1502 | 1502 |
| 1503 | 1503 |
| 1504 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1504 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
| 1505 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), | 1505 return AssignEnvironment(new LBoundsCheck(UseRegisterAtStart(instr->index()), |
| 1506 Use(instr->length()))); | 1506 Use(instr->length()))); |
| 1507 } | 1507 } |
| 1508 | 1508 |
| 1509 | 1509 |
| 1510 LInstruction* LChunkBuilder::DoAbnormalExit(HAbnormalExit* instr) { |
| 1511 // The control instruction marking the end of a block that completed |
| 1512 // abruptly (e.g., threw an exception). There is nothing specific to do. |
| 1513 return NULL; |
| 1514 } |
| 1515 |
| 1516 |
| 1510 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { | 1517 LInstruction* LChunkBuilder::DoThrow(HThrow* instr) { |
| 1511 LOperand* value = UseFixed(instr->value(), eax); | 1518 LOperand* value = UseFixed(instr->value(), eax); |
| 1512 return MarkAsCall(new LThrow(value), instr); | 1519 return MarkAsCall(new LThrow(value), instr); |
| 1513 } | 1520 } |
| 1514 | 1521 |
| 1515 | 1522 |
| 1516 LInstruction* LChunkBuilder::DoChange(HChange* instr) { | 1523 LInstruction* LChunkBuilder::DoChange(HChange* instr) { |
| 1517 Representation from = instr->from(); | 1524 Representation from = instr->from(); |
| 1518 Representation to = instr->to(); | 1525 Representation to = instr->to(); |
| 1519 if (from.IsTagged()) { | 1526 if (from.IsTagged()) { |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 if (instr->HasAssignedIndexAt(i)) { | 1875 if (instr->HasAssignedIndexAt(i)) { |
| 1869 env->Bind(instr->GetAssignedIndexAt(i), value); | 1876 env->Bind(instr->GetAssignedIndexAt(i), value); |
| 1870 } else { | 1877 } else { |
| 1871 env->Push(value); | 1878 env->Push(value); |
| 1872 } | 1879 } |
| 1873 } | 1880 } |
| 1874 ASSERT(env->length() == instr->environment_length()); | 1881 ASSERT(env->length() == instr->environment_length()); |
| 1875 | 1882 |
| 1876 // If there is an instruction pending deoptimization environment create a | 1883 // If there is an instruction pending deoptimization environment create a |
| 1877 // lazy bailout instruction to capture the environment. | 1884 // lazy bailout instruction to capture the environment. |
| 1878 if (pending_deoptimization_ast_id_ == instr->ast_id()) { | 1885 if (pending_deoptimization_ast_id_ != AstNode::kNoNumber) { |
| 1886 ASSERT(pending_deoptimization_ast_id_ == instr->ast_id()); |
| 1879 LLazyBailout* lazy_bailout = new LLazyBailout; | 1887 LLazyBailout* lazy_bailout = new LLazyBailout; |
| 1880 LInstruction* result = AssignEnvironment(lazy_bailout); | 1888 LInstruction* result = AssignEnvironment(lazy_bailout); |
| 1881 instructions_pending_deoptimization_environment_-> | 1889 instruction_pending_deoptimization_environment_-> |
| 1882 set_deoptimization_environment(result->environment()); | 1890 set_deoptimization_environment(result->environment()); |
| 1883 ClearInstructionPendingDeoptimizationEnvironment(); | 1891 ClearInstructionPendingDeoptimizationEnvironment(); |
| 1884 return result; | 1892 return result; |
| 1885 } | 1893 } |
| 1886 | 1894 |
| 1887 return NULL; | 1895 return NULL; |
| 1888 } | 1896 } |
| 1889 | 1897 |
| 1890 | 1898 |
| 1891 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { | 1899 LInstruction* LChunkBuilder::DoStackCheck(HStackCheck* instr) { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1909 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 1917 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { |
| 1910 HEnvironment* outer = current_block_->last_environment()->outer(); | 1918 HEnvironment* outer = current_block_->last_environment()->outer(); |
| 1911 current_block_->UpdateEnvironment(outer); | 1919 current_block_->UpdateEnvironment(outer); |
| 1912 return NULL; | 1920 return NULL; |
| 1913 } | 1921 } |
| 1914 | 1922 |
| 1915 | 1923 |
| 1916 } } // namespace v8::internal | 1924 } } // namespace v8::internal |
| 1917 | 1925 |
| 1918 #endif // V8_TARGET_ARCH_IA32 | 1926 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |