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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 length()->PrintTo(stream); | 337 length()->PrintTo(stream); |
338 | 338 |
339 stream->Add(" index "); | 339 stream->Add(" index "); |
340 index()->PrintTo(stream); | 340 index()->PrintTo(stream); |
341 } | 341 } |
342 | 342 |
343 | 343 |
344 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) { | 344 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) { |
345 // Skip a slot if for a double-width slot. | 345 // Skip a slot if for a double-width slot. |
346 if (kind == DOUBLE_REGISTERS) { | 346 if (kind == DOUBLE_REGISTERS) { |
347 spill_slot_count_++; | 347 current_frame_slots_++; |
348 spill_slot_count_ |= 1; | 348 current_frame_slots_ |= 1; |
349 num_double_slots_++; | 349 num_double_slots_++; |
350 } | 350 } |
351 return spill_slot_count_++; | 351 return current_frame_slots_++; |
352 } | 352 } |
353 | 353 |
354 | 354 |
355 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) { | 355 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) { |
356 int index = GetNextSpillIndex(kind); | 356 int index = GetNextSpillIndex(kind); |
357 if (kind == DOUBLE_REGISTERS) { | 357 if (kind == DOUBLE_REGISTERS) { |
358 return LDoubleStackSlot::Create(index, zone()); | 358 return LDoubleStackSlot::Create(index, zone()); |
359 } else { | 359 } else { |
360 DCHECK(kind == GENERAL_REGISTERS); | 360 DCHECK(kind == GENERAL_REGISTERS); |
361 return LStackSlot::Create(index, zone()); | 361 return LStackSlot::Create(index, zone()); |
(...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2505 spill_index = env_index - instr->environment()->first_local_index(); | 2505 spill_index = env_index - instr->environment()->first_local_index(); |
2506 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { | 2506 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { |
2507 Retry(kNotEnoughSpillSlotsForOsr); | 2507 Retry(kNotEnoughSpillSlotsForOsr); |
2508 spill_index = 0; | 2508 spill_index = 0; |
2509 } | 2509 } |
2510 if (spill_index == 0) { | 2510 if (spill_index == 0) { |
2511 // The dynamic frame alignment state overwrites the first local. | 2511 // The dynamic frame alignment state overwrites the first local. |
2512 // The first local is saved at the end of the unoptimized frame. | 2512 // The first local is saved at the end of the unoptimized frame. |
2513 spill_index = graph()->osr()->UnoptimizedFrameSlots(); | 2513 spill_index = graph()->osr()->UnoptimizedFrameSlots(); |
2514 } | 2514 } |
| 2515 spill_index += StandardFrameConstants::kFixedSlotCount; |
2515 } | 2516 } |
2516 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); | 2517 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); |
2517 } | 2518 } |
2518 | 2519 |
2519 | 2520 |
2520 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { | 2521 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { |
2521 LOperand* context = UseFixed(instr->context(), esi); | 2522 LOperand* context = UseFixed(instr->context(), esi); |
2522 LCallStub* result = new(zone()) LCallStub(context); | 2523 LCallStub* result = new(zone()) LCallStub(context); |
2523 return MarkAsCall(DefineFixed(result, eax), instr); | 2524 return MarkAsCall(DefineFixed(result, eax), instr); |
2524 } | 2525 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2680 LAllocateBlockContext* result = | 2681 LAllocateBlockContext* result = |
2681 new(zone()) LAllocateBlockContext(context, function); | 2682 new(zone()) LAllocateBlockContext(context, function); |
2682 return MarkAsCall(DefineFixed(result, esi), instr); | 2683 return MarkAsCall(DefineFixed(result, esi), instr); |
2683 } | 2684 } |
2684 | 2685 |
2685 | 2686 |
2686 } // namespace internal | 2687 } // namespace internal |
2687 } // namespace v8 | 2688 } // namespace v8 |
2688 | 2689 |
2689 #endif // V8_TARGET_ARCH_IA32 | 2690 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |