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/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 6971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6982 return result; | 6982 return result; |
6983 } else { | 6983 } else { |
6984 return New<HStoreKeyedGeneric>(object, key, value, function_language_mode(), | 6984 return New<HStoreKeyedGeneric>(object, key, value, function_language_mode(), |
6985 PREMONOMORPHIC); | 6985 PREMONOMORPHIC); |
6986 } | 6986 } |
6987 } | 6987 } |
6988 | 6988 |
6989 | 6989 |
6990 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { | 6990 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { |
6991 // Loads from a "stock" fast holey double arrays can elide the hole check. | 6991 // Loads from a "stock" fast holey double arrays can elide the hole check. |
6992 // Loads from a "stock" fast holey array can convert the hole to undefined | |
6993 // with impunity. | |
6992 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE; | 6994 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE; |
6993 if (*map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS) && | 6995 Map* holey_double_elements = |
Jakob Kummerow
2015/04/23 13:40:00
Suggestion: "bool holey_double_elements = *map ==
mvstanton
2015/04/27 07:57:12
Done.
| |
6996 isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS); | |
6997 Map* holey_elements = | |
6998 isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS); | |
6999 if ((*map == holey_double_elements || *map == holey_elements) && | |
6994 isolate()->IsFastArrayConstructorPrototypeChainIntact()) { | 7000 isolate()->IsFastArrayConstructorPrototypeChainIntact()) { |
7001 load_mode = *map == holey_double_elements ? ALLOW_RETURN_HOLE | |
7002 : CONVERT_HOLE_TO_UNDEFINED; | |
7003 | |
6995 Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate()); | 7004 Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate()); |
6996 Handle<JSObject> object_prototype = isolate()->initial_object_prototype(); | 7005 Handle<JSObject> object_prototype = isolate()->initial_object_prototype(); |
6997 BuildCheckPrototypeMaps(prototype, object_prototype); | 7006 BuildCheckPrototypeMaps(prototype, object_prototype); |
6998 load_mode = ALLOW_RETURN_HOLE; | |
6999 graph()->MarkDependsOnEmptyArrayProtoElements(); | 7007 graph()->MarkDependsOnEmptyArrayProtoElements(); |
7000 } | 7008 } |
7001 | |
7002 return load_mode; | 7009 return load_mode; |
7003 } | 7010 } |
7004 | 7011 |
7005 | 7012 |
7006 HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess( | 7013 HInstruction* HOptimizedGraphBuilder::BuildMonomorphicElementAccess( |
7007 HValue* object, | 7014 HValue* object, |
7008 HValue* key, | 7015 HValue* key, |
7009 HValue* val, | 7016 HValue* val, |
7010 HValue* dependency, | 7017 HValue* dependency, |
7011 Handle<Map> map, | 7018 Handle<Map> map, |
(...skipping 6011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13023 if (ShouldProduceTraceOutput()) { | 13030 if (ShouldProduceTraceOutput()) { |
13024 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13031 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13025 } | 13032 } |
13026 | 13033 |
13027 #ifdef DEBUG | 13034 #ifdef DEBUG |
13028 graph_->Verify(false); // No full verify. | 13035 graph_->Verify(false); // No full verify. |
13029 #endif | 13036 #endif |
13030 } | 13037 } |
13031 | 13038 |
13032 } } // namespace v8::internal | 13039 } } // namespace v8::internal |
OLD | NEW |