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

Unified Diff: src/code-stubs.cc

Issue 1895093002: Create per-descriptor-index LoadApiGetterStub (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 8 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/code-assembler.h » ('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 84d8d98c8eace1582719037fc752c9338b2dd7e6..f594b0f9e266955659e86e464cb6a4568de2c083 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -3229,6 +3229,23 @@ void GenerateStringEqual(CodeStubAssembler* assembler, ResultMode mode) {
} // namespace
+void LoadApiGetterStub::GenerateAssembly(CodeStubAssembler* assembler) const {
+ typedef compiler::Node Node;
+ Node* context = assembler->Parameter(3);
+ Node* receiver = assembler->Parameter(0);
+ // For now we only support receiver_is_holder.
+ DCHECK(receiver_is_holder());
+ Node* holder = receiver;
+ Node* map = assembler->LoadMap(receiver);
+ Node* descriptors = assembler->LoadMapDescriptors(map);
+ Node* offset =
+ assembler->Int32Constant(DescriptorArray::ToValueIndex(index()));
+ Node* callback =
+ assembler->LoadFixedArrayElementInt32Index(descriptors, offset);
+ assembler->TailCallStub(CodeFactory::ApiGetter(isolate()), context, receiver,
+ holder, callback);
+}
+
void LessThanStub::GenerateAssembly(CodeStubAssembler* assembler) const {
GenerateAbstractRelationalComparison(assembler, kLessThan);
}
« no previous file with comments | « src/code-stubs.h ('k') | src/compiler/code-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698