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

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

Issue 718193003: [turbofan] Avoid useless bit masking in typed lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 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
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/v8.h" 5 #include "src/v8.h"
6 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/graph-inl.h" 8 #include "src/compiler/graph-inl.h"
9 #include "src/compiler/js-typed-lowering.h" 9 #include "src/compiler/js-typed-lowering.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 for (int k = 0; k < R.kNumberOps; k += 2) { 320 for (int k = 0; k < R.kNumberOps; k += 2) {
321 Node* add = R.Binop(R.ops[k], p0, p1); 321 Node* add = R.Binop(R.ops[k], p0, p1);
322 Node* r = R.reduce(add); 322 Node* r = R.reduce(add);
323 323
324 R.CheckPureBinop(R.ops[k + 1], r); 324 R.CheckPureBinop(R.ops[k + 1], r);
325 Node* r0 = r->InputAt(0); 325 Node* r0 = r->InputAt(0);
326 Node* r1 = r->InputAt(1); 326 Node* r1 = r->InputAt(1);
327 327
328 CheckToI32(p0, r0, R.signedness[k]); 328 CheckToI32(p0, r0, R.signedness[k]);
329 329
330 R.CheckPureBinop(IrOpcode::kWord32And, r1); 330 if (r1->opcode() == IrOpcode::kWord32And) {
331 CheckToI32(p1, r1->InputAt(0), R.signedness[k + 1]); 331 R.CheckPureBinop(IrOpcode::kWord32And, r1);
332 R.CheckInt32Constant(0x1F, r1->InputAt(1)); 332 CheckToI32(p1, r1->InputAt(0), R.signedness[k + 1]);
333 R.CheckInt32Constant(0x1F, r1->InputAt(1));
334 } else {
335 CheckToI32(p1, r1, R.signedness[k]);
336 }
333 } 337 }
334 } 338 }
335 } 339 }
336 } 340 }
337 341
338 342
339 // A helper class for testing lowering of bitwise operators. 343 // A helper class for testing lowering of bitwise operators.
340 class JSBitwiseTypedLoweringTester : public JSTypedLoweringTester { 344 class JSBitwiseTypedLoweringTester : public JSTypedLoweringTester {
341 public: 345 public:
342 static const int kNumberOps = 6; 346 static const int kNumberOps = 6;
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1340 CHECK_EQ(p1, r->InputAt(0)); 1344 CHECK_EQ(p1, r->InputAt(0));
1341 CHECK_EQ(p0, r->InputAt(1)); 1345 CHECK_EQ(p0, r->InputAt(1));
1342 } else { 1346 } else {
1343 CHECK_EQ(p0, r->InputAt(0)); 1347 CHECK_EQ(p0, r->InputAt(0));
1344 CHECK_EQ(p1, r->InputAt(1)); 1348 CHECK_EQ(p1, r->InputAt(1));
1345 } 1349 }
1346 } 1350 }
1347 } 1351 }
1348 } 1352 }
1349 } 1353 }
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698