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

Side by Side Diff: src/hydrogen.cc

Issue 1330153003: Adding template parameter to PrototypeIterator GetCurrent for casting (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: simplifications Created 5 years, 3 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
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | src/ic/handler-compiler.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 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
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 = *PrototypeIterator::GetCurrent<JSObject>(iter);
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
7908 return check; 7908 return check;
7909 } 7909 }
7910 7910
7911 7911
7912 HInstruction* HGraphBuilder::BuildCheckPrototypeMaps(Handle<JSObject> prototype, 7912 HInstruction* HGraphBuilder::BuildCheckPrototypeMaps(Handle<JSObject> prototype,
7913 Handle<JSObject> holder) { 7913 Handle<JSObject> holder) {
7914 PrototypeIterator iter(isolate(), prototype, 7914 PrototypeIterator iter(isolate(), prototype,
7915 PrototypeIterator::START_AT_RECEIVER); 7915 PrototypeIterator::START_AT_RECEIVER);
7916 while (holder.is_null() || 7916 while (holder.is_null() ||
7917 !PrototypeIterator::GetCurrent(iter).is_identical_to(holder)) { 7917 !PrototypeIterator::GetCurrent(iter).is_identical_to(holder)) {
7918 BuildConstantMapCheck( 7918 BuildConstantMapCheck(PrototypeIterator::GetCurrent<JSObject>(iter));
7919 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)));
7920 iter.Advance(); 7919 iter.Advance();
7921 if (iter.IsAtEnd()) { 7920 if (iter.IsAtEnd()) {
7922 return NULL; 7921 return NULL;
7923 } 7922 }
7924 } 7923 }
7925 return BuildConstantMapCheck( 7924 return BuildConstantMapCheck(PrototypeIterator::GetCurrent<JSObject>(iter));
7926 Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)));
7927 } 7925 }
7928 7926
7929 7927
7930 void HOptimizedGraphBuilder::AddCheckPrototypeMaps(Handle<JSObject> holder, 7928 void HOptimizedGraphBuilder::AddCheckPrototypeMaps(Handle<JSObject> holder,
7931 Handle<Map> receiver_map) { 7929 Handle<Map> receiver_map) {
7932 if (!holder.is_null()) { 7930 if (!holder.is_null()) {
7933 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype())); 7931 Handle<JSObject> prototype(JSObject::cast(receiver_map->prototype()));
7934 BuildCheckPrototypeMaps(prototype, holder); 7932 BuildCheckPrototypeMaps(prototype, holder);
7935 } 7933 }
7936 } 7934 }
(...skipping 5559 matching lines...) Expand 10 before | Expand all | Expand 10 after
13496 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13494 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13497 } 13495 }
13498 13496
13499 #ifdef DEBUG 13497 #ifdef DEBUG
13500 graph_->Verify(false); // No full verify. 13498 graph_->Verify(false); // No full verify.
13501 #endif 13499 #endif
13502 } 13500 }
13503 13501
13504 } // namespace internal 13502 } // namespace internal
13505 } // namespace v8 13503 } // namespace v8
OLDNEW
« no previous file with comments | « src/debug/debug-evaluate.cc ('k') | src/ic/handler-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698