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/mips/lithium-mips.h" | 5 #include "src/crankshaft/mips/lithium-mips.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 1943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 UNREACHABLE(); | 1954 UNREACHABLE(); |
1955 return NULL; | 1955 return NULL; |
1956 } | 1956 } |
1957 } | 1957 } |
1958 | 1958 |
1959 | 1959 |
1960 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { | 1960 LInstruction* LChunkBuilder::DoLoadGlobalGeneric(HLoadGlobalGeneric* instr) { |
1961 LOperand* context = UseFixed(instr->context(), cp); | 1961 LOperand* context = UseFixed(instr->context(), cp); |
1962 LOperand* global_object = | 1962 LOperand* global_object = |
1963 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); | 1963 UseFixed(instr->global_object(), LoadDescriptor::ReceiverRegister()); |
1964 LOperand* vector = NULL; | 1964 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
1965 if (instr->HasVectorAndSlot()) { | |
1966 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
1967 } | |
1968 LLoadGlobalGeneric* result = | 1965 LLoadGlobalGeneric* result = |
1969 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 1966 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
1970 return MarkAsCall(DefineFixed(result, v0), instr); | 1967 return MarkAsCall(DefineFixed(result, v0), instr); |
1971 } | 1968 } |
1972 | 1969 |
1973 | 1970 |
1974 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 1971 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
1975 LOperand* context = UseRegisterAtStart(instr->value()); | 1972 LOperand* context = UseRegisterAtStart(instr->value()); |
1976 LInstruction* result = | 1973 LInstruction* result = |
1977 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 1974 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
(...skipping 25 matching lines...) Expand all Loading... |
2003 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { | 2000 LInstruction* LChunkBuilder::DoLoadNamedField(HLoadNamedField* instr) { |
2004 LOperand* obj = UseRegisterAtStart(instr->object()); | 2001 LOperand* obj = UseRegisterAtStart(instr->object()); |
2005 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); | 2002 return DefineAsRegister(new(zone()) LLoadNamedField(obj)); |
2006 } | 2003 } |
2007 | 2004 |
2008 | 2005 |
2009 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { | 2006 LInstruction* LChunkBuilder::DoLoadNamedGeneric(HLoadNamedGeneric* instr) { |
2010 LOperand* context = UseFixed(instr->context(), cp); | 2007 LOperand* context = UseFixed(instr->context(), cp); |
2011 LOperand* object = | 2008 LOperand* object = |
2012 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2009 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
2013 LOperand* vector = NULL; | 2010 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
2014 if (instr->HasVectorAndSlot()) { | |
2015 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
2016 } | |
2017 | 2011 |
2018 LInstruction* result = | 2012 LInstruction* result = |
2019 DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), v0); | 2013 DefineFixed(new(zone()) LLoadNamedGeneric(context, object, vector), v0); |
2020 return MarkAsCall(result, instr); | 2014 return MarkAsCall(result, instr); |
2021 } | 2015 } |
2022 | 2016 |
2023 | 2017 |
2024 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( | 2018 LInstruction* LChunkBuilder::DoLoadFunctionPrototype( |
2025 HLoadFunctionPrototype* instr) { | 2019 HLoadFunctionPrototype* instr) { |
2026 return AssignEnvironment(DefineAsRegister( | 2020 return AssignEnvironment(DefineAsRegister( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2078 } | 2072 } |
2079 return result; | 2073 return result; |
2080 } | 2074 } |
2081 | 2075 |
2082 | 2076 |
2083 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2077 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
2084 LOperand* context = UseFixed(instr->context(), cp); | 2078 LOperand* context = UseFixed(instr->context(), cp); |
2085 LOperand* object = | 2079 LOperand* object = |
2086 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2080 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
2087 LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); | 2081 LOperand* key = UseFixed(instr->key(), LoadDescriptor::NameRegister()); |
2088 LOperand* vector = NULL; | 2082 LOperand* vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
2089 if (instr->HasVectorAndSlot()) { | |
2090 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | |
2091 } | |
2092 | 2083 |
2093 LInstruction* result = | 2084 LInstruction* result = |
2094 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 2085 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |
2095 v0); | 2086 v0); |
2096 return MarkAsCall(result, instr); | 2087 return MarkAsCall(result, instr); |
2097 } | 2088 } |
2098 | 2089 |
2099 | 2090 |
2100 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2091 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
2101 if (!instr->is_fixed_typed_array()) { | 2092 if (!instr->is_fixed_typed_array()) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2143 LOperand* context = UseFixed(instr->context(), cp); | 2134 LOperand* context = UseFixed(instr->context(), cp); |
2144 LOperand* obj = | 2135 LOperand* obj = |
2145 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2136 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
2146 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); | 2137 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); |
2147 LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2138 LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
2148 | 2139 |
2149 DCHECK(instr->object()->representation().IsTagged()); | 2140 DCHECK(instr->object()->representation().IsTagged()); |
2150 DCHECK(instr->key()->representation().IsTagged()); | 2141 DCHECK(instr->key()->representation().IsTagged()); |
2151 DCHECK(instr->value()->representation().IsTagged()); | 2142 DCHECK(instr->value()->representation().IsTagged()); |
2152 | 2143 |
2153 LOperand* slot = NULL; | 2144 LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
2154 LOperand* vector = NULL; | 2145 LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
2155 if (instr->HasVectorAndSlot()) { | |
2156 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | |
2157 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | |
2158 } | |
2159 | 2146 |
2160 LStoreKeyedGeneric* result = | 2147 LStoreKeyedGeneric* result = |
2161 new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); | 2148 new (zone()) LStoreKeyedGeneric(context, obj, key, val, slot, vector); |
2162 return MarkAsCall(result, instr); | 2149 return MarkAsCall(result, instr); |
2163 } | 2150 } |
2164 | 2151 |
2165 | 2152 |
2166 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2153 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2167 HTransitionElementsKind* instr) { | 2154 HTransitionElementsKind* instr) { |
2168 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2155 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2237 | 2224 |
2238 return new(zone()) LStoreNamedField(obj, val, temp); | 2225 return new(zone()) LStoreNamedField(obj, val, temp); |
2239 } | 2226 } |
2240 | 2227 |
2241 | 2228 |
2242 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { | 2229 LInstruction* LChunkBuilder::DoStoreNamedGeneric(HStoreNamedGeneric* instr) { |
2243 LOperand* context = UseFixed(instr->context(), cp); | 2230 LOperand* context = UseFixed(instr->context(), cp); |
2244 LOperand* obj = | 2231 LOperand* obj = |
2245 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2232 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
2246 LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2233 LOperand* val = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
2247 LOperand* slot = NULL; | 2234 LOperand* slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
2248 LOperand* vector = NULL; | 2235 LOperand* vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
2249 if (instr->HasVectorAndSlot()) { | |
2250 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | |
2251 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | |
2252 } | |
2253 | 2236 |
2254 LStoreNamedGeneric* result = | 2237 LStoreNamedGeneric* result = |
2255 new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector); | 2238 new (zone()) LStoreNamedGeneric(context, obj, val, slot, vector); |
2256 return MarkAsCall(result, instr); | 2239 return MarkAsCall(result, instr); |
2257 } | 2240 } |
2258 | 2241 |
2259 | 2242 |
2260 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2243 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
2261 LOperand* context = UseFixed(instr->context(), cp); | 2244 LOperand* context = UseFixed(instr->context(), cp); |
2262 LOperand* left = UseFixed(instr->left(), a1); | 2245 LOperand* left = UseFixed(instr->left(), a1); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2466 LOperand* index = UseTempRegister(instr->index()); | 2449 LOperand* index = UseTempRegister(instr->index()); |
2467 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2450 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2468 LInstruction* result = DefineSameAsFirst(load); | 2451 LInstruction* result = DefineSameAsFirst(load); |
2469 return AssignPointerMap(result); | 2452 return AssignPointerMap(result); |
2470 } | 2453 } |
2471 | 2454 |
2472 } // namespace internal | 2455 } // namespace internal |
2473 } // namespace v8 | 2456 } // namespace v8 |
2474 | 2457 |
2475 #endif // V8_TARGET_ARCH_MIPS | 2458 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |