Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index 50d84d06cf7971b020a9e77ecad2e0a5becab661..28bb36e95be96a2ce6311e4f0e7a63b0c73c45c9 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -3664,6 +3664,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); |