Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/hydrogen.h" | 5 #include "src/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 7333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7344 KeyedAccessStoreMode store_mode) { | 7344 KeyedAccessStoreMode store_mode) { |
| 7345 HCheckMaps* checked_object = Add<HCheckMaps>(object, map, dependency); | 7345 HCheckMaps* checked_object = Add<HCheckMaps>(object, map, dependency); |
| 7346 | 7346 |
| 7347 if (access_type == STORE && map->prototype()->IsJSObject()) { | 7347 if (access_type == STORE && map->prototype()->IsJSObject()) { |
| 7348 // monomorphic stores need a prototype chain check because shape | 7348 // monomorphic stores need a prototype chain check because shape |
| 7349 // changes could allow callbacks on elements in the chain that | 7349 // changes could allow callbacks on elements in the chain that |
| 7350 // aren't compatible with monomorphic keyed stores. | 7350 // aren't compatible with monomorphic keyed stores. |
| 7351 PrototypeIterator iter(map); | 7351 PrototypeIterator iter(map); |
| 7352 JSObject* holder = NULL; | 7352 JSObject* holder = NULL; |
| 7353 while (!iter.IsAtEnd()) { | 7353 while (!iter.IsAtEnd()) { |
| 7354 holder = JSObject::cast(*PrototypeIterator::GetCurrent(iter)); | 7354 holder = iter.GetCurrent<JSObject>(); |
|
Jakob Kummerow
2015/09/09 14:29:55
I think you need to keep the '*' -- when a Prototy
Camillo Bruni
2015/09/09 17:24:07
PrototypeIterator::GetCurrent and ->/.GetCurrent a
Camillo Bruni
2015/09/10 10:53:59
reverted
| |
| 7355 iter.Advance(); | 7355 iter.Advance(); |
| 7356 } | 7356 } |
| 7357 DCHECK(holder && holder->IsJSObject()); | 7357 DCHECK(holder && holder->IsJSObject()); |
| 7358 | 7358 |
| 7359 BuildCheckPrototypeMaps(handle(JSObject::cast(map->prototype())), | 7359 BuildCheckPrototypeMaps(handle(JSObject::cast(map->prototype())), |
| 7360 Handle<JSObject>(holder)); | 7360 Handle<JSObject>(holder)); |
| 7361 } | 7361 } |
| 7362 | 7362 |
| 7363 LoadKeyedHoleMode load_mode = BuildKeyedHoleMode(map); | 7363 LoadKeyedHoleMode load_mode = BuildKeyedHoleMode(map); |
| 7364 return BuildUncheckedMonomorphicElementAccess( | 7364 return BuildUncheckedMonomorphicElementAccess( |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7873 return check; | 7873 return check; |
| 7874 } | 7874 } |
| 7875 | 7875 |
| 7876 | 7876 |
| 7877 HInstruction* HGraphBuilder::BuildCheckPrototypeMaps(Handle<JSObject> prototype, | 7877 HInstruction* HGraphBuilder::BuildCheckPrototypeMaps(Handle<JSObject> prototype, |
| 7878 Handle<JSObject> holder) { | 7878 Handle<JSObject> holder) { |
| 7879 PrototypeIterator iter(isolate(), prototype, | 7879 PrototypeIterator iter(isolate(), prototype, |
| 7880 PrototypeIterator::START_AT_RECEIVER); | 7880 PrototypeIterator::START_AT_RECEIVER); |
| 7881 while (holder.is_null() || | 7881 while (holder.is_null() || |
| 7882 !PrototypeIterator::GetCurrent(iter).is_identical_to(holder)) { | 7882 !PrototypeIterator::GetCurrent(iter).is_identical_to(holder)) { |
| 7883 BuildConstantMapCheck( | 7883 BuildConstantMapCheck(PrototypeIterator::GetCurrent<JSObject>(iter)); |
| 7884 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter))); | |
| 7885 iter.Advance(); | 7884 iter.Advance(); |
| 7886 if (iter.IsAtEnd()) { | 7885 if (iter.IsAtEnd()) { |
| 7887 return NULL; | 7886 return NULL; |
| 7888 } | 7887 } |
| 7889 } | 7888 } |
| 7890 return BuildConstantMapCheck( | 7889 return BuildConstantMapCheck(PrototypeIterator::GetCurrent<JSObject>(iter)); |
| 7891 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter))); | |
| 7892 } | 7890 } |
| 7893 | 7891 |
| 7894 | 7892 |
| 7895 void HOptimizedGraphBuilder::AddCheckPrototypeMaps(Handle<JSObject> holder, | 7893 void HOptimizedGraphBuilder::AddCheckPrototypeMaps(Handle<JSObject> holder, |
| 7896 Handle<Map> receiver_map) { | 7894 Handle<Map> receiver_map) { |
| 7897 if (!holder.is_null()) { | 7895 if (!holder.is_null()) { |
| 7898 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); | 7896 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); |
| 7899 BuildCheckPrototypeMaps(prototype, holder); | 7897 BuildCheckPrototypeMaps(prototype, holder); |
| 7900 } | 7898 } |
| 7901 } | 7899 } |
| (...skipping 5559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 13461 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13459 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13462 } | 13460 } |
| 13463 | 13461 |
| 13464 #ifdef DEBUG | 13462 #ifdef DEBUG |
| 13465 graph_->Verify(false); // No full verify. | 13463 graph_->Verify(false); // No full verify. |
| 13466 #endif | 13464 #endif |
| 13467 } | 13465 } |
| 13468 | 13466 |
| 13469 } // namespace internal | 13467 } // namespace internal |
| 13470 } // namespace v8 | 13468 } // namespace v8 |
| OLD | NEW |