Changeset 214979 in webkit for trunk/Source/JavaScriptCore/interpreter/CalleeBits.h
- Timestamp:
- Apr 5, 2017, 4:59:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/CalleeBits.h
r214905 r214979 26 26 #pragma once 27 27 28 #include "JSCJSValue.h" 28 29 #include <wtf/StdLibExtras.h> 29 30 … … 37 38 38 39 class CalleeBits { 39 static constexpr uintptr_t wasmTag = 1;40 40 public: 41 41 CalleeBits() = default; … … 49 49 } 50 50 51 #if ENABLE(WEBASSEMBLY) 51 52 static void* boxWasm(Wasm::Callee* callee) 52 53 { 53 ASSERT(!(bitwise_cast<uintptr_t>(callee) & wasmTag)); 54 return bitwise_cast<void*>(bitwise_cast<uintptr_t>(callee) | wasmTag); 54 CalleeBits result(bitwise_cast<void*>(bitwise_cast<uintptr_t>(callee) | TagBitsWasm)); 55 ASSERT(result.isWasm()); 56 return result.rawPtr(); 55 57 } 58 #endif 56 59 57 bool isWasm() const { return bitwise_cast<uintptr_t>(m_ptr) & wasmTag; } 60 bool isWasm() const 61 { 62 #if ENABLE(WEBASSEMBLY) 63 return (bitwise_cast<uintptr_t>(m_ptr) & TagWasmMask) == TagBitsWasm; 64 #else 65 return false; 66 #endif 67 } 58 68 bool isCell() const { return !isWasm(); } 59 69 … … 64 74 } 65 75 76 #if ENABLE(WEBASSEMBLY) 66 77 Wasm::Callee* asWasmCallee() const 67 78 { 68 79 ASSERT(isWasm()); 69 return bitwise_cast<Wasm::Callee*>(bitwise_cast<uintptr_t>(m_ptr) & ~ wasmTag);80 return bitwise_cast<Wasm::Callee*>(bitwise_cast<uintptr_t>(m_ptr) & ~TagBitsWasm); 70 81 } 82 #endif 71 83 72 84 void* rawPtr() const { return m_ptr; }
Note:
See TracChangeset
for help on using the changeset viewer.