| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 int index = GetNextSpillIndex(kind); | 360 int index = GetNextSpillIndex(kind); |
| 361 if (kind == DOUBLE_REGISTERS) { | 361 if (kind == DOUBLE_REGISTERS) { |
| 362 return LDoubleStackSlot::Create(index, zone()); | 362 return LDoubleStackSlot::Create(index, zone()); |
| 363 } else { | 363 } else { |
| 364 DCHECK(kind == GENERAL_REGISTERS); | 364 DCHECK(kind == GENERAL_REGISTERS); |
| 365 return LStackSlot::Create(index, zone()); | 365 return LStackSlot::Create(index, zone()); |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 | 368 |
| 369 | 369 |
| 370 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) { | |
| 371 stream->Add("depth:%d slot:%d", depth(), slot_index()); | |
| 372 } | |
| 373 | |
| 374 | |
| 375 void LStoreNamedField::PrintDataTo(StringStream* stream) { | 370 void LStoreNamedField::PrintDataTo(StringStream* stream) { |
| 376 object()->PrintTo(stream); | 371 object()->PrintTo(stream); |
| 377 std::ostringstream os; | 372 std::ostringstream os; |
| 378 os << hydrogen()->access() << " <- "; | 373 os << hydrogen()->access() << " <- "; |
| 379 stream->Add(os.str().c_str()); | 374 stream->Add(os.str().c_str()); |
| 380 value()->PrintTo(stream); | 375 value()->PrintTo(stream); |
| 381 } | 376 } |
| 382 | 377 |
| 383 | 378 |
| 384 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { | 379 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
| 385 object()->PrintTo(stream); | 380 object()->PrintTo(stream); |
| 386 stream->Add("."); | 381 stream->Add("."); |
| 387 stream->Add(String::cast(*name())->ToCString().get()); | 382 stream->Add(String::cast(*name())->ToCString().get()); |
| 388 stream->Add(" <- "); | 383 stream->Add(" <- "); |
| 389 value()->PrintTo(stream); | 384 value()->PrintTo(stream); |
| 390 } | 385 } |
| 391 | 386 |
| 392 | 387 |
| 393 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) { | |
| 394 stream->Add("depth:%d slot:%d <- ", depth(), slot_index()); | |
| 395 value()->PrintTo(stream); | |
| 396 } | |
| 397 | |
| 398 | |
| 399 void LLoadKeyed::PrintDataTo(StringStream* stream) { | 388 void LLoadKeyed::PrintDataTo(StringStream* stream) { |
| 400 elements()->PrintTo(stream); | 389 elements()->PrintTo(stream); |
| 401 stream->Add("["); | 390 stream->Add("["); |
| 402 key()->PrintTo(stream); | 391 key()->PrintTo(stream); |
| 403 if (hydrogen()->IsDehoisted()) { | 392 if (hydrogen()->IsDehoisted()) { |
| 404 stream->Add(" + %d]", base_offset()); | 393 stream->Add(" + %d]", base_offset()); |
| 405 } else { | 394 } else { |
| 406 stream->Add("]"); | 395 stream->Add("]"); |
| 407 } | 396 } |
| 408 } | 397 } |
| (...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 if (instr->HasVectorAndSlot()) { | 2081 if (instr->HasVectorAndSlot()) { |
| 2093 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | 2082 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
| 2094 } | 2083 } |
| 2095 | 2084 |
| 2096 LLoadGlobalGeneric* result = | 2085 LLoadGlobalGeneric* result = |
| 2097 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2086 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
| 2098 return MarkAsCall(DefineFixed(result, rax), instr); | 2087 return MarkAsCall(DefineFixed(result, rax), instr); |
| 2099 } | 2088 } |
| 2100 | 2089 |
| 2101 | 2090 |
| 2102 LInstruction* LChunkBuilder::DoLoadGlobalViaContext( | |
| 2103 HLoadGlobalViaContext* instr) { | |
| 2104 LOperand* context = UseFixed(instr->context(), rsi); | |
| 2105 DCHECK(instr->slot_index() > 0); | |
| 2106 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context); | |
| 2107 return MarkAsCall(DefineFixed(result, rax), instr); | |
| 2108 } | |
| 2109 | |
| 2110 | |
| 2111 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2091 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2112 LOperand* context = UseRegisterAtStart(instr->value()); | 2092 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2113 LInstruction* result = | 2093 LInstruction* result = |
| 2114 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 2094 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
| 2115 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2095 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
| 2116 result = AssignEnvironment(result); | 2096 result = AssignEnvironment(result); |
| 2117 } | 2097 } |
| 2118 return result; | 2098 return result; |
| 2119 } | 2099 } |
| 2120 | 2100 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2460 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | 2440 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
| 2461 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | 2441 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
| 2462 } | 2442 } |
| 2463 | 2443 |
| 2464 LStoreNamedGeneric* result = | 2444 LStoreNamedGeneric* result = |
| 2465 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); | 2445 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); |
| 2466 return MarkAsCall(result, instr); | 2446 return MarkAsCall(result, instr); |
| 2467 } | 2447 } |
| 2468 | 2448 |
| 2469 | 2449 |
| 2470 LInstruction* LChunkBuilder::DoStoreGlobalViaContext( | |
| 2471 HStoreGlobalViaContext* instr) { | |
| 2472 LOperand* context = UseFixed(instr->context(), rsi); | |
| 2473 LOperand* value = UseFixed(instr->value(), | |
| 2474 StoreGlobalViaContextDescriptor::ValueRegister()); | |
| 2475 DCHECK(instr->slot_index() > 0); | |
| 2476 | |
| 2477 LStoreGlobalViaContext* result = | |
| 2478 new (zone()) LStoreGlobalViaContext(context, value); | |
| 2479 return MarkAsCall(result, instr); | |
| 2480 } | |
| 2481 | |
| 2482 | |
| 2483 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2450 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| 2484 LOperand* context = UseFixed(instr->context(), rsi); | 2451 LOperand* context = UseFixed(instr->context(), rsi); |
| 2485 LOperand* left = UseFixed(instr->left(), rdx); | 2452 LOperand* left = UseFixed(instr->left(), rdx); |
| 2486 LOperand* right = UseFixed(instr->right(), rax); | 2453 LOperand* right = UseFixed(instr->right(), rax); |
| 2487 return MarkAsCall( | 2454 return MarkAsCall( |
| 2488 DefineFixed(new(zone()) LStringAdd(context, left, right), rax), instr); | 2455 DefineFixed(new(zone()) LStringAdd(context, left, right), rax), instr); |
| 2489 } | 2456 } |
| 2490 | 2457 |
| 2491 | 2458 |
| 2492 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2459 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2739 LAllocateBlockContext* result = | 2706 LAllocateBlockContext* result = |
| 2740 new(zone()) LAllocateBlockContext(context, function); | 2707 new(zone()) LAllocateBlockContext(context, function); |
| 2741 return MarkAsCall(DefineFixed(result, rsi), instr); | 2708 return MarkAsCall(DefineFixed(result, rsi), instr); |
| 2742 } | 2709 } |
| 2743 | 2710 |
| 2744 | 2711 |
| 2745 } // namespace internal | 2712 } // namespace internal |
| 2746 } // namespace v8 | 2713 } // namespace v8 |
| 2747 | 2714 |
| 2748 #endif // V8_TARGET_ARCH_X64 | 2715 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |