Changeset 43839 in webkit for trunk/JavaScriptCore/jit/JITCode.h
- Timestamp:
- May 18, 2009, 1:22:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITCode.h
r43837 r43839 33 33 #include "CallFrame.h" 34 34 #include "JSValue.h" 35 #include "MacroAssembler.h"36 35 #include "Profiler.h" 37 36 … … 42 41 43 42 class JITCode { 44 typedef MacroAssembler::CodeRef CodeRef;45 43 public: 46 JITCode() 44 JITCode(void* code) 45 : code(code) 47 46 { 48 47 } 49 48 50 JITCode(const CodeRef ref) 51 : m_ref(ref) 49 operator bool() const 52 50 { 53 } 54 55 bool operator !() const 56 { 57 return !m_ref.m_code; 51 return code != 0; 58 52 } 59 53 60 54 void* addressForCall() 61 55 { 62 return m_ref.m_code;56 return code; 63 57 } 64 58 … … 68 62 unsigned offsetOf(void* pointerIntoCode) 69 63 { 70 intptr_t result = reinterpret_cast<intptr_t>(pointerIntoCode) - reinterpret_cast<intptr_t>( m_ref.m_code);64 intptr_t result = reinterpret_cast<intptr_t>(pointerIntoCode) - reinterpret_cast<intptr_t>(code); 71 65 ASSERT(static_cast<intptr_t>(static_cast<unsigned>(result)) == result); 72 66 return static_cast<unsigned>(result); … … 80 74 0, 0, 0, 0, 0, 0, 81 75 #endif 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); 76 code, registerFile, callFrame, exception, Profiler::enabledProfilerReference(), globalData)); 103 77 } 104 78 105 79 private: 106 JITCode(void* code, PassRefPtr<ExecutablePool> executablePool, size_t size) 107 : m_ref(code, executablePool, size) 108 { 109 } 110 111 CodeRef m_ref; 80 void* code; 112 81 }; 113 82
Note:
See TracChangeset
for help on using the changeset viewer.