OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 Handle<Object> return_value = v8::Utils::OpenHandle(*result); | 1074 Handle<Object> return_value = v8::Utils::OpenHandle(*result); |
1075 return_value->VerifyApiCallResultType(); | 1075 return_value->VerifyApiCallResultType(); |
1076 // Rebox handle before return. | 1076 // Rebox handle before return. |
1077 return handle(*return_value, isolate); | 1077 return handle(*return_value, isolate); |
1078 } | 1078 } |
1079 | 1079 |
1080 // Regular accessor. | 1080 // Regular accessor. |
1081 Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate); | 1081 Handle<Object> getter(AccessorPair::cast(*structure)->getter(), isolate); |
1082 if (getter->IsFunctionTemplateInfo()) { | 1082 if (getter->IsFunctionTemplateInfo()) { |
1083 auto result = Builtins::InvokeApiFunction( | 1083 auto result = Builtins::InvokeApiFunction( |
1084 false, Handle<FunctionTemplateInfo>::cast(getter), receiver, 0, | 1084 Handle<FunctionTemplateInfo>::cast(getter), receiver, 0, nullptr); |
1085 nullptr); | |
1086 if (isolate->has_pending_exception()) { | 1085 if (isolate->has_pending_exception()) { |
1087 return MaybeHandle<Object>(); | 1086 return MaybeHandle<Object>(); |
1088 } | 1087 } |
1089 Handle<Object> return_value; | 1088 Handle<Object> return_value; |
1090 if (result.ToHandle(&return_value)) { | 1089 if (result.ToHandle(&return_value)) { |
1091 return_value->VerifyApiCallResultType(); | 1090 return_value->VerifyApiCallResultType(); |
1092 return handle(*return_value, isolate); | 1091 return handle(*return_value, isolate); |
1093 } | 1092 } |
1094 } else if (getter->IsCallable()) { | 1093 } else if (getter->IsCallable()) { |
1095 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 1094 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 should_throw); | 1143 should_throw); |
1145 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); | 1144 args.Call(call_fun, v8::Utils::ToLocal(name), v8::Utils::ToLocal(value)); |
1146 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); | 1145 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, Nothing<bool>()); |
1147 return Just(true); | 1146 return Just(true); |
1148 } | 1147 } |
1149 | 1148 |
1150 // Regular accessor. | 1149 // Regular accessor. |
1151 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); | 1150 Handle<Object> setter(AccessorPair::cast(*structure)->setter(), isolate); |
1152 if (setter->IsFunctionTemplateInfo()) { | 1151 if (setter->IsFunctionTemplateInfo()) { |
1153 Handle<Object> argv[] = {value}; | 1152 Handle<Object> argv[] = {value}; |
1154 auto result = Builtins::InvokeApiFunction( | 1153 auto result = |
1155 false, Handle<FunctionTemplateInfo>::cast(setter), receiver, | 1154 Builtins::InvokeApiFunction(Handle<FunctionTemplateInfo>::cast(setter), |
1156 arraysize(argv), argv); | 1155 receiver, arraysize(argv), argv); |
1157 if (isolate->has_pending_exception()) { | 1156 if (isolate->has_pending_exception()) { |
1158 return Nothing<bool>(); | 1157 return Nothing<bool>(); |
1159 } | 1158 } |
1160 return Just(true); | 1159 return Just(true); |
1161 } else if (setter->IsCallable()) { | 1160 } else if (setter->IsCallable()) { |
1162 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 1161 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
1163 return SetPropertyWithDefinedSetter( | 1162 return SetPropertyWithDefinedSetter( |
1164 receiver, Handle<JSReceiver>::cast(setter), value, should_throw); | 1163 receiver, Handle<JSReceiver>::cast(setter), value, should_throw); |
1165 } | 1164 } |
1166 | 1165 |
(...skipping 18605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19772 if (cell->value() != *new_value) { | 19771 if (cell->value() != *new_value) { |
19773 cell->set_value(*new_value); | 19772 cell->set_value(*new_value); |
19774 Isolate* isolate = cell->GetIsolate(); | 19773 Isolate* isolate = cell->GetIsolate(); |
19775 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19774 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19776 isolate, DependentCode::kPropertyCellChangedGroup); | 19775 isolate, DependentCode::kPropertyCellChangedGroup); |
19777 } | 19776 } |
19778 } | 19777 } |
19779 | 19778 |
19780 } // namespace internal | 19779 } // namespace internal |
19781 } // namespace v8 | 19780 } // namespace v8 |
OLD | NEW |