OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 Heap* heap = name->GetHeap(); | 538 Heap* heap = name->GetHeap(); |
539 | 539 |
540 // Traverse the prototype chain from the current object (this) to | 540 // Traverse the prototype chain from the current object (this) to |
541 // the holder and check for access rights. This avoids traversing the | 541 // the holder and check for access rights. This avoids traversing the |
542 // objects more than once in case of interceptors, because the | 542 // objects more than once in case of interceptors, because the |
543 // holder will always be the interceptor holder and the search may | 543 // holder will always be the interceptor holder and the search may |
544 // only continue with a current object just after the interceptor | 544 // only continue with a current object just after the interceptor |
545 // holder in the prototype chain. | 545 // holder in the prototype chain. |
546 // Proxy handlers do not use the proxy's prototype, so we can skip this. | 546 // Proxy handlers do not use the proxy's prototype, so we can skip this. |
547 if (!result->IsHandler()) { | 547 if (!result->IsHandler()) { |
548 Object* last = result->IsProperty() ? result->holder() : heap->null_value(); | 548 Object* last = result->IsProperty() |
| 549 ? result->holder() |
| 550 : Object::cast(heap->null_value()); |
549 ASSERT(this != this->GetPrototype()); | 551 ASSERT(this != this->GetPrototype()); |
550 for (Object* current = this; true; current = current->GetPrototype()) { | 552 for (Object* current = this; true; current = current->GetPrototype()) { |
551 if (current->IsAccessCheckNeeded()) { | 553 if (current->IsAccessCheckNeeded()) { |
552 // Check if we're allowed to read from the current object. Note | 554 // Check if we're allowed to read from the current object. Note |
553 // that even though we may not actually end up loading the named | 555 // that even though we may not actually end up loading the named |
554 // property from the current object, we still check that we have | 556 // property from the current object, we still check that we have |
555 // access to it. | 557 // access to it. |
556 JSObject* checked = JSObject::cast(current); | 558 JSObject* checked = JSObject::cast(current); |
557 if (!heap->isolate()->MayNamedAccess(checked, name, v8::ACCESS_GET)) { | 559 if (!heap->isolate()->MayNamedAccess(checked, name, v8::ACCESS_GET)) { |
558 return checked->GetPropertyWithFailedAccessCheck(receiver, | 560 return checked->GetPropertyWithFailedAccessCheck(receiver, |
(...skipping 11605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12164 if (break_point_objects()->IsUndefined()) return 0; | 12166 if (break_point_objects()->IsUndefined()) return 0; |
12165 // Single break point. | 12167 // Single break point. |
12166 if (!break_point_objects()->IsFixedArray()) return 1; | 12168 if (!break_point_objects()->IsFixedArray()) return 1; |
12167 // Multiple break points. | 12169 // Multiple break points. |
12168 return FixedArray::cast(break_point_objects())->length(); | 12170 return FixedArray::cast(break_point_objects())->length(); |
12169 } | 12171 } |
12170 #endif | 12172 #endif |
12171 | 12173 |
12172 | 12174 |
12173 } } // namespace v8::internal | 12175 } } // namespace v8::internal |
OLD | NEW |