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 7080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7091 PREMONOMORPHIC); | 7091 PREMONOMORPHIC); |
7092 } | 7092 } |
7093 } | 7093 } |
7094 | 7094 |
7095 | 7095 |
7096 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { | 7096 LoadKeyedHoleMode HOptimizedGraphBuilder::BuildKeyedHoleMode(Handle<Map> map) { |
7097 // Loads from a "stock" fast holey double arrays can elide the hole check. | 7097 // Loads from a "stock" fast holey double arrays can elide the hole check. |
7098 // Loads from a "stock" fast holey array can convert the hole to undefined | 7098 // Loads from a "stock" fast holey array can convert the hole to undefined |
7099 // with impunity. | 7099 // with impunity. |
7100 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE; | 7100 LoadKeyedHoleMode load_mode = NEVER_RETURN_HOLE; |
| 7101 bool holey_smi_elements = |
| 7102 *map == isolate()->get_initial_js_array_map(FAST_HOLEY_SMI_ELEMENTS); |
7101 bool holey_double_elements = | 7103 bool holey_double_elements = |
7102 *map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS); | 7104 *map == isolate()->get_initial_js_array_map(FAST_HOLEY_DOUBLE_ELEMENTS); |
7103 bool holey_elements = | 7105 bool holey_elements = |
7104 *map == isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS); | 7106 *map == isolate()->get_initial_js_array_map(FAST_HOLEY_ELEMENTS); |
7105 if ((holey_double_elements || holey_elements) && | 7107 if ((holey_smi_elements || holey_double_elements || holey_elements) && |
7106 isolate()->IsFastArrayConstructorPrototypeChainIntact()) { | 7108 isolate()->IsFastArrayConstructorPrototypeChainIntact()) { |
7107 load_mode = | 7109 load_mode = |
7108 holey_double_elements ? ALLOW_RETURN_HOLE : CONVERT_HOLE_TO_UNDEFINED; | 7110 holey_double_elements ? ALLOW_RETURN_HOLE : CONVERT_HOLE_TO_UNDEFINED; |
7109 | 7111 |
7110 Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate()); | 7112 Handle<JSObject> prototype(JSObject::cast(map->prototype()), isolate()); |
7111 Handle<JSObject> object_prototype = isolate()->initial_object_prototype(); | 7113 Handle<JSObject> object_prototype = isolate()->initial_object_prototype(); |
7112 BuildCheckPrototypeMaps(prototype, object_prototype); | 7114 BuildCheckPrototypeMaps(prototype, object_prototype); |
7113 graph()->MarkDependsOnEmptyArrayProtoElements(); | 7115 graph()->MarkDependsOnEmptyArrayProtoElements(); |
7114 } | 7116 } |
7115 return load_mode; | 7117 return load_mode; |
(...skipping 6034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13150 if (ShouldProduceTraceOutput()) { | 13152 if (ShouldProduceTraceOutput()) { |
13151 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13153 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13152 } | 13154 } |
13153 | 13155 |
13154 #ifdef DEBUG | 13156 #ifdef DEBUG |
13155 graph_->Verify(false); // No full verify. | 13157 graph_->Verify(false); // No full verify. |
13156 #endif | 13158 #endif |
13157 } | 13159 } |
13158 | 13160 |
13159 } } // namespace v8::internal | 13161 } } // namespace v8::internal |
OLD | NEW |