Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: src/compiler/js-native-context-specialization.cc

Issue 2517543002: Merged: [turbofan] Fix deopt check for storing into constant field. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-626986.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 Handle<JSObject> holder; 811 Handle<JSObject> holder;
812 if (access_info.holder().ToHandle(&holder)) { 812 if (access_info.holder().ToHandle(&holder)) {
813 AssumePrototypesStable(access_info.receiver_maps(), native_context, holder); 813 AssumePrototypesStable(access_info.receiver_maps(), native_context, holder);
814 } 814 }
815 815
816 // Generate the actual property access. 816 // Generate the actual property access.
817 if (access_info.IsNotFound()) { 817 if (access_info.IsNotFound()) {
818 DCHECK_EQ(AccessMode::kLoad, access_mode); 818 DCHECK_EQ(AccessMode::kLoad, access_mode);
819 value = jsgraph()->UndefinedConstant(); 819 value = jsgraph()->UndefinedConstant();
820 } else if (access_info.IsDataConstant()) { 820 } else if (access_info.IsDataConstant()) {
821 value = jsgraph()->Constant(access_info.constant()); 821 Node* constant_value = jsgraph()->Constant(access_info.constant());
822 if (access_mode == AccessMode::kStore) { 822 if (access_mode == AccessMode::kStore) {
823 Node* check = 823 Node* check = graph()->NewNode(simplified()->ReferenceEqual(), value,
824 graph()->NewNode(simplified()->ReferenceEqual(), value, value); 824 constant_value);
825 effect = 825 effect =
826 graph()->NewNode(simplified()->CheckIf(), check, effect, control); 826 graph()->NewNode(simplified()->CheckIf(), check, effect, control);
827 } 827 }
828 value = constant_value;
828 } else if (access_info.IsAccessorConstant()) { 829 } else if (access_info.IsAccessorConstant()) {
829 // TODO(bmeurer): Properly rewire the IfException edge here if there's any. 830 // TODO(bmeurer): Properly rewire the IfException edge here if there's any.
830 Node* target = jsgraph()->Constant(access_info.constant()); 831 Node* target = jsgraph()->Constant(access_info.constant());
831 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state); 832 FrameStateInfo const& frame_info = OpParameter<FrameStateInfo>(frame_state);
832 Handle<SharedFunctionInfo> shared_info = 833 Handle<SharedFunctionInfo> shared_info =
833 frame_info.shared_info().ToHandleChecked(); 834 frame_info.shared_info().ToHandleChecked();
834 switch (access_mode) { 835 switch (access_mode) {
835 case AccessMode::kLoad: { 836 case AccessMode::kLoad: {
836 // We need a FrameState for the getter stub to restore the correct 837 // We need a FrameState for the getter stub to restore the correct
837 // context before returning to fullcodegen. 838 // context before returning to fullcodegen.
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1529 } 1530 }
1530 1531
1531 1532
1532 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { 1533 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const {
1533 return jsgraph()->simplified(); 1534 return jsgraph()->simplified();
1534 } 1535 }
1535 1536
1536 } // namespace compiler 1537 } // namespace compiler
1537 } // namespace internal 1538 } // namespace internal
1538 } // namespace v8 1539 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-626986.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698