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

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

Issue 1921203002: Add new relocation type WASM_MEMORY_SIZE_REFERENCE, use relocatable pointers to update wasm memory … (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ben's review Created 4 years, 7 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
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.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/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.h"
8 #include "src/base/lazy-instance.h" 8 #include "src/base/lazy-instance.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/opcodes.h" 10 #include "src/compiler/opcodes.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 143
144 std::ostream& operator<<(std::ostream& os, ParameterInfo const& i) { 144 std::ostream& operator<<(std::ostream& os, ParameterInfo const& i) {
145 if (i.debug_name()) os << i.debug_name() << '#'; 145 if (i.debug_name()) os << i.debug_name() << '#';
146 os << i.index(); 146 os << i.index();
147 return os; 147 return os;
148 } 148 }
149 149
150 bool operator==(RelocatablePtrConstantInfo const& lhs, 150 bool operator==(RelocatablePtrConstantInfo const& lhs,
151 RelocatablePtrConstantInfo const& rhs) { 151 RelocatablePtrConstantInfo const& rhs) {
152 return lhs.rmode() == rhs.rmode() && lhs.value() == rhs.value(); 152 return lhs.rmode() == rhs.rmode() && lhs.value() == rhs.value() &&
153 lhs.type() == rhs.type();
153 } 154 }
154 155
155 bool operator!=(RelocatablePtrConstantInfo const& lhs, 156 bool operator!=(RelocatablePtrConstantInfo const& lhs,
156 RelocatablePtrConstantInfo const& rhs) { 157 RelocatablePtrConstantInfo const& rhs) {
157 return !(lhs == rhs); 158 return !(lhs == rhs);
158 } 159 }
159 160
160 size_t hash_value(RelocatablePtrConstantInfo const& p) { 161 size_t hash_value(RelocatablePtrConstantInfo const& p) {
161 return base::hash_combine(p.value(), p.rmode()); 162 return base::hash_combine(p.value(), p.rmode(), p.type());
162 } 163 }
163 164
164 std::ostream& operator<<(std::ostream& os, 165 std::ostream& operator<<(std::ostream& os,
165 RelocatablePtrConstantInfo const& p) { 166 RelocatablePtrConstantInfo const& p) {
166 return os << p.value() << "|" << p.rmode(); 167 return os << p.value() << "|" << p.rmode() << "|" << p.type();
167 } 168 }
168 169
169 #define CACHED_OP_LIST(V) \ 170 #define CACHED_OP_LIST(V) \
170 V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \ 171 V(Dead, Operator::kFoldable, 0, 0, 0, 1, 1, 1) \
171 V(DeoptimizeIf, Operator::kFoldable, 2, 1, 1, 0, 0, 1) \ 172 V(DeoptimizeIf, Operator::kFoldable, 2, 1, 1, 0, 0, 1) \
172 V(DeoptimizeUnless, Operator::kFoldable, 2, 1, 1, 0, 0, 1) \ 173 V(DeoptimizeUnless, Operator::kFoldable, 2, 1, 1, 0, 0, 1) \
173 V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 174 V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
174 V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 175 V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
175 V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 176 V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
176 V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \ 177 V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 int32_t value, RelocInfo::Mode rmode) { 697 int32_t value, RelocInfo::Mode rmode) {
697 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // -- 698 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
698 IrOpcode::kRelocatableInt32Constant, Operator::kPure, // opcode 699 IrOpcode::kRelocatableInt32Constant, Operator::kPure, // opcode
699 "RelocatableInt32Constant", // name 700 "RelocatableInt32Constant", // name
700 0, 0, 0, 1, 0, 0, // counts 701 0, 0, 0, 1, 0, 0, // counts
701 RelocatablePtrConstantInfo(value, rmode)); // parameter 702 RelocatablePtrConstantInfo(value, rmode)); // parameter
702 } 703 }
703 704
704 const Operator* CommonOperatorBuilder::RelocatableInt64Constant( 705 const Operator* CommonOperatorBuilder::RelocatableInt64Constant(
705 int64_t value, RelocInfo::Mode rmode) { 706 int64_t value, RelocInfo::Mode rmode) {
706 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // -- 707 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
707 IrOpcode::kRelocatableInt64Constant, Operator::kPure, // opcode 708 IrOpcode::kRelocatableInt64Constant, Operator::kPure, // opcode
708 "RelocatableInt64Constant", // name 709 "RelocatableInt64Constant", // name
709 0, 0, 0, 1, 0, 0, // counts 710 0, 0, 0, 1, 0, 0, // counts
710 RelocatablePtrConstantInfo(static_cast<intptr_t>(value), // parameter 711 RelocatablePtrConstantInfo(value, rmode)); // parameter
711 rmode));
712 } 712 }
713 713
714 const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep, 714 const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep,
715 BranchHint hint) { 715 BranchHint hint) {
716 return new (zone()) Operator1<SelectParameters>( // -- 716 return new (zone()) Operator1<SelectParameters>( // --
717 IrOpcode::kSelect, Operator::kPure, // opcode 717 IrOpcode::kSelect, Operator::kPure, // opcode
718 "Select", // name 718 "Select", // name
719 3, 0, 0, 1, 0, 0, // counts 719 3, 0, 0, 1, 0, 0, // counts
720 SelectParameters(rep, hint)); // parameter 720 SelectParameters(rep, hint)); // parameter
721 } 721 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 CommonOperatorBuilder::CreateFrameStateFunctionInfo( 904 CommonOperatorBuilder::CreateFrameStateFunctionInfo(
905 FrameStateType type, int parameter_count, int local_count, 905 FrameStateType type, int parameter_count, int local_count,
906 Handle<SharedFunctionInfo> shared_info) { 906 Handle<SharedFunctionInfo> shared_info) {
907 return new (zone()->New(sizeof(FrameStateFunctionInfo))) 907 return new (zone()->New(sizeof(FrameStateFunctionInfo)))
908 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); 908 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info);
909 } 909 }
910 910
911 } // namespace compiler 911 } // namespace compiler
912 } // namespace internal 912 } // namespace internal
913 } // namespace v8 913 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698