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

Side by Side Diff: vm/assembler_x64.cc

Issue 10383189: Replace long sequences of popq with a Drop(int) macro instruction. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/heap.h" 9 #include "vm/heap.h"
10 #include "vm/memory_region.h" 10 #include "vm/memory_region.h"
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 value = -value; 1259 value = -value;
1260 if (value == 1) { 1260 if (value == 1) {
1261 decq(reg); 1261 decq(reg);
1262 } else if (value != 0) { 1262 } else if (value != 0) {
1263 subq(reg, Immediate(value)); 1263 subq(reg, Immediate(value));
1264 } 1264 }
1265 } 1265 }
1266 } 1266 }
1267 1267
1268 1268
1269 void Assembler::Drop(int stack_elements) {
1270 if (stack_elements > 0) {
1271 addq(RSP, Immediate(stack_elements * kWordSize));
srdjan 2012/05/15 19:52:27 When is an addq better than pop? Maybe add a TODO(
Florian Schneider 2012/05/15 21:40:56 Not sure what is considered better: For i<4 pop is
1272 }
srdjan 2012/05/15 19:52:27 ASSERT stack_elements >= 0?
Florian Schneider 2012/05/15 21:40:56 Done.
1273 }
1274
1275
1269 void Assembler::LoadObject(Register dst, const Object& object) { 1276 void Assembler::LoadObject(Register dst, const Object& object) {
1270 if (object.IsSmi()) { 1277 if (object.IsSmi()) {
1271 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw()))); 1278 movq(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
1272 } else { 1279 } else {
1273 ASSERT(object.IsZoneHandle()); 1280 ASSERT(object.IsZoneHandle());
1274 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 1281 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
1275 EmitRegisterREX(dst, REX_W); 1282 EmitRegisterREX(dst, REX_W);
1276 EmitUint8(0xB8 | (dst & 7)); 1283 EmitUint8(0xB8 | (dst & 7));
1277 buffer_.EmitObject(object); 1284 buffer_.EmitObject(object);
1278 } 1285 }
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1502 } else { 1509 } else {
1503 EmitRegisterREX(operand, REX_NONE); 1510 EmitRegisterREX(operand, REX_NONE);
1504 } 1511 }
1505 EmitUint8(0xD3); 1512 EmitUint8(0xD3);
1506 EmitOperand(rm, Operand(operand)); 1513 EmitOperand(rm, Operand(operand));
1507 } 1514 }
1508 1515
1509 } // namespace dart 1516 } // namespace dart
1510 1517
1511 #endif // defined TARGET_ARCH_X64 1518 #endif // defined TARGET_ARCH_X64
OLDNEW
« vm/assembler_x64.h ('K') | « vm/assembler_x64.h ('k') | vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698