Chromium Code Reviews| Index: src/ia32/lithium-codegen-ia32.cc |
| diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
| index af2b92a1bb80d1e412b4cdf304fcc13cb6228352..b43174597cf029fe02e4e14dffe32959e58bd4a5 100644 |
| --- a/src/ia32/lithium-codegen-ia32.cc |
| +++ b/src/ia32/lithium-codegen-ia32.cc |
| @@ -1817,6 +1817,17 @@ void LCodeGen::DoStoreGlobal(LStoreGlobal* instr) { |
| } |
| +void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
| + // TODO(antonm): load a context with a separate instruction. |
| + Register result = ToRegister(instr->result()); |
| + HLoadContextSlot* hinstr = instr->hydrogen(); |
|
Kevin Millikin (Chromium)
2010/12/20 12:05:44
It's typical for the Lithium instructions to have
antonm
2010/12/20 20:39:24
Done.
|
| + Comment(";;; Load context slot %d at %d", |
|
Kevin Millikin (Chromium)
2010/12/20 12:05:44
There will automatically be a comment with the pri
antonm
2010/12/20 20:39:24
Done.
|
| + hinstr->slot_index(), hinstr->context_chain_length()); |
| + __ LoadContext(result, hinstr->context_chain_length()); |
| + __ mov(result, ContextOperand(result, hinstr->slot_index())); |
| +} |
| + |
| + |
| void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
| Register object = ToRegister(instr->input()); |
| Register result = ToRegister(instr->result()); |
| @@ -2910,13 +2921,13 @@ void LCodeGen::DoCheckMap(LCheckMap* instr) { |
| } |
| -void LCodeGen::LoadPrototype(Register result, Handle<JSObject> prototype) { |
| - if (Heap::InNewSpace(*prototype)) { |
| +void LCodeGen::LoadHeapObject(Register result, Handle<HeapObject> object) { |
| + if (Heap::InNewSpace(*object)) { |
| Handle<JSGlobalPropertyCell> cell = |
| - Factory::NewJSGlobalPropertyCell(prototype); |
| + Factory::NewJSGlobalPropertyCell(object); |
| __ mov(result, Operand::Cell(cell)); |
| } else { |
| - __ mov(result, prototype); |
| + __ mov(result, object); |
| } |
| } |
| @@ -2929,7 +2940,7 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| Handle<JSObject> current_prototype(JSObject::cast(receiver_map->prototype())); |
| // Load prototype object. |
| - LoadPrototype(reg, current_prototype); |
| + LoadHeapObject(reg, current_prototype); |
| // Check prototype maps up to the holder. |
| while (!current_prototype.is_identical_to(holder)) { |
| @@ -2939,7 +2950,7 @@ void LCodeGen::DoCheckPrototypeMaps(LCheckPrototypeMaps* instr) { |
| current_prototype = |
| Handle<JSObject>(JSObject::cast(current_prototype->GetPrototype())); |
| // Load next prototype object. |
| - LoadPrototype(reg, current_prototype); |
| + LoadHeapObject(reg, current_prototype); |
| } |
| // Check the holder map. |