| 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/crankshaft/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 1977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 UNREACHABLE(); | 1988 UNREACHABLE(); |
| 1989 return NULL; | 1989 return NULL; |
| 1990 } | 1990 } |
| 1991 } | 1991 } |
| 1992 | 1992 |
| 1993 | 1993 |
| 1994 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 1994 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
| 1995 LOperand* context = UseFixed(instr->context(), rsi); | 1995 LOperand* context = UseFixed(instr->context(), rsi); |
| 1996 LOperand* global_object = | 1996 LOperand* global_object = |
| 1997 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); | 1997 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); |
| 1998 LOperand* vector = NULL; | 1998 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
| 1999 if (instr->HasVectorAndSlot()) { | |
| 2000 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
| 2001 } | |
| 2002 | 1999 |
| 2003 LLoadGlobalGeneric* result = | 2000 LLoadGlobalGeneric* result = |
| 2004 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2001 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
| 2005 return MarkAsCall(DefineFixed(result, rax), instr); | 2002 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2006 } | 2003 } |
| 2007 | 2004 |
| 2008 | 2005 |
| 2009 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2006 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2010 LOperand* context = UseRegisterAtStart(instr->value()); | 2007 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2011 LInstruction* result = | 2008 LInstruction* result = |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2051 } | 2048 } |
| 2052 LOperand* obj = UseRegisterAtStart(instr->object()); | 2049 LOperand* obj = UseRegisterAtStart(instr->object()); |
| 2053 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); | 2050 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
| 2054 } | 2051 } |
| 2055 | 2052 |
| 2056 | 2053 |
| 2057 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 2054 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
| 2058 LOperand* context = UseFixed(instr->context(), rsi); | 2055 LOperand* context = UseFixed(instr->context(), rsi); |
| 2059 LOperand* object = | 2056 LOperand* object = |
| 2060 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2057 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
| 2061 LOperand* vector = NULL; | 2058 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
| 2062 if (instr->HasVectorAndSlot()) { | |
| 2063 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
| 2064 } | |
| 2065 LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( | 2059 LLoadNamedGeneric* result = new(zone()) LLoadNamedGeneric( |
| 2066 context, object, vector); | 2060 context, object, vector); |
| 2067 return MarkAsCall(DefineFixed(result, rax), instr); | 2061 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2068 } | 2062 } |
| 2069 | 2063 |
| 2070 | 2064 |
| 2071 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 2065 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
| 2072 HLoadFunctionPrototype* instr) { | 2066 HLoadFunctionPrototype* instr) { |
| 2073 return AssignEnvironment(DefineAsRegister( | 2067 return AssignEnvironment(DefineAsRegister( |
| 2074 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); | 2068 new(zone()) LLoadFunctionPrototype(UseRegister(instr->function())))); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2152 } | 2146 } |
| 2153 return result; | 2147 return result; |
| 2154 } | 2148 } |
| 2155 | 2149 |
| 2156 | 2150 |
| 2157 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2151 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
| 2158 LOperand* context = UseFixed(instr->context(), rsi); | 2152 LOperand* context = UseFixed(instr->context(), rsi); |
| 2159 LOperand* object = | 2153 LOperand* object = |
| 2160 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2154 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
| 2161 LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); | 2155 LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); |
| 2162 LOperand* vector = NULL; | 2156 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
| 2163 if (instr->HasVectorAndSlot()) { | |
| 2164 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
| 2165 } | |
| 2166 | 2157 |
| 2167 LLoadKeyedGeneric* result = | 2158 LLoadKeyedGeneric* result = |
| 2168 new(zone()) LLoadKeyedGeneric(context, object, key, vector); | 2159 new(zone()) LLoadKeyedGeneric(context, object, key, vector); |
| 2169 return MarkAsCall(DefineFixed(result, rax), instr); | 2160 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2170 } | 2161 } |
| 2171 | 2162 |
| 2172 | 2163 |
| 2173 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2164 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| 2174 ElementsKind elements_kind = instr->elements_kind(); | 2165 ElementsKind elements_kind = instr->elements_kind(); |
| 2175 | 2166 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2236 LOperand* context = UseFixed(instr->context(), rsi); | 2227 LOperand* context = UseFixed(instr->context(), rsi); |
| 2237 LOperand* object = | 2228 LOperand* object = |
| 2238 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2229 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
| 2239 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); | 2230 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); |
| 2240 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2231 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
| 2241 | 2232 |
| 2242 DCHECK(instr->object()->representation().IsTagged()); | 2233 DCHECK(instr->object()->representation().IsTagged()); |
| 2243 DCHECK(instr->key()->representation().IsTagged()); | 2234 DCHECK(instr->key()->representation().IsTagged()); |
| 2244 DCHECK(instr->value()->representation().IsTagged()); | 2235 DCHECK(instr->value()->representation().IsTagged()); |
| 2245 | 2236 |
| 2246 LOperand* slot = NULL; | 2237 LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
| 2247 LOperand* vector = NULL; | 2238 LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
| 2248 if (instr->HasVectorAndSlot()) { | |
| 2249 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | |
| 2250 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | |
| 2251 } | |
| 2252 | 2239 |
| 2253 LStoreKeyedGeneric* result = new (zone()) | 2240 LStoreKeyedGeneric* result = new (zone()) |
| 2254 LStoreKeyedGeneric(context, object, key, value, slot, vector); | 2241 LStoreKeyedGeneric(context, object, key, value, slot, vector); |
| 2255 return MarkAsCall(result, instr); | 2242 return MarkAsCall(result, instr); |
| 2256 } | 2243 } |
| 2257 | 2244 |
| 2258 | 2245 |
| 2259 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2246 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| 2260 HTransitionElementsKind* instr) { | 2247 HTransitionElementsKind* instr) { |
| 2261 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2248 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2348 | 2335 |
| 2349 return new(zone()) LStoreNamedField(obj, val, temp); | 2336 return new(zone()) LStoreNamedField(obj, val, temp); |
| 2350 } | 2337 } |
| 2351 | 2338 |
| 2352 | 2339 |
| 2353 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2340 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
| 2354 LOperand* context = UseFixed(instr->context(), rsi); | 2341 LOperand* context = UseFixed(instr->context(), rsi); |
| 2355 LOperand* object = | 2342 LOperand* object = |
| 2356 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2343 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
| 2357 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2344 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
| 2358 LOperand* slot = NULL; | 2345 LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
| 2359 LOperand* vector = NULL; | 2346 LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
| 2360 if (instr->HasVectorAndSlot()) { | |
| 2361 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | |
| 2362 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | |
| 2363 } | |
| 2364 | 2347 |
| 2365 LStoreNamedGeneric* result = | 2348 LStoreNamedGeneric* result = |
| 2366 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); | 2349 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); |
| 2367 return MarkAsCall(result, instr); | 2350 return MarkAsCall(result, instr); |
| 2368 } | 2351 } |
| 2369 | 2352 |
| 2370 | 2353 |
| 2371 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2354 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| 2372 LOperand* context = UseFixed(instr->context(), rsi); | 2355 LOperand* context = UseFixed(instr->context(), rsi); |
| 2373 LOperand* left = UseFixed(instr->left(), rdx); | 2356 LOperand* left = UseFixed(instr->left(), rdx); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2586 LOperand* index = UseTempRegister(instr->index()); | 2569 LOperand* index = UseTempRegister(instr->index()); |
| 2587 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2570 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
| 2588 LInstruction* result = DefineSameAsFirst(load); | 2571 LInstruction* result = DefineSameAsFirst(load); |
| 2589 return AssignPointerMap(result); | 2572 return AssignPointerMap(result); |
| 2590 } | 2573 } |
| 2591 | 2574 |
| 2592 } // namespace internal | 2575 } // namespace internal |
| 2593 } // namespace v8 | 2576 } // namespace v8 |
| 2594 | 2577 |
| 2595 #endif // V8_TARGET_ARCH_X64 | 2578 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |