OLD | NEW |
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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 DCHECK(flag != kCacheOnPrototypeReceiverIsDictionary); | 271 DCHECK(flag != kCacheOnPrototypeReceiverIsDictionary); |
272 | 272 |
273 if (state() == MONOMORPHIC) { | 273 if (state() == MONOMORPHIC) { |
274 int index = ic_holder_map->IndexInCodeCache(*name, *target()); | 274 int index = ic_holder_map->IndexInCodeCache(*name, *target()); |
275 if (index >= 0) { | 275 if (index >= 0) { |
276 ic_holder_map->RemoveFromCodeCache(*name, *target(), index); | 276 ic_holder_map->RemoveFromCodeCache(*name, *target(), index); |
277 } | 277 } |
278 } | 278 } |
279 | 279 |
280 if (receiver->IsGlobalObject()) { | 280 if (receiver->IsGlobalObject()) { |
281 LookupResult lookup(isolate()); | 281 Handle<GlobalObject> global = Handle<GlobalObject>::cast(receiver); |
282 GlobalObject* global = GlobalObject::cast(*receiver); | 282 LookupIterator it(global, name, LookupIterator::CHECK_PROPERTY); |
283 global->LookupOwnRealNamedProperty(name, &lookup); | 283 if (!it.IsFound() || !it.HasProperty()) return false; |
284 if (!lookup.IsFound()) return false; | 284 Handle<PropertyCell> cell = it.GetPropertyCell(); |
285 PropertyCell* cell = global->GetPropertyCell(&lookup); | |
286 return cell->type()->IsConstant(); | 285 return cell->type()->IsConstant(); |
287 } | 286 } |
288 | 287 |
289 return true; | 288 return true; |
290 } | 289 } |
291 | 290 |
292 | 291 |
293 bool IC::IsNameCompatibleWithPrototypeFailure(Handle<Object> name) { | 292 bool IC::IsNameCompatibleWithPrototypeFailure(Handle<Object> name) { |
294 if (target()->is_keyed_stub()) { | 293 if (target()->is_keyed_stub()) { |
295 // Determine whether the failure is due to a name failure. | 294 // Determine whether the failure is due to a name failure. |
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3174 #undef ADDR | 3173 #undef ADDR |
3175 }; | 3174 }; |
3176 | 3175 |
3177 | 3176 |
3178 Address IC::AddressFromUtilityId(IC::UtilityId id) { | 3177 Address IC::AddressFromUtilityId(IC::UtilityId id) { |
3179 return IC_utilities[id]; | 3178 return IC_utilities[id]; |
3180 } | 3179 } |
3181 | 3180 |
3182 | 3181 |
3183 } } // namespace v8::internal | 3182 } } // namespace v8::internal |
OLD | NEW |