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

Unified Diff: src/interpreter/interpreter.cc

Issue 2113613002: [Interpereter] Inline FastNewClosure into CreateClosure bytecode handler (Closed) Base URL: ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@int_context
Patch Set: Rebaseline bytecode expectations Created 4 years, 6 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.cc ('k') | test/cctest/interpreter/bytecode_expectations/BasicLoops.golden » ('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 8a05777818ded7d37187c4f91ab4ba7da9b3d584..227bef538fafff8487362d8ff4af26aaba6ff7a4 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1492,17 +1492,29 @@ void Interpreter::DoCreateObjectLiteral(InterpreterAssembler* assembler) {
// Creates a new closure for SharedFunctionInfo at position |index| in the
// constant pool and with the PretenureFlag <tenured>.
void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) {
- // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of
- // calling into the runtime.
Node* index = __ BytecodeOperandIdx(0);
Node* shared = __ LoadConstantPoolEntry(index);
- Node* tenured_raw = __ BytecodeOperandFlag(1);
- Node* tenured = __ SmiTag(tenured_raw);
+ Node* flags = __ BytecodeOperandFlag(1);
Node* context = __ GetContext();
- Node* result =
- __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, tenured);
- __ SetAccumulator(result);
+
+ Label call_runtime(assembler, Label::kDeferred);
+ Node* fast_new_closure = __ Word32And(
+ flags, __ Int32Constant(CreateClosureFlags::FastNewClosureBit::kMask));
+ __ GotoUnless(fast_new_closure, &call_runtime);
+ __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context));
__ Dispatch();
+
+ __ Bind(&call_runtime);
+ {
+ STATIC_ASSERT(CreateClosureFlags::PretenuredBit::kShift == 0);
+ Node* tenured_raw = __ Word32And(
+ flags, __ Int32Constant(CreateClosureFlags::PretenuredBit::kMask));
+ Node* tenured = __ SmiTag(tenured_raw);
+ Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context,
+ shared, tenured);
+ __ SetAccumulator(result);
+ __ Dispatch();
+ }
}
// CreateMappedArguments
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | test/cctest/interpreter/bytecode_expectations/BasicLoops.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698