@@ -5969,7 +5969,8 @@ void CodeStubAssembler::LoadPropertyFromGlobalDictionary(Node* dictionary,
5969
5969
// Returns either the original value, or the result of the getter call.
5970
5970
Node* CodeStubAssembler::CallGetterIfAccessor (Node* value, Node* details,
5971
5971
Node* context, Node* receiver,
5972
- Label* if_bailout) {
5972
+ Label* if_bailout,
5973
+ GetOwnPropertyMode mode) {
5973
5974
VARIABLE (var_value, MachineRepresentation::kTagged , value);
5974
5975
Label done (this ), if_accessor_info (this , Label::kDeferred );
5975
5976
@@ -5981,23 +5982,26 @@ Node* CodeStubAssembler::CallGetterIfAccessor(Node* value, Node* details,
5981
5982
5982
5983
// AccessorPair case.
5983
5984
{
5984
- Node* accessor_pair = value;
5985
- Node* getter = LoadObjectField (accessor_pair, AccessorPair::kGetterOffset );
5986
- Node* getter_map = LoadMap (getter);
5987
- Node* instance_type = LoadMapInstanceType (getter_map);
5988
- // FunctionTemplateInfo getters are not supported yet.
5989
- GotoIf (
5990
- Word32Equal (instance_type, Int32Constant (FUNCTION_TEMPLATE_INFO_TYPE)),
5991
- if_bailout);
5992
-
5993
- // Return undefined if the {getter} is not callable.
5994
- var_value.Bind (UndefinedConstant ());
5995
- GotoIfNot (IsCallableMap (getter_map), &done);
5996
-
5997
- // Call the accessor.
5998
- Callable callable = CodeFactory::Call (isolate ());
5999
- Node* result = CallJS (callable, context, getter, receiver);
6000
- var_value.Bind (result);
5985
+ if (mode == kCallJSGetter ) {
5986
+ Node* accessor_pair = value;
5987
+ Node* getter =
5988
+ LoadObjectField (accessor_pair, AccessorPair::kGetterOffset );
5989
+ Node* getter_map = LoadMap (getter);
5990
+ Node* instance_type = LoadMapInstanceType (getter_map);
5991
+ // FunctionTemplateInfo getters are not supported yet.
5992
+ GotoIf (Word32Equal (instance_type,
5993
+ Int32Constant (FUNCTION_TEMPLATE_INFO_TYPE)),
5994
+ if_bailout);
5995
+
5996
+ // Return undefined if the {getter} is not callable.
5997
+ var_value.Bind (UndefinedConstant ());
5998
+ GotoIfNot (IsCallableMap (getter_map), &done);
5999
+
6000
+ // Call the accessor.
6001
+ Callable callable = CodeFactory::Call (isolate ());
6002
+ Node* result = CallJS (callable, context, getter, receiver);
6003
+ var_value.Bind (result);
6004
+ }
6001
6005
Goto (&done);
6002
6006
}
6003
6007
@@ -6067,14 +6071,14 @@ void CodeStubAssembler::TryGetOwnProperty(
6067
6071
Label* if_not_found, Label* if_bailout) {
6068
6072
TryGetOwnProperty (context, receiver, object, map, instance_type, unique_name,
6069
6073
if_found_value, var_value, nullptr , nullptr , if_not_found,
6070
- if_bailout);
6074
+ if_bailout, kCallJSGetter );
6071
6075
}
6072
6076
6073
6077
void CodeStubAssembler::TryGetOwnProperty (
6074
6078
Node* context, Node* receiver, Node* object, Node* map, Node* instance_type,
6075
6079
Node* unique_name, Label* if_found_value, Variable* var_value,
6076
6080
Variable* var_details, Variable* var_raw_value, Label* if_not_found,
6077
- Label* if_bailout) {
6081
+ Label* if_bailout, GetOwnPropertyMode mode ) {
6078
6082
DCHECK_EQ (MachineRepresentation::kTagged , var_value->rep ());
6079
6083
Comment (" TryGetOwnProperty" );
6080
6084
@@ -6125,7 +6129,7 @@ void CodeStubAssembler::TryGetOwnProperty(
6125
6129
var_raw_value->Bind (var_value->value ());
6126
6130
}
6127
6131
Node* value = CallGetterIfAccessor (var_value->value (), var_details->value (),
6128
- context, receiver, if_bailout);
6132
+ context, receiver, if_bailout, mode );
6129
6133
var_value->Bind (value);
6130
6134
Goto (if_found_value);
6131
6135
}
0 commit comments