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

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

Issue 1383573002: VM: More compact code for pushing constant arguments on ia32/x64. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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" // 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 void Assembler::pushq(const Address& address) { 116 void Assembler::pushq(const Address& address) {
117 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 117 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
118 EmitOperandREX(6, address, REX_NONE); 118 EmitOperandREX(6, address, REX_NONE);
119 EmitUint8(0xFF); 119 EmitUint8(0xFF);
120 EmitOperand(6, address); 120 EmitOperand(6, address);
121 } 121 }
122 122
123 123
124 void Assembler::pushq(const Immediate& imm) { 124 void Assembler::pushq(const Immediate& imm) {
125 if (imm.is_int32()) { 125 if (imm.is_int8()) {
126 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
127 EmitUint8(0x6A);
128 EmitUint8(imm.value() & 0xFF);
129 } else if (imm.is_int32()) {
126 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 130 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
127 EmitUint8(0x68); 131 EmitUint8(0x68);
128 EmitImmediate(imm); 132 EmitImmediate(imm);
129 } else { 133 } else {
130 movq(TMP, imm); 134 movq(TMP, imm);
131 pushq(TMP); 135 pushq(TMP);
132 } 136 }
133 } 137 }
134 138
135 139
(...skipping 3831 matching lines...) Expand 10 before | Expand all | Expand 10 after
3967 3971
3968 3972
3969 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3973 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3970 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3974 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3971 return xmm_reg_names[reg]; 3975 return xmm_reg_names[reg];
3972 } 3976 }
3973 3977
3974 } // namespace dart 3978 } // namespace dart
3975 3979
3976 #endif // defined TARGET_ARCH_X64 3980 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698