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

Side by Side Diff: src/hydrogen.cc

Issue 153743005: Remove special ArrayLength handling already covered by JSObjectFieldAccessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/hydrogen.h ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5446 matching lines...) Expand 10 before | Expand all | Expand 10 after
5457 } 5457 }
5458 5458
5459 5459
5460 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic( 5460 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic(
5461 SmallMapList* types) { 5461 SmallMapList* types) {
5462 ASSERT(type_->Is(ToType(types->first()))); 5462 ASSERT(type_->Is(ToType(types->first())));
5463 if (!CanAccessMonomorphic()) return false; 5463 if (!CanAccessMonomorphic()) return false;
5464 STATIC_ASSERT(kMaxLoadPolymorphism == kMaxStorePolymorphism); 5464 STATIC_ASSERT(kMaxLoadPolymorphism == kMaxStorePolymorphism);
5465 if (types->length() > kMaxLoadPolymorphism) return false; 5465 if (types->length() > kMaxLoadPolymorphism) return false;
5466 5466
5467 if (IsArrayLength()) {
5468 bool is_fast = IsFastElementsKind(map()->elements_kind());
5469 for (int i = 1; i < types->length(); ++i) {
5470 Handle<Map> test_map = types->at(i);
5471 if (test_map->instance_type() != JS_ARRAY_TYPE) return false;
5472 if (IsFastElementsKind(test_map->elements_kind()) != is_fast) {
5473 return false;
5474 }
5475 }
5476 return true;
5477 }
5478
5479 HObjectAccess access = HObjectAccess::ForMap(); // bogus default 5467 HObjectAccess access = HObjectAccess::ForMap(); // bogus default
5480 if (GetJSObjectFieldAccess(&access)) { 5468 if (GetJSObjectFieldAccess(&access)) {
5481 for (int i = 1; i < types->length(); ++i) { 5469 for (int i = 1; i < types->length(); ++i) {
5482 PropertyAccessInfo test_info( 5470 PropertyAccessInfo test_info(
5483 builder_, access_type_, ToType(types->at(i)), name_); 5471 builder_, access_type_, ToType(types->at(i)), name_);
5484 HObjectAccess test_access = HObjectAccess::ForMap(); // bogus default 5472 HObjectAccess test_access = HObjectAccess::ForMap(); // bogus default
5485 if (!test_info.GetJSObjectFieldAccess(&test_access)) return false; 5473 if (!test_info.GetJSObjectFieldAccess(&test_access)) return false;
5486 if (!access.Equals(test_access)) return false; 5474 if (!access.Equals(test_access)) return false;
5487 } 5475 }
5488 return true; 5476 return true;
(...skipping 5723 matching lines...) Expand 10 before | Expand all | Expand 10 after
11212 if (ShouldProduceTraceOutput()) { 11200 if (ShouldProduceTraceOutput()) {
11213 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 11201 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
11214 } 11202 }
11215 11203
11216 #ifdef DEBUG 11204 #ifdef DEBUG
11217 graph_->Verify(false); // No full verify. 11205 graph_->Verify(false); // No full verify.
11218 #endif 11206 #endif
11219 } 11207 }
11220 11208
11221 } } // namespace v8::internal 11209 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698