Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: src/prototype.h

Issue 390323002: Remove JSReceiver::GetPrototype and replace it with PrototypeIterator calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects-printer.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698