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

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: Fix mips/mips64 build 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
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 0, 0, 0, 1, 0, 0, // counts 692 0, 0, 0, 1, 0, 0, // counts
692 value); // parameter 693 value); // parameter
693 } 694 }
694 695
695 const Operator* CommonOperatorBuilder::RelocatableInt32Constant( 696 const Operator* CommonOperatorBuilder::RelocatableInt32Constant(
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(static_cast<int32_t>(value),
titzer 2016/05/04 11:21:22 AFAICT, the static_cast here is unnecessary.
gdeepti 2016/05/04 20:14:52 Done.
703 rmode)); // parameter
702 } 704 }
703 705
704 const Operator* CommonOperatorBuilder::RelocatableInt64Constant( 706 const Operator* CommonOperatorBuilder::RelocatableInt64Constant(
705 int64_t value, RelocInfo::Mode rmode) { 707 int64_t value, RelocInfo::Mode rmode) {
706 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // -- 708 return new (zone()) Operator1<RelocatablePtrConstantInfo>( // --
707 IrOpcode::kRelocatableInt64Constant, Operator::kPure, // opcode 709 IrOpcode::kRelocatableInt64Constant, Operator::kPure, // opcode
708 "RelocatableInt64Constant", // name 710 "RelocatableInt64Constant", // name
709 0, 0, 0, 1, 0, 0, // counts 711 0, 0, 0, 1, 0, 0, // counts
710 RelocatablePtrConstantInfo(static_cast<intptr_t>(value), // parameter 712 RelocatablePtrConstantInfo(static_cast<int64_t>(value),
titzer 2016/05/04 11:21:22 Here as well.
gdeepti 2016/05/04 20:14:52 Done.
711 rmode)); 713 rmode)); // parameter
712 } 714 }
713 715
714 const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep, 716 const Operator* CommonOperatorBuilder::Select(MachineRepresentation rep,
715 BranchHint hint) { 717 BranchHint hint) {
716 return new (zone()) Operator1<SelectParameters>( // -- 718 return new (zone()) Operator1<SelectParameters>( // --
717 IrOpcode::kSelect, Operator::kPure, // opcode 719 IrOpcode::kSelect, Operator::kPure, // opcode
718 "Select", // name 720 "Select", // name
719 3, 0, 0, 1, 0, 0, // counts 721 3, 0, 0, 1, 0, 0, // counts
720 SelectParameters(rep, hint)); // parameter 722 SelectParameters(rep, hint)); // parameter
721 } 723 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 CommonOperatorBuilder::CreateFrameStateFunctionInfo( 906 CommonOperatorBuilder::CreateFrameStateFunctionInfo(
905 FrameStateType type, int parameter_count, int local_count, 907 FrameStateType type, int parameter_count, int local_count,
906 Handle<SharedFunctionInfo> shared_info) { 908 Handle<SharedFunctionInfo> shared_info) {
907 return new (zone()->New(sizeof(FrameStateFunctionInfo))) 909 return new (zone()->New(sizeof(FrameStateFunctionInfo)))
908 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info); 910 FrameStateFunctionInfo(type, parameter_count, local_count, shared_info);
909 } 911 }
910 912
911 } // namespace compiler 913 } // namespace compiler
912 } // namespace internal 914 } // namespace internal
913 } // namespace v8 915 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698