Chromium Code Reviews| Index: src/ia32/macro-assembler-ia32.cc |
| diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
| index 8b1be3cf17262f7c7c5d9de2d8a755af7982b937..67a7c0d2b49010552c1afb5d0c1ccf1dbe84e92b 100644 |
| --- a/src/ia32/macro-assembler-ia32.cc |
| +++ b/src/ia32/macro-assembler-ia32.cc |
| @@ -54,6 +54,60 @@ MacroAssembler::MacroAssembler(Isolate* arg_isolate, void* buffer, int size) |
| } |
| +void MacroAssembler::LoadRoot(Register destination, Heap::RootListIndex index) { |
| + if (isolate()->heap()->RootCanBeTreatedAsConstant(index)) { |
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
| + mov(destination, value); |
| + return; |
| + } |
| + ExternalReference roots_array_start = |
| + ExternalReference::roots_array_start(isolate()); |
| + mov(destination, Immediate(index)); |
| + mov(destination, Operand::StaticArray(destination, |
| + times_pointer_size, |
| + roots_array_start)); |
|
danno
2013/08/09 13:36:03
The two moves all be done in one instruction, you
Benedikt Meurer
2013/08/09 13:41:55
There's no way to do this in one instruction, caus
|
| +} |
| + |
| + |
| +void MacroAssembler::StoreRoot(Register source, |
| + Register scratch, |
| + Heap::RootListIndex index) { |
| + ASSERT(Heap::RootCanBeWrittenAfterInitialization(index)); |
| + ExternalReference roots_array_start = |
| + ExternalReference::roots_array_start(isolate()); |
| + mov(scratch, Immediate(index)); |
| + mov(Operand::StaticArray(scratch, times_pointer_size, roots_array_start), |
| + source); |
| +} |
| + |
| + |
| +void MacroAssembler::CompareRoot(Register with, |
| + Register scratch, |
| + Heap::RootListIndex index) { |
| + ExternalReference roots_array_start = |
| + ExternalReference::roots_array_start(isolate()); |
| + mov(scratch, Immediate(index)); |
| + cmp(with, Operand::StaticArray(scratch, |
| + times_pointer_size, |
| + roots_array_start)); |
| +} |
| + |
| + |
| +void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) { |
| + ASSERT(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
| + cmp(with, value); |
| +} |
| + |
| + |
| +void MacroAssembler::CompareRoot(const Operand& with, |
| + Heap::RootListIndex index) { |
| + ASSERT(isolate()->heap()->RootCanBeTreatedAsConstant(index)); |
| + Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
| + cmp(with, value); |
| +} |
| + |
| + |
| void MacroAssembler::InNewSpace( |
| Register object, |
| Register scratch, |
| @@ -432,21 +486,6 @@ void MacroAssembler::SafePush(const Immediate& x) { |
| } |
| -void MacroAssembler::CompareRoot(Register with, Heap::RootListIndex index) { |
| - // see ROOT_ACCESSOR macro in factory.h |
| - Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
| - cmp(with, value); |
| -} |
| - |
| - |
| -void MacroAssembler::CompareRoot(const Operand& with, |
| - Heap::RootListIndex index) { |
| - // see ROOT_ACCESSOR macro in factory.h |
| - Handle<Object> value(&isolate()->heap()->roots_array_start()[index]); |
| - cmp(with, value); |
| -} |
| - |
| - |
| void MacroAssembler::CmpObjectType(Register heap_object, |
| InstanceType type, |
| Register map) { |