Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index 6fe3062f2ebe72176d6a364ae061949449d39725..ca6bddb2015dfb717c6ad86baadf20380d0f02c7 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -1039,12 +1039,12 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) { |
// Convert the object to a JS object. |
Label convert, done_convert; |
- __ JumpIfSmi(rax, &convert); |
+ __ JumpIfSmi(rax, &convert, Label::kNear); |
__ CmpObjectType(rax, FIRST_SPEC_OBJECT_TYPE, rcx); |
- __ j(above_equal, &done_convert); |
+ __ j(above_equal, &done_convert, Label::kNear); |
__ bind(&convert); |
- __ Push(rax); |
- __ InvokeBuiltin(Builtins::TO_OBJECT, CALL_FUNCTION); |
+ ToObjectStub stub(isolate()); |
+ __ CallStub(&stub); |
__ bind(&done_convert); |
PrepareForBailoutForId(stmt->ToObjectId(), TOS_REG); |
__ Push(rax); |
@@ -3912,6 +3912,19 @@ void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { |
} |
+void FullCodeGenerator::EmitToObject(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ DCHECK_EQ(1, args->length()); |
+ |
+ // Load the argument into rax and convert it. |
+ VisitForAccumulatorValue(args->at(0)); |
+ |
+ ToObjectStub stub(isolate()); |
+ __ CallStub(&stub); |
+ context()->Plug(rax); |
+} |
+ |
+ |
void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK(args->length() == 1); |