2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
authorcwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Sep 2008 03:22:04 +0000 (03:22 +0000)
committercwzwarich@webkit.org <cwzwarich@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Sep 2008 03:22:04 +0000 (03:22 +0000)
        Reviewed by Maciej Stachowiak.

        Bug 20759: Remove MacroAssembler
        <https://bugs.webkit.org/show_bug.cgi?id=20759>

        Remove MacroAssembler and move its functionality to X86Assembler.

        JavaScriptCore:

        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * VM/CTI.cpp:
        (JSC::CTI::emitGetArg):
        (JSC::CTI::emitGetPutArg):
        (JSC::CTI::emitPutArg):
        (JSC::CTI::emitPutCTIParam):
        (JSC::CTI::emitGetCTIParam):
        (JSC::CTI::emitPutToCallFrameHeader):
        (JSC::CTI::emitGetFromCallFrameHeader):
        (JSC::CTI::emitPutResult):
        (JSC::CTI::emitDebugExceptionCheck):
        (JSC::CTI::emitJumpSlowCaseIfNotImm):
        (JSC::CTI::emitJumpSlowCaseIfNotImms):
        (JSC::CTI::emitFastArithDeTagImmediate):
        (JSC::CTI::emitFastArithReTagImmediate):
        (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
        (JSC::CTI::emitFastArithImmToInt):
        (JSC::CTI::emitFastArithIntToImmOrSlowCase):
        (JSC::CTI::emitFastArithIntToImmNoCheck):
        (JSC::CTI::compileOpCall):
        (JSC::CTI::emitSlowScriptCheck):
        (JSC::CTI::privateCompileMainPass):
        (JSC::CTI::privateCompileSlowCases):
        (JSC::CTI::privateCompile):
        (JSC::CTI::privateCompileGetByIdSelf):
        (JSC::CTI::privateCompileGetByIdProto):
        (JSC::CTI::privateCompileGetByIdChain):
        (JSC::CTI::privateCompilePutByIdReplace):
        (JSC::CTI::privateArrayLengthTrampoline):
        (JSC::CTI::privateStringLengthTrampoline):
        (JSC::CTI::compileRegExp):
        * VM/CTI.h:
        (JSC::CallRecord::CallRecord):
        (JSC::JmpTable::JmpTable):
        (JSC::SlowCaseEntry::SlowCaseEntry):
        (JSC::CTI::JSRInfo::JSRInfo):
        * masm/MacroAssembler.h: Removed.
        * masm/MacroAssemblerWin.cpp: Removed.
        * masm/X86Assembler.h:
        (JSC::X86Assembler::emitConvertToFastCall):
        (JSC::X86Assembler::emitRestoreArgumentReference):
        * wrec/WREC.h:
        (JSC::WRECGenerator::WRECGenerator):
        (JSC::WRECParser::WRECParser):

        WebCore:

        * ForwardingHeaders/masm/IA32MacroAsm.h: Removed.
        * ForwardingHeaders/masm/MacroAssembler.h: Removed.
        * ForwardingHeaders/masm/X86Assembler.h: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36311 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/VM/CTI.cpp
JavaScriptCore/VM/CTI.h
JavaScriptCore/masm/MacroAssembler.h [deleted file]
JavaScriptCore/masm/MacroAssemblerWin.cpp [deleted file]
JavaScriptCore/masm/X86Assembler.h
JavaScriptCore/wrec/WREC.h
WebCore/ChangeLog
WebCore/ForwardingHeaders/masm/IA32MacroAsm.h [deleted file]
WebCore/ForwardingHeaders/masm/MacroAssembler.h [deleted file]
WebCore/ForwardingHeaders/masm/X86Assembler.h [new file with mode: 0644]

index c26023a..241f229 100644 (file)
@@ -1,3 +1,58 @@
+2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
+
+        Reviewed by Maciej Stachowiak.
+
+        Bug 20759: Remove MacroAssembler
+        <https://bugs.webkit.org/show_bug.cgi?id=20759>
+
+        Remove MacroAssembler and move its functionality to X86Assembler.
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * VM/CTI.cpp:
+        (JSC::CTI::emitGetArg):
+        (JSC::CTI::emitGetPutArg):
+        (JSC::CTI::emitPutArg):
+        (JSC::CTI::emitPutCTIParam):
+        (JSC::CTI::emitGetCTIParam):
+        (JSC::CTI::emitPutToCallFrameHeader):
+        (JSC::CTI::emitGetFromCallFrameHeader):
+        (JSC::CTI::emitPutResult):
+        (JSC::CTI::emitDebugExceptionCheck):
+        (JSC::CTI::emitJumpSlowCaseIfNotImm):
+        (JSC::CTI::emitJumpSlowCaseIfNotImms):
+        (JSC::CTI::emitFastArithDeTagImmediate):
+        (JSC::CTI::emitFastArithReTagImmediate):
+        (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
+        (JSC::CTI::emitFastArithImmToInt):
+        (JSC::CTI::emitFastArithIntToImmOrSlowCase):
+        (JSC::CTI::emitFastArithIntToImmNoCheck):
+        (JSC::CTI::compileOpCall):
+        (JSC::CTI::emitSlowScriptCheck):
+        (JSC::CTI::privateCompileMainPass):
+        (JSC::CTI::privateCompileSlowCases):
+        (JSC::CTI::privateCompile):
+        (JSC::CTI::privateCompileGetByIdSelf):
+        (JSC::CTI::privateCompileGetByIdProto):
+        (JSC::CTI::privateCompileGetByIdChain):
+        (JSC::CTI::privateCompilePutByIdReplace):
+        (JSC::CTI::privateArrayLengthTrampoline):
+        (JSC::CTI::privateStringLengthTrampoline):
+        (JSC::CTI::compileRegExp):
+        * VM/CTI.h:
+        (JSC::CallRecord::CallRecord):
+        (JSC::JmpTable::JmpTable):
+        (JSC::SlowCaseEntry::SlowCaseEntry):
+        (JSC::CTI::JSRInfo::JSRInfo):
+        * masm/MacroAssembler.h: Removed.
+        * masm/MacroAssemblerWin.cpp: Removed.
+        * masm/X86Assembler.h:
+        (JSC::X86Assembler::emitConvertToFastCall):
+        (JSC::X86Assembler::emitRestoreArgumentReference):
+        * wrec/WREC.h:
+        (JSC::WRECGenerator::WRECGenerator):
+        (JSC::WRECParser::WRECParser):
+
 2008-09-09  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Cameron Zwarich.
index d90dd7f..049597c 100644 (file)
                                RelativePath="..\..\masm\X86Assembler.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\masm\MacroAssembler.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\masm\MacroAssemblerWin.cpp"\r
-                               >\r
-                       </File>\r
                </Filter>\r
                <Filter\r
                        Name="wrec"\r
index c28e86d..0599af1 100644 (file)
                A72701B60DADE94900E548D7 /* ExceptionHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72701B40DADE94900E548D7 /* ExceptionHelpers.cpp */; };
                A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
                A727FF6B0DA3092200E548D7 /* JSPropertyNameIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */; };
-               A763F79D0E70E0FE00BC151E /* MacroAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = A763F79C0E70E0FE00BC151E /* MacroAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A7C31DAA0DBEBA4300FDF8EB /* SegmentedVector.h in Headers */ = {isa = PBXBuildFile; fileRef = A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */; };
                BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; };
                BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; };
                A72701B40DADE94900E548D7 /* ExceptionHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExceptionHelpers.cpp; path = VM/ExceptionHelpers.cpp; sourceTree = "<group>"; };
                A727FF650DA3053B00E548D7 /* JSPropertyNameIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSPropertyNameIterator.h; path = VM/JSPropertyNameIterator.h; sourceTree = "<group>"; };
                A727FF660DA3053B00E548D7 /* JSPropertyNameIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSPropertyNameIterator.cpp; path = VM/JSPropertyNameIterator.cpp; sourceTree = "<group>"; };
-               A763F79C0E70E0FE00BC151E /* MacroAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssembler.h; sourceTree = "<group>"; };
                A7C31DA80DBEBA4300FDF8EB /* SegmentedVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SegmentedVector.h; path = VM/SegmentedVector.h; sourceTree = "<group>"; };
                A7E42C180E3938830065A544 /* JSStaticScopeObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStaticScopeObject.h; sourceTree = "<group>"; };
                A7E42C190E3938830065A544 /* JSStaticScopeObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStaticScopeObject.cpp; sourceTree = "<group>"; };
                8690813F0E640C89000D36ED /* masm */ = {
                        isa = PBXGroup;
                        children = (
-                               A763F79C0E70E0FE00BC151E /* MacroAssembler.h */,
                                869081400E640C89000D36ED /* X86Assembler.h */,
                        );
                        path = masm;
                                869083160E6518D7000D36ED /* WREC.h in Headers */,
                                933040040E6A749400786E6A /* SmallStrings.h in Headers */,
                                BCDE3AB80E6C82F5001453A7 /* StructureID.h in Headers */,
-                               A763F79D0E70E0FE00BC151E /* MacroAssembler.h in Headers */,
                                147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
                                147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
                        );
index f2e76c4..2a9c9d9 100644 (file)
@@ -107,7 +107,7 @@ extern "C"
 
 
 // get arg puts an arg from the SF register array into a h/w register
-ALWAYS_INLINE void CTI::emitGetArg(unsigned src, MacroAssembler::RegisterID dst)
+ALWAYS_INLINE void CTI::emitGetArg(unsigned src, X86Assembler::RegisterID dst)
 {
     // TODO: we want to reuse values that are already in registers if we can - add a register allocator!
     if (src < m_codeBlock->constantRegisters.size()) {
@@ -118,7 +118,7 @@ ALWAYS_INLINE void CTI::emitGetArg(unsigned src, MacroAssembler::RegisterID dst)
 }
 
 // get arg puts an arg from the SF register array onto the stack, as an arg to a context threaded function.
-ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, MacroAssembler::RegisterID scratch)
+ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch)
 {
     if (src < m_codeBlock->constantRegisters.size()) {
         JSValue* js = m_codeBlock->constantRegisters[src].jsValue(m_exec);
@@ -130,7 +130,7 @@ ALWAYS_INLINE void CTI::emitGetPutArg(unsigned src, unsigned offset, MacroAssemb
 }
 
 // puts an arg onto the stack, as an arg to a context threaded function.
-ALWAYS_INLINE void CTI::emitPutArg(MacroAssembler::RegisterID src, unsigned offset)
+ALWAYS_INLINE void CTI::emitPutArg(X86Assembler::RegisterID src, unsigned offset)
 {
     m_jit.movl_rm(src, offset + sizeof(void*), X86::esp);
 }
@@ -149,27 +149,27 @@ ALWAYS_INLINE JSValue* CTI::getConstantImmediateNumericArg(unsigned src)
     return 0;
 }
 
-ALWAYS_INLINE void CTI::emitPutCTIParam(MacroAssembler::RegisterID from, unsigned name)
+ALWAYS_INLINE void CTI::emitPutCTIParam(X86Assembler::RegisterID from, unsigned name)
 {
     m_jit.movl_rm(from, name * sizeof(void*), X86::esp);
 }
 
-ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, MacroAssembler::RegisterID to)
+ALWAYS_INLINE void CTI::emitGetCTIParam(unsigned name, X86Assembler::RegisterID to)
 {
     m_jit.movl_mr(name * sizeof(void*), X86::esp, to);
 }
 
-ALWAYS_INLINE void CTI::emitPutToCallFrameHeader(MacroAssembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry)
+ALWAYS_INLINE void CTI::emitPutToCallFrameHeader(X86Assembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry)
 {
     m_jit.movl_rm(from, -((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), X86::edi);
 }
 
-ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, MacroAssembler::RegisterID to)
+ALWAYS_INLINE void CTI::emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, X86Assembler::RegisterID to)
 {
     m_jit.movl_mr(-((m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) - entry) * sizeof(Register), X86::edi, to);
 }
 
-ALWAYS_INLINE void CTI::emitPutResult(unsigned dst, MacroAssembler::RegisterID from)
+ALWAYS_INLINE void CTI::emitPutResult(unsigned dst, X86Assembler::RegisterID from)
 {
     m_jit.movl_rm(from, dst * sizeof(Register), X86::edi);
     // FIXME: #ifndef NDEBUG, Write the correct m_type to the register.
@@ -201,7 +201,7 @@ ALWAYS_INLINE void CTI::emitDebugExceptionCheck()
 {
     emitGetCTIParam(CTI_ARGS_exec, X86::ecx);
     m_jit.cmpl_i32m(0, OBJECT_OFFSET(ExecState, m_exception), X86::ecx);
-    MacroAssembler::JmpSrc noException = m_jit.emitUnlinkedJe();
+    X86Assembler::JmpSrc noException = m_jit.emitUnlinkedJe();
     m_jit.emitInt3();
     m_jit.link(noException, m_jit.label());
 }
@@ -302,13 +302,13 @@ ALWAYS_INLINE void CTI::emitCall(unsigned opcodeIndex, CTIHelper_s helper)
 #endif
 }
 
-ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImm(MacroAssembler::RegisterID reg, unsigned opcodeIndex)
+ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImm(X86Assembler::RegisterID reg, unsigned opcodeIndex)
 {
     m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, reg);
     m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), opcodeIndex));
 }
 
-ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImms(MacroAssembler::RegisterID reg1, MacroAssembler::RegisterID reg2, unsigned opcodeIndex)
+ALWAYS_INLINE void CTI::emitJumpSlowCaseIfNotImms(X86Assembler::RegisterID reg1, X86Assembler::RegisterID reg2, unsigned opcodeIndex)
 {
     m_jit.movl_rr(reg1, X86::ecx);
     m_jit.andl_rr(reg2, X86::ecx);
@@ -321,35 +321,35 @@ ALWAYS_INLINE unsigned CTI::getDeTaggedConstantImmediate(JSValue* imm)
     return reinterpret_cast<unsigned>(imm) & ~JSImmediate::TagBitTypeInteger;
 }
 
-ALWAYS_INLINE void CTI::emitFastArithDeTagImmediate(MacroAssembler::RegisterID reg)
+ALWAYS_INLINE void CTI::emitFastArithDeTagImmediate(X86Assembler::RegisterID reg)
 {
     // op_mod relies on this being a sub - setting zf if result is 0.
     m_jit.subl_i8r(JSImmediate::TagBitTypeInteger, reg);
 }
 
-ALWAYS_INLINE void CTI::emitFastArithReTagImmediate(MacroAssembler::RegisterID reg)
+ALWAYS_INLINE void CTI::emitFastArithReTagImmediate(X86Assembler::RegisterID reg)
 {
     m_jit.addl_i8r(JSImmediate::TagBitTypeInteger, reg);
 }
 
-ALWAYS_INLINE void CTI::emitFastArithPotentiallyReTagImmediate(MacroAssembler::RegisterID reg)
+ALWAYS_INLINE void CTI::emitFastArithPotentiallyReTagImmediate(X86Assembler::RegisterID reg)
 {
     m_jit.orl_rr(JSImmediate::TagBitTypeInteger, reg);
 }
 
-ALWAYS_INLINE void CTI::emitFastArithImmToInt(MacroAssembler::RegisterID reg)
+ALWAYS_INLINE void CTI::emitFastArithImmToInt(X86Assembler::RegisterID reg)
 {
     m_jit.sarl_i8r(1, reg);
 }
 
-ALWAYS_INLINE void CTI::emitFastArithIntToImmOrSlowCase(MacroAssembler::RegisterID reg, unsigned opcodeIndex)
+ALWAYS_INLINE void CTI::emitFastArithIntToImmOrSlowCase(X86Assembler::RegisterID reg, unsigned opcodeIndex)
 {
     m_jit.addl_rr(reg, reg);
     m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJo(), opcodeIndex));
     emitFastArithReTagImmediate(reg);
 }
 
-ALWAYS_INLINE void CTI::emitFastArithIntToImmNoCheck(MacroAssembler::RegisterID reg)
+ALWAYS_INLINE void CTI::emitFastArithIntToImmNoCheck(X86Assembler::RegisterID reg)
 {
     m_jit.addl_rr(reg, reg);
     emitFastArithReTagImmediate(reg);
@@ -396,7 +396,7 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
             emitGetPutArg(thisVal, 4, X86::ecx);
     }
 
-    MacroAssembler::JmpSrc wasEval;
+    X86Assembler::JmpSrc wasEval;
     if (type == OpCallEval) {
         emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
         emitCall(i, Machine::cti_op_call_eval);
@@ -417,16 +417,16 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
 
     // Fast check for JS function.
     m_jit.testl_i32r(JSImmediate::TagMask, X86::ecx);
-    MacroAssembler::JmpSrc isNotObject = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc isNotObject = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsFunctionVptr), X86::ecx);
-    MacroAssembler::JmpSrc isJSFunction = m_jit.emitUnlinkedJe();
+    X86Assembler::JmpSrc isJSFunction = m_jit.emitUnlinkedJe();
     m_jit.link(isNotObject, m_jit.label());
 
     // This handles host functions
     emitCall(i, ((type == OpConstruct) ? Machine::cti_op_construct_NotJSConstruct : Machine::cti_op_call_NotJSFunction));
     emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     
-    MacroAssembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp();
+    X86Assembler::JmpSrc wasNotJSFunction = m_jit.emitUnlinkedJmp();
     m_jit.link(isJSFunction, m_jit.label());
 
     // This handles JSFunctions
@@ -434,7 +434,7 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
     m_jit.call_r(X86::eax);
     emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
 
-    MacroAssembler::JmpDst end = m_jit.label();
+    X86Assembler::JmpDst end = m_jit.label();
     m_jit.link(wasNotJSFunction, end);
     if (type == OpCallEval)
         m_jit.link(wasEval, end);
@@ -445,7 +445,7 @@ void CTI::compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType
 void CTI::emitSlowScriptCheck(unsigned opcodeIndex)
 {
     m_jit.subl_i8r(1, X86::esi);
-    MacroAssembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc skipTimeout = m_jit.emitUnlinkedJne();
     emitCall(opcodeIndex, Machine::cti_timeout_check);
 
     emitGetCTIParam(CTI_ARGS_exec, X86::ecx);
@@ -754,7 +754,7 @@ void CTI::privateCompileMainPass()
             emitGetArg(instruction[i + 1].u.operand, X86::eax);
 
             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
-            MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
+            X86Assembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target));
 
@@ -838,7 +838,7 @@ void CTI::privateCompileMainPass()
             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
-            MacroAssembler::JmpSrc isNonZero = m_jit.emitUnlinkedJne();
+            X86Assembler::JmpSrc isNonZero = m_jit.emitUnlinkedJne();
 
             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::falseImmediate()), X86::eax);
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJe(), i + 2 + target));
@@ -872,9 +872,9 @@ void CTI::privateCompileMainPass()
             int retAddrDst = instruction[i + 1].u.operand;
             int target = instruction[i + 2].u.operand;
             m_jit.movl_i32m(0, sizeof(Register) * retAddrDst, X86::edi);
-            MacroAssembler::JmpDst addrPosition = m_jit.label();
+            X86Assembler::JmpDst addrPosition = m_jit.label();
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 2 + target));
-            MacroAssembler::JmpDst sretTarget = m_jit.label();
+            X86Assembler::JmpDst sretTarget = m_jit.label();
             m_jsrSites.append(JSRInfo(addrPosition, sretTarget));
             i += 3;
             break;
@@ -981,7 +981,7 @@ void CTI::privateCompileMainPass()
             emitGetArg(instruction[i + 1].u.operand, X86::eax);
 
             m_jit.cmpl_i32r(reinterpret_cast<uint32_t>(JSImmediate::zeroImmediate()), X86::eax);
-            MacroAssembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
+            X86Assembler::JmpSrc isZero = m_jit.emitUnlinkedJe();
             m_jit.testl_i32r(JSImmediate::TagBitTypeInteger, X86::eax);
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJne(), i + 2 + target));
 
@@ -1063,7 +1063,7 @@ void CTI::privateCompileMainPass()
             unsigned target = instruction[i + 3].u.operand;
             emitCall(i, Machine::cti_op_next_pname);
             m_jit.testl_rr(X86::eax, X86::eax);
-            MacroAssembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe();
+            X86Assembler::JmpSrc endOfIter = m_jit.emitUnlinkedJe();
             emitPutResult(instruction[i + 1].u.operand);
             m_jmpTable.append(JmpTable(m_jit.emitUnlinkedJmp(), i + 3 + target));
             m_jit.link(endOfIter, m_jit.label());
@@ -1283,7 +1283,7 @@ void CTI::privateCompileSlowCases()
             if (src2 < m_codeBlock->constantRegisters.size()) {
                 JSValue* value = m_codeBlock->constantRegisters[src2].jsValue(m_exec);
                 if (JSImmediate::isNumber(value)) {
-                    MacroAssembler::JmpSrc notImm = iter->from;
+                    X86Assembler::JmpSrc notImm = iter->from;
                     m_jit.link((++iter)->from, m_jit.label());
                     m_jit.subl_i32r(getDeTaggedConstantImmediate(value), X86::eax);
                     m_jit.link(notImm, m_jit.label());
@@ -1298,7 +1298,7 @@ void CTI::privateCompileSlowCases()
 
             ASSERT(!(static_cast<unsigned>(instruction[i + 2].u.operand) < m_codeBlock->constantRegisters.size()));
 
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.subl_rr(X86::edx, X86::eax);
             emitFastArithReTagImmediate(X86::eax);
@@ -1311,7 +1311,7 @@ void CTI::privateCompileSlowCases()
             break;
         }
         case op_get_by_val: {
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.link((++iter)->from, m_jit.label());
@@ -1325,7 +1325,7 @@ void CTI::privateCompileSlowCases()
             break;
         }
         case op_sub: {
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.addl_rr(X86::edx, X86::eax);
             m_jit.link(notImm, m_jit.label());
@@ -1347,8 +1347,8 @@ void CTI::privateCompileSlowCases()
             break;
         }
         case op_lshift: {
-            MacroAssembler::JmpSrc notImm1 = iter->from;
-            MacroAssembler::JmpSrc notImm2 = (++iter)->from;
+            X86Assembler::JmpSrc notImm1 = iter->from;
+            X86Assembler::JmpSrc notImm2 = (++iter)->from;
             m_jit.link((++iter)->from, m_jit.label());
             emitGetArg(instruction[i + 2].u.operand, X86::eax);
             emitGetArg(instruction[i + 3].u.operand, X86::ecx);
@@ -1387,7 +1387,7 @@ void CTI::privateCompileSlowCases()
         }
         case op_pre_inc: {
             unsigned srcDst = instruction[i + 1].u.operand;
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.subl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
             m_jit.link(notImm, m_jit.label());
@@ -1398,7 +1398,7 @@ void CTI::privateCompileSlowCases()
             break;
         }
         case op_put_by_val: {
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.link((++iter)->from, m_jit.label());
@@ -1425,7 +1425,7 @@ void CTI::privateCompileSlowCases()
         }
         case op_pre_dec: {
             unsigned srcDst = instruction[i + 1].u.operand;
-            MacroAssembler::JmpSrc notImm = iter->from;
+            X86Assembler::JmpSrc notImm = iter->from;
             m_jit.link((++iter)->from, m_jit.label());
             m_jit.addl_i8r(getDeTaggedConstantImmediate(JSImmediate::oneImmediate()), X86::eax);
             m_jit.link(notImm, m_jit.label());
@@ -1563,8 +1563,8 @@ void CTI::privateCompileSlowCases()
             break;
         }
         case op_mod: {
-            MacroAssembler::JmpSrc notImm1 = iter->from;
-            MacroAssembler::JmpSrc notImm2 = (++iter)->from;
+            X86Assembler::JmpSrc notImm1 = iter->from;
+            X86Assembler::JmpSrc notImm2 = (++iter)->from;
             m_jit.link((++iter)->from, m_jit.label());
             emitFastArithReTagImmediate(X86::eax);
             emitFastArithReTagImmediate(X86::ecx);
@@ -1637,13 +1637,13 @@ void CTI::privateCompile()
     // could be faster if we could do something like this:
     // m_codeBlock->ctiReturnAddressVPCMap.grow(m_calls.size());
     for (Vector<CallRecord>::iterator iter = m_calls.begin(); iter != m_calls.end(); ++iter) {
-        MacroAssembler::link(code, iter->from, iter->to);
+        X86Assembler::link(code, iter->from, iter->to);
         m_codeBlock->ctiReturnAddressVPCMap.add(m_jit.getRelocatedAddress(code, iter->from), iter->opcodeIndex);
     }
 
     // Link absolute addresses for jsr
     for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter)
-        MacroAssembler::linkAbsoluteAddress(code, iter->addrPosition, iter->target);
+        X86Assembler::linkAbsoluteAddress(code, iter->addrPosition, iter->target);
 
     m_codeBlock->ctiCode = code;
 }
@@ -1652,9 +1652,9 @@ void* CTI::privateCompileGetByIdSelf(StructureID* structureID, size_t cachedOffs
 {
     // Check eax is an object of the right StructureID.
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
-    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
-    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
 
     // Checks out okay! - getDirectOffset
     m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
@@ -1664,8 +1664,8 @@ void* CTI::privateCompileGetByIdSelf(StructureID* structureID, size_t cachedOffs
     void* code = m_jit.copy();
     ASSERT(code);
 
-    MacroAssembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
     
     m_codeBlock->structureIDAccessStubs.append(code);
     
@@ -1682,14 +1682,14 @@ void* CTI::privateCompileGetByIdProto(StructureID* structureID, StructureID* pro
 
     // check eax is an object of the right StructureID.
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
-    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
-    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
 
     // Check the prototype object's StructureID had not changed.
     StructureID** protoStructureIDAddress = &(protoObject->m_structureID);
     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(prototypeStructureID), static_cast<void*>(protoStructureIDAddress));
-    MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJne();
 
     // Checks out okay! - getDirectOffset
     m_jit.movl_mr(cachedOffset * sizeof(JSValue*), X86::edx, X86::eax);
@@ -1699,9 +1699,9 @@ void* CTI::privateCompileGetByIdProto(StructureID* structureID, StructureID* pro
     void* code = m_jit.copy();
     ASSERT(code);
 
-    MacroAssembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
 
     m_codeBlock->structureIDAccessStubs.append(code);
 
@@ -1712,7 +1712,7 @@ void* CTI::privateCompileGetByIdChain(StructureID* structureID, StructureIDChain
 {
     ASSERT(count);
     
-    Vector<MacroAssembler::JmpSrc> bucketsOfFail;
+    Vector<X86Assembler::JmpSrc> bucketsOfFail;
 
     // Check eax is an object of the right StructureID.
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
@@ -1745,7 +1745,7 @@ void* CTI::privateCompileGetByIdChain(StructureID* structureID, StructureIDChain
     ASSERT(code);
 
     for (unsigned i = 0; i < bucketsOfFail.size(); ++i)
-        MacroAssembler::link(code, bucketsOfFail[i], reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+        X86Assembler::link(code, bucketsOfFail[i], reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
     m_codeBlock->structureIDAccessStubs.append(code);
     return code;
 }
@@ -1754,9 +1754,9 @@ void* CTI::privateCompilePutByIdReplace(StructureID* structureID, size_t cachedO
 {
     // check eax is an object of the right StructureID.
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
-    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<uint32_t>(structureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax);
-    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
 
     // checks out okay! - putDirectOffset
     m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax);
@@ -1766,8 +1766,8 @@ void* CTI::privateCompilePutByIdReplace(StructureID* structureID, size_t cachedO
     void* code = m_jit.copy();
     ASSERT(code);
     
-    MacroAssembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_put_by_id_fail));
-    MacroAssembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_put_by_id_fail));
+    X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_put_by_id_fail));
+    X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_put_by_id_fail));
 
     m_codeBlock->structureIDAccessStubs.append(code);
     
@@ -1778,16 +1778,16 @@ void* CTI::privateArrayLengthTrampoline()
 {
     // Check eax is an array
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
-    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsArrayVptr), X86::eax);
-    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
 
     // Checks out okay! - get the length from the storage
     m_jit.movl_mr(OBJECT_OFFSET(JSArray, m_storage), X86::eax, X86::eax);
     m_jit.movl_mr(OBJECT_OFFSET(ArrayStorage, m_length), X86::eax, X86::eax);
 
     m_jit.addl_rr(X86::eax, X86::eax);
-    MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
+    X86Assembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
     m_jit.addl_i8r(1, X86::eax);
     
     m_jit.ret();
@@ -1795,9 +1795,9 @@ void* CTI::privateArrayLengthTrampoline()
     void* code = m_jit.copy();
     ASSERT(code);
 
-    MacroAssembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
     
     return code;
 }
@@ -1806,16 +1806,16 @@ void* CTI::privateStringLengthTrampoline()
 {
     // Check eax is a string
     m_jit.testl_i32r(JSImmediate::TagMask, X86::eax);
-    MacroAssembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases1 = m_jit.emitUnlinkedJne();
     m_jit.cmpl_i32m(reinterpret_cast<unsigned>(m_machine->m_jsStringVptr), X86::eax);
-    MacroAssembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
+    X86Assembler::JmpSrc failureCases2 = m_jit.emitUnlinkedJne();
 
     // Checks out okay! - get the length from the Ustring.
     m_jit.movl_mr(OBJECT_OFFSET(JSString, m_value) + OBJECT_OFFSET(UString, m_rep), X86::eax, X86::eax);
     m_jit.movl_mr(OBJECT_OFFSET(UString::Rep, len), X86::eax, X86::eax);
 
     m_jit.addl_rr(X86::eax, X86::eax);
-    MacroAssembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
+    X86Assembler::JmpSrc failureCases3 = m_jit.emitUnlinkedJo();
     m_jit.addl_i8r(1, X86::eax);
     
     m_jit.ret();
@@ -1823,9 +1823,9 @@ void* CTI::privateStringLengthTrampoline()
     void* code = m_jit.copy();
     ASSERT(code);
 
-    MacroAssembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
-    MacroAssembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases1, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases2, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
+    X86Assembler::link(code, failureCases3, reinterpret_cast<void*>(Machine::cti_op_get_by_id_fail));
 
     return code;
 }
@@ -1840,7 +1840,7 @@ void* CTI::compileRegExp(ExecState* exec, const UString& pattern, unsigned* numS
         return 0;
     }
 
-    MacroAssembler jit(exec->machine()->jitCodeBuffer());
+    X86Assembler jit(exec->machine()->jitCodeBuffer());
     WRECParser parser(pattern, ignoreCase, multiline, jit);
     
     jit.emitConvertToFastCall();
index ba22357..c188a30 100644 (file)
@@ -32,7 +32,7 @@
 #include "Opcode.h"
 #include "RegisterFile.h"
 #include "RegisterFile.h"
-#include <masm/MacroAssembler.h>
+#include <masm/X86Assembler.h>
 #include <profiler/Profiler.h>
 #include <wtf/AlwaysInline.h>
 #include <wtf/Vector.h>
@@ -114,7 +114,7 @@ namespace JSC {
     extern OpcodeID what;
 
     struct CallRecord {
-        MacroAssembler::JmpSrc from;
+        X86Assembler::JmpSrc from;
         void* to;
         unsigned opcodeIndex;
 
@@ -122,35 +122,35 @@ namespace JSC {
         {
         }
 
-        CallRecord(MacroAssembler::JmpSrc f, CTIHelper_j t, unsigned i)
+        CallRecord(X86Assembler::JmpSrc f, CTIHelper_j t, unsigned i)
             : from(f)
             , to((void*)t)
             , opcodeIndex(i)
         {
         }
 
-        CallRecord(MacroAssembler::JmpSrc f, CTIHelper_p t, unsigned i)
+        CallRecord(X86Assembler::JmpSrc f, CTIHelper_p t, unsigned i)
             : from(f)
             , to((void*)t)
             , opcodeIndex(i)
         {
         }
         
-        CallRecord(MacroAssembler::JmpSrc f, CTIHelper_v t, unsigned i)
+        CallRecord(X86Assembler::JmpSrc f, CTIHelper_v t, unsigned i)
             : from(f)
             , to((void*)t)
             , opcodeIndex(i)
         {
         }
         
-        CallRecord(MacroAssembler::JmpSrc f, CTIHelper_s t, unsigned i)
+        CallRecord(X86Assembler::JmpSrc f, CTIHelper_s t, unsigned i)
             : from(f)
             , to((void*)t)
             , opcodeIndex(i)
         {
         }
         
-        CallRecord(MacroAssembler::JmpSrc f, CTIHelper_b t, unsigned i)
+        CallRecord(X86Assembler::JmpSrc f, CTIHelper_b t, unsigned i)
             : from(f)
             , to((void*)t)
             , opcodeIndex(i)
@@ -159,10 +159,10 @@ namespace JSC {
     };
 
     struct JmpTable {
-        MacroAssembler::JmpSrc from;
+        X86Assembler::JmpSrc from;
         unsigned to;
         
-        JmpTable(MacroAssembler::JmpSrc f, unsigned t)
+        JmpTable(X86Assembler::JmpSrc f, unsigned t)
             : from(f)
             , to(t)
         {
@@ -170,11 +170,11 @@ namespace JSC {
     };
 
     struct SlowCaseEntry {
-        MacroAssembler::JmpSrc from;
+        X86Assembler::JmpSrc from;
         unsigned to;
         unsigned hint;
         
-        SlowCaseEntry(MacroAssembler::JmpSrc f, unsigned t, unsigned h = 0)
+        SlowCaseEntry(X86Assembler::JmpSrc f, unsigned t, unsigned h = 0)
             : from(f)
             , to(t)
             , hint(h)
@@ -297,30 +297,30 @@ namespace JSC {
         enum CompileOpCallType { OpCallNormal, OpCallEval, OpConstruct };
         void compileOpCall(Instruction* instruction, unsigned i, CompileOpCallType type = OpCallNormal);
 
-        void emitGetArg(unsigned src, MacroAssembler::RegisterID dst);
-        void emitGetPutArg(unsigned src, unsigned offset, MacroAssembler::RegisterID scratch);
-        void emitPutArg(MacroAssembler::RegisterID src, unsigned offset);
+        void emitGetArg(unsigned src, X86Assembler::RegisterID dst);
+        void emitGetPutArg(unsigned src, unsigned offset, X86Assembler::RegisterID scratch);
+        void emitPutArg(X86Assembler::RegisterID src, unsigned offset);
         void emitPutArgConstant(unsigned value, unsigned offset);
-        void emitPutResult(unsigned dst, MacroAssembler::RegisterID from = X86::eax);
+        void emitPutResult(unsigned dst, X86Assembler::RegisterID from = X86::eax);
 
-        void emitPutCTIParam(MacroAssembler::RegisterID from, unsigned name);
-        void emitGetCTIParam(unsigned name, MacroAssembler::RegisterID to);
+        void emitPutCTIParam(X86Assembler::RegisterID from, unsigned name);
+        void emitGetCTIParam(unsigned name, X86Assembler::RegisterID to);
 
-        void emitPutToCallFrameHeader(MacroAssembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry);
-        void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, MacroAssembler::RegisterID to);
+        void emitPutToCallFrameHeader(X86Assembler::RegisterID from, RegisterFile::CallFrameHeaderEntry entry);
+        void emitGetFromCallFrameHeader(RegisterFile::CallFrameHeaderEntry entry, X86Assembler::RegisterID to);
 
         JSValue* getConstantImmediateNumericArg(unsigned src);
         unsigned getDeTaggedConstantImmediate(JSValue* imm);
 
-        void emitJumpSlowCaseIfNotImm(MacroAssembler::RegisterID, unsigned opcodeIndex);
-        void emitJumpSlowCaseIfNotImms(MacroAssembler::RegisterID, MacroAssembler::RegisterID, unsigned opcodeIndex);
+        void emitJumpSlowCaseIfNotImm(X86Assembler::RegisterID, unsigned opcodeIndex);
+        void emitJumpSlowCaseIfNotImms(X86Assembler::RegisterID, X86Assembler::RegisterID, unsigned opcodeIndex);
 
-        void emitFastArithDeTagImmediate(MacroAssembler::RegisterID);
-        void emitFastArithReTagImmediate(MacroAssembler::RegisterID);
-        void emitFastArithPotentiallyReTagImmediate(MacroAssembler::RegisterID);
-        void emitFastArithImmToInt(MacroAssembler::RegisterID);
-        void emitFastArithIntToImmOrSlowCase(MacroAssembler::RegisterID, unsigned opcodeIndex);
-        void emitFastArithIntToImmNoCheck(MacroAssembler::RegisterID);
+        void emitFastArithDeTagImmediate(X86Assembler::RegisterID);
+        void emitFastArithReTagImmediate(X86Assembler::RegisterID);
+        void emitFastArithPotentiallyReTagImmediate(X86Assembler::RegisterID);
+        void emitFastArithImmToInt(X86Assembler::RegisterID);
+        void emitFastArithIntToImmOrSlowCase(X86Assembler::RegisterID, unsigned opcodeIndex);
+        void emitFastArithIntToImmNoCheck(X86Assembler::RegisterID);
 
         void emitDebugExceptionCheck();
 
@@ -335,20 +335,20 @@ namespace JSC {
         void printOpcodeOperandTypes(unsigned src1, unsigned src2);
 #endif
 
-        MacroAssembler m_jit;
+        X86Assembler m_jit;
         Machine* m_machine;
         ExecState* m_exec;
         CodeBlock* m_codeBlock;
 
         Vector<CallRecord> m_calls;
-        Vector<MacroAssembler::JmpDst> m_labels;
+        Vector<X86Assembler::JmpDst> m_labels;
         Vector<JmpTable> m_jmpTable;
 
         struct JSRInfo {
-            MacroAssembler::JmpDst addrPosition;
-            MacroAssembler::JmpDst target;
+            X86Assembler::JmpDst addrPosition;
+            X86Assembler::JmpDst target;
 
-            JSRInfo(const MacroAssembler::JmpDst& storeLocation, const MacroAssembler::JmpDst& targetLocation)
+            JSRInfo(const X86Assembler::JmpDst& storeLocation, const X86Assembler::JmpDst& targetLocation)
                 : addrPosition(storeLocation)
                 , target(targetLocation)
             {
diff --git a/JavaScriptCore/masm/MacroAssembler.h b/JavaScriptCore/masm/MacroAssembler.h
deleted file mode 100644 (file)
index f33856c..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-
-#ifndef MACROASM_H
-#define MACROASM_H
-
-#if ENABLE(MASM) && PLATFORM(X86)
-
-#include "X86Assembler.h"
-
-#if COMPILER(GCC)
-#define WREC_CALL __attribute__ ((regparm (3)))
-#else
-#define WREC_CALL
-#endif
-
-namespace JSC {
-
-    class MacroAssembler : public X86Assembler {
-    public:
-        MacroAssembler(JITCodeBuffer* buffer)
-            : X86Assembler(buffer)
-        {
-        }
-
-#if COMPILER(MSVC)
-        void emitConvertToFastCall();
-        void emitRestoreArgumentReference();
-#else
-        void emitConvertToFastCall() {};
-        void emitRestoreArgumentReference() {};
-#endif
-        
-    };
-}
-
-#endif
-
-#endif
diff --git a/JavaScriptCore/masm/MacroAssemblerWin.cpp b/JavaScriptCore/masm/MacroAssemblerWin.cpp
deleted file mode 100644 (file)
index 29bd1ce..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-
-#include "config.h"
-#include "MacroAssembler.h"
-
-#if ENABLE(MASM) && PLATFORM(X86)
-
-namespace JSC {
-
-void MacroAssembler::emitConvertToFastCall()
-{
-    movl_mr(4, X86::esp, X86::eax);
-    movl_mr(8, X86::esp, X86::edx);
-    movl_mr(12, X86::esp, X86::ecx);
-}
-
-void MacroAssembler::emitRestoreArgumentReference()
-{
-    movl_rm(X86::esp, 0, X86::esp);
-}
-
-}
-
-#endif
index 5dc9d6e..8a53f28 100644 (file)
@@ -778,6 +778,23 @@ public:
         return m_buffer->copy();
     }
 
+#if COMPILER(MSVC)
+    void emitConvertToFastCall()
+    {
+        movl_mr(4, X86::esp, X86::eax);
+        movl_mr(8, X86::esp, X86::edx);
+        movl_mr(12, X86::esp, X86::ecx);
+    }
+
+    void emitRestoreArgumentReference()
+    {
+        movl_rm(X86::esp, 0, X86::esp);
+    }
+#else
+    void emitConvertToFastCall() {};
+    void emitRestoreArgumentReference() {};
+#endif
+
 private:
     void emitModRm_rr(RegisterID reg, RegisterID rm)
     {
index bc4edc7..9f42786 100644 (file)
 #if ENABLE(WREC)
 
 #include "ustring.h"
-#include <masm/MacroAssembler.h>
+#include <masm/X86Assembler.h>
 #include <wtf/ASCIICType.h>
 #include <wtf/Vector.h>
 
+#if COMPILER(GCC)
+#define WREC_CALL __attribute__ ((regparm (3)))
+#else
+#define WREC_CALL
+#endif
+
 namespace JSC {
 
     typedef int (*WRECFunction)(const UChar* input, unsigned start, unsigned length, int* output) WREC_CALL;
@@ -72,18 +78,18 @@ namespace JSC {
 
     class WRECParser;
 
-    typedef Vector<MacroAssembler::JmpSrc> JmpSrcVector;
+    typedef Vector<X86Assembler::JmpSrc> JmpSrcVector;
 
     class WRECGenerator {
     public:
-        WRECGenerator(WRECParser& parser, MacroAssembler& jit)
+        WRECGenerator(WRECParser& parser, X86Assembler& jit)
             : m_parser(parser)
             , m_jit(jit)
         {
         }
 
-        typedef MacroAssembler::JmpSrc JmpSrc;
-        typedef MacroAssembler::JmpDst JmpDst;
+        typedef X86Assembler::JmpSrc JmpSrc;
+        typedef X86Assembler::JmpDst JmpDst;
 
         // these regs setup by the params
         static const X86Assembler::RegisterID inputRegister = X86::eax;
@@ -122,7 +128,7 @@ namespace JSC {
 
     private:
         WRECParser& m_parser;
-        MacroAssembler& m_jit;
+        X86Assembler& m_jit;
     };
 
     class WRECParser {
@@ -141,7 +147,7 @@ namespace JSC {
             TempError_unsupportedParentheses,
         } m_err;
 
-        WRECParser(const UString& pattern, bool ignoreCase, bool multiline, MacroAssembler& jit)
+        WRECParser(const UString& pattern, bool ignoreCase, bool multiline, X86Assembler& jit)
             : m_ignoreCase(ignoreCase)
             , m_multiline(multiline)
             , m_numSubpatterns(0)
index fded3d4..fdc2c84 100644 (file)
@@ -1,3 +1,17 @@
+2008-09-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
+
+        Reviewed by Maciej Stachowiak.
+
+        Bug 20759: Remove MacroAssembler
+        <https://bugs.webkit.org/show_bug.cgi?id=20759>
+
+        Make the necessary changes to ForwardingHeaders to remove
+        MacroAssembler.
+
+        * ForwardingHeaders/masm/IA32MacroAsm.h: Removed.
+        * ForwardingHeaders/masm/MacroAssembler.h: Removed.
+        * ForwardingHeaders/masm/X86Assembler.h: Added.
+
 2008-09-09  Alp Toker  <alp@nuanti.com>
 
         Reviewed by Dave Hyatt.
diff --git a/WebCore/ForwardingHeaders/masm/IA32MacroAsm.h b/WebCore/ForwardingHeaders/masm/IA32MacroAsm.h
deleted file mode 100644 (file)
index c660786..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/IA32MacroAsm.h>
diff --git a/WebCore/ForwardingHeaders/masm/MacroAssembler.h b/WebCore/ForwardingHeaders/masm/MacroAssembler.h
deleted file mode 100644 (file)
index c8428be..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/MacroAssembler.h>\r
diff --git a/WebCore/ForwardingHeaders/masm/X86Assembler.h b/WebCore/ForwardingHeaders/masm/X86Assembler.h
new file mode 100644 (file)
index 0000000..e1f0b4d
--- /dev/null
@@ -0,0 +1 @@
+#include <JavaScriptCore/X86Assembler.h>