Changeset 153256 in webkit for trunk/Source/JavaScriptCore/disassembler
- Timestamp:
- Jul 24, 2013, 9:04:05 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore/disassembler
- Files:
-
- 2 added
- 3 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/disassembler/Disassembler.cpp
r135640 r153256 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 32 32 namespace JSC { 33 33 34 void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out )34 void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out, InstructionSubsetHint subsetHint) 35 35 { 36 if (tryToDisassemble(codePtr, size, prefix, out ))36 if (tryToDisassemble(codePtr, size, prefix, out, subsetHint)) 37 37 return; 38 38 -
trunk/Source/JavaScriptCore/disassembler/Disassembler.h
r135640 r153256 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 34 34 class MacroAssemblerCodePtr; 35 35 36 enum InstructionSubsetHint { MacroAssemblerSubset, LLVMSubset }; 37 36 38 #if ENABLE(DISASSEMBLER) 37 bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream& );39 bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream&, InstructionSubsetHint = MacroAssemblerSubset); 38 40 #else 39 inline bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char*, PrintStream& )41 inline bool tryToDisassemble(const MacroAssemblerCodePtr&, size_t, const char*, PrintStream&, InstructionSubsetHint = MacroAssemblerSubset) 40 42 { 41 43 return false; … … 45 47 // Prints either the disassembly, or a line of text indicating that disassembly failed and 46 48 // the range of machine code addresses. 47 void disassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream& out );49 void disassemble(const MacroAssemblerCodePtr&, size_t, const char* prefix, PrintStream& out, InstructionSubsetHint = MacroAssemblerSubset); 48 50 49 51 } // namespace JSC -
trunk/Source/JavaScriptCore/disassembler/LLVMDisassembler.h
r153255 r153256 1 1 /* 2 * Copyright (C) 201 2Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 26 #ifndef LLVMDisassembler_h 27 #define LLVMDisassembler_h 28 27 29 #include "Disassembler.h" 28 29 #include "MacroAssemblerCodeRef.h"30 #include <wtf/DataLog.h>31 30 32 31 namespace JSC { 33 32 34 void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out) 35 { 36 if (tryToDisassemble(codePtr, size, prefix, out)) 37 return; 38 39 out.printf("%sdisassembly not available for range %p...%p\n", prefix, codePtr.executableAddress(), static_cast<char*>(codePtr.executableAddress()) + size); 40 } 33 #if USE(LLVM_DISASSEMBLER) 34 35 bool tryToDisassembleWithLLVM(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out, InstructionSubsetHint); 36 37 #else // USE(LLVM_DISASSEMBLER) 38 39 inline bool tryToDisassembleWithLLVM(const MacroAssemblerCodePtr&, size_t, const char*, PrintStream&, InstructionSubsetHint) { return false; } 40 41 #endif // USE(LLVM_DISASSEMBLER) 41 42 42 43 } // namespace JSC 43 44 45 #endif // LLVMDisassembler_h 46 -
trunk/Source/JavaScriptCore/disassembler/UDis86Disassembler.cpp
r135640 r153256 1 1 /* 2 * Copyright (C) 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 25 25 26 26 #include "config.h" 27 #include " Disassembler.h"27 #include "UDis86Disassembler.h" 28 28 29 29 #if USE(UDIS86) … … 34 34 namespace JSC { 35 35 36 bool tryToDisassemble (const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out)36 bool tryToDisassembleWithUDis86(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out, InstructionSubsetHint) 37 37 { 38 38 ud_t disassembler; -
trunk/Source/JavaScriptCore/disassembler/UDis86Disassembler.h
r153255 r153256 1 1 /* 2 * Copyright (C) 201 2Apple Inc. All rights reserved.2 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 26 #ifndef UDis86Disassembler_h 27 #define UDis86Disassembler_h 28 27 29 #include "Disassembler.h" 28 29 #include "MacroAssemblerCodeRef.h"30 #include <wtf/DataLog.h>31 30 32 31 namespace JSC { 33 32 34 void disassemble(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out) 35 { 36 if (tryToDisassemble(codePtr, size, prefix, out)) 37 return; 38 39 out.printf("%sdisassembly not available for range %p...%p\n", prefix, codePtr.executableAddress(), static_cast<char*>(codePtr.executableAddress()) + size); 40 } 33 #if USE(UDIS86) 34 35 bool tryToDisassembleWithUDis86(const MacroAssemblerCodePtr& codePtr, size_t size, const char* prefix, PrintStream& out, InstructionSubsetHint); 36 37 #else // USE(UDIS86) 38 39 inline bool tryToDisassembleWithUDis86(const MacroAssemblerCodePtr&, size_t, const char*, PrintStream&, InstructionSubsetHint) { return false; } 40 41 #endif // USE(UDIS86) 41 42 42 43 } // namespace JSC 43 44 45 #endif // UDis86Disassembler_h 46
Note:
See TracChangeset
for help on using the changeset viewer.