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

Side by Side Diff: src/s390/macro-assembler-s390.cc

Issue 2105023008: PPC/s390: [builtins] New frame type for exits to C++ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/s390/macro-assembler-s390.h ('k') | no next file » | 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 <assert.h> // For assert 5 #include <assert.h> // For assert
6 #include <limits.h> // For LONG_MIN, LONG_MAX. 6 #include <limits.h> // For LONG_MIN, LONG_MAX.
7 7
8 #if V8_TARGET_ARCH_S390 8 #if V8_TARGET_ARCH_S390
9 9
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 // Then - we buy a new frame 1017 // Then - we buy a new frame
1018 1018
1019 // r14 1019 // r14
1020 // oldFP <- newFP 1020 // oldFP <- newFP
1021 // SP 1021 // SP
1022 // Code 1022 // Code
1023 // Floats 1023 // Floats
1024 // gaps 1024 // gaps
1025 // Args 1025 // Args
1026 // ABIRes <- newSP 1026 // ABIRes <- newSP
1027 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space) { 1027 void MacroAssembler::EnterExitFrame(bool save_doubles, int stack_space,
1028 StackFrame::Type frame_type) {
1029 DCHECK(frame_type == StackFrame::EXIT ||
1030 frame_type == StackFrame::BUILTIN_EXIT);
1028 // Set up the frame structure on the stack. 1031 // Set up the frame structure on the stack.
1029 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement); 1032 DCHECK_EQ(2 * kPointerSize, ExitFrameConstants::kCallerSPDisplacement);
1030 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset); 1033 DCHECK_EQ(1 * kPointerSize, ExitFrameConstants::kCallerPCOffset);
1031 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset); 1034 DCHECK_EQ(0 * kPointerSize, ExitFrameConstants::kCallerFPOffset);
1032 DCHECK(stack_space > 0); 1035 DCHECK(stack_space > 0);
1033 1036
1034 // This is an opportunity to build a frame to wrap 1037 // This is an opportunity to build a frame to wrap
1035 // all of the pushes that have happened inside of V8 1038 // all of the pushes that have happened inside of V8
1036 // since we were called from C code 1039 // since we were called from C code
1037 CleanseP(r14); 1040 CleanseP(r14);
1038 LoadSmiLiteral(r1, Smi::FromInt(StackFrame::EXIT)); 1041 LoadSmiLiteral(r1, Smi::FromInt(frame_type));
1039 PushCommonFrame(r1); 1042 PushCommonFrame(r1);
1040 // Reserve room for saved entry sp and code object. 1043 // Reserve room for saved entry sp and code object.
1041 lay(sp, MemOperand(fp, -ExitFrameConstants::kFixedFrameSizeFromFp)); 1044 lay(sp, MemOperand(fp, -ExitFrameConstants::kFixedFrameSizeFromFp));
1042 1045
1043 if (emit_debug_code()) { 1046 if (emit_debug_code()) {
1044 StoreP(MemOperand(fp, ExitFrameConstants::kSPOffset), Operand::Zero(), r1); 1047 StoreP(MemOperand(fp, ExitFrameConstants::kSPOffset), Operand::Zero(), r1);
1045 } 1048 }
1046 mov(r1, Operand(CodeObject())); 1049 mov(r1, Operand(CodeObject()));
1047 StoreP(r1, MemOperand(fp, ExitFrameConstants::kCodeOffset)); 1050 StoreP(r1, MemOperand(fp, ExitFrameConstants::kCodeOffset));
1048 1051
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2607 2610
2608 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) { 2611 void MacroAssembler::TailCallRuntime(Runtime::FunctionId fid) {
2609 const Runtime::Function* function = Runtime::FunctionForId(fid); 2612 const Runtime::Function* function = Runtime::FunctionForId(fid);
2610 DCHECK_EQ(1, function->result_size); 2613 DCHECK_EQ(1, function->result_size);
2611 if (function->nargs >= 0) { 2614 if (function->nargs >= 0) {
2612 mov(r2, Operand(function->nargs)); 2615 mov(r2, Operand(function->nargs));
2613 } 2616 }
2614 JumpToExternalReference(ExternalReference(fid, isolate())); 2617 JumpToExternalReference(ExternalReference(fid, isolate()));
2615 } 2618 }
2616 2619
2617 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin) { 2620 void MacroAssembler::JumpToExternalReference(const ExternalReference& builtin,
2621 bool builtin_exit_frame) {
2618 mov(r3, Operand(builtin)); 2622 mov(r3, Operand(builtin));
2619 CEntryStub stub(isolate(), 1); 2623 CEntryStub stub(isolate(), 1, kDontSaveFPRegs, kArgvOnStack,
2624 builtin_exit_frame);
2620 Jump(stub.GetCode(), RelocInfo::CODE_TARGET); 2625 Jump(stub.GetCode(), RelocInfo::CODE_TARGET);
2621 } 2626 }
2622 2627
2623 void MacroAssembler::SetCounter(StatsCounter* counter, int value, 2628 void MacroAssembler::SetCounter(StatsCounter* counter, int value,
2624 Register scratch1, Register scratch2) { 2629 Register scratch1, Register scratch2) {
2625 if (FLAG_native_code_counters && counter->Enabled()) { 2630 if (FLAG_native_code_counters && counter->Enabled()) {
2626 mov(scratch1, Operand(value)); 2631 mov(scratch1, Operand(value));
2627 mov(scratch2, Operand(ExternalReference(counter))); 2632 mov(scratch2, Operand(ExternalReference(counter)));
2628 StoreW(scratch1, MemOperand(scratch2)); 2633 StoreW(scratch1, MemOperand(scratch2));
2629 } 2634 }
(...skipping 2873 matching lines...) Expand 10 before | Expand all | Expand 10 after
5503 } 5508 }
5504 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift)); 5509 if (mag.shift > 0) ShiftRightArith(result, result, Operand(mag.shift));
5505 ExtractBit(r0, dividend, 31); 5510 ExtractBit(r0, dividend, 31);
5506 AddP(result, r0); 5511 AddP(result, r0);
5507 } 5512 }
5508 5513
5509 } // namespace internal 5514 } // namespace internal
5510 } // namespace v8 5515 } // namespace v8
5511 5516
5512 #endif // V8_TARGET_ARCH_S390 5517 #endif // V8_TARGET_ARCH_S390
OLDNEW
« no previous file with comments | « src/s390/macro-assembler-s390.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698