Ignore:
Timestamp:
Feb 29, 2016, 2:14:59 PM (9 years ago)
Author:
[email protected]
Message:

Make it cheap to #include "JITOperations.h"
https://bugs.webkit.org/show_bug.cgi?id=154836

Reviewed by Mark Lam.

Prior to this change, this header included the whole world even though it did't have any
definitions. This patch turns almost all of the includes into forward declarations. Right
now this header is very cheap to include.

  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
  • JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • dfg/DFGSpeculativeJIT.h:
  • jit/JITOperations.cpp:
  • jit/JITOperations.h:
  • jit/Repatch.h:
  • runtime/CommonSlowPaths.h:

(JSC::encodeResult): Deleted.
(JSC::decodeResult): Deleted.

  • runtime/SlowPathReturnType.h: Added.

(JSC::encodeResult):
(JSC::decodeResult):

Location:
trunk/Source/JavaScriptCore/runtime
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/CommonSlowPaths.h

    r192937 r197365  
    3131#include "ExceptionHelpers.h"
    3232#include "JSStackInlines.h"
     33#include "SlowPathReturnType.h"
    3334#include "StackAlignment.h"
    3435#include "Symbol.h"
     
    176177struct Instruction;
    177178
    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 compiler
    181 // 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    
    229179#define SLOW_PATH
    230180   
Note: See TracChangeset for help on using the changeset viewer.