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

Unified Diff: runtime/vm/assembler_ia32.cc

Issue 8818001: Add 64-bit stubs to call into the runtime and to call native functions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_ia32.cc
===================================================================
--- runtime/vm/assembler_ia32.cc (revision 2205)
+++ runtime/vm/assembler_ia32.cc (working copy)
@@ -1223,31 +1223,43 @@
void Assembler::LoadObject(Register dst, const Object& object) {
- ASSERT(object.IsZoneHandle());
- AssemblerBuffer::EnsureCapacity ensured(&buffer_);
- EmitUint8(0xB8 + dst);
- buffer_.EmitObject(object);
+ if (object.IsSmi()) {
+ movl(dst, Immediate(reinterpret_cast<int32_t>(object.raw())));
+ } else {
+ ASSERT(object.IsZoneHandle());
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0xB8 + dst);
+ buffer_.EmitObject(object);
+ }
}
void Assembler::PushObject(const Object& object) {
- ASSERT(object.IsZoneHandle());
- AssemblerBuffer::EnsureCapacity ensured(&buffer_);
- EmitUint8(0x68);
- buffer_.EmitObject(object);
+ if (object.IsSmi()) {
+ pushl(Immediate(reinterpret_cast<int32_t>(object.raw())));
+ } else {
+ ASSERT(object.IsZoneHandle());
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ EmitUint8(0x68);
+ buffer_.EmitObject(object);
+ }
}
void Assembler::CompareObject(Register reg, const Object& object) {
- ASSERT(object.IsZoneHandle());
- AssemblerBuffer::EnsureCapacity ensured(&buffer_);
- if (reg == EAX) {
- EmitUint8(0x05 + (7 << 3));
- buffer_.EmitObject(object);
+ if (object.IsSmi()) {
+ cmpl(reg, Immediate(reinterpret_cast<int32_t>(object.raw())));
} else {
- EmitUint8(0x81);
- EmitOperand(7, Operand(reg));
- buffer_.EmitObject(object);
+ ASSERT(object.IsZoneHandle());
+ AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+ if (reg == EAX) {
+ EmitUint8(0x05 + (7 << 3));
+ buffer_.EmitObject(object);
+ } else {
+ EmitUint8(0x81);
+ EmitOperand(7, Operand(reg));
+ buffer_.EmitObject(object);
+ }
}
}
« no previous file with comments | « runtime/vm/assembler_ia32.h ('k') | runtime/vm/assembler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698