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()); |
} |