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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 LOperand* function = UseFixed(instr->function(), rdi); | 1095 LOperand* function = UseFixed(instr->function(), rdi); |
1096 | 1096 |
1097 LCallJSFunction* result = new(zone()) LCallJSFunction(function); | 1097 LCallJSFunction* result = new(zone()) LCallJSFunction(function); |
1098 | 1098 |
1099 return MarkAsCall(DefineFixed(result, rax), instr); | 1099 return MarkAsCall(DefineFixed(result, rax), instr); |
1100 } | 1100 } |
1101 | 1101 |
1102 | 1102 |
1103 LInstruction* LChunkBuilder::DoCallWithDescriptor( | 1103 LInstruction* LChunkBuilder::DoCallWithDescriptor( |
1104 HCallWithDescriptor* instr) { | 1104 HCallWithDescriptor* instr) { |
1105 const CallInterfaceDescriptor* descriptor = instr->descriptor(); | 1105 CallInterfaceDescriptor descriptor = instr->descriptor(); |
1106 | 1106 |
1107 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); | 1107 LOperand* target = UseRegisterOrConstantAtStart(instr->target()); |
1108 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); | 1108 ZoneList<LOperand*> ops(instr->OperandCount(), zone()); |
1109 ops.Add(target, zone()); | 1109 ops.Add(target, zone()); |
1110 for (int i = 1; i < instr->OperandCount(); i++) { | 1110 for (int i = 1; i < instr->OperandCount(); i++) { |
1111 LOperand* op = UseFixed(instr->OperandAt(i), | 1111 LOperand* op = |
1112 descriptor->GetParameterRegister(i - 1)); | 1112 UseFixed(instr->OperandAt(i), descriptor.GetParameterRegister(i - 1)); |
1113 ops.Add(op, zone()); | 1113 ops.Add(op, zone()); |
1114 } | 1114 } |
1115 | 1115 |
1116 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( | 1116 LCallWithDescriptor* result = new(zone()) LCallWithDescriptor( |
1117 descriptor, ops, zone()); | 1117 descriptor, ops, zone()); |
1118 return MarkAsCall(DefineFixed(result, rax), instr); | 1118 return MarkAsCall(DefineFixed(result, rax), instr); |
1119 } | 1119 } |
1120 | 1120 |
1121 | 1121 |
1122 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { | 1122 LInstruction* LChunkBuilder::DoInvokeFunction(HInvokeFunction* instr) { |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; | 2051 LLoadGlobalCell* result = new(zone()) LLoadGlobalCell; |
2052 return instr->RequiresHoleCheck() | 2052 return instr->RequiresHoleCheck() |
2053 ? AssignEnvironment(DefineAsRegister(result)) | 2053 ? AssignEnvironment(DefineAsRegister(result)) |
2054 : DefineAsRegister(result); | 2054 : DefineAsRegister(result); |
2055 } | 2055 } |
2056 | 2056 |
2057 | 2057 |
2058 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 2058 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
2059 LOperand* context = UseFixed(instr->context(), rsi); | 2059 LOperand* context = UseFixed(instr->context(), rsi); |
2060 LOperand* global_object = | 2060 LOperand* global_object = |
2061 UseFixed(instr->global_object(), LoadConvention::ReceiverRegister()); | 2061 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); |
2062 LOperand* vector = NULL; | 2062 LOperand* vector = NULL; |
2063 if (FLAG_vector_ics) { | 2063 if (FLAG_vector_ics) { |
2064 vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); | 2064 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); |
2065 } | 2065 } |
2066 | 2066 |
2067 LLoadGlobalGeneric* result = | 2067 LLoadGlobalGeneric* result = |
2068 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2068 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
2069 return MarkAsCall(DefineFixed(result, rax), instr); | 2069 return MarkAsCall(DefineFixed(result, rax), instr); |
2070 } | 2070 } |
2071 | 2071 |
2072 | 2072 |
2073 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { | 2073 LInstruction* LChunkBuilder::DoStoreGlobalCell(HStoreGlobalCell* instr) { |
2074 LOperand* value = UseRegister(instr->value()); | 2074 LOperand* value = UseRegister(instr->value()); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 return DefineFixed(new(zone()) LLoadNamedField(obj), rax); | 2124 return DefineFixed(new(zone()) LLoadNamedField(obj), rax); |
2125 } | 2125 } |
2126 LOperand* obj = UseRegisterAtStart(instr->object()); | 2126 LOperand* obj = UseRegisterAtStart(instr->object()); |
2127 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); | 2127 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
2128 } | 2128 } |
2129 | 2129 |
2130 | 2130 |
2131 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 2131 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
2132 LOperand* context = UseFixed(instr->context(), rsi); | 2132 LOperand* context = UseFixed(instr->context(), rsi); |
2133 LOperand* object = | 2133 LOperand* object = |
2134 UseFixed(instr->object(), LoadConvention::ReceiverRegister()); | 2134 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
2135 LOperand* vector = NULL; | 2135 LOperand* vector = NULL; |
2136 if (FLAG_vector_ics) { | 2136 if (FLAG_vector_ics) { |
2137 vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); | 2137 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); |
2138 } | 2138 } |
2139 LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( | 2139 LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( |
2140 context, object, vector); | 2140 context, object, vector); |
2141 return MarkAsCall(DefineFixed(result, rax), instr); | 2141 return MarkAsCall(DefineFixed(result, rax), instr); |
2142 } | 2142 } |
2143 | 2143 |
2144 | 2144 |
2145 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 2145 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
2146 HLoadFunctionPrototype* instr) { | 2146 HLoadFunctionPrototype* instr) { |
2147 return AssignEnvironment(DefineAsRegister( | 2147 return AssignEnvironment(DefineAsRegister( |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 instr->RequiresHoleCheck()) { | 2216 instr->RequiresHoleCheck()) { |
2217 result = AssignEnvironment(result); | 2217 result = AssignEnvironment(result); |
2218 } | 2218 } |
2219 return result; | 2219 return result; |
2220 } | 2220 } |
2221 | 2221 |
2222 | 2222 |
2223 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2223 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
2224 LOperand* context = UseFixed(instr->context(), rsi); | 2224 LOperand* context = UseFixed(instr->context(), rsi); |
2225 LOperand* object = | 2225 LOperand* object = |
2226 UseFixed(instr->object(), LoadConvention::ReceiverRegister()); | 2226 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
2227 LOperand* key = UseFixed(instr->key(), LoadConvention::NameRegister()); | 2227 LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); |
2228 LOperand* vector = NULL; | 2228 LOperand* vector = NULL; |
2229 if (FLAG_vector_ics) { | 2229 if (FLAG_vector_ics) { |
2230 vector = FixedTemp(FullVectorLoadConvention::VectorRegister()); | 2230 vector = FixedTemp(VectorLoadICDescriptor::VectorRegister()); |
2231 } | 2231 } |
2232 | 2232 |
2233 LLoadKeyedGeneric* result = | 2233 LLoadKeyedGeneric* result = |
2234 new(zone()) LLoadKeyedGeneric(context, object, key, vector); | 2234 new(zone()) LLoadKeyedGeneric(context, object, key, vector); |
2235 return MarkAsCall(DefineFixed(result, rax), instr); | 2235 return MarkAsCall(DefineFixed(result, rax), instr); |
2236 } | 2236 } |
2237 | 2237 |
2238 | 2238 |
2239 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2239 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
2240 ElementsKind elements_kind = instr->elements_kind(); | 2240 ElementsKind elements_kind = instr->elements_kind(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2298 : UseRegisterOrConstantAtStart(instr->key()); | 2298 : UseRegisterOrConstantAtStart(instr->key()); |
2299 } | 2299 } |
2300 LOperand* backing_store = UseRegister(instr->elements()); | 2300 LOperand* backing_store = UseRegister(instr->elements()); |
2301 return new(zone()) LStoreKeyed(backing_store, key, val); | 2301 return new(zone()) LStoreKeyed(backing_store, key, val); |
2302 } | 2302 } |
2303 | 2303 |
2304 | 2304 |
2305 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2305 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
2306 LOperand* context = UseFixed(instr->context(), rsi); | 2306 LOperand* context = UseFixed(instr->context(), rsi); |
2307 LOperand* object = | 2307 LOperand* object = |
2308 UseFixed(instr->object(), StoreConvention::ReceiverRegister()); | 2308 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
2309 LOperand* key = UseFixed(instr->key(), StoreConvention::NameRegister()); | 2309 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); |
2310 LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); | 2310 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
2311 | 2311 |
2312 DCHECK(instr->object()->representation().IsTagged()); | 2312 DCHECK(instr->object()->representation().IsTagged()); |
2313 DCHECK(instr->key()->representation().IsTagged()); | 2313 DCHECK(instr->key()->representation().IsTagged()); |
2314 DCHECK(instr->value()->representation().IsTagged()); | 2314 DCHECK(instr->value()->representation().IsTagged()); |
2315 | 2315 |
2316 LStoreKeyedGeneric* result = | 2316 LStoreKeyedGeneric* result = |
2317 new(zone()) LStoreKeyedGeneric(context, object, key, value); | 2317 new(zone()) LStoreKeyedGeneric(context, object, key, value); |
2318 return MarkAsCall(result, instr); | 2318 return MarkAsCall(result, instr); |
2319 } | 2319 } |
2320 | 2320 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 LOperand* temp = (!is_in_object || needs_write_barrier || | 2396 LOperand* temp = (!is_in_object || needs_write_barrier || |
2397 needs_write_barrier_for_map) ? TempRegister() : NULL; | 2397 needs_write_barrier_for_map) ? TempRegister() : NULL; |
2398 | 2398 |
2399 return new(zone()) LStoreNamedField(obj, val, temp); | 2399 return new(zone()) LStoreNamedField(obj, val, temp); |
2400 } | 2400 } |
2401 | 2401 |
2402 | 2402 |
2403 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2403 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2404 LOperand* context = UseFixed(instr->context(), rsi); | 2404 LOperand* context = UseFixed(instr->context(), rsi); |
2405 LOperand* object = | 2405 LOperand* object = |
2406 UseFixed(instr->object(), StoreConvention::ReceiverRegister()); | 2406 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
2407 LOperand* value = UseFixed(instr->value(), StoreConvention::ValueRegister()); | 2407 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
2408 | 2408 |
2409 LStoreNamedGeneric* result = | 2409 LStoreNamedGeneric* result = |
2410 new(zone()) LStoreNamedGeneric(context, object, value); | 2410 new(zone()) LStoreNamedGeneric(context, object, value); |
2411 return MarkAsCall(result, instr); | 2411 return MarkAsCall(result, instr); |
2412 } | 2412 } |
2413 | 2413 |
2414 | 2414 |
2415 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2415 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
2416 LOperand* context = UseFixed(instr->context(), rsi); | 2416 LOperand* context = UseFixed(instr->context(), rsi); |
2417 LOperand* left = UseFixed(instr->left(), rdx); | 2417 LOperand* left = UseFixed(instr->left(), rdx); |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2677 LOperand* function = UseRegisterAtStart(instr->function()); | 2677 LOperand* function = UseRegisterAtStart(instr->function()); |
2678 LAllocateBlockContext* result = | 2678 LAllocateBlockContext* result = |
2679 new(zone()) LAllocateBlockContext(context, function); | 2679 new(zone()) LAllocateBlockContext(context, function); |
2680 return MarkAsCall(DefineFixed(result, rsi), instr); | 2680 return MarkAsCall(DefineFixed(result, rsi), instr); |
2681 } | 2681 } |
2682 | 2682 |
2683 | 2683 |
2684 } } // namespace v8::internal | 2684 } } // namespace v8::internal |
2685 | 2685 |
2686 #endif // V8_TARGET_ARCH_X64 | 2686 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |