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

Side by Side Diff: test/cctest/compiler/test-node.cc

Issue 602563002: [turbofan] Add length operand to LoadElement and StoreElement. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 <functional> 5 #include <functional>
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "graph-tester.h" 9 #include "graph-tester.h"
10 #include "src/compiler/generic-node-inl.h" 10 #include "src/compiler/generic-node-inl.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 CHECK(current != uses.end()); 331 CHECK(current != uses.end());
332 CHECK(*current == n5); 332 CHECK(*current == n5);
333 ++current; 333 ++current;
334 CHECK(current != uses.end()); 334 CHECK(current != uses.end());
335 CHECK(*current == n3); 335 CHECK(*current == n3);
336 ++current; 336 ++current;
337 CHECK(current == uses.end()); 337 CHECK(current == uses.end());
338 } 338 }
339 339
340 340
341 TEST(RemoveInput) {
342 GraphTester graph;
343
344 Node* n0 = graph.NewNode(&dummy_operator);
345 Node* n1 = graph.NewNode(&dummy_operator, n0);
346 Node* n2 = graph.NewNode(&dummy_operator, n0, n1);
347
348 n1->RemoveInput(0);
349 CHECK_EQ(0, n1->InputCount());
350 CHECK_EQ(1, n0->UseCount());
351
352 n2->RemoveInput(0);
353 CHECK_EQ(1, n2->InputCount());
354 CHECK_EQ(0, n0->UseCount());
355 CHECK_EQ(1, n1->UseCount());
356
357 n2->RemoveInput(0);
358 CHECK_EQ(0, n2->InputCount());
359 }
360
361
341 TEST(AppendInputsAndIterator) { 362 TEST(AppendInputsAndIterator) {
342 GraphTester graph; 363 GraphTester graph;
343 364
344 Node* n0 = graph.NewNode(&dummy_operator); 365 Node* n0 = graph.NewNode(&dummy_operator);
345 Node* n1 = graph.NewNode(&dummy_operator, n0); 366 Node* n1 = graph.NewNode(&dummy_operator, n0);
346 Node* n2 = graph.NewNode(&dummy_operator, n0, n1); 367 Node* n2 = graph.NewNode(&dummy_operator, n0, n1);
347 368
348 Node::Inputs inputs(n2->inputs()); 369 Node::Inputs inputs(n2->inputs());
349 Node::Inputs::iterator current = inputs.begin(); 370 Node::Inputs::iterator current = inputs.begin();
350 CHECK(current != inputs.end()); 371 CHECK(current != inputs.end());
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 n1->ReplaceInput(0, n1); // self-reference. 832 n1->ReplaceInput(0, n1); // self-reference.
812 833
813 CHECK_EQ(0, n0->UseCount()); 834 CHECK_EQ(0, n0->UseCount());
814 CHECK_EQ(1, n1->UseCount()); 835 CHECK_EQ(1, n1->UseCount());
815 n1->RemoveAllInputs(); 836 n1->RemoveAllInputs();
816 CHECK_EQ(1, n1->InputCount()); 837 CHECK_EQ(1, n1->InputCount());
817 CHECK_EQ(0, n1->UseCount()); 838 CHECK_EQ(0, n1->UseCount());
818 CHECK_EQ(NULL, n1->InputAt(0)); 839 CHECK_EQ(NULL, n1->InputAt(0));
819 } 840 }
820 } 841 }
OLDNEW
« no previous file with comments | « test/cctest/compiler/simplified-graph-builder.h ('k') | test/cctest/compiler/test-simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698