Index: src/full-codegen/x87/full-codegen-x87.cc |
diff --git a/src/full-codegen/x87/full-codegen-x87.cc b/src/full-codegen/x87/full-codegen-x87.cc |
index 816962ab3bd8e555a81ae054cae18af558b85ba8..fe0053d36b2b473e955a964328b70211a6919a4b 100644 |
--- a/src/full-codegen/x87/full-codegen-x87.cc |
+++ b/src/full-codegen/x87/full-codegen-x87.cc |
@@ -3655,6 +3655,23 @@ void FullCodeGenerator::EmitSetValueOf(CallRuntime* expr) { |
} |
+void FullCodeGenerator::EmitToInteger(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ DCHECK_EQ(1, args->length()); |
+ |
+ // Load the argument into eax and convert it. |
+ VisitForAccumulatorValue(args->at(0)); |
+ |
+ // Convert the object to an integer. |
+ Label done_convert; |
+ __ JumpIfSmi(eax, &done_convert, Label::kNear); |
+ __ Push(eax); |
+ __ CallRuntime(Runtime::kToInteger, 1); |
+ __ bind(&done_convert); |
+ context()->Plug(eax); |
+} |
+ |
+ |
void FullCodeGenerator::EmitNumberToString(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK_EQ(args->length(), 1); |