Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index 6c40d26af27e6aa2e28289276f25f5fb0e727e6a..862f17994c645d4a04566345b8b4ef3fb9ebff84 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -1629,6 +1629,49 @@ void FullCodeGenerator::VisitCall(Call* expr) { |
#endif |
} |
+void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ int arg_count = args->length(); |
+ |
+ if (expr->is_jsruntime()) { |
+ Comment cmnt(masm_, "[ CallRuntime"); |
+ EmitLoadJSRuntimeFunction(expr); |
+ |
+ // Push the arguments ("left-to-right"). |
+ for (int i = 0; i < arg_count; i++) { |
+ VisitForStackValue(args->at(i)); |
+ } |
+ |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
+ EmitCallJSRuntimeFunction(expr); |
+ context()->DropAndPlug(1, result_register()); |
+ |
+ } else { |
+ const Runtime::Function* function = expr->function(); |
+ switch (function->function_id) { |
+#define CALL_INTRINSIC_GENERATOR(Name) \ |
+ case Runtime::kInline##Name: { \ |
+ Comment cmnt(masm_, "[ Inline" #Name); \ |
+ return Emit##Name(expr); \ |
+ } |
+ FOR_EACH_FULL_CODE_INTRINSIC(CALL_INTRINSIC_GENERATOR) |
+#undef CALL_INTRINSIC_GENERATOR |
+ default: { |
+ Comment cmnt(masm_, "[ CallRuntime for unhandled intrinsic"); |
+ // Push the arguments ("left-to-right"). |
+ for (int i = 0; i < arg_count; i++) { |
+ VisitForStackValue(args->at(i)); |
+ } |
+ |
+ // Call the C runtime function. |
+ PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
+ __ CallRuntime(expr->function(), arg_count); |
+ OperandStackDepthDecrement(arg_count); |
+ context()->Plug(result_register()); |
+ } |
+ } |
+ } |
+} |
void FullCodeGenerator::VisitSpread(Spread* expr) { UNREACHABLE(); } |