| OLD | NEW |
| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 const intptr_t retval_offset = NativeArguments::retval_offset(); | 44 const intptr_t retval_offset = NativeArguments::retval_offset(); |
| 45 | 45 |
| 46 __ EnterFrame(0); | 46 __ EnterFrame(0); |
| 47 | 47 |
| 48 COMPILE_ASSERT( | 48 COMPILE_ASSERT( |
| 49 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); | 49 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); |
| 50 __ LoadIsolate(R12); | 50 __ LoadIsolate(R12); |
| 51 | 51 |
| 52 // Save exit frame information to enable stack walking as we are about | 52 // Save exit frame information to enable stack walking as we are about |
| 53 // to transition to Dart VM C++ code. | 53 // to transition to Dart VM C++ code. |
| 54 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RSP); | 54 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RBP); |
| 55 | 55 |
| 56 #if defined(DEBUG) | 56 #if defined(DEBUG) |
| 57 { Label ok; | 57 { Label ok; |
| 58 // Check that we are always entering from Dart code. | 58 // Check that we are always entering from Dart code. |
| 59 __ movq(RAX, Immediate(VMTag::kDartTagId)); | 59 __ movq(RAX, Immediate(VMTag::kDartTagId)); |
| 60 __ cmpq(RAX, Address(R12, Isolate::vm_tag_offset())); | 60 __ cmpq(RAX, Address(R12, Isolate::vm_tag_offset())); |
| 61 __ j(EQUAL, &ok, Assembler::kNearJump); | 61 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 62 __ Stop("Not coming from Dart code."); | 62 __ Stop("Not coming from Dart code."); |
| 63 __ Bind(&ok); | 63 __ Bind(&ok); |
| 64 } | 64 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 NativeArguments::retval_offset() + native_args_struct_offset; | 141 NativeArguments::retval_offset() + native_args_struct_offset; |
| 142 | 142 |
| 143 __ EnterFrame(0); | 143 __ EnterFrame(0); |
| 144 | 144 |
| 145 COMPILE_ASSERT( | 145 COMPILE_ASSERT( |
| 146 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); | 146 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); |
| 147 __ LoadIsolate(R12); | 147 __ LoadIsolate(R12); |
| 148 | 148 |
| 149 // Save exit frame information to enable stack walking as we are about | 149 // Save exit frame information to enable stack walking as we are about |
| 150 // to transition to native code. | 150 // to transition to native code. |
| 151 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RSP); | 151 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RBP); |
| 152 | 152 |
| 153 #if defined(DEBUG) | 153 #if defined(DEBUG) |
| 154 { Label ok; | 154 { Label ok; |
| 155 // Check that we are always entering from Dart code. | 155 // Check that we are always entering from Dart code. |
| 156 __ movq(R8, Immediate(VMTag::kDartTagId)); | 156 __ movq(R8, Immediate(VMTag::kDartTagId)); |
| 157 __ cmpq(R8, Address(R12, Isolate::vm_tag_offset())); | 157 __ cmpq(R8, Address(R12, Isolate::vm_tag_offset())); |
| 158 __ j(EQUAL, &ok, Assembler::kNearJump); | 158 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 159 __ Stop("Not coming from Dart code."); | 159 __ Stop("Not coming from Dart code."); |
| 160 __ Bind(&ok); | 160 __ Bind(&ok); |
| 161 } | 161 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 NativeArguments::retval_offset() + native_args_struct_offset; | 215 NativeArguments::retval_offset() + native_args_struct_offset; |
| 216 | 216 |
| 217 __ EnterFrame(0); | 217 __ EnterFrame(0); |
| 218 | 218 |
| 219 COMPILE_ASSERT( | 219 COMPILE_ASSERT( |
| 220 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); | 220 (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0); |
| 221 __ LoadIsolate(R12); | 221 __ LoadIsolate(R12); |
| 222 | 222 |
| 223 // Save exit frame information to enable stack walking as we are about | 223 // Save exit frame information to enable stack walking as we are about |
| 224 // to transition to native code. | 224 // to transition to native code. |
| 225 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RSP); | 225 __ movq(Address(R12, Isolate::top_exit_frame_info_offset()), RBP); |
| 226 | 226 |
| 227 #if defined(DEBUG) | 227 #if defined(DEBUG) |
| 228 { Label ok; | 228 { Label ok; |
| 229 // Check that we are always entering from Dart code. | 229 // Check that we are always entering from Dart code. |
| 230 __ movq(R8, Immediate(VMTag::kDartTagId)); | 230 __ movq(R8, Immediate(VMTag::kDartTagId)); |
| 231 __ cmpq(R8, Address(R12, Isolate::vm_tag_offset())); | 231 __ cmpq(R8, Address(R12, Isolate::vm_tag_offset())); |
| 232 __ j(EQUAL, &ok, Assembler::kNearJump); | 232 __ j(EQUAL, &ok, Assembler::kNearJump); |
| 233 __ Stop("Not coming from Dart code."); | 233 __ Stop("Not coming from Dart code."); |
| 234 __ Bind(&ok); | 234 __ Bind(&ok); |
| 235 } | 235 } |
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 // Result: | 2174 // Result: |
| 2175 // RCX: entry point. | 2175 // RCX: entry point. |
| 2176 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2176 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2177 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); | 2177 EmitMegamorphicLookup(assembler, RDI, RBX, RCX); |
| 2178 __ ret(); | 2178 __ ret(); |
| 2179 } | 2179 } |
| 2180 | 2180 |
| 2181 } // namespace dart | 2181 } // namespace dart |
| 2182 | 2182 |
| 2183 #endif // defined TARGET_ARCH_X64 | 2183 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |