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 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 | 1280 |
1281 Handle<Object> argv[] = { value }; | 1281 Handle<Object> argv[] = { value }; |
1282 RETURN_ON_EXCEPTION_VALUE(isolate, Execution::Call(isolate, setter, receiver, | 1282 RETURN_ON_EXCEPTION_VALUE(isolate, Execution::Call(isolate, setter, receiver, |
1283 arraysize(argv), argv), | 1283 arraysize(argv), argv), |
1284 Nothing<bool>()); | 1284 Nothing<bool>()); |
1285 return Just(true); | 1285 return Just(true); |
1286 } | 1286 } |
1287 | 1287 |
1288 | 1288 |
1289 // static | 1289 // static |
1290 bool Object::IsErrorObject(Isolate* isolate, Handle<Object> object) { | |
1291 if (!object->IsJSObject()) return false; | |
1292 // Use stack_trace_symbol as proxy for [[ErrorData]]. | |
1293 Handle<Name> symbol = isolate->factory()->stack_trace_symbol(); | |
1294 Maybe<bool> has_stack_trace = | |
1295 JSReceiver::HasOwnProperty(Handle<JSReceiver>::cast(object), symbol); | |
1296 DCHECK(!has_stack_trace.IsNothing()); | |
1297 return has_stack_trace.FromJust(); | |
1298 } | |
1299 | |
1300 | |
1301 // static | |
1302 bool JSObject::AllCanRead(LookupIterator* it) { | 1290 bool JSObject::AllCanRead(LookupIterator* it) { |
1303 // Skip current iteration, it's in state ACCESS_CHECK or INTERCEPTOR, both of | 1291 // Skip current iteration, it's in state ACCESS_CHECK or INTERCEPTOR, both of |
1304 // which have already been checked. | 1292 // which have already been checked. |
1305 DCHECK(it->state() == LookupIterator::ACCESS_CHECK || | 1293 DCHECK(it->state() == LookupIterator::ACCESS_CHECK || |
1306 it->state() == LookupIterator::INTERCEPTOR); | 1294 it->state() == LookupIterator::INTERCEPTOR); |
1307 for (it->Next(); it->IsFound(); it->Next()) { | 1295 for (it->Next(); it->IsFound(); it->Next()) { |
1308 if (it->state() == LookupIterator::ACCESSOR) { | 1296 if (it->state() == LookupIterator::ACCESSOR) { |
1309 auto accessors = it->GetAccessors(); | 1297 auto accessors = it->GetAccessors(); |
1310 if (accessors->IsAccessorInfo()) { | 1298 if (accessors->IsAccessorInfo()) { |
1311 if (AccessorInfo::cast(*accessors)->all_can_read()) return true; | 1299 if (AccessorInfo::cast(*accessors)->all_can_read()) return true; |
(...skipping 17540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18852 } else { | 18840 } else { |
18853 // Old-style generators. | 18841 // Old-style generators. |
18854 int offset = continuation(); | 18842 int offset = continuation(); |
18855 CHECK(0 <= offset && offset < function()->code()->instruction_size()); | 18843 CHECK(0 <= offset && offset < function()->code()->instruction_size()); |
18856 return function()->code()->SourcePosition(offset); | 18844 return function()->code()->SourcePosition(offset); |
18857 } | 18845 } |
18858 } | 18846 } |
18859 | 18847 |
18860 } // namespace internal | 18848 } // namespace internal |
18861 } // namespace v8 | 18849 } // namespace v8 |
OLD | NEW |