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

Side by Side Diff: src/compiler/simplified-operator.cc

Issue 579723004: Introduce simplified BooleanToNumber operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/simplified-operator.h" 5 #include "src/compiler/simplified-operator.h"
6 6
7 #include "src/base/lazy-instance.h" 7 #include "src/base/lazy-instance.h"
8 #include "src/compiler/opcodes.h" 8 #include "src/compiler/opcodes.h"
9 #include "src/compiler/operator.h" 9 #include "src/compiler/operator.h"
10 #include "src/types-inl.h" 10 #include "src/types-inl.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 static bool Equals(const ElementAccess& lhs, const ElementAccess& rhs) { 58 static bool Equals(const ElementAccess& lhs, const ElementAccess& rhs) {
59 return lhs.base_is_tagged == rhs.base_is_tagged && 59 return lhs.base_is_tagged == rhs.base_is_tagged &&
60 lhs.header_size == rhs.header_size && 60 lhs.header_size == rhs.header_size &&
61 lhs.machine_type == rhs.machine_type && lhs.type->Is(rhs.type); 61 lhs.machine_type == rhs.machine_type && lhs.type->Is(rhs.type);
62 } 62 }
63 }; 63 };
64 64
65 65
66 #define PURE_OP_LIST(V) \ 66 #define PURE_OP_LIST(V) \
67 V(BooleanNot, Operator::kNoProperties, 1) \ 67 V(BooleanNot, Operator::kNoProperties, 1) \
68 V(BooleanToNumber, Operator::kNoProperties, 1) \
titzer 2014/09/17 12:01:22 Should be pure. And I think the Number operators s
Michael Starzinger 2014/09/17 12:43:28 Acknowledged. I agree, please appreciate kPure bei
68 V(NumberEqual, Operator::kCommutative, 2) \ 69 V(NumberEqual, Operator::kCommutative, 2) \
69 V(NumberLessThan, Operator::kNoProperties, 2) \ 70 V(NumberLessThan, Operator::kNoProperties, 2) \
70 V(NumberLessThanOrEqual, Operator::kNoProperties, 2) \ 71 V(NumberLessThanOrEqual, Operator::kNoProperties, 2) \
71 V(NumberAdd, Operator::kCommutative, 2) \ 72 V(NumberAdd, Operator::kCommutative, 2) \
72 V(NumberSubtract, Operator::kNoProperties, 2) \ 73 V(NumberSubtract, Operator::kNoProperties, 2) \
73 V(NumberMultiply, Operator::kCommutative, 2) \ 74 V(NumberMultiply, Operator::kCommutative, 2) \
74 V(NumberDivide, Operator::kNoProperties, 2) \ 75 V(NumberDivide, Operator::kNoProperties, 2) \
75 V(NumberModulus, Operator::kNoProperties, 2) \ 76 V(NumberModulus, Operator::kNoProperties, 2) \
76 V(NumberToInt32, Operator::kNoProperties, 1) \ 77 V(NumberToInt32, Operator::kNoProperties, 1) \
77 V(NumberToUint32, Operator::kNoProperties, 1) \ 78 V(NumberToUint32, Operator::kNoProperties, 1) \
(...skipping 15 matching lines...) Expand all
93 V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1) \ 94 V(LoadField, FieldAccess, Operator::kNoWrite, 1, 1) \
94 V(StoreField, FieldAccess, Operator::kNoRead, 2, 0) \ 95 V(StoreField, FieldAccess, Operator::kNoRead, 2, 0) \
95 V(LoadElement, ElementAccess, Operator::kNoWrite, 2, 1) \ 96 V(LoadElement, ElementAccess, Operator::kNoWrite, 2, 1) \
96 V(StoreElement, ElementAccess, Operator::kNoRead, 3, 0) 97 V(StoreElement, ElementAccess, Operator::kNoRead, 3, 0)
97 98
98 99
99 struct SimplifiedOperatorBuilderImpl FINAL { 100 struct SimplifiedOperatorBuilderImpl FINAL {
100 #define PURE(Name, properties, input_count) \ 101 #define PURE(Name, properties, input_count) \
101 struct Name##Operator FINAL : public SimpleOperator { \ 102 struct Name##Operator FINAL : public SimpleOperator { \
102 Name##Operator() \ 103 Name##Operator() \
103 : SimpleOperator(IrOpcode::k##Name, Operator::kPure | properties, \ 104 : SimpleOperator(IrOpcode::k##Name, Operator::kPure | properties, \
Michael Starzinger 2014/09/17 12:43:28 ... here.
104 input_count, 1, #Name) {} \ 105 input_count, 1, #Name) {} \
105 }; \ 106 }; \
106 Name##Operator k##Name; 107 Name##Operator k##Name;
107 PURE_OP_LIST(PURE) 108 PURE_OP_LIST(PURE)
108 #undef PURE 109 #undef PURE
109 }; 110 };
110 111
111 112
112 static base::LazyInstance<SimplifiedOperatorBuilderImpl>::type kImpl = 113 static base::LazyInstance<SimplifiedOperatorBuilderImpl>::type kImpl =
113 LAZY_INSTANCE_INITIALIZER; 114 LAZY_INSTANCE_INITIALIZER;
(...skipping 22 matching lines...) Expand all
136 return new (zone()) \ 137 return new (zone()) \
137 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \ 138 Operator1<Type>(IrOpcode::k##Name, Operator::kNoThrow | properties, \
138 input_count, output_count, #Name, access); \ 139 input_count, output_count, #Name, access); \
139 } 140 }
140 ACCESS_OP_LIST(ACCESS) 141 ACCESS_OP_LIST(ACCESS)
141 #undef ACCESS 142 #undef ACCESS
142 143
143 } // namespace compiler 144 } // namespace compiler
144 } // namespace internal 145 } // namespace internal
145 } // namespace v8 146 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698