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 cf59e66abdcb7aec5469fe61aff43f3c53ef31ff..0e5cf985b8d9286f4192c9d6c6db93fcbae0b2e7 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -2730,6 +2730,25 @@ |
// All done. |
__ bind(&done); |
+ context()->Plug(rax); |
+} |
+ |
+ |
+void FullCodeGenerator::EmitValueOf(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ DCHECK(args->length() == 1); |
+ |
+ VisitForAccumulatorValue(args->at(0)); // Load the object. |
+ |
+ Label done; |
+ // If the object is a smi return the object. |
+ __ JumpIfSmi(rax, &done); |
+ // If the object is not a value type, return the object. |
+ __ CmpObjectType(rax, JS_VALUE_TYPE, rbx); |
+ __ j(not_equal, &done); |
+ __ movp(rax, FieldOperand(rax, JSValue::kValueOffset)); |
+ |
+ __ bind(&done); |
context()->Plug(rax); |
} |