| 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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 } | 1084 } |
| 1085 } else if (getter->IsCallable()) { | 1085 } else if (getter->IsCallable()) { |
| 1086 // TODO(rossberg): nicer would be to cast to some JSCallable here... | 1086 // TODO(rossberg): nicer would be to cast to some JSCallable here... |
| 1087 return Object::GetPropertyWithDefinedGetter( | 1087 return Object::GetPropertyWithDefinedGetter( |
| 1088 receiver, Handle<JSReceiver>::cast(getter)); | 1088 receiver, Handle<JSReceiver>::cast(getter)); |
| 1089 } | 1089 } |
| 1090 // Getter is not a function. | 1090 // Getter is not a function. |
| 1091 return ReadAbsentProperty(isolate, receiver, it->GetName()); | 1091 return ReadAbsentProperty(isolate, receiver, it->GetName()); |
| 1092 } | 1092 } |
| 1093 | 1093 |
| 1094 #ifdef USE_SIMULATOR | |
| 1095 // static | |
| 1096 Address AccessorInfo::redirect(Isolate* isolate, Address address, | |
| 1097 AccessorComponent component) { | |
| 1098 ApiFunction fun(address); | |
| 1099 DCHECK_EQ(ACCESSOR_GETTER, component); | |
| 1100 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; | |
| 1101 return ExternalReference(&fun, type, isolate).address(); | |
| 1102 } | |
| 1103 | |
| 1104 Address AccessorInfo::redirected_getter() const { | |
| 1105 Address accessor = v8::ToCData<Address>(getter()); | |
| 1106 if (accessor == nullptr) return nullptr; | |
| 1107 return redirect(GetIsolate(), accessor, ACCESSOR_GETTER); | |
| 1108 } | |
| 1109 #endif | |
| 1110 | 1094 |
| 1111 bool AccessorInfo::IsCompatibleReceiverMap(Isolate* isolate, | 1095 bool AccessorInfo::IsCompatibleReceiverMap(Isolate* isolate, |
| 1112 Handle<AccessorInfo> info, | 1096 Handle<AccessorInfo> info, |
| 1113 Handle<Map> map) { | 1097 Handle<Map> map) { |
| 1114 if (!info->HasExpectedReceiverType()) return true; | 1098 if (!info->HasExpectedReceiverType()) return true; |
| 1115 if (!map->IsJSObjectMap()) return false; | 1099 if (!map->IsJSObjectMap()) return false; |
| 1116 return FunctionTemplateInfo::cast(info->expected_receiver_type()) | 1100 return FunctionTemplateInfo::cast(info->expected_receiver_type()) |
| 1117 ->IsTemplateFor(*map); | 1101 ->IsTemplateFor(*map); |
| 1118 } | 1102 } |
| 1119 | 1103 |
| (...skipping 18292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19412 if (cell->value() != *new_value) { | 19396 if (cell->value() != *new_value) { |
| 19413 cell->set_value(*new_value); | 19397 cell->set_value(*new_value); |
| 19414 Isolate* isolate = cell->GetIsolate(); | 19398 Isolate* isolate = cell->GetIsolate(); |
| 19415 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19399 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19416 isolate, DependentCode::kPropertyCellChangedGroup); | 19400 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19417 } | 19401 } |
| 19418 } | 19402 } |
| 19419 | 19403 |
| 19420 } // namespace internal | 19404 } // namespace internal |
| 19421 } // namespace v8 | 19405 } // namespace v8 |
| OLD | NEW |