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

Side by Side Diff: src/ic-inl.h

Issue 376233002: Introduce a PrototypeIterator class and use it for prototype access (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/ic.cc ('k') | src/isolate.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IC_INL_H_ 5 #ifndef V8_IC_INL_H_
6 #define V8_IC_INL_H_ 6 #define V8_IC_INL_H_
7 7
8 #include "src/ic.h" 8 #include "src/ic.h"
9 9
10 #include "src/compiler.h" 10 #include "src/compiler.h"
11 #include "src/debug.h" 11 #include "src/debug.h"
12 #include "src/macro-assembler.h" 12 #include "src/macro-assembler.h"
13 #include "src/prototype.h"
13 14
14 namespace v8 { 15 namespace v8 {
15 namespace internal { 16 namespace internal {
16 17
17 18
18 Address IC::address() const { 19 Address IC::address() const {
19 // Get the address of the call. 20 // Get the address of the call.
20 Address result = Assembler::target_address_from_return_address(pc()); 21 Address result = Assembler::target_address_from_return_address(pc());
21 22
22 Debug* debug = isolate()->debug(); 23 Debug* debug = isolate()->debug();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 ASSERT(object->IsString() || object->IsSymbol() || 126 ASSERT(object->IsString() || object->IsSymbol() ||
126 object->IsNumber() || object->IsBoolean()); 127 object->IsNumber() || object->IsBoolean());
127 return PROTOTYPE_MAP; 128 return PROTOTYPE_MAP;
128 } 129 }
129 130
130 131
131 HeapObject* IC::GetCodeCacheHolder(Isolate* isolate, 132 HeapObject* IC::GetCodeCacheHolder(Isolate* isolate,
132 Object* object, 133 Object* object,
133 InlineCacheHolderFlag holder) { 134 InlineCacheHolderFlag holder) {
134 if (object->IsSmi()) holder = PROTOTYPE_MAP; 135 if (object->IsSmi()) holder = PROTOTYPE_MAP;
135 Object* map_owner = holder == OWN_MAP 136 PrototypeIterator iter(isolate, object,
136 ? object : object->GetPrototype(isolate); 137 holder == OWN_MAP
137 return HeapObject::cast(map_owner); 138 ? PrototypeIterator::START_AT_RECEIVER
139 : PrototypeIterator::START_AT_PROTOTYPE);
140 return HeapObject::cast(iter.GetCurrent());
138 } 141 }
139 142
140 143
141 InlineCacheHolderFlag IC::GetCodeCacheFlag(HeapType* type) { 144 InlineCacheHolderFlag IC::GetCodeCacheFlag(HeapType* type) {
142 if (type->Is(HeapType::Boolean()) || 145 if (type->Is(HeapType::Boolean()) ||
143 type->Is(HeapType::Number()) || 146 type->Is(HeapType::Number()) ||
144 type->Is(HeapType::String()) || 147 type->Is(HeapType::String()) ||
145 type->Is(HeapType::Symbol())) { 148 type->Is(HeapType::Symbol())) {
146 return PROTOTYPE_MAP; 149 return PROTOTYPE_MAP;
147 } 150 }
(...skipping 19 matching lines...) Expand all
167 } 170 }
168 return handle(JSObject::cast(constructor->instance_prototype())->map()); 171 return handle(JSObject::cast(constructor->instance_prototype())->map());
169 } 172 }
170 return TypeToMap(type, isolate); 173 return TypeToMap(type, isolate);
171 } 174 }
172 175
173 176
174 } } // namespace v8::internal 177 } } // namespace v8::internal
175 178
176 #endif // V8_IC_INL_H_ 179 #endif // V8_IC_INL_H_
OLDNEW
« no previous file with comments | « src/ic.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698