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

Side by Side Diff: src/hydrogen.cc

Issue 992913002: handle the special snowflakes that are Integer Indexed Exotic objects (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/hydrogen.h ('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/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 5248 matching lines...) Expand 10 before | Expand all | Expand 10 after
5259 HOptimizedGraphBuilder::LookupGlobalProperty(Variable* var, LookupIterator* it, 5259 HOptimizedGraphBuilder::LookupGlobalProperty(Variable* var, LookupIterator* it,
5260 PropertyAccessType access_type) { 5260 PropertyAccessType access_type) {
5261 if (var->is_this() || !current_info()->has_global_object()) { 5261 if (var->is_this() || !current_info()->has_global_object()) {
5262 return kUseGeneric; 5262 return kUseGeneric;
5263 } 5263 }
5264 5264
5265 switch (it->state()) { 5265 switch (it->state()) {
5266 case LookupIterator::ACCESSOR: 5266 case LookupIterator::ACCESSOR:
5267 case LookupIterator::ACCESS_CHECK: 5267 case LookupIterator::ACCESS_CHECK:
5268 case LookupIterator::INTERCEPTOR: 5268 case LookupIterator::INTERCEPTOR:
5269 case LookupIterator::INTEGER_INDEXED_EXOTIC:
5269 case LookupIterator::NOT_FOUND: 5270 case LookupIterator::NOT_FOUND:
5270 return kUseGeneric; 5271 return kUseGeneric;
5271 case LookupIterator::DATA: 5272 case LookupIterator::DATA:
5272 if (access_type == STORE && it->IsReadOnly()) return kUseGeneric; 5273 if (access_type == STORE && it->IsReadOnly()) return kUseGeneric;
5273 return kUseCell; 5274 return kUseCell;
5274 case LookupIterator::JSPROXY: 5275 case LookupIterator::JSPROXY:
5275 case LookupIterator::TRANSITION: 5276 case LookupIterator::TRANSITION:
5276 UNREACHABLE(); 5277 UNREACHABLE();
5277 } 5278 }
5278 UNREACHABLE(); 5279 UNREACHABLE();
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
6064 return false; 6065 return false;
6065 } 6066 }
6066 LookupDescriptor(*map, *name_); 6067 LookupDescriptor(*map, *name_);
6067 if (IsFound()) return LoadResult(map); 6068 if (IsFound()) return LoadResult(map);
6068 } 6069 }
6069 NotFound(); 6070 NotFound();
6070 return true; 6071 return true;
6071 } 6072 }
6072 6073
6073 6074
6075 bool HOptimizedGraphBuilder::PropertyAccessInfo::IsIntegerIndexedExotic() {
6076 InstanceType instance_type = map_->instance_type();
6077 return instance_type == JS_TYPED_ARRAY_TYPE && IsNonArrayIndexInteger(*name_);
6078 }
6079
6080
6074 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() { 6081 bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessMonomorphic() {
6075 if (!CanInlinePropertyAccess(map_)) return false; 6082 if (!CanInlinePropertyAccess(map_)) return false;
6076 if (IsJSObjectFieldAccessor()) return IsLoad(); 6083 if (IsJSObjectFieldAccessor()) return IsLoad();
6077 if (map_->function_with_prototype() && !map_->has_non_instance_prototype() && 6084 if (map_->function_with_prototype() && !map_->has_non_instance_prototype() &&
6078 name_.is_identical_to(isolate()->factory()->prototype_string())) { 6085 name_.is_identical_to(isolate()->factory()->prototype_string())) {
6079 return IsLoad(); 6086 return IsLoad();
6080 } 6087 }
6081 if (!LookupDescriptor()) return false; 6088 if (!LookupDescriptor()) return false;
6082 if (IsFound()) return IsLoad() || !IsReadOnly(); 6089 if (IsFound()) return IsLoad() || !IsReadOnly();
6090 if (IsIntegerIndexedExotic()) return false;
6083 if (!LookupInPrototypes()) return false; 6091 if (!LookupInPrototypes()) return false;
6084 if (IsLoad()) return true; 6092 if (IsLoad()) return true;
6085 6093
6086 if (IsAccessorConstant()) return true; 6094 if (IsAccessorConstant()) return true;
6087 LookupTransition(*map_, *name_, NONE); 6095 LookupTransition(*map_, *name_, NONE);
6088 if (IsTransitionToData() && map_->unused_property_fields() > 0) { 6096 if (IsTransitionToData() && map_->unused_property_fields() > 0) {
6089 // Construct the object field access. 6097 // Construct the object field access.
6090 int descriptor = transition()->LastAdded(); 6098 int descriptor = transition()->LastAdded();
6091 int index = 6099 int index =
6092 transition()->instance_descriptors()->GetFieldIndex(descriptor) - 6100 transition()->instance_descriptors()->GetFieldIndex(descriptor) -
(...skipping 7343 matching lines...) Expand 10 before | Expand all | Expand 10 after
13436 if (ShouldProduceTraceOutput()) { 13444 if (ShouldProduceTraceOutput()) {
13437 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13445 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13438 } 13446 }
13439 13447
13440 #ifdef DEBUG 13448 #ifdef DEBUG
13441 graph_->Verify(false); // No full verify. 13449 graph_->Verify(false); // No full verify.
13442 #endif 13450 #endif
13443 } 13451 }
13444 13452
13445 } } // namespace v8::internal 13453 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.h ('k') | src/ic/handler-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698