Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: src/interpreter/interpreter.cc

Issue 1396693003: [Interpreter] Add function literal support. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_newcontext
Patch Set: Review comments Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 0306e7b575d8aca0f186623cb5875c132337502b..3ed234c778d9ba5d837b717132ec24c2cbb3f671 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -687,6 +687,23 @@ void Interpreter::DoJumpIfFalseConstant(
}
+// CreateClosure <tenured>
+//
+// Creates a new closure for SharedFunctionInfo in the accumulator with the
+// PretenureFlag <tenured>.
+void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) {
+ // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of
+ // calling into the runtime.
+ Node* shared = __ GetAccumulator();
+ Node* tenured_raw = __ BytecodeOperandImm8(0);
+ Node* tenured = __ SmiTag(tenured_raw);
+ Node* result =
+ __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured);
+ __ SetAccumulator(result);
+ __ Dispatch();
+}
+
+
// Return
//
// Return the value in the accumulator.
« no previous file with comments | « src/interpreter/bytecodes.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698