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

Unified Diff: src/code-stubs.cc

Issue 2187523002: [interpreter] Add CreateFunctionContext bytecode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fncontextstubslotparam
Patch Set: fix bytecode graph builder Created 4 years, 4 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/code-stubs.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index 22f70fbd6e119bf644484ccb2b902f2930e6bb7a..e098f20fcbb0e77e4f7e240c76fd31db337f42e4 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4623,16 +4623,14 @@ void FastNewClosureStub::GenerateAssembly(CodeStubAssembler* assembler) const {
Generate(assembler, assembler->Parameter(0), assembler->Parameter(1)));
}
-void FastNewFunctionContextStub::GenerateAssembly(
- CodeStubAssembler* assembler) const {
+// static
+compiler::Node* FastNewFunctionContextStub::Generate(
+ CodeStubAssembler* assembler, compiler::Node* function,
+ compiler::Node* slots, compiler::Node* context) {
typedef CodeStubAssembler::Label Label;
typedef compiler::Node Node;
typedef CodeStubAssembler::Variable Variable;
- Node* function = assembler->Parameter(Descriptor::kFunction);
- Node* slots = assembler->Parameter(FastNewFunctionContextDescriptor::kSlots);
- Node* context = assembler->Parameter(Descriptor::kContext);
-
Node* min_context_slots =
assembler->Int32Constant(Context::MIN_CONTEXT_SLOTS);
Node* length = assembler->Int32Add(slots, min_context_slots);
@@ -4643,9 +4641,10 @@ void FastNewFunctionContextStub::GenerateAssembly(
// Create a new closure from the given function info in new space
Node* function_context = assembler->Allocate(size);
+ Isolate* isolate = assembler->isolate();
assembler->StoreMapNoWriteBarrier(
function_context,
- assembler->HeapConstant(isolate()->factory()->function_context_map()));
+ assembler->HeapConstant(isolate->factory()->function_context_map()));
assembler->StoreObjectFieldNoWriteBarrier(function_context,
Context::kLengthOffset,
assembler->SmiFromWord32(length));
@@ -4689,7 +4688,17 @@ void FastNewFunctionContextStub::GenerateAssembly(
}
assembler->Bind(&after_loop);
- assembler->Return(function_context);
+ return function_context;
+}
+
+void FastNewFunctionContextStub::GenerateAssembly(
+ CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+ Node* function = assembler->Parameter(Descriptor::kFunction);
+ Node* slots = assembler->Parameter(FastNewFunctionContextDescriptor::kSlots);
+ Node* context = assembler->Parameter(Descriptor::kContext);
+
+ assembler->Return(Generate(assembler, function, slots, context));
}
void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) {
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698