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

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

Issue 1189573004: Use object pool for runtime calls. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/runtime_entry_arm.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 (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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/heap.h" 10 #include "vm/heap.h"
(...skipping 3188 matching lines...) Expand 10 before | Expand all | Expand 10 after
3199 pushq(TMP); // Preserve TMP register. 3199 pushq(TMP); // Preserve TMP register.
3200 pushq(RDI); // Preserve RDI register. 3200 pushq(RDI); // Preserve RDI register.
3201 if (fixed_length_encoding) { 3201 if (fixed_length_encoding) {
3202 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 3202 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
3203 EmitRegisterREX(RDI, REX_W); 3203 EmitRegisterREX(RDI, REX_W);
3204 EmitUint8(0xB8 | (RDI & 7)); 3204 EmitUint8(0xB8 | (RDI & 7));
3205 EmitInt64(message_address); 3205 EmitInt64(message_address);
3206 } else { 3206 } else {
3207 LoadImmediate(RDI, Immediate(message_address), PP); 3207 LoadImmediate(RDI, Immediate(message_address), PP);
3208 } 3208 }
3209 call(&StubCode::PrintStopMessageLabel()); 3209 call(&Isolate::Current()->stub_code()->PrintStopMessageLabel());
3210 popq(RDI); // Restore RDI register. 3210 popq(RDI); // Restore RDI register.
3211 popq(TMP); // Restore TMP register. 3211 popq(TMP); // Restore TMP register.
3212 } else { 3212 } else {
3213 // Emit the lower half and the higher half of the message address as 3213 // Emit the lower half and the higher half of the message address as
3214 // immediate operands in the test rax instructions. 3214 // immediate operands in the test rax instructions.
3215 testl(RAX, Immediate(Utils::Low32Bits(message_address))); 3215 testl(RAX, Immediate(Utils::Low32Bits(message_address)));
3216 testl(RAX, Immediate(Utils::High32Bits(message_address))); 3216 testl(RAX, Immediate(Utils::High32Bits(message_address)));
3217 } 3217 }
3218 // Emit the int3 instruction. 3218 // Emit the int3 instruction.
3219 int3(); // Execution can be resumed with the 'cont' command in gdb. 3219 int3(); // Execution can be resumed with the 'cont' command in gdb.
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3437 prologue_offset_ = CodeSize(); 3437 prologue_offset_ = CodeSize();
3438 } 3438 }
3439 movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override); 3439 movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override);
3440 movq(PP, new_pp); 3440 movq(PP, new_pp);
3441 if (extra_size != 0) { 3441 if (extra_size != 0) {
3442 subq(RSP, Immediate(extra_size)); 3442 subq(RSP, Immediate(extra_size));
3443 } 3443 }
3444 } 3444 }
3445 3445
3446 3446
3447 void Assembler::EnterStubFrame(bool load_pp) { 3447 void Assembler::EnterStubFrame() {
3448 EnterFrame(0); 3448 EnterFrame(0);
3449 pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames. 3449 pushq(Immediate(0)); // Push 0 in the saved PC area for stub frames.
3450 pushq(PP); // Save caller's pool pointer 3450 pushq(PP); // Save caller's pool pointer
3451 if (load_pp) { 3451 LoadPoolPointer(PP);
3452 LoadPoolPointer(PP);
3453 }
3454 } 3452 }
3455 3453
3456 3454
3457 void Assembler::LeaveStubFrame() { 3455 void Assembler::LeaveStubFrame() {
3458 // Restore caller's PP register that was pushed in EnterStubFrame. 3456 // Restore caller's PP register that was pushed in EnterStubFrame.
3459 movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize))); 3457 movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize)));
3460 LeaveFrame(); 3458 LeaveFrame();
3461 } 3459 }
3462 3460
3463 3461
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
3928 3926
3929 3927
3930 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3928 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3931 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3929 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3932 return xmm_reg_names[reg]; 3930 return xmm_reg_names[reg];
3933 } 3931 }
3934 3932
3935 } // namespace dart 3933 } // namespace dart
3936 3934
3937 #endif // defined TARGET_ARCH_X64 3935 #endif // defined TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/runtime_entry_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698