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

Side by Side Diff: test/cctest/compiler/c-signature.h

Issue 1424983003: [turbofan] Cleanup RawMachineAssembler::Store interface. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 5 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
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/codegen-tester.h » ('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 #ifndef V8_COMPILER_C_SIGNATURE_H_ 5 #ifndef V8_COMPILER_C_SIGNATURE_H_
6 #define V8_COMPILER_C_SIGNATURE_H_ 6 #define V8_COMPILER_C_SIGNATURE_H_
7 7
8 #include "src/compiler/machine-type.h" 8 #include "src/compiler/machine-type.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 18 matching lines...) Expand all
29 29
30 template <typename T> 30 template <typename T>
31 inline MachineType MachineTypeForC() { 31 inline MachineType MachineTypeForC() {
32 while (false) { 32 while (false) {
33 // All other types T must be assignable to Object* 33 // All other types T must be assignable to Object*
34 *(static_cast<Object* volatile*>(0)) = static_cast<T>(0); 34 *(static_cast<Object* volatile*>(0)) = static_cast<T>(0);
35 } 35 }
36 return kMachAnyTagged; 36 return kMachAnyTagged;
37 } 37 }
38 38
39 template <typename T>
40 inline StoreRepresentation StoreRepresentationForC(
41 WriteBarrierKind write_barrier_kind) {
42 return StoreRepresentation(MachineTypeForC<T>(), write_barrier_kind);
43 }
44
45 #define DECLARE_TEMPLATE_SPECIALIZATION(ctype, mtype) \ 39 #define DECLARE_TEMPLATE_SPECIALIZATION(ctype, mtype) \
46 template <> \ 40 template <> \
47 inline MachineType MachineTypeForC<ctype>() { \ 41 inline MachineType MachineTypeForC<ctype>() { \
48 return mtype; \ 42 return mtype; \
49 } 43 }
50 FOREACH_CTYPE_MACHINE_TYPE_MAPPING(DECLARE_TEMPLATE_SPECIALIZATION) 44 FOREACH_CTYPE_MACHINE_TYPE_MAPPING(DECLARE_TEMPLATE_SPECIALIZATION)
51 #undef DECLARE_TEMPLATE_SPECIALIZATION 45 #undef DECLARE_TEMPLATE_SPECIALIZATION
52 46
53 // Helper for building machine signatures from C types. 47 // Helper for building machine signatures from C types.
54 class CSignature : public MachineSignature { 48 class CSignature : public MachineSignature {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 typedef CSignature2<int32_t, int32_t, int32_t> CSignature_i_ii; 157 typedef CSignature2<int32_t, int32_t, int32_t> CSignature_i_ii;
164 typedef CSignature2<uint32_t, uint32_t, uint32_t> CSignature_u_uu; 158 typedef CSignature2<uint32_t, uint32_t, uint32_t> CSignature_u_uu;
165 typedef CSignature2<float, float, float> CSignature_f_ff; 159 typedef CSignature2<float, float, float> CSignature_f_ff;
166 typedef CSignature2<double, double, double> CSignature_d_dd; 160 typedef CSignature2<double, double, double> CSignature_d_dd;
167 typedef CSignature2<Object*, Object*, Object*> CSignature_o_oo; 161 typedef CSignature2<Object*, Object*, Object*> CSignature_o_oo;
168 } // namespace compiler 162 } // namespace compiler
169 } // namespace internal 163 } // namespace internal
170 } // namespace v8 164 } // namespace v8
171 165
172 #endif // V8_COMPILER_C_SIGNATURE_H_ 166 #endif // V8_COMPILER_C_SIGNATURE_H_
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | test/cctest/compiler/codegen-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698