| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2076 return DefineAsRegister(new(zone()) LConstantE); | 2076 return DefineAsRegister(new(zone()) LConstantE); |
| 2077 } else if (r.IsTagged()) { | 2077 } else if (r.IsTagged()) { |
| 2078 return DefineAsRegister(new(zone()) LConstantT); | 2078 return DefineAsRegister(new(zone()) LConstantT); |
| 2079 } else { | 2079 } else { |
| 2080 UNREACHABLE(); | 2080 UNREACHABLE(); |
| 2081 return NULL; | 2081 return NULL; |
| 2082 } | 2082 } |
| 2083 } | 2083 } |
| 2084 | 2084 |
| 2085 | 2085 |
| 2086 LInstruction* LChunkBuilder::DoLoadGlobalCell(HLoadGlobalCell* instr) { | |
| 2087 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; | |
| 2088 return instr->RequiresHoleCheck() | |
| 2089 ? AssignEnvironment(DefineAsRegister(result)) | |
| 2090 : DefineAsRegister(result); | |
| 2091 } | |
| 2092 | |
| 2093 | |
| 2094 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 2086 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
| 2095 LOperand* context = UseFixed(instr->context(), rsi); | 2087 LOperand* context = UseFixed(instr->context(), rsi); |
| 2096 LOperand* global_object = | 2088 LOperand* global_object = |
| 2097 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); | 2089 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); |
| 2098 LOperand* vector = NULL; | 2090 LOperand* vector = NULL; |
| 2099 if (instr->HasVectorAndSlot()) { | 2091 if (instr->HasVectorAndSlot()) { |
| 2100 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); | 2092 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); |
| 2101 } | 2093 } |
| 2102 | 2094 |
| 2103 LLoadGlobalGeneric* result = | 2095 LLoadGlobalGeneric* result = |
| 2104 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2096 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
| 2105 return MarkAsCall(DefineFixed(result, rax), instr); | 2097 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2106 } | 2098 } |
| 2107 | 2099 |
| 2108 | 2100 |
| 2109 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | |
| 2110 LOperand* value = UseRegister(instr->value()); | |
| 2111 // Use a temp to avoid reloading the cell value address in the case where | |
| 2112 // we perform a hole check. | |
| 2113 return instr->RequiresHoleCheck() | |
| 2114 ? AssignEnvironment(new(zone()) LStoreGlobalCell(value, TempRegister())) | |
| 2115 : new(zone()) LStoreGlobalCell(value, NULL); | |
| 2116 } | |
| 2117 | |
| 2118 | |
| 2119 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2101 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2120 LOperand* context = UseRegisterAtStart(instr->value()); | 2102 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2121 LInstruction* result = | 2103 LInstruction* result = |
| 2122 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 2104 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
| 2123 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2105 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
| 2124 result = AssignEnvironment(result); | 2106 result = AssignEnvironment(result); |
| 2125 } | 2107 } |
| 2126 return result; | 2108 return result; |
| 2127 } | 2109 } |
| 2128 | 2110 |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2711 LOperand* function = UseRegisterAtStart(instr->function()); | 2693 LOperand* function = UseRegisterAtStart(instr->function()); |
| 2712 LAllocateBlockContext* result = | 2694 LAllocateBlockContext* result = |
| 2713 new(zone()) LAllocateBlockContext(context, function); | 2695 new(zone()) LAllocateBlockContext(context, function); |
| 2714 return MarkAsCall(DefineFixed(result, rsi), instr); | 2696 return MarkAsCall(DefineFixed(result, rsi), instr); |
| 2715 } | 2697 } |
| 2716 | 2698 |
| 2717 | 2699 |
| 2718 } } // namespace v8::internal | 2700 } } // namespace v8::internal |
| 2719 | 2701 |
| 2720 #endif // V8_TARGET_ARCH_X64 | 2702 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |