Changeset 151250 in webkit
- Timestamp:
- Jun 5, 2013 7:13:34 PM (11 years ago)
- Location:
- branches/dfgFourthTier/Source/JavaScriptCore
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dfgFourthTier/Source/JavaScriptCore/ChangeLog
r151229 r151250 1 2013-06-05 Mark Lam <mark.lam@apple.com> 2 3 Disambiguate between CallFrame bytecodeOffset and codeOriginIndex. 4 https://bugs.webkit.org/show_bug.cgi?id=117262. 5 6 Reviewed by Geoffrey Garen. 7 8 When writing to the ArgumentCount tag in CallFrame, we will set the high 9 bit if the written value is a codeOriginIndex. 10 11 * GNUmakefile.list.am: 12 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 13 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: 14 * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: 15 * JavaScriptCore.xcodeproj/project.pbxproj: 16 * bytecode/CodeOrigin.h: 17 (CodeOrigin): 18 (JSC::CodeOrigin::isHandle): 19 (JSC::CodeOrigin::encodeHandle): 20 (JSC::CodeOrigin::decodeHandle): 21 * dfg/DFGJITCompiler.h: 22 (JSC::DFG::JITCompiler::beginCall): 23 * dfg/DFGRepatch.cpp: 24 (JSC::DFG::tryBuildGetByIDList): 25 * interpreter/CallFrame.cpp: 26 (JSC::CallFrame::locationAsBytecodeOffset): 27 (JSC::CallFrame::setLocationAsBytecodeOffset): 28 (JSC::CallFrame::currentVPC): 29 (JSC::CallFrame::setCurrentVPC): 30 (JSC::CallFrame::trueCallFrame): 31 * interpreter/CallFrame.h: 32 (ExecState): 33 (JSC::ExecState::inlineCallFrame): 34 * interpreter/CallFrameInlines.h: Added. 35 (JSC::CallFrame::hasLocationAsBytecodeOffset): 36 (JSC::CallFrame::hasLocationAsCodeOriginIndex): 37 (JSC::CallFrame::locationAsRawBits): 38 (JSC::CallFrame::setLocationAsRawBits): 39 (JSC::CallFrame::locationAsBytecodeOffset): 40 (JSC::CallFrame::setLocationAsBytecodeOffset): 41 (JSC::CallFrame::locationAsCodeOriginIndex): 42 * interpreter/Interpreter.cpp: 43 (JSC::getBytecodeOffsetForCallFrame): 44 (JSC::getCallerInfo): 45 * jit/JITStubs.cpp: 46 (JSC::DEFINE_STUB_FUNCTION): 47 1 48 2013-06-04 Filip Pizlo <fpizlo@apple.com> 2 49 -
branches/dfgFourthTier/Source/JavaScriptCore/GNUmakefile.list.am
r151155 r151250 430 430 Source/JavaScriptCore/interpreter/CallFrame.cpp \ 431 431 Source/JavaScriptCore/interpreter/CallFrame.h \ 432 Source/JavaScriptCore/interpreter/CallFrameInlines.h \ 432 433 Source/JavaScriptCore/interpreter/Interpreter.cpp \ 433 434 Source/JavaScriptCore/interpreter/Interpreter.h \ -
branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r151155 r151250 2399 2399 </File> 2400 2400 <File 2401 RelativePath="..\..\interpreter\CallFrameInlines.h" 2402 > 2403 </File> 2404 <File 2401 2405 RelativePath="..\..\interpreter\CallFrameClosure.h" 2402 2406 > -
branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
r151155 r151250 550 550 <ClInclude Include="..\interpreter\CachedCall.h" /> 551 551 <ClInclude Include="..\interpreter\CallFrame.h" /> 552 <ClInclude Include="..\interpreter\CallFrameInlines.h" /> 552 553 <ClInclude Include="..\interpreter\CallFrameClosure.h" /> 553 554 <ClInclude Include="..\interpreter\Interpreter.h" /> -
branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
r151155 r151250 1197 1197 <Filter>interpreter</Filter> 1198 1198 </ClInclude> 1199 <ClInclude Include="..\interpreter\CallFrameInlines.h"> 1200 <Filter>interpreter</Filter> 1201 </ClInclude> 1199 1202 <ClInclude Include="..\interpreter\CallFrameClosure.h"> 1200 1203 <Filter>interpreter</Filter> -
branches/dfgFourthTier/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r151155 r151250 952 952 FE20CE9D15F04A9500DF3430 /* LLIntCLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */; }; 953 953 FE20CE9E15F04A9500DF3430 /* LLIntCLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */; settings = {ATTRIBUTES = (Private, ); }; }; 954 FE24596217601D580074FCE0 /* CallFrameInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = FE24596117601D580074FCE0 /* CallFrameInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 954 955 FE4A331F15BD2E07006F54F3 /* VMInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */; }; 955 956 FE4A332015BD2E07006F54F3 /* VMInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4A331E15BD2E07006F54F3 /* VMInspector.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 957 958 FECE74571745456500FF9300 /* MacroAssemblerX86Common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FECE74561745456500FF9300 /* MacroAssemblerX86Common.cpp */; }; 958 959 FED287B215EC9A5700DA8161 /* LLIntOpcode.h in Headers */ = {isa = PBXBuildFile; fileRef = FED287B115EC9A5700DA8161 /* LLIntOpcode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 960 FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; }; 961 FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); }; }; 962 FED94F30171E3E2300BE77A4 /* WatchdogMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */; }; 959 963 FEE3147D174AACAF0013BCAC /* MacroAssemblerARMv7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FEE3147C174AACAF0013BCAC /* MacroAssemblerARMv7.cpp */; }; 960 964 FEF6835E174343CC00A32E25 /* JITStubsARM.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835A174343CC00A32E25 /* JITStubsARM.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 962 966 FEF68360174343CC00A32E25 /* JITStubsX86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */; settings = {ATTRIBUTES = (Private, ); }; }; 963 967 FEF68361174343CC00A32E25 /* JITStubsX86.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF6835D174343CC00A32E25 /* JITStubsX86.h */; settings = {ATTRIBUTES = (Private, ); }; }; 964 FED94F2E171E3E2300BE77A4 /* Watchdog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */; };965 FED94F2F171E3E2300BE77A4 /* Watchdog.h in Headers */ = {isa = PBXBuildFile; fileRef = FED94F2C171E3E2300BE77A4 /* Watchdog.h */; settings = {ATTRIBUTES = (Private, ); };};966 FED94F30171E3E2300BE77A4 /* WatchdogMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */; };967 968 /* End PBXBuildFile section */ 968 969 … … 1987 1988 FE20CE9B15F04A9500DF3430 /* LLIntCLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLIntCLoop.cpp; path = llint/LLIntCLoop.cpp; sourceTree = "<group>"; }; 1988 1989 FE20CE9C15F04A9500DF3430 /* LLIntCLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntCLoop.h; path = llint/LLIntCLoop.h; sourceTree = "<group>"; }; 1990 FE24596117601D580074FCE0 /* CallFrameInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallFrameInlines.h; sourceTree = "<group>"; }; 1989 1991 FE4A331D15BD2E07006F54F3 /* VMInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VMInspector.cpp; sourceTree = "<group>"; }; 1990 1992 FE4A331E15BD2E07006F54F3 /* VMInspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMInspector.h; sourceTree = "<group>"; }; … … 1992 1994 FECE74561745456500FF9300 /* MacroAssemblerX86Common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerX86Common.cpp; sourceTree = "<group>"; }; 1993 1995 FED287B115EC9A5700DA8161 /* LLIntOpcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLIntOpcode.h; path = llint/LLIntOpcode.h; sourceTree = "<group>"; }; 1996 FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Watchdog.cpp; sourceTree = "<group>"; }; 1997 FED94F2C171E3E2300BE77A4 /* Watchdog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Watchdog.h; sourceTree = "<group>"; }; 1998 FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WatchdogMac.cpp; sourceTree = "<group>"; }; 1994 1999 FEE3147C174AACAF0013BCAC /* MacroAssemblerARMv7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerARMv7.cpp; sourceTree = "<group>"; }; 1995 2000 FEF6835A174343CC00A32E25 /* JITStubsARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsARM.h; sourceTree = "<group>"; }; … … 1997 2002 FEF6835C174343CC00A32E25 /* JITStubsX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsX86_64.h; sourceTree = "<group>"; }; 1998 2003 FEF6835D174343CC00A32E25 /* JITStubsX86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITStubsX86.h; sourceTree = "<group>"; }; 1999 FED94F2B171E3E2300BE77A4 /* Watchdog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Watchdog.cpp; sourceTree = "<group>"; };2000 FED94F2C171E3E2300BE77A4 /* Watchdog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Watchdog.h; sourceTree = "<group>"; };2001 FED94F2D171E3E2300BE77A4 /* WatchdogMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WatchdogMac.cpp; sourceTree = "<group>"; };2002 2004 /* End PBXFileReference section */ 2003 2005 … … 2274 2276 1429D8DC0ED2205B00B89619 /* CallFrame.h */, 2275 2277 A7F869EC0F95C2EC00558697 /* CallFrameClosure.h */, 2278 FE24596117601D580074FCE0 /* CallFrameInlines.h */, 2276 2279 1429D7D30ED2128200B89619 /* Interpreter.cpp */, 2277 2280 1429D77B0ED20D7300B89619 /* Interpreter.h */, … … 3260 3263 BC18C3E70E16F5CD00B34460 /* ArrayPrototype.h in Headers */, 3261 3264 FEF6835F174343CC00A32E25 /* JITStubsARMv7.h in Headers */, 3265 FE24596217601D580074FCE0 /* CallFrameInlines.h in Headers */, 3262 3266 FEF68360174343CC00A32E25 /* JITStubsX86_64.h in Headers */, 3263 3267 FEF6835E174343CC00A32E25 /* JITStubsARM.h in Headers */, -
branches/dfgFourthTier/Source/JavaScriptCore/bytecode/CodeOrigin.h
r151041 r151250 89 89 90 90 void dump(PrintStream&) const; 91 92 static inline bool isHandle(uint32_t bits) { return !!(bits & handleFlag); } 93 static inline uint32_t encodeHandle(uint32_t bits) 94 { 95 ASSERT(!isHandle(bits)); 96 return bits | handleFlag; 97 } 98 static inline uint32_t decodeHandle(uint32_t bits) 99 { 100 ASSERT(isHandle(bits)); 101 return bits & ~handleFlag; 102 } 103 104 private: 105 static const uint32_t handleFlag = (1 << 31); 91 106 }; 92 107 -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGJITCompiler.h
r150139 r151250 314 314 { 315 315 unsigned index = m_exceptionChecks.size(); 316 store32(TrustedImm32(index), tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount))); 316 unsigned handle = CodeOrigin::encodeHandle(index); 317 store32(TrustedImm32(handle), tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount))); 317 318 token.set(codeOrigin, index); 318 319 } -
branches/dfgFourthTier/Source/JavaScriptCore/dfg/DFGRepatch.cpp
r150657 r151250 1 1 /* 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.2 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 29 29 #if ENABLE(DFG_JIT) 30 30 31 #include "CallFrameInlines.h" 31 32 #include "DFGCCallHelpers.h" 32 33 #include "DFGScratchRegisterAllocator.h" … … 467 468 // right now! 468 469 stubJit.store32( 469 MacroAssembler::TrustedImm32(exec-> codeOriginIndexForDFG()),470 MacroAssembler::TrustedImm32(exec->locationAsRawBits()), 470 471 CCallHelpers::tagFor(static_cast<VirtualRegister>(JSStack::ArgumentCount))); 471 472 -
branches/dfgFourthTier/Source/JavaScriptCore/interpreter/CallFrame.cpp
r151167 r151250 27 27 #include "CallFrame.h" 28 28 29 #include "CallFrameInlines.h" 29 30 #include "CodeBlock.h" 30 31 #include "Interpreter.h" … … 42 43 43 44 #if USE(JSVALUE32_64) 44 unsigned CallFrame:: bytecodeOffsetForNonDFGCode() const45 unsigned CallFrame::locationAsBytecodeOffset() const 45 46 { 46 47 ASSERT(codeBlock()); 48 ASSERT(hasLocationAsBytecodeOffset()); 47 49 return currentVPC() - codeBlock()->instructions().begin(); 48 50 } 49 51 50 void CallFrame::set BytecodeOffsetForNonDFGCode(unsigned offset)52 void CallFrame::setLocationAsBytecodeOffset(unsigned offset) 51 53 { 52 54 ASSERT(codeBlock()); 55 ASSERT(!CodeOrigin::isHandle(offset)); 53 56 setCurrentVPC(codeBlock()->instructions().begin() + offset); 57 ASSERT(hasLocationAsBytecodeOffset()); 54 58 } 55 59 #else 56 60 Instruction* CallFrame::currentVPC() const 57 61 { 58 return codeBlock()->instructions().begin() + bytecodeOffsetForNonDFGCode();62 return codeBlock()->instructions().begin() + locationAsBytecodeOffset(); 59 63 } 60 64 void CallFrame::setCurrentVPC(Instruction* vpc) 61 65 { 62 set BytecodeOffsetForNonDFGCode(vpc - codeBlock()->instructions().begin());66 setLocationAsBytecodeOffset(vpc - codeBlock()->instructions().begin()); 63 67 } 64 68 #endif … … 120 124 } 121 125 } else { 122 unsigned index = codeOriginIndexForDFG();126 unsigned index = locationAsCodeOriginIndex(); 123 127 ASSERT(machineCodeBlock->canGetCodeOrigin(index)); 124 128 if (!machineCodeBlock->canGetCodeOrigin(index)) { -
branches/dfgFourthTier/Source/JavaScriptCore/interpreter/CallFrame.h
r151167 r151250 2 2 * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) 3 3 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 4 * Copyright (C) 2003, 2007, 2008, 2011 Apple Inc. All rights reserved.4 * Copyright (C) 2003, 2007, 2008, 2011, 2013 Apple Inc. All rights reserved. 5 5 * 6 6 * This library is free software; you can redistribute it and/or … … 114 114 #endif 115 115 AbstractPC abstractReturnPC(VM& vm) { return AbstractPC(vm, this); } 116 #if USE(JSVALUE32_64) 117 unsigned bytecodeOffsetForNonDFGCode() const; 118 void setBytecodeOffsetForNonDFGCode(unsigned offset); 119 #else 120 unsigned bytecodeOffsetForNonDFGCode() const 121 { 122 ASSERT(codeBlock()); 123 return this[JSStack::ArgumentCount].tag(); 124 } 125 126 void setBytecodeOffsetForNonDFGCode(unsigned offset) 127 { 128 ASSERT(codeBlock()); 129 this[JSStack::ArgumentCount].tag() = static_cast<int32_t>(offset); 130 } 131 #endif 116 117 bool hasLocationAsBytecodeOffset() const; 118 bool hasLocationAsCodeOriginIndex() const; 119 120 unsigned locationAsRawBits() const; 121 unsigned locationAsBytecodeOffset() const; 122 unsigned locationAsCodeOriginIndex() const; 123 124 void setLocationAsRawBits(unsigned); 125 void setLocationAsBytecodeOffset(unsigned); 132 126 133 127 Register* frameExtent() … … 142 136 #if ENABLE(DFG_JIT) 143 137 InlineCallFrame* inlineCallFrame() const { return this[JSStack::ReturnPC].asInlineCallFrame(); } 144 unsigned codeOriginIndexForDFG() const { return this[JSStack::ArgumentCount].tag(); }145 138 #else 146 139 // This will never be called if !ENABLE(DFG_JIT) since all calls should be guarded by -
branches/dfgFourthTier/Source/JavaScriptCore/interpreter/Interpreter.cpp
r151167 r151250 574 574 #if ENABLE(DFG_JIT) 575 575 if (JITCode::isOptimizingJIT(codeBlock->jitType())) 576 return codeBlock->codeOrigin(callFrame-> codeOriginIndexForDFG()).bytecodeIndex;577 #endif 578 return callFrame-> bytecodeOffsetForNonDFGCode();576 return codeBlock->codeOrigin(callFrame->locationAsCodeOriginIndex()).bytecodeIndex; 577 #endif 578 return callFrame->locationAsBytecodeOffset(); 579 579 #endif 580 580 } … … 602 602 #if ENABLE(DFG_JIT) 603 603 if (callerCodeBlock && JITCode::isOptimizingJIT(callerCodeBlock->jitType())) { 604 unsigned codeOriginIndex = callFrame->callerFrame()->removeHostCallFrameFlag()-> codeOriginIndexForDFG();604 unsigned codeOriginIndex = callFrame->callerFrame()->removeHostCallFrameFlag()->locationAsCodeOriginIndex(); 605 605 CodeOrigin origin = callerCodeBlock->codeOrigin(codeOriginIndex); 606 606 bytecodeOffset = origin.bytecodeIndex; … … 609 609 } else 610 610 #endif 611 bytecodeOffset = trueCallerFrame-> bytecodeOffsetForNonDFGCode();611 bytecodeOffset = trueCallerFrame->locationAsBytecodeOffset(); 612 612 } else { 613 613 #if ENABLE(DFG_JIT) -
branches/dfgFourthTier/Source/JavaScriptCore/jit/JITStubs.cpp
r151155 r151250 1621 1621 bool didOptimize = false; 1622 1622 1623 unsigned bytecodeOffset = callFrame-> bytecodeOffsetForNonDFGCode();1623 unsigned bytecodeOffset = callFrame->locationAsBytecodeOffset(); 1624 1624 ASSERT(bytecodeOffset); 1625 1625 ByValInfo& byValInfo = callFrame->codeBlock()->getByValInfo(bytecodeOffset - 1); … … 1755 1755 bool didOptimize = false; 1756 1756 1757 unsigned bytecodeOffset = callFrame-> bytecodeOffsetForNonDFGCode();1757 unsigned bytecodeOffset = callFrame->locationAsBytecodeOffset(); 1758 1758 ASSERT(bytecodeOffset); 1759 1759 ByValInfo& byValInfo = callFrame->codeBlock()->getByValInfo(bytecodeOffset - 1);
Note: See TracChangeset
for help on using the changeset viewer.