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

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1086303002: [turbofan] Typed lowering requires typed nodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/js-graph.h" 6 #include "src/compiler/js-graph.h"
7 #include "src/compiler/js-typed-lowering.h" 7 #include "src/compiler/js-typed-lowering.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 Node* const input = node->InputAt(0); 740 Node* const input = node->InputAt(0);
741 Reduction reduction = ReduceJSToStringInput(input); 741 Reduction reduction = ReduceJSToStringInput(input);
742 if (reduction.Changed()) { 742 if (reduction.Changed()) {
743 NodeProperties::ReplaceWithValue(node, reduction.replacement()); 743 NodeProperties::ReplaceWithValue(node, reduction.replacement());
744 return reduction; 744 return reduction;
745 } 745 }
746 return NoChange(); 746 return NoChange();
747 } 747 }
748 748
749 749
750 static bool IsGlobalObject(Node* node) {
751 return NodeProperties::IsTyped(node) &&
752 NodeProperties::GetBounds(node).upper->Is(Type::GlobalObject());
753 }
754
755
756 Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) { 750 Reduction JSTypedLowering::ReduceJSLoadNamed(Node* node) {
757 if (IsGlobalObject(node->InputAt(0))) { 751 Node* object = NodeProperties::GetValueInput(node, 0);
752 Type* object_type = NodeProperties::GetBounds(object).upper;
753 if (object_type->Is(Type::GlobalObject())) {
758 // Optimize global constants like "undefined", "Infinity", and "NaN". 754 // Optimize global constants like "undefined", "Infinity", and "NaN".
759 Handle<Name> name = LoadNamedParametersOf(node->op()).name().handle(); 755 Handle<Name> name = LoadNamedParametersOf(node->op()).name().handle();
760 Handle<Object> constant_value = factory()->GlobalConstantFor(name); 756 Handle<Object> constant_value = factory()->GlobalConstantFor(name);
761 if (!constant_value.is_null()) { 757 if (!constant_value.is_null()) {
762 Node* constant = jsgraph()->Constant(constant_value); 758 Node* constant = jsgraph()->Constant(constant_value);
763 NodeProperties::ReplaceWithValue(node, constant); 759 NodeProperties::ReplaceWithValue(node, constant);
764 return Replace(constant); 760 return Replace(constant);
765 } 761 }
766 } 762 }
767 return NoChange(); 763 return NoChange();
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 } 1096 }
1101 1097
1102 1098
1103 MachineOperatorBuilder* JSTypedLowering::machine() const { 1099 MachineOperatorBuilder* JSTypedLowering::machine() const {
1104 return jsgraph()->machine(); 1100 return jsgraph()->machine();
1105 } 1101 }
1106 1102
1107 } // namespace compiler 1103 } // namespace compiler
1108 } // namespace internal 1104 } // namespace internal
1109 } // namespace v8 1105 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698