Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index 025bd891c2273305ea7da6d98d37692ad23bb876..0196aead9c7545de875aadb84b6e0c386631dcd3 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -56,6 +56,34 @@ MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) |
} |
+void MacroAssembler::Load(Register dst, const Operand& src, Representation r) { |
+ ASSERT(!r.IsDouble()); |
+ if (r.IsInteger8()) { |
+ movsx_b(dst, src); |
+ } else if (r.IsUInteger8()) { |
+ movzx_b(dst, src); |
+ } else if (r.IsInteger16()) { |
+ movsx_w(dst, src); |
+ } else if (r.IsUInteger16()) { |
+ movzx_w(dst, src); |
+ } else { |
+ mov(dst, src); |
+ } |
+} |
+ |
+ |
+void MacroAssembler::Store(Register src, const Operand& dst, Representation r) { |
+ ASSERT(!r.IsDouble()); |
+ if (r.IsInteger8() || r.IsUInteger8()) { |
+ mov_b(dst, src); |
+ } else if (r.IsInteger16() || r.IsUInteger16()) { |
+ mov_w(dst, src); |
+ } else { |
+ mov(dst, src); |
+ } |
+} |
+ |
+ |
void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { |
if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) { |
Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |