Changeset 43837 in webkit for trunk/JavaScriptCore/jit/JITCode.h
- Timestamp:
- May 18, 2009, 12:46:37 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITCode.h
r43273 r43837 33 33 #include "CallFrame.h" 34 34 #include "JSValue.h" 35 #include "MacroAssembler.h" 35 36 #include "Profiler.h" 36 37 … … 41 42 42 43 class JITCode { 44 typedef MacroAssembler::CodeRef CodeRef; 43 45 public: 44 JITCode(void* code) 45 : code(code) 46 JITCode() 46 47 { 47 48 } 48 49 49 operator bool() const 50 JITCode(const CodeRef ref) 51 : m_ref(ref) 50 52 { 51 return code != 0; 53 } 54 55 bool operator !() const 56 { 57 return !m_ref.m_code; 52 58 } 53 59 54 60 void* addressForCall() 55 61 { 56 return code;62 return m_ref.m_code; 57 63 } 58 64 … … 62 68 unsigned offsetOf(void* pointerIntoCode) 63 69 { 64 intptr_t result = reinterpret_cast<intptr_t>(pointerIntoCode) - reinterpret_cast<intptr_t>( code);70 intptr_t result = reinterpret_cast<intptr_t>(pointerIntoCode) - reinterpret_cast<intptr_t>(m_ref.m_code); 65 71 ASSERT(static_cast<intptr_t>(static_cast<unsigned>(result)) == result); 66 72 return static_cast<unsigned>(result); … … 74 80 0, 0, 0, 0, 0, 0, 75 81 #endif 76 code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData)); 82 m_ref.m_code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData)); 83 } 84 85 #ifndef NDEBUG 86 size_t size() 87 { 88 ASSERT(m_ref.m_code); 89 return m_ref.m_size; 90 } 91 #endif 92 93 ExecutablePool* getExecutablePool() 94 { 95 return m_ref.m_executablePool.get(); 96 } 97 98 // Host functions are a bit special; they have a m_code pointer but they 99 // do not individully ref the executable pool containing the trampoline. 100 static JITCode HostFunction(void* code) 101 { 102 return JITCode(code, 0, 0); 77 103 } 78 104 79 105 private: 80 void* code; 106 JITCode(void* code, PassRefPtr<ExecutablePool> executablePool, size_t size) 107 : m_ref(code, executablePool, size) 108 { 109 } 110 111 CodeRef m_ref; 81 112 }; 82 113
Note:
See TracChangeset
for help on using the changeset viewer.