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

Side by Side Diff: runtime/vm/intrinsifier_x64.cc

Issue 2003403003: ARM/ARM64: Fix smashed CODE_REG in intrinsics with InvokeMathCFunctionInstrs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64.
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 15 matching lines...) Expand all
26 // The RBP register should not be modified, because it is used by the profiler. 26 // The RBP register should not be modified, because it is used by the profiler.
27 // The PP and THR registers (see constants_x64.h) must be preserved. 27 // The PP and THR registers (see constants_x64.h) must be preserved.
28 28
29 #define __ assembler-> 29 #define __ assembler->
30 30
31 31
32 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; } 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return 0; }
33 33
34 34
35 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { 35 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
36 const intptr_t kAbiPreservedCpuRegs =
37 CallingConventions::kCalleeSaveCpuRegisters;
38 COMPILE_ASSERT((1 << CODE_REG) & kAbiPreservedCpuRegs);
39 COMPILE_ASSERT(((1 << ARGS_DESC_REG) & kAbiPreservedCpuRegs) == 0);
40 COMPILE_ASSERT((1 << CALLEE_SAVED_TEMP) & kAbiPreservedCpuRegs);
41 COMPILE_ASSERT(CALLEE_SAVED_TEMP != CODE_REG);
42 COMPILE_ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG);
43
36 assembler->Comment("IntrinsicCallPrologue"); 44 assembler->Comment("IntrinsicCallPrologue");
37 assembler->movq(CALLEE_SAVED_TEMP, R10); 45 assembler->movq(CALLEE_SAVED_TEMP, ARGS_DESC_REG);
38 } 46 }
39 47
40 48
41 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { 49 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
42 assembler->Comment("IntrinsicCallEpilogue"); 50 assembler->Comment("IntrinsicCallEpilogue");
43 assembler->movq(R10, CALLEE_SAVED_TEMP); 51 assembler->movq(ARGS_DESC_REG, CALLEE_SAVED_TEMP);
44 } 52 }
45 53
46 54
47 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { 55 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) {
48 if (Isolate::Current()->type_checks()) { 56 if (Isolate::Current()->type_checks()) {
49 return; 57 return;
50 } 58 }
51 59
52 Label fall_through; 60 Label fall_through;
53 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value. 61 __ movq(RDX, Address(RSP, + 1 * kWordSize)); // Value.
(...skipping 2054 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 __ Bind(&true_label); 2116 __ Bind(&true_label);
2109 __ LoadObject(RAX, Bool::True()); 2117 __ LoadObject(RAX, Bool::True());
2110 __ ret(); 2118 __ ret();
2111 } 2119 }
2112 2120
2113 #undef __ 2121 #undef __
2114 2122
2115 } // namespace dart 2123 } // namespace dart
2116 2124
2117 #endif // defined TARGET_ARCH_X64 2125 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698