| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
| 10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
| (...skipping 2080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2091 return DefineAsRegister(new (zone()) LConstantE); | 2091 return DefineAsRegister(new (zone()) LConstantE); |
| 2092 } else if (r.IsTagged()) { | 2092 } else if (r.IsTagged()) { |
| 2093 return DefineAsRegister(new (zone()) LConstantT); | 2093 return DefineAsRegister(new (zone()) LConstantT); |
| 2094 } else { | 2094 } else { |
| 2095 UNREACHABLE(); | 2095 UNREACHABLE(); |
| 2096 return NULL; | 2096 return NULL; |
| 2097 } | 2097 } |
| 2098 } | 2098 } |
| 2099 | 2099 |
| 2100 | 2100 |
| 2101 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { | |
| 2102 LLoadGlobalCell* result = new (zone()) LLoadGlobalCell; | |
| 2103 return instr->RequiresHoleCheck() | |
| 2104 ? AssignEnvironment(DefineAsRegister(result)) | |
| 2105 : DefineAsRegister(result); | |
| 2106 } | |
| 2107 | |
| 2108 | |
| 2109 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 2101 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
| 2110 LOperand* context = UseFixed(instr->context(), cp); | 2102 LOperand* context = UseFixed(instr->context(), cp); |
| 2111 LOperand* global_object = | 2103 LOperand* global_object = |
| 2112 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); | 2104 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); |
| 2113 LOperand* vector = NULL; | 2105 LOperand* vector = NULL; |
| 2114 if (instr->HasVectorAndSlot()) { | 2106 if (instr->HasVectorAndSlot()) { |
| 2115 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); | 2107 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); |
| 2116 } | 2108 } |
| 2117 LLoadGlobalGeneric* result = | 2109 LLoadGlobalGeneric* result = |
| 2118 new (zone()) LLoadGlobalGeneric(context, global_object, vector); | 2110 new (zone()) LLoadGlobalGeneric(context, global_object, vector); |
| 2119 return MarkAsCall(DefineFixed(result, r3), instr); | 2111 return MarkAsCall(DefineFixed(result, r3), instr); |
| 2120 } | 2112 } |
| 2121 | 2113 |
| 2122 | 2114 |
| 2123 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | |
| 2124 LOperand* value = UseRegister(instr->value()); | |
| 2125 // Use a temp to check the value in the cell in the case where we perform | |
| 2126 // a hole check. | |
| 2127 return instr->RequiresHoleCheck() | |
| 2128 ? AssignEnvironment(new (zone()) | |
| 2129 LStoreGlobalCell(value, TempRegister())) | |
| 2130 : new (zone()) LStoreGlobalCell(value, NULL); | |
| 2131 } | |
| 2132 | |
| 2133 | |
| 2134 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2115 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2135 LOperand* context = UseRegisterAtStart(instr->value()); | 2116 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2136 LInstruction* result = | 2117 LInstruction* result = |
| 2137 DefineAsRegister(new (zone()) LLoadContextSlot(context)); | 2118 DefineAsRegister(new (zone()) LLoadContextSlot(context)); |
| 2138 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2119 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
| 2139 result = AssignEnvironment(result); | 2120 result = AssignEnvironment(result); |
| 2140 } | 2121 } |
| 2141 return result; | 2122 return result; |
| 2142 } | 2123 } |
| 2143 | 2124 |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2625 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2606 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
| 2626 HAllocateBlockContext* instr) { | 2607 HAllocateBlockContext* instr) { |
| 2627 LOperand* context = UseFixed(instr->context(), cp); | 2608 LOperand* context = UseFixed(instr->context(), cp); |
| 2628 LOperand* function = UseRegisterAtStart(instr->function()); | 2609 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2629 LAllocateBlockContext* result = | 2610 LAllocateBlockContext* result = |
| 2630 new (zone()) LAllocateBlockContext(context, function); | 2611 new (zone()) LAllocateBlockContext(context, function); |
| 2631 return MarkAsCall(DefineFixed(result, cp), instr); | 2612 return MarkAsCall(DefineFixed(result, cp), instr); |
| 2632 } | 2613 } |
| 2633 } | 2614 } |
| 2634 } // namespace v8::internal | 2615 } // namespace v8::internal |
| OLD | NEW |