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

Unified Diff: src/code-stub-assembler.cc

Issue 2128233002: [Interpreter] Add ClassOf intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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-stub-assembler.h ('k') | src/interpreter/interpreter-intrinsics.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index c0380bb8c1df22cff8ce5801e9300d4e4aa5b380..3545348033d189ea5321a29c666cd69bf1583447 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -567,6 +567,26 @@ Node* CodeStubAssembler::LoadMapInobjectProperties(Node* map) {
MachineType::Uint8());
}
+Node* CodeStubAssembler::LoadMapConstructor(Node* map) {
+ Variable result(this, MachineRepresentation::kTagged);
+ result.Bind(LoadObjectField(map, Map::kConstructorOrBackPointerOffset));
+
+ Label done(this), loop(this, &result);
+ Goto(&loop);
+ Bind(&loop);
+ {
+ GotoIf(WordIsSmi(result.value()), &done);
+ Node* is_map_type =
+ Word32Equal(LoadInstanceType(result.value()), Int32Constant(MAP_TYPE));
+ GotoUnless(is_map_type, &done);
+ result.Bind(
+ LoadObjectField(result.value(), Map::kConstructorOrBackPointerOffset));
+ Goto(&loop);
+ }
+ Bind(&done);
+ return result.value();
+}
+
Node* CodeStubAssembler::LoadNameHashField(Node* name) {
return LoadObjectField(name, Name::kHashFieldOffset, MachineType::Uint32());
}
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/interpreter/interpreter-intrinsics.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698