Changeset 197365 in webkit for trunk/Source/JavaScriptCore/runtime
- Timestamp:
- Feb 29, 2016, 2:14:59 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore/runtime
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h
r192937 r197365 31 31 #include "ExceptionHelpers.h" 32 32 #include "JSStackInlines.h" 33 #include "SlowPathReturnType.h" 33 34 #include "StackAlignment.h" 34 35 #include "Symbol.h" … … 176 177 struct Instruction; 177 178 178 #if USE(JSVALUE64)179 // According to C++ rules, a type used for the return signature of function with C linkage (i.e.180 // 'extern "C"') needs to be POD; hence putting any constructors into it could cause either compiler181 // warnings, or worse, a change in the ABI used to return these types.182 struct SlowPathReturnType {183 void* a;184 void* b;185 };186 187 inline SlowPathReturnType encodeResult(void* a, void* b)188 {189 SlowPathReturnType result;190 result.a = a;191 result.b = b;192 return result;193 }194 195 inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)196 {197 a = result.a;198 b = result.b;199 }200 201 #else // USE(JSVALUE32_64)202 typedef int64_t SlowPathReturnType;203 204 typedef union {205 struct {206 void* a;207 void* b;208 } pair;209 int64_t i;210 } SlowPathReturnTypeEncoding;211 212 inline SlowPathReturnType encodeResult(void* a, void* b)213 {214 SlowPathReturnTypeEncoding u;215 u.pair.a = a;216 u.pair.b = b;217 return u.i;218 }219 220 inline void decodeResult(SlowPathReturnType result, void*& a, void*& b)221 {222 SlowPathReturnTypeEncoding u;223 u.i = result;224 a = u.pair.a;225 b = u.pair.b;226 }227 #endif // USE(JSVALUE32_64)228 229 179 #define SLOW_PATH 230 180
Note:
See TracChangeset
for help on using the changeset viewer.