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

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

Issue 653693002: Reland "Refine expression typing, esp. by propagating range information." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: The actual changes since reverting. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/compiler/test-js-constant-cache.cc ('k') | test/cctest/compiler/test-typer.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/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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 CHECK_EQ(p0, r->InputAt(0)); 255 CHECK_EQ(p0, r->InputAt(0));
256 CHECK_EQ(p1, r->InputAt(1)); 256 CHECK_EQ(p1, r->InputAt(1));
257 } 257 }
258 } 258 }
259 } 259 }
260 } 260 }
261 261
262 262
263 static void CheckToI32(Node* old_input, Node* new_input, bool is_signed) { 263 static void CheckToI32(Node* old_input, Node* new_input, bool is_signed) {
264 Type* old_type = NodeProperties::GetBounds(old_input).upper; 264 Type* old_type = NodeProperties::GetBounds(old_input).upper;
265 Type* new_type = NodeProperties::GetBounds(new_input).upper;
265 Type* expected_type = I32Type(is_signed); 266 Type* expected_type = I32Type(is_signed);
267 CHECK(new_type->Is(expected_type));
266 if (old_type->Is(expected_type)) { 268 if (old_type->Is(expected_type)) {
267 CHECK_EQ(old_input, new_input); 269 CHECK_EQ(old_input, new_input);
268 } else if (new_input->opcode() == IrOpcode::kNumberConstant) { 270 } else if (new_input->opcode() == IrOpcode::kNumberConstant) {
269 CHECK(NodeProperties::GetBounds(new_input).upper->Is(expected_type));
270 double v = OpParameter<double>(new_input); 271 double v = OpParameter<double>(new_input);
271 double e = static_cast<double>(is_signed ? FastD2I(v) : FastD2UI(v)); 272 double e = static_cast<double>(is_signed ? FastD2I(v) : FastD2UI(v));
272 CHECK_EQ(e, v); 273 CHECK_EQ(e, v);
273 } else {
274 CHECK_EQ(NumberToI32(is_signed), new_input->opcode());
275 } 274 }
276 } 275 }
277 276
278 277
279 // A helper class for testing lowering of bitwise shift operators. 278 // A helper class for testing lowering of bitwise shift operators.
280 class JSBitwiseShiftTypedLoweringTester : public JSTypedLoweringTester { 279 class JSBitwiseShiftTypedLoweringTester : public JSTypedLoweringTester {
281 public: 280 public:
282 static const int kNumberOps = 6; 281 static const int kNumberOps = 6;
283 const Operator* ops[kNumberOps]; 282 const Operator* ops[kNumberOps];
284 bool signedness[kNumberOps]; 283 bool signedness[kNumberOps];
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after
1378 CHECK_EQ(p1, r->InputAt(0)); 1377 CHECK_EQ(p1, r->InputAt(0));
1379 CHECK_EQ(p0, r->InputAt(1)); 1378 CHECK_EQ(p0, r->InputAt(1));
1380 } else { 1379 } else {
1381 CHECK_EQ(p0, r->InputAt(0)); 1380 CHECK_EQ(p0, r->InputAt(0));
1382 CHECK_EQ(p1, r->InputAt(1)); 1381 CHECK_EQ(p1, r->InputAt(1));
1383 } 1382 }
1384 } 1383 }
1385 } 1384 }
1386 } 1385 }
1387 } 1386 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-js-constant-cache.cc ('k') | test/cctest/compiler/test-typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698