Index: src/fast-accessor-assembler.cc |
diff --git a/src/fast-accessor-assembler.cc b/src/fast-accessor-assembler.cc |
index cd2910ca132214374d7bc857099bdcb36370db0e..1bbb1504d3dae1b949089508045c399485cce959 100644 |
--- a/src/fast-accessor-assembler.cc |
+++ b/src/fast-accessor-assembler.cc |
@@ -56,12 +56,13 @@ FastAccessorAssembler::ValueId FastAccessorAssembler::LoadInternalField( |
CodeStubAssembler::Variable result(assembler_.get(), |
MachineRepresentation::kTagged); |
CodeStubAssembler::Label is_jsobject(assembler_.get()); |
+ CodeStubAssembler::Label maybe_api_object(assembler_.get()); |
CodeStubAssembler::Label is_not_jsobject(assembler_.get()); |
CodeStubAssembler::Label merge(assembler_.get(), &result); |
assembler_->Branch( |
assembler_->WordEqual( |
instance_type, assembler_->IntPtrConstant(Internals::kJSObjectType)), |
- &is_jsobject, &is_not_jsobject); |
+ &is_jsobject, &maybe_api_object); |
// JSObject? Then load the internal field field_no. |
assembler_->Bind(&is_jsobject); |
@@ -71,6 +72,12 @@ FastAccessorAssembler::ValueId FastAccessorAssembler::LoadInternalField( |
result.Bind(internal_field); |
assembler_->Goto(&merge); |
+ assembler_->Bind(&maybe_api_object); |
+ assembler_->Branch( |
+ assembler_->WordEqual(instance_type, assembler_->IntPtrConstant( |
+ Internals::kJSApiObjectType)), |
+ &is_jsobject, &is_not_jsobject); |
+ |
// No JSObject? Return undefined. |
// TODO(vogelheim): Check whether this is the appropriate action, or whether |
// the method should take a label instead. |