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

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

Issue 1513383003: [turbofan] Store nodes use only MachineRepresentation, not MachineType. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: please mips64 Created 5 years 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 <limits> 5 #include <limits>
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler/access-builder.h" 8 #include "src/compiler/access-builder.h"
9 #include "src/compiler/change-lowering.h" 9 #include "src/compiler/change-lowering.h"
10 #include "src/compiler/control-builders.h" 10 #include "src/compiler/control-builders.h"
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 1364
1365 Node* val = t.ExampleWithOutput(kMachineReps[i]); 1365 Node* val = t.ExampleWithOutput(kMachineReps[i]);
1366 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, 1366 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0,
1367 val, t.start, t.start); 1367 val, t.start, t.start);
1368 t.Effect(store); 1368 t.Effect(store);
1369 t.LowerAllNodesAndLowerChanges(); 1369 t.LowerAllNodesAndLowerChanges();
1370 CHECK_EQ(IrOpcode::kStore, store->opcode()); 1370 CHECK_EQ(IrOpcode::kStore, store->opcode());
1371 CHECK_EQ(val, store->InputAt(2)); 1371 CHECK_EQ(val, store->InputAt(2));
1372 CheckFieldAccessArithmetic(access, store); 1372 CheckFieldAccessArithmetic(access, store);
1373 1373
1374 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); 1374 StoreRepresentation rep = StoreRepresentationOf(store->op());
1375 if (kMachineReps[i].representation() == MachineRepresentation::kTagged) { 1375 if (kMachineReps[i].representation() == MachineRepresentation::kTagged) {
1376 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); 1376 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind());
1377 } 1377 }
1378 CHECK_EQ(kMachineReps[i], rep.machine_type()); 1378 CHECK_EQ(kMachineReps[i].representation(), rep.representation());
1379 } 1379 }
1380 } 1380 }
1381 { 1381 {
1382 HandleAndZoneScope scope; 1382 HandleAndZoneScope scope;
1383 Zone* z = scope.main_zone(); 1383 Zone* z = scope.main_zone();
1384 TestingGraph t(Type::Any(), Type::Intersect(Type::SignedSmall(), 1384 TestingGraph t(Type::Any(), Type::Intersect(Type::SignedSmall(),
1385 Type::TaggedSigned(), z)); 1385 Type::TaggedSigned(), z));
1386 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, 1386 FieldAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
1387 Handle<Name>::null(), Type::Any(), 1387 Handle<Name>::null(), Type::Any(),
1388 MachineType::AnyTagged()}; 1388 MachineType::AnyTagged()};
1389 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0, 1389 Node* store = t.graph()->NewNode(t.simplified()->StoreField(access), t.p0,
1390 t.p1, t.start, t.start); 1390 t.p1, t.start, t.start);
1391 t.Effect(store); 1391 t.Effect(store);
1392 t.LowerAllNodesAndLowerChanges(); 1392 t.LowerAllNodesAndLowerChanges();
1393 CHECK_EQ(IrOpcode::kStore, store->opcode()); 1393 CHECK_EQ(IrOpcode::kStore, store->opcode());
1394 CHECK_EQ(t.p1, store->InputAt(2)); 1394 CHECK_EQ(t.p1, store->InputAt(2));
1395 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); 1395 StoreRepresentation rep = StoreRepresentationOf(store->op());
1396 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); 1396 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind());
1397 } 1397 }
1398 } 1398 }
1399 1399
1400 1400
1401 TEST(LowerLoadElement_to_load) { 1401 TEST(LowerLoadElement_to_load) {
1402 TestingGraph t(Type::Any(), Type::Signed32()); 1402 TestingGraph t(Type::Any(), Type::Signed32());
1403 1403
1404 for (size_t i = 0; i < arraysize(kMachineReps); i++) { 1404 for (size_t i = 0; i < arraysize(kMachineReps); i++) {
1405 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, 1405 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
(...skipping 24 matching lines...) Expand all
1430 1430
1431 Node* val = t.ExampleWithOutput(kMachineReps[i]); 1431 Node* val = t.ExampleWithOutput(kMachineReps[i]);
1432 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), 1432 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access),
1433 t.p0, t.p1, val, t.start, t.start); 1433 t.p0, t.p1, val, t.start, t.start);
1434 t.Effect(store); 1434 t.Effect(store);
1435 t.LowerAllNodesAndLowerChanges(); 1435 t.LowerAllNodesAndLowerChanges();
1436 CHECK_EQ(IrOpcode::kStore, store->opcode()); 1436 CHECK_EQ(IrOpcode::kStore, store->opcode());
1437 CHECK_EQ(val, store->InputAt(2)); 1437 CHECK_EQ(val, store->InputAt(2));
1438 CheckElementAccessArithmetic(access, store); 1438 CheckElementAccessArithmetic(access, store);
1439 1439
1440 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); 1440 StoreRepresentation rep = StoreRepresentationOf(store->op());
1441 if (kMachineReps[i].representation() == MachineRepresentation::kTagged) { 1441 if (kMachineReps[i].representation() == MachineRepresentation::kTagged) {
1442 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind()); 1442 CHECK_EQ(kFullWriteBarrier, rep.write_barrier_kind());
1443 } 1443 }
1444 CHECK_EQ(kMachineReps[i], rep.machine_type()); 1444 CHECK_EQ(kMachineReps[i].representation(), rep.representation());
1445 } 1445 }
1446 } 1446 }
1447 { 1447 {
1448 HandleAndZoneScope scope; 1448 HandleAndZoneScope scope;
1449 Zone* z = scope.main_zone(); 1449 Zone* z = scope.main_zone();
1450 TestingGraph t( 1450 TestingGraph t(
1451 Type::Any(), Type::Signed32(), 1451 Type::Any(), Type::Signed32(),
1452 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z)); 1452 Type::Intersect(Type::SignedSmall(), Type::TaggedSigned(), z));
1453 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, 1453 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize,
1454 Type::Any(), MachineType::AnyTagged()}; 1454 Type::Any(), MachineType::AnyTagged()};
1455 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0, 1455 Node* store = t.graph()->NewNode(t.simplified()->StoreElement(access), t.p0,
1456 t.p1, t.p2, t.start, t.start); 1456 t.p1, t.p2, t.start, t.start);
1457 t.Effect(store); 1457 t.Effect(store);
1458 t.LowerAllNodesAndLowerChanges(); 1458 t.LowerAllNodesAndLowerChanges();
1459 CHECK_EQ(IrOpcode::kStore, store->opcode()); 1459 CHECK_EQ(IrOpcode::kStore, store->opcode());
1460 CHECK_EQ(t.p2, store->InputAt(2)); 1460 CHECK_EQ(t.p2, store->InputAt(2));
1461 StoreRepresentation rep = OpParameter<StoreRepresentation>(store); 1461 StoreRepresentation rep = StoreRepresentationOf(store->op());
1462 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind()); 1462 CHECK_EQ(kNoWriteBarrier, rep.write_barrier_kind());
1463 } 1463 }
1464 } 1464 }
1465 1465
1466 1466
1467 TEST(InsertChangeForLoadElementIndex) { 1467 TEST(InsertChangeForLoadElementIndex) {
1468 // LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) => 1468 // LoadElement(obj: Tagged, index: kTypeInt32 | kRepTagged, length) =>
1469 // Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k)) 1469 // Load(obj, Int32Add(Int32Mul(ChangeTaggedToInt32(index), #k), #k))
1470 TestingGraph t(Type::Any(), Type::Signed32()); 1470 TestingGraph t(Type::Any(), Type::Signed32());
1471 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(), 1471 ElementAccess access = {kTaggedBase, FixedArrayBase::kHeaderSize, Type::Any(),
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1963 t.Return(use); 1963 t.Return(use);
1964 t.Lower(); 1964 t.Lower();
1965 1965
1966 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op())); 1966 CHECK_EQ(d.expected, PhiRepresentationOf(phi->op()));
1967 } 1967 }
1968 } 1968 }
1969 1969
1970 } // namespace compiler 1970 } // namespace compiler
1971 } // namespace internal 1971 } // namespace internal
1972 } // namespace v8 1972 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-run-native-calls.cc ('k') | test/unittests/compiler/arm/instruction-selector-arm-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698