Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 615ea71d8adc46f810ed3ae2c0d561014f9541e7..56ccabb75019625488a981f231adecbcd1295926 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -12285,6 +12285,20 @@ void HOptimizedGraphBuilder::GenerateToString(CallRuntime* call) { |
} |
+void HOptimizedGraphBuilder::GenerateToLength(CallRuntime* call) { |
+ DCHECK_EQ(1, call->arguments()->length()); |
+ CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |
+ Callable callable = CodeFactory::ToLength(isolate()); |
+ HValue* input = Pop(); |
+ HValue* stub = Add<HConstant>(callable.code()); |
+ HValue* values[] = {context(), input}; |
+ HInstruction* result = |
+ New<HCallWithDescriptor>(stub, 0, callable.descriptor(), |
+ Vector<HValue*>(values, arraysize(values))); |
+ return ast_context()->ReturnInstruction(result, call->id()); |
+} |
+ |
+ |
void HOptimizedGraphBuilder::GenerateToNumber(CallRuntime* call) { |
DCHECK_EQ(1, call->arguments()->length()); |
CHECK_ALIVE(VisitForValue(call->arguments()->at(0))); |