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

Unified Diff: src/code-stubs.cc

Issue 2325013004: [stubs] Port LoadScriptContextFieldStub and StoreScriptContextFieldStub to TurboFan. (Closed)
Patch Set: Rebasing Created 4 years, 3 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/code-stubs-hydrogen.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 685ddf87a9d54953438a903d7a443038b2e8b4c4..016d40770208e395f8cd60aa7c845580333ff78a 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -4615,6 +4615,39 @@ void KeyedStoreSloppyArgumentsStub::GenerateAssembly(
}
}
+void LoadScriptContextFieldStub::GenerateAssembly(
+ CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+
+ assembler->Comment("LoadScriptContextFieldStub: context_index=%d, slot=%d",
+ context_index(), slot_index());
+
+ Node* context = assembler->Parameter(Descriptor::kContext);
+
+ Node* script_context = assembler->LoadScriptContext(context, context_index());
+ Node* result = assembler->LoadFixedArrayElement(
+ script_context, assembler->IntPtrConstant(slot_index()), 0,
+ CodeStubAssembler::INTPTR_PARAMETERS);
+ assembler->Return(result);
+}
+
+void StoreScriptContextFieldStub::GenerateAssembly(
+ CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+
+ assembler->Comment("StoreScriptContextFieldStub: context_index=%d, slot=%d",
+ context_index(), slot_index());
+
+ Node* value = assembler->Parameter(Descriptor::kValue);
+ Node* context = assembler->Parameter(Descriptor::kContext);
+
+ Node* script_context = assembler->LoadScriptContext(context, context_index());
+ assembler->StoreFixedArrayElement(
+ script_context, assembler->IntPtrConstant(slot_index()), value,
+ UPDATE_WRITE_BARRIER, CodeStubAssembler::INTPTR_PARAMETERS);
+ assembler->Return(value);
+}
+
// static
compiler::Node* LessThanStub::Generate(CodeStubAssembler* assembler,
compiler::Node* lhs, compiler::Node* rhs,
« no previous file with comments | « src/code-stubs.h ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698