| 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 <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
| 10 | 10 |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 int index = GetNextSpillIndex(kind); | 372 int index = GetNextSpillIndex(kind); |
| 373 if (kind == DOUBLE_REGISTERS) { | 373 if (kind == DOUBLE_REGISTERS) { |
| 374 return LDoubleStackSlot::Create(index, zone()); | 374 return LDoubleStackSlot::Create(index, zone()); |
| 375 } else { | 375 } else { |
| 376 DCHECK(kind == GENERAL_REGISTERS); | 376 DCHECK(kind == GENERAL_REGISTERS); |
| 377 return LStackSlot::Create(index, zone()); | 377 return LStackSlot::Create(index, zone()); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 | 380 |
| 381 | 381 |
| 382 void LLoadGlobalViaContext::PrintDataTo(StringStream* stream) { |
| 383 stream->Add(String::cast(*name())->ToCString().get()); |
| 384 stream->Add(" depth:%d slot:%d", depth(), slot_index()); |
| 385 } |
| 386 |
| 387 |
| 382 void LStoreNamedField::PrintDataTo(StringStream* stream) { | 388 void LStoreNamedField::PrintDataTo(StringStream* stream) { |
| 383 object()->PrintTo(stream); | 389 object()->PrintTo(stream); |
| 384 std::ostringstream os; | 390 std::ostringstream os; |
| 385 os << hydrogen()->access() << " <- "; | 391 os << hydrogen()->access() << " <- "; |
| 386 stream->Add(os.str().c_str()); | 392 stream->Add(os.str().c_str()); |
| 387 value()->PrintTo(stream); | 393 value()->PrintTo(stream); |
| 388 } | 394 } |
| 389 | 395 |
| 390 | 396 |
| 391 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { | 397 void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
| 392 object()->PrintTo(stream); | 398 object()->PrintTo(stream); |
| 393 stream->Add("."); | 399 stream->Add("."); |
| 394 stream->Add(String::cast(*name())->ToCString().get()); | 400 stream->Add(String::cast(*name())->ToCString().get()); |
| 395 stream->Add(" <- "); | 401 stream->Add(" <- "); |
| 396 value()->PrintTo(stream); | 402 value()->PrintTo(stream); |
| 397 } | 403 } |
| 398 | 404 |
| 399 | 405 |
| 406 void LStoreGlobalViaContext::PrintDataTo(StringStream* stream) { |
| 407 stream->Add(String::cast(*name())->ToCString().get()); |
| 408 stream->Add(" <- "); |
| 409 value()->PrintTo(stream); |
| 410 stream->Add(" depth:%d slot:%d", depth(), slot_index()); |
| 411 } |
| 412 |
| 413 |
| 400 void LLoadKeyed::PrintDataTo(StringStream* stream) { | 414 void LLoadKeyed::PrintDataTo(StringStream* stream) { |
| 401 elements()->PrintTo(stream); | 415 elements()->PrintTo(stream); |
| 402 stream->Add("["); | 416 stream->Add("["); |
| 403 key()->PrintTo(stream); | 417 key()->PrintTo(stream); |
| 404 if (hydrogen()->IsDehoisted()) { | 418 if (hydrogen()->IsDehoisted()) { |
| 405 stream->Add(" + %d]", base_offset()); | 419 stream->Add(" + %d]", base_offset()); |
| 406 } else { | 420 } else { |
| 407 stream->Add("]"); | 421 stream->Add("]"); |
| 408 } | 422 } |
| 409 } | 423 } |
| (...skipping 1727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2137 if (instr->HasVectorAndSlot()) { | 2151 if (instr->HasVectorAndSlot()) { |
| 2138 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); | 2152 vector = FixedTemp(LoadWithVectorDescriptor::VectorRegister()); |
| 2139 } | 2153 } |
| 2140 | 2154 |
| 2141 LLoadGlobalGeneric* result = | 2155 LLoadGlobalGeneric* result = |
| 2142 new(zone()) LLoadGlobalGeneric(context, global_object, vector); | 2156 new(zone()) LLoadGlobalGeneric(context, global_object, vector); |
| 2143 return MarkAsCall(DefineFixed(result, eax), instr); | 2157 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2144 } | 2158 } |
| 2145 | 2159 |
| 2146 | 2160 |
| 2161 LInstruction* LChunkBuilder::DoLoadGlobalViaContext( |
| 2162 HLoadGlobalViaContext* instr) { |
| 2163 LOperand* context = UseFixed(instr->context(), esi); |
| 2164 DCHECK(instr->slot_index() > 0); |
| 2165 LLoadGlobalViaContext* result = new (zone()) LLoadGlobalViaContext(context); |
| 2166 return MarkAsCall(DefineFixed(result, eax), instr); |
| 2167 } |
| 2168 |
| 2169 |
| 2147 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { | 2170 LInstruction* LChunkBuilder::DoLoadContextSlot(HLoadContextSlot* instr) { |
| 2148 LOperand* context = UseRegisterAtStart(instr->value()); | 2171 LOperand* context = UseRegisterAtStart(instr->value()); |
| 2149 LInstruction* result = | 2172 LInstruction* result = |
| 2150 DefineAsRegister(new(zone()) LLoadContextSlot(context)); | 2173 DefineAsRegister(new(zone()) LLoadContextSlot(context)); |
| 2151 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { | 2174 if (instr->RequiresHoleCheck() && instr->DeoptimizesOnHole()) { |
| 2152 result = AssignEnvironment(result); | 2175 result = AssignEnvironment(result); |
| 2153 } | 2176 } |
| 2154 return result; | 2177 return result; |
| 2155 } | 2178 } |
| 2156 | 2179 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); | 2499 slot = FixedTemp(VectorStoreICDescriptor::SlotRegister()); |
| 2477 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); | 2500 vector = FixedTemp(VectorStoreICDescriptor::VectorRegister()); |
| 2478 } | 2501 } |
| 2479 | 2502 |
| 2480 LStoreNamedGeneric* result = | 2503 LStoreNamedGeneric* result = |
| 2481 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); | 2504 new (zone()) LStoreNamedGeneric(context, object, value, slot, vector); |
| 2482 return MarkAsCall(result, instr); | 2505 return MarkAsCall(result, instr); |
| 2483 } | 2506 } |
| 2484 | 2507 |
| 2485 | 2508 |
| 2509 LInstruction* LChunkBuilder::DoStoreGlobalViaContext( |
| 2510 HStoreGlobalViaContext* instr) { |
| 2511 LOperand* context = UseFixed(instr->context(), esi); |
| 2512 LOperand* value = UseFixed(instr->value(), |
| 2513 StoreGlobalViaContextDescriptor::ValueRegister()); |
| 2514 DCHECK(instr->slot_index() > 0); |
| 2515 |
| 2516 LStoreGlobalViaContext* result = |
| 2517 new (zone()) LStoreGlobalViaContext(context, value); |
| 2518 return MarkAsCall(result, instr); |
| 2519 } |
| 2520 |
| 2521 |
| 2486 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { | 2522 LInstruction* LChunkBuilder::DoStringAdd(HStringAdd* instr) { |
| 2487 LOperand* context = UseFixed(instr->context(), esi); | 2523 LOperand* context = UseFixed(instr->context(), esi); |
| 2488 LOperand* left = UseFixed(instr->left(), edx); | 2524 LOperand* left = UseFixed(instr->left(), edx); |
| 2489 LOperand* right = UseFixed(instr->right(), eax); | 2525 LOperand* right = UseFixed(instr->right(), eax); |
| 2490 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); | 2526 LStringAdd* string_add = new(zone()) LStringAdd(context, left, right); |
| 2491 return MarkAsCall(DefineFixed(string_add, eax), instr); | 2527 return MarkAsCall(DefineFixed(string_add, eax), instr); |
| 2492 } | 2528 } |
| 2493 | 2529 |
| 2494 | 2530 |
| 2495 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { | 2531 LInstruction* LChunkBuilder::DoStringCharCodeAt(HStringCharCodeAt* instr) { |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2753 LAllocateBlockContext* result = | 2789 LAllocateBlockContext* result = |
| 2754 new(zone()) LAllocateBlockContext(context, function); | 2790 new(zone()) LAllocateBlockContext(context, function); |
| 2755 return MarkAsCall(DefineFixed(result, esi), instr); | 2791 return MarkAsCall(DefineFixed(result, esi), instr); |
| 2756 } | 2792 } |
| 2757 | 2793 |
| 2758 | 2794 |
| 2759 } // namespace internal | 2795 } // namespace internal |
| 2760 } // namespace v8 | 2796 } // namespace v8 |
| 2761 | 2797 |
| 2762 #endif // V8_TARGET_ARCH_IA32 | 2798 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |