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

Side by Side Diff: test/unittests/compiler/common-operator-unittest.cc

Issue 680313003: Move input/output counts directly into Operators, simplying OperatorProperties. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: yes 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 | Annotate | Revision Log
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/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/compiler/operator-properties-inl.h" 9 #include "src/compiler/operator-properties-inl.h"
10 #include "test/unittests/test-utils.h" 10 #include "test/unittests/test-utils.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 control_input_count, effect_output_count, control_output_count) \ 42 control_input_count, effect_output_count, control_output_count) \
43 { \ 43 { \
44 &CommonOperatorBuilder::Name, IrOpcode::k##Name, properties, \ 44 &CommonOperatorBuilder::Name, IrOpcode::k##Name, properties, \
45 value_input_count, effect_input_count, control_input_count, \ 45 value_input_count, effect_input_count, control_input_count, \
46 effect_output_count, control_output_count \ 46 effect_output_count, control_output_count \
47 } 47 }
48 SHARED(Dead, Operator::kFoldable, 0, 0, 0, 0, 1), 48 SHARED(Dead, Operator::kFoldable, 0, 0, 0, 0, 1),
49 SHARED(End, Operator::kFoldable, 0, 0, 1, 0, 0), 49 SHARED(End, Operator::kFoldable, 0, 0, 1, 0, 0),
50 SHARED(IfTrue, Operator::kFoldable, 0, 0, 1, 0, 1), 50 SHARED(IfTrue, Operator::kFoldable, 0, 0, 1, 0, 1),
51 SHARED(IfFalse, Operator::kFoldable, 0, 0, 1, 0, 1), 51 SHARED(IfFalse, Operator::kFoldable, 0, 0, 1, 0, 1),
52 SHARED(Throw, Operator::kFoldable, 1, 0, 1, 0, 1), 52 SHARED(Throw, Operator::kFoldable, 1, 1, 1, 0, 1),
53 SHARED(Return, Operator::kNoProperties, 1, 1, 1, 1, 1) 53 SHARED(Return, Operator::kNoProperties, 1, 1, 1, 0, 1)
54 #undef SHARED 54 #undef SHARED
55 }; 55 };
56 56
57 57
58 class CommonSharedOperatorTest 58 class CommonSharedOperatorTest
59 : public TestWithZone, 59 : public TestWithZone,
60 public ::testing::WithParamInterface<SharedOperator> {}; 60 public ::testing::WithParamInterface<SharedOperator> {};
61 61
62 } // namespace 62 } // namespace
63 63
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 CommonOperatorTest() : common_(zone()) {} 123 CommonOperatorTest() : common_(zone()) {}
124 virtual ~CommonOperatorTest() {} 124 virtual ~CommonOperatorTest() {}
125 125
126 CommonOperatorBuilder* common() { return &common_; } 126 CommonOperatorBuilder* common() { return &common_; }
127 127
128 private: 128 private:
129 CommonOperatorBuilder common_; 129 CommonOperatorBuilder common_;
130 }; 130 };
131 131
132 132
133 const int kArguments[] = {1, 5, 6, 42, 100, 10000, kMaxInt}; 133 const int kArguments[] = {1, 5, 6, 42, 100, 10000, 65000};
134 134
135 135
136 const float kFloatValues[] = {-std::numeric_limits<float>::infinity(), 136 const float kFloatValues[] = {-std::numeric_limits<float>::infinity(),
137 std::numeric_limits<float>::min(), 137 std::numeric_limits<float>::min(),
138 -1.0f, 138 -1.0f,
139 -0.0f, 139 -0.0f,
140 0.0f, 140 0.0f,
141 1.0f, 141 1.0f,
142 std::numeric_limits<float>::max(), 142 std::numeric_limits<float>::max(),
143 std::numeric_limits<float>::infinity(), 143 std::numeric_limits<float>::infinity(),
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op)); 260 EXPECT_EQ(arguments + 1, OperatorProperties::GetTotalInputCount(op));
261 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op)); 261 EXPECT_EQ(0, OperatorProperties::GetControlOutputCount(op));
262 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op)); 262 EXPECT_EQ(0, OperatorProperties::GetEffectOutputCount(op));
263 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op)); 263 EXPECT_EQ(1, OperatorProperties::GetValueOutputCount(op));
264 } 264 }
265 } 265 }
266 266
267 } // namespace compiler 267 } // namespace compiler
268 } // namespace internal 268 } // namespace internal
269 } // namespace v8 269 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/compiler/test-schedule.cc ('k') | test/unittests/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698