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

Side by Side Diff: src/compiler/ppc/code-generator-ppc.cc

Issue 1315183002: PPC: Fix "[turbofan] Support unboxed float and double stack parameters." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | src/compiler/ppc/instruction-selector-ppc.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/ppc/macro-assembler-ppc.h" 10 #include "src/ppc/macro-assembler-ppc.h"
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 case kPPC_Push: 974 case kPPC_Push:
975 if (instr->InputAt(0)->IsDoubleRegister()) { 975 if (instr->InputAt(0)->IsDoubleRegister()) {
976 __ stfdu(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize)); 976 __ stfdu(i.InputDoubleRegister(0), MemOperand(sp, -kDoubleSize));
977 } else { 977 } else {
978 __ Push(i.InputRegister(0)); 978 __ Push(i.InputRegister(0));
979 } 979 }
980 DCHECK_EQ(LeaveRC, i.OutputRCBit()); 980 DCHECK_EQ(LeaveRC, i.OutputRCBit());
981 break; 981 break;
982 case kPPC_PushFrame: { 982 case kPPC_PushFrame: {
983 int num_slots = i.InputInt32(1); 983 int num_slots = i.InputInt32(1);
984 __ StorePU(i.InputRegister(0), MemOperand(sp, -num_slots * kPointerSize)); 984 if (instr->InputAt(0)->IsDoubleRegister()) {
985 __ stfdu(i.InputDoubleRegister(0),
986 MemOperand(sp, -num_slots * kPointerSize));
987 } else {
988 __ StorePU(i.InputRegister(0),
989 MemOperand(sp, -num_slots * kPointerSize));
990 }
985 break; 991 break;
986 } 992 }
987 case kPPC_StoreToStackSlot: { 993 case kPPC_StoreToStackSlot: {
988 int slot = i.InputInt32(1); 994 int slot = i.InputInt32(1);
989 if (instr->InputAt(0)->IsDoubleRegister()) { 995 if (instr->InputAt(0)->IsDoubleRegister()) {
990 __ stfd(i.InputDoubleRegister(0), MemOperand(sp, slot * kPointerSize)); 996 __ stfd(i.InputDoubleRegister(0), MemOperand(sp, slot * kPointerSize));
991 } else { 997 } else {
992 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize)); 998 __ StoreP(i.InputRegister(0), MemOperand(sp, slot * kPointerSize));
993 } 999 }
994 break; 1000 break;
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 frame()->SetRegisterSaveAreaSize(register_save_area_size); 1337 frame()->SetRegisterSaveAreaSize(register_save_area_size);
1332 } else if (descriptor->IsJSFunctionCall()) { 1338 } else if (descriptor->IsJSFunctionCall()) {
1333 CompilationInfo* info = this->info(); 1339 CompilationInfo* info = this->info();
1334 __ Prologue(info->IsCodePreAgingActive()); 1340 __ Prologue(info->IsCodePreAgingActive());
1335 frame()->SetRegisterSaveAreaSize( 1341 frame()->SetRegisterSaveAreaSize(
1336 StandardFrameConstants::kFixedFrameSizeFromFp); 1342 StandardFrameConstants::kFixedFrameSizeFromFp);
1337 } else if (needs_frame_) { 1343 } else if (needs_frame_) {
1338 __ StubPrologue(); 1344 __ StubPrologue();
1339 frame()->SetRegisterSaveAreaSize( 1345 frame()->SetRegisterSaveAreaSize(
1340 StandardFrameConstants::kFixedFrameSizeFromFp); 1346 StandardFrameConstants::kFixedFrameSizeFromFp);
1347 } else {
1348 frame()->SetPCOnStack(false);
titzer 2015/08/26 19:18:37 You'll have to rebase this, since danno changed th
1341 } 1349 }
1342 1350
1343 if (info()->is_osr()) { 1351 if (info()->is_osr()) {
1344 // TurboFan OSR-compiled functions cannot be entered directly. 1352 // TurboFan OSR-compiled functions cannot be entered directly.
1345 __ Abort(kShouldNotDirectlyEnterOsrFunction); 1353 __ Abort(kShouldNotDirectlyEnterOsrFunction);
1346 1354
1347 // Unoptimized code jumps directly to this entrypoint while the unoptimized 1355 // Unoptimized code jumps directly to this entrypoint while the unoptimized
1348 // frame is still on the stack. Optimized code uses OSR values directly from 1356 // frame is still on the stack. Optimized code uses OSR values directly from
1349 // the unoptimized frame. Thus, all that needs to be done is to allocate the 1357 // the unoptimized frame. Thus, all that needs to be done is to allocate the
1350 // remaining stack slots. 1358 // remaining stack slots.
(...skipping 26 matching lines...) Expand all
1377 __ MultiPopDoubles(double_saves); 1385 __ MultiPopDoubles(double_saves);
1378 1386
1379 // Restore registers. 1387 // Restore registers.
1380 RegList frame_saves = 0; 1388 RegList frame_saves = 0;
1381 if (FLAG_enable_embedded_constant_pool) { 1389 if (FLAG_enable_embedded_constant_pool) {
1382 frame_saves |= kConstantPoolRegister.bit(); 1390 frame_saves |= kConstantPoolRegister.bit();
1383 } 1391 }
1384 const RegList saves = descriptor->CalleeSavedRegisters() & ~frame_saves; 1392 const RegList saves = descriptor->CalleeSavedRegisters() & ~frame_saves;
1385 __ MultiPop(saves); 1393 __ MultiPop(saves);
1386 } 1394 }
1395 __ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
1387 } else if (descriptor->IsJSFunctionCall() || needs_frame_) { 1396 } else if (descriptor->IsJSFunctionCall() || needs_frame_) {
1388 // Canonicalize JSFunction return sites for now. 1397 // Canonicalize JSFunction return sites for now.
1389 if (return_label_.is_bound()) { 1398 if (return_label_.is_bound()) {
1390 __ b(&return_label_); 1399 __ b(&return_label_);
1391 return; 1400 return;
1392 } else { 1401 } else {
1393 __ bind(&return_label_); 1402 __ bind(&return_label_);
1403 __ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
1394 } 1404 }
1405 } else {
1406 __ Drop(pop_count);
1395 } 1407 }
1396 __ LeaveFrame(StackFrame::MANUAL, pop_count * kPointerSize);
1397 __ Ret(); 1408 __ Ret();
1398 } 1409 }
1399 1410
1400 1411
1401 void CodeGenerator::AssembleMove(InstructionOperand* source, 1412 void CodeGenerator::AssembleMove(InstructionOperand* source,
1402 InstructionOperand* destination) { 1413 InstructionOperand* destination) {
1403 PPCOperandConverter g(this, NULL); 1414 PPCOperandConverter g(this, NULL);
1404 // Dispatch on the source and destination operand kinds. Not all 1415 // Dispatch on the source and destination operand kinds. Not all
1405 // combinations are possible. 1416 // combinations are possible.
1406 if (source->IsRegister()) { 1417 if (source->IsRegister()) {
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 padding_size -= v8::internal::Assembler::kInstrSize; 1609 padding_size -= v8::internal::Assembler::kInstrSize;
1599 } 1610 }
1600 } 1611 }
1601 } 1612 }
1602 1613
1603 #undef __ 1614 #undef __
1604 1615
1605 } // namespace compiler 1616 } // namespace compiler
1606 } // namespace internal 1617 } // namespace internal
1607 } // namespace v8 1618 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ppc/instruction-selector-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698