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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 87c1f31bcc7f0d4d984c03170def24e1dfb660ca..091952162be8b5d5aff2149453541c5a7eebd473 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -122,7 +122,11 @@ void Assembler::pushq(const Address& address) {
void Assembler::pushq(const Immediate& imm) {
- if (imm.is_int32()) {
+ if (imm.is_int8()) {
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x6A);
+ EmitUint8(imm.value() & 0xFF);
+ } else if (imm.is_int32()) {
AssemblerBuffer::EnsureCapacity ensured(&buffer_);
EmitUint8(0x68);
EmitImmediate(imm);

Powered by Google App Engine
This is Rietveld 408576698