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

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: Make CreateClosure a bytecode 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
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 74cfd4782898db131ac44803c58464fae5e46d66..212da8e70efcf882836f631698b18506cd4a9a60 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -652,6 +652,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
Michael Starzinger 2015/10/09 13:19:00 About this TODO: Michael Stanton is currently work
rmcilroy 2015/10/12 17:00:15 Good to know, thanks!
+ // 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.

Powered by Google App Engine
This is Rietveld 408576698