Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: src/crankshaft/x64/lithium-x64.cc

Issue 1702593002: More simplification and unification of frame handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm64 Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/crankshaft/x64/lithium-codegen-x64.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 length()->PrintTo(stream); 327 length()->PrintTo(stream);
328 328
329 stream->Add(" index "); 329 stream->Add(" index ");
330 index()->PrintTo(stream); 330 index()->PrintTo(stream);
331 } 331 }
332 332
333 333
334 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) { 334 int LPlatformChunk::GetNextSpillIndex(RegisterKind kind) {
335 if (kind == DOUBLE_REGISTERS && kDoubleSize == 2 * kPointerSize) { 335 if (kind == DOUBLE_REGISTERS && kDoubleSize == 2 * kPointerSize) {
336 // Skip a slot if for a double-width slot for x32 port. 336 // Skip a slot if for a double-width slot for x32 port.
337 spill_slot_count_++; 337 current_frame_slots_++;
338 // The spill slot's address is at rbp - (index + 1) * kPointerSize - 338 // The spill slot's address is at rbp - (index + 1) * kPointerSize -
339 // StandardFrameConstants::kFixedFrameSizeFromFp. kFixedFrameSizeFromFp is 339 // StandardFrameConstants::kFixedFrameSizeFromFp. kFixedFrameSizeFromFp is
340 // 2 * kPointerSize, if rbp is aligned at 8-byte boundary, the below "|= 1" 340 // 2 * kPointerSize, if rbp is aligned at 8-byte boundary, the below "|= 1"
341 // will make sure the spilled doubles are aligned at 8-byte boundary. 341 // will make sure the spilled doubles are aligned at 8-byte boundary.
342 // TODO(haitao): make sure rbp is aligned at 8-byte boundary for x32 port. 342 // TODO(haitao): make sure rbp is aligned at 8-byte boundary for x32 port.
343 spill_slot_count_ |= 1; 343 current_frame_slots_ |= 1;
344 } 344 }
345 return spill_slot_count_++; 345 return current_frame_slots_++;
346 } 346 }
347 347
348 348
349 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) { 349 LOperand* LPlatformChunk::GetNextSpillSlot(RegisterKind kind) {
350 // All stack slots are Double stack slots on x64. 350 // All stack slots are Double stack slots on x64.
351 // Alternatively, at some point, start using half-size 351 // Alternatively, at some point, start using half-size
352 // stack slots for int32 values. 352 // stack slots for int32 values.
353 int index = GetNextSpillIndex(kind); 353 int index = GetNextSpillIndex(kind);
354 if (kind == DOUBLE_REGISTERS) { 354 if (kind == DOUBLE_REGISTERS) {
355 return LDoubleStackSlot::Create(index, zone()); 355 return LDoubleStackSlot::Create(index, zone());
(...skipping 2138 matching lines...) Expand 10 before | Expand all | Expand 10 after
2494 int env_index = instr->index(); 2494 int env_index = instr->index();
2495 int spill_index = 0; 2495 int spill_index = 0;
2496 if (instr->environment()->is_parameter_index(env_index)) { 2496 if (instr->environment()->is_parameter_index(env_index)) {
2497 spill_index = chunk()->GetParameterStackSlot(env_index); 2497 spill_index = chunk()->GetParameterStackSlot(env_index);
2498 } else { 2498 } else {
2499 spill_index = env_index - instr->environment()->first_local_index(); 2499 spill_index = env_index - instr->environment()->first_local_index();
2500 if (spill_index > LUnallocated::kMaxFixedSlotIndex) { 2500 if (spill_index > LUnallocated::kMaxFixedSlotIndex) {
2501 Retry(kTooManySpillSlotsNeededForOSR); 2501 Retry(kTooManySpillSlotsNeededForOSR);
2502 spill_index = 0; 2502 spill_index = 0;
2503 } 2503 }
2504 spill_index += StandardFrameConstants::kFixedSlotCount;
2504 } 2505 }
2505 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index); 2506 return DefineAsSpilled(new(zone()) LUnknownOSRValue, spill_index);
2506 } 2507 }
2507 2508
2508 2509
2509 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) { 2510 LInstruction* LChunkBuilder::DoCallStub(HCallStub* instr) {
2510 LOperand* context = UseFixed(instr->context(), rsi); 2511 LOperand* context = UseFixed(instr->context(), rsi);
2511 LCallStub* result = new(zone()) LCallStub(context); 2512 LCallStub* result = new(zone()) LCallStub(context);
2512 return MarkAsCall(DefineFixed(result, rax), instr); 2513 return MarkAsCall(DefineFixed(result, rax), instr);
2513 } 2514 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
2670 LAllocateBlockContext* result = 2671 LAllocateBlockContext* result =
2671 new(zone()) LAllocateBlockContext(context, function); 2672 new(zone()) LAllocateBlockContext(context, function);
2672 return MarkAsCall(DefineFixed(result, rsi), instr); 2673 return MarkAsCall(DefineFixed(result, rsi), instr);
2673 } 2674 }
2674 2675
2675 2676
2676 } // namespace internal 2677 } // namespace internal
2677 } // namespace v8 2678 } // namespace v8
2678 2679
2679 #endif // V8_TARGET_ARCH_X64 2680 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/crankshaft/x64/lithium-codegen-x64.cc ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698