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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 Handle<JSObject> holder; | 860 Handle<JSObject> holder; |
861 if (access_info.holder().ToHandle(&holder)) { | 861 if (access_info.holder().ToHandle(&holder)) { |
862 AssumePrototypesStable(access_info.receiver_maps(), holder); | 862 AssumePrototypesStable(access_info.receiver_maps(), holder); |
863 } | 863 } |
864 | 864 |
865 // Generate the actual property access. | 865 // Generate the actual property access. |
866 if (access_info.IsNotFound()) { | 866 if (access_info.IsNotFound()) { |
867 DCHECK_EQ(AccessMode::kLoad, access_mode); | 867 DCHECK_EQ(AccessMode::kLoad, access_mode); |
868 value = jsgraph()->UndefinedConstant(); | 868 value = jsgraph()->UndefinedConstant(); |
869 } else if (access_info.IsDataConstant()) { | 869 } else if (access_info.IsDataConstant()) { |
870 value = jsgraph()->Constant(access_info.constant()); | 870 Node* constant_value = jsgraph()->Constant(access_info.constant()); |
871 if (access_mode == AccessMode::kStore) { | 871 if (access_mode == AccessMode::kStore) { |
872 Node* check = | 872 Node* check = graph()->NewNode(simplified()->ReferenceEqual(), value, |
873 graph()->NewNode(simplified()->ReferenceEqual(), value, value); | 873 constant_value); |
874 effect = | 874 effect = |
875 graph()->NewNode(simplified()->CheckIf(), check, effect, control); | 875 graph()->NewNode(simplified()->CheckIf(), check, effect, control); |
876 } | 876 } |
| 877 value = constant_value; |
877 } else if (access_info.IsAccessorConstant()) { | 878 } else if (access_info.IsAccessorConstant()) { |
878 // TODO(bmeurer): Properly rewire the IfException edge here if there's any. | 879 // TODO(bmeurer): Properly rewire the IfException edge here if there's any. |
879 Node* target = jsgraph()->Constant(access_info.constant()); | 880 Node* target = jsgraph()->Constant(access_info.constant()); |
880 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); | 881 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); |
881 Handle<SharedFunctionInfo> shared_info = | 882 Handle<SharedFunctionInfo> shared_info = |
882 frame_info.shared_info().ToHandleChecked(); | 883 frame_info.shared_info().ToHandleChecked(); |
883 switch (access_mode) { | 884 switch (access_mode) { |
884 case AccessMode::kLoad: { | 885 case AccessMode::kLoad: { |
885 // We need a FrameState for the getter stub to restore the correct | 886 // We need a FrameState for the getter stub to restore the correct |
886 // context before returning to fullcodegen. | 887 // context before returning to fullcodegen. |
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 return jsgraph()->javascript(); | 1653 return jsgraph()->javascript(); |
1653 } | 1654 } |
1654 | 1655 |
1655 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1656 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1656 return jsgraph()->simplified(); | 1657 return jsgraph()->simplified(); |
1657 } | 1658 } |
1658 | 1659 |
1659 } // namespace compiler | 1660 } // namespace compiler |
1660 } // namespace internal | 1661 } // namespace internal |
1661 } // namespace v8 | 1662 } // namespace v8 |
OLD | NEW |