Commit 43c0a419 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove special ArrayLength handling already covered by JSObjectFieldAccessors

R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/153743005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19152 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 476881ce
......@@ -5481,18 +5481,6 @@ bool HOptimizedGraphBuilder::PropertyAccessInfo::CanAccessAsMonomorphic(
STATIC_ASSERT(kMaxLoadPolymorphism == kMaxStorePolymorphism);
if (types->length() > kMaxLoadPolymorphism) return false;
if (IsArrayLength()) {
bool is_fast = IsFastElementsKind(map()->elements_kind());
for (int i = 1; i < types->length(); ++i) {
Handle<Map> test_map = types->at(i);
if (test_map->instance_type() != JS_ARRAY_TYPE) return false;
if (IsFastElementsKind(test_map->elements_kind()) != is_fast) {
return false;
}
}
return true;
}
HObjectAccess access = HObjectAccess::ForMap(); // bogus default
if (GetJSObjectFieldAccess(&access)) {
for (int i = 1; i < types->length(); ++i) {
......
......@@ -2336,15 +2336,14 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
}
bool GetJSObjectFieldAccess(HObjectAccess* access) {
if (IsArrayLength()) {
*access = HObjectAccess::ForArrayLength(map()->elements_kind());
return true;
}
int offset;
if (Accessors::IsJSObjectFieldAccessor<Type>(type_, name_, &offset)) {
if (type_->Is(Type::String())) {
ASSERT(name_->Equals(isolate()->heap()->length_string()));
*access = HObjectAccess::ForStringLength();
} else if (type_->Is(Type::Array())) {
ASSERT(name_->Equals(isolate()->heap()->length_string()));
*access = HObjectAccess::ForArrayLength(map()->elements_kind());
} else {
*access = HObjectAccess::ForMapAndOffset(map(), offset);
}
......@@ -2368,11 +2367,6 @@ class HOptimizedGraphBuilder : public HGraphBuilder, public AstVisitor {
Isolate* isolate() { return lookup_.isolate(); }
CompilationInfo* current_info() { return builder_->current_info(); }
bool IsArrayLength() {
return map()->instance_type() == JS_ARRAY_TYPE &&
name_->Equals(isolate()->heap()->length_string());
}
bool LoadResult(Handle<Map> map);
bool LookupDescriptor();
bool LookupInPrototypes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment