| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (js_object->map()->is_access_check_needed()) return false; | 120 if (js_object->map()->is_access_check_needed()) return false; |
| 121 auto isolate = js_object->GetIsolate(); | 121 auto isolate = js_object->GetIsolate(); |
| 122 // TODO(dcarney): this should just be read from the symbol registry so as not | 122 // TODO(dcarney): this should just be read from the symbol registry so as not |
| 123 // to be context dependent. | 123 // to be context dependent. |
| 124 auto key = isolate->promise_status(); | 124 auto key = isolate->promise_status(); |
| 125 // Shouldn't be possible to throw here. | 125 // Shouldn't be possible to throw here. |
| 126 return JSObject::HasRealNamedProperty(js_object, key).FromJust(); | 126 return JSObject::HasRealNamedProperty(js_object, key).FromJust(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 | 129 |
| 130 MaybeHandle<Object> Object::GetProperty(LookupIterator* it, | 130 MaybeHandle<Object> Object::GetPropertyInternal(LookupIterator* it, |
| 131 LanguageMode language_mode) { | 131 bool* failedAccessCheck, |
| 132 LanguageMode language_mode) { |
| 132 for (; it->IsFound(); it->Next()) { | 133 for (; it->IsFound(); it->Next()) { |
| 133 switch (it->state()) { | 134 switch (it->state()) { |
| 134 case LookupIterator::NOT_FOUND: | 135 case LookupIterator::NOT_FOUND: |
| 135 case LookupIterator::TRANSITION: | 136 case LookupIterator::TRANSITION: |
| 136 UNREACHABLE(); | 137 UNREACHABLE(); |
| 137 case LookupIterator::JSPROXY: | 138 case LookupIterator::JSPROXY: |
| 138 return JSProxy::GetPropertyWithHandler( | 139 return JSProxy::GetPropertyWithHandler( |
| 139 it->GetHolder<JSProxy>(), it->GetReceiver(), it->GetName()); | 140 it->GetHolder<JSProxy>(), it->GetReceiver(), it->GetName()); |
| 140 case LookupIterator::INTERCEPTOR: { | 141 case LookupIterator::INTERCEPTOR: { |
| 141 bool done; | 142 bool done; |
| 142 Handle<Object> result; | 143 Handle<Object> result; |
| 143 ASSIGN_RETURN_ON_EXCEPTION( | 144 ASSIGN_RETURN_ON_EXCEPTION( |
| 144 it->isolate(), result, | 145 it->isolate(), result, |
| 145 JSObject::GetPropertyWithInterceptor(it, &done), Object); | 146 JSObject::GetPropertyWithInterceptor(it, &done), Object); |
| 146 if (done) return result; | 147 if (done) return result; |
| 147 break; | 148 break; |
| 148 } | 149 } |
| 149 case LookupIterator::ACCESS_CHECK: | 150 case LookupIterator::ACCESS_CHECK: |
| 150 if (it->HasAccess()) break; | 151 if (it->HasAccess()) break; |
| 151 return JSObject::GetPropertyWithFailedAccessCheck(it); | 152 *failedAccessCheck = true; |
| 153 return MaybeHandle<Object>(); |
| 152 case LookupIterator::ACCESSOR: | 154 case LookupIterator::ACCESSOR: |
| 153 return GetPropertyWithAccessor(it, language_mode); | 155 return GetPropertyWithAccessor(it, language_mode); |
| 154 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 156 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
| 155 return ReadAbsentProperty(it, language_mode); | 157 return ReadAbsentProperty(it, language_mode); |
| 156 case LookupIterator::DATA: | 158 case LookupIterator::DATA: |
| 157 return it->GetDataValue(); | 159 return it->GetDataValue(); |
| 158 } | 160 } |
| 159 } | 161 } |
| 160 return ReadAbsentProperty(it, language_mode); | 162 return ReadAbsentProperty(it, language_mode); |
| 161 } | 163 } |
| (...skipping 15964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16126 Handle<Object> new_value) { | 16128 Handle<Object> new_value) { |
| 16127 if (cell->value() != *new_value) { | 16129 if (cell->value() != *new_value) { |
| 16128 cell->set_value(*new_value); | 16130 cell->set_value(*new_value); |
| 16129 Isolate* isolate = cell->GetIsolate(); | 16131 Isolate* isolate = cell->GetIsolate(); |
| 16130 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16132 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 16131 isolate, DependentCode::kPropertyCellChangedGroup); | 16133 isolate, DependentCode::kPropertyCellChangedGroup); |
| 16132 } | 16134 } |
| 16133 } | 16135 } |
| 16134 } // namespace internal | 16136 } // namespace internal |
| 16135 } // namespace v8 | 16137 } // namespace v8 |
| OLD | NEW |