| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_PROTOTYPE_H_ | 5 #ifndef V8_PROTOTYPE_H_ |
| 6 #define V8_PROTOTYPE_H_ | 6 #define V8_PROTOTYPE_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/objects.h" | 9 #include "src/objects.h" |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 object_(receiver), | 45 object_(receiver), |
| 46 isolate_(isolate) { | 46 isolate_(isolate) { |
| 47 if (where_to_start == START_AT_PROTOTYPE) { | 47 if (where_to_start == START_AT_PROTOTYPE) { |
| 48 Advance(); | 48 Advance(); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 explicit PrototypeIterator(Map* receiver_map) | 51 explicit PrototypeIterator(Map* receiver_map) |
| 52 : did_jump_to_prototype_chain_(true), | 52 : did_jump_to_prototype_chain_(true), |
| 53 object_(receiver_map->prototype()), | 53 object_(receiver_map->prototype()), |
| 54 isolate_(receiver_map->GetIsolate()) {} | 54 isolate_(receiver_map->GetIsolate()) {} |
| 55 explicit PrototypeIterator(Handle<Map> receiver_map) |
| 56 : did_jump_to_prototype_chain_(true), |
| 57 object_(NULL), |
| 58 handle_(handle(receiver_map->prototype(), receiver_map->GetIsolate())), |
| 59 isolate_(receiver_map->GetIsolate()) {} |
| 55 ~PrototypeIterator() {} | 60 ~PrototypeIterator() {} |
| 56 | 61 |
| 57 Object* GetCurrent() const { | 62 Object* GetCurrent() const { |
| 58 ASSERT(handle_.is_null()); | 63 ASSERT(handle_.is_null()); |
| 59 return object_; | 64 return object_; |
| 60 } | 65 } |
| 61 static Handle<Object> GetCurrent(const PrototypeIterator& iterator) { | 66 static Handle<Object> GetCurrent(const PrototypeIterator& iterator) { |
| 62 ASSERT(!iterator.handle_.is_null()); | 67 ASSERT(!iterator.handle_.is_null()); |
| 63 return iterator.handle_; | 68 return iterator.handle_; |
| 64 } | 69 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 126 |
| 122 DISALLOW_COPY_AND_ASSIGN(PrototypeIterator); | 127 DISALLOW_COPY_AND_ASSIGN(PrototypeIterator); |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 | 130 |
| 126 } // namespace internal | 131 } // namespace internal |
| 127 | 132 |
| 128 } // namespace v8 | 133 } // namespace v8 |
| 129 | 134 |
| 130 #endif // V8_PROTOTYPE_H_ | 135 #endif // V8_PROTOTYPE_H_ |
| OLD | NEW |