Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index d1bb4aa97570183f993313c476e2d3b7db705cb5..8878a8d5d65c545329d3c1c483507265d52f60c1 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -1842,11 +1842,7 @@ void LCodeGen::DoConstantT(LConstantT* instr) { |
Register reg = ToRegister(instr->result()); |
Handle<Object> handle = instr->value(); |
AllowDeferredHandleDereference smi_check; |
- if (handle->IsHeapObject()) { |
- __ LoadHeapObject(reg, Handle<HeapObject>::cast(handle)); |
- } else { |
- __ Set(reg, Immediate(handle)); |
- } |
+ __ LoadObject(reg, handle); |
} |
@@ -3074,11 +3070,11 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
} |
-void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
- Register object, |
- Handle<Map> type, |
- Handle<String> name, |
- LEnvironment* env) { |
+void LCodeGen::EmitLoadFieldOrConstant(Register result, |
+ Register object, |
+ Handle<Map> type, |
+ Handle<String> name, |
+ LEnvironment* env) { |
LookupResult lookup(isolate()); |
type->LookupDescriptor(NULL, *name, &lookup); |
ASSERT(lookup.IsFound() || lookup.IsCacheable()); |
@@ -3094,9 +3090,9 @@ void LCodeGen::EmitLoadFieldOrConstantFunction(Register result, |
__ mov(result, FieldOperand(object, JSObject::kPropertiesOffset)); |
__ mov(result, FieldOperand(result, offset + FixedArray::kHeaderSize)); |
} |
- } else if (lookup.IsConstantFunction()) { |
- Handle<JSFunction> function(lookup.GetConstantFunctionFromMap(*type)); |
- __ LoadHeapObject(result, function); |
+ } else if (lookup.IsConstant()) { |
+ Handle<Object> constant(lookup.GetConstantFromMap(*type), isolate()); |
+ __ LoadObject(result, constant); |
} else { |
// Negative lookup. |
// Check prototypes. |
@@ -3145,7 +3141,7 @@ static bool CompactEmit(SmallMapList* list, |
if (map->HasElementsTransition()) return false; |
LookupResult lookup(isolate); |
map->LookupDescriptor(NULL, *name, &lookup); |
- return lookup.IsField() || lookup.IsConstantFunction(); |
+ return lookup.IsField() || lookup.IsConstant(); |
} |
@@ -3177,16 +3173,14 @@ void LCodeGen::DoLoadNamedFieldPolymorphic(LLoadNamedFieldPolymorphic* instr) { |
if (last && !need_generic) { |
DeoptimizeIf(not_equal, instr->environment()); |
__ bind(&check_passed); |
- EmitLoadFieldOrConstantFunction( |
- result, object, map, name, instr->environment()); |
+ EmitLoadFieldOrConstant(result, object, map, name, instr->environment()); |
} else { |
Label next; |
bool compact = all_are_compact ? true : |
CompactEmit(instr->hydrogen()->types(), name, i, isolate()); |
__ j(not_equal, &next, compact ? Label::kNear : Label::kFar); |
__ bind(&check_passed); |
- EmitLoadFieldOrConstantFunction( |
- result, object, map, name, instr->environment()); |
+ EmitLoadFieldOrConstant(result, object, map, name, instr->environment()); |
__ jmp(&done, all_are_compact ? Label::kNear : Label::kFar); |
__ bind(&next); |
} |