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

Side by Side Diff: test/cctest/compiler/test-js-typed-lowering.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 | « src/compiler/node.h ('k') | test/cctest/compiler/test-osr.cc » ('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/js-graph.h" 5 #include "src/compiler/js-graph.h"
6 #include "src/compiler/js-typed-lowering.h" 6 #include "src/compiler/js-typed-lowering.h"
7 #include "src/compiler/machine-operator.h" 7 #include "src/compiler/machine-operator.h"
8 #include "src/compiler/node-properties.h" 8 #include "src/compiler/node-properties.h"
9 #include "src/compiler/opcodes.h" 9 #include "src/compiler/opcodes.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 } 455 }
456 456
457 457
458 TEST(JSToNumber_replacement) { 458 TEST(JSToNumber_replacement) {
459 JSTypedLoweringTester R; 459 JSTypedLoweringTester R;
460 460
461 Type* types[] = {Type::Null(), Type::Undefined(), Type::Number()}; 461 Type* types[] = {Type::Null(), Type::Undefined(), Type::Number()};
462 462
463 for (size_t i = 0; i < arraysize(types); i++) { 463 for (size_t i = 0; i < arraysize(types); i++) {
464 Node* n = R.Parameter(types[i]); 464 Node* n = R.Parameter(types[i]);
465 Node* c = R.graph.NewNode(R.javascript.ToNumber(), n, R.context(), 465 Node* c =
466 R.start(), R.start()); 466 R.graph.NewNode(R.javascript.ToNumber(), n, R.context(),
467 R.EmptyFrameState(R.context()), R.start(), R.start());
467 Node* effect_use = R.UseForEffect(c); 468 Node* effect_use = R.UseForEffect(c);
468 Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(Type::Any()), n, c); 469 Node* add = R.graph.NewNode(R.simplified.ReferenceEqual(Type::Any()), n, c);
469 470
470 R.CheckEffectInput(c, effect_use); 471 R.CheckEffectInput(c, effect_use);
471 Node* r = R.reduce(c); 472 Node* r = R.reduce(c);
472 473
473 if (types[i]->Is(Type::Number())) { 474 if (types[i]->Is(Type::Number())) {
474 CHECK_EQ(n, r); 475 CHECK_EQ(n, r);
475 } else { 476 } else {
476 CHECK_EQ(IrOpcode::kNumberConstant, r->opcode()); 477 CHECK_EQ(IrOpcode::kNumberConstant, r->opcode());
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 CHECK_EQ(p1, r->InputAt(0)); 1275 CHECK_EQ(p1, r->InputAt(0));
1275 CHECK_EQ(p0, r->InputAt(1)); 1276 CHECK_EQ(p0, r->InputAt(1));
1276 } else { 1277 } else {
1277 CHECK_EQ(p0, r->InputAt(0)); 1278 CHECK_EQ(p0, r->InputAt(0));
1278 CHECK_EQ(p1, r->InputAt(1)); 1279 CHECK_EQ(p1, r->InputAt(1));
1279 } 1280 }
1280 } 1281 }
1281 } 1282 }
1282 } 1283 }
1283 } 1284 }
OLDNEW
« no previous file with comments | « src/compiler/node.h ('k') | test/cctest/compiler/test-osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698