| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1983 element_machine_type = MachineType::TaggedSigned(); | 1983 element_machine_type = MachineType::TaggedSigned(); |
| 1984 } | 1984 } |
| 1985 ElementAccess element_access = {kTaggedBase, FixedArray::kHeaderSize, | 1985 ElementAccess element_access = {kTaggedBase, FixedArray::kHeaderSize, |
| 1986 element_type, element_machine_type, | 1986 element_type, element_machine_type, |
| 1987 kFullWriteBarrier}; | 1987 kFullWriteBarrier}; |
| 1988 | 1988 |
| 1989 // Access the actual element. | 1989 // Access the actual element. |
| 1990 if (access_mode == AccessMode::kLoad) { | 1990 if (access_mode == AccessMode::kLoad) { |
| 1991 // Compute the real element access type, which includes the hole in case | 1991 // Compute the real element access type, which includes the hole in case |
| 1992 // of holey backing stores. | 1992 // of holey backing stores. |
| 1993 if (IsHoleyElementsKind(elements_kind)) { |
| 1994 element_access.type = |
| 1995 Type::Union(element_type, Type::Hole(), graph()->zone()); |
| 1996 } |
| 1993 if (elements_kind == FAST_HOLEY_ELEMENTS || | 1997 if (elements_kind == FAST_HOLEY_ELEMENTS || |
| 1994 elements_kind == FAST_HOLEY_SMI_ELEMENTS) { | 1998 elements_kind == FAST_HOLEY_SMI_ELEMENTS) { |
| 1995 element_access.type = | |
| 1996 Type::Union(element_type, Type::Hole(), graph()->zone()); | |
| 1997 element_access.machine_type = MachineType::AnyTagged(); | 1999 element_access.machine_type = MachineType::AnyTagged(); |
| 1998 } | 2000 } |
| 1999 // Perform the actual backing store access. | 2001 // Perform the actual backing store access. |
| 2000 value = effect = | 2002 value = effect = |
| 2001 graph()->NewNode(simplified()->LoadElement(element_access), elements, | 2003 graph()->NewNode(simplified()->LoadElement(element_access), elements, |
| 2002 index, effect, control); | 2004 index, effect, control); |
| 2003 // Handle loading from holey backing stores correctly, by either mapping | 2005 // Handle loading from holey backing stores correctly, by either mapping |
| 2004 // the hole to undefined if possible, or deoptimizing otherwise. | 2006 // the hole to undefined if possible, or deoptimizing otherwise. |
| 2005 if (elements_kind == FAST_HOLEY_ELEMENTS || | 2007 if (elements_kind == FAST_HOLEY_ELEMENTS || |
| 2006 elements_kind == FAST_HOLEY_SMI_ELEMENTS) { | 2008 elements_kind == FAST_HOLEY_SMI_ELEMENTS) { |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2342 return jsgraph()->javascript(); | 2344 return jsgraph()->javascript(); |
| 2343 } | 2345 } |
| 2344 | 2346 |
| 2345 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 2347 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 2346 return jsgraph()->simplified(); | 2348 return jsgraph()->simplified(); |
| 2347 } | 2349 } |
| 2348 | 2350 |
| 2349 } // namespace compiler | 2351 } // namespace compiler |
| 2350 } // namespace internal | 2352 } // namespace internal |
| 2351 } // namespace v8 | 2353 } // namespace v8 |
| OLD | NEW |