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/ia32/lithium-ia32.h" | 5 #include "src/crankshaft/ia32/lithium-ia32.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 int index = GetNextSpillIndex(kind); | 365 int index = GetNextSpillIndex(kind); |
366 if (kind == DOUBLE_REGISTERS) { | 366 if (kind == DOUBLE_REGISTERS) { |
367 return LDoubleStackSlot::Create(index, zone()); | 367 return LDoubleStackSlot::Create(index, zone()); |
368 } else { | 368 } else { |
369 DCHECK(kind == GENERAL_REGISTERS); | 369 DCHECK(kind == GENERAL_REGISTERS); |
370 return LStackSlot::Create(index, zone()); | 370 return LStackSlot::Create(index, zone()); |
371 } | 371 } |
372 } | 372 } |
373 | 373 |
374 | 374 |
375 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) { | |
376 stream->Add("depth:%d slot:%d", depth(), slot_index()); | |
377 } | |
378 | |
379 | |
380 void LStoreNamedField::PrintDataTo(StringStream* stream) { | 375 void LStoreNamedField::PrintDataTo(StringStream* stream) { |
381 object()->PrintTo(stream); | 376 object()->PrintTo(stream); |
382 std::ostringstream os; | 377 std::ostringstream os; |
383 os << hydrogen()->access() << " <- "; | 378 os << hydrogen()->access() << " <- "; |
384 stream->Add(os.str().c_str()); | 379 stream->Add(os.str().c_str()); |
385 value()->PrintTo(stream); | 380 value()->PrintTo(stream); |
386 } | 381 } |
387 | 382 |
388 | 383 |
389 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { | 384 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
390 object()->PrintTo(stream); | 385 object()->PrintTo(stream); |
391 stream->Add("."); | 386 stream->Add("."); |
392 stream->Add(String::cast(*name())->ToCString().get()); | 387 stream->Add(String::cast(*name())->ToCString().get()); |
393 stream->Add(" <- "); | 388 stream->Add(" <- "); |
394 value()->PrintTo(stream); | 389 value()->PrintTo(stream); |
395 } | 390 } |
396 | 391 |
397 | 392 |
398 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) { | |
399 stream->Add("depth:%d slot:%d <- ", depth(), slot_index()); | |
400 value()->PrintTo(stream); | |
401 } | |
402 | |
403 | |
404 void LLoadKeyed::PrintDataTo(StringStream* stream) { | 393 void LLoadKeyed::PrintDataTo(StringStream* stream) { |
405 elements()->PrintTo(stream); | 394 elements()->PrintTo(stream); |
406 stream->Add("["); | 395 stream->Add("["); |
407 key()->PrintTo(stream); | 396 key()->PrintTo(stream); |
408 if (hydrogen()->IsDehoisted()) { | 397 if (hydrogen()->IsDehoisted()) { |
409 stream->Add(" + %d]", base_offset()); | 398 stream->Add(" + %d]", base_offset()); |
410 } else { | 399 } else { |
411 stream->Add("]"); | 400 stream->Add("]"); |
412 } | 401 } |
413 } | 402 } |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2129 if (instr->HasVectorAndSlot()) { | 2118 if (instr->HasVectorAndSlot()) { |
2130 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | 2119 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
2131 } | 2120 } |
2132 | 2121 |
2133 LLoadGlobalGeneric* result = | 2122 LLoadGlobalGeneric* result = |
2134 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2123 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
2135 return MarkAsCall(DefineFixed(result, eax), instr); | 2124 return MarkAsCall(DefineFixed(result, eax), instr); |
2136 } | 2125 } |
2137 | 2126 |
2138 | 2127 |
2139 LInstruction* LChunkBuilder::DoLoadGlobalViaContext( | |
2140 HLoadGlobalViaContext* instr) { | |
2141 LOperand* context = UseFixed(instr->context(), esi); | |
2142 DCHECK(instr->slot_index() > 0); | |
2143 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context); | |
2144 return MarkAsCall(DefineFixed(result, eax), instr); | |
2145 } | |
2146 | |
2147 | |
2148 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2128 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
2149 LOperand* context = UseRegisterAtStart(instr->value()); | 2129 LOperand* context = UseRegisterAtStart(instr->value()); |
2150 LInstruction* result = | 2130 LInstruction* result = |
2151 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 2131 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
2152 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2132 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
2153 result = AssignEnvironment(result); | 2133 result = AssignEnvironment(result); |
2154 } | 2134 } |
2155 return result; | 2135 return result; |
2156 } | 2136 } |
2157 | 2137 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2470 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | 2450 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
2471 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | 2451 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
2472 } | 2452 } |
2473 | 2453 |
2474 LStoreNamedGeneric* result = | 2454 LStoreNamedGeneric* result = |
2475 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); | 2455 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); |
2476 return MarkAsCall(result, instr); | 2456 return MarkAsCall(result, instr); |
2477 } | 2457 } |
2478 | 2458 |
2479 | 2459 |
2480 LInstruction* LChunkBuilder::DoStoreGlobalViaContext( | |
2481 HStoreGlobalViaContext* instr) { | |
2482 LOperand* context = UseFixed(instr->context(), esi); | |
2483 LOperand* value = UseFixed(instr->value(), | |
2484 StoreGlobalViaContextDescriptor::ValueRegister()); | |
2485 DCHECK(instr->slot_index() > 0); | |
2486 | |
2487 LStoreGlobalViaContext* result = | |
2488 new (zone()) LStoreGlobalViaContext(context, value); | |
2489 return MarkAsCall(result, instr); | |
2490 } | |
2491 | |
2492 | |
2493 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2460 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
2494 LOperand* context = UseFixed(instr->context(), esi); | 2461 LOperand* context = UseFixed(instr->context(), esi); |
2495 LOperand* left = UseFixed(instr->left(), edx); | 2462 LOperand* left = UseFixed(instr->left(), edx); |
2496 LOperand* right = UseFixed(instr->right(), eax); | 2463 LOperand* right = UseFixed(instr->right(), eax); |
2497 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); | 2464 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); |
2498 return MarkAsCall(DefineFixed(string_add, eax), instr); | 2465 return MarkAsCall(DefineFixed(string_add, eax), instr); |
2499 } | 2466 } |
2500 | 2467 |
2501 | 2468 |
2502 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2469 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2753 LAllocateBlockContext* result = | 2720 LAllocateBlockContext* result = |
2754 new(zone()) LAllocateBlockContext(context, function); | 2721 new(zone()) LAllocateBlockContext(context, function); |
2755 return MarkAsCall(DefineFixed(result, esi), instr); | 2722 return MarkAsCall(DefineFixed(result, esi), instr); |
2756 } | 2723 } |
2757 | 2724 |
2758 | 2725 |
2759 } // namespace internal | 2726 } // namespace internal |
2760 } // namespace v8 | 2727 } // namespace v8 |
2761 | 2728 |
2762 #endif // V8_TARGET_ARCH_IA32 | 2729 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |