OLD | NEW |
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_RUNTIME_RUNTIME_UTILS_H_ | 5 #ifndef V8_RUNTIME_RUNTIME_UTILS_H_ |
6 #define V8_RUNTIME_RUNTIME_UTILS_H_ | 6 #define V8_RUNTIME_RUNTIME_UTILS_H_ |
7 | 7 |
8 #include "src/runtime/runtime.h" | 8 #include "src/runtime/runtime.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 (reinterpret_cast<ObjectPair>(y) << 32); | 155 (reinterpret_cast<ObjectPair>(y) << 32); |
156 #elif defined(V8_TARGET_BIG_ENDIAN) | 156 #elif defined(V8_TARGET_BIG_ENDIAN) |
157 return reinterpret_cast<uint32_t>(y) | | 157 return reinterpret_cast<uint32_t>(y) | |
158 (reinterpret_cast<ObjectPair>(x) << 32); | 158 (reinterpret_cast<ObjectPair>(x) << 32); |
159 #else | 159 #else |
160 #error Unknown endianness | 160 #error Unknown endianness |
161 #endif | 161 #endif |
162 } | 162 } |
163 #endif | 163 #endif |
164 | 164 |
| 165 |
| 166 // A mechanism to return a triple of Object pointers. In all calling |
| 167 // conventions, a struct of two pointers is returned in memory, |
| 168 // allocated by the caller, and passed as a pointer in a hidden first parameter. |
| 169 struct ObjectTriple { |
| 170 Object* x; |
| 171 Object* y; |
| 172 Object* z; |
| 173 }; |
| 174 |
| 175 static inline ObjectTriple MakeTriple(Object* x, Object* y, Object* z) { |
| 176 ObjectTriple result = {x, y, z}; |
| 177 // ObjectTriple is assigned to a hidden first argument. |
| 178 return result; |
| 179 } |
| 180 |
165 } // namespace internal | 181 } // namespace internal |
166 } // namespace v8 | 182 } // namespace v8 |
167 | 183 |
168 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ | 184 #endif // V8_RUNTIME_RUNTIME_UTILS_H_ |
OLD | NEW |