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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 if (value() == NULL) { | 373 if (value() == NULL) { |
374 DCHECK(hydrogen()->IsConstantHoleStore() && | 374 DCHECK(hydrogen()->IsConstantHoleStore() && |
375 hydrogen()->value()->representation().IsDouble()); | 375 hydrogen()->value()->representation().IsDouble()); |
376 stream->Add("<the hole(nan)>"); | 376 stream->Add("<the hole(nan)>"); |
377 } else { | 377 } else { |
378 value()->PrintTo(stream); | 378 value()->PrintTo(stream); |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 | 382 |
383 void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { | |
384 object()->PrintTo(stream); | |
385 stream->Add("["); | |
386 key()->PrintTo(stream); | |
387 stream->Add("] <- "); | |
388 value()->PrintTo(stream); | |
389 } | |
390 | |
391 | |
392 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { | 383 void LTransitionElementsKind::PrintDataTo(StringStream* stream) { |
393 object()->PrintTo(stream); | 384 object()->PrintTo(stream); |
394 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); | 385 stream->Add(" %p -> %p", *original_map(), *transitioned_map()); |
395 } | 386 } |
396 | 387 |
397 | 388 |
398 LPlatformChunk* LChunkBuilder::Build() { | 389 LPlatformChunk* LChunkBuilder::Build() { |
399 DCHECK(is_unused()); | 390 DCHECK(is_unused()); |
400 chunk_ = new(zone()) LPlatformChunk(info(), graph()); | 391 chunk_ = new(zone()) LPlatformChunk(info(), graph()); |
401 LPhase phase("L_Building chunk", chunk_); | 392 LPhase phase("L_Building chunk", chunk_); |
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 key = clobbers_key | 2198 key = clobbers_key |
2208 ? UseTempRegister(instr->key()) | 2199 ? UseTempRegister(instr->key()) |
2209 : UseRegisterOrConstantAtStart(instr->key()); | 2200 : UseRegisterOrConstantAtStart(instr->key()); |
2210 } | 2201 } |
2211 LOperand* backing_store = UseRegister(instr->elements()); | 2202 LOperand* backing_store = UseRegister(instr->elements()); |
2212 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); | 2203 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); |
2213 return new (zone()) LStoreKeyed(backing_store, key, val, backing_store_owner); | 2204 return new (zone()) LStoreKeyed(backing_store, key, val, backing_store_owner); |
2214 } | 2205 } |
2215 | 2206 |
2216 | 2207 |
2217 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | |
2218 LOperand* context = UseFixed(instr->context(), rsi); | |
2219 LOperand* object = | |
2220 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | |
2221 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); | |
2222 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | |
2223 | |
2224 DCHECK(instr->object()->representation().IsTagged()); | |
2225 DCHECK(instr->key()->representation().IsTagged()); | |
2226 DCHECK(instr->value()->representation().IsTagged()); | |
2227 | |
2228 LOperand* slot = FixedTemp(StoreWithVectorDescriptor::SlotRegister()); | |
2229 LOperand* vector = FixedTemp(StoreWithVectorDescriptor::VectorRegister()); | |
2230 | |
2231 LStoreKeyedGeneric* result = new (zone()) | |
2232 LStoreKeyedGeneric(context, object, key, value, slot, vector); | |
2233 return MarkAsCall(result, instr); | |
2234 } | |
2235 | |
2236 | |
2237 LInstruction* LChunkBuilder::DoTransitionElementsKind( | 2208 LInstruction* LChunkBuilder::DoTransitionElementsKind( |
2238 HTransitionElementsKind* instr) { | 2209 HTransitionElementsKind* instr) { |
2239 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { | 2210 if (IsSimpleMapChangeTransition(instr->from_kind(), instr->to_kind())) { |
2240 LOperand* object = UseRegister(instr->object()); | 2211 LOperand* object = UseRegister(instr->object()); |
2241 LOperand* new_map_reg = TempRegister(); | 2212 LOperand* new_map_reg = TempRegister(); |
2242 LOperand* temp_reg = TempRegister(); | 2213 LOperand* temp_reg = TempRegister(); |
2243 LTransitionElementsKind* result = new(zone()) LTransitionElementsKind( | 2214 LTransitionElementsKind* result = new(zone()) LTransitionElementsKind( |
2244 object, NULL, new_map_reg, temp_reg); | 2215 object, NULL, new_map_reg, temp_reg); |
2245 return result; | 2216 return result; |
2246 } else { | 2217 } else { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2546 LOperand* index = UseTempRegister(instr->index()); | 2517 LOperand* index = UseTempRegister(instr->index()); |
2547 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2518 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2548 LInstruction* result = DefineSameAsFirst(load); | 2519 LInstruction* result = DefineSameAsFirst(load); |
2549 return AssignPointerMap(result); | 2520 return AssignPointerMap(result); |
2550 } | 2521 } |
2551 | 2522 |
2552 } // namespace internal | 2523 } // namespace internal |
2553 } // namespace v8 | 2524 } // namespace v8 |
2554 | 2525 |
2555 #endif // V8_TARGET_ARCH_X64 | 2526 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |