Changeset 120175 in webkit for trunk/Source/JavaScriptCore/assembler/X86Assembler.h
- Timestamp:
- Jun 13, 2012, 2:38:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/assembler/X86Assembler.h
r120172 r120175 1 1 /* 2 * Copyright (C) 2008 , 2012Apple Inc. All rights reserved.2 * Copyright (C) 2008 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 248 248 249 249 X86Assembler() 250 : m_indexOfLastWatchpoint(INT_MIN)251 , m_indexOfTailOfLastWatchpoint(INT_MIN)252 250 { 253 251 } … … 801 799 m_formatter.immediate8(imm); 802 800 } 803 804 #if CPU(X86)805 void cmpb_im(int imm, const void* addr)806 {807 m_formatter.oneByteOp(OP_GROUP1_EbIb, GROUP1_OP_CMP, addr);808 m_formatter.immediate8(imm);809 }810 #endif811 801 812 802 void cmpl_im(int imm, int offset, RegisterID base, RegisterID index, int scale) … … 958 948 m_formatter.immediate8(imm); 959 949 } 960 961 #if CPU(X86)962 void testb_im(int imm, const void* addr)963 {964 m_formatter.oneByteOp(OP_GROUP3_EbIb, GROUP3_OP_TEST, addr);965 m_formatter.immediate8(imm);966 }967 #endif968 950 969 951 void testl_i32m(int imm, int offset, RegisterID base, RegisterID index, int scale) … … 1721 1703 return m_formatter.codeSize(); 1722 1704 } 1723 1724 AssemblerLabel labelForWatchpoint()1725 {1726 AssemblerLabel result = m_formatter.label();1727 if (static_cast<int>(result.m_offset) != m_indexOfLastWatchpoint)1728 result = label();1729 m_indexOfLastWatchpoint = result.m_offset;1730 m_indexOfTailOfLastWatchpoint = result.m_offset + maxJumpReplacementSize();1731 return result;1732 }1733 1705 1734 1706 AssemblerLabel label() 1735 1707 { 1736 AssemblerLabel result = m_formatter.label(); 1737 while (UNLIKELY(static_cast<int>(result.m_offset) < m_indexOfTailOfLastWatchpoint)) { 1738 nop(); 1739 result = m_formatter.label(); 1740 } 1741 return result; 1708 return m_formatter.label(); 1742 1709 } 1743 1710 … … 1821 1788 } 1822 1789 1823 static void replaceWithJump(void* instructionStart, void* to)1824 {1825 uint8_t* ptr = reinterpret_cast<uint8_t*>(instructionStart);1826 uint8_t* dstPtr = reinterpret_cast<uint8_t*>(to);1827 intptr_t distance = (intptr_t)(dstPtr - (ptr + 5));1828 ptr[0] = static_cast<uint8_t>(OP_JMP_rel32);1829 *reinterpret_cast<int32_t*>(ptr + 1) = static_cast<int32_t>(distance);1830 }1831 1832 static ptrdiff_t maxJumpReplacementSize()1833 {1834 return 5;1835 }1836 1837 1790 static unsigned getCallReturnOffset(AssemblerLabel call) 1838 1791 { … … 2387 2340 AssemblerBuffer m_buffer; 2388 2341 } m_formatter; 2389 int m_indexOfLastWatchpoint;2390 int m_indexOfTailOfLastWatchpoint;2391 2342 }; 2392 2343
Note:
See TracChangeset
for help on using the changeset viewer.