| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 ASSERT(instr->value()->representation().IsTagged()); | 2151 ASSERT(instr->value()->representation().IsTagged()); |
| 2152 | 2152 |
| 2153 LStoreKeyedGeneric* result = | 2153 LStoreKeyedGeneric* result = |
| 2154 new(zone()) LStoreKeyedGeneric(context, object, key, value); | 2154 new(zone()) LStoreKeyedGeneric(context, object, key, value); |
| 2155 return MarkAsCall(result, instr); | 2155 return MarkAsCall(result, instr); |
| 2156 } | 2156 } |
| 2157 | 2157 |
| 2158 | 2158 |
| 2159 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2159 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
| 2160 HTransitionElementsKind* instr) { | 2160 HTransitionElementsKind* instr) { |
| 2161 LOperand* object = UseRegister(instr->object()); |
| 2161 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2162 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
| 2162 LOperand* object = UseRegister(instr->object()); | 2163 LOperand* object = UseRegister(instr->object()); |
| 2163 LOperand* new_map_reg = TempRegister(); | 2164 LOperand* new_map_reg = TempRegister(); |
| 2164 LOperand* temp_reg = TempRegister(); | 2165 LOperand* temp_reg = TempRegister(); |
| 2165 LTransitionElementsKind* result = | 2166 LTransitionElementsKind* result = |
| 2166 new(zone()) LTransitionElementsKind(object, new_map_reg, temp_reg); | 2167 new(zone()) LTransitionElementsKind(object, NULL, |
| 2167 return DefineSameAsFirst(result); | 2168 new_map_reg, temp_reg); |
| 2169 return result; |
| 2170 } else if (FLAG_compiled_transitions) { |
| 2171 LOperand* context = UseRegister(instr->context()); |
| 2172 LTransitionElementsKind* result = |
| 2173 new(zone()) LTransitionElementsKind(object, context, NULL, NULL); |
| 2174 return AssignPointerMap(result); |
| 2168 } else { | 2175 } else { |
| 2169 LOperand* object = UseFixed(instr->object(), eax); | 2176 LOperand* object = UseFixed(instr->object(), eax); |
| 2170 LOperand* fixed_object_reg = FixedTemp(edx); | 2177 LOperand* fixed_object_reg = FixedTemp(edx); |
| 2171 LOperand* new_map_reg = FixedTemp(ebx); | 2178 LOperand* new_map_reg = FixedTemp(ebx); |
| 2172 LTransitionElementsKind* result = | 2179 LTransitionElementsKind* result = |
| 2173 new(zone()) LTransitionElementsKind(object, | 2180 new(zone()) LTransitionElementsKind(object, |
| 2181 NULL, |
| 2174 new_map_reg, | 2182 new_map_reg, |
| 2175 fixed_object_reg); | 2183 fixed_object_reg); |
| 2176 return MarkAsCall(DefineFixed(result, eax), instr); | 2184 return MarkAsCall(result, instr); |
| 2177 } | 2185 } |
| 2178 } | 2186 } |
| 2179 | 2187 |
| 2180 | 2188 |
| 2189 LInstruction* LChunkBuilder::DoTrapAllocationMemento( |
| 2190 HTrapAllocationMemento* instr) { |
| 2191 LOperand* object = UseRegister(instr->object()); |
| 2192 LOperand* temp = TempRegister(); |
| 2193 LTrapAllocationMemento* result = |
| 2194 new(zone()) LTrapAllocationMemento(object, temp); |
| 2195 return AssignEnvironment(result); |
| 2196 } |
| 2197 |
| 2198 |
| 2181 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { | 2199 LInstruction* LChunkBuilder::DoStoreNamedField(HStoreNamedField* instr) { |
| 2182 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2200 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2183 bool needs_write_barrier_for_map = !instr->transition().is_null() && | 2201 bool needs_write_barrier_for_map = !instr->transition().is_null() && |
| 2184 instr->NeedsWriteBarrierForMap(); | 2202 instr->NeedsWriteBarrierForMap(); |
| 2185 | 2203 |
| 2186 LOperand* obj; | 2204 LOperand* obj; |
| 2187 if (needs_write_barrier) { | 2205 if (needs_write_barrier) { |
| 2188 obj = instr->is_in_object() | 2206 obj = instr->is_in_object() |
| 2189 ? UseRegister(instr->object()) | 2207 ? UseRegister(instr->object()) |
| 2190 : UseTempRegister(instr->object()); | 2208 : UseTempRegister(instr->object()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2249 } | 2267 } |
| 2250 | 2268 |
| 2251 | 2269 |
| 2252 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { | 2270 LInstruction* LChunkBuilder::DoStringLength(HStringLength* instr) { |
| 2253 LOperand* string = UseRegisterAtStart(instr->value()); | 2271 LOperand* string = UseRegisterAtStart(instr->value()); |
| 2254 return DefineAsRegister(new(zone()) LStringLength(string)); | 2272 return DefineAsRegister(new(zone()) LStringLength(string)); |
| 2255 } | 2273 } |
| 2256 | 2274 |
| 2257 | 2275 |
| 2258 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { | 2276 LInstruction* LChunkBuilder::DoAllocateObject(HAllocateObject* instr) { |
| 2259 LOperand* context = UseFixed(instr->context(), esi); | 2277 info()->MarkAsDeferredCalling(); |
| 2278 LOperand* context = UseAny(instr->context()); |
| 2260 LOperand* temp = TempRegister(); | 2279 LOperand* temp = TempRegister(); |
| 2261 LAllocateObject* result = new(zone()) LAllocateObject(context, temp); | 2280 LAllocateObject* result = new(zone()) LAllocateObject(context, temp); |
| 2262 return AssignPointerMap(DefineAsRegister(result)); | 2281 return AssignPointerMap(DefineAsRegister(result)); |
| 2263 } | 2282 } |
| 2264 | 2283 |
| 2265 | 2284 |
| 2285 LInstruction* LChunkBuilder::DoAllocate(HAllocate* instr) { |
| 2286 info()->MarkAsDeferredCalling(); |
| 2287 LOperand* context = UseAny(instr->context()); |
| 2288 LOperand* size = UseTempRegister(instr->size()); |
| 2289 LOperand* temp = TempRegister(); |
| 2290 LAllocate* result = new(zone()) LAllocate(context, size, temp); |
| 2291 return AssignPointerMap(DefineAsRegister(result)); |
| 2292 } |
| 2293 |
| 2294 |
| 2266 LInstruction* LChunkBuilder::DoFastLiteral(HFastLiteral* instr) { | 2295 LInstruction* LChunkBuilder::DoFastLiteral(HFastLiteral* instr) { |
| 2267 LOperand* context = UseFixed(instr->context(), esi); | 2296 LOperand* context = UseFixed(instr->context(), esi); |
| 2268 return MarkAsCall( | 2297 return MarkAsCall( |
| 2269 DefineFixed(new(zone()) LFastLiteral(context), eax), instr); | 2298 DefineFixed(new(zone()) LFastLiteral(context), eax), instr); |
| 2270 } | 2299 } |
| 2271 | 2300 |
| 2272 | 2301 |
| 2273 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { | 2302 LInstruction* LChunkBuilder::DoArrayLiteral(HArrayLiteral* instr) { |
| 2274 LOperand* context = UseFixed(instr->context(), esi); | 2303 LOperand* context = UseFixed(instr->context(), esi); |
| 2275 return MarkAsCall( | 2304 return MarkAsCall( |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2511 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2540 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2512 LOperand* object = UseRegister(instr->object()); | 2541 LOperand* object = UseRegister(instr->object()); |
| 2513 LOperand* index = UseTempRegister(instr->index()); | 2542 LOperand* index = UseTempRegister(instr->index()); |
| 2514 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2543 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2515 } | 2544 } |
| 2516 | 2545 |
| 2517 | 2546 |
| 2518 } } // namespace v8::internal | 2547 } } // namespace v8::internal |
| 2519 | 2548 |
| 2520 #endif // V8_TARGET_ARCH_IA32 | 2549 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |