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

Side by Side Diff: src/compiler/arm64/instruction-selector-arm64.cc

Issue 1149563004: [turbofan] Add bounds check to Node::InputAt(index) and fix tests that go out of bounds. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | src/compiler/node.h » ('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 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/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) { 1081 void InstructionSelector::VisitTruncateFloat64ToFloat32(Node* node) {
1082 Arm64OperandGenerator g(this); 1082 Arm64OperandGenerator g(this);
1083 Emit(kArm64Float64ToFloat32, g.DefineAsRegister(node), 1083 Emit(kArm64Float64ToFloat32, g.DefineAsRegister(node),
1084 g.UseRegister(node->InputAt(0))); 1084 g.UseRegister(node->InputAt(0)));
1085 } 1085 }
1086 1086
1087 1087
1088 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) { 1088 void InstructionSelector::VisitTruncateInt64ToInt32(Node* node) {
1089 Arm64OperandGenerator g(this); 1089 Arm64OperandGenerator g(this);
1090 Node* value = node->InputAt(0); 1090 Node* value = node->InputAt(0);
1091 if (CanCover(node, value)) { 1091 if (CanCover(node, value) && value->InputCount() >= 2) {
1092 Int64BinopMatcher m(value); 1092 Int64BinopMatcher m(value);
1093 if ((m.IsWord64Sar() && m.right().HasValue() && 1093 if ((m.IsWord64Sar() && m.right().HasValue() &&
1094 (m.right().Value() == 32)) || 1094 (m.right().Value() == 32)) ||
1095 (m.IsWord64Shr() && m.right().IsInRange(32, 63))) { 1095 (m.IsWord64Shr() && m.right().IsInRange(32, 63))) {
1096 Emit(kArm64Lsr, g.DefineAsRegister(node), g.UseRegister(m.left().node()), 1096 Emit(kArm64Lsr, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
1097 g.UseImmediate(m.right().node())); 1097 g.UseImmediate(m.right().node()));
1098 return; 1098 return;
1099 } 1099 }
1100 } 1100 }
1101 1101
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 MachineOperatorBuilder::kFloat64RoundTruncate | 1900 MachineOperatorBuilder::kFloat64RoundTruncate |
1901 MachineOperatorBuilder::kFloat64RoundTiesAway | 1901 MachineOperatorBuilder::kFloat64RoundTiesAway |
1902 MachineOperatorBuilder::kWord32ShiftIsSafe | 1902 MachineOperatorBuilder::kWord32ShiftIsSafe |
1903 MachineOperatorBuilder::kInt32DivIsSafe | 1903 MachineOperatorBuilder::kInt32DivIsSafe |
1904 MachineOperatorBuilder::kUint32DivIsSafe; 1904 MachineOperatorBuilder::kUint32DivIsSafe;
1905 } 1905 }
1906 1906
1907 } // namespace compiler 1907 } // namespace compiler
1908 } // namespace internal 1908 } // namespace internal
1909 } // namespace v8 1909 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698