/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog-2009-06-16

https://bitbucket.org/ultra_iter/qt-vtl · #! · 39978 lines · 32111 code · 7867 blank · 0 comment · 0 complexity · 7209fee122a23f8bd405bb12ac2ebbd8 MD5 · raw file

  1. 2009-06-15 Gavin Barraclough <barraclough@apple.com>
  2. Rubber Stamped by Sam Weinig.
  3. Rename PatchBuffer to LinkBuffer. Previously our terminology has been a little
  4. mixed up, but we have decided to fix on refering to the process that takes place
  5. at the end of code generation as 'linking', and on any modifications that take
  6. place later (and once the code has potentially already been executed) as 'patching'.
  7. However, the term 'PatchBuffer' is already in use, and needs to be repurposed.
  8. To try to minimize confusion, we're going to switch the terminology over in stages,
  9. so for now we'll refer to later modifications as 'repatching'. This means that the
  10. new 'PatchBuffer' has been introduced with the name 'RepatchBuffer' instead.
  11. This patch renames the old 'PatchBuffer' to 'LinkBuffer'. We'll leave ToT in this
  12. state for a week or so to try to avoid to much overlap of the meaning of the term
  13. 'PatchBuffer', then will come back and rename 'RepatchBuffer'.
  14. * assembler/ARMv7Assembler.h:
  15. * assembler/AbstractMacroAssembler.h:
  16. (JSC::AbstractMacroAssembler::LinkBuffer::LinkBuffer):
  17. (JSC::AbstractMacroAssembler::LinkBuffer::~LinkBuffer):
  18. * jit/JIT.cpp:
  19. (JSC::JIT::privateCompile):
  20. * jit/JITPropertyAccess.cpp:
  21. (JSC::JIT::privateCompilePutByIdTransition):
  22. (JSC::JIT::privateCompilePatchGetArrayLength):
  23. (JSC::JIT::privateCompileGetByIdProto):
  24. (JSC::JIT::privateCompileGetByIdSelfList):
  25. (JSC::JIT::privateCompileGetByIdProtoList):
  26. (JSC::JIT::privateCompileGetByIdChainList):
  27. (JSC::JIT::privateCompileGetByIdChain):
  28. * yarr/RegexJIT.cpp:
  29. (JSC::Yarr::RegexGenerator::compile):
  30. 2009-06-15 Gavin Barraclough <barraclough@apple.com>
  31. Reviewed by Sam Weinig.
  32. Having moved most of their functionality into the RepatchBuffer class,
  33. we can simplify the CodeLocation* classes.
  34. The CodeLocation* classes are currently a tangle of templatey and friendly
  35. badness, burried in the middle of AbstractMacroAssembler. Having moved
  36. the ability to repatch out into RepatchBufer they are now do-nothing wrappers
  37. on CodePtr (MacroAssemblerCodePtr), that only exist to provide type-safety.
  38. Simplify the code, and move them off into their own header.
  39. * JavaScriptCore.xcodeproj/project.pbxproj:
  40. * assembler/AbstractMacroAssembler.h:
  41. (JSC::AbstractMacroAssembler::PatchBuffer::patch):
  42. * assembler/CodeLocation.h: Copied from assembler/AbstractMacroAssembler.h.
  43. (JSC::CodeLocationCommon::CodeLocationCommon):
  44. (JSC::CodeLocationInstruction::CodeLocationInstruction):
  45. (JSC::CodeLocationLabel::CodeLocationLabel):
  46. (JSC::CodeLocationJump::CodeLocationJump):
  47. (JSC::CodeLocationCall::CodeLocationCall):
  48. (JSC::CodeLocationNearCall::CodeLocationNearCall):
  49. (JSC::CodeLocationDataLabel32::CodeLocationDataLabel32):
  50. (JSC::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
  51. (JSC::CodeLocationCommon::instructionAtOffset):
  52. (JSC::CodeLocationCommon::labelAtOffset):
  53. (JSC::CodeLocationCommon::jumpAtOffset):
  54. (JSC::CodeLocationCommon::callAtOffset):
  55. (JSC::CodeLocationCommon::nearCallAtOffset):
  56. (JSC::CodeLocationCommon::dataLabelPtrAtOffset):
  57. (JSC::CodeLocationCommon::dataLabel32AtOffset):
  58. * assembler/MacroAssemblerCodeRef.h:
  59. (JSC::MacroAssemblerCodePtr::operator!):
  60. * bytecode/CodeBlock.h:
  61. (JSC::getStructureStubInfoReturnLocation):
  62. (JSC::getCallLinkInfoReturnLocation):
  63. (JSC::getMethodCallLinkInfoReturnLocation):
  64. * bytecode/Instruction.h:
  65. * bytecode/JumpTable.h:
  66. (JSC::StringJumpTable::ctiForValue):
  67. (JSC::SimpleJumpTable::ctiForValue):
  68. * bytecode/StructureStubInfo.h:
  69. * bytecompiler/BytecodeGenerator.cpp:
  70. (JSC::BytecodeGenerator::emitCatch):
  71. * jit/JIT.cpp:
  72. (JSC::JIT::privateCompile):
  73. * jit/JITStubs.cpp:
  74. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  75. (JSC::JITStubs::getPolymorphicAccessStructureListSlot):
  76. 2009-06-15 Gavin Barraclough <barraclough@apple.com>
  77. Reviewed by Sam Weinig.
  78. Having introduced the RepatchBuffer, ProcessorReturnAddress is now a do-nothing
  79. wrapper around ReturnAddressPtr. Remove it. In tugging on this piece of string
  80. it made sense to roll out the use of ReturnAddressPtr a little further into
  81. JITStubs (which had always been the intention).
  82. No performance impact.
  83. * assembler/AbstractMacroAssembler.h:
  84. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
  85. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
  86. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
  87. * assembler/MacroAssemblerCodeRef.h:
  88. (JSC::ReturnAddressPtr::ReturnAddressPtr):
  89. * bytecode/CodeBlock.h:
  90. (JSC::CodeBlock::getStubInfo):
  91. (JSC::CodeBlock::getCallLinkInfo):
  92. (JSC::CodeBlock::getMethodCallLinkInfo):
  93. (JSC::CodeBlock::getBytecodeIndex):
  94. * interpreter/Interpreter.cpp:
  95. (JSC::bytecodeOffsetForPC):
  96. * jit/JIT.cpp:
  97. (JSC::ctiPatchNearCallByReturnAddress):
  98. (JSC::ctiPatchCallByReturnAddress):
  99. * jit/JIT.h:
  100. (JSC::JIT::compileGetByIdProto):
  101. (JSC::JIT::compileGetByIdChain):
  102. (JSC::JIT::compilePutByIdTransition):
  103. (JSC::JIT::compilePatchGetArrayLength):
  104. * jit/JITPropertyAccess.cpp:
  105. (JSC::JIT::privateCompilePutByIdTransition):
  106. (JSC::JIT::patchGetByIdSelf):
  107. (JSC::JIT::patchPutByIdReplace):
  108. (JSC::JIT::privateCompilePatchGetArrayLength):
  109. (JSC::JIT::privateCompileGetByIdProto):
  110. (JSC::JIT::privateCompileGetByIdChain):
  111. * jit/JITStubs.cpp:
  112. (JSC::JITThunks::tryCachePutByID):
  113. (JSC::JITThunks::tryCacheGetByID):
  114. (JSC::StackHack::StackHack):
  115. (JSC::returnToThrowTrampoline):
  116. (JSC::throwStackOverflowError):
  117. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  118. * jit/JITStubs.h:
  119. (JSC::):
  120. (JSC::JITStackFrame::returnAddressSlot):
  121. * runtime/JSGlobalData.h:
  122. 2009-06-15 Simon Fraser <simon.fraser@apple.com>
  123. Reviewed by Mark Rowe.
  124. <rdar://problem/6974857>
  125. Define ENABLE_3D_RENDERING when building on 10.6, and move ENABLE_3D_RENDERING
  126. switch from config.h to wtf/Platform.h.
  127. * Configurations/FeatureDefines.xcconfig:
  128. * wtf/Platform.h:
  129. 2009-06-15 Gavin Barraclough <barraclough@apple.com>
  130. Reviewed by Oliver Hunt.
  131. Move repatching methods into a set of methods on a class. This will allow us to
  132. coallesce memory reprotection calls. Really, we want this class to be called
  133. PatchBuffer, we want the class PatchBuffer to be called LinkBuffer, we want both
  134. to be memblers of MacroAssembler rather then AbstractMacroAssembler, we don't
  135. want the CodeLocationFoo types anymore (they are now only really there to provide
  136. type safety, and that is completely undermined by the way we use offsets). Then
  137. the link & patch buffers should delegate the actual patching calls to the
  138. architecture-specific layer of the MacroAssembler. Landing all these changes as a
  139. sequence of patches.
  140. No performance impact.
  141. * assembler/AbstractMacroAssembler.h:
  142. (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
  143. (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
  144. (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
  145. (JSC::AbstractMacroAssembler::RepatchBuffer::RepatchBuffer):
  146. (JSC::AbstractMacroAssembler::RepatchBuffer::relink):
  147. (JSC::AbstractMacroAssembler::RepatchBuffer::repatch):
  148. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToTrampoline):
  149. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkCallerToFunction):
  150. (JSC::AbstractMacroAssembler::RepatchBuffer::relinkNearCallerToTrampoline):
  151. (JSC::AbstractMacroAssembler::RepatchBuffer::repatchLoadPtrToLEA):
  152. * jit/JIT.cpp:
  153. (JSC::ctiPatchNearCallByReturnAddress):
  154. (JSC::ctiPatchCallByReturnAddress):
  155. (JSC::JIT::unlinkCall):
  156. (JSC::JIT::linkCall):
  157. * jit/JITPropertyAccess.cpp:
  158. (JSC::JIT::privateCompilePutByIdTransition):
  159. (JSC::JIT::patchGetByIdSelf):
  160. (JSC::JIT::patchMethodCallProto):
  161. (JSC::JIT::patchPutByIdReplace):
  162. (JSC::JIT::privateCompilePatchGetArrayLength):
  163. (JSC::JIT::privateCompileGetByIdProto):
  164. (JSC::JIT::privateCompileGetByIdSelfList):
  165. (JSC::JIT::privateCompileGetByIdProtoList):
  166. (JSC::JIT::privateCompileGetByIdChainList):
  167. (JSC::JIT::privateCompileGetByIdChain):
  168. 2009-06-15 Gavin Barraclough <barraclough@apple.com>
  169. Reviewed by Geoff Hunt & Oliver Garen.
  170. We are currently generating two copies of the slow path for op_call for no reason. Stop that.
  171. Originally op_call used two slow paths since the first set up the pointer to the CallLinkInfo
  172. for use when linking. However this is now looked up using the return address (as we do for
  173. property accesses) so the two paths are now identical.
  174. No performance impact, reduces memory footprint.
  175. * bytecode/CodeBlock.h:
  176. * jit/JIT.cpp:
  177. (JSC::JIT::privateCompile):
  178. (JSC::JIT::linkCall):
  179. * jit/JIT.h:
  180. * jit/JITCall.cpp:
  181. (JSC::JIT::compileOpCallSlowCase):
  182. * jit/JITStubs.cpp:
  183. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  184. 2009-06-12 Dave Hyatt <hyatt@apple.com>
  185. Reviewed by Anders Carlsson.
  186. https://bugs.webkit.org/show_bug.cgi?id=26373
  187. Add a new class to Threading in wtf called ReadWriteLock that handles single writer/multiple reader locking.
  188. Provide a pthreads-only implementation of the lock for now, as this class is only going to be used
  189. on Snow Leopard at first.
  190. * wtf/Threading.h:
  191. (WTF::ReadWriteLock::impl):
  192. * wtf/ThreadingPthreads.cpp:
  193. (WTF::ReadWriteLock::ReadWriteLock):
  194. (WTF::ReadWriteLock::~ReadWriteLock):
  195. (WTF::ReadWriteLock::readLock):
  196. (WTF::ReadWriteLock::tryReadLock):
  197. (WTF::ReadWriteLock::writeLock):
  198. (WTF::ReadWriteLock::tryWriteLock):
  199. (WTF::ReadWriteLock::unlock):
  200. 2009-06-12 Oliver Hunt <oliver@apple.com>
  201. Reviewed by Geoff Garen.
  202. Make LiteralParser non-recursive
  203. Convert LiteralParser from using a simple recursive descent parser
  204. to a hand rolled PDA. Relatively simple conversion, but required
  205. modifications to MarkedArgumentBuffer to make it more suitable as
  206. a generic marked vector. I'll refactor and rename MarkedArgumentBuffer
  207. in future as there are many other cases where it will be useful to
  208. have such a class.
  209. * runtime/ArgList.h:
  210. (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
  211. (JSC::MarkedArgumentBuffer::append):
  212. (JSC::MarkedArgumentBuffer::removeLast):
  213. (JSC::MarkedArgumentBuffer::last):
  214. * runtime/LiteralParser.cpp:
  215. (JSC::LiteralParser::parse):
  216. * runtime/LiteralParser.h:
  217. (JSC::LiteralParser::LiteralParser):
  218. (JSC::LiteralParser::tryLiteralParse):
  219. (JSC::LiteralParser::):
  220. 2009-06-12 David Levin <levin@chromium.org>
  221. Reviewed by NOBODY (build fix for windows).
  222. Adjust the exports for JSC on Windows like what was done for OSX in
  223. the previous commit.
  224. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  225. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  226. 2009-06-12 David Levin <levin@chromium.org>
  227. Reviewed by Darin Adler.
  228. UString shouldn't create sharedBuffer for SmallStrings.
  229. https://bugs.webkit.org/show_bug.cgi?id=26360
  230. The methods changed are not used by JSC, so there is no JS perf impact. However,
  231. there is a potential DOM perf impact, so I re-ran several of the tests that
  232. I ran previously and ensured that the perf stay the same which caused me to
  233. adjust the minLengthToShare.
  234. * JavaScriptCore.exp:
  235. * runtime/UString.cpp:
  236. (JSC::UString::Rep::sharedBuffer):
  237. Determines if the buffer being shared is big enough before doing so.
  238. Previously, BaseString::sharedBuffer was called but it would only know
  239. the length of the base string (BaseString::len) which may not be the same
  240. as the string being shared (Rep::len).
  241. (JSC::UString::BaseString::sharedBuffer):
  242. This is now only be used by Rep::sharedBuffer. which does the length check.
  243. * runtime/UString.h:
  244. 2009-06-12 Dimitri Glazkov <dglazkov@chromium.org>
  245. Reviewed by Eric Seidel.
  246. https://bugs.webkit.org/show_bug.cgi?id=26191
  247. Remove xmath include in MathExtras.h, because it is not needed and also
  248. breaks VS2008 builds with TR1 turned on.
  249. * wtf/MathExtras.h: Removed xmath include.
  250. 2009-06-12 Peter Kasting <pkasting@google.com>
  251. Reviewed by Eric Seidel.
  252. * ChangeLog-2007-10-14: Change pseudonym "Don Gibson" to me (was used while Google Chrome was not public); update my email address.
  253. 2009-06-12 Kevin Ollivier <kevino@theolliviers.com>
  254. wx build fix. Adding JSONObject.cpp to the build.
  255. * JavaScriptCoreSources.bkl:
  256. 2009-06-12 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  257. Reviewed by Jan Michael Alonzo.
  258. [Qt] Fix build break
  259. https://bugs.webkit.org/show_bug.cgi?id=26340
  260. * JavaScriptCore.pri: Add JSONObject.cpp to LUT files.
  261. 2009-06-11 Oliver Hunt <oliver@apple.com>
  262. Reviewed by NOBODY (build fix).
  263. Lower stringify recursion limit to deal with small windows stack.
  264. * JavaScriptCore.xcodeproj/project.pbxproj:
  265. * runtime/JSONObject.cpp:
  266. (JSC::Stringifier::):
  267. 2009-06-11 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  268. Reviewed by Holger Freyther.
  269. Fix compilation warnings
  270. <https://bugs.webkit.org/show_bug.cgi?id=26015>
  271. * wtf/ThreadingNone.cpp:
  272. (WTF::ThreadCondition::wait): Fix compilation warning.
  273. (WTF::ThreadCondition::timedWait): Ditto.
  274. 2009-06-10 Brent Fulgham <bfulgham@webkit.org>
  275. Build fix for Windows target.
  276. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  277. Correct missing </File> tag after @r44550 that prevents the
  278. project from being loaded in the Visual Studio IDE.
  279. 2009-06-09 Gavin Barraclough <barraclough@apple.com>
  280. Rubber Stamped by Mark Rowe.
  281. Tidy up a couple of comments.
  282. * assembler/ARMv7Assembler.h:
  283. Fix date in copyright, neaten up a couple of comments.
  284. * assembler/MacroAssemblerARMv7.h:
  285. Fix date in copyright.
  286. 2009-06-07 Oliver Hunt <oliver@apple.com>
  287. Reviewed by Sam Weinig.
  288. Bug 26249: Support JSON.stringify
  289. <https://bugs.webkit.org/show_bug.cgi?id=26249>
  290. Implement JSON.stringify. This patch handles all the semantics of the ES5
  291. JSON.stringify function, including replacer functions and arrays and both
  292. string and numeric gap arguments.
  293. Currently uses a clamped recursive algorithm basically identical to the spec
  294. description but with a few minor tweaks for performance and corrected semantics
  295. discussed in the es-discuss mailing list.
  296. * DerivedSources.make:
  297. * GNUmakefile.am:
  298. * JavaScriptCore.pri:
  299. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  300. * JavaScriptCore.xcodeproj/project.pbxproj:
  301. * interpreter/CallFrame.h:
  302. (JSC::ExecState::jsonTable):
  303. * runtime/CommonIdentifiers.h:
  304. add toJSON to the list of common identifiers
  305. * runtime/JSGlobalData.cpp:
  306. (JSC::JSGlobalData::JSGlobalData):
  307. (JSC::JSGlobalData::~JSGlobalData):
  308. * runtime/JSGlobalData.h:
  309. * runtime/JSGlobalObject.cpp:
  310. (JSC::JSGlobalObject::reset):
  311. Add support for the JSON object lookup table
  312. * runtime/JSONObject.cpp: Added.
  313. (JSC::):
  314. (JSC::JSONObject::getOwnPropertySlot):
  315. (JSC::Stringifier::):
  316. (JSC::Stringifier::Stringifier):
  317. (JSC::Stringifier::stringify):
  318. (JSC::Stringifier::appendString):
  319. (JSC::Stringifier::StringKeyGenerator::StringKeyGenerator):
  320. (JSC::Stringifier::StringKeyGenerator::getKey):
  321. (JSC::Stringifier::IntKeyGenerator::IntKeyGenerator):
  322. (JSC::Stringifier::IntKeyGenerator::getKey):
  323. These KeyGenerator classes are used to abstract away the lazy evaluation of keys for
  324. toJSON and replacer functions.
  325. (JSC::Stringifier::toJSONValue):
  326. (JSC::Stringifier::stringifyArray):
  327. (JSC::Stringifier::stringifyObject):
  328. (JSC::JSONProtoFuncStringify):
  329. * runtime/JSONObject.h: Added.
  330. (JSC::JSONObject:::JSObject):
  331. (JSC::JSONObject::classInfo):
  332. (JSC::JSONObject::createStructure):
  333. 2009-06-09 Gavin Barraclough <barraclough@apple.com>
  334. Reviewed by Geoff Garen.
  335. Enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS on ARMv7 platforms.
  336. These optimizations function correctly with no further changes.
  337. * wtf/Platform.h:
  338. Change to enable JIT_OPTIMIZE_CALL & JIT_OPTIMIZE_METHOD_CALLS.
  339. 2009-06-09 Gavin Barraclough <barraclough@apple.com>
  340. Not Reviewed, build fix.
  341. * assembler/MacroAssemblerARMv7.h:
  342. 2009-06-09 Gavin Barraclough <barraclough@apple.com>
  343. Reviewed by Geoff Garen.
  344. Enable JIT_OPTIMIZE_ARITHMETIC on ARMv7 platforms.
  345. Temporarily split support for 'branchTruncateDoubleToInt32' onto its own switch
  346. ('supportsFloatingPointTruncate'). See comment in MacroAssemblerARMv7, we need
  347. to work out wherther we are going to be able to support the current interface on
  348. all platforms, or whether this should be refactored.
  349. * assembler/MacroAssemblerARMv7.h:
  350. (JSC::MacroAssemblerARMv7::supportsFloatingPoint):
  351. Add implementation of supportsFloatingPointTruncate (returns true).
  352. (JSC::MacroAssemblerARMv7::supportsFloatingPointTruncate):
  353. Add implementation of supportsFloatingPointTruncate (returns false).
  354. (JSC::MacroAssemblerARMv7::loadDouble):
  355. (JSC::MacroAssemblerARMv7::storeDouble):
  356. (JSC::MacroAssemblerARMv7::addDouble):
  357. (JSC::MacroAssemblerARMv7::subDouble):
  358. (JSC::MacroAssemblerARMv7::mulDouble):
  359. (JSC::MacroAssemblerARMv7::convertInt32ToDouble):
  360. (JSC::MacroAssemblerARMv7::branchDouble):
  361. Implement FP code genertion operations.
  362. * assembler/MacroAssemblerX86.h:
  363. (JSC::MacroAssemblerX86::supportsFloatingPointTruncate):
  364. Add implementation of supportsFloatingPointTruncate (returns true).
  365. * assembler/MacroAssemblerX86_64.h:
  366. (JSC::MacroAssemblerX86_64::supportsFloatingPointTruncate):
  367. Add implementation of supportsFloatingPointTruncate (returns true).
  368. * jit/JITArithmetic.cpp:
  369. (JSC::JIT::emit_op_rshift):
  370. Changed to call supportsFloatingPointTruncate().
  371. (JSC::JIT::emitSlow_op_rshift):
  372. Changed to call supportsFloatingPointTruncate().
  373. * wtf/Platform.h:
  374. Change to enable JIT_OPTIMIZE_ARITHMETIC.
  375. 2009-06-09 Gavin Barraclough <barraclough@apple.com>
  376. Reviewed by Mark Rowe & Geoff Garen.
  377. Enable JIT_OPTIMIZE_PROPERTY_ACCESS on ARMv7 platforms.
  378. Firm up interface for planting load intructions that will be repatched by
  379. repatchLoadPtrToLEA(). This method should now no longer be applied to just
  380. any loadPtr instruction.
  381. * assembler/MacroAssemblerARMv7.h:
  382. (JSC::MacroAssemblerARMv7::loadPtrWithPatchToLEA):
  383. Implement loadPtrWithPatchToLEA interface (plants a load with a fixed width address).
  384. (JSC::MacroAssemblerARMv7::move):
  385. (JSC::MacroAssemblerARMv7::nearCall):
  386. (JSC::MacroAssemblerARMv7::call):
  387. (JSC::MacroAssemblerARMv7::moveWithPatch):
  388. (JSC::MacroAssemblerARMv7::tailRecursiveCall):
  389. Switch to use common method 'moveFixedWidthEncoding()' to perform fixed width (often patchable) loads.
  390. (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding):
  391. Move an immediate to a register, always plants movT3/movt instruction pair.
  392. * assembler/MacroAssemblerX86.h:
  393. (JSC::MacroAssemblerX86::loadPtrWithPatchToLEA):
  394. Implement loadPtrWithPatchToLEA interface (just a regular 32-bit load on x86).
  395. * assembler/MacroAssemblerX86_64.h:
  396. (JSC::MacroAssemblerX86_64::loadPtrWithPatchToLEA):
  397. Implement loadPtrWithPatchToLEA interface (just a regular 64-bit load on x86_64).
  398. * jit/JITPropertyAccess.cpp:
  399. (JSC::JIT::compileGetByIdHotPath):
  400. (JSC::JIT::emit_op_put_by_id):
  401. * wtf/Platform.h:
  402. Change to enable JIT_OPTIMIZE_PROPERTY_ACCESS.
  403. 2009-06-08 Gavin Barraclough <barraclough@apple.com>
  404. Reviewed by Geoff Garen.
  405. Enable JS language JIT for ARM thumb2 platforms. Add ARMv7 specific
  406. asm & constants, add appropriate configuration switches to Platform.h.
  407. Landing this disabled until jump linking is completed (see YARR jit patch).
  408. * assembler/MacroAssemblerARMv7.h:
  409. (JSC::MacroAssemblerARMv7::load32):
  410. Fix: should load pointer with ImmPtr not Imm32.
  411. (JSC::MacroAssemblerARMv7::store32):
  412. Fix: should load pointer with ImmPtr not Imm32.
  413. (JSC::MacroAssemblerARMv7::move):
  414. Fix: When moving an Imm32 that is actually a pointer, should call movT3()
  415. not mov(), to ensure code generation is repeatable (for exception handling).
  416. * jit/JIT.cpp:
  417. (JSC::JIT::privateCompileCTIMachineTrampolines):
  418. Disable JIT_OPTIMIZE_NATIVE_CALL specific code generation if the optimization is not enabled.
  419. * jit/JIT.h:
  420. Add ARMv7 specific values of constants & register names.
  421. * jit/JITInlineMethods.h:
  422. (JSC::JIT::preverveReturnAddressAfterCall):
  423. (JSC::JIT::restoreReturnAddressBeforeReturn):
  424. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  425. Implement for ARMv7 (move value to/from lr).
  426. * jit/JITStubs.cpp:
  427. Add JIT entry/thow trampolines, add macro to add thunk wrapper around stub routines.
  428. * jit/JITStubs.h:
  429. (JSC::JITStackFrame::returnAddressSlot):
  430. Add ARMv7 stack frame object.
  431. * wtf/Platform.h:
  432. Add changes necessary to allow JIT to build on this platform, disabled.
  433. 2009-06-08 Mark Rowe <mrowe@apple.com>
  434. Speculative GTK build fix.
  435. * wtf/DateMath.cpp:
  436. 2009-06-08 Gavin Barraclough <barraclough@apple.com>
  437. Reviewed by Mark Rowe.
  438. Previous patch caused a regression.
  439. Restructure so no new (empty, inline) function calls are added on x86.
  440. * jit/ExecutableAllocator.h:
  441. (JSC::ExecutableAllocator::makeWritable):
  442. (JSC::ExecutableAllocator::makeExecutable):
  443. (JSC::ExecutableAllocator::reprotectRegion):
  444. (JSC::ExecutableAllocator::cacheFlush):
  445. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  446. Unreviewed, GTK build fix (thanks, bdash).
  447. * GNUmakefile.am: Moved DateMath with all other wtf kin.
  448. 2009-06-08 Gavin Barraclough <barraclough@apple.com>
  449. Reviewed by Geoff Garen.
  450. Add (incomplete) support to YARR for running with the jit enabled
  451. on Arm thumb2 platforms. Adds new Assembler/MacroAssembler classes,
  452. along with cache flushing support, tweaks to MacroAssemblerCodePtr
  453. to support decorated thumb code pointers, and new enter/exit code
  454. to YARR jit for the platform.
  455. Support for this platform is still under development - the assembler
  456. currrently only supports planting and linking jumps with a 16Mb range.
  457. As such, initially commiting in a disabled state.
  458. * JavaScriptCore.xcodeproj/project.pbxproj:
  459. Add new assembler files.
  460. * assembler/ARMv7Assembler.h: Added.
  461. Add new Assembler.
  462. * assembler/AbstractMacroAssembler.h:
  463. Tweaks to ensure sizes of pointer values planted in JIT code do not change.
  464. * assembler/MacroAssembler.h:
  465. On ARMv7 platforms use MacroAssemblerARMv7.
  466. * assembler/MacroAssemblerARMv7.h: Added.
  467. Add new MacroAssembler.
  468. * assembler/MacroAssemblerCodeRef.h:
  469. (JSC::FunctionPtr::FunctionPtr):
  470. Add better ASSERT.
  471. (JSC::ReturnAddressPtr::ReturnAddressPtr):
  472. Add better ASSERT.
  473. (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
  474. On ARMv7, MacroAssemblerCodePtr's mush be 'decorated' with a low bit set,
  475. to indicate to the processor that the code is thumb code, not traditional
  476. 32-bit ARM.
  477. (JSC::MacroAssemblerCodePtr::dataLocation):
  478. On ARMv7, decoration must be removed.
  479. * jit/ExecutableAllocator.h:
  480. (JSC::ExecutableAllocator::makeWritable):
  481. Reformatted, no change.
  482. (JSC::ExecutableAllocator::makeExecutable):
  483. When marking code executable also cache flush it, where necessary.
  484. (JSC::ExecutableAllocator::MakeWritable::MakeWritable):
  485. Only use the null implementation of this class if both !ASSEMBLER_WX_EXCLUSIVE
  486. and running on x86(_64) - on other platforms we may also need ensure that
  487. makeExecutable is called at the end to flush caches.
  488. (JSC::ExecutableAllocator::reprotectRegion):
  489. Reformatted, no change.
  490. (JSC::ExecutableAllocator::cacheFlush):
  491. Cache flush a region of memory, or platforms where this is necessary.
  492. * wtf/Platform.h:
  493. Add changes necessary to allow YARR jit to build on this platform, disabled.
  494. * yarr/RegexJIT.cpp:
  495. (JSC::Yarr::RegexGenerator::generateEnter):
  496. (JSC::Yarr::RegexGenerator::generateReturn):
  497. Add support to these methods for ARMv7.
  498. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  499. Unreviewed, fix my previous fix.
  500. * runtime/DateInstance.cpp:
  501. (JSC::DateInstance::msToGregorianDateTime): Use WTF namespace qualifier to
  502. disambiguate func signatures.
  503. 2009-06-08 Mark Rowe <mrowe@apple.com>
  504. Attempt to fix the Tiger build.
  505. * wtf/Platform.h: Only test the value of the macro once we know it is defined.
  506. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  507. Unreviewed, another Windows build fix.
  508. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  509. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  510. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  511. Unreviewed, projectile-fixing Windows build.
  512. * runtime/DateConversion.cpp: Added StringExtras include.
  513. * wtf/DateMath.cpp: Replaced math with algorithm include (looking for std::min def for Windows).
  514. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  515. Unreviewed, Windows build fix.
  516. * runtime/DateConstructor.cpp: Changed to use WTF namespace.
  517. * runtime/DateConversion.cpp: Added UString include.
  518. * runtime/DateInstance.cpp: Changed to use WTF namespace.
  519. * wtf/DateMath.cpp: Added math include.
  520. 2009-06-08 Dimitri Glazkov <dglazkov@chromium.org>
  521. Reviewed by Eric Seidel.
  522. https://bugs.webkit.org/show_bug.cgi?id=26238
  523. Move most of runtime/DateMath functions to wtf/DateMath, and split off conversion-related
  524. helpers to DateConversion.
  525. * AllInOneFile.cpp: Changed DateMath->DateConversion.
  526. * GNUmakefile.am: Ditto and added DateMath.
  527. * JavaScriptCore.exp: Ditto.
  528. * JavaScriptCore.pri: Ditto.
  529. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
  530. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added DateMath.
  531. * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  532. * JavaScriptCoreSources.bkl: Ditto.
  533. * pcre/pcre_exec.cpp: Changed to use DateMath.
  534. * profiler/ProfileNode.cpp:
  535. (JSC::getCount): Changed to use DateConversion.
  536. * runtime/DateConstructor.cpp: Ditto.
  537. * runtime/DateConversion.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
  538. (JSC::parseDate): Refactored to use null-terminated characters as input.
  539. * runtime/DateConversion.h: Copied from JavaScriptCore/runtime/DateMath.h.
  540. * runtime/DateInstance.cpp: Changed to use wtf/DateMath.
  541. * runtime/DateInstance.h: Ditto.
  542. * runtime/DateMath.cpp: Removed.
  543. * runtime/DateMath.h: Removed.
  544. * runtime/DatePrototype.cpp: Ditto.
  545. * runtime/InitializeThreading.cpp: Ditto.
  546. * wtf/DateMath.cpp: Copied from JavaScriptCore/runtime/DateMath.cpp.
  547. * wtf/DateMath.h: Copied from JavaScriptCore/runtime/DateMath.h.
  548. 2009-06-08 Steve Falkenburg <sfalken@apple.com>
  549. Windows build fix.
  550. * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
  551. 2009-06-07 David Kilzer <ddkilzer@apple.com>
  552. Make JavaScriptCore compile for iPhone and iPhone Simulator
  553. Reviewed by Gavin Barraclough.
  554. * Configurations/Base.xcconfig: Split GCC_ENABLE_OBJC_GC on
  555. $(REAL_PLATFORM_NAME). Added $(ARCHS_UNIVERSAL_IPHONE_OS) to
  556. VALID_ARCHS. Added REAL_PLATFORM_NAME_iphoneos,
  557. REAL_PLATFORM_NAME_iphonesimulator, HAVE_DTRACE_iphoneos and
  558. HAVE_DTRACE_iphonesimulator variables.
  559. * Configurations/DebugRelase.xcconfig: Split ARCHS definition on
  560. $(REAL_PLATFORM_NAME).
  561. * Configurations/JavaScriptCore.xcconfig: Added
  562. EXPORTED_SYMBOLS_FILE_armv6 and EXPORTED_SYMBOLS_FILE_armv7
  563. variables. Split OTHER_LDFLAGS into OTHER_LDFLAGS_BASE and
  564. OTHER_LDFLAGS_$(REAL_PLATFORM_NAME) since CoreServices.framework
  565. is only linked to on Mac OS X.
  566. * JavaScriptCore.xcodeproj/project.pbxproj: Removed references
  567. to CoreServices.framework since it's linked using OTHER_LDFLAGS
  568. in JavaScriptCore.xcconfig.
  569. * profiler/ProfilerServer.mm: Added #import for iPhone
  570. Simulator.
  571. (-[ProfilerServer init]): Conditionalize use of
  572. NSDistributedNotificationCenter to non-iPhone or iPhone
  573. Simulator.
  574. * wtf/FastMalloc.cpp:
  575. (WTF::TCMallocStats::): Build fix for iPhone and iPhone
  576. Simulator.
  577. * wtf/Platform.h: Defined PLATFORM(IPHONE) and
  578. PLATFORM(IPHONE_SIMULATOR).
  579. * wtf/ThreadingPthreads.cpp:
  580. (WTF::setThreadNameInternal): Build fix for iPhone and iPhone
  581. Simulator.
  582. 2009-06-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  583. Reviewed by Simon Hausmann.
  584. [Qt] Use $QMAKE_PATH_SEP instead of hardcoded / to fix Windows build
  585. * JavaScriptCore.pri:
  586. * JavaScriptCore.pro:
  587. * jsc.pro:
  588. 2009-06-07 Gavin Barraclough <barraclough@apple.com>
  589. RS by Sam Weinig.
  590. Remove bonus bogus \n from last commit.
  591. * jit/JITStubs.cpp:
  592. (JSC::):
  593. 2009-06-07 Gavin Barraclough <barraclough@apple.com>
  594. Reviewed by Sam Weinig.
  595. Change the implementation of op_throw so the stub function always modifies its
  596. return address - if it doesn't find a 'catch' it will switch to a trampoline
  597. to force a return from JIT execution. This saves memory, by avoiding the need
  598. for a unique return for every op_throw.
  599. * jit/JITOpcodes.cpp:
  600. (JSC::JIT::emit_op_throw):
  601. JITStubs::cti_op_throw now always changes its return address,
  602. remove return code generated after the stub call (this is now
  603. handled by ctiOpThrowNotCaught).
  604. * jit/JITStubs.cpp:
  605. (JSC::):
  606. Add ctiOpThrowNotCaught definitions.
  607. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  608. Change cti_op_throw to always change its return address.
  609. * jit/JITStubs.h:
  610. Add ctiOpThrowNotCaught declaration.
  611. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  612. Rudder stamped by Sam Weinig.
  613. Add missing ASSERT.
  614. * assembler/X86Assembler.h:
  615. (JSC::X86Assembler::getRelocatedAddress):
  616. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  617. Reviewed by Sam Weinig.
  618. Switch storePtrWithPatch to take the initial immediate value as an argument.
  619. * assembler/MacroAssemblerX86.h:
  620. (JSC::MacroAssemblerX86::storePtrWithPatch):
  621. * assembler/MacroAssemblerX86_64.h:
  622. (JSC::MacroAssemblerX86_64::storePtrWithPatch):
  623. * jit/JITOpcodes.cpp:
  624. (JSC::JIT::emit_op_jsr):
  625. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  626. Reviewed by Sam Weinig.
  627. Remove patchLength..tByIdExternalLoadPrefix magic numbers from JIT.h.
  628. These aren't really suitable values to be tracking within common code
  629. of the JIT, since they are not (and realistically cannot) be checked
  630. by ASSERTs, as the other repatch offsets are. Move this functionality
  631. (skipping the REX prefix when patching load instructions to LEAs on
  632. x86-64) into the X86Assembler.
  633. * assembler/AbstractMacroAssembler.h:
  634. (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadPtrToLEA):
  635. * assembler/X86Assembler.h:
  636. (JSC::X86Assembler::repatchLoadPtrToLEA):
  637. * jit/JIT.h:
  638. * jit/JITPropertyAccess.cpp:
  639. (JSC::JIT::patchGetByIdSelf):
  640. (JSC::JIT::patchPutByIdReplace):
  641. 2009-06-05 Shinichiro Hamaji <hamaji@chromium.org>
  642. Bug 26160: Compile fails in MacOSX when GNU fileutils are installed
  643. <https://bugs.webkit.org/show_bug.cgi?id=26160>
  644. Reviewed by Alexey Proskuryakov.
  645. Use /bin/ln instead of ln for cases where this command is used with -h option.
  646. As this option is not supported by GNU fileutils, this change helps users
  647. who have GNU fileutils in their PATH.
  648. * JavaScriptCore.xcodeproj/project.pbxproj:
  649. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  650. Reviewed by Oliver Hunt.
  651. Remove DoubleNotEqual floating point comparison condition for now -
  652. it is not used, and it is unclear the semantics are correct (I think
  653. this comparison would actually give you not-equal-or-unordered, which
  654. might be what is wanted... we can revisit this interface & get it
  655. right when required).
  656. Also, fix asserts in branchArith32 ops. All adds & subs can check
  657. for Signed, multiply only sets OF so can only check for overflow.
  658. * assembler/MacroAssemblerX86Common.h:
  659. (JSC::MacroAssemblerX86Common::):
  660. (JSC::MacroAssemblerX86Common::branchAdd32):
  661. (JSC::MacroAssemblerX86Common::branchMul32):
  662. (JSC::MacroAssemblerX86Common::branchSub32):
  663. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  664. Reviewed by Oliver Hunt.
  665. Minor tidy up in JITStubs.
  666. * jit/JITStubs.cpp:
  667. (JSC::StackHack::StackHack):
  668. * jit/JITStubs.h:
  669. 2009-06-05 Koen Kooi <koen@dominion.thruhere.net>
  670. Reviewed by Xan Lopez.
  671. Build fix for glib unicode backend.
  672. * wtf/unicode/glib/UnicodeMacrosFromICU.h:
  673. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  674. Reviewed by Oliver Hunt.
  675. 3 tiny cleanups:
  676. * assembler/MacroAssemblerX86.h:
  677. * assembler/MacroAssemblerX86_64.h:
  678. (JSC::MacroAssemblerX86_64::storePtrWithPatch):
  679. store*() methods should take an ImplicitAddress, rather than an Address.
  680. * assembler/X86Assembler.h:
  681. Make patchPointer private.
  682. * jit/JITOpcodes.cpp:
  683. (JSC::JIT::emit_op_ret):
  684. Remove empty line at end of function.
  685. 2009-06-05 Gavin Barraclough <barraclough@apple.com>
  686. Reviewed by Oliver Hunt.
  687. Encapsulate many uses of void* in the assembler & jit with types that provide
  688. more semantic information. The new types are:
  689. * MacroAssemblerCodePtr - this wraps a pointer into JIT generated code.
  690. * FunctionPtr - this wraps a pointer to a C/C++ function in JSC.
  691. * ReturnAddressPtr - this wraps a return address resulting from a 'call' instruction.
  692. Wrapping these types allows for stronger type-checking than is possible with everything
  693. represented a void*. For example, it is now enforced by the type system that near
  694. calls can only be linked to JIT code and not to C functions in JSC (this was previously
  695. required, but could not be enforced on the interface).
  696. * assembler/AbstractMacroAssembler.h:
  697. (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
  698. (JSC::AbstractMacroAssembler::CodeLocationCommon::dataLocation):
  699. (JSC::AbstractMacroAssembler::CodeLocationCommon::executableAddress):
  700. (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
  701. (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
  702. (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
  703. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
  704. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
  705. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
  706. (JSC::AbstractMacroAssembler::CodeLocationLabel::operator!):
  707. (JSC::AbstractMacroAssembler::CodeLocationLabel::reset):
  708. (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
  709. (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
  710. (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
  711. (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
  712. (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
  713. (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
  714. (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
  715. (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
  716. (JSC::AbstractMacroAssembler::CodeLocationNearCall::calleeReturnAddressValue):
  717. (JSC::AbstractMacroAssembler::CodeLocationNearCall::CodeLocationNearCall):
  718. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
  719. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
  720. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
  721. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
  722. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
  723. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
  724. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
  725. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::addressForLookup):
  726. (JSC::AbstractMacroAssembler::trampolineAt):
  727. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  728. (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
  729. (JSC::::CodeLocationCommon::instructionAtOffset):
  730. (JSC::::CodeLocationCommon::labelAtOffset):
  731. (JSC::::CodeLocationCommon::jumpAtOffset):
  732. (JSC::::CodeLocationCommon::callAtOffset):
  733. (JSC::::CodeLocationCommon::nearCallAtOffset):
  734. (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
  735. (JSC::::CodeLocationCommon::dataLabel32AtOffset):
  736. * assembler/MacroAssemblerCodeRef.h:
  737. (JSC::FunctionPtr::FunctionPtr):
  738. (JSC::FunctionPtr::value):
  739. (JSC::FunctionPtr::executableAddress):
  740. (JSC::ReturnAddressPtr::ReturnAddressPtr):
  741. (JSC::ReturnAddressPtr::value):
  742. (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr):
  743. (JSC::MacroAssemblerCodePtr::executableAddress):
  744. (JSC::MacroAssemblerCodePtr::dataLocation):
  745. (JSC::MacroAssemblerCodeRef::MacroAssemblerCodeRef):
  746. * assembler/X86Assembler.h:
  747. (JSC::X86Assembler::patchPointerForCall):
  748. * jit/JIT.cpp:
  749. (JSC::ctiPatchNearCallByReturnAddress):
  750. (JSC::ctiPatchCallByReturnAddress):
  751. (JSC::JIT::privateCompile):
  752. (JSC::JIT::privateCompileCTIMachineTrampolines):
  753. * jit/JIT.h:
  754. (JSC::JIT::compileCTIMachineTrampolines):
  755. * jit/JITCall.cpp:
  756. (JSC::JIT::compileOpCall):
  757. * jit/JITCode.h:
  758. (JSC::JITCode::operator !):
  759. (JSC::JITCode::addressForCall):
  760. (JSC::JITCode::offsetOf):
  761. (JSC::JITCode::execute):
  762. (JSC::JITCode::size):
  763. (JSC::JITCode::HostFunction):
  764. * jit/JITInlineMethods.h:
  765. (JSC::JIT::emitNakedCall):
  766. * jit/JITPropertyAccess.cpp:
  767. (JSC::JIT::privateCompilePutByIdTransition):
  768. (JSC::JIT::patchGetByIdSelf):
  769. (JSC::JIT::patchPutByIdReplace):
  770. (JSC::JIT::privateCompilePatchGetArrayLength):
  771. (JSC::JIT::privateCompileGetByIdProto):
  772. (JSC::JIT::privateCompileGetByIdChain):
  773. * jit/JITStubs.cpp:
  774. (JSC::JITThunks::JITThunks):
  775. (JSC::JITThunks::tryCachePutByID):
  776. (JSC::JITThunks::tryCacheGetByID):
  777. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  778. * jit/JITStubs.h:
  779. (JSC::JITThunks::ctiArrayLengthTrampoline):
  780. (JSC::JITThunks::ctiStringLengthTrampoline):
  781. (JSC::JITThunks::ctiVirtualCallPreLink):
  782. (JSC::JITThunks::ctiVirtualCallLink):
  783. (JSC::JITThunks::ctiVirtualCall):
  784. (JSC::JITThunks::ctiNativeCallThunk):
  785. * yarr/RegexJIT.h:
  786. (JSC::Yarr::RegexCodeBlock::operator!):
  787. (JSC::Yarr::RegexCodeBlock::execute):
  788. 2009-06-05 Antti Koivisto <antti@apple.com>
  789. Try to unbreak Windows build.
  790. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  791. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  792. 2009-06-03 Antti Koivisto <antti@apple.com>
  793. Reviewed by Dave Kilzer.
  794. https://bugs.webkit.org/show_bug.cgi?id=13128
  795. Safari not obeying cache header
  796. Export JSC::parseDate()
  797. * JavaScriptCore.exp:
  798. * JavaScriptCore.xcodeproj/project.pbxproj:
  799. 2009-06-04 Oliver Hunt <oliver@apple.com>
  800. Reviewed by Gavin Barraclough.
  801. Bug in property caching of getters and setters.
  802. Make sure that the transition logic accounts for getters and setters.
  803. If we don't we end up screwing up the transition tables so that some
  804. transitions will start incorrectly believing that they need to check
  805. for getters and setters.
  806. * runtime/JSObject.cpp:
  807. (JSC::JSObject::defineGetter):
  808. (JSC::JSObject::defineSetter):
  809. * runtime/JSObject.h:
  810. (JSC::):
  811. * runtime/Structure.h:
  812. 2009-06-04 Gavin Barraclough <barraclough@apple.com>
  813. Reviewed by Sam Weinig.
  814. Minor tweak to PatchBuffer, change it so it no longer holds a CodeRef, and instead
  815. holds a separate code pointer and executable pool. Since it now always holds its
  816. own copy of the code size, and to simplify the construction sequence, it's neater
  817. this way.
  818. * assembler/AbstractMacroAssembler.h:
  819. (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
  820. (JSC::AbstractMacroAssembler::PatchBuffer::finalizeCode):
  821. (JSC::AbstractMacroAssembler::PatchBuffer::code):
  822. (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
  823. 2009-06-04 Gavin Barraclough <barraclough@apple.com>
  824. Reviewed by Oliver Hunt.
  825. Remove 'JIT_STUB_ARGUMENT_STACK' this is unused and untested.
  826. This just leaves JIT_STUB_ARGUMENT_REGISTER and JIT_STUB_ARGUMENT_VA_LIST.
  827. Since JIT_STUB_ARGUMENT_REGISTER is the sensible configuration on most platforms,
  828. remove this define and make this the default behaviour.
  829. Platforms must now define JIT_STUB_ARGUMENT_VA_LIST to get crazy va_list voodoo,
  830. if they so desire.
  831. (Refactoring of #ifdefs only, no functional change, no performance impact.)
  832. * jit/JIT.h:
  833. * jit/JITInlineMethods.h:
  834. (JSC::JIT::restoreArgumentReference):
  835. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  836. * jit/JITStubs.cpp:
  837. (JSC::):
  838. * jit/JITStubs.h:
  839. * wtf/Platform.h:
  840. 2009-06-04 Gavin Barraclough <barraclough@apple.com>
  841. Rubber stamped by Sam Weinig.
  842. * jit/JITArithmetic.cpp:
  843. Remove some redundant typedefs, unused since arithmetic was added to the MacroAssembler interface.
  844. 2009-06-04 Brent Fulgham <bfulgham@webkit.org>
  845. Build fix due to header include problem.
  846. * interpreter/Interpreter.h: Remove wtf from includes so that
  847. compile can find the headers in expected places.
  848. 2009-06-04 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
  849. Reviewed by Darin Adler.
  850. HashTable class (JavaScriptCore/wtf/HashTable.h) doesn't instantiated by 'new', so
  851. inheritance was removed. HashTable struct has been instantiated by operator new in
  852. JSGlobalData.cpp:106.
  853. HashTable couldn't inherited from FastAllocBase since struct with inheritance is
  854. no longer POD, so HashTable struct has been instantiated by fastNew, destroyed by
  855. fastDelete.
  856. * interpreter/Interpreter.h:
  857. * runtime/JSGlobalData.cpp:
  858. (JSC::JSGlobalData::JSGlobalData):
  859. (JSC::JSGlobalData::~JSGlobalData):
  860. * wtf/HashTable.h:
  861. 2009-06-04 Gavin Barraclough <barraclough@apple.com>
  862. Reviewed by Oliver Hunt.
  863. Wrap the code that plants pushes/pops planted by JIT in explanatorily named
  864. methods; move property storage reallocation into a standard stub function.
  865. ~No performance impact (possible <1% progression on x86-64, likely just noise).
  866. * jit/JIT.cpp:
  867. (JSC::JIT::privateCompile):
  868. (JSC::JIT::privateCompileCTIMachineTrampolines):
  869. Wrap calls to push/pop.
  870. * jit/JIT.h:
  871. Declare the new wrapper methods.
  872. * jit/JITInlineMethods.h:
  873. (JSC::JIT::preverveReturnAddressAfterCall):
  874. (JSC::JIT::restoreReturnAddressBeforeReturn):
  875. Define the new wrapper methods.
  876. * jit/JITOpcodes.cpp:
  877. (JSC::JIT::emit_op_end):
  878. (JSC::JIT::emit_op_ret):
  879. Wrap calls to push/pop.
  880. * jit/JITPropertyAccess.cpp:
  881. (JSC::JIT::privateCompilePutByIdTransition):
  882. Move property storage reallocation into a standard stub function.
  883. * jit/JITStubs.cpp:
  884. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  885. * jit/JITStubs.h:
  886. (JSC::JITStubs::):
  887. 2009-06-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  888. Reviewed by Ariya Hidayat.
  889. [Qt] Single-threaded QtWebKit configuration
  890. <https://bugs.webkit.org/show_bug.cgi?id=26015>
  891. * JavaScriptCore.pri: Use ThreadingNone.cpp instead of
  892. ThreadingQt.cpp and make sure ENABLE_JSC_MULTIPLE_THREADS is turned off
  893. when ENABLE_SINGLE_THREADED is tuned on
  894. * wtf/ThreadingNone.cpp:
  895. (WTF::ThreadCondition::wait): Fix compilation warning.
  896. (WTF::ThreadCondition::timedWait): Ditto.
  897. 2009-06-02 Mark Rowe <mrowe@apple.com>
  898. Reviewed by Anders Carlsson.
  899. Remove workaround that was added to address <rdar://problem/5488678> as it no longer affects our Tiger builds.
  900. * Configurations/Base.xcconfig:
  901. 2009-06-02 Xan Lopez <xlopez@igalia.com>
  902. Reviewed by Sam Weinig.
  903. Use C-style comments in Platform.h so it can be included from C
  904. files.
  905. * wtf/Platform.h:
  906. 2009-06-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  907. Rubber-stamped by Simon Hausmann.
  908. Use File::Spec->tmpdir instead of hardcoded paths for tempfile() dir
  909. This fixes the Windows-build if the user does not have a /tmp directory.
  910. * pcre/dftables:
  911. 2009-06-02 Gavin Barraclough <barraclough@apple.com>
  912. Reviewed by Oliver ">>" Hunt.
  913. emitSlow_op_rshift is linking the wrong number of slow cases, if !supportsFloatingPoint().
  914. Fixerate, and refactor/comment the code a little to make it clearer what is going on.
  915. * jit/JITArithmetic.cpp:
  916. (JSC::JIT::emit_op_rshift):
  917. (JSC::JIT::emitSlow_op_rshift):
  918. 2009-06-01 Gavin Barraclough <barraclough@apple.com>
  919. Reviewed by NOBODY - speculative windows build fix (errm, for the other patch!).
  920. * jit/JITStubs.cpp:
  921. (JSC::):
  922. 2009-06-01 Gavin Barraclough <barraclough@apple.com>
  923. Reviewed by NOBODY - speculative windows build fix.
  924. * assembler/AbstractMacroAssembler.h:
  925. (JSC::::CodeLocationCall::CodeLocationCall):
  926. (JSC::::CodeLocationNearCall::CodeLocationNearCall):
  927. 2009-06-01 Gavin Barraclough <barraclough@apple.com>
  928. Reviewed by Olliej Hunt.
  929. Change JITStub functions from being static members on the JITStub class to be
  930. global extern "C" functions, and switch their the function signature declaration
  931. in the definition of the functions to be C-macro generated. This makes it easier
  932. to work with the stub functions from assembler code (since the names no longer
  933. require mangling), and by delaring the functions with a macro we can look at
  934. also auto-generating asm thunks to wrap the JITStub functions to perform the
  935. work currently in 'restoreArgumentReference' (as a memory saving).
  936. Making this change also forces us to be a bit more realistic about what is private
  937. on the Register and CallFrame objects. Presently most everything on these classes
  938. is private, and the classes have plenty of friends. We could befriend all the
  939. global functions to perpetuate the delusion of encapsulation, but using friends is
  940. a bit of a sledgehammer solution here - since friends can poke around with all of
  941. the class's privates, and since all the major classes taht operate on Regsiters are
  942. currently friends, right there is currently in practice very little protection at
  943. all. Better to start removing friend delclarations, and exposing just the parts
  944. that need to be exposed.
  945. * interpreter/CallFrame.h:
  946. (JSC::ExecState::returnPC):
  947. (JSC::ExecState::setCallerFrame):
  948. (JSC::ExecState::returnValueRegister):
  949. (JSC::ExecState::setArgumentCount):
  950. (JSC::ExecState::setCallee):
  951. (JSC::ExecState::setCodeBlock):
  952. * interpreter/Interpreter.h:
  953. * interpreter/Register.h:
  954. (JSC::Register::Register):
  955. (JSC::Register::i):
  956. * jit/JITStubs.cpp:
  957. (JSC::):
  958. (JSC::JITThunks::JITThunks):
  959. (JSC::JITThunks::tryCachePutByID):
  960. (JSC::JITThunks::tryCacheGetByID):
  961. (JSC::JITStubs::DEFINE_STUB_FUNCTION):
  962. * jit/JITStubs.h:
  963. (JSC::JITStubs::):
  964. * runtime/JSFunction.h:
  965. (JSC::JSFunction::nativeFunction):
  966. (JSC::JSFunction::classInfo):
  967. * runtime/JSGlobalData.h:
  968. 2009-06-01 Oliver Hunt <oliver@apple.com>
  969. Reviewed by Gavin Barraclough.
  970. Tidy up the literal parser.
  971. Make the number lexing in the LiteralParser exactly match the JSON spec, which
  972. makes us cover more cases, but also more strict. Also made string lexing only
  973. allow double-quoted strings.
  974. * runtime/LiteralParser.cpp:
  975. (JSC::LiteralParser::Lexer::lex):
  976. (JSC::LiteralParser::Lexer::lexString):
  977. (JSC::LiteralParser::Lexer::lexNumber):
  978. 2009-06-01 Gavin Barraclough <barraclough@apple.com>
  979. Reviewed by Sam "WX" Weinig.
  980. Allow the JIT to operate without relying on use of RWX memory, on platforms where this is supported.
  981. This patch adds a switch to Platform.h (ENABLE_ASSEMBLER_WX_EXCLUSIVE) which enables this mode of operation.
  982. When this flag is set, all executable memory will be allocated RX, and switched to RW only whilst being
  983. modified. Upon completion of code generation the protection is switched back to RX to allow execution.
  984. Further optimization will be required before it is desirable to enable this mode of operation by default;
  985. enabling this presently incurs a 5%-10% regression.
  986. (Submitting disabled - no performance impact).
  987. * assembler/AbstractMacroAssembler.h:
  988. (JSC::AbstractMacroAssembler::CodeLocationInstruction::repatchLoadToLEA):
  989. (JSC::AbstractMacroAssembler::CodeLocationLabel::fromFunctionPointer):
  990. (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
  991. (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
  992. (JSC::AbstractMacroAssembler::CodeLocationNearCall::relink):
  993. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
  994. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
  995. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
  996. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
  997. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToTrampoline):
  998. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkNearCallerToFunction):
  999. (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
  1000. (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
  1001. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  1002. (JSC::AbstractMacroAssembler::PatchBuffer::patch):
  1003. (JSC::AbstractMacroAssembler::PatchBuffer::performFinalization):
  1004. (JSC::::CodeLocationCommon::nearCallAtOffset):
  1005. (JSC::::CodeLocationCall::CodeLocationCall):
  1006. (JSC::::CodeLocationNearCall::CodeLocationNearCall):
  1007. * assembler/AssemblerBuffer.h:
  1008. (JSC::AssemblerBuffer::executableCopy):
  1009. * assembler/X86Assembler.h:
  1010. (JSC::CAN_SIGN_EXTEND_U32_64):
  1011. (JSC::X86Assembler::linkJump):
  1012. (JSC::X86Assembler::linkCall):
  1013. (JSC::X86Assembler::patchPointer):
  1014. (JSC::X86Assembler::relinkJump):
  1015. (JSC::X86Assembler::relinkCall):
  1016. (JSC::X86Assembler::repatchInt32):
  1017. (JSC::X86Assembler::repatchPointer):
  1018. (JSC::X86Assembler::repatchLoadToLEA):
  1019. (JSC::X86Assembler::patchInt32):
  1020. (JSC::X86Assembler::patchRel32):
  1021. * jit/ExecutableAllocator.h:
  1022. (JSC::ExecutableAllocator::):
  1023. (JSC::ExecutableAllocator::makeWritable):
  1024. (JSC::ExecutableAllocator::makeExecutable):
  1025. * jit/ExecutableAllocatorFixedVMPool.cpp:
  1026. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  1027. * jit/ExecutableAllocatorPosix.cpp:
  1028. (JSC::ExecutablePool::systemAlloc):
  1029. (JSC::ExecutablePool::systemRelease):
  1030. (JSC::ExecutableAllocator::reprotectRegion):
  1031. * jit/ExecutableAllocatorWin.cpp:
  1032. * jit/JITPropertyAccess.cpp:
  1033. (JSC::JIT::patchGetByIdSelf):
  1034. (JSC::JIT::patchPutByIdReplace):
  1035. * wtf/Platform.h:
  1036. 2009-05-29 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
  1037. Reviewed by Darin Adler.
  1038. Inherits Interpreter class from FastAllocBase because it has been
  1039. instantiated by 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
  1040. * interpreter/Interpreter.h:
  1041. 2009-06-01 David Levin <levin@chromium.org>
  1042. Reviewed by NOBODY (windows build fix).
  1043. Add exports for windows (corresponding to the JavaScriptCore.exp modification
  1044. in the previous change).
  1045. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  1046. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  1047. 2009-06-01 David Levin <levin@chromium.org>
  1048. Reviewed by Darin Alder and Maciej Stachowiak.
  1049. Bug 26057: StringImpl should share buffers with UString.
  1050. https://bugs.webkit.org/show_bug.cgi?id=26057
  1051. * JavaScriptCore.exp:
  1052. * runtime/UString.cpp:
  1053. (JSC::UString::Rep::create):
  1054. (JSC::UString::BaseString::sharedBuffer): Only do the sharing when
  1055. the buffer exceeds a certain size. The size was tuned by running
  1056. various dom benchmarks with numbers ranging from 20 to 800 and finding
  1057. a place that seemed to do the best overall.
  1058. * runtime/UString.h:
  1059. 2009-05-31 Gavin Barraclough <barraclough@apple.com>
  1060. Reviewed by Olliej "you just need to change NativeFunctionWrapper.h" Hunt.
  1061. Add ENABLE_JIT_OPTIMIZE_NATIVE_CALL switch to allow JIT to operate without native call optimizations.
  1062. * runtime/NativeFunctionWrapper.h:
  1063. * wtf/Platform.h:
  1064. 2009-05-30 Darin Adler <darin@apple.com>
  1065. Reviewed by Sam Weinig.
  1066. <rdar://problem/6935193> REGRESSION (r42734): Celtic Kane JavaScript benchmark does not run:
  1067. "Maximum call stack size exceeded"
  1068. * runtime/ArrayPrototype.cpp:
  1069. (JSC::arrayProtoFuncToString): Use the same recursion limit as the other recursion checks.
  1070. We need a limit of at least 100 to run the benchmark above.
  1071. (JSC::arrayProtoFuncToLocaleString): Ditto.
  1072. (JSC::arrayProtoFuncJoin): Ditto.
  1073. 2009-05-28 Dirk Schulze <krit@webkit.org>
  1074. Reviewed by Nikolas Zimmermann.
  1075. Added new build flag --filters for Mac. More details in WebCore/ChangeLog.
  1076. * Configurations/FeatureDefines.xcconfig:
  1077. 2009-05-27 Oliver Hunt <oliver@apple.com>
  1078. Reviewed by Mark Rowe.
  1079. <rdar://problem/6928025> Stack overflow in JSC::stringProtoFuncReplace() running jsFunFuzz
  1080. We should always check for exceptions after creating a CachedCall, this wasn't being done in
  1081. the string replace logic.
  1082. * runtime/StringPrototype.cpp:
  1083. (JSC::stringProtoFuncReplace):
  1084. 2009-05-27 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
  1085. Unreviewed (make distcheck) build fix; adding missing headers.
  1086. * GNUmakefile.am:
  1087. 2009-05-27 Jessie Berlin <jberlin@apple.com>
  1088. Reviewed by Adam Roben
  1089. Fix the Windows build.
  1090. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  1091. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  1092. 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
  1093. Reviewed by Gustavo Noronha.
  1094. When building on Windows, consider Windows specific files.
  1095. * GNUmakefile.am:
  1096. 2009-05-27 Fridrich Strba <fridrich.strba@bluewin.ch>
  1097. Reviewed by Maciej Stachowiak.
  1098. When building with MinGW, don't use the __declspec(dl{import,export})
  1099. decorations and rely on the linker to use its nifty auto-import feature.
  1100. It is extremely hard to get the decorations right with MinGW in general
  1101. and impossible in WebKit, where the resulting shared library is linking
  1102. together some static libraries.
  1103. * config.h:
  1104. 2009-05-26 Holger Hans Peter Freyther <zecke@selfish.org>
  1105. Reviewed by Xan Lopez.
  1106. https://bugs.webkit.org/show_bug.cgi?id=25613
  1107. Be able to use GOwnPtr for GHashTable as well. The assumption
  1108. is that the hash table has been created with g_hash_table_new_full
  1109. and has proper destruction functions.
  1110. * wtf/GOwnPtr.cpp:
  1111. (WTF::GHashTable):
  1112. * wtf/GOwnPtr.h:
  1113. 2009-05-26 Oliver Hunt <oliver@apple.com>
  1114. Reviewed by Gavin Barraclough.
  1115. <rdar://problem/6924033> REGRESSION: Assertion failure due to forward references
  1116. Add a pattern type for forward references to ensure that we don't confuse the
  1117. quantifier alternatives assertion.
  1118. * yarr/RegexCompiler.cpp:
  1119. (JSC::Yarr::RegexPatternConstructor::atomBackReference):
  1120. (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
  1121. * yarr/RegexInterpreter.cpp:
  1122. (JSC::Yarr::ByteCompiler::emitDisjunction):
  1123. * yarr/RegexJIT.cpp:
  1124. (JSC::Yarr::RegexGenerator::generateTerm):
  1125. * yarr/RegexPattern.h:
  1126. (JSC::Yarr::PatternTerm::):
  1127. (JSC::Yarr::PatternTerm::PatternTerm):
  1128. (JSC::Yarr::PatternTerm::ForwardReference):
  1129. 2009-05-26 Gavin Barraclough <barraclough@apple.com>
  1130. Reviewed by Oliver Hunt.
  1131. Fix for: <rdar://problem/6918095> REGRESSION: jQuery load() issue (25981),
  1132. and also an ASSERT failure on http://ihasahotdog.com/.
  1133. When overwriting a property on a dictionary with a cached specific value,
  1134. clear the cache if new value being written is different.
  1135. * JavaScriptCore.exp:
  1136. Export the new symbols.
  1137. * jit/JITStubs.cpp:
  1138. (JSC::JITStubs::cti_op_get_by_id_method_check_second):
  1139. Close dictionary prototypes upon caching a method access, as would happen when caching
  1140. a regular get_by_id.
  1141. * runtime/JSObject.h:
  1142. (JSC::JSObject::propertyStorage):
  1143. (JSC::JSObject::locationForOffset):
  1144. Make these methods private.
  1145. (JSC::JSObject::putDirectInternal):
  1146. When overwriting a property on a dictionary with a cached specific value,
  1147. clear the cache if new value being written is different.
  1148. * runtime/Structure.cpp:
  1149. (JSC::Structure::despecifyDictionaryFunction):
  1150. Reset the specific value field for a given property in a dictionary.
  1151. (JSC::Structure::despecifyFunctionTransition):
  1152. Rename of 'changeFunctionTransition' (this was already internally refered to as a despecification).
  1153. * runtime/Structure.h:
  1154. Declare new method.
  1155. 2009-05-26 Gavin Barraclough <barraclough@apple.com>
  1156. Reviewed by Oliver "pieces of eight" Hunt.
  1157. When reseting RegexPattern class, should fully reset the class, not just bits of it.
  1158. In particular, we delete the cached character classes (for wordchars, etc), but do
  1159. not reset the set of pointers to the cached classes. In the case of a repeated parse
  1160. due to an illegal back-reference we will continue to use the deleted character class.
  1161. * yarr/RegexPattern.h:
  1162. (JSC::Yarr::RegexPattern::reset):
  1163. 2009-05-26 Brent Fulgham <bfulgham@webkit.org>
  1164. Build fix to correct r44161.
  1165. * wtf/FastAllocBase.h:
  1166. 2009-05-26 Zoltan Horvath <horvath.zoltan.6@stud.u-szeged.hu>
  1167. Reviewed by Maciej Stachowiak.
  1168. Inherite HashTable from FastAllocBase, because it has been instantiated by
  1169. 'new' in JavaScriptCore/runtime/JSGlobalData.cpp.
  1170. * wtf/HashTable.h:
  1171. * wtf/FastAllocBase.h: Remove 'wtf' path from TypeTraits.h to allow use outside of wtf.
  1172. 2009-05-25 David Levin <levin@chromium.org>
  1173. Reviewed by Maciej Stachowiak and Oliver Hunt.
  1174. https://bugs.webkit.org/show_bug.cgi?id=25126
  1175. Allow the buffer underlying UString to be shared.
  1176. In order to not grow the underlying size of any structure,
  1177. there is a union in the Rep string which holds
  1178. + m_sharedBuffer -- a pointer to the shared ref counted buffer
  1179. if the class is BaseString and the buffer is being shared OR
  1180. + m_baseString -- the BaseString if the class is only UString::Rep
  1181. but not a UString::BaseString
  1182. Ideally, m_sharedBuffer would be a RefPtr, but it cannot be because
  1183. it is in a union.
  1184. No change in sunspider perf.
  1185. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  1186. * JavaScriptCore.xcodeproj/project.pbxproj:
  1187. * runtime/UString.cpp:
  1188. (JSC::UString::Rep::share):
  1189. (JSC::UString::Rep::destroy):
  1190. (JSC::UString::BaseString::sharedBuffer):
  1191. (JSC::UString::BaseString::setSharedBuffer):
  1192. (JSC::UString::BaseString::slowIsBufferReadOnly):
  1193. (JSC::expandCapacity):
  1194. (JSC::UString::Rep::reserveCapacity):
  1195. (JSC::UString::expandPreCapacity):
  1196. (JSC::concatenate):
  1197. (JSC::UString::append):
  1198. * runtime/UString.h:
  1199. (JSC::UString::Rep::Rep):
  1200. (JSC::UString::Rep::):
  1201. (JSC::UString::BaseString::isShared):
  1202. (JSC::UString::BaseString::isBufferReadOnly):
  1203. (JSC::UString::Rep::baseString):
  1204. * wtf/CrossThreadRefCounted.h:
  1205. (WTF::CrossThreadRefCounted::isShared):
  1206. * wtf/OwnFastMallocPtr.h: Added.
  1207. (WTF::OwnFastMallocPtr::OwnFastMallocPtr):
  1208. (WTF::OwnFastMallocPtr::~OwnFastMallocPtr):
  1209. (WTF::OwnFastMallocPtr::get):
  1210. (WTF::OwnFastMallocPtr::release):
  1211. 2009-05-25 Oliver Hunt <oliver@apple.com>
  1212. Reviewed by Maciej Stachowiak.
  1213. Re-add interpreter logic to jit-enabled builds as GCC mysteriously regresses without it
  1214. * wtf/Platform.h:
  1215. 2009-05-25 Fridrich Strba <fridrich.strba@bluewin.ch>
  1216. Reviewed by Maciej Stachowiak.
  1217. The functions written in assembly need to have a leading
  1218. underscore on Windows too.
  1219. * jit/JITStubs.cpp:
  1220. 2009-05-24 Steve Falkenburg <sfalken@apple.com>
  1221. Build fix for experimental PGO Windows target.
  1222. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1223. 2009-05-23 David Kilzer <ddkilzer@apple.com>
  1224. Part 1 of 2: Bug 25495: Implement PassOwnPtr and replace uses of std::auto_ptr
  1225. <https://bugs.webkit.org/show_bug.cgi?id=25495>
  1226. Reviewed by Oliver Hunt.
  1227. * GNUmakefile.am: Added OwnPtrCommon.h and PassOwnPtr.h.
  1228. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
  1229. * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  1230. * wtf/OwnPtr.h:
  1231. (WTF::OwnPtr::OwnPtr): Added constructors that take a
  1232. PassOwnPtr. Also added a copy constructor declaration that's
  1233. required when assigning a PassOwnPtr to a stack-based OwnPtr.
  1234. (WTF::operator=): Added assignment operator methods that take a
  1235. PassOwnPtr.
  1236. (WTF::swap): Reformatted.
  1237. (WTF::operator==): Whitespace changes.
  1238. (WTF::operator!=): Ditto.
  1239. * wtf/OwnPtrCommon.h: Added.
  1240. (WTF::deleteOwnedPtr):
  1241. * wtf/PassOwnPtr.h: Added.
  1242. (WTF::PassOwnPtr::PassOwnPtr):
  1243. (WTF::PassOwnPtr::~PassOwnPtr):
  1244. (WTF::PassOwnPtr::get):
  1245. (WTF::PassOwnPtr::clear):
  1246. (WTF::PassOwnPtr::release):
  1247. (WTF::PassOwnPtr::operator*):
  1248. (WTF::PassOwnPtr::operator->):
  1249. (WTF::PassOwnPtr::operator!):
  1250. (WTF::PassOwnPtr::operator UnspecifiedBoolType):
  1251. (WTF::::operator):
  1252. (WTF::operator==):
  1253. (WTF::operator!=):
  1254. (WTF::static_pointer_cast):
  1255. (WTF::const_pointer_cast):
  1256. (WTF::getPtr):
  1257. 2009-05-23 Oliver Hunt <oliver@apple.com>
  1258. Reviewed by Maciej Stachowiak.
  1259. Remove interpreter specific logic from the JIT builds.
  1260. This saves ~100k in JSC release builds.
  1261. * interpreter/Interpreter.cpp:
  1262. (JSC::Interpreter::privateExecute):
  1263. * interpreter/Interpreter.h:
  1264. * wtf/Platform.h:
  1265. 2009-05-22 Mark Rowe <mrowe@apple.com>
  1266. Part two of an attempted Windows build fix.
  1267. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  1268. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  1269. 2009-05-22 Mark Rowe <mrowe@apple.com>
  1270. Part one of an attempted Windows build fix.
  1271. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  1272. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  1273. 2009-05-21 Gavin Barraclough <barraclough@apple.com>
  1274. Reviewed by Geoff Garen.
  1275. op_method_check
  1276. Optimize method calls, by caching specific function values within the Structure.
  1277. The new opcode is used almost like an x86 opcode prefix byte to optimize op_get_by_id,
  1278. where the property access is being used to read a function to be passed to op-call (i.e.
  1279. 'foo.bar();'). This patch modifies the Structure class such that when a property is
  1280. put to an object for the first time we will check if the value is a function. If it is,
  1281. we will cache the function value on the Structure. A Structure in such a state guarantees
  1282. that not only does a property with the given identifier exist on the object, but also that
  1283. its value is unchanged. Upon any further attempt to put a property with the same identifier
  1284. (but a different value) to the object, it will transition back to a normal Structure (where
  1285. it will guarantee the presence but not the value of the property).
  1286. op_method_check makes use of the new information made available by the Structure, by
  1287. augmenting the functionality of op_get_by_id. Upon generating a FunctionCallDotNode a
  1288. check will be emitted prior to the property access reading the function value, and the JIT
  1289. will generate an extra (initially unlinked but patchable) set of checks prior to the regular
  1290. JIT code for get_by_id. The new code will do inline structure and prototype structure check
  1291. (unlike a regular get_by_id, which can only handle 'self' accesses inline), and then performs
  1292. an immediate load of the function value, rather than using memory accesses to load the value
  1293. from the obejct's property storage array. If the method check fails it will revert, or if
  1294. the access is polymorphic, the op_get_by_id will continue to operate - and optimize itself -
  1295. just as any other regular op_get_by_id would.
  1296. ~2.5% on v8-tests, due to a ~9% progression on richards.
  1297. * API/JSCallbackObjectFunctions.h:
  1298. (JSC::::put):
  1299. (JSC::::staticFunctionGetter):
  1300. * API/JSObjectRef.cpp:
  1301. (JSObjectMakeConstructor):
  1302. * JavaScriptCore.exp:
  1303. * assembler/AbstractMacroAssembler.h:
  1304. (JSC::AbstractMacroAssembler::differenceBetween):
  1305. * assembler/MacroAssemblerX86.h:
  1306. (JSC::MacroAssemblerX86::moveWithPatch):
  1307. * bytecode/CodeBlock.cpp:
  1308. (JSC::CodeBlock::dump):
  1309. * bytecode/CodeBlock.h:
  1310. (JSC::getMethodCallLinkInfoReturnLocation):
  1311. (JSC::CodeBlock::getMethodCallLinkInfo):
  1312. (JSC::CodeBlock::addMethodCallLinkInfos):
  1313. (JSC::CodeBlock::methodCallLinkInfo):
  1314. * bytecode/Opcode.h:
  1315. * bytecompiler/BytecodeGenerator.cpp:
  1316. (JSC::BytecodeGenerator::emitMethodCheck):
  1317. * bytecompiler/BytecodeGenerator.h:
  1318. * interpreter/Interpreter.cpp:
  1319. (JSC::Interpreter::privateExecute):
  1320. * jit/JIT.cpp:
  1321. (JSC::JIT::privateCompileMainPass):
  1322. (JSC::JIT::privateCompileSlowCases):
  1323. (JSC::JIT::privateCompile):
  1324. * jit/JIT.h:
  1325. (JSC::MethodCallCompilationInfo::MethodCallCompilationInfo):
  1326. * jit/JITOpcodes.cpp:
  1327. * jit/JITPropertyAccess.cpp:
  1328. (JSC::JIT::emit_op_method_check):
  1329. (JSC::JIT::emitSlow_op_method_check):
  1330. (JSC::JIT::emit_op_get_by_id):
  1331. (JSC::JIT::emitSlow_op_get_by_id):
  1332. (JSC::JIT::emit_op_put_by_id):
  1333. (JSC::JIT::emitSlow_op_put_by_id):
  1334. (JSC::JIT::compileGetByIdHotPath):
  1335. (JSC::JIT::compileGetByIdSlowCase):
  1336. (JSC::JIT::patchMethodCallProto):
  1337. * jit/JITStubs.cpp:
  1338. (JSC::JITStubs::cti_op_get_by_id_method_check):
  1339. (JSC::JITStubs::cti_op_get_by_id_method_check_second):
  1340. * jit/JITStubs.h:
  1341. * jsc.cpp:
  1342. (GlobalObject::GlobalObject):
  1343. * parser/Nodes.cpp:
  1344. (JSC::FunctionCallDotNode::emitBytecode):
  1345. * runtime/Arguments.cpp:
  1346. (JSC::Arguments::put):
  1347. * runtime/ArrayConstructor.cpp:
  1348. (JSC::ArrayConstructor::ArrayConstructor):
  1349. * runtime/BooleanConstructor.cpp:
  1350. (JSC::BooleanConstructor::BooleanConstructor):
  1351. * runtime/DateConstructor.cpp:
  1352. (JSC::DateConstructor::DateConstructor):
  1353. * runtime/ErrorConstructor.cpp:
  1354. (JSC::ErrorConstructor::ErrorConstructor):
  1355. (JSC::constructError):
  1356. * runtime/ErrorPrototype.cpp:
  1357. (JSC::ErrorPrototype::ErrorPrototype):
  1358. * runtime/FunctionConstructor.cpp:
  1359. (JSC::FunctionConstructor::FunctionConstructor):
  1360. * runtime/FunctionPrototype.cpp:
  1361. (JSC::FunctionPrototype::FunctionPrototype):
  1362. * runtime/InternalFunction.cpp:
  1363. (JSC::InternalFunction::InternalFunction):
  1364. * runtime/JSActivation.cpp:
  1365. (JSC::JSActivation::put):
  1366. (JSC::JSActivation::putWithAttributes):
  1367. * runtime/JSByteArray.cpp:
  1368. (JSC::JSByteArray::JSByteArray):
  1369. * runtime/JSFunction.cpp:
  1370. (JSC::JSFunction::JSFunction):
  1371. (JSC::JSFunction::getOwnPropertySlot):
  1372. * runtime/JSGlobalObject.cpp:
  1373. (JSC::JSGlobalObject::putWithAttributes):
  1374. (JSC::JSGlobalObject::reset):
  1375. (JSC::JSGlobalObject::mark):
  1376. * runtime/JSGlobalObject.h:
  1377. (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
  1378. (JSC::JSGlobalObject::methodCallDummy):
  1379. * runtime/JSObject.cpp:
  1380. (JSC::JSObject::put):
  1381. (JSC::JSObject::putWithAttributes):
  1382. (JSC::JSObject::deleteProperty):
  1383. (JSC::JSObject::defineGetter):
  1384. (JSC::JSObject::defineSetter):
  1385. (JSC::JSObject::getPropertyAttributes):
  1386. (JSC::JSObject::getPropertySpecificFunction):
  1387. (JSC::JSObject::putDirectFunction):
  1388. (JSC::JSObject::putDirectFunctionWithoutTransition):
  1389. * runtime/JSObject.h:
  1390. (JSC::getJSFunction):
  1391. (JSC::JSObject::getDirectLocation):
  1392. (JSC::JSObject::putDirect):
  1393. (JSC::JSObject::putDirectWithoutTransition):
  1394. * runtime/LiteralParser.cpp:
  1395. (JSC::LiteralParser::parseObject):
  1396. * runtime/Lookup.cpp:
  1397. (JSC::setUpStaticFunctionSlot):
  1398. * runtime/Lookup.h:
  1399. (JSC::lookupPut):
  1400. * runtime/MathObject.cpp:
  1401. (JSC::MathObject::MathObject):
  1402. * runtime/NativeErrorConstructor.cpp:
  1403. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  1404. (JSC::NativeErrorConstructor::construct):
  1405. * runtime/NativeErrorPrototype.cpp:
  1406. (JSC::NativeErrorPrototype::NativeErrorPrototype):
  1407. * runtime/NumberConstructor.cpp:
  1408. (JSC::NumberConstructor::NumberConstructor):
  1409. * runtime/ObjectConstructor.cpp:
  1410. (JSC::ObjectConstructor::ObjectConstructor):
  1411. * runtime/PropertyMapHashTable.h:
  1412. (JSC::PropertyMapEntry::PropertyMapEntry):
  1413. * runtime/PrototypeFunction.cpp:
  1414. (JSC::PrototypeFunction::PrototypeFunction):
  1415. * runtime/PutPropertySlot.h:
  1416. (JSC::PutPropertySlot::):
  1417. (JSC::PutPropertySlot::PutPropertySlot):
  1418. (JSC::PutPropertySlot::setNewProperty):
  1419. (JSC::PutPropertySlot::setDespecifyFunctionProperty):
  1420. (JSC::PutPropertySlot::isCacheable):
  1421. (JSC::PutPropertySlot::cachedOffset):
  1422. * runtime/RegExpConstructor.cpp:
  1423. (JSC::RegExpConstructor::RegExpConstructor):
  1424. * runtime/StringConstructor.cpp:
  1425. (JSC::StringConstructor::StringConstructor):
  1426. * runtime/StringPrototype.cpp:
  1427. (JSC::StringPrototype::StringPrototype):
  1428. * runtime/Structure.cpp:
  1429. (JSC::Structure::Structure):
  1430. (JSC::Structure::~Structure):
  1431. (JSC::Structure::materializePropertyMap):
  1432. (JSC::Structure::addPropertyTransitionToExistingStructure):
  1433. (JSC::Structure::addPropertyTransition):
  1434. (JSC::Structure::changeFunctionTransition):
  1435. (JSC::Structure::addPropertyWithoutTransition):
  1436. (JSC::Structure::get):
  1437. (JSC::Structure::despecifyFunction):
  1438. (JSC::Structure::put):
  1439. (JSC::Structure::remove):
  1440. * runtime/Structure.h:
  1441. (JSC::Structure::get):
  1442. (JSC::Structure::specificFunction):
  1443. * runtime/StructureTransitionTable.h:
  1444. (JSC::StructureTransitionTableHashTraits::emptyValue):
  1445. * wtf/Platform.h:
  1446. 2009-05-22 Brent Fulgham <bfulgham@webkit.org>
  1447. Reviewed by Steve Falkenburg.
  1448. https://bugs.webkit.org/show_bug.cgi?id=25950
  1449. JavaScriptCore Fails to build on Windows (Cairo) due to CoreFoundation
  1450. link requirement.
  1451. Modify project to add new Debug_CFLite and Release_CFLite targets. These
  1452. use the new JavaScriptCoreCFLite.vsprops to link against CFLite.dll.
  1453. Existing projects are changed to use the new JavaScriptCoreCF.vsprops
  1454. to link against CoreFoundation.dll.
  1455. The JavaScriptCoreCommon.vsprops is modified to remove the link
  1456. against CoreFoundation.dll.
  1457. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1458. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added.
  1459. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added.
  1460. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
  1461. 2009-05-22 Dominik Röttsches <dominik.roettsches@access-company.com>
  1462. Reviewed by Gustavo Noronha.
  1463. https://bugs.webkit.org/show_bug.cgi?id=15914
  1464. [GTK] Implement Unicode functionality using GLib
  1465. Original patch by Jürg Billeter and Naiem Shaik.
  1466. Implementing WTF Unicode functionality based on GLib.
  1467. * GNUmakefile.am:
  1468. * wtf/unicode/Unicode.h:
  1469. * wtf/unicode/glib: Added.
  1470. * wtf/unicode/glib/UnicodeGLib.cpp: Added.
  1471. (WTF::Unicode::foldCase):
  1472. (WTF::Unicode::toLower):
  1473. (WTF::Unicode::toUpper):
  1474. (WTF::Unicode::direction):
  1475. (WTF::Unicode::umemcasecmp):
  1476. * wtf/unicode/glib/UnicodeGLib.h: Added.
  1477. (WTF::Unicode::):
  1478. (WTF::Unicode::toLower):
  1479. (WTF::Unicode::toUpper):
  1480. (WTF::Unicode::toTitleCase):
  1481. (WTF::Unicode::isArabicChar):
  1482. (WTF::Unicode::isFormatChar):
  1483. (WTF::Unicode::isSeparatorSpace):
  1484. (WTF::Unicode::isPrintableChar):
  1485. (WTF::Unicode::isDigit):
  1486. (WTF::Unicode::isPunct):
  1487. (WTF::Unicode::mirroredChar):
  1488. (WTF::Unicode::category):
  1489. (WTF::Unicode::isLower):
  1490. (WTF::Unicode::digitValue):
  1491. (WTF::Unicode::combiningClass):
  1492. (WTF::Unicode::decompositionType):
  1493. * wtf/unicode/glib/UnicodeMacrosFromICU.h: Added.
  1494. 2009-05-21 Xan Lopez <xlopez@igalia.com>
  1495. Unreviewed build fix.
  1496. Add MacroAssemblerCodeRef.h to file list.
  1497. * GNUmakefile.am:
  1498. 2009-05-21 Gavin Barraclough <barraclough@apple.com>
  1499. Reviewed by Darin Adler.
  1500. Addition of MacroAssemblerCodeRef.h rubber stamped by Geoff Garen.
  1501. Refactor JIT code-handle objects. The representation of generated code is currently
  1502. a bit of a mess. We have a class JITCode which wraps the pointer to a block of
  1503. generated code, but this object does not reference the executable pool meaning that
  1504. external events (the pool being derefed) could make the pointer become invalid.
  1505. To overcome this both the JIT and Yarr implement further (and similar) objects to
  1506. wrap the code pointer with a RefPtr to the pool. To add to the mire, as well as the
  1507. CodeBlock containing a handle onto the code the FunctionBodyNode also contains a
  1508. copy of the code pointer which is used almost (but not entirely) uniquely to access
  1509. the JIT code for a function.
  1510. Rationalization of all this:
  1511. * Add a new type 'MacroAssembler::CodeRef' as a handle for a block of JIT generated code.
  1512. * Change the JIT & Yarr to internally handle code using CodeRefs.
  1513. * Move the CodeRef (formerly anow defunct JITCodeRef) from CodeBlock to its owner node.
  1514. * Remove the (now) redundant code pointer from FunctionBodyNode.
  1515. While tidying this up I've made the PatchBuffer return code in new allocations using a CodeRef,
  1516. and have enforced an interface that the PatchBuffer will always be used, and 'finalizeCode()' or
  1517. 'finalizeCodeAddendum()' will always be called exactly once on the PatchBuffer to complete code generation.
  1518. This gives us a potentially useful hook ('PatchBuffer::performFinalization()') at the end of generation,
  1519. which may have a number of uses. It may be helpful should we wish to switch our generation
  1520. model to allow RW/RX exclusive memory, and it may be useful on non-cache-coherent platforms to
  1521. give us an oportunity to cache flush as necessary.
  1522. No performance impact.
  1523. * assembler/AbstractMacroAssembler.h:
  1524. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToTrampoline):
  1525. (JSC::AbstractMacroAssembler::CodeRef::CodeRef):
  1526. (JSC::AbstractMacroAssembler::CodeRef::trampolineAt):
  1527. (JSC::AbstractMacroAssembler::PatchBuffer::PatchBuffer):
  1528. (JSC::AbstractMacroAssembler::PatchBuffer::~PatchBuffer):
  1529. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  1530. (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
  1531. (JSC::AbstractMacroAssembler::PatchBuffer::patch):
  1532. (JSC::AbstractMacroAssembler::PatchBuffer::complete):
  1533. (JSC::AbstractMacroAssembler::PatchBuffer::finalize):
  1534. (JSC::AbstractMacroAssembler::PatchBuffer::entry):
  1535. * bytecode/CodeBlock.cpp:
  1536. (JSC::CodeBlock::CodeBlock):
  1537. (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
  1538. (JSC::CodeBlock::setJITCode):
  1539. * bytecode/CodeBlock.h:
  1540. (JSC::CodeBlock::getBytecodeIndex):
  1541. (JSC::CodeBlock::executablePool):
  1542. * interpreter/CallFrameClosure.h:
  1543. * interpreter/Interpreter.cpp:
  1544. (JSC::Interpreter::execute):
  1545. (JSC::Interpreter::prepareForRepeatCall):
  1546. * jit/JIT.cpp:
  1547. (JSC::JIT::privateCompile):
  1548. (JSC::JIT::privateCompileCTIMachineTrampolines):
  1549. (JSC::JIT::linkCall):
  1550. * jit/JIT.h:
  1551. * jit/JITCode.h:
  1552. (JSC::JITCode::JITCode):
  1553. (JSC::JITCode::operator bool):
  1554. (JSC::JITCode::addressForCall):
  1555. (JSC::JITCode::offsetOf):
  1556. (JSC::JITCode::execute):
  1557. (JSC::JITCode::size):
  1558. (JSC::JITCode::executablePool):
  1559. (JSC::JITCode::HostFunction):
  1560. * jit/JITPropertyAccess.cpp:
  1561. (JSC::JIT::privateCompilePutByIdTransition):
  1562. (JSC::JIT::privateCompilePatchGetArrayLength):
  1563. (JSC::JIT::privateCompileGetByIdProto):
  1564. (JSC::JIT::privateCompileGetByIdSelfList):
  1565. (JSC::JIT::privateCompileGetByIdProtoList):
  1566. (JSC::JIT::privateCompileGetByIdChainList):
  1567. (JSC::JIT::privateCompileGetByIdChain):
  1568. * jit/JITStubs.cpp:
  1569. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  1570. (JSC::JITStubs::cti_vm_lazyLinkCall):
  1571. * parser/Nodes.cpp:
  1572. (JSC::ProgramNode::generateJITCode):
  1573. (JSC::EvalNode::generateJITCode):
  1574. (JSC::FunctionBodyNode::FunctionBodyNode):
  1575. (JSC::FunctionBodyNode::createNativeThunk):
  1576. (JSC::FunctionBodyNode::generateJITCode):
  1577. * parser/Nodes.h:
  1578. (JSC::ScopeNode::generatedJITCode):
  1579. (JSC::ScopeNode::getExecutablePool):
  1580. (JSC::ScopeNode::setJITCode):
  1581. (JSC::ProgramNode::jitCode):
  1582. (JSC::EvalNode::jitCode):
  1583. (JSC::FunctionBodyNode::jitCode):
  1584. * runtime/RegExp.cpp:
  1585. (JSC::RegExp::match):
  1586. * yarr/RegexJIT.cpp:
  1587. (JSC::Yarr::RegexGenerator::compile):
  1588. (JSC::Yarr::jitCompileRegex):
  1589. (JSC::Yarr::executeRegex):
  1590. * yarr/RegexJIT.h:
  1591. (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
  1592. (JSC::Yarr::RegexCodeBlock::pcreFallback):
  1593. (JSC::Yarr::RegexCodeBlock::setFallback):
  1594. (JSC::Yarr::RegexCodeBlock::operator bool):
  1595. (JSC::Yarr::RegexCodeBlock::set):
  1596. (JSC::Yarr::RegexCodeBlock::execute):
  1597. 2009-05-21 Oliver Hunt <oliver@apple.com>
  1598. Reviewed by Maciej Stachowiak.
  1599. <rdar://problem/6910264> REGRESSION: Cached DOM global object property access fails in browser (25921)
  1600. <https://bugs.webkit.org/show_bug.cgi?id=25921>
  1601. When caching properties on the global object we need to ensure that we're
  1602. not attempting to cache through a shell object.
  1603. * interpreter/Interpreter.cpp:
  1604. (JSC::Interpreter::resolveGlobal):
  1605. * jit/JITStubs.cpp:
  1606. (JSC::JITStubs::cti_op_resolve_global):
  1607. 2009-05-21 Steve Falkenburg <sfalken@apple.com>
  1608. Windows build fix.
  1609. * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
  1610. 2009-05-21 Cameron Zwarich <zwarich@apple.com>
  1611. Reviewed by Mark Rowe.
  1612. Bug 25945: Add support for MADV_FREE to TCMalloc
  1613. <https://bugs.webkit.org/show_bug.cgi?id=25945>
  1614. <rdar://problem/6910754>
  1615. Add support for MADV_FREE to TCMalloc_SystemRelease for platforms that
  1616. don't also support MADV_FREE_REUSE. The code is identical to the MADV_DONTNEED
  1617. case except for the advice passed to madvise(), so combining the two cases
  1618. makes the most sense.
  1619. * wtf/Platform.h: Only define HAVE_MADV_FREE when not building on Tiger or
  1620. Leopard, because while it is defined on these platforms it actually does
  1621. nothing.
  1622. * wtf/TCSystemAlloc.cpp:
  1623. (TCMalloc_SystemRelease): use MADV_FREE if it is available; otherwise use
  1624. MADV_DONTNEED.
  1625. 2009-05-21 Mark Rowe <mrowe@apple.com>
  1626. Reviewed by Oliver Hunt.
  1627. Fix <https://bugs.webkit.org/show_bug.cgi?id=25917> / <rdar://problem/6910066>.
  1628. Bug 25917: REGRESSION (r43559?): Javascript debugger crashes when pausing page
  1629. The debugger currently retrieves the arguments object from an activation rather than pulling
  1630. it from a call frame. This is unreliable to due to the recent optimization to lazily create
  1631. the arguments object. In the long-term it should stop doing that (<rdar://problem/6911886>),
  1632. but for now we force eager creation of the arguments object when debugging.
  1633. * bytecompiler/BytecodeGenerator.cpp:
  1634. (JSC::BytecodeGenerator::BytecodeGenerator):
  1635. 2009-05-21 Cameron Zwarich <zwarich@apple.com>
  1636. Reviewed by Maciej Stachowiak.
  1637. Bug 25912: Harden NumberPrototype.cpp by removing use of strcpy()
  1638. <https://bugs.webkit.org/show_bug.cgi?id=25912>
  1639. This causes no change on SunSpider.
  1640. * runtime/NumberPrototype.cpp:
  1641. (JSC::integerPartNoExp): replace strcpy() with memcpy(), ASSERT that the
  1642. temporary buffer has sufficient space to store the result, and move the
  1643. explicit null-termination closer to the memcpy() for easier visual inspection
  1644. of the code.
  1645. (JSC::fractionalPartToString): replace strcpy() with memcpy(), and ASSERT
  1646. that the temporary buffer has sufficient space to store the result. There
  1647. is no explicit null-termination because this is done by the caller. The
  1648. same is already true for exponentialPartToString().
  1649. (JSC::numberProtoFuncToExponential): replace strcpy() with memcpy(), explicitly
  1650. null-terminate the result, and ASSERT that the temporary buffer has sufficient
  1651. space to store the result.
  1652. 2009-05-20 Sam Weinig <sam@webkit.org>
  1653. Reviewed by Cameron Zwarich.
  1654. Cleanup the JSGlobalData when exiting early with the usage statement in jsc.
  1655. * jsc.cpp:
  1656. (printUsageStatement):
  1657. (parseArguments):
  1658. (jscmain):
  1659. 2009-05-20 Stephanie Lewis <slewis@apple.com>
  1660. Update the order files. <rdar://problem/6881750> Generate new order files.
  1661. * JavaScriptCore.order:
  1662. 2009-05-19 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
  1663. Reviewed by Simon Hausmann.
  1664. Replace WREC with YARR + YARR_JIT for the Qt port. This is only
  1665. used when compiled with JIT support for now, so it is a drop-in
  1666. replacement for the WREC usage. Still including the wrec headers
  1667. as they are being referred from RegExp.h, though the contents of
  1668. that header it protected by "#if ENABLE(WREC)".
  1669. * JavaScriptCore.pri:
  1670. 2009-05-20 Xan Lopez <xlopez@igalia.com>
  1671. Reviewed by Eric Seidel.
  1672. Fix GTK debug build.
  1673. The function dumpDisjunction, compiled with debug enabled, uses
  1674. printf, which needs stdio.h to be included.
  1675. * yarr/RegexInterpreter.cpp:
  1676. 2009-05-20 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  1677. Reviewed by George Staikos.
  1678. BUG 25843: [Qt] Remove qt-port build flag
  1679. <https://bugs.webkit.org/show_bug.cgi?id=25843>
  1680. * JavaScriptCore.pro:
  1681. 2009-05-19 Geoffrey Garen <ggaren@apple.com>
  1682. Windows build fix.
  1683. * interpreter/RegisterFile.cpp:
  1684. (JSC::RegisterFile::releaseExcessCapacity): Copy-paste typo.
  1685. 2009-05-19 Geoffrey Garen <ggaren@apple.com>
  1686. Reviewed by Sam Weinig.
  1687. Fixed <rdar://problem/6885680> CrashTracer: [USER] 1 crash in Install
  1688. Mac OS X at <unknown binary> 0x9274241c
  1689. (Original patch by Joe Sokol and Ronnie Misra.)
  1690. SunSpider says 1.004x faster.
  1691. * interpreter/RegisterFile.cpp:
  1692. (JSC::RegisterFile::releaseExcessCapacity): Instead of doing complicated
  1693. math that sometimes used to overflow, just release the full range of the
  1694. register file.
  1695. * interpreter/RegisterFile.h:
  1696. (JSC::isPageAligned):
  1697. (JSC::RegisterFile::RegisterFile): Added ASSERTs to verify that it's
  1698. safe to release the full range of the register file.
  1699. (JSC::RegisterFile::shrink): No need to releaseExcessCapacity() if the
  1700. new end is not smaller than the old end. (Also, doing so used to cause
  1701. numeric overflow, unmapping basically the whole process from memory.)
  1702. 2009-05-19 Oliver Hunt <oliver@apple.com>
  1703. RS=Mark Rowe.
  1704. <rdar://problem/6888393> REGRESSION: Start Debugging JavaScript crashes browser (nightly builds only?)
  1705. <https://bugs.webkit.org/show_bug.cgi?id=25717>
  1706. Remove JSC_FAST_CALL as it wasn't gaining us anything, and was
  1707. resulting in weird bugs in the nightly builds.
  1708. * parser/Nodes.cpp:
  1709. * parser/Nodes.h:
  1710. (JSC::ExpressionNode::isNumber):
  1711. (JSC::ExpressionNode::isString):
  1712. (JSC::ExpressionNode::isNull):
  1713. (JSC::ExpressionNode::isPure):
  1714. (JSC::ExpressionNode::isLocation):
  1715. (JSC::ExpressionNode::isResolveNode):
  1716. (JSC::ExpressionNode::isBracketAccessorNode):
  1717. (JSC::ExpressionNode::isDotAccessorNode):
  1718. (JSC::ExpressionNode::isFuncExprNode):
  1719. (JSC::ExpressionNode::isSimpleArray):
  1720. (JSC::ExpressionNode::isAdd):
  1721. (JSC::ExpressionNode::resultDescriptor):
  1722. (JSC::StatementNode::firstLine):
  1723. (JSC::StatementNode::lastLine):
  1724. (JSC::StatementNode::isEmptyStatement):
  1725. (JSC::StatementNode::isReturnNode):
  1726. (JSC::StatementNode::isExprStatement):
  1727. (JSC::StatementNode::isBlock):
  1728. (JSC::NullNode::isNull):
  1729. (JSC::BooleanNode::isPure):
  1730. (JSC::NumberNode::value):
  1731. (JSC::NumberNode::setValue):
  1732. (JSC::NumberNode::isNumber):
  1733. (JSC::NumberNode::isPure):
  1734. (JSC::StringNode::isPure):
  1735. (JSC::StringNode::isString):
  1736. (JSC::ResolveNode::identifier):
  1737. (JSC::ResolveNode::isLocation):
  1738. (JSC::ResolveNode::isResolveNode):
  1739. (JSC::BracketAccessorNode::isLocation):
  1740. (JSC::BracketAccessorNode::isBracketAccessorNode):
  1741. (JSC::DotAccessorNode::base):
  1742. (JSC::DotAccessorNode::identifier):
  1743. (JSC::DotAccessorNode::isLocation):
  1744. (JSC::DotAccessorNode::isDotAccessorNode):
  1745. (JSC::TypeOfResolveNode::identifier):
  1746. (JSC::AddNode::isAdd):
  1747. (JSC::BlockNode::isBlock):
  1748. (JSC::EmptyStatementNode::isEmptyStatement):
  1749. (JSC::ExprStatementNode::isExprStatement):
  1750. (JSC::ReturnNode::isReturnNode):
  1751. (JSC::ScopeNode::sourceURL):
  1752. (JSC::ProgramNode::bytecode):
  1753. (JSC::EvalNode::bytecode):
  1754. (JSC::FunctionBodyNode::parameters):
  1755. (JSC::FunctionBodyNode::toSourceString):
  1756. (JSC::FunctionBodyNode::bytecode):
  1757. (JSC::FuncExprNode::isFuncExprNode):
  1758. 2009-05-19 Maciej Stachowiak <mjs@apple.com>
  1759. Reviewed by Gavin Barraclough.
  1760. - speed up string comparison, especially for short strings
  1761. ~1% on SunSpider
  1762. * JavaScriptCore.exp:
  1763. * runtime/UString.cpp:
  1764. * runtime/UString.h:
  1765. (JSC::operator==): Inline UString's operator==, since it is called from
  1766. hot places in the runtime. Also, specialize 2-char strings in a similar way to
  1767. 1-char, since we're taking the hit of a switch anyway.
  1768. 2009-05-18 Maciej Stachowiak <mjs@apple.com>
  1769. Reviewed by Gavin Barraclough.
  1770. - for polymorphic prototype lookups, increase the number of slots from 4 to 8
  1771. ~4% faster on v8 raytrace benchmark
  1772. * bytecode/Instruction.h:
  1773. 2009-05-18 Maciej Stachowiak <mjs@apple.com>
  1774. Reviewed by Oliver Hunt.
  1775. - tighten up the code for the load_varargs stub
  1776. ~1-2% on v8-raytrace
  1777. * jit/JITStubs.cpp:
  1778. (JSC::JITStubs::cti_op_load_varargs): Hoist some loop invariants that
  1779. the compiler didn't feel like hoisting for us. Remove unneeded exception check.
  1780. 2009-05-18 Maciej Stachowiak <mjs@apple.com>
  1781. Reviewed by Geoff Garen.
  1782. - Improve code generation for access to prototype properties
  1783. ~0.4% speedup on SunSpider.
  1784. Based on a suggestion from Geoff Garen.
  1785. * jit/JIT.h:
  1786. * jit/JITPropertyAccess.cpp:
  1787. (JSC::JIT::compileGetDirectOffset):
  1788. (JSC::JIT::privateCompileGetByIdProto):
  1789. (JSC::JIT::privateCompileGetByIdProtoList):
  1790. (JSC::JIT::privateCompileGetByIdChainList):
  1791. (JSC::JIT::privateCompileGetByIdChain):
  1792. 2009-05-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
  1793. Reviewed by Gavin Barraclough.
  1794. Enable YARR, and disable WREC for GTK+.
  1795. * GNUmakefile.am:
  1796. * yarr/RegexParser.h:
  1797. 2009-05-18 Jan Michael Alonzo <jmalonzo@webkit.org>
  1798. Reviewed by Xan Lopez.
  1799. [Gtk] Various autotools build refactoring and fixes
  1800. https://bugs.webkit.org/show_bug.cgi?id=25286
  1801. Add -no-install and -no-fast-install to programs and tests that we
  1802. don't install. Also remove -O2 since this is already handled at
  1803. configure time.
  1804. * GNUmakefile.am:
  1805. 2009-05-17 Jan Michael Alonzo <jmalonzo@webkit.org>
  1806. Reviewed by Xan Lopez.
  1807. [Gtk] Various autotools build refactoring and fixes
  1808. https://bugs.webkit.org/show_bug.cgi?id=25286
  1809. Add JavaScriptCore/ to JSC include path only since it's not
  1810. required when building WebCore.
  1811. * GNUmakefile.am:
  1812. 2009-05-17 Steve Falkenburg <sfalken@apple.com>
  1813. Windows build fix
  1814. * JavaScriptCore.vcproj/JavaScriptCore.make:
  1815. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1816. 2009-05-15 Gavin Barraclough <barraclough@apple.com>
  1817. Reviewed by Oliver Hunt.
  1818. Looking like MSVC doesn't like static variables in inline methods?
  1819. Make the state of the SSE2 check a static variable on the class
  1820. MacroAssemblerX86Common as a speculative build fix for Windows.
  1821. * assembler/MacroAssemblerX86Common.h:
  1822. (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
  1823. (JSC::MacroAssemblerX86Common::branchDouble):
  1824. (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
  1825. (JSC::MacroAssemblerX86Common::isSSE2Present):
  1826. (JSC::MacroAssemblerX86Common::):
  1827. * jit/JIT.cpp:
  1828. 2009-05-15 Adam Roben <aroben@apple.com>
  1829. Add some assembler headers to JavaScriptCore.vcproj
  1830. This is just a convenience for Windows developers.
  1831. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1832. 2009-05-15 Gavin Barraclough <barraclough@apple.com>
  1833. Reviewed by Oliver Hunt.
  1834. Add FP support to the MacroAssembler, port JITArithmetic over to make use of this. Also add
  1835. API to determine whether FP support is available 'MacroAssembler::supportsFloatingPoint()',
  1836. FP is presently only supported on SSE2 platforms, not x87. On platforms where a suitable
  1837. hardware FPU is not available 'supportsFloatingPoint()' may simply return false, and all
  1838. other methods ASSERT_NOT_REACHED().
  1839. * assembler/AbstractMacroAssembler.h:
  1840. * assembler/MacroAssemblerX86.h:
  1841. (JSC::MacroAssemblerX86::MacroAssemblerX86):
  1842. (JSC::MacroAssemblerX86::branch32):
  1843. (JSC::MacroAssemblerX86::branchPtrWithPatch):
  1844. (JSC::MacroAssemblerX86::supportsFloatingPoint):
  1845. * assembler/MacroAssemblerX86Common.h:
  1846. (JSC::MacroAssemblerX86Common::):
  1847. (JSC::MacroAssemblerX86Common::loadDouble):
  1848. (JSC::MacroAssemblerX86Common::storeDouble):
  1849. (JSC::MacroAssemblerX86Common::addDouble):
  1850. (JSC::MacroAssemblerX86Common::subDouble):
  1851. (JSC::MacroAssemblerX86Common::mulDouble):
  1852. (JSC::MacroAssemblerX86Common::convertInt32ToDouble):
  1853. (JSC::MacroAssemblerX86Common::branchDouble):
  1854. (JSC::MacroAssemblerX86Common::branchTruncateDoubleToInt32):
  1855. (JSC::MacroAssemblerX86Common::branch32):
  1856. (JSC::MacroAssemblerX86Common::branch16):
  1857. (JSC::MacroAssemblerX86Common::branchTest32):
  1858. (JSC::MacroAssemblerX86Common::branchAdd32):
  1859. (JSC::MacroAssemblerX86Common::branchMul32):
  1860. (JSC::MacroAssemblerX86Common::branchSub32):
  1861. (JSC::MacroAssemblerX86Common::set32):
  1862. (JSC::MacroAssemblerX86Common::setTest32):
  1863. (JSC::MacroAssemblerX86Common::x86Condition):
  1864. (JSC::MacroAssemblerX86Common::isSSE2Present):
  1865. * assembler/MacroAssemblerX86_64.h:
  1866. (JSC::MacroAssemblerX86_64::movePtrToDouble):
  1867. (JSC::MacroAssemblerX86_64::moveDoubleToPtr):
  1868. (JSC::MacroAssemblerX86_64::setPtr):
  1869. (JSC::MacroAssemblerX86_64::branchPtr):
  1870. (JSC::MacroAssemblerX86_64::branchTestPtr):
  1871. (JSC::MacroAssemblerX86_64::branchAddPtr):
  1872. (JSC::MacroAssemblerX86_64::branchSubPtr):
  1873. (JSC::MacroAssemblerX86_64::supportsFloatingPoint):
  1874. * assembler/X86Assembler.h:
  1875. * jit/JIT.cpp:
  1876. (JSC::JIT::JIT):
  1877. * jit/JIT.h:
  1878. * jit/JITArithmetic.cpp:
  1879. (JSC::JIT::emit_op_rshift):
  1880. (JSC::JIT::emitSlow_op_rshift):
  1881. (JSC::JIT::emitSlow_op_jnless):
  1882. (JSC::JIT::emitSlow_op_jnlesseq):
  1883. (JSC::JIT::compileBinaryArithOp):
  1884. (JSC::JIT::compileBinaryArithOpSlowCase):
  1885. (JSC::JIT::emit_op_add):
  1886. (JSC::JIT::emitSlow_op_add):
  1887. (JSC::JIT::emit_op_mul):
  1888. (JSC::JIT::emitSlow_op_mul):
  1889. * jit/JITPropertyAccess.cpp:
  1890. (JSC::JIT::privateCompilePutByIdTransition):
  1891. 2009-05-15 Francisco Tolmasky <francisco@280north.com>
  1892. BUG 25467: JavaScript debugger should use function.displayName as the function's name in the call stack
  1893. <https://bugs.webkit.org/show_bug.cgi?id=25467>
  1894. Reviewed by Adam Roben.
  1895. * JavaScriptCore.exp: Added calculatedFunctionName
  1896. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: Added calculatedFunctionName
  1897. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Added calculatedFunctionName
  1898. * debugger/DebuggerCallFrame.cpp: Added calculatedFunctionName to match existing one in ProfileNode.
  1899. (JSC::DebuggerCallFrame::calculatedFunctionName):
  1900. * debugger/DebuggerCallFrame.h: Added calculatedFunctionName to match existing one in ProfileNode.
  1901. 2009-05-14 Gavin Barraclough <barraclough@apple.com>
  1902. Build fix, not reviewed.
  1903. Quick fixes for JIT builds with OPTIMIZE flags disabled.
  1904. * jit/JITCall.cpp:
  1905. (JSC::JIT::compileOpCall):
  1906. (JSC::JIT::compileOpCallSlowCase):
  1907. * jit/JITPropertyAccess.cpp:
  1908. (JSC::JIT::compilePutByIdHotPath):
  1909. 2009-05-14 Steve Falkenburg <sfalken@apple.com>
  1910. Back out incorrect Windows build fix
  1911. * JavaScriptCore.vcproj/JavaScriptCore.make:
  1912. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1913. 2009-05-14 Steve Falkenburg <sfalken@apple.com>
  1914. Windows build fix
  1915. * JavaScriptCore.vcproj/JavaScriptCore.make:
  1916. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1917. 2009-05-14 Adam Roben <aroben@apple.com>
  1918. Windows jsc build fix
  1919. r43648 modified jsc.vcproj's post-build event not to try to copy files
  1920. that aren't present. Then r43661 mistakenly un-did that modification.
  1921. This patch restores the modification from r43648, but puts the code in
  1922. jscCommon.vsprops (where it should have been added in r43648).
  1923. * JavaScriptCore.vcproj/jsc/jsc.vcproj: Restored empty
  1924. VCPostBuildEventTool tags.
  1925. * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Modified the post-build
  1926. event command line to match the one in jsc.vcproj from r43648.
  1927. 2009-05-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  1928. Reviewed by Darin Adler.
  1929. https://bugs.webkit.org/show_bug.cgi?id=25325
  1930. Make sure pthread_self() is declared before it gets called in Collector.cpp
  1931. * runtime/Collector.cpp: Include pthread.h in most Unix-like platforms
  1932. (not just for OPENBSD)
  1933. 2009-05-14 Mark Rowe <mrowe@apple.com>
  1934. Reviewed by Oliver Hunt.
  1935. Fix <https://bugs.webkit.org/show_bug.cgi?id=25785>.
  1936. Bug 25785: Segfault in mark when using JSObjectMakeConstructor
  1937. * API/JSObjectRef.cpp:
  1938. (JSObjectMakeConstructor): OpaqueJSClass::prototype can return 0. We need to use the default object prototype when it does.
  1939. * API/tests/testapi.c:
  1940. (main): Add a test case.
  1941. * runtime/JSObject.h:
  1942. (JSC::JSObject::putDirect): Add a clearer assertion for a null value. The assertion on the next line does catch this,
  1943. but the cause of the failure is not clear from the assertion itself.
  1944. 2009-05-14 Mark Rowe <mrowe@apple.com>
  1945. Rubber-stamped by Darin Adler.
  1946. <rdar://problem/6681868> When building with Xcode 3.1.3 should be using gcc 4.2
  1947. The meaning of XCODE_VERSION_ACTUAL is more sensible in newer versions of Xcode.
  1948. Update our logic to select the compiler version to use the more appropriate XCODE_VERSION_MINOR
  1949. if the version of Xcode supports it, and fall back to XCODE_VERSION_ACTUAL if not.
  1950. * Configurations/Base.xcconfig:
  1951. 2009-05-14 Gavin Barraclough <barraclough@apple.com>
  1952. Reviewed by Geoff Garen.
  1953. Checking register file bounds should be a ptr comparison (m_end is a Register*).
  1954. Also, the compare should be unsigned, pointers don'ts go negative.
  1955. * jit/JIT.cpp:
  1956. (JSC::JIT::privateCompile):
  1957. 2009-05-13 Gavin Barraclough <barraclough@apple.com>
  1958. Reviewed by Oliver Hunt.
  1959. Fix <rdar://problem/6882919> REGRESSION: page at Metroauto site crashes in cti_op_loop_if_less (25730)
  1960. op_loop_if_less (imm < op) was loading op into regT1, but in the slow path spills regT0.
  1961. This leads to bad happen.
  1962. * jit/JITOpcodes.cpp:
  1963. (JSC::JIT::emit_op_loop_if_less):
  1964. (JSC::JIT::emitSlow_op_loop_if_less):
  1965. 2009-05-13 Dmitry Titov <dimich@chromium.org>
  1966. Rubber-stamped by Mark Rowe.
  1967. https://bugs.webkit.org/show_bug.cgi?id=25746
  1968. Revert http://trac.webkit.org/changeset/43507 which caused crash in PPC nightlies with Safari 4.
  1969. * JavaScriptCore.exp:
  1970. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  1971. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  1972. * bytecode/SamplingTool.cpp:
  1973. (JSC::SamplingThread::start):
  1974. (JSC::SamplingThread::stop):
  1975. * bytecode/SamplingTool.h:
  1976. * wtf/CrossThreadRefCounted.h:
  1977. (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
  1978. (WTF::::ref):
  1979. (WTF::::deref):
  1980. * wtf/Threading.h:
  1981. * wtf/ThreadingNone.cpp:
  1982. * wtf/ThreadingPthreads.cpp:
  1983. (WTF::threadMapMutex):
  1984. (WTF::initializeThreading):
  1985. (WTF::threadMap):
  1986. (WTF::identifierByPthreadHandle):
  1987. (WTF::establishIdentifierForPthreadHandle):
  1988. (WTF::pthreadHandleForIdentifier):
  1989. (WTF::clearPthreadHandleForIdentifier):
  1990. (WTF::createThreadInternal):
  1991. (WTF::waitForThreadCompletion):
  1992. (WTF::detachThread):
  1993. (WTF::currentThread):
  1994. * wtf/ThreadingWin.cpp:
  1995. (WTF::threadMapMutex):
  1996. (WTF::initializeThreading):
  1997. (WTF::threadMap):
  1998. (WTF::storeThreadHandleByIdentifier):
  1999. (WTF::threadHandleForIdentifier):
  2000. (WTF::clearThreadHandleForIdentifier):
  2001. (WTF::createThreadInternal):
  2002. (WTF::waitForThreadCompletion):
  2003. (WTF::detachThread):
  2004. (WTF::currentThread):
  2005. * wtf/gtk/ThreadingGtk.cpp:
  2006. (WTF::threadMapMutex):
  2007. (WTF::initializeThreading):
  2008. (WTF::threadMap):
  2009. (WTF::identifierByGthreadHandle):
  2010. (WTF::establishIdentifierForThread):
  2011. (WTF::threadForIdentifier):
  2012. (WTF::clearThreadForIdentifier):
  2013. (WTF::createThreadInternal):
  2014. (WTF::waitForThreadCompletion):
  2015. (WTF::currentThread):
  2016. * wtf/qt/ThreadingQt.cpp:
  2017. (WTF::threadMapMutex):
  2018. (WTF::threadMap):
  2019. (WTF::identifierByQthreadHandle):
  2020. (WTF::establishIdentifierForThread):
  2021. (WTF::clearThreadForIdentifier):
  2022. (WTF::threadForIdentifier):
  2023. (WTF::initializeThreading):
  2024. (WTF::createThreadInternal):
  2025. (WTF::waitForThreadCompletion):
  2026. (WTF::currentThread):
  2027. 2009-05-13 Darin Adler <darin@apple.com>
  2028. Revert the parser arena change. It was a slowdown, not a speedup.
  2029. Better luck next time (I'll break it up into pieces).
  2030. 2009-05-13 Darin Adler <darin@apple.com>
  2031. Tiger build fix.
  2032. * parser/Grammar.y: Add back empty code blocks, needed by older
  2033. versions of bison on certain rules.
  2034. 2009-05-13 Steve Falkenburg <sfalken@apple.com>
  2035. Windows build fix.
  2036. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  2037. 2009-05-13 Adam Roben <aroben@apple.com>
  2038. Windows build fixes after r43642
  2039. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2040. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  2041. Updated.
  2042. * debugger/Debugger.cpp:
  2043. * runtime/ArrayConstructor.cpp:
  2044. * runtime/JSArray.cpp:
  2045. * runtime/RegExp.cpp:
  2046. * runtime/RegExpConstructor.cpp:
  2047. * runtime/RegExpPrototype.cpp:
  2048. * runtime/StringPrototype.cpp:
  2049. Added missing #includes.
  2050. 2009-05-13 Darin Adler <darin@apple.com>
  2051. Reviewed by Cameron Zwarich.
  2052. Bug 25674: syntax tree nodes should use arena allocation
  2053. https://bugs.webkit.org/show_bug.cgi?id=25674
  2054. Step 3: Add some actual arena allocation. About 1% SunSpider speedup.
  2055. * JavaScriptCore.exp: Updated.
  2056. * bytecompiler/BytecodeGenerator.cpp:
  2057. (JSC::BytecodeGenerator::BytecodeGenerator): Updated since VarStack
  2058. contains const Identifier* now.
  2059. (JSC::BytecodeGenerator::emitPushNewScope): Updated to take a const
  2060. Identifier&.
  2061. * bytecompiler/BytecodeGenerator.h: Ditto
  2062. * bytecompiler/SegmentedVector.h: Added isEmpty.
  2063. * debugger/Debugger.cpp:
  2064. (JSC::Debugger::recompileAllJSFunctions): Moved this function here from
  2065. WebCore so WebCore doesn't need the details of FunctionBodyNode.
  2066. * debugger/Debugger.h: Ditto.
  2067. * interpreter/Interpreter.cpp:
  2068. (JSC::Interpreter::execute): Updated since VarStack contains const
  2069. Identifier* now.
  2070. * jit/JITStubs.cpp:
  2071. (JSC::JITStubs::cti_vm_lazyLinkCall): Call isHostFunction on the body
  2072. rather than on the function object, since we can't easily have inlined
  2073. access to the FunctionBodyNode in JSFunction.h since WebCore needs
  2074. access to that header.
  2075. (JSC::JITStubs::cti_op_construct_JSConstruct): Ditto.
  2076. * profiler/Profiler.cpp:
  2077. (JSC::Profiler::createCallIdentifier): Ditto.
  2078. * parser/Grammar.y: Use JSGlobalData* to pass the global data pointer
  2079. around whenever possible instead of using void*. Changed
  2080. SET_EXCEPTION_LOCATION from a macro to an inline function. Marked
  2081. the structure-creating functions inline. Changed the VarStack to use
  2082. identifier pointers instead of actual identifiers. This takes
  2083. advantage of the fact that all identifier pointers come from the
  2084. arena and avoids reference count churn. Changed Identifier* to
  2085. const Identifier* to make sure we don't modify any by accident.
  2086. Used identifiers for regular expression strings too, using the new
  2087. scanRegExp that has out parameters instead of the old one that relied
  2088. on side effects in the Lexer. Move the creation of numeric identifiers
  2089. out of this file and into the PropertyNode constructor.
  2090. * parser/Lexer.cpp:
  2091. (JSC::Lexer::setCode): Pass in ParserArena, used for identifiers.
  2092. (JSC::Lexer::makeIdentifier): Changed return type to const Identifier*
  2093. and changed to call ParserArena.
  2094. (JSC::Lexer::scanRegExp): Added out arguments that are const Identifier*
  2095. as well as a prefix character argument so we can handle the /= case
  2096. without a string append.
  2097. (JSC::Lexer::skipRegExp): Added. Skips a regular expression without
  2098. allocating Identifier objects.
  2099. (JSC::Lexer::clear): Removed the code to manage m_identifiers, m_pattern,
  2100. and m_flags, and added code to set m_arena to 0.
  2101. * parser/Lexer.h: Updated for changes above.
  2102. * parser/NodeConstructors.h:
  2103. (JSC::ParserArenaFreeable::operator new): Added. Calls allocateFreeable
  2104. on the arena.
  2105. (JSC::ParserArenaDeletable::operator new): Changed to call the
  2106. allocateDeletable function on the arena instead of deleteWithArena.
  2107. (JSC::RegExpNode::RegExpNode): Changed arguments to Identifier instead
  2108. of UString since these come from the parser which makes identifiers.
  2109. (JSC::PropertyNode::PropertyNode): Added new constructor that makes
  2110. numeric identifiers. Some day we might want to optimize this for
  2111. integers so it doesn't create a string for each one.
  2112. (JSC::ContinueNode::ContinueNode): Initialize m_ident to nullIdentifier
  2113. since it's now a const Identifier& so it can't be left uninitialized.
  2114. (JSC::BreakNode::BreakNode): Ditto.
  2115. (JSC::CaseClauseNode::CaseClauseNode): Updated to use SourceElements*
  2116. to keep track of the statements rather than a separate statement vector.
  2117. (JSC::BlockNode::BlockNode): Ditto.
  2118. (JSC::ForInNode::ForInNode): Initialize m_ident to nullIdentifier.
  2119. * parser/Nodes.cpp: Moved the comment explaining emitBytecode in here.
  2120. It seemed strangely out of place in the header.
  2121. (JSC::ThrowableExpressionData::emitThrowError): Added an overload for
  2122. UString as well as Identifier.
  2123. (JSC::SourceElements::singleStatement): Added.
  2124. (JSC::SourceElements::lastStatement): Added.
  2125. (JSC::RegExpNode::emitBytecode): Updated since the pattern and flags
  2126. are now Identifier instead of UString. Also changed the throwError code
  2127. to use the substitution mechanism instead of doing a string append.
  2128. (JSC::SourceElements::emitBytecode): Added. Replaces the old
  2129. statementListEmitCode function, since we now keep the SourceElements
  2130. objects around.
  2131. (JSC::BlockNode::lastStatement): Added.
  2132. (JSC::BlockNode::emitBytecode): Changed to use emitBytecode instead of
  2133. statementListEmitCode.
  2134. (JSC::CaseClauseNode::emitBytecode): Added.
  2135. (JSC::CaseBlockNode::emitBytecodeForBlock): Changed to use emitBytecode
  2136. instead of statementListEmitCode.
  2137. (JSC::ScopeNodeData::ScopeNodeData): Changed to store the
  2138. SourceElements* instead of using releaseContentsIntoVector.
  2139. (JSC::ScopeNode::emitStatementsBytecode): Added.
  2140. (JSC::ScopeNode::singleStatement): Added.
  2141. (JSC::ProgramNode::emitBytecode): Call emitStatementsBytecode instead
  2142. of statementListEmitCode.
  2143. (JSC::EvalNode::emitBytecode): Ditto.
  2144. (JSC::EvalNode::generateBytecode): Removed code to clear the children
  2145. vector. This optimization is no longer possible since everything is in
  2146. a single arena.
  2147. (JSC::FunctionBodyNode::emitBytecode): Call emitStatementsBytecode
  2148. insetad of statementListEmitCode and check for the return node using
  2149. the new functions.
  2150. * parser/Nodes.h: Changed VarStack to store const Identifier* instead
  2151. of Identifier and rely on the arena to control lifetime. Added a new
  2152. ParserArenaFreeable class. Made ParserArenaDeletable inherit from
  2153. FastAllocBase instead of having its own operator new. Base the Node
  2154. class on ParserArenaFreeable. Changed the various Node classes
  2155. to use const Identifier& instead of Identifier to avoid the need to
  2156. call their destructors and allow them to function as "freeable" in the
  2157. arena. Removed extraneous JSC_FAST_CALL on definitions of inline functions.
  2158. Changed ElementNode, PropertyNode, ArgumentsNode, ParameterNode,
  2159. CaseClauseNode, ClauseListNode, and CaseBlockNode to use ParserArenaFreeable
  2160. as a base class since they do not descend from Node. Eliminated the
  2161. StatementVector type and instead have various classes use SourceElements*
  2162. instead of StatementVector. This prevents those classes from having th
  2163. use ParserArenaDeletable to make sure the vector destructor is called.
  2164. * parser/Parser.cpp:
  2165. (JSC::Parser::parse): Pass the arena to the lexer.
  2166. * parser/Parser.h: Added an include of ParserArena.h, which is no longer
  2167. included by Nodes.h.
  2168. * parser/ParserArena.cpp:
  2169. (JSC::ParserArena::ParserArena): Added. Initializes the new members,
  2170. m_freeableMemory, m_freeablePoolEnd, and m_identifiers.
  2171. (JSC::ParserArena::freeablePool): Added. Computes the pool pointer,
  2172. since we store only the current pointer and the end of pool pointer.
  2173. (JSC::ParserArena::deallocateObjects): Added. Contains the common
  2174. memory-deallocation logic used by both the destructor and the
  2175. reset function.
  2176. (JSC::ParserArena::~ParserArena): Changed to call deallocateObjects.
  2177. (JSC::ParserArena::reset): Ditto. Also added code to zero out the
  2178. new structures, and switched to use clear() instead of shrink(0) since
  2179. we don't really reuse arenas.
  2180. (JSC::ParserArena::makeNumericIdentifier): Added.
  2181. (JSC::ParserArena::allocateFreeablePool): Added. Used when the pool
  2182. is empty.
  2183. (JSC::ParserArena::isEmpty): Added. No longer inline, which is fine
  2184. since this is used only for assertions at the moment.
  2185. * parser/ParserArena.h: Added an actual arena of "freeable" objects,
  2186. ones that don't need destructors to be called. Also added the segmented
  2187. vector of identifiers that used to be in the Lexer.
  2188. * runtime/FunctionConstructor.cpp:
  2189. (JSC::extractFunctionBody): Use singleStatement function rather than
  2190. getting at a StatementVector.
  2191. * runtime/FunctionPrototype.cpp:
  2192. (JSC::functionProtoFuncToString): Call isHostFunction on the body
  2193. rather than the function object.
  2194. * runtime/JSFunction.cpp:
  2195. (JSC::JSFunction::JSFunction): Moved the structure version of this in
  2196. here from the header. It's not hot enough that it needs to be inlined.
  2197. (JSC::JSFunction::isHostFunction): Moved this in here from the header.
  2198. It's now a helper to be used only within the class.
  2199. (JSC::JSFunction::setBody): Moved this in here. It's not hot enough that
  2200. it needs to be inlined, and we want to be able to compile the header
  2201. without the definition of FunctionBodyNode.
  2202. * runtime/JSFunction.h: Eliminated the include of "Nodes.h". This was
  2203. exposing too much JavaScriptCore dependency to WebCore. Because of this
  2204. change and some changes made to WebCore, we could now export a lot fewer
  2205. headers from JavaScriptCore, but I have not done that yet in this check-in.
  2206. Made a couple functions non-inline. Removes some isHostFunction() assertions.
  2207. * wtf/FastAllocBase.h: Added the conventional using statements we use in
  2208. WTF so we can use identifiers from the WTF namespace without explicit
  2209. namespace qualification or namespace directive. This is the usual WTF style,
  2210. although it's unconventional in the C++ world. We use the namespace primarily
  2211. for link-time disambiguation, not compile-time.
  2212. * wtf/FastMalloc.cpp: Fixed an incorrect comment.
  2213. 2009-05-13 Xan Lopez <xlopez@igalia.com>
  2214. Unreviewed build fix: add JITStubCall.h to files list.
  2215. * GNUmakefile.am:
  2216. 2009-05-13 Ariya Hidayat <ariya.hidayat@nokia.com>
  2217. Unreviewed build fix, as suggested by Yael Aharon <yael.aharon@nokia.com>.
  2218. * wtf/qt/ThreadingQt.cpp:
  2219. (WTF::waitForThreadCompletion): renamed IsValid to isValid.
  2220. 2009-05-13 Jan Michael Alonzo <jmalonzo@webkit.org>
  2221. Revert r43562 - [Gtk] WTF_USE_JSC is already defined in
  2222. WebCore/config.h.
  2223. * wtf/Platform.h:
  2224. 2009-05-12 Gavin Barraclough <barraclough@apple.com>
  2225. Reviewed by Oliver Hunt.
  2226. Add SamplingCounter tool to provide a simple mechanism for counting events in JSC
  2227. (enabled using ENABLE(SAMPLING_COUNTERS)). To count events within a single function
  2228. use the class 'SamplingCounter', where the counter may be incremented from multiple
  2229. functions 'GlobalSamplingCounter' may be convenient; all other counters (stack or
  2230. heap allocated, rather than statically declared) should use the DeletableSamplingCounter.
  2231. Further description of these classes is provided alongside their definition in
  2232. SamplingTool.h.
  2233. Counters may be incremented from c++ by calling the 'count()' method on the counter,
  2234. or may be incremented by JIT code by using the 'emitCount()' method within the JIT.
  2235. This patch also fixes CODEBLOCK_SAMPLING, which was missing a null pointer check.
  2236. * JavaScriptCore.exp:
  2237. * assembler/MacroAssemblerX86.h:
  2238. (JSC::MacroAssemblerX86::addWithCarry32):
  2239. (JSC::MacroAssemblerX86::and32):
  2240. (JSC::MacroAssemblerX86::or32):
  2241. * assembler/MacroAssemblerX86Common.h:
  2242. (JSC::MacroAssemblerX86Common::and32):
  2243. (JSC::MacroAssemblerX86Common::or32):
  2244. * assembler/MacroAssemblerX86_64.h:
  2245. (JSC::MacroAssemblerX86_64::and32):
  2246. (JSC::MacroAssemblerX86_64::or32):
  2247. (JSC::MacroAssemblerX86_64::addPtr):
  2248. * assembler/X86Assembler.h:
  2249. (JSC::X86Assembler::):
  2250. (JSC::X86Assembler::adcl_im):
  2251. (JSC::X86Assembler::addq_im):
  2252. (JSC::X86Assembler::andl_im):
  2253. (JSC::X86Assembler::orl_im):
  2254. * bytecode/SamplingTool.cpp:
  2255. (JSC::AbstractSamplingCounter::dump):
  2256. * bytecode/SamplingTool.h:
  2257. (JSC::AbstractSamplingCounter::count):
  2258. (JSC::GlobalSamplingCounter::name):
  2259. (JSC::SamplingCounter::SamplingCounter):
  2260. * jit/JIT.h:
  2261. * jit/JITCall.cpp:
  2262. (JSC::):
  2263. * jit/JITInlineMethods.h:
  2264. (JSC::JIT::setSamplingFlag):
  2265. (JSC::JIT::clearSamplingFlag):
  2266. (JSC::JIT::emitCount):
  2267. * jsc.cpp:
  2268. (runWithScripts):
  2269. * parser/Nodes.cpp:
  2270. (JSC::ScopeNode::ScopeNode):
  2271. * wtf/Platform.h:
  2272. 2009-05-13 Steve Falkenburg <sfalken@apple.com>
  2273. Windows build fix.
  2274. * JavaScriptCore.vcproj/JavaScriptCore.make:
  2275. 2009-05-12 Steve Falkenburg <sfalken@apple.com>
  2276. Windows build fix.
  2277. * JavaScriptCore.vcproj/JavaScriptCore.make:
  2278. 2009-05-12 Oliver Hunt <oliver@apple.com>
  2279. Reviewed by Gavin Barraclough.
  2280. <rdar://problem/6881457> Crash occurs at JSC::Interpreter::execute() when loading http://www.sears.com
  2281. We created the arguments objects before an op_push_scope but not
  2282. before op_push_new_scope, this meant a null arguments object could
  2283. be resolved inside catch blocks.
  2284. * bytecompiler/BytecodeGenerator.cpp:
  2285. (JSC::BytecodeGenerator::emitPushNewScope):
  2286. 2009-05-12 Oliver Hunt <oliver@apple.com>
  2287. Reviewed by Gavin Barraclough.
  2288. <rdar://problem/6879881> Crash occurs at JSC::JSActivation::mark() when loading http://www.monster.com; http://www.cnet.com
  2289. <https://bugs.webkit.org/show_bug.cgi?id=25736> Crash loading www.google.dk/ig (and other igoogle's as well)
  2290. Following on from the lazy arguments creation patch, it's now
  2291. possible for an activation to to have a null register in the callframe
  2292. so we can't just blindly mark the local registers in an activation,
  2293. and must null check first instead.
  2294. * API/tests/testapi.c:
  2295. (functionGC):
  2296. * API/tests/testapi.js:
  2297. (bludgeonArguments.return.g):
  2298. (bludgeonArguments):
  2299. * runtime/JSActivation.cpp:
  2300. (JSC::JSActivation::mark):
  2301. 2009-05-12 Gavin Barraclough <barraclough@apple.com>
  2302. Rubber stamped by Geoff Garen.
  2303. WTF_USE_CTI_REPATCH_PIC is no longer used, remove.
  2304. * jit/JIT.h:
  2305. * jit/JITStubCall.h:
  2306. 2009-05-12 Gavin Barraclough <barraclough@apple.com>
  2307. Reviewed by Maciej Stachowiak.
  2308. We've run into some problems where changing the size of the class JIT leads to
  2309. performance fluctuations. Try forcing alignment in an attempt to stabalize this.
  2310. * jit/JIT.h:
  2311. 2009-05-12 Kevin Ollivier <kevino@theolliviers.com>
  2312. wx build fix. Add ParserArena.cpp to the build.
  2313. * JavaScriptCoreSources.bkl:
  2314. 2009-05-12 Oliver Hunt <oliver@apple.com>
  2315. Reviewed by Geoff Garen.
  2316. Unsigned underflow on 64bit cannot be treated as a negative number
  2317. This code included some placeswhere we deliberately create negative offsets
  2318. from unsigned values, on 32bit this is "safe", but in 64bit builds much
  2319. badness occurs. Solution is to use signed types as nature intended.
  2320. * jit/JITStubs.cpp:
  2321. (JSC::JITStubs::cti_op_load_varargs):
  2322. 2009-05-12 Jan Michael Alonzo <jmalonzo@webkit.org>
  2323. Reviewed by Holger Freyther.
  2324. [Gtk] Various autotools build refactoring and fixes
  2325. https://bugs.webkit.org/show_bug.cgi?id=25286
  2326. Define WTF_USE_JSC for the Gtk port.
  2327. * wtf/Platform.h:
  2328. 2009-05-12 Maciej Stachowiak <mjs@apple.com>
  2329. Reviewed by Oliver Hunt.
  2330. - allow all of strictEqual to be inlined into cti_op_stricteq once again
  2331. We had this optimization once but accidentally lost it at some point.
  2332. * runtime/Operations.h:
  2333. (JSC::JSValue::strictEqualSlowCaseInline):
  2334. (JSC::JSValue::strictEqual):
  2335. 2009-05-12 Gavin Barraclough <barraclough@apple.com>
  2336. Reviewed by Oliver Hunt.
  2337. instanceof should throw if the constructor being tested does not implement
  2338. 'HasInstance" (i.e. is a function). Instead we were returning false.
  2339. * interpreter/Interpreter.cpp:
  2340. (JSC::isInvalidParamForIn):
  2341. (JSC::isInvalidParamForInstanceOf):
  2342. (JSC::Interpreter::privateExecute):
  2343. * jit/JITStubs.cpp:
  2344. (JSC::JITStubs::cti_op_instanceof):
  2345. * tests/mozilla/ecma_2/instanceof/instanceof-003.js:
  2346. Fix broken test case.
  2347. * tests/mozilla/ecma_2/instanceof/regress-7635.js:
  2348. Remove broken test case (was an exact duplicate of a test in instanceof-003.js).
  2349. 2009-05-12 Oliver Hunt <oliver@apple.com>
  2350. Reviewed by Gavin Barraclough.
  2351. Improve function call forwarding performance
  2352. Make creation of the Arguments object occur lazily, so it
  2353. is not necessarily created for every function that references
  2354. it. Then add logic to Function.apply to allow it to avoid
  2355. allocating the Arguments object at all. Helps a lot with
  2356. the function forwarding/binding logic in jQuery, Prototype,
  2357. and numerous other JS libraries.
  2358. * bytecode/CodeBlock.cpp:
  2359. (JSC::CodeBlock::dump):
  2360. * bytecode/Opcode.h:
  2361. * bytecompiler/BytecodeGenerator.cpp:
  2362. (JSC::BytecodeGenerator::BytecodeGenerator):
  2363. (JSC::BytecodeGenerator::registerFor):
  2364. (JSC::BytecodeGenerator::willResolveToArguments):
  2365. (JSC::BytecodeGenerator::uncheckedRegisterForArguments):
  2366. (JSC::BytecodeGenerator::createArgumentsIfNecessary):
  2367. (JSC::BytecodeGenerator::emitCallEval):
  2368. (JSC::BytecodeGenerator::emitPushScope):
  2369. * bytecompiler/BytecodeGenerator.h:
  2370. * interpreter/Interpreter.cpp:
  2371. (JSC::Interpreter::privateExecute):
  2372. (JSC::Interpreter::retrieveArguments):
  2373. * jit/JIT.cpp:
  2374. (JSC::JIT::privateCompileMainPass):
  2375. * jit/JIT.h:
  2376. * jit/JITOpcodes.cpp:
  2377. (JSC::JIT::emit_op_create_arguments):
  2378. (JSC::JIT::emit_op_init_arguments):
  2379. * jit/JITStubs.cpp:
  2380. (JSC::JITStubs::cti_op_tear_off_arguments):
  2381. (JSC::JITStubs::cti_op_load_varargs):
  2382. * parser/Nodes.cpp:
  2383. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  2384. 2009-05-11 Gavin Barraclough <barraclough@apple.com>
  2385. Reviewed by Oliver Hunt.
  2386. Enable use of SamplingFlags directly from JIT code.
  2387. * bytecode/SamplingTool.h:
  2388. * jit/JIT.h:
  2389. (JSC::JIT::sampleCodeBlock):
  2390. (JSC::JIT::sampleInstruction):
  2391. * jit/JITInlineMethods.h:
  2392. (JSC::JIT::setSamplingFlag):
  2393. (JSC::JIT::clearSamplingFlag):
  2394. 2009-05-11 Gavin Barraclough <barraclough@apple.com>
  2395. Reviewed by Cameron Zwarich.
  2396. Implement JIT generation for instanceof for non-objects (always returns false).
  2397. Also fixes the sequencing of the prototype and value isObject checks, to no match the spec.
  2398. 0.5% progression on v8 tests overall, due to 3.5% on early-boyer.
  2399. * jit/JIT.cpp:
  2400. (JSC::JIT::privateCompileMainPass):
  2401. (JSC::JIT::privateCompileSlowCases):
  2402. * runtime/JSObject.cpp:
  2403. (JSC::JSObject::hasInstance):
  2404. * runtime/TypeInfo.h:
  2405. (JSC::TypeInfo::TypeInfo):
  2406. 2009-05-11 Geoffrey Garen <ggaren@apple.com>
  2407. Reviewed by Sam Weinig.
  2408. A little more JIT refactoring.
  2409. Rearranged code to more clearly indicate what's conditionally compiled
  2410. and why. Now, all shared code is at the top of our JIT files, and all
  2411. #if'd code is at the bottom. #if'd code is delineated by large comments.
  2412. Moved functions that relate to the JIT but don't explicitly do codegen
  2413. into JIT.cpp. Refactored SSE2 check to store its result as a data member
  2414. in the JIT.
  2415. * jit/JIT.cpp:
  2416. (JSC::isSSE2Present):
  2417. (JSC::JIT::JIT):
  2418. (JSC::JIT::unlinkCall):
  2419. (JSC::JIT::linkCall):
  2420. * jit/JIT.h:
  2421. (JSC::JIT::isSSE2Present):
  2422. * jit/JITArithmetic.cpp:
  2423. (JSC::JIT::emit_op_mod):
  2424. (JSC::JIT::emitSlow_op_mod):
  2425. * jit/JITCall.cpp:
  2426. (JSC::JIT::compileOpCallVarargs):
  2427. (JSC::JIT::compileOpCallVarargsSlowCase):
  2428. 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
  2429. Build fix.
  2430. * JavaScriptCore.pri: Build the new JITOpcodes.cpp
  2431. 2009-05-11 Sam Weinig <sam@webkit.org>
  2432. Reviewed by Geoffrey Garen.
  2433. More re-factoring of JIT code generation. Use a macro to
  2434. forward the main switch-statement cases to the helper functions.
  2435. * jit/JIT.cpp:
  2436. (JSC::JIT::privateCompileMainPass):
  2437. (JSC::JIT::privateCompileSlowCases):
  2438. 2009-05-11 Sam Weinig <sam@webkit.org>
  2439. Reviewed by Geoffrey Garen.
  2440. More re-factoring of JIT code generation to move opcode generation
  2441. to helper functions outside the main switch-statement and gave those
  2442. helper functions standardized names. This patch covers the remaining
  2443. slow cases.
  2444. * jit/JIT.cpp:
  2445. * jit/JIT.h:
  2446. * jit/JITOpcodes.cpp:
  2447. 2009-05-11 Geoffrey Garen <ggaren@apple.com>
  2448. Build fix.
  2449. * GNUmakefile.am: Added JITOpcodes.cpp and JITStubCall.h to the project.
  2450. 2009-05-11 Geoffrey Garen <ggaren@apple.com>
  2451. Build fix.
  2452. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
  2453. JITOpcodes.cpp and JITStubCall.h to the project.
  2454. 2009-05-11 Geoffrey Garen <ggaren@apple.com>
  2455. Reviewed by Sam Weinig.
  2456. Some JIT refactoring.
  2457. Moved JITStubCall* into its own header.
  2458. Modified JITStubCall to ASSERT that its return value is handled correctly.
  2459. Also, replaced function template with explicit instantiations to resolve
  2460. some confusion.
  2461. Replaced all uses of emit{Get,Put}CTIArgument with explicit peeks, pokes,
  2462. and calls to killLastResultRegister().
  2463. * JavaScriptCore.xcodeproj/project.pbxproj:
  2464. * jit/JIT.cpp:
  2465. (JSC::JIT::privateCompileMainPass):
  2466. (JSC::JIT::privateCompile):
  2467. * jit/JIT.h:
  2468. * jit/JITArithmetic.cpp:
  2469. * jit/JITCall.cpp:
  2470. * jit/JITInlineMethods.h:
  2471. (JSC::JIT::restoreArgumentReference):
  2472. * jit/JITPropertyAccess.cpp:
  2473. * jit/JITStubCall.h: Copied from jit/JIT.h.
  2474. (JSC::JITStubCall::JITStubCall):
  2475. (JSC::JITStubCall::addArgument):
  2476. (JSC::JITStubCall::call):
  2477. (JSC::JITStubCall::):
  2478. 2009-05-11 Sam Weinig <sam@webkit.org>
  2479. Reviewed by Geoffrey Garen.
  2480. Start re-factoring JIT code generation to move opcode generation
  2481. to helper functions outside the main switch-statement and gave those
  2482. helper functions standardized names. This patch only covers the main
  2483. pass and all the arithmetic opcodes in the slow path.
  2484. * JavaScriptCore.xcodeproj/project.pbxproj:
  2485. * jit/JIT.cpp:
  2486. (JSC::JIT::privateCompileMainPass):
  2487. (JSC::JIT::privateCompileSlowCases):
  2488. * jit/JIT.h:
  2489. * jit/JITArithmetic.cpp:
  2490. * jit/JITOpcodes.cpp: Copied from jit/JIT.cpp.
  2491. * jit/JITPropertyAccess.cpp:
  2492. 2009-05-11 Steve Falkenburg <sfalken@apple.com>
  2493. Re-add experimental PGO configs.
  2494. Reviewed by Adam Roben.
  2495. * JavaScriptCore.vcproj/JavaScriptCore.make:
  2496. * JavaScriptCore.vcproj/JavaScriptCore.sln:
  2497. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  2498. * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
  2499. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  2500. 2009-05-11 Sam Weinig <sam@webkit.org>
  2501. Reviewed by Geoffrey "1" Garen.
  2502. Rip out the !USE(CTI_REPATCH_PIC) code. It was untested and unused.
  2503. * jit/JIT.h:
  2504. (JSC::JIT::compileGetByIdChainList):
  2505. (JSC::JIT::compileGetByIdChain):
  2506. (JSC::JIT::compileCTIMachineTrampolines):
  2507. * jit/JITPropertyAccess.cpp:
  2508. (JSC::JIT::privateCompileGetByIdProto):
  2509. (JSC::JIT::privateCompileGetByIdChainList):
  2510. (JSC::JIT::privateCompileGetByIdChain):
  2511. * jit/JITStubs.cpp:
  2512. (JSC::JITStubs::tryCachePutByID):
  2513. (JSC::JITStubs::tryCacheGetByID):
  2514. 2009-05-11 Dmitry Titov <dimich@chromium.org>
  2515. GTK build fix - the deprecated waitForThreadCompletion is not needed on GTK.
  2516. * wtf/ThreadingPthreads.cpp: used #ifdef PLATFORM(DARWIN) around waitForThreadCompletion().
  2517. 2009-05-11 Adam Roben <aroben@apple.com>
  2518. Build fix for newer versions of GCC
  2519. * wtf/ThreadingPthreads.cpp: Added a declaration of
  2520. waitForThreadCompletion before its definition to silence a warning.
  2521. 2009-05-11 Dmitry Titov <dimich@chromium.org>
  2522. Reviewed by Alexey Proskuryakov and Adam Roben.
  2523. https://bugs.webkit.org/show_bug.cgi?id=25348
  2524. Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
  2525. * wtf/Threading.h:
  2526. (WTF::ThreadIdentifier::ThreadIdentifier):
  2527. (WTF::ThreadIdentifier::isValid):
  2528. (WTF::ThreadIdentifier::invalidate):
  2529. (WTF::ThreadIdentifier::platformId):
  2530. ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
  2531. methods that are used across the code on thread ids: construction, comparisons,
  2532. check for 'valid' state etc. '0' is used as invalid id, which happens to just work
  2533. with all platform-specific thread id implementations.
  2534. All the following files repeatedly reflect the new ThreadIdentifier for each platform.
  2535. We remove ThreadMap and threadMapMutex from all of them, remove the functions that
  2536. populated/searched/cleared the map and add platform-specific comparison operators
  2537. for ThreadIdentifier.
  2538. There are specific temporary workarounds for Safari 4 beta on OSX and Win32 since the
  2539. public build uses WTF threading functions with old type of ThreadingIdentifier.
  2540. The next time Safari 4 is rebuilt, it will 'automatically' pick up the new type and new
  2541. functions so the deprecated ones can be removed.
  2542. * wtf/gtk/ThreadingGtk.cpp:
  2543. (WTF::ThreadIdentifier::operator==):
  2544. (WTF::ThreadIdentifier::operator!=):
  2545. (WTF::initializeThreading):
  2546. (WTF::createThreadInternal):
  2547. (WTF::waitForThreadCompletion):
  2548. (WTF::currentThread):
  2549. * wtf/ThreadingNone.cpp:
  2550. (WTF::ThreadIdentifier::operator==):
  2551. (WTF::ThreadIdentifier::operator!=):
  2552. * wtf/ThreadingPthreads.cpp:
  2553. (WTF::ThreadIdentifier::operator==):
  2554. (WTF::ThreadIdentifier::operator!=):
  2555. (WTF::initializeThreading):
  2556. (WTF::createThreadInternal):
  2557. (WTF::waitForThreadCompletion):
  2558. (WTF::detachThread):
  2559. (WTF::currentThread):
  2560. (WTF::waitForThreadCompletion): This is a workaround for Safari 4 beta on Mac.
  2561. Safari 4 is linked against old definition of ThreadIdentifier so it treats it as uint32_t.
  2562. This 'old' variant of waitForThreadCompletion takes uint32_t and has the old decorated name, so Safari can
  2563. load it from JavaScriptCore library. The other functions (CurrentThread() etc) happen to match their previous
  2564. decorated names and, while they return pthread_t now, it is a pointer which round-trips through a uint32_t.
  2565. This function will be removed as soon as Safari 4 will release next public build.
  2566. * wtf/qt/ThreadingQt.cpp:
  2567. (WTF::ThreadIdentifier::operator==):
  2568. (WTF::ThreadIdentifier::operator!=):
  2569. (WTF::initializeThreading):
  2570. (WTF::createThreadInternal):
  2571. (WTF::waitForThreadCompletion):
  2572. (WTF::currentThread):
  2573. * wtf/ThreadingWin.cpp:
  2574. (WTF::ThreadIdentifier::operator==):
  2575. (WTF::ThreadIdentifier::operator!=):
  2576. (WTF::initializeThreading):
  2577. (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
  2578. counter as a thread ID and mapped it into platform ID. Windows was using native thread
  2579. id and mapped it into thread handle. Since we can always obtain a thread handle
  2580. by thread id, createThread now closes the handle.
  2581. (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
  2582. it means the thread already exited.
  2583. (WTF::detachThread):
  2584. (WTF::currentThread):
  2585. (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
  2586. (WTF::waitForThreadCompletionDeprecated): same.
  2587. (WTF::currentThreadDeprecated): same.
  2588. (WTF::createThreadDeprecated): same.
  2589. * bytecode/SamplingTool.h:
  2590. * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
  2591. * JavaScriptCore.exp: export lists - updated decorated names of the WTF threading functions
  2592. since they now take a different type as a parameter.
  2593. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
  2594. that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
  2595. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
  2596. 2009-05-11 Darin Adler <darin@apple.com>
  2597. Reviewed by Oliver Hunt.
  2598. Bug 25560: REGRESSION (r34821): "string value".__proto__ gets the wrong object.
  2599. https://bugs.webkit.org/show_bug.cgi?id=25560
  2600. rdar://problem/6861069
  2601. I missed this case back a year ago when I sped up handling
  2602. of JavaScript wrappers. Easy to fix.
  2603. * runtime/JSObject.h:
  2604. (JSC::JSValue::get): Return the prototype itself if the property name
  2605. is __proto__.
  2606. * runtime/JSString.cpp:
  2607. (JSC::JSString::getOwnPropertySlot): Ditto.
  2608. 2009-05-09 Oliver Hunt <oliver@apple.com>
  2609. Reviewed by Maciej Stachowiak.
  2610. Rename emitGetFromCallFrameHeader to emitGetFromCallFrameHeaderPtr
  2611. * jit/JIT.cpp:
  2612. (JSC::JIT::privateCompileMainPass):
  2613. (JSC::JIT::privateCompileCTIMachineTrampolines):
  2614. * jit/JIT.h:
  2615. * jit/JITInlineMethods.h:
  2616. (JSC::JIT::emitGetFromCallFrameHeaderPtr):
  2617. (JSC::JIT::emitGetFromCallFrameHeader32):
  2618. 2009-05-11 Holger Hans Peter Freyther <zecke@selfish.org>
  2619. Unreviewed build fix. Build ParserAreana.cpp for Qt
  2620. * JavaScriptCore.pri:
  2621. 2009-05-11 Norbert Leser <norbert.leser@nokia.com>
  2622. Reviewed by Darin Adler.
  2623. https://bugs.webkit.org/show_bug.cgi?id=24536
  2624. Symbian compilers cannot resolve WTF::PassRefPtr<JSC::Profile>
  2625. unless Profile.h is included.
  2626. * profiler/ProfileGenerator.h:
  2627. 2009-05-11 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  2628. Reviewed by Holger Freyther.
  2629. https://bugs.webkit.org/show_bug.cgi?id=24284
  2630. * JavaScriptCore.pri: coding style modified
  2631. * jsc.pro: duplicated values removed from INCLUDEPATH, DEFINES
  2632. 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
  2633. Reviewed by NOBODY (build fix).
  2634. Also add ParserArena, in addition to AllInOne, for release builds,
  2635. since adding it to AllInOne breaks Mac.
  2636. * GNUmakefile.am:
  2637. 2009-05-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
  2638. Unreviewed build fix. Adding ParserArena to the autotools build.
  2639. * GNUmakefile.am:
  2640. 2009-05-11 Adam Roben <aroben@apple.com>
  2641. More Windows build fixes after r43479
  2642. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2643. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  2644. Export ParserArena::reset.
  2645. 2009-05-11 Adam Roben <aroben@apple.com>
  2646. Windows build fixes after r43479
  2647. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
  2648. ParserArena to the project.
  2649. * parser/NodeConstructors.h: Added a missing include.
  2650. (JSC::ParserArenaDeletable::operator new): Marked these as inline.
  2651. 2009-05-10 Maciej Stachowiak <mjs@apple.com>
  2652. Reviewed by Geoff Garen.
  2653. - fixed REGRESSION(r43432): Many JavaScriptCore tests crash in 64-bit
  2654. https://bugs.webkit.org/show_bug.cgi?id=25680
  2655. Accound for the 64-bit instruction prefix when rewriting mov to lea on 64-bit.
  2656. * jit/JIT.h:
  2657. * jit/JITPropertyAccess.cpp:
  2658. (JSC::JIT::patchGetByIdSelf):
  2659. (JSC::JIT::patchPutByIdReplace):
  2660. 2009-05-10 Darin Adler <darin@apple.com>
  2661. Reviewed by Cameron Zwarich.
  2662. Bug 25674: syntax tree nodes should use arena allocation
  2663. https://bugs.webkit.org/show_bug.cgi?id=25674
  2664. Part two: Remove reference counting from most nodes.
  2665. * JavaScriptCore.exp: Updated.
  2666. * JavaScriptCore.xcodeproj/project.pbxproj: Added ParserArena.h and .cpp.
  2667. * parser/Grammar.y: Replaced uses of ParserRefCountedData with uses of
  2668. ParserArenaData. Took out now-nonfunctional code that tries to manually
  2669. release declaration list. Changed the new calls that create FuncDeclNode
  2670. and FuncExprNode so that they use the proper version of operator new for
  2671. the reference-counted idiom, not the deletion idiom.
  2672. * parser/NodeConstructors.h:
  2673. (JSC::ParserArenaDeletable::operator new): Added.
  2674. (JSC::ParserArenaRefCounted::ParserArenaRefCounted): Added.
  2675. (JSC::Node::Node): Removed ParserRefCounted initializer.
  2676. (JSC::ElementNode::ElementNode): Ditto.
  2677. (JSC::PropertyNode::PropertyNode): Ditto.
  2678. (JSC::ArgumentsNode::ArgumentsNode): Ditto.
  2679. (JSC::SourceElements::SourceElements): Ditto.
  2680. (JSC::ParameterNode::ParameterNode): Ditto.
  2681. (JSC::FuncExprNode::FuncExprNode): Added ParserArenaRefCounted initializer.
  2682. (JSC::FuncDeclNode::FuncDeclNode): Ditto.
  2683. (JSC::CaseClauseNode::CaseClauseNode): Removed ParserRefCounted initializer.
  2684. (JSC::ClauseListNode::ClauseListNode): Ditto.
  2685. (JSC::CaseBlockNode::CaseBlockNode): Ditto.
  2686. * parser/NodeInfo.h: Replaced uses of ParserRefCountedData with uses of
  2687. ParserArenaData.
  2688. * parser/Nodes.cpp:
  2689. (JSC::ScopeNode::ScopeNode): Added ParserArenaRefCounted initializer.
  2690. (JSC::ProgramNode::create): Use the proper version of operator new for
  2691. the reference-counted idiom, not the deletion idiom. Use the arena
  2692. contains function instead of the vecctor find function.
  2693. (JSC::EvalNode::create): Use the proper version of operator new for
  2694. the reference-counted idiom, not the deletion idiom. Use the arena
  2695. reset function instead of the vector shrink function.
  2696. (JSC::FunctionBodyNode::createNativeThunk): Use the proper version
  2697. of operator new for the reference-counted idiom, not the deletion idiom.
  2698. (JSC::FunctionBodyNode::create): More of the same.
  2699. * parser/Nodes.h: Added ParserArenaDeletable and ParserArenaRefCounted
  2700. to replace ParserRefCounted. Fixed inheritance so only the classes that
  2701. need reference counting inherit from ParserArenaRefCounted.
  2702. * parser/Parser.cpp:
  2703. (JSC::Parser::parse): Set m_sourceElements to 0 since it now starts
  2704. uninitialized. Just set it to 0 again in the failure case, since it's
  2705. now just a raw pointer, not an owning one.
  2706. (JSC::Parser::reparseInPlace): Removed now-unneeded get() function.
  2707. (JSC::Parser::didFinishParsing): Replaced uses of ParserRefCountedData
  2708. with uses of ParserArenaData.
  2709. * parser/Parser.h: Less RefPtr, more arena.
  2710. * parser/ParserArena.cpp: Added.
  2711. * parser/ParserArena.h: Added.
  2712. * runtime/JSGlobalData.cpp:
  2713. (JSC::JSGlobalData::~JSGlobalData): Removed arena-related code, since it's
  2714. now in the Parser.
  2715. (JSC::JSGlobalData::createLeaked): Removed unneeded #ifndef.
  2716. (JSC::JSGlobalData::createNativeThunk): Tweaked #if a bit.
  2717. * runtime/JSGlobalData.h: Removed parserArena, which is now in Parser.
  2718. * wtf/RefCounted.h: Added deletionHasBegun function, for use in
  2719. assertions to catch deletion not done by the deref function.
  2720. 2009-05-10 David Kilzer <ddkilzer@apple.com>
  2721. Part 2: Try to fix the Windows build by adding a symbol which is really just a re-mangling of a changed method signature
  2722. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2723. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  2724. 2009-05-10 David Kilzer <ddkilzer@apple.com>
  2725. Try to fix the Windows build by removing an unknown symbol
  2726. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2727. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  2728. 2009-05-10 David Kilzer <ddkilzer@apple.com>
  2729. Touch Nodes.cpp to try to fix Windows build
  2730. * parser/Nodes.cpp: Removed whitespace.
  2731. 2009-05-10 Darin Adler <darin@apple.com>
  2732. Reviewed by Maciej Stachowiak.
  2733. Quick fix for failures seen on buildbot. Maciej plans a better fix later.
  2734. * wtf/dtoa.cpp: Change the hardcoded number of 32-bit words in a BigInt
  2735. from 32 to 64. Parsing "1e500", for example, requires more than 32 words.
  2736. 2009-05-10 Darin Adler <darin@apple.com>
  2737. Reviewed by Sam Weinig.
  2738. Bug 25674: syntax tree nodes should use arena allocation
  2739. Part one: Change lifetimes so we won't have to use reference
  2740. counting so much, but don't eliminate the reference counts
  2741. entirely yet.
  2742. * JavaScriptCore.exp: Updated.
  2743. * bytecompiler/BytecodeGenerator.cpp:
  2744. (JSC::BytecodeGenerator::BytecodeGenerator): Update for use of raw pointers
  2745. instead of RefPtr.
  2746. (JSC::BytecodeGenerator::emitCall): Ditto.
  2747. (JSC::BytecodeGenerator::emitConstruct): Ditto.
  2748. * parser/Grammar.y: Update node creating code to use new (JSGlobalData*)
  2749. instead of the plain new. At the moment this is just a hook for future
  2750. arena allocation; it's inline and JSGlobalData* is not used.
  2751. * parser/NodeConstructors.h: Updated for name change of parserObjects to
  2752. parserArena. Also added explicit initialization for raw pointers that used
  2753. to be RefPtr. Also removed some uses of get() that aren't needed now that
  2754. the pointers are raw pointers. Also eliminated m_parameter from FuncExprNode
  2755. and FuncDeclNode. Also changed node-creating code to use new (JSGlobalData*)
  2756. as above.
  2757. * parser/Nodes.cpp: Eliminated NodeReleaser and all use of it.
  2758. (JSC::ParserRefCounted::ParserRefCounted): Updated for name change of
  2759. parserObjects to parserArena.
  2760. (JSC::SourceElements::append): Use raw pointers.
  2761. (JSC::ArrayNode::emitBytecode): Ditto.
  2762. (JSC::ArrayNode::isSimpleArray): Ditto.
  2763. (JSC::ArrayNode::toArgumentList): Ditto.
  2764. (JSC::ObjectLiteralNode::emitBytecode): Ditto.
  2765. (JSC::PropertyListNode::emitBytecode): Ditto.
  2766. (JSC::BracketAccessorNode::emitBytecode): Ditto.
  2767. (JSC::DotAccessorNode::emitBytecode): Ditto.
  2768. (JSC::ArgumentListNode::emitBytecode): Ditto.
  2769. (JSC::NewExprNode::emitBytecode): Ditto.
  2770. (JSC::EvalFunctionCallNode::emitBytecode): Ditto.
  2771. (JSC::FunctionCallValueNode::emitBytecode): Ditto.
  2772. (JSC::FunctionCallResolveNode::emitBytecode): Ditto.
  2773. (JSC::FunctionCallBracketNode::emitBytecode): Ditto.
  2774. (JSC::FunctionCallDotNode::emitBytecode): Ditto.
  2775. (JSC::CallFunctionCallDotNode::emitBytecode): Ditto.
  2776. (JSC::ApplyFunctionCallDotNode::emitBytecode): Ditto.
  2777. (JSC::PostfixBracketNode::emitBytecode): Ditto.
  2778. (JSC::PostfixDotNode::emitBytecode): Ditto.
  2779. (JSC::DeleteBracketNode::emitBytecode): Ditto.
  2780. (JSC::DeleteDotNode::emitBytecode): Ditto.
  2781. (JSC::DeleteValueNode::emitBytecode): Ditto.
  2782. (JSC::VoidNode::emitBytecode): Ditto.
  2783. (JSC::TypeOfValueNode::emitBytecode): Ditto.
  2784. (JSC::PrefixBracketNode::emitBytecode): Ditto.
  2785. (JSC::PrefixDotNode::emitBytecode): Ditto.
  2786. (JSC::UnaryOpNode::emitBytecode): Ditto.
  2787. (JSC::BinaryOpNode::emitStrcat): Ditto.
  2788. (JSC::BinaryOpNode::emitBytecode): Ditto.
  2789. (JSC::EqualNode::emitBytecode): Ditto.
  2790. (JSC::StrictEqualNode::emitBytecode): Ditto.
  2791. (JSC::ReverseBinaryOpNode::emitBytecode): Ditto.
  2792. (JSC::ThrowableBinaryOpNode::emitBytecode): Ditto.
  2793. (JSC::InstanceOfNode::emitBytecode): Ditto.
  2794. (JSC::LogicalOpNode::emitBytecode): Ditto.
  2795. (JSC::ConditionalNode::emitBytecode): Ditto.
  2796. (JSC::ReadModifyResolveNode::emitBytecode): Ditto.
  2797. (JSC::AssignResolveNode::emitBytecode): Ditto.
  2798. (JSC::AssignDotNode::emitBytecode): Ditto.
  2799. (JSC::ReadModifyDotNode::emitBytecode): Ditto.
  2800. (JSC::AssignBracketNode::emitBytecode): Ditto.
  2801. (JSC::ReadModifyBracketNode::emitBytecode): Ditto.
  2802. (JSC::CommaNode::emitBytecode): Ditto.
  2803. (JSC::ConstDeclNode::emitCodeSingle): Ditto.
  2804. (JSC::ConstDeclNode::emitBytecode): Ditto.
  2805. (JSC::ConstStatementNode::emitBytecode): Ditto.
  2806. (JSC::statementListEmitCode): Ditto.
  2807. (JSC::BlockNode::emitBytecode): Ditto.
  2808. (JSC::ExprStatementNode::emitBytecode): Ditto.
  2809. (JSC::VarStatementNode::emitBytecode): Ditto.
  2810. (JSC::IfNode::emitBytecode): Ditto.
  2811. (JSC::IfElseNode::emitBytecode): Ditto.
  2812. (JSC::DoWhileNode::emitBytecode): Ditto.
  2813. (JSC::WhileNode::emitBytecode): Ditto.
  2814. (JSC::ForNode::emitBytecode): Ditto.
  2815. (JSC::ForInNode::emitBytecode): Ditto.
  2816. (JSC::ReturnNode::emitBytecode): Ditto.
  2817. (JSC::WithNode::emitBytecode): Ditto.
  2818. (JSC::CaseBlockNode::tryOptimizedSwitch): Ditto.
  2819. (JSC::CaseBlockNode::emitBytecodeForBlock): Ditto.
  2820. (JSC::SwitchNode::emitBytecode): Ditto.
  2821. (JSC::LabelNode::emitBytecode): Ditto.
  2822. (JSC::ThrowNode::emitBytecode): Ditto.
  2823. (JSC::TryNode::emitBytecode): Ditto.
  2824. (JSC::ScopeNodeData::ScopeNodeData): Use swap to transfer ownership
  2825. of the arena, varStack and functionStack.
  2826. (JSC::ScopeNode::ScopeNode): Pass in the arena when creating the
  2827. ScopeNodeData.
  2828. (JSC::ProgramNode::ProgramNode): Made this inline since it's used
  2829. in only one place.
  2830. (JSC::ProgramNode::create): Changed this to return a PassRefPtr since
  2831. we plan to have the scope nodes be outside the arena, so they will need
  2832. some kind of ownership transfer (maybe auto_ptr instead of PassRefPtr
  2833. in the future, though). Remove the node from the newly-created arena to
  2834. avoid a circular reference. Later we'll keep the node out of the arena
  2835. by using a different operator new, but for now it's the ParserRefCounted
  2836. constructor that puts the node into the arena, and there's no way to
  2837. bypass that.
  2838. (JSC::EvalNode::EvalNode): Ditto.
  2839. (JSC::EvalNode::create): Ditto.
  2840. (JSC::FunctionBodyNode::FunctionBodyNode): Ditto.
  2841. (JSC::FunctionBodyNode::createNativeThunk): Moved the code that
  2842. reseets the arena here instead of the caller.
  2843. (JSC::FunctionBodyNode::create): Same change as the other create
  2844. functions above.
  2845. (JSC::FunctionBodyNode::emitBytecode): Use raw pointers.
  2846. * parser/Nodes.h: Removed NodeReleaser. Changed FunctionStack to
  2847. use raw pointers. Removed the releaseNodes function. Added an override
  2848. of operator new that takes a JSGlobalData* to prepare for future arena use.
  2849. Use raw pointers instead of RefPtr everywhere possible.
  2850. * parser/Parser.cpp:
  2851. (JSC::Parser::reparseInPlace): Pass the arena in.
  2852. * parser/Parser.h:
  2853. (JSC::Parser::parse): Updated for name change of parserObjects to parserArena.
  2854. (JSC::Parser::reparse): Ditto.
  2855. * runtime/FunctionConstructor.cpp:
  2856. (JSC::extractFunctionBody): Ditto.
  2857. * runtime/JSGlobalData.cpp:
  2858. (JSC::JSGlobalData::~JSGlobalData): Ditto.
  2859. (JSC::JSGlobalData::createNativeThunk): Moved arena manipulation into the
  2860. FunctionBodyNode::createNativeThunk function.
  2861. * runtime/JSGlobalData.h: Tweaked formatting and renamed parserObjects to
  2862. parserArena.
  2863. * wtf/NotFound.h: Added the usual "using WTF" to this header to match the
  2864. rest of WTF.
  2865. 2009-05-10 Dimitri Glazkov <dglazkov@chromium.org>
  2866. Reviewed by Geoffrey Garen.
  2867. https://bugs.webkit.org/show_bug.cgi?id=25670
  2868. Remove no longer valid chunk of code from dtoa.
  2869. * wtf/dtoa.cpp:
  2870. (WTF::dtoa): Removed invalid code.
  2871. 2009-05-10 Alexey Proskuryakov <ap@webkit.org>
  2872. Reviewed by Geoff Garen.
  2873. "Class const *" is the same as "const Class*", use the latter syntax consistently.
  2874. See <http://www.parashift.com/c++-faq-lite/const-correctness.html#faq-18.9>.
  2875. * pcre/pcre_compile.cpp:
  2876. (calculateCompiledPatternLength):
  2877. * runtime/JSObject.h:
  2878. (JSC::JSObject::offsetForLocation):
  2879. (JSC::JSObject::locationForOffset):
  2880. 2009-05-10 Maciej Stachowiak <mjs@apple.com>
  2881. Reviewed by Alexey Proskuryakov.
  2882. - speedup dtoa/strtod
  2883. Added a bunch of inlining, and replaced malloc with stack allocation.
  2884. 0.5% SunSpider speedup (7% on string-tagcloud).
  2885. * runtime/NumberPrototype.cpp:
  2886. (JSC::integerPartNoExp):
  2887. (JSC::numberProtoFuncToExponential):
  2888. * runtime/UString.cpp:
  2889. (JSC::concatenate):
  2890. (JSC::UString::from):
  2891. * wtf/dtoa.cpp:
  2892. (WTF::BigInt::BigInt):
  2893. (WTF::BigInt::operator=):
  2894. (WTF::Balloc):
  2895. (WTF::Bfree):
  2896. (WTF::multadd):
  2897. (WTF::s2b):
  2898. (WTF::i2b):
  2899. (WTF::mult):
  2900. (WTF::pow5mult):
  2901. (WTF::lshift):
  2902. (WTF::cmp):
  2903. (WTF::diff):
  2904. (WTF::b2d):
  2905. (WTF::d2b):
  2906. (WTF::ratio):
  2907. (WTF::strtod):
  2908. (WTF::quorem):
  2909. (WTF::freedtoa):
  2910. (WTF::dtoa):
  2911. * wtf/dtoa.h:
  2912. 2009-05-09 Mike Hommey <glandium@debian.org>
  2913. Reviewed by Geoffrey Garen. Landed by Jan Alonzo.
  2914. Enable JIT on x86-64 gtk+
  2915. https://bugs.webkit.org/show_bug.cgi?id=24724
  2916. * GNUmakefile.am:
  2917. 2009-05-09 Geoffrey Garen <ggaren@apple.com>
  2918. Reviewed by Cameron Zwarich.
  2919. Removed the last non-call-related manually managed JIT stub call.
  2920. * jit/JITArithmetic.cpp:
  2921. (JSC::JIT::compileFastArithSlow_op_rshift): Fully use the JITStubCall
  2922. abstraction, instead of emitPutJITStubArg.
  2923. 2009-05-09 Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
  2924. Reviewed by Gustavo Noronha.
  2925. https://bugs.webkit.org/show_bug.cgi?id=25653
  2926. PLATFORM(X86_64) inherits ia64
  2927. __ia64__ is defined by gcc in an IA64 arch and has completely
  2928. nothing in common with X86-64 exept both are from Intel and have
  2929. an 64bit address space. That's it. Since code seems to expect x86
  2930. here, ia64 has to go.
  2931. * wtf/Platform.h:
  2932. 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
  2933. Suggested by Geoffrey Garen.
  2934. Assume SSE2 is present on X86-64 and on MAC X86-32. This fixes a
  2935. build breakage on non-Mac X86-64 when JIT is enabled.
  2936. * jit/JITArithmetic.cpp:
  2937. 2009-05-09 Gustavo Noronha Silva <gns@gnome.org>
  2938. Build fix, adding missing files to make dist.
  2939. * GNUmakefile.am:
  2940. 2009-05-09 Geoffrey Garen <ggaren@apple.com>
  2941. Windows build fix.
  2942. * assembler/X86Assembler.h:
  2943. (JSC::X86Assembler::patchLoadToLEA):
  2944. 2009-05-09 Geoffrey Garen <ggaren@apple.com>
  2945. Windows build fix.
  2946. * assembler/X86Assembler.h:
  2947. (JSC::X86Assembler::patchLoadToLEA):
  2948. 2009-05-09 Maciej Stachowiak <mjs@apple.com>
  2949. Reviewed by Gavin Barraclough.
  2950. Original patch by John McCall. Updated by Cameron Zwarich. Further refined by me.
  2951. - Assorted speedups to property access
  2952. ~.3%-1% speedup on SunSpider
  2953. 1) When we know from the structure ID that an object is using inline storage, plant direct
  2954. loads and stores against it; no need to indirect through storage pointer.
  2955. 2) Also because of the above, union the property storage pointer with the first inline property
  2956. slot and add an extra inline property slot.
  2957. * assembler/AbstractMacroAssembler.h:
  2958. (JSC::AbstractMacroAssembler::CodeLocationInstruction::CodeLocationInstruction):
  2959. (JSC::AbstractMacroAssembler::CodeLocationInstruction::patchLoadToLEA):
  2960. (JSC::::CodeLocationCommon::instructionAtOffset):
  2961. * assembler/MacroAssembler.h:
  2962. (JSC::MacroAssembler::storePtr):
  2963. * assembler/MacroAssemblerX86.h:
  2964. (JSC::MacroAssemblerX86::store32):
  2965. * assembler/MacroAssemblerX86_64.h:
  2966. (JSC::MacroAssemblerX86_64::storePtr):
  2967. * assembler/X86Assembler.h:
  2968. (JSC::X86Assembler::movq_EAXm):
  2969. (JSC::X86Assembler::movl_rm):
  2970. (JSC::X86Assembler::patchLoadToLEA):
  2971. * jit/JIT.cpp:
  2972. (JSC::JIT::privateCompileMainPass):
  2973. * jit/JIT.h:
  2974. * jit/JITPropertyAccess.cpp:
  2975. (JSC::JIT::compileGetByIdHotPath):
  2976. (JSC::JIT::compilePutByIdHotPath):
  2977. (JSC::JIT::compilePutDirectOffset):
  2978. (JSC::JIT::compileGetDirectOffset):
  2979. (JSC::JIT::privateCompilePutByIdTransition):
  2980. (JSC::JIT::patchGetByIdSelf):
  2981. (JSC::JIT::patchPutByIdReplace):
  2982. (JSC::JIT::privateCompileGetByIdSelf):
  2983. (JSC::JIT::privateCompileGetByIdProto):
  2984. (JSC::JIT::privateCompileGetByIdSelfList):
  2985. (JSC::JIT::privateCompileGetByIdProtoList):
  2986. (JSC::JIT::privateCompileGetByIdChainList):
  2987. (JSC::JIT::privateCompileGetByIdChain):
  2988. (JSC::JIT::privateCompilePutByIdReplace):
  2989. * runtime/JSObject.cpp:
  2990. (JSC::JSObject::mark):
  2991. (JSC::JSObject::removeDirect):
  2992. * runtime/JSObject.h:
  2993. (JSC::JSObject::propertyStorage):
  2994. (JSC::JSObject::getDirect):
  2995. (JSC::JSObject::getOffset):
  2996. (JSC::JSObject::offsetForLocation):
  2997. (JSC::JSObject::locationForOffset):
  2998. (JSC::JSObject::getDirectOffset):
  2999. (JSC::JSObject::putDirectOffset):
  3000. (JSC::JSObject::isUsingInlineStorage):
  3001. (JSC::JSObject::):
  3002. (JSC::JSObject::JSObject):
  3003. (JSC::JSObject::~JSObject):
  3004. (JSC::Structure::isUsingInlineStorage):
  3005. (JSC::JSObject::putDirect):
  3006. (JSC::JSObject::putDirectWithoutTransition):
  3007. (JSC::JSObject::allocatePropertyStorageInline):
  3008. * runtime/Structure.h:
  3009. 2009-05-09 Geoffrey Garen <ggaren@apple.com>
  3010. Reviewed by Gavin Barraclough.
  3011. Changed all our JIT stubs so that they return a maximum of 1 JS value or
  3012. two non-JS pointers, and do all other value returning through out
  3013. parameters, in preparation for 64bit JS values on a 32bit system.
  3014. Stubs that used to return two JSValues now return one JSValue and take
  3015. and out parameter specifying where in the register array the second
  3016. value should go.
  3017. SunSpider reports no change.
  3018. * jit/JIT.cpp:
  3019. (JSC::JIT::privateCompileMainPass):
  3020. * jit/JITArithmetic.cpp:
  3021. (JSC::JIT::compileFastArithSlow_op_post_inc):
  3022. (JSC::JIT::compileFastArithSlow_op_post_dec):
  3023. * jit/JITStubs.cpp:
  3024. (JSC::JITStubs::cti_op_call_arityCheck):
  3025. (JSC::JITStubs::cti_op_resolve_func):
  3026. (JSC::JITStubs::cti_op_post_inc):
  3027. (JSC::JITStubs::cti_op_resolve_with_base):
  3028. (JSC::JITStubs::cti_op_post_dec):
  3029. * jit/JITStubs.h:
  3030. (JSC::):
  3031. 2009-05-08 Geoffrey Garen <ggaren@apple.com>
  3032. Reviewed by Cameron Zwarich.
  3033. Fixed <rdar://problem/6634956> CrashTracer: [REGRESSION] >400 crashes
  3034. in Safari at com.apple.JavaScriptCore JSC::BytecodeGenerator::emitComplexJumpScopes + 468
  3035. https://bugs.webkit.org/show_bug.cgi?id=25658
  3036. * bytecompiler/BytecodeGenerator.cpp:
  3037. (JSC::BytecodeGenerator::emitComplexJumpScopes): Guard the whole loop
  3038. with a bounds check. The old loop logic would decrement and read topScope
  3039. without a bounds check, which could cause crashes on page boundaries.
  3040. 2009-05-08 Jan Michael Alonzo <jmalonzo@webkit.org>
  3041. Reviewed by NOBODY (BuildFix).
  3042. Gtk fix: add LiteralParser to the build script per r43424.
  3043. Add LiteralParser to the Qt and Wx build scripts too.
  3044. * GNUmakefile.am:
  3045. * JavaScriptCore.pri:
  3046. * JavaScriptCoreSources.bkl:
  3047. 2009-05-08 Oliver Hunt <oliver@apple.com>
  3048. Reviewed by Gavin Barraclough and Darin Adler.
  3049. Add a limited literal parser for eval to handle object and array literals fired at eval
  3050. This is a simplified parser and lexer that we can throw at strings passed to eval
  3051. in case a site is using eval to parse JSON (eg. json2.js). The lexer is intentionally
  3052. limited (in effect it's whitelisting a limited "common" subset of the JSON grammar)
  3053. as this decreases the likelihood of us wating time attempting to parse any significant
  3054. amount of non-JSON content.
  3055. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3056. * JavaScriptCore.xcodeproj/project.pbxproj:
  3057. * interpreter/Interpreter.cpp:
  3058. (JSC::Interpreter::callEval):
  3059. * runtime/JSGlobalObjectFunctions.cpp:
  3060. (JSC::globalFuncEval):
  3061. * runtime/LiteralParser.cpp: Added.
  3062. (JSC::isStringCharacter):
  3063. (JSC::LiteralParser::Lexer::lex):
  3064. (JSC::LiteralParser::Lexer::lexString):
  3065. (JSC::LiteralParser::Lexer::lexNumber):
  3066. (JSC::LiteralParser::parseStatement):
  3067. (JSC::LiteralParser::parseExpression):
  3068. (JSC::LiteralParser::parseArray):
  3069. (JSC::LiteralParser::parseObject):
  3070. (JSC::LiteralParser::StackGuard::StackGuard):
  3071. (JSC::LiteralParser::StackGuard::~StackGuard):
  3072. (JSC::LiteralParser::StackGuard::isSafe):
  3073. * runtime/LiteralParser.h: Added.
  3074. (JSC::LiteralParser::LiteralParser):
  3075. (JSC::LiteralParser::attemptJSONParse):
  3076. (JSC::LiteralParser::):
  3077. (JSC::LiteralParser::Lexer::Lexer):
  3078. (JSC::LiteralParser::Lexer::next):
  3079. (JSC::LiteralParser::Lexer::currentToken):
  3080. (JSC::LiteralParser::abortParse):
  3081. 2009-05-08 Geoffrey Garen <ggaren@apple.com>
  3082. Not reviewed.
  3083. Restored a Mozilla JS test I accidentally gutted.
  3084. * tests/mozilla/ecma/Array/15.4.4.2.js:
  3085. (getTestCases):
  3086. (test):
  3087. 2009-05-08 Geoffrey Garen <ggaren@apple.com>
  3088. Reviewed by Gavin Barraclough.
  3089. More abstraction for JITStub calls from JITed code.
  3090. Added a JITStubCall class that automatically handles things like assigning
  3091. arguments to different stack slots and storing return values. Deployed
  3092. the class in about a billion places. A bunch more places remain to be
  3093. fixed up, but this is a good stopping point for now.
  3094. * jit/JIT.cpp:
  3095. (JSC::JIT::emitTimeoutCheck):
  3096. (JSC::JIT::privateCompileMainPass):
  3097. (JSC::JIT::privateCompileSlowCases):
  3098. (JSC::JIT::privateCompile):
  3099. * jit/JIT.h:
  3100. (JSC::JIT::JSRInfo::JSRInfo):
  3101. (JSC::JITStubCall::JITStubCall):
  3102. (JSC::JITStubCall::addArgument):
  3103. (JSC::JITStubCall::call):
  3104. (JSC::JITStubCall::):
  3105. (JSC::CallEvalJITStub::CallEvalJITStub):
  3106. * jit/JITArithmetic.cpp:
  3107. (JSC::JIT::compileFastArithSlow_op_lshift):
  3108. (JSC::JIT::compileFastArithSlow_op_rshift):
  3109. (JSC::JIT::compileFastArithSlow_op_jnless):
  3110. (JSC::JIT::compileFastArithSlow_op_bitand):
  3111. (JSC::JIT::compileFastArithSlow_op_mod):
  3112. (JSC::JIT::compileFastArith_op_mod):
  3113. (JSC::JIT::compileFastArithSlow_op_post_inc):
  3114. (JSC::JIT::compileFastArithSlow_op_post_dec):
  3115. (JSC::JIT::compileFastArithSlow_op_pre_inc):
  3116. (JSC::JIT::compileFastArithSlow_op_pre_dec):
  3117. (JSC::JIT::compileFastArith_op_add):
  3118. (JSC::JIT::compileFastArith_op_mul):
  3119. (JSC::JIT::compileFastArith_op_sub):
  3120. (JSC::JIT::compileBinaryArithOpSlowCase):
  3121. (JSC::JIT::compileFastArithSlow_op_add):
  3122. (JSC::JIT::compileFastArithSlow_op_mul):
  3123. * jit/JITCall.cpp:
  3124. (JSC::JIT::compileOpCall):
  3125. (JSC::):
  3126. * jit/JITPropertyAccess.cpp:
  3127. (JSC::JIT::compileGetByIdHotPath):
  3128. (JSC::JIT::compilePutByIdHotPath):
  3129. (JSC::JIT::compileGetByIdSlowCase):
  3130. (JSC::JIT::compilePutByIdSlowCase):
  3131. * jit/JITStubs.cpp:
  3132. (JSC::JITStubs::cti_op_resolve_func):
  3133. (JSC::JITStubs::cti_op_resolve_with_base):
  3134. 2009-05-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  3135. Reviewed by Maciej Stachowiak.
  3136. Add a new opcode jnlesseq, and optimize its compilation in the JIT using
  3137. techniques similar to what were used to optimize jnless in r43363.
  3138. This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
  3139. control-flow-recursive, date-format-xparb, and string-base64.
  3140. * bytecode/CodeBlock.cpp:
  3141. (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
  3142. * bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
  3143. * bytecompiler/BytecodeGenerator.cpp:
  3144. (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization
  3145. for op_jnlesseq when emitting lesseq followed by a jump.
  3146. * interpreter/Interpreter.cpp:
  3147. (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
  3148. * jit/JIT.cpp:
  3149. (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq.
  3150. (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
  3151. * jit/JIT.h:
  3152. * jit/JITArithmetic.cpp:
  3153. (JSC::JIT::compileFastArith_op_jnlesseq): Added.
  3154. (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
  3155. * jit/JITStubs.cpp:
  3156. (JSC::JITStubs::cti_op_jlesseq): Added.
  3157. * jit/JITStubs.h:
  3158. 2009-05-08 Maciej Stachowiak <mjs@apple.com>
  3159. Reviewed by Cameron Zwarich.
  3160. - fix test failures on 64-bit
  3161. * jit/JITArithmetic.cpp:
  3162. (JSC::JIT::compileFastArithSlow_op_jnless): Avoid accidentaly treating an
  3163. immediate int as an immediate float in the 64-bit value representation.
  3164. 2009-05-08 Gavin Barraclough <barraclough@apple.com>
  3165. Rubber stamped by Oliver Hunt.
  3166. Removing an empty constructor and an uncalled, empty function seems to be a
  3167. pretty solid 1% regeression on my machine, so I'm going to put them back.
  3168. Um. Yeah, this this pretty pointles and makes no sense at all. I officially
  3169. lose the will to live in 3... 2...
  3170. * bytecode/SamplingTool.cpp:
  3171. (JSC::SamplingTool::notifyOfScope):
  3172. * bytecode/SamplingTool.h:
  3173. (JSC::SamplingTool::~SamplingTool):
  3174. 2009-05-08 Gavin Barraclough <barraclough@apple.com>
  3175. Reviewed by Oliver "I see lots of ifdefs" Hunt.
  3176. Fix (kinda) for sampling tool breakage. The codeblock sampling tool has become
  3177. b0rked due to recent changes in native function calling. The initialization of
  3178. a ScopeNode appears to now occur before the sampling tool (or possibly the
  3179. interpreter has been brought into existence, wihich leads to crashyness).
  3180. This patch doesn't fix the problem. The crash occurs when tracking a Scope, but
  3181. we shouldn't need to track scopes when we're just sampling opcodes, not
  3182. codeblocks. Not retaining Scopes when just opcode sampling will reduce sampling
  3183. overhead reducing any instrumentation skew, which is a good thing. As a side
  3184. benefit this patch also gets the opcode sampling going again, albeit in a bit of
  3185. a lame way. Will come back later with a proper fix from codeblock sampling.
  3186. * JavaScriptCore.exp:
  3187. * bytecode/SamplingTool.cpp:
  3188. (JSC::compareLineCountInfoSampling):
  3189. (JSC::SamplingTool::dump):
  3190. * bytecode/SamplingTool.h:
  3191. (JSC::SamplingTool::SamplingTool):
  3192. * parser/Nodes.cpp:
  3193. (JSC::ScopeNode::ScopeNode):
  3194. 2009-05-07 Mark Rowe <mrowe@apple.com>
  3195. Rubber-stamped by Oliver Hunt.
  3196. Fix <https://bugs.webkit.org/show_bug.cgi?id=25640>.
  3197. Bug 25640: Crash on quit in r43384 nightly build on Leopard w/ Safari 4 beta installed
  3198. Roll out r43366 as it removed symbols that Safari 4 Beta uses.
  3199. * JavaScriptCore.exp:
  3200. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  3201. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  3202. * bytecode/SamplingTool.cpp:
  3203. (JSC::SamplingThread::start):
  3204. (JSC::SamplingThread::stop):
  3205. * bytecode/SamplingTool.h:
  3206. * wtf/CrossThreadRefCounted.h:
  3207. (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
  3208. (WTF::::ref):
  3209. (WTF::::deref):
  3210. * wtf/Threading.h:
  3211. * wtf/ThreadingNone.cpp:
  3212. * wtf/ThreadingPthreads.cpp:
  3213. (WTF::threadMapMutex):
  3214. (WTF::initializeThreading):
  3215. (WTF::threadMap):
  3216. (WTF::identifierByPthreadHandle):
  3217. (WTF::establishIdentifierForPthreadHandle):
  3218. (WTF::pthreadHandleForIdentifier):
  3219. (WTF::clearPthreadHandleForIdentifier):
  3220. (WTF::createThreadInternal):
  3221. (WTF::waitForThreadCompletion):
  3222. (WTF::detachThread):
  3223. (WTF::currentThread):
  3224. * wtf/ThreadingWin.cpp:
  3225. (WTF::threadMapMutex):
  3226. (WTF::initializeThreading):
  3227. (WTF::threadMap):
  3228. (WTF::storeThreadHandleByIdentifier):
  3229. (WTF::threadHandleForIdentifier):
  3230. (WTF::clearThreadHandleForIdentifier):
  3231. (WTF::createThreadInternal):
  3232. (WTF::waitForThreadCompletion):
  3233. (WTF::detachThread):
  3234. (WTF::currentThread):
  3235. * wtf/gtk/ThreadingGtk.cpp:
  3236. (WTF::threadMapMutex):
  3237. (WTF::initializeThreading):
  3238. (WTF::threadMap):
  3239. (WTF::identifierByGthreadHandle):
  3240. (WTF::establishIdentifierForThread):
  3241. (WTF::threadForIdentifier):
  3242. (WTF::clearThreadForIdentifier):
  3243. (WTF::createThreadInternal):
  3244. (WTF::waitForThreadCompletion):
  3245. (WTF::currentThread):
  3246. * wtf/qt/ThreadingQt.cpp:
  3247. (WTF::threadMapMutex):
  3248. (WTF::threadMap):
  3249. (WTF::identifierByQthreadHandle):
  3250. (WTF::establishIdentifierForThread):
  3251. (WTF::clearThreadForIdentifier):
  3252. (WTF::threadForIdentifier):
  3253. (WTF::initializeThreading):
  3254. (WTF::createThreadInternal):
  3255. (WTF::waitForThreadCompletion):
  3256. (WTF::currentThread):
  3257. 2009-05-07 Gustavo Noronha Silva <gns@gnome.org>
  3258. Suggested by Oliver Hunt.
  3259. Also check for Linux for the special-cased calling convention.
  3260. * jit/JIT.cpp:
  3261. (JSC::JIT::privateCompileCTIMachineTrampolines):
  3262. * wtf/Platform.h:
  3263. 2009-05-07 Gavin Barraclough <barraclough@apple.com>
  3264. Reviewed by Maciej Stachowiak.
  3265. Previously, when appending to an existing string and growing the underlying buffer,
  3266. we would actually allocate 110% of the required size in order to give us some space
  3267. to expand into. Now we treat strings differently based on their size:
  3268. Small Strings (up to 4 pages):
  3269. Expand the allocation size to 112.5% of the amount requested. This is largely sicking
  3270. to our previous policy, however 112.5% is cheaper to calculate.
  3271. Medium Strings (up to 128 pages):
  3272. For pages covering multiple pages over-allocation is less of a concern - any unused
  3273. space will not be paged in if it is not used, so this is purely a VM overhead. For
  3274. these strings allocate 2x the requested size.
  3275. Large Strings (to infinity and beyond!):
  3276. Revert to our 112.5% policy - probably best to limit the amount of unused VM we allow
  3277. any individual string be responsible for.
  3278. Additionally, round small allocations up to a multiple of 16 bytes, and medium and
  3279. large allocations up to a multiple of page size.
  3280. ~1.5% progression on Sunspider, due to 5% improvement on tagcloud & 15% on validate.
  3281. * runtime/UString.cpp:
  3282. (JSC::expandedSize):
  3283. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3284. Reviewed by Cameron Zwarich.
  3285. Fixed a minor sequencing error introduced by recent Parser speedups.
  3286. * runtime/JSGlobalData.cpp:
  3287. (JSC::JSGlobalData::createNativeThunk): Missed a spot in my last patch.
  3288. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3289. Not reviewed.
  3290. * wtf/Platform.h: Reverted an accidental (and performance-catastrophic)
  3291. change.
  3292. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3293. Reviewed by Cameron Zwarich.
  3294. Fixed a minor sequencing error introduced by recent Parser speedups.
  3295. * parser/Parser.cpp:
  3296. (JSC::Parser::reparseInPlace): Missed a spot in my last patch.
  3297. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3298. Reviewed by Cameron Zwarich.
  3299. Fixed a minor sequencing error introduced by recent Parser speedups.
  3300. * parser/Parser.cpp:
  3301. (JSC::Parser::parse):
  3302. * parser/Parser.h:
  3303. (JSC::Parser::parse):
  3304. (JSC::Parser::reparse): Shrink the parsedObjects vector after allocating
  3305. the root node, to avoid leaving a stray node in the vector, since that's
  3306. a slight memory leak, and it causes problems during JSGlobalData teardown.
  3307. * runtime/JSGlobalData.cpp:
  3308. (JSC::JSGlobalData::~JSGlobalData): ASSERT that we're not being torn
  3309. down while we think we're still parsing, since that would cause lots of
  3310. bad memory references during our destruction.
  3311. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3312. Reviewed by Cameron Zwarich.
  3313. Replaced two more macros with references to the JITStackFrame structure.
  3314. * jit/JIT.cpp:
  3315. (JSC::JIT::privateCompileMainPass):
  3316. * jit/JITInlineMethods.h:
  3317. (JSC::JIT::restoreArgumentReference):
  3318. * jit/JITStubs.cpp:
  3319. (JSC::):
  3320. * jit/JITStubs.h:
  3321. 2009-05-07 Oliver Hunt <oliver@apple.com>
  3322. Reviewed by Gavin Barraclough.
  3323. Improve native call performance
  3324. Fix the windows build by adding calling convention declarations everywhere,
  3325. chose fastcall as that seemed most sensible given we were having to declare
  3326. the convention explicitly. In addition switched to fastcall on mac in the
  3327. deluded belief that documented fastcall behavior on windows would match
  3328. actual its actual behavior.
  3329. * API/JSCallbackFunction.h:
  3330. * API/JSCallbackObject.h:
  3331. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  3332. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  3333. * interpreter/CallFrame.h:
  3334. (JSC::ExecState::argumentCount):
  3335. * jit/JIT.cpp:
  3336. (JSC::JIT::privateCompileCTIMachineTrampolines):
  3337. * jsc.cpp:
  3338. (functionPrint):
  3339. (functionDebug):
  3340. (functionGC):
  3341. (functionVersion):
  3342. (functionRun):
  3343. (functionLoad):
  3344. (functionSetSamplingFlags):
  3345. (functionClearSamplingFlags):
  3346. (functionReadline):
  3347. (functionQuit):
  3348. * runtime/ArrayConstructor.cpp:
  3349. (JSC::callArrayConstructor):
  3350. * runtime/ArrayPrototype.cpp:
  3351. (JSC::arrayProtoFuncToString):
  3352. (JSC::arrayProtoFuncToLocaleString):
  3353. (JSC::arrayProtoFuncJoin):
  3354. (JSC::arrayProtoFuncConcat):
  3355. (JSC::arrayProtoFuncPop):
  3356. (JSC::arrayProtoFuncPush):
  3357. (JSC::arrayProtoFuncReverse):
  3358. (JSC::arrayProtoFuncShift):
  3359. (JSC::arrayProtoFuncSlice):
  3360. (JSC::arrayProtoFuncSort):
  3361. (JSC::arrayProtoFuncSplice):
  3362. (JSC::arrayProtoFuncUnShift):
  3363. (JSC::arrayProtoFuncFilter):
  3364. (JSC::arrayProtoFuncMap):
  3365. (JSC::arrayProtoFuncEvery):
  3366. (JSC::arrayProtoFuncForEach):
  3367. (JSC::arrayProtoFuncSome):
  3368. (JSC::arrayProtoFuncReduce):
  3369. (JSC::arrayProtoFuncReduceRight):
  3370. (JSC::arrayProtoFuncIndexOf):
  3371. (JSC::arrayProtoFuncLastIndexOf):
  3372. * runtime/BooleanConstructor.cpp:
  3373. (JSC::callBooleanConstructor):
  3374. * runtime/BooleanPrototype.cpp:
  3375. (JSC::booleanProtoFuncToString):
  3376. (JSC::booleanProtoFuncValueOf):
  3377. * runtime/CallData.h:
  3378. * runtime/DateConstructor.cpp:
  3379. (JSC::callDate):
  3380. (JSC::dateParse):
  3381. (JSC::dateNow):
  3382. (JSC::dateUTC):
  3383. * runtime/DatePrototype.cpp:
  3384. (JSC::dateProtoFuncToString):
  3385. (JSC::dateProtoFuncToUTCString):
  3386. (JSC::dateProtoFuncToDateString):
  3387. (JSC::dateProtoFuncToTimeString):
  3388. (JSC::dateProtoFuncToLocaleString):
  3389. (JSC::dateProtoFuncToLocaleDateString):
  3390. (JSC::dateProtoFuncToLocaleTimeString):
  3391. (JSC::dateProtoFuncGetTime):
  3392. (JSC::dateProtoFuncGetFullYear):
  3393. (JSC::dateProtoFuncGetUTCFullYear):
  3394. (JSC::dateProtoFuncToGMTString):
  3395. (JSC::dateProtoFuncGetMonth):
  3396. (JSC::dateProtoFuncGetUTCMonth):
  3397. (JSC::dateProtoFuncGetDate):
  3398. (JSC::dateProtoFuncGetUTCDate):
  3399. (JSC::dateProtoFuncGetDay):
  3400. (JSC::dateProtoFuncGetUTCDay):
  3401. (JSC::dateProtoFuncGetHours):
  3402. (JSC::dateProtoFuncGetUTCHours):
  3403. (JSC::dateProtoFuncGetMinutes):
  3404. (JSC::dateProtoFuncGetUTCMinutes):
  3405. (JSC::dateProtoFuncGetSeconds):
  3406. (JSC::dateProtoFuncGetUTCSeconds):
  3407. (JSC::dateProtoFuncGetMilliSeconds):
  3408. (JSC::dateProtoFuncGetUTCMilliseconds):
  3409. (JSC::dateProtoFuncGetTimezoneOffset):
  3410. (JSC::dateProtoFuncSetTime):
  3411. (JSC::dateProtoFuncSetMilliSeconds):
  3412. (JSC::dateProtoFuncSetUTCMilliseconds):
  3413. (JSC::dateProtoFuncSetSeconds):
  3414. (JSC::dateProtoFuncSetUTCSeconds):
  3415. (JSC::dateProtoFuncSetMinutes):
  3416. (JSC::dateProtoFuncSetUTCMinutes):
  3417. (JSC::dateProtoFuncSetHours):
  3418. (JSC::dateProtoFuncSetUTCHours):
  3419. (JSC::dateProtoFuncSetDate):
  3420. (JSC::dateProtoFuncSetUTCDate):
  3421. (JSC::dateProtoFuncSetMonth):
  3422. (JSC::dateProtoFuncSetUTCMonth):
  3423. (JSC::dateProtoFuncSetFullYear):
  3424. (JSC::dateProtoFuncSetUTCFullYear):
  3425. (JSC::dateProtoFuncSetYear):
  3426. (JSC::dateProtoFuncGetYear):
  3427. * runtime/ErrorConstructor.cpp:
  3428. (JSC::callErrorConstructor):
  3429. * runtime/ErrorPrototype.cpp:
  3430. (JSC::errorProtoFuncToString):
  3431. * runtime/FunctionConstructor.cpp:
  3432. (JSC::callFunctionConstructor):
  3433. * runtime/FunctionPrototype.cpp:
  3434. (JSC::callFunctionPrototype):
  3435. (JSC::functionProtoFuncToString):
  3436. (JSC::functionProtoFuncApply):
  3437. (JSC::functionProtoFuncCall):
  3438. * runtime/JSFunction.h:
  3439. (JSC::JSFunction::nativeFunction):
  3440. (JSC::JSFunction::setScopeChain):
  3441. * runtime/JSGlobalObjectFunctions.cpp:
  3442. (JSC::globalFuncEval):
  3443. (JSC::globalFuncParseInt):
  3444. (JSC::globalFuncParseFloat):
  3445. (JSC::globalFuncIsNaN):
  3446. (JSC::globalFuncIsFinite):
  3447. (JSC::globalFuncDecodeURI):
  3448. (JSC::globalFuncDecodeURIComponent):
  3449. (JSC::globalFuncEncodeURI):
  3450. (JSC::globalFuncEncodeURIComponent):
  3451. (JSC::globalFuncEscape):
  3452. (JSC::globalFuncUnescape):
  3453. (JSC::globalFuncJSCPrint):
  3454. * runtime/JSGlobalObjectFunctions.h:
  3455. * runtime/MathObject.cpp:
  3456. (JSC::mathProtoFuncAbs):
  3457. (JSC::mathProtoFuncACos):
  3458. (JSC::mathProtoFuncASin):
  3459. (JSC::mathProtoFuncATan):
  3460. (JSC::mathProtoFuncATan2):
  3461. (JSC::mathProtoFuncCeil):
  3462. (JSC::mathProtoFuncCos):
  3463. (JSC::mathProtoFuncExp):
  3464. (JSC::mathProtoFuncFloor):
  3465. (JSC::mathProtoFuncLog):
  3466. (JSC::mathProtoFuncMax):
  3467. (JSC::mathProtoFuncMin):
  3468. (JSC::mathProtoFuncPow):
  3469. (JSC::mathProtoFuncRandom):
  3470. (JSC::mathProtoFuncRound):
  3471. (JSC::mathProtoFuncSin):
  3472. (JSC::mathProtoFuncSqrt):
  3473. (JSC::mathProtoFuncTan):
  3474. * runtime/NativeErrorConstructor.cpp:
  3475. (JSC::callNativeErrorConstructor):
  3476. * runtime/NativeFunctionWrapper.h:
  3477. * runtime/NumberConstructor.cpp:
  3478. (JSC::callNumberConstructor):
  3479. * runtime/NumberPrototype.cpp:
  3480. (JSC::numberProtoFuncToString):
  3481. (JSC::numberProtoFuncToLocaleString):
  3482. (JSC::numberProtoFuncValueOf):
  3483. (JSC::numberProtoFuncToFixed):
  3484. (JSC::numberProtoFuncToExponential):
  3485. (JSC::numberProtoFuncToPrecision):
  3486. * runtime/ObjectConstructor.cpp:
  3487. (JSC::callObjectConstructor):
  3488. * runtime/ObjectPrototype.cpp:
  3489. (JSC::objectProtoFuncValueOf):
  3490. (JSC::objectProtoFuncHasOwnProperty):
  3491. (JSC::objectProtoFuncIsPrototypeOf):
  3492. (JSC::objectProtoFuncDefineGetter):
  3493. (JSC::objectProtoFuncDefineSetter):
  3494. (JSC::objectProtoFuncLookupGetter):
  3495. (JSC::objectProtoFuncLookupSetter):
  3496. (JSC::objectProtoFuncPropertyIsEnumerable):
  3497. (JSC::objectProtoFuncToLocaleString):
  3498. (JSC::objectProtoFuncToString):
  3499. * runtime/ObjectPrototype.h:
  3500. * runtime/RegExpConstructor.cpp:
  3501. (JSC::callRegExpConstructor):
  3502. * runtime/RegExpObject.cpp:
  3503. (JSC::callRegExpObject):
  3504. * runtime/RegExpPrototype.cpp:
  3505. (JSC::regExpProtoFuncTest):
  3506. (JSC::regExpProtoFuncExec):
  3507. (JSC::regExpProtoFuncCompile):
  3508. (JSC::regExpProtoFuncToString):
  3509. * runtime/StringConstructor.cpp:
  3510. (JSC::stringFromCharCode):
  3511. (JSC::callStringConstructor):
  3512. * runtime/StringPrototype.cpp:
  3513. (JSC::stringProtoFuncReplace):
  3514. (JSC::stringProtoFuncToString):
  3515. (JSC::stringProtoFuncCharAt):
  3516. (JSC::stringProtoFuncCharCodeAt):
  3517. (JSC::stringProtoFuncConcat):
  3518. (JSC::stringProtoFuncIndexOf):
  3519. (JSC::stringProtoFuncLastIndexOf):
  3520. (JSC::stringProtoFuncMatch):
  3521. (JSC::stringProtoFuncSearch):
  3522. (JSC::stringProtoFuncSlice):
  3523. (JSC::stringProtoFuncSplit):
  3524. (JSC::stringProtoFuncSubstr):
  3525. (JSC::stringProtoFuncSubstring):
  3526. (JSC::stringProtoFuncToLowerCase):
  3527. (JSC::stringProtoFuncToUpperCase):
  3528. (JSC::stringProtoFuncLocaleCompare):
  3529. (JSC::stringProtoFuncBig):
  3530. (JSC::stringProtoFuncSmall):
  3531. (JSC::stringProtoFuncBlink):
  3532. (JSC::stringProtoFuncBold):
  3533. (JSC::stringProtoFuncFixed):
  3534. (JSC::stringProtoFuncItalics):
  3535. (JSC::stringProtoFuncStrike):
  3536. (JSC::stringProtoFuncSub):
  3537. (JSC::stringProtoFuncSup):
  3538. (JSC::stringProtoFuncFontcolor):
  3539. (JSC::stringProtoFuncFontsize):
  3540. (JSC::stringProtoFuncAnchor):
  3541. (JSC::stringProtoFuncLink):
  3542. * wtf/Platform.h:
  3543. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3544. Not reviewed.
  3545. Rolled out a portion of r43352 because it broke 64bit.
  3546. * jit/JITStubs.h:
  3547. 2009-05-07 Kevin Ollivier <kevino@theolliviers.com>
  3548. Build fix for functions reaturning ThreadIdentifier.
  3549. * wtf/ThreadingNone.cpp:
  3550. (WTF::createThreadInternal):
  3551. (WTF::currentThread):
  3552. 2009-05-07 Maciej Stachowiak <mjs@apple.com>
  3553. Reviewed by John Honeycutt.
  3554. - enable optimization case im the last patch that I accidentally had disabled.
  3555. * jit/JITArithmetic.cpp:
  3556. (JSC::JIT::compileFastArithSlow_op_jnless):
  3557. 2009-05-07 Dmitry Titov <dimich@chromium.org>
  3558. Attempt to fix Win build.
  3559. * jit/JITArithmetic.cpp:
  3560. (JSC::JIT::compileFastArithSlow_op_jnless):
  3561. 2009-05-07 Dmitry Titov <dimich@chromium.org>
  3562. Reviewed by Alexey Proskuryakov and Adam Roben.
  3563. https://bugs.webkit.org/show_bug.cgi?id=25348
  3564. Change WTF::ThreadIdentifier to be an actual (but wrapped) thread id, remove ThreadMap.
  3565. * wtf/Threading.h:
  3566. (WTF::ThreadIdentifier::ThreadIdentifier):
  3567. (WTF::ThreadIdentifier::isValid):
  3568. (WTF::ThreadIdentifier::invalidate):
  3569. (WTF::ThreadIdentifier::platformId):
  3570. ThreadIdentifier is now a class, containing a PlatformThreadIdentifier and
  3571. methods that are used across the code on thread ids: construction, comparisons,
  3572. check for 'valid' state etc. '0' is used as invalid id, which happens to just work
  3573. with all platform-specific thread id implementations.
  3574. All the following files repeatedly reflect the new ThreadIdentifier for each platform.
  3575. We remove ThreadMap and threadMapMutex from all of them, remove the functions that
  3576. populated/searched/cleared the map and add platform-specific comparison operators
  3577. for ThreadIdentifier.
  3578. * wtf/gtk/ThreadingGtk.cpp:
  3579. (WTF::ThreadIdentifier::operator==):
  3580. (WTF::ThreadIdentifier::operator!=):
  3581. (WTF::initializeThreading):
  3582. (WTF::createThreadInternal):
  3583. (WTF::waitForThreadCompletion):
  3584. (WTF::currentThread):
  3585. * wtf/ThreadingNone.cpp:
  3586. (WTF::ThreadIdentifier::operator==):
  3587. (WTF::ThreadIdentifier::operator!=):
  3588. * wtf/ThreadingPthreads.cpp:
  3589. (WTF::ThreadIdentifier::operator==):
  3590. (WTF::ThreadIdentifier::operator!=):
  3591. (WTF::initializeThreading):
  3592. (WTF::createThreadInternal):
  3593. (WTF::waitForThreadCompletion):
  3594. (WTF::detachThread):
  3595. (WTF::currentThread):
  3596. * wtf/qt/ThreadingQt.cpp:
  3597. (WTF::ThreadIdentifier::operator==):
  3598. (WTF::ThreadIdentifier::operator!=):
  3599. (WTF::initializeThreading):
  3600. (WTF::createThreadInternal):
  3601. (WTF::waitForThreadCompletion):
  3602. (WTF::currentThread):
  3603. * wtf/ThreadingWin.cpp:
  3604. (WTF::ThreadIdentifier::operator==):
  3605. (WTF::ThreadIdentifier::operator!=):
  3606. (WTF::initializeThreading):
  3607. (WTF::createThreadInternal): All the platforms (except Windows) used a sequential
  3608. counter as a thread ID and mapped it into platform ID. Windows was using native thread
  3609. id and mapped it into thread handle. Since we can always obtain a thread handle
  3610. by thread id, createThread now closes the handle.
  3611. (WTF::waitForThreadCompletion): obtains another one using OpenThread(id) API. If can not obtain a handle,
  3612. it means the thread already exited.
  3613. (WTF::detachThread):
  3614. (WTF::currentThread):
  3615. (WTF::detachThreadDeprecated): old function, renamed (for Win Safari 4 beta which uses it for now).
  3616. (WTF::waitForThreadCompletionDeprecated): same.
  3617. (WTF::currentThreadDeprecated): same.
  3618. (WTF::createThreadDeprecated): same.
  3619. * bytecode/SamplingTool.h:
  3620. * bytecode/SamplingTool.cpp: Use DEFINE_STATIC_LOCAL for a static ThreadIdentifier variable, to avoid static constructor.
  3621. * JavaScriptCore.exp: export lists - updated the WTF threading functions decorated names
  3622. since they now take a different type as a parameter.
  3623. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: ditto for Windows, plus added "deprecated" functions
  3624. that take old parameter type - turns out public beta of Safari 4 uses those, so they need to be kept along for a while.
  3625. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def: ditto.
  3626. 2009-05-07 Maciej Stachowiak <mjs@apple.com>
  3627. Reviewed by Sam Weinig.
  3628. - optimize various cases of branch-fused less
  3629. 1% speedup on SunSpider overall
  3630. 13% speedup on math-cordic
  3631. * jit/JIT.cpp:
  3632. (JSC::JIT::privateCompileMainPass):
  3633. op_loop_if_less: Optimize case of constant as first operand, just as case of constant as
  3634. second operand.
  3635. op_jnless: Factored out into compileFastArith_op_jnless.
  3636. (JSC::JIT::privateCompileSlowCases):
  3637. op_jnless: Factored out into compileFastArithSlow_op_jnless.
  3638. * jit/JIT.h:
  3639. * jit/JITArithmetic.cpp:
  3640. (JSC::JIT::compileFastArith_op_jnless): Factored out from main compile loop.
  3641. - Generate inline code for comparison of constant immediate int as first operand to another
  3642. immediate int, as for loop_if_less
  3643. (JSC::JIT::compileFastArithSlow_op_jnless):
  3644. - Generate inline code for comparing two floating point numbers.
  3645. - Generate code for both cases of comparing a floating point number to a constant immediate
  3646. int.
  3647. * bytecode/CodeBlock.cpp:
  3648. (JSC::CodeBlock::dump): Fix dumping of op_jnless (tangentially related bugfix).
  3649. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3650. Reviewed by Sam Weinig.
  3651. Added the return address of a stub function to the JITStackFrame abstraction.
  3652. * jit/JIT.cpp:
  3653. * jit/JIT.h:
  3654. * jit/JITStubs.cpp:
  3655. (JSC::):
  3656. (JSC::StackHack::StackHack):
  3657. (JSC::StackHack::~StackHack):
  3658. (JSC::returnToThrowTrampoline):
  3659. (JSC::JITStubs::cti_op_convert_this):
  3660. (JSC::JITStubs::cti_op_end):
  3661. (JSC::JITStubs::cti_op_add):
  3662. (JSC::JITStubs::cti_op_pre_inc):
  3663. (JSC::JITStubs::cti_timeout_check):
  3664. (JSC::JITStubs::cti_register_file_check):
  3665. (JSC::JITStubs::cti_op_loop_if_less):
  3666. (JSC::JITStubs::cti_op_loop_if_lesseq):
  3667. (JSC::JITStubs::cti_op_new_object):
  3668. (JSC::JITStubs::cti_op_put_by_id_generic):
  3669. (JSC::JITStubs::cti_op_get_by_id_generic):
  3670. (JSC::JITStubs::cti_op_put_by_id):
  3671. (JSC::JITStubs::cti_op_put_by_id_second):
  3672. (JSC::JITStubs::cti_op_put_by_id_fail):
  3673. (JSC::JITStubs::cti_op_get_by_id):
  3674. (JSC::JITStubs::cti_op_get_by_id_second):
  3675. (JSC::JITStubs::cti_op_get_by_id_self_fail):
  3676. (JSC::JITStubs::cti_op_get_by_id_proto_list):
  3677. (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
  3678. (JSC::JITStubs::cti_op_get_by_id_proto_fail):
  3679. (JSC::JITStubs::cti_op_get_by_id_array_fail):
  3680. (JSC::JITStubs::cti_op_get_by_id_string_fail):
  3681. (JSC::JITStubs::cti_op_instanceof):
  3682. (JSC::JITStubs::cti_op_del_by_id):
  3683. (JSC::JITStubs::cti_op_mul):
  3684. (JSC::JITStubs::cti_op_new_func):
  3685. (JSC::JITStubs::cti_op_call_JSFunction):
  3686. (JSC::JITStubs::cti_op_call_arityCheck):
  3687. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  3688. (JSC::JITStubs::cti_vm_lazyLinkCall):
  3689. (JSC::JITStubs::cti_op_push_activation):
  3690. (JSC::JITStubs::cti_op_call_NotJSFunction):
  3691. (JSC::JITStubs::cti_op_create_arguments):
  3692. (JSC::JITStubs::cti_op_create_arguments_no_params):
  3693. (JSC::JITStubs::cti_op_tear_off_activation):
  3694. (JSC::JITStubs::cti_op_tear_off_arguments):
  3695. (JSC::JITStubs::cti_op_profile_will_call):
  3696. (JSC::JITStubs::cti_op_profile_did_call):
  3697. (JSC::JITStubs::cti_op_ret_scopeChain):
  3698. (JSC::JITStubs::cti_op_new_array):
  3699. (JSC::JITStubs::cti_op_resolve):
  3700. (JSC::JITStubs::cti_op_construct_JSConstruct):
  3701. (JSC::JITStubs::cti_op_construct_NotJSConstruct):
  3702. (JSC::JITStubs::cti_op_get_by_val):
  3703. (JSC::JITStubs::cti_op_get_by_val_string):
  3704. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  3705. (JSC::JITStubs::cti_op_resolve_func):
  3706. (JSC::JITStubs::cti_op_sub):
  3707. (JSC::JITStubs::cti_op_put_by_val):
  3708. (JSC::JITStubs::cti_op_put_by_val_array):
  3709. (JSC::JITStubs::cti_op_put_by_val_byte_array):
  3710. (JSC::JITStubs::cti_op_lesseq):
  3711. (JSC::JITStubs::cti_op_loop_if_true):
  3712. (JSC::JITStubs::cti_op_load_varargs):
  3713. (JSC::JITStubs::cti_op_negate):
  3714. (JSC::JITStubs::cti_op_resolve_base):
  3715. (JSC::JITStubs::cti_op_resolve_skip):
  3716. (JSC::JITStubs::cti_op_resolve_global):
  3717. (JSC::JITStubs::cti_op_div):
  3718. (JSC::JITStubs::cti_op_pre_dec):
  3719. (JSC::JITStubs::cti_op_jless):
  3720. (JSC::JITStubs::cti_op_not):
  3721. (JSC::JITStubs::cti_op_jtrue):
  3722. (JSC::JITStubs::cti_op_post_inc):
  3723. (JSC::JITStubs::cti_op_eq):
  3724. (JSC::JITStubs::cti_op_lshift):
  3725. (JSC::JITStubs::cti_op_bitand):
  3726. (JSC::JITStubs::cti_op_rshift):
  3727. (JSC::JITStubs::cti_op_bitnot):
  3728. (JSC::JITStubs::cti_op_resolve_with_base):
  3729. (JSC::JITStubs::cti_op_new_func_exp):
  3730. (JSC::JITStubs::cti_op_mod):
  3731. (JSC::JITStubs::cti_op_less):
  3732. (JSC::JITStubs::cti_op_neq):
  3733. (JSC::JITStubs::cti_op_post_dec):
  3734. (JSC::JITStubs::cti_op_urshift):
  3735. (JSC::JITStubs::cti_op_bitxor):
  3736. (JSC::JITStubs::cti_op_new_regexp):
  3737. (JSC::JITStubs::cti_op_bitor):
  3738. (JSC::JITStubs::cti_op_call_eval):
  3739. (JSC::JITStubs::cti_op_throw):
  3740. (JSC::JITStubs::cti_op_get_pnames):
  3741. (JSC::JITStubs::cti_op_next_pname):
  3742. (JSC::JITStubs::cti_op_push_scope):
  3743. (JSC::JITStubs::cti_op_pop_scope):
  3744. (JSC::JITStubs::cti_op_typeof):
  3745. (JSC::JITStubs::cti_op_is_undefined):
  3746. (JSC::JITStubs::cti_op_is_boolean):
  3747. (JSC::JITStubs::cti_op_is_number):
  3748. (JSC::JITStubs::cti_op_is_string):
  3749. (JSC::JITStubs::cti_op_is_object):
  3750. (JSC::JITStubs::cti_op_is_function):
  3751. (JSC::JITStubs::cti_op_stricteq):
  3752. (JSC::JITStubs::cti_op_to_primitive):
  3753. (JSC::JITStubs::cti_op_strcat):
  3754. (JSC::JITStubs::cti_op_nstricteq):
  3755. (JSC::JITStubs::cti_op_to_jsnumber):
  3756. (JSC::JITStubs::cti_op_in):
  3757. (JSC::JITStubs::cti_op_push_new_scope):
  3758. (JSC::JITStubs::cti_op_jmp_scopes):
  3759. (JSC::JITStubs::cti_op_put_by_index):
  3760. (JSC::JITStubs::cti_op_switch_imm):
  3761. (JSC::JITStubs::cti_op_switch_char):
  3762. (JSC::JITStubs::cti_op_switch_string):
  3763. (JSC::JITStubs::cti_op_del_by_val):
  3764. (JSC::JITStubs::cti_op_put_getter):
  3765. (JSC::JITStubs::cti_op_put_setter):
  3766. (JSC::JITStubs::cti_op_new_error):
  3767. (JSC::JITStubs::cti_op_debug):
  3768. (JSC::JITStubs::cti_vm_throw):
  3769. * jit/JITStubs.h:
  3770. (JSC::JITStackFrame::returnAddressSlot):
  3771. 2009-05-07 Darin Adler <darin@apple.com>
  3772. Reviewed by Geoff Garen.
  3773. * parser/Lexer.cpp:
  3774. (JSC::Lexer::lex): Fix missing braces. This would make us always
  3775. take the slower case for string parsing and Visual Studio correctly
  3776. noticed unreachable code.
  3777. 2009-05-07 Darin Adler <darin@apple.com>
  3778. Reviewed by Sam Weinig.
  3779. Bug 25589: goto instead of state machine in lexer
  3780. https://bugs.webkit.org/show_bug.cgi?id=25589
  3781. SunSpider is 0.8% faster.
  3782. * parser/Lexer.cpp:
  3783. (JSC::Lexer::currentCharacter): Added.
  3784. (JSC::Lexer::currentOffset): Changed to call currentCharacter for clarity.
  3785. (JSC::Lexer::setCode): Removed code to set now-obsolete m_skipLineEnd.
  3786. (JSC::Lexer::shiftLineTerminator): Added. Handles line numbers and the
  3787. two-character line terminators.
  3788. (JSC::Lexer::makeIdentifier): Changed to take characters and length rather
  3789. than a vector, since we now make these directly out of the source buffer
  3790. when possible.
  3791. (JSC::Lexer::lastTokenWasRestrKeyword): Added.
  3792. (JSC::isNonASCIIIdentStart): Broke out the non-inline part.
  3793. (JSC::isIdentStart): Moved here.
  3794. (JSC::isNonASCIIIdentPart): Broke out the non-inline part.
  3795. (JSC::isIdentPart): Moved here.
  3796. (JSC::singleEscape): Moved here, and removed some unneeded cases.
  3797. (JSC::Lexer::record8): Moved here.
  3798. (JSC::Lexer::record16): Moved here.
  3799. (JSC::Lexer::lex): Rewrote this whole function to use goto and not use
  3800. a state machine. Got rid of most of the local variables. Also rolled the
  3801. matchPunctuator function in here.
  3802. (JSC::Lexer::scanRegExp): Changed to use the new version of isLineTerminator.
  3803. Clear m_buffer16 after using it instead of before.
  3804. * parser/Lexer.h: Removed State enum, setDone function, nextLine function,
  3805. lookupKeywordFunction, one of the isLineTerminator functions, m_done data member,
  3806. m_skipLineEnd data member, and m_state data member. Added shiftLineTerminator
  3807. function, currentCharacter function, and changed the arguments to the makeIdentifier
  3808. function. Removed one branch from the isLineTerminator function.
  3809. * runtime/StringPrototype.cpp:
  3810. (JSC::stringProtoFuncReplace): Streamlined the case where we don't replace anything.
  3811. 2009-05-07 Geoffrey Garen <ggaren@apple.com>
  3812. Reviewed by Gavin Barraclough.
  3813. Removed a few more special constants, and replaced them with uses of
  3814. the JITStackFrame struct.
  3815. Removed one of the two possible definitions of VoidPtrPair. The Mac
  3816. definition was more elegant, but SunSpider doesn't think it's any
  3817. faster, and it's net less elegant to have two ways of doing things.
  3818. * jit/JIT.cpp:
  3819. (JSC::JIT::privateCompileMainPass):
  3820. (JSC::JIT::privateCompile):
  3821. * jit/JITStubs.h:
  3822. (JSC::):
  3823. 2009-05-07 Darin Adler <darin@apple.com>
  3824. * runtime/ScopeChain.h:
  3825. (JSC::ScopeChainNode::~ScopeChainNode): Tweak formatting.
  3826. 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
  3827. Reviewed by Tor Arne Vestbø.
  3828. Fix the build thread stack base determination build on Symbian,
  3829. by moving the code block before PLATFORM(UNIX), which is also
  3830. enabled on Symbian builds.
  3831. * runtime/Collector.cpp:
  3832. (JSC::currentThreadStackBase):
  3833. 2009-05-07 Oliver Hunt <oliver@apple.com>
  3834. Reviewed by Gavin Barraclough.
  3835. Fix crash due to incorrectly using an invalid scopechain
  3836. stringProtoFuncReplace was checking for an exception on a CachedCall
  3837. by asking for the cached callframes exception. Unfortunately this
  3838. could crash in certain circumstances as CachedCall does not guarantee
  3839. a valid callframe following a call. Even more unfortunately the check
  3840. was entirely unnecessary as there is only a single exception slot per
  3841. global data, so it was already checked via the initial exec->hadException()
  3842. check.
  3843. To make bugs like this more obvious, i've added a debug only destructor
  3844. to ScopeChainNode that 0's all of its fields. This exposed a crash in
  3845. the standard javascriptcore tests.
  3846. * runtime/ScopeChain.h:
  3847. (JSC::ScopeChainNode::~ScopeChainNode):
  3848. (JSC::ScopeChain::~ScopeChain):
  3849. * runtime/StringPrototype.cpp:
  3850. (JSC::stringProtoFuncReplace):
  3851. 2009-05-07 Gavin Barraclough <barraclough@apple.com>
  3852. Reviewed by Geoff Garen.
  3853. Enable op_strcat across += assignments. This patch allows the lhs of a read/modify node
  3854. to be included within the concatenation operation, and also modifies the implementation
  3855. of the concatenation to attempt to reuse and cat onto the leftmost string, rather than
  3856. always allocating a new empty output string to copy into (as was previously the behaviour).
  3857. ~0.5% progression, due to a 3%-3.5% progression on the string tests (particularly validate).
  3858. * parser/Nodes.cpp:
  3859. (JSC::BinaryOpNode::emitStrcat):
  3860. (JSC::emitReadModifyAssignment):
  3861. (JSC::ReadModifyResolveNode::emitBytecode):
  3862. (JSC::ReadModifyDotNode::emitBytecode):
  3863. (JSC::ReadModifyBracketNode::emitBytecode):
  3864. * parser/Nodes.h:
  3865. * runtime/Operations.h:
  3866. (JSC::concatenateStrings):
  3867. * runtime/UString.cpp:
  3868. (JSC::UString::reserveCapacity):
  3869. * runtime/UString.h:
  3870. 2009-05-07 Simon Hausmann <simon.hausmann@nokia.com>
  3871. Reviewed by Oliver Hunt.
  3872. Fix the build on Windows without JIT: interpreter/RegisterFile.h needs
  3873. roundUpAllocationSize, which is protected by #if ENABLED(ASSEMBLER).
  3874. Moved the #ifdef down and always offer the function.
  3875. * jit/ExecutableAllocator.h:
  3876. 2009-05-06 Geoffrey Garen <ggaren@apple.com>
  3877. Reviewed by Gavin "++" Barraclough.
  3878. Added some abstraction around the JIT stub calling convention by creating
  3879. a struct to represent the persistent stack frame JIT code shares with
  3880. JIT stubs.
  3881. SunSpider reports no change.
  3882. * jit/JIT.h:
  3883. * jit/JITStubs.cpp:
  3884. (JSC::JITStubs::cti_op_convert_this):
  3885. (JSC::JITStubs::cti_op_end):
  3886. (JSC::JITStubs::cti_op_add):
  3887. (JSC::JITStubs::cti_op_pre_inc):
  3888. (JSC::JITStubs::cti_timeout_check):
  3889. (JSC::JITStubs::cti_register_file_check):
  3890. (JSC::JITStubs::cti_op_loop_if_less):
  3891. (JSC::JITStubs::cti_op_loop_if_lesseq):
  3892. (JSC::JITStubs::cti_op_new_object):
  3893. (JSC::JITStubs::cti_op_put_by_id_generic):
  3894. (JSC::JITStubs::cti_op_get_by_id_generic):
  3895. (JSC::JITStubs::cti_op_put_by_id):
  3896. (JSC::JITStubs::cti_op_put_by_id_second):
  3897. (JSC::JITStubs::cti_op_put_by_id_fail):
  3898. (JSC::JITStubs::cti_op_get_by_id):
  3899. (JSC::JITStubs::cti_op_get_by_id_second):
  3900. (JSC::JITStubs::cti_op_get_by_id_self_fail):
  3901. (JSC::JITStubs::cti_op_get_by_id_proto_list):
  3902. (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
  3903. (JSC::JITStubs::cti_op_get_by_id_proto_fail):
  3904. (JSC::JITStubs::cti_op_get_by_id_array_fail):
  3905. (JSC::JITStubs::cti_op_get_by_id_string_fail):
  3906. (JSC::JITStubs::cti_op_instanceof):
  3907. (JSC::JITStubs::cti_op_del_by_id):
  3908. (JSC::JITStubs::cti_op_mul):
  3909. (JSC::JITStubs::cti_op_new_func):
  3910. (JSC::JITStubs::cti_op_call_JSFunction):
  3911. (JSC::JITStubs::cti_op_call_arityCheck):
  3912. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  3913. (JSC::JITStubs::cti_vm_lazyLinkCall):
  3914. (JSC::JITStubs::cti_op_push_activation):
  3915. (JSC::JITStubs::cti_op_call_NotJSFunction):
  3916. (JSC::JITStubs::cti_op_create_arguments):
  3917. (JSC::JITStubs::cti_op_create_arguments_no_params):
  3918. (JSC::JITStubs::cti_op_tear_off_activation):
  3919. (JSC::JITStubs::cti_op_tear_off_arguments):
  3920. (JSC::JITStubs::cti_op_profile_will_call):
  3921. (JSC::JITStubs::cti_op_profile_did_call):
  3922. (JSC::JITStubs::cti_op_ret_scopeChain):
  3923. (JSC::JITStubs::cti_op_new_array):
  3924. (JSC::JITStubs::cti_op_resolve):
  3925. (JSC::JITStubs::cti_op_construct_JSConstruct):
  3926. (JSC::JITStubs::cti_op_construct_NotJSConstruct):
  3927. (JSC::JITStubs::cti_op_get_by_val):
  3928. (JSC::JITStubs::cti_op_get_by_val_string):
  3929. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  3930. (JSC::JITStubs::cti_op_resolve_func):
  3931. (JSC::JITStubs::cti_op_sub):
  3932. (JSC::JITStubs::cti_op_put_by_val):
  3933. (JSC::JITStubs::cti_op_put_by_val_array):
  3934. (JSC::JITStubs::cti_op_put_by_val_byte_array):
  3935. (JSC::JITStubs::cti_op_lesseq):
  3936. (JSC::JITStubs::cti_op_loop_if_true):
  3937. (JSC::JITStubs::cti_op_load_varargs):
  3938. (JSC::JITStubs::cti_op_negate):
  3939. (JSC::JITStubs::cti_op_resolve_base):
  3940. (JSC::JITStubs::cti_op_resolve_skip):
  3941. (JSC::JITStubs::cti_op_resolve_global):
  3942. (JSC::JITStubs::cti_op_div):
  3943. (JSC::JITStubs::cti_op_pre_dec):
  3944. (JSC::JITStubs::cti_op_jless):
  3945. (JSC::JITStubs::cti_op_not):
  3946. (JSC::JITStubs::cti_op_jtrue):
  3947. (JSC::JITStubs::cti_op_post_inc):
  3948. (JSC::JITStubs::cti_op_eq):
  3949. (JSC::JITStubs::cti_op_lshift):
  3950. (JSC::JITStubs::cti_op_bitand):
  3951. (JSC::JITStubs::cti_op_rshift):
  3952. (JSC::JITStubs::cti_op_bitnot):
  3953. (JSC::JITStubs::cti_op_resolve_with_base):
  3954. (JSC::JITStubs::cti_op_new_func_exp):
  3955. (JSC::JITStubs::cti_op_mod):
  3956. (JSC::JITStubs::cti_op_less):
  3957. (JSC::JITStubs::cti_op_neq):
  3958. (JSC::JITStubs::cti_op_post_dec):
  3959. (JSC::JITStubs::cti_op_urshift):
  3960. (JSC::JITStubs::cti_op_bitxor):
  3961. (JSC::JITStubs::cti_op_new_regexp):
  3962. (JSC::JITStubs::cti_op_bitor):
  3963. (JSC::JITStubs::cti_op_call_eval):
  3964. (JSC::JITStubs::cti_op_throw):
  3965. (JSC::JITStubs::cti_op_get_pnames):
  3966. (JSC::JITStubs::cti_op_next_pname):
  3967. (JSC::JITStubs::cti_op_push_scope):
  3968. (JSC::JITStubs::cti_op_pop_scope):
  3969. (JSC::JITStubs::cti_op_typeof):
  3970. (JSC::JITStubs::cti_op_is_undefined):
  3971. (JSC::JITStubs::cti_op_is_boolean):
  3972. (JSC::JITStubs::cti_op_is_number):
  3973. (JSC::JITStubs::cti_op_is_string):
  3974. (JSC::JITStubs::cti_op_is_object):
  3975. (JSC::JITStubs::cti_op_is_function):
  3976. (JSC::JITStubs::cti_op_stricteq):
  3977. (JSC::JITStubs::cti_op_to_primitive):
  3978. (JSC::JITStubs::cti_op_strcat):
  3979. (JSC::JITStubs::cti_op_nstricteq):
  3980. (JSC::JITStubs::cti_op_to_jsnumber):
  3981. (JSC::JITStubs::cti_op_in):
  3982. (JSC::JITStubs::cti_op_push_new_scope):
  3983. (JSC::JITStubs::cti_op_jmp_scopes):
  3984. (JSC::JITStubs::cti_op_put_by_index):
  3985. (JSC::JITStubs::cti_op_switch_imm):
  3986. (JSC::JITStubs::cti_op_switch_char):
  3987. (JSC::JITStubs::cti_op_switch_string):
  3988. (JSC::JITStubs::cti_op_del_by_val):
  3989. (JSC::JITStubs::cti_op_put_getter):
  3990. (JSC::JITStubs::cti_op_put_setter):
  3991. (JSC::JITStubs::cti_op_new_error):
  3992. (JSC::JITStubs::cti_op_debug):
  3993. (JSC::JITStubs::cti_vm_throw):
  3994. * jit/JITStubs.h:
  3995. (JSC::):
  3996. 2009-05-06 Gavin Barraclough <barraclough@apple.com>
  3997. Reviewed by Maciej Stachowiak & Darin Adler.
  3998. Improve string concatenation (as coded in JS as a sequence of adds).
  3999. Detect patterns corresponding to string concatenation, and change the bytecode
  4000. generation to emit a new op_strcat instruction. By handling the full set of
  4001. additions within a single function we do not need allocate JSString wrappers
  4002. for intermediate results, and we can calculate the size of the output string
  4003. prior to allocating storage, in order to prevent reallocation of the buffer.
  4004. 1.5%-2% progression on Sunspider, largely due to a 30% progression on date-format-xparb.
  4005. * bytecode/CodeBlock.cpp:
  4006. (JSC::CodeBlock::dump):
  4007. Add new opcodes.
  4008. * bytecode/Opcode.h:
  4009. Add new opcodes.
  4010. * bytecompiler/BytecodeGenerator.cpp:
  4011. (JSC::BytecodeGenerator::emitStrcat):
  4012. (JSC::BytecodeGenerator::emitToPrimitive):
  4013. Add generation of new opcodes.
  4014. * bytecompiler/BytecodeGenerator.h:
  4015. Add generation of new opcodes.
  4016. * interpreter/Interpreter.cpp:
  4017. (JSC::Interpreter::privateExecute):
  4018. Add implmentation of new opcodes.
  4019. * jit/JIT.cpp:
  4020. (JSC::JIT::privateCompileMainPass):
  4021. (JSC::JIT::privateCompileSlowCases):
  4022. Add implmentation of new opcodes.
  4023. * jit/JITStubs.cpp:
  4024. (JSC::JITStubs::cti_op_to_primitive):
  4025. (JSC::JITStubs::cti_op_strcat):
  4026. Add implmentation of new opcodes.
  4027. * jit/JITStubs.h:
  4028. Add implmentation of new opcodes.
  4029. * parser/Nodes.cpp:
  4030. (JSC::BinaryOpNode::emitStrcat):
  4031. (JSC::BinaryOpNode::emitBytecode):
  4032. (JSC::ReadModifyResolveNode::emitBytecode):
  4033. Add generation of new opcodes.
  4034. * parser/Nodes.h:
  4035. (JSC::ExpressionNode::):
  4036. (JSC::AddNode::):
  4037. Add methods to allow identification of add nodes.
  4038. * parser/ResultType.h:
  4039. (JSC::ResultType::definitelyIsString):
  4040. (JSC::ResultType::forAdd):
  4041. Fix error in detection of adds that will produce string results.
  4042. * runtime/Operations.h:
  4043. (JSC::concatenateStrings):
  4044. Add implmentation of new opcodes.
  4045. * runtime/UString.cpp:
  4046. (JSC::UString::appendNumeric):
  4047. Add methods to append numbers to an existing string.
  4048. * runtime/UString.h:
  4049. (JSC::UString::Rep::createEmptyBuffer):
  4050. (JSC::UString::BaseString::BaseString):
  4051. Add support for creating an empty string with a non-zero capacity available in the BaseString.
  4052. 2009-05-06 Darin Adler <darin@apple.com>
  4053. Reviewed by Sam Weinig.
  4054. Made RefCounted::m_refCount private.
  4055. * runtime/Structure.h: Removed addressOfCount.
  4056. * wtf/RefCounted.h: Made m_refCount private.
  4057. Added addressOfCount.
  4058. 2009-05-06 Darin Adler <darin@apple.com>
  4059. Fixed assertion seen a lot!
  4060. * parser/Nodes.cpp:
  4061. (JSC::FunctionBodyNode::~FunctionBodyNode): Removed now-bogus assertion.
  4062. 2009-05-06 Darin Adler <darin@apple.com>
  4063. Working with Sam Weinig.
  4064. Redo parse tree constructor optimization without breaking the Windows
  4065. build the way I did yesterday. The previous try broke the build by adding
  4066. an include of Lexer.h and all its dependencies that had to work outside
  4067. the JavaScriptCore project.
  4068. * GNUmakefile.am: Added NodeConstructors.h.
  4069. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
  4070. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
  4071. Removed byteocde directory -- we no longer are trying to include Lexer.h
  4072. outside JavaScriptCore.
  4073. * JavaScriptCore.xcodeproj/project.pbxproj: Change SegmentedVector.h
  4074. and Lexer.h back to internal files. Added NodeConstructors.h.
  4075. * parser/Grammar.y: Added include of NodeConstructors.h.
  4076. Changed use of ConstDeclNode to use public functions.
  4077. * parser/NodeConstructors.h: Copied from parser/Nodes.h.
  4078. Just contains the inlined constructors now.
  4079. * parser/Nodes.cpp: Added include of NodeConstructors.h.
  4080. Moved node constructors into the header.
  4081. (JSC::FunctionBodyNode::FunctionBodyNode): Removed m_refCount
  4082. initialization.
  4083. * parser/Nodes.h: Removed all the constructor definitions, and also
  4084. removed the JSC_FAST_CALL from them since these are all inlined, so the
  4085. calling convention is irrelevant. Made more things private. Used a data
  4086. member for operator opcodes instead of a virtual function. Removed the
  4087. special FunctionBodyNode::ref/deref functions since the default functions
  4088. are now just as fast.
  4089. * runtime/FunctionConstructor.cpp:
  4090. (JSC::extractFunctionBody): Fixed types here so we don't typecast until
  4091. after we do type checking.
  4092. 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
  4093. Reviewed by Ariya Hidayat.
  4094. Fix the Qt build on Windows.
  4095. * JavaScriptCore.pri: Define BUILDING_JavaScriptCore/WTF to get the meaning
  4096. of the JS_EXPORTDATA macros correct
  4097. 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
  4098. Reviewed by Ariya Hidayat.
  4099. Enable the JIT for the Qt build on Windows.
  4100. * JavaScriptCore.pri:
  4101. 2009-05-06 Simon Hausmann <simon.hausmann@nokia.com>
  4102. Reviewed by Tor Arne Vestbø.
  4103. Tweak JavaScriptCore.pri for being able to override the generated sources dir for the
  4104. generated_files target.
  4105. * JavaScriptCore.pri:
  4106. 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  4107. Reviewed by Simon Hausmann.
  4108. Build QtWebKit as a framework on Mac
  4109. This implies both debug and release build by default, unless
  4110. one of the --debug or --release config options are passed to
  4111. the build-webkit script.
  4112. Frameworks can be disabled by passing CONFIG+=webkit_no_framework
  4113. to the build-webkit script.
  4114. To be able to build both debug and release targets in parallel
  4115. we have to use separate output directories for the generated
  4116. sources, which is not optimal, but required to avoid race conditions.
  4117. An optimization would be to only require this spit-up on Mac.
  4118. * JavaScriptCore.pri:
  4119. * JavaScriptCore.pro:
  4120. * jsc.pro:
  4121. 2009-05-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  4122. Reviewed by Simon Hausmann.
  4123. [Qt] Use $$GENERATED_SOURCES_DIR as output when running bison
  4124. A couple of the generators left the bison output file in the source
  4125. tree, and then moved it into $$GENERATED_SOURCES_DIR, which did not
  4126. work well when building release and debug configurations in parallel.
  4127. * JavaScriptCore.pri:
  4128. 2009-05-05 Geoffrey Garen <ggaren@apple.com>
  4129. Reviewed by Maciej Stachowiak.
  4130. Simplified a bit of codegen.
  4131. * jit/JIT.cpp:
  4132. (JSC::JIT::privateCompileMainPass):
  4133. 2009-05-05 Geoffrey Garen <ggaren@apple.com>
  4134. Reviewed by Cameron Zwarich.
  4135. Moved all the JIT stub related code into one place.
  4136. * jit/JIT.cpp:
  4137. * jit/JIT.h:
  4138. * jit/JITCode.h:
  4139. * jit/JITStubs.cpp:
  4140. (JSC::):
  4141. * jit/JITStubs.h:
  4142. 2009-05-05 Sam Weinig <sam@webkit.org>
  4143. Try to fix Windows build.
  4144. Move Node constructor to the .cpp file.
  4145. * parser/Nodes.cpp:
  4146. * parser/Nodes.h:
  4147. 2009-05-05 Darin Adler <darin@apple.com>
  4148. Try to fix Windows build.
  4149. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4150. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4151. Try to fix Mac build.
  4152. * JavaScriptCore.xcodeproj/project.pbxproj: Made SegmentedVector.h private.
  4153. 2009-05-05 Darin Adler <darin@apple.com>
  4154. Try to fix Mac build.
  4155. * JavaScriptCore.xcodeproj/project.pbxproj: Made Lexer.h private.
  4156. 2009-05-05 Darin Adler <darin@apple.com>
  4157. Reviewed by Sam Weinig.
  4158. Bug 25569: make ParserRefCounted use conventional reference counting
  4159. https://bugs.webkit.org/show_bug.cgi?id=25569
  4160. SunSpider speedup of about 1.6%.
  4161. * JavaScriptCore.exp: Updated.
  4162. * parser/Nodes.cpp:
  4163. (JSC::NodeReleaser::releaseAllNodes): ALWAYS_INLINE.
  4164. (JSC::NodeReleaser::adopt): Ditto.
  4165. (JSC::ParserRefCounted::ParserRefCounted): Removed most of the code.
  4166. Add the object to a Vector<RefPtr> that gets cleared after parsing.
  4167. (JSC::ParserRefCounted::~ParserRefCounted): Removed most of the code.
  4168. * parser/Nodes.h: Made ParserRefCounted inherit from RefCounted and
  4169. made inline versions of the constructor and destructor. Made the
  4170. Node constructor inline.
  4171. * parser/Parser.cpp:
  4172. (JSC::Parser::parse): Call globalData->parserObjects.shrink(0) after
  4173. parsing, where it used to call ParserRefCounted::deleteNewObjects.
  4174. * runtime/JSGlobalData.cpp:
  4175. (JSC::JSGlobalData::JSGlobalData): Eliminated code to manage the
  4176. newParserObjects and parserObjectExtraRefCounts.
  4177. (JSC::JSGlobalData::~JSGlobalData): Ditto.
  4178. * runtime/JSGlobalData.h: Replaced the HashSet and HashCountedSet
  4179. with a Vector.
  4180. * wtf/PassRefPtr.h:
  4181. (WTF::PassRefPtr::~PassRefPtr): The most common thing to do with a
  4182. PassRefPtr in hot code is to pass it and then destroy it once it's
  4183. set to zero. Help the optimizer by telling it that's true.
  4184. 2009-05-05 Xan Lopez <xlopez@igalia.com> and Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
  4185. Reviewed by Oliver Hunt.
  4186. Disable the NativeFunctionWrapper for all non-Mac ports for now,
  4187. as it is also crashing on Linux/x86.
  4188. * runtime/NativeFunctionWrapper.h:
  4189. 2009-05-05 Steve Falkenburg <sfalken@apple.com>
  4190. Fix build.
  4191. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4192. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4193. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4194. Reviewed by Maciej Stachowiak.
  4195. Expose toThisObject for the DOM Window
  4196. * JavaScriptCore.exp:
  4197. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4198. Reviewed by NOBODY (Make windows go again until i work out the
  4199. accursed calling convention).
  4200. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4201. * jit/JIT.cpp:
  4202. * runtime/NativeFunctionWrapper.h:
  4203. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4204. Reviewed by NOBODY (Fix windows debug builds).
  4205. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4206. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4207. Reviewed by NOBODY (Hopefully the last fix).
  4208. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4209. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4210. Reviewed by NOBODY (Fix the build fix caused by a different build fix).
  4211. * parser/Nodes.cpp:
  4212. * parser/Nodes.h:
  4213. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4214. Reviewed by NOBODY (No idea how my changes could have broken these).
  4215. * runtime/DatePrototype.cpp:
  4216. * runtime/RegExpObject.cpp:
  4217. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4218. Reviewed by NOBODY (Why should i expect msvc to list all the errors in a file?).
  4219. * parser/Nodes.cpp:
  4220. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4221. Reviewed by NOBODY (Fix warning, and another missing include).
  4222. * jit/JIT.cpp:
  4223. * parser/Nodes.h:
  4224. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4225. Reviewed by NOBODY (More build fixes).
  4226. * runtime/ErrorPrototype.cpp:
  4227. * runtime/JSGlobalObject.cpp:
  4228. * runtime/NumberPrototype.cpp:
  4229. * runtime/ObjectPrototype.cpp:
  4230. * runtime/StringConstructor.cpp:
  4231. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4232. Reviewed by NOBODY (Will the fixes never end?).
  4233. * runtime/FunctionPrototype.h:
  4234. * runtime/Lookup.cpp:
  4235. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4236. Reviewed by NOBODY (More build fixes).
  4237. * jit/JIT.cpp:
  4238. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4239. Reviewed by NOBODY (More build fixing).
  4240. * runtime/CallData.h:
  4241. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4242. Reviewed by NOBODY (Build fix).
  4243. * runtime/ArrayConstructor.cpp:
  4244. * runtime/BooleanPrototype.cpp:
  4245. * runtime/DateConstructor.cpp:
  4246. * runtime/Error.cpp:
  4247. * runtime/ObjectConstructor.cpp:
  4248. * runtime/RegExpPrototype.cpp:
  4249. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4250. Reviewed by NOBODY (Buildfix).
  4251. Add missing file
  4252. * runtime/NativeFunctionWrapper.h: Copied from JavaScriptCore/jit/ExecutableAllocator.cpp.
  4253. 2009-05-05 Oliver Hunt <oliver@apple.com>
  4254. Reviewed by Gavin Barraclough.
  4255. Bug 25559: Improve native function call performance
  4256. <https://bugs.webkit.org/show_bug.cgi?id=25559>
  4257. In order to cache calls to native functions we now make the standard
  4258. prototype functions use a small assembly thunk that converts the JS
  4259. calling convention into the native calling convention. As this is
  4260. only beneficial in the JIT we use the NativeFunctionWrapper typedef
  4261. to alternate between PrototypeFunction and JSFunction to keep the
  4262. code sane. This change from PrototypeFunction to NativeFunctionWrapper
  4263. is the bulk of this patch.
  4264. * JavaScriptCore.exp:
  4265. * JavaScriptCore.xcodeproj/project.pbxproj:
  4266. * assembler/MacroAssemblerX86Common.h:
  4267. (JSC::MacroAssemblerX86Common::call):
  4268. * assembler/MacroAssemblerX86_64.h:
  4269. (JSC::MacroAssemblerX86_64::addPtr):
  4270. * assembler/X86Assembler.h:
  4271. (JSC::X86Assembler::leaq_mr):
  4272. (JSC::X86Assembler::call_m):
  4273. * interpreter/Interpreter.cpp:
  4274. (JSC::Interpreter::execute):
  4275. (JSC::Interpreter::prepareForRepeatCall):
  4276. * jit/JIT.cpp:
  4277. (JSC::JIT::privateCompileCTIMachineTrampolines):
  4278. * jit/JIT.h:
  4279. (JSC::JIT::compileCTIMachineTrampolines):
  4280. * jit/JITCall.cpp:
  4281. (JSC::JIT::linkCall):
  4282. (JSC::JIT::compileOpCallInitializeCallFrame):
  4283. (JSC::JIT::compileOpCall):
  4284. * jit/JITCode.h:
  4285. (JSC::JITCode::operator bool):
  4286. * jit/JITInlineMethods.h:
  4287. (JSC::JIT::emitGetFromCallFrameHeader):
  4288. (JSC::JIT::emitGetFromCallFrameHeader32):
  4289. * jit/JITStubs.cpp:
  4290. (JSC::JITStubs::JITStubs):
  4291. (JSC::JITStubs::cti_op_call_JSFunction):
  4292. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  4293. (JSC::JITStubs::cti_vm_lazyLinkCall):
  4294. (JSC::JITStubs::cti_op_construct_JSConstruct):
  4295. * jit/JITStubs.h:
  4296. (JSC::JITStubs::ctiNativeCallThunk):
  4297. * jsc.cpp:
  4298. (GlobalObject::GlobalObject):
  4299. * parser/Nodes.cpp:
  4300. (JSC::FunctionBodyNode::FunctionBodyNode):
  4301. (JSC::FunctionBodyNode::createNativeThunk):
  4302. (JSC::FunctionBodyNode::generateJITCode):
  4303. * parser/Nodes.h:
  4304. (JSC::FunctionBodyNode::):
  4305. (JSC::FunctionBodyNode::generatedJITCode):
  4306. (JSC::FunctionBodyNode::jitCode):
  4307. * profiler/Profiler.cpp:
  4308. (JSC::Profiler::createCallIdentifier):
  4309. * runtime/ArgList.h:
  4310. * runtime/ArrayPrototype.cpp:
  4311. (JSC::isNumericCompareFunction):
  4312. * runtime/BooleanPrototype.cpp:
  4313. (JSC::BooleanPrototype::BooleanPrototype):
  4314. * runtime/DateConstructor.cpp:
  4315. (JSC::DateConstructor::DateConstructor):
  4316. * runtime/ErrorPrototype.cpp:
  4317. (JSC::ErrorPrototype::ErrorPrototype):
  4318. * runtime/FunctionPrototype.cpp:
  4319. (JSC::FunctionPrototype::addFunctionProperties):
  4320. (JSC::functionProtoFuncToString):
  4321. * runtime/FunctionPrototype.h:
  4322. * runtime/JSFunction.cpp:
  4323. (JSC::JSFunction::JSFunction):
  4324. (JSC::JSFunction::~JSFunction):
  4325. (JSC::JSFunction::mark):
  4326. (JSC::JSFunction::getCallData):
  4327. (JSC::JSFunction::call):
  4328. (JSC::JSFunction::argumentsGetter):
  4329. (JSC::JSFunction::callerGetter):
  4330. (JSC::JSFunction::lengthGetter):
  4331. (JSC::JSFunction::getOwnPropertySlot):
  4332. (JSC::JSFunction::put):
  4333. (JSC::JSFunction::deleteProperty):
  4334. (JSC::JSFunction::getConstructData):
  4335. (JSC::JSFunction::construct):
  4336. * runtime/JSFunction.h:
  4337. (JSC::JSFunction::JSFunction):
  4338. (JSC::JSFunction::setScope):
  4339. (JSC::JSFunction::scope):
  4340. (JSC::JSFunction::isHostFunction):
  4341. (JSC::JSFunction::scopeChain):
  4342. (JSC::JSFunction::clearScopeChain):
  4343. (JSC::JSFunction::setScopeChain):
  4344. (JSC::JSFunction::nativeFunction):
  4345. (JSC::JSFunction::setNativeFunction):
  4346. * runtime/JSGlobalData.cpp:
  4347. (JSC::JSGlobalData::~JSGlobalData):
  4348. (JSC::JSGlobalData::createNativeThunk):
  4349. * runtime/JSGlobalData.h:
  4350. (JSC::JSGlobalData::nativeFunctionThunk):
  4351. * runtime/JSGlobalObject.cpp:
  4352. (JSC::JSGlobalObject::reset):
  4353. * runtime/JSGlobalObject.h:
  4354. * runtime/Lookup.cpp:
  4355. (JSC::setUpStaticFunctionSlot):
  4356. * runtime/Lookup.h:
  4357. * runtime/NumberPrototype.cpp:
  4358. (JSC::NumberPrototype::NumberPrototype):
  4359. * runtime/ObjectPrototype.cpp:
  4360. (JSC::ObjectPrototype::ObjectPrototype):
  4361. * runtime/RegExpPrototype.cpp:
  4362. (JSC::RegExpPrototype::RegExpPrototype):
  4363. * runtime/StringConstructor.cpp:
  4364. (JSC::StringConstructor::StringConstructor):
  4365. 2009-05-05 Gavin Barraclough <barraclough@apple.com>
  4366. Reviewed by Oliver Hunt.
  4367. For convenience, let the sampling flags tool clear multiple flags at once.
  4368. * jsc.cpp:
  4369. (GlobalObject::GlobalObject):
  4370. (functionSetSamplingFlags):
  4371. (functionClearSamplingFlags):
  4372. 2009-05-04 Maciej Stachowiak <mjs@apple.com>
  4373. Rubber stamped by Gavin.
  4374. - inline Vector::resize for a ~1.5% speedup on string-tagcloud
  4375. * wtf/Vector.h:
  4376. (WTF::Vector::resize): Inline
  4377. 2009-05-03 Steve Falkenburg <sfalken@apple.com>
  4378. Windows build fix.
  4379. * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
  4380. 2009-05-03 Mark Rowe <mrowe@apple.com>
  4381. Fix the 64-bit build.
  4382. * API/APICast.h:
  4383. (toJS):
  4384. (toRef):
  4385. * runtime/JSNumberCell.cpp:
  4386. (JSC::jsAPIMangledNumber):
  4387. * runtime/JSNumberCell.h:
  4388. 2009-05-02 Sam Weinig <sam@webkit.org>
  4389. Roll JSC API number marshaling back in one last time (I hope).
  4390. 2009-05-03 Sam Weinig <sam@webkit.org>
  4391. Roll JSC API number marshaling back out. It still breaks windows.
  4392. 2009-05-03 Sam Weinig <sam@webkit.org>
  4393. Roll JSC API number marshaling back in.
  4394. 2009-05-02 Darin Adler <darin@apple.com>
  4395. Reviewed by Maciej Stachowiak.
  4396. Bug 25519: streamline lexer by handling BOMs differently
  4397. https://bugs.webkit.org/show_bug.cgi?id=25519
  4398. Roughly 1% faster SunSpider.
  4399. * parser/Grammar.y: Tweak formatting a bit.
  4400. * parser/Lexer.cpp:
  4401. (JSC::Lexer::Lexer): Remove unnnecessary initialization of data members
  4402. that are set up by setCode.
  4403. (JSC::Lexer::currentOffset): Added. Used where the old code would look at
  4404. m_currentOffset.
  4405. (JSC::Lexer::shift1): Replaces the old shift function. No longer does anything
  4406. to handle BOM characters.
  4407. (JSC::Lexer::shift2): Ditto.
  4408. (JSC::Lexer::shift3): Ditto.
  4409. (JSC::Lexer::shift4): Ditto.
  4410. (JSC::Lexer::setCode): Updated for name change from yylineno to m_line.
  4411. Removed now-unused m_eatNextIdentifier, m_stackToken, and m_restrKeyword.
  4412. Replaced m_skipLF and m_skipCR with m_skipLineEnd. Replaced the old
  4413. m_length with m_codeEnd and m_currentOffset with m_codeStart. Added code
  4414. to scan for a BOM character and call copyCodeWithoutBOMs() if we find any.
  4415. (JSC::Lexer::copyCodeWithoutBOMs): Added.
  4416. (JSC::Lexer::nextLine): Updated for name change from yylineno to m_line.
  4417. (JSC::Lexer::makeIdentifier): Moved up higher in the file.
  4418. (JSC::Lexer::matchPunctuator): Moved up higher in the file and changed to
  4419. use a switch statement instead of just if statements.
  4420. (JSC::Lexer::isLineTerminator): Moved up higher in the file and changed to
  4421. have fewer branches.
  4422. (JSC::Lexer::lastTokenWasRestrKeyword): Added. This replaces the old
  4423. m_restrKeyword boolean.
  4424. (JSC::Lexer::isIdentStart): Moved up higher in the file. Changed to use
  4425. fewer branches in the ASCII but not identifier case.
  4426. (JSC::Lexer::isIdentPart): Ditto.
  4427. (JSC::Lexer::singleEscape): Moved up higher in the file.
  4428. (JSC::Lexer::convertOctal): Moved up higher in the file.
  4429. (JSC::Lexer::convertHex): Moved up higher in the file. Changed to use
  4430. toASCIIHexValue instead of rolling our own here.
  4431. (JSC::Lexer::convertUnicode): Ditto.
  4432. (JSC::Lexer::record8): Moved up higher in the file.
  4433. (JSC::Lexer::record16): Moved up higher in the file.
  4434. (JSC::Lexer::lex): Changed type of stringType to int. Replaced m_skipLF
  4435. and m_skipCR with m_skipLineEnd, which requires fewer branches in the
  4436. main lexer loop. Use currentOffset instead of m_currentOffset. Removed
  4437. unneeded m_stackToken. Use isASCIIDigit instead of isDecimalDigit.
  4438. Split out the two cases for InIdentifierOrKeyword and InIdentifier.
  4439. Added special case tight loops for identifiers and other simple states.
  4440. Removed a branch from the code that sets m_atLineStart to false using goto.
  4441. Streamlined the number-handling code so we don't check for the same types
  4442. twice for non-numeric cases and don't add a null to m_buffer8 when it's
  4443. not being used. Removed m_eatNextIdentifier, which wasn't working anyway,
  4444. and m_restrKeyword, which is redundant with m_lastToken. Set the
  4445. m_delimited flag without using a branch.
  4446. (JSC::Lexer::scanRegExp): Tweaked style a bit.
  4447. (JSC::Lexer::clear): Clear m_codeWithoutBOMs so we don't use memory after
  4448. parsing. Clear out UString objects in the more conventional way.
  4449. (JSC::Lexer::sourceCode): Made this no-longer inline since it has more
  4450. work to do in the case where we stripped BOMs.
  4451. * parser/Lexer.h: Renamed yylineno to m_lineNumber. Removed convertHex
  4452. function, which is the same as toASCIIHexValue. Removed isHexDigit
  4453. function, which is the same as isASCIIHedDigit. Replaced shift with four
  4454. separate shift functions. Removed isWhiteSpace function that passes
  4455. m_current, instead just passing m_current explicitly. Removed isOctalDigit,
  4456. which is the same as isASCIIOctalDigit. Eliminated unused arguments from
  4457. matchPunctuator. Added copyCoodeWithoutBOMs and currentOffset. Moved the
  4458. makeIdentifier function out of the header. Added lastTokenWasRestrKeyword
  4459. function. Added new constants for m_skipLineEnd. Removed unused yycolumn,
  4460. m_restrKeyword, m_skipLF, m_skipCR, m_eatNextIdentifier, m_stackToken,
  4461. m_position, m_length, m_currentOffset, m_nextOffset1, m_nextOffset2,
  4462. m_nextOffset3. Added m_skipLineEnd, m_codeStart, m_codeEnd, and
  4463. m_codeWithoutBOMs.
  4464. * parser/SourceProvider.h: Added hasBOMs function. In the future this can
  4465. be used to tell the lexer about strings known not to have BOMs.
  4466. * runtime/JSGlobalObjectFunctions.cpp:
  4467. (JSC::globalFuncUnescape): Changed to use isASCIIHexDigit.
  4468. * wtf/ASCIICType.h: Added using statements to match the design of the
  4469. other WTF headers.
  4470. 2009-05-02 Ada Chan <adachan@apple.com>
  4471. Fix windows build (when doing a clean build)
  4472. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4473. 2009-05-02 Geoffrey Garen <ggaren@apple.com>
  4474. Reviewed by Sam Weinig.
  4475. Simplified null-ish JSValues.
  4476. Replaced calls to noValue() with calls to JSValue() (which is what
  4477. noValue() returned). Removed noValue().
  4478. Replaced almost all uses of jsImpossibleValue() with uses of JSValue().
  4479. Its one remaining use is for construction of hash table deleted values.
  4480. For that specific task, I made a new, private constructor with a special
  4481. tag. Removed jsImpossibleValue().
  4482. Removed "JSValue()" initialiazers, since default construction happens...
  4483. by default.
  4484. * API/JSCallbackObjectFunctions.h:
  4485. (JSC::::call):
  4486. * bytecompiler/BytecodeGenerator.cpp:
  4487. (JSC::BytecodeGenerator::emitLoad):
  4488. * bytecompiler/BytecodeGenerator.h:
  4489. * debugger/DebuggerCallFrame.cpp:
  4490. (JSC::DebuggerCallFrame::evaluate):
  4491. * debugger/DebuggerCallFrame.h:
  4492. (JSC::DebuggerCallFrame::DebuggerCallFrame):
  4493. * interpreter/CallFrame.h:
  4494. (JSC::ExecState::clearException):
  4495. * interpreter/Interpreter.cpp:
  4496. (JSC::Interpreter::privateExecute):
  4497. (JSC::Interpreter::retrieveLastCaller):
  4498. * interpreter/Register.h:
  4499. (JSC::Register::Register):
  4500. * jit/JITCall.cpp:
  4501. (JSC::JIT::unlinkCall):
  4502. (JSC::JIT::compileOpCallInitializeCallFrame):
  4503. (JSC::JIT::compileOpCall):
  4504. * jit/JITStubs.cpp:
  4505. (JSC::JITStubs::cti_op_call_eval):
  4506. (JSC::JITStubs::cti_vm_throw):
  4507. * profiler/Profiler.cpp:
  4508. (JSC::Profiler::willExecute):
  4509. (JSC::Profiler::didExecute):
  4510. * runtime/ArrayPrototype.cpp:
  4511. (JSC::getProperty):
  4512. * runtime/Completion.cpp:
  4513. (JSC::evaluate):
  4514. * runtime/Completion.h:
  4515. (JSC::Completion::Completion):
  4516. * runtime/GetterSetter.cpp:
  4517. (JSC::GetterSetter::getPrimitiveNumber):
  4518. * runtime/JSArray.cpp:
  4519. (JSC::JSArray::putSlowCase):
  4520. (JSC::JSArray::deleteProperty):
  4521. (JSC::JSArray::increaseVectorLength):
  4522. (JSC::JSArray::setLength):
  4523. (JSC::JSArray::pop):
  4524. (JSC::JSArray::sort):
  4525. (JSC::JSArray::compactForSorting):
  4526. * runtime/JSCell.cpp:
  4527. (JSC::JSCell::getJSNumber):
  4528. * runtime/JSCell.h:
  4529. (JSC::JSValue::getJSNumber):
  4530. * runtime/JSGlobalData.cpp:
  4531. (JSC::JSGlobalData::JSGlobalData):
  4532. * runtime/JSImmediate.h:
  4533. (JSC::JSImmediate::fromNumberOutsideIntegerRange):
  4534. (JSC::JSImmediate::from):
  4535. * runtime/JSNumberCell.cpp:
  4536. (JSC::jsNumberCell):
  4537. * runtime/JSObject.cpp:
  4538. (JSC::callDefaultValueFunction):
  4539. * runtime/JSObject.h:
  4540. (JSC::JSObject::getDirect):
  4541. * runtime/JSPropertyNameIterator.cpp:
  4542. (JSC::JSPropertyNameIterator::toPrimitive):
  4543. * runtime/JSPropertyNameIterator.h:
  4544. (JSC::JSPropertyNameIterator::next):
  4545. * runtime/JSValue.h:
  4546. (JSC::JSValue::):
  4547. (JSC::JSValueHashTraits::constructDeletedValue):
  4548. (JSC::JSValueHashTraits::isDeletedValue):
  4549. (JSC::JSValue::JSValue):
  4550. * runtime/JSWrapperObject.h:
  4551. (JSC::JSWrapperObject::JSWrapperObject):
  4552. * runtime/Operations.h:
  4553. (JSC::resolveBase):
  4554. * runtime/PropertySlot.h:
  4555. (JSC::PropertySlot::clearBase):
  4556. (JSC::PropertySlot::clearValue):
  4557. 2009-05-02 Maciej Stachowiak <mjs@apple.com>
  4558. Reviewed by Cameron Zwarich.
  4559. - speed up the lexer in various ways
  4560. ~2% command-line SunSpider speedup
  4561. * parser/Lexer.cpp:
  4562. (JSC::Lexer::setCode): Moved below shift() so it can inline.
  4563. (JSC::Lexer::scanRegExp): Use resize(0) instead of clear() on Vectors, since the intent
  4564. here is not to free the underlying buffer.
  4565. (JSC::Lexer::lex): ditto; also, change the loop logic a bit for the main lexing loop
  4566. to avoid branching on !m_done twice per iteration. Now we only check it once.
  4567. (JSC::Lexer::shift): Make this ALWAYS_INLINE and tag an unusual branch as UNLIKELY
  4568. * parser/Lexer.h:
  4569. (JSC::Lexer::makeIdentifier): force to be ALWAYS_INLINE
  4570. * wtf/Vector.h:
  4571. (WTF::::append): force to be ALWAYS_INLINE (may have helped in ways other than parsing but it wasn't
  4572. getting inlined in a hot code path in the lexer)
  4573. 2009-05-01 Steve Falkenburg <sfalken@apple.com>
  4574. Windows build fix.
  4575. * JavaScriptCore.vcproj/JavaScriptCore.make:
  4576. 2009-05-01 Sam Weinig <sam@webkit.org>
  4577. Fix 64bit build.
  4578. * runtime/JSNumberCell.h:
  4579. (JSC::JSValue::JSValue):
  4580. * runtime/JSValue.h:
  4581. (JSC::jsNumber):
  4582. 2009-05-01 Sam Weinig <sam@webkit.org>
  4583. Roll out JavaScriptCore API number marshaling.
  4584. * API/APICast.h:
  4585. (toJS):
  4586. (toRef):
  4587. * API/JSBase.cpp:
  4588. (JSEvaluateScript):
  4589. (JSCheckScriptSyntax):
  4590. * API/JSCallbackConstructor.cpp:
  4591. (JSC::constructJSCallback):
  4592. * API/JSCallbackFunction.cpp:
  4593. (JSC::JSCallbackFunction::call):
  4594. * API/JSCallbackObjectFunctions.h:
  4595. (JSC::::getOwnPropertySlot):
  4596. (JSC::::put):
  4597. (JSC::::deleteProperty):
  4598. (JSC::::construct):
  4599. (JSC::::hasInstance):
  4600. (JSC::::call):
  4601. (JSC::::toNumber):
  4602. (JSC::::toString):
  4603. (JSC::::staticValueGetter):
  4604. (JSC::::callbackGetter):
  4605. * API/JSObjectRef.cpp:
  4606. (JSObjectMakeFunction):
  4607. (JSObjectMakeArray):
  4608. (JSObjectMakeDate):
  4609. (JSObjectMakeError):
  4610. (JSObjectMakeRegExp):
  4611. (JSObjectGetPrototype):
  4612. (JSObjectSetPrototype):
  4613. (JSObjectGetProperty):
  4614. (JSObjectSetProperty):
  4615. (JSObjectGetPropertyAtIndex):
  4616. (JSObjectSetPropertyAtIndex):
  4617. (JSObjectDeleteProperty):
  4618. (JSObjectCallAsFunction):
  4619. (JSObjectCallAsConstructor):
  4620. * API/JSValueRef.cpp:
  4621. (JSValueGetType):
  4622. (JSValueIsUndefined):
  4623. (JSValueIsNull):
  4624. (JSValueIsBoolean):
  4625. (JSValueIsNumber):
  4626. (JSValueIsString):
  4627. (JSValueIsObject):
  4628. (JSValueIsObjectOfClass):
  4629. (JSValueIsEqual):
  4630. (JSValueIsStrictEqual):
  4631. (JSValueIsInstanceOfConstructor):
  4632. (JSValueMakeUndefined):
  4633. (JSValueMakeNull):
  4634. (JSValueMakeBoolean):
  4635. (JSValueMakeNumber):
  4636. (JSValueMakeString):
  4637. (JSValueToBoolean):
  4638. (JSValueToNumber):
  4639. (JSValueToStringCopy):
  4640. (JSValueToObject):
  4641. (JSValueProtect):
  4642. (JSValueUnprotect):
  4643. * JavaScriptCore.exp:
  4644. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4645. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4646. * runtime/JSNumberCell.cpp:
  4647. * runtime/JSNumberCell.h:
  4648. * runtime/JSValue.h:
  4649. 2009-05-01 Sam Weinig <sam@webkit.org>
  4650. Fix windows build.
  4651. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4652. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4653. 2009-05-01 Sam Weinig <sam@webkit.org>
  4654. Fix the build.
  4655. * JavaScriptCore.exp:
  4656. 2009-05-01 Sam Weinig <sam@webkit.org>
  4657. Reviewed by Geoffrey "Too Far!" Garen.
  4658. Move JS number construction into JSValue.
  4659. * runtime/JSImmediate.h:
  4660. * runtime/JSNumberCell.h:
  4661. (JSC::JSValue::JSValue):
  4662. * runtime/JSValue.h:
  4663. (JSC::jsNumber):
  4664. 2009-05-01 Sam Weinig <sam@webkit.org>
  4665. Reviewed by Geoff "The Minneapolis" Garen.
  4666. Add mechanism to vend heap allocated JS numbers to JavaScriptCore API clients with a
  4667. representation that is independent of the number representation in the VM.
  4668. - Numbers leaving the interpreter are converted to a tagged JSNumberCell.
  4669. - The numbers coming into the interpreter (asserted to be the tagged JSNumberCell) are
  4670. converted back to the VM's internal number representation.
  4671. * API/APICast.h:
  4672. (toJS):
  4673. (toRef):
  4674. * API/JSBase.cpp:
  4675. (JSEvaluateScript):
  4676. (JSCheckScriptSyntax):
  4677. * API/JSCallbackConstructor.cpp:
  4678. (JSC::constructJSCallback):
  4679. * API/JSCallbackFunction.cpp:
  4680. (JSC::JSCallbackFunction::call):
  4681. * API/JSCallbackObjectFunctions.h:
  4682. (JSC::::getOwnPropertySlot):
  4683. (JSC::::put):
  4684. (JSC::::deleteProperty):
  4685. (JSC::::construct):
  4686. (JSC::::hasInstance):
  4687. (JSC::::call):
  4688. (JSC::::toNumber):
  4689. (JSC::::toString):
  4690. (JSC::::staticValueGetter):
  4691. (JSC::::callbackGetter):
  4692. * API/JSObjectRef.cpp:
  4693. (JSObjectMakeFunction):
  4694. (JSObjectMakeArray):
  4695. (JSObjectMakeDate):
  4696. (JSObjectMakeError):
  4697. (JSObjectMakeRegExp):
  4698. (JSObjectGetPrototype):
  4699. (JSObjectSetPrototype):
  4700. (JSObjectGetProperty):
  4701. (JSObjectSetProperty):
  4702. (JSObjectGetPropertyAtIndex):
  4703. (JSObjectSetPropertyAtIndex):
  4704. (JSObjectDeleteProperty):
  4705. (JSObjectCallAsFunction):
  4706. (JSObjectCallAsConstructor):
  4707. * API/JSValueRef.cpp:
  4708. (JSValueGetType):
  4709. (JSValueIsUndefined):
  4710. (JSValueIsNull):
  4711. (JSValueIsBoolean):
  4712. (JSValueIsNumber):
  4713. (JSValueIsString):
  4714. (JSValueIsObject):
  4715. (JSValueIsObjectOfClass):
  4716. (JSValueIsEqual):
  4717. (JSValueIsStrictEqual):
  4718. (JSValueIsInstanceOfConstructor):
  4719. (JSValueMakeUndefined):
  4720. (JSValueMakeNull):
  4721. (JSValueMakeBoolean):
  4722. (JSValueMakeNumber):
  4723. (JSValueMakeString):
  4724. (JSValueToBoolean):
  4725. (JSValueToNumber):
  4726. (JSValueToStringCopy):
  4727. (JSValueToObject):
  4728. (JSValueProtect):
  4729. (JSValueUnprotect):
  4730. * runtime/JSNumberCell.cpp:
  4731. (JSC::jsAPIMangledNumber):
  4732. * runtime/JSNumberCell.h:
  4733. (JSC::JSNumberCell::isAPIMangledNumber):
  4734. (JSC::JSNumberCell::):
  4735. (JSC::JSNumberCell::JSNumberCell):
  4736. (JSC::JSValue::isAPIMangledNumber):
  4737. * runtime/JSValue.h:
  4738. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4739. Windows build fix take 6.
  4740. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4741. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4742. Windows build fix take 5.
  4743. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4744. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4745. Windows build fix take 4.
  4746. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4747. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4748. Windows build fix take 3.
  4749. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4750. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4751. Windows build fix take 2.
  4752. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4753. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4754. Windows build fix take 1.
  4755. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4756. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  4757. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  4758. Rubber Stamped by Sam Weinig.
  4759. Renamed JSValuePtr => JSValue.
  4760. * API/APICast.h:
  4761. (toJS):
  4762. (toRef):
  4763. * API/JSCallbackConstructor.h:
  4764. (JSC::JSCallbackConstructor::createStructure):
  4765. * API/JSCallbackFunction.cpp:
  4766. (JSC::JSCallbackFunction::call):
  4767. * API/JSCallbackFunction.h:
  4768. (JSC::JSCallbackFunction::createStructure):
  4769. * API/JSCallbackObject.h:
  4770. (JSC::JSCallbackObject::createStructure):
  4771. * API/JSCallbackObjectFunctions.h:
  4772. (JSC::::asCallbackObject):
  4773. (JSC::::put):
  4774. (JSC::::hasInstance):
  4775. (JSC::::call):
  4776. (JSC::::staticValueGetter):
  4777. (JSC::::staticFunctionGetter):
  4778. (JSC::::callbackGetter):
  4779. * API/JSContextRef.cpp:
  4780. * API/JSObjectRef.cpp:
  4781. (JSObjectMakeConstructor):
  4782. (JSObjectSetPrototype):
  4783. (JSObjectGetProperty):
  4784. (JSObjectSetProperty):
  4785. (JSObjectGetPropertyAtIndex):
  4786. (JSObjectSetPropertyAtIndex):
  4787. * API/JSValueRef.cpp:
  4788. (JSValueGetType):
  4789. (JSValueIsUndefined):
  4790. (JSValueIsNull):
  4791. (JSValueIsBoolean):
  4792. (JSValueIsNumber):
  4793. (JSValueIsString):
  4794. (JSValueIsObject):
  4795. (JSValueIsObjectOfClass):
  4796. (JSValueIsEqual):
  4797. (JSValueIsStrictEqual):
  4798. (JSValueIsInstanceOfConstructor):
  4799. (JSValueToBoolean):
  4800. (JSValueToNumber):
  4801. (JSValueToStringCopy):
  4802. (JSValueToObject):
  4803. (JSValueProtect):
  4804. (JSValueUnprotect):
  4805. * JavaScriptCore.exp:
  4806. * bytecode/CodeBlock.cpp:
  4807. (JSC::valueToSourceString):
  4808. (JSC::constantName):
  4809. (JSC::CodeBlock::dump):
  4810. * bytecode/CodeBlock.h:
  4811. (JSC::CodeBlock::getConstant):
  4812. (JSC::CodeBlock::addUnexpectedConstant):
  4813. (JSC::CodeBlock::unexpectedConstant):
  4814. * bytecode/EvalCodeCache.h:
  4815. (JSC::EvalCodeCache::get):
  4816. * bytecompiler/BytecodeGenerator.cpp:
  4817. (JSC::BytecodeGenerator::addConstant):
  4818. (JSC::BytecodeGenerator::addUnexpectedConstant):
  4819. (JSC::BytecodeGenerator::emitLoad):
  4820. (JSC::BytecodeGenerator::emitGetScopedVar):
  4821. (JSC::BytecodeGenerator::emitPutScopedVar):
  4822. (JSC::BytecodeGenerator::emitNewError):
  4823. (JSC::keyForImmediateSwitch):
  4824. * bytecompiler/BytecodeGenerator.h:
  4825. (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
  4826. (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  4827. * debugger/Debugger.cpp:
  4828. (JSC::evaluateInGlobalCallFrame):
  4829. * debugger/Debugger.h:
  4830. * debugger/DebuggerActivation.cpp:
  4831. (JSC::DebuggerActivation::put):
  4832. (JSC::DebuggerActivation::putWithAttributes):
  4833. (JSC::DebuggerActivation::lookupGetter):
  4834. (JSC::DebuggerActivation::lookupSetter):
  4835. * debugger/DebuggerActivation.h:
  4836. (JSC::DebuggerActivation::createStructure):
  4837. * debugger/DebuggerCallFrame.cpp:
  4838. (JSC::DebuggerCallFrame::evaluate):
  4839. * debugger/DebuggerCallFrame.h:
  4840. (JSC::DebuggerCallFrame::DebuggerCallFrame):
  4841. (JSC::DebuggerCallFrame::exception):
  4842. * interpreter/CachedCall.h:
  4843. (JSC::CachedCall::CachedCall):
  4844. (JSC::CachedCall::call):
  4845. (JSC::CachedCall::setThis):
  4846. (JSC::CachedCall::setArgument):
  4847. * interpreter/CallFrame.cpp:
  4848. (JSC::CallFrame::thisValue):
  4849. (JSC::CallFrame::dumpCaller):
  4850. * interpreter/CallFrame.h:
  4851. (JSC::ExecState::setException):
  4852. (JSC::ExecState::exception):
  4853. (JSC::ExecState::exceptionSlot):
  4854. * interpreter/CallFrameClosure.h:
  4855. (JSC::CallFrameClosure::setArgument):
  4856. * interpreter/Interpreter.cpp:
  4857. (JSC::Interpreter::resolve):
  4858. (JSC::Interpreter::resolveSkip):
  4859. (JSC::Interpreter::resolveGlobal):
  4860. (JSC::Interpreter::resolveBase):
  4861. (JSC::Interpreter::resolveBaseAndProperty):
  4862. (JSC::Interpreter::resolveBaseAndFunc):
  4863. (JSC::isNotObject):
  4864. (JSC::Interpreter::callEval):
  4865. (JSC::Interpreter::unwindCallFrame):
  4866. (JSC::Interpreter::throwException):
  4867. (JSC::Interpreter::execute):
  4868. (JSC::Interpreter::prepareForRepeatCall):
  4869. (JSC::Interpreter::createExceptionScope):
  4870. (JSC::Interpreter::tryCachePutByID):
  4871. (JSC::Interpreter::tryCacheGetByID):
  4872. (JSC::Interpreter::privateExecute):
  4873. (JSC::Interpreter::retrieveArguments):
  4874. (JSC::Interpreter::retrieveCaller):
  4875. (JSC::Interpreter::retrieveLastCaller):
  4876. * interpreter/Interpreter.h:
  4877. * interpreter/Register.h:
  4878. (JSC::Register::):
  4879. (JSC::Register::Register):
  4880. (JSC::Register::jsValue):
  4881. * jit/JIT.cpp:
  4882. (JSC::):
  4883. (JSC::JIT::privateCompileMainPass):
  4884. * jit/JIT.h:
  4885. * jit/JITArithmetic.cpp:
  4886. (JSC::JIT::compileFastArith_op_mod):
  4887. * jit/JITCall.cpp:
  4888. (JSC::JIT::unlinkCall):
  4889. (JSC::JIT::compileOpCallInitializeCallFrame):
  4890. (JSC::JIT::compileOpCall):
  4891. * jit/JITCode.h:
  4892. (JSC::):
  4893. (JSC::JITCode::execute):
  4894. * jit/JITInlineMethods.h:
  4895. (JSC::JIT::emitGetVirtualRegister):
  4896. (JSC::JIT::getConstantOperand):
  4897. (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
  4898. (JSC::JIT::emitInitRegister):
  4899. * jit/JITPropertyAccess.cpp:
  4900. (JSC::JIT::privateCompilePutByIdTransition):
  4901. (JSC::JIT::patchGetByIdSelf):
  4902. (JSC::JIT::patchPutByIdReplace):
  4903. (JSC::JIT::privateCompileGetByIdSelf):
  4904. (JSC::JIT::privateCompileGetByIdProto):
  4905. (JSC::JIT::privateCompileGetByIdSelfList):
  4906. (JSC::JIT::privateCompileGetByIdProtoList):
  4907. (JSC::JIT::privateCompileGetByIdChainList):
  4908. (JSC::JIT::privateCompileGetByIdChain):
  4909. (JSC::JIT::privateCompilePutByIdReplace):
  4910. * jit/JITStubs.cpp:
  4911. (JSC::JITStubs::tryCachePutByID):
  4912. (JSC::JITStubs::tryCacheGetByID):
  4913. (JSC::JITStubs::cti_op_convert_this):
  4914. (JSC::JITStubs::cti_op_add):
  4915. (JSC::JITStubs::cti_op_pre_inc):
  4916. (JSC::JITStubs::cti_op_loop_if_less):
  4917. (JSC::JITStubs::cti_op_loop_if_lesseq):
  4918. (JSC::JITStubs::cti_op_get_by_id_generic):
  4919. (JSC::JITStubs::cti_op_get_by_id):
  4920. (JSC::JITStubs::cti_op_get_by_id_second):
  4921. (JSC::JITStubs::cti_op_get_by_id_self_fail):
  4922. (JSC::JITStubs::cti_op_get_by_id_proto_list):
  4923. (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
  4924. (JSC::JITStubs::cti_op_get_by_id_proto_fail):
  4925. (JSC::JITStubs::cti_op_get_by_id_array_fail):
  4926. (JSC::JITStubs::cti_op_get_by_id_string_fail):
  4927. (JSC::JITStubs::cti_op_instanceof):
  4928. (JSC::JITStubs::cti_op_del_by_id):
  4929. (JSC::JITStubs::cti_op_mul):
  4930. (JSC::JITStubs::cti_op_call_NotJSFunction):
  4931. (JSC::JITStubs::cti_op_resolve):
  4932. (JSC::JITStubs::cti_op_construct_NotJSConstruct):
  4933. (JSC::JITStubs::cti_op_get_by_val):
  4934. (JSC::JITStubs::cti_op_get_by_val_string):
  4935. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  4936. (JSC::JITStubs::cti_op_resolve_func):
  4937. (JSC::JITStubs::cti_op_sub):
  4938. (JSC::JITStubs::cti_op_put_by_val):
  4939. (JSC::JITStubs::cti_op_put_by_val_array):
  4940. (JSC::JITStubs::cti_op_put_by_val_byte_array):
  4941. (JSC::JITStubs::cti_op_lesseq):
  4942. (JSC::JITStubs::cti_op_loop_if_true):
  4943. (JSC::JITStubs::cti_op_load_varargs):
  4944. (JSC::JITStubs::cti_op_negate):
  4945. (JSC::JITStubs::cti_op_resolve_base):
  4946. (JSC::JITStubs::cti_op_resolve_skip):
  4947. (JSC::JITStubs::cti_op_resolve_global):
  4948. (JSC::JITStubs::cti_op_div):
  4949. (JSC::JITStubs::cti_op_pre_dec):
  4950. (JSC::JITStubs::cti_op_jless):
  4951. (JSC::JITStubs::cti_op_not):
  4952. (JSC::JITStubs::cti_op_jtrue):
  4953. (JSC::JITStubs::cti_op_post_inc):
  4954. (JSC::JITStubs::cti_op_eq):
  4955. (JSC::JITStubs::cti_op_lshift):
  4956. (JSC::JITStubs::cti_op_bitand):
  4957. (JSC::JITStubs::cti_op_rshift):
  4958. (JSC::JITStubs::cti_op_bitnot):
  4959. (JSC::JITStubs::cti_op_resolve_with_base):
  4960. (JSC::JITStubs::cti_op_mod):
  4961. (JSC::JITStubs::cti_op_less):
  4962. (JSC::JITStubs::cti_op_neq):
  4963. (JSC::JITStubs::cti_op_post_dec):
  4964. (JSC::JITStubs::cti_op_urshift):
  4965. (JSC::JITStubs::cti_op_bitxor):
  4966. (JSC::JITStubs::cti_op_bitor):
  4967. (JSC::JITStubs::cti_op_call_eval):
  4968. (JSC::JITStubs::cti_op_throw):
  4969. (JSC::JITStubs::cti_op_next_pname):
  4970. (JSC::JITStubs::cti_op_typeof):
  4971. (JSC::JITStubs::cti_op_is_undefined):
  4972. (JSC::JITStubs::cti_op_is_boolean):
  4973. (JSC::JITStubs::cti_op_is_number):
  4974. (JSC::JITStubs::cti_op_is_string):
  4975. (JSC::JITStubs::cti_op_is_object):
  4976. (JSC::JITStubs::cti_op_is_function):
  4977. (JSC::JITStubs::cti_op_stricteq):
  4978. (JSC::JITStubs::cti_op_nstricteq):
  4979. (JSC::JITStubs::cti_op_to_jsnumber):
  4980. (JSC::JITStubs::cti_op_in):
  4981. (JSC::JITStubs::cti_op_switch_imm):
  4982. (JSC::JITStubs::cti_op_switch_char):
  4983. (JSC::JITStubs::cti_op_switch_string):
  4984. (JSC::JITStubs::cti_op_del_by_val):
  4985. (JSC::JITStubs::cti_op_new_error):
  4986. (JSC::JITStubs::cti_vm_throw):
  4987. * jit/JITStubs.h:
  4988. * jsc.cpp:
  4989. (functionPrint):
  4990. (functionDebug):
  4991. (functionGC):
  4992. (functionVersion):
  4993. (functionRun):
  4994. (functionLoad):
  4995. (functionSetSamplingFlag):
  4996. (functionClearSamplingFlag):
  4997. (functionReadline):
  4998. (functionQuit):
  4999. * parser/Nodes.cpp:
  5000. (JSC::processClauseList):
  5001. * profiler/ProfileGenerator.cpp:
  5002. (JSC::ProfileGenerator::addParentForConsoleStart):
  5003. * profiler/Profiler.cpp:
  5004. (JSC::Profiler::willExecute):
  5005. (JSC::Profiler::didExecute):
  5006. (JSC::Profiler::createCallIdentifier):
  5007. * profiler/Profiler.h:
  5008. * runtime/ArgList.cpp:
  5009. (JSC::MarkedArgumentBuffer::slowAppend):
  5010. * runtime/ArgList.h:
  5011. (JSC::MarkedArgumentBuffer::at):
  5012. (JSC::MarkedArgumentBuffer::append):
  5013. (JSC::ArgList::ArgList):
  5014. (JSC::ArgList::at):
  5015. * runtime/Arguments.cpp:
  5016. (JSC::Arguments::put):
  5017. * runtime/Arguments.h:
  5018. (JSC::Arguments::createStructure):
  5019. (JSC::asArguments):
  5020. * runtime/ArrayConstructor.cpp:
  5021. (JSC::callArrayConstructor):
  5022. * runtime/ArrayPrototype.cpp:
  5023. (JSC::getProperty):
  5024. (JSC::putProperty):
  5025. (JSC::arrayProtoFuncToString):
  5026. (JSC::arrayProtoFuncToLocaleString):
  5027. (JSC::arrayProtoFuncJoin):
  5028. (JSC::arrayProtoFuncConcat):
  5029. (JSC::arrayProtoFuncPop):
  5030. (JSC::arrayProtoFuncPush):
  5031. (JSC::arrayProtoFuncReverse):
  5032. (JSC::arrayProtoFuncShift):
  5033. (JSC::arrayProtoFuncSlice):
  5034. (JSC::arrayProtoFuncSort):
  5035. (JSC::arrayProtoFuncSplice):
  5036. (JSC::arrayProtoFuncUnShift):
  5037. (JSC::arrayProtoFuncFilter):
  5038. (JSC::arrayProtoFuncMap):
  5039. (JSC::arrayProtoFuncEvery):
  5040. (JSC::arrayProtoFuncForEach):
  5041. (JSC::arrayProtoFuncSome):
  5042. (JSC::arrayProtoFuncReduce):
  5043. (JSC::arrayProtoFuncReduceRight):
  5044. (JSC::arrayProtoFuncIndexOf):
  5045. (JSC::arrayProtoFuncLastIndexOf):
  5046. * runtime/BooleanConstructor.cpp:
  5047. (JSC::callBooleanConstructor):
  5048. (JSC::constructBooleanFromImmediateBoolean):
  5049. * runtime/BooleanConstructor.h:
  5050. * runtime/BooleanObject.h:
  5051. (JSC::asBooleanObject):
  5052. * runtime/BooleanPrototype.cpp:
  5053. (JSC::booleanProtoFuncToString):
  5054. (JSC::booleanProtoFuncValueOf):
  5055. * runtime/CallData.cpp:
  5056. (JSC::call):
  5057. * runtime/CallData.h:
  5058. * runtime/Collector.cpp:
  5059. (JSC::Heap::protect):
  5060. (JSC::Heap::unprotect):
  5061. (JSC::Heap::heap):
  5062. * runtime/Collector.h:
  5063. * runtime/Completion.cpp:
  5064. (JSC::evaluate):
  5065. * runtime/Completion.h:
  5066. (JSC::Completion::Completion):
  5067. (JSC::Completion::value):
  5068. (JSC::Completion::setValue):
  5069. * runtime/ConstructData.cpp:
  5070. (JSC::construct):
  5071. * runtime/ConstructData.h:
  5072. * runtime/DateConstructor.cpp:
  5073. (JSC::constructDate):
  5074. (JSC::callDate):
  5075. (JSC::dateParse):
  5076. (JSC::dateNow):
  5077. (JSC::dateUTC):
  5078. * runtime/DateInstance.h:
  5079. (JSC::asDateInstance):
  5080. * runtime/DatePrototype.cpp:
  5081. (JSC::dateProtoFuncToString):
  5082. (JSC::dateProtoFuncToUTCString):
  5083. (JSC::dateProtoFuncToDateString):
  5084. (JSC::dateProtoFuncToTimeString):
  5085. (JSC::dateProtoFuncToLocaleString):
  5086. (JSC::dateProtoFuncToLocaleDateString):
  5087. (JSC::dateProtoFuncToLocaleTimeString):
  5088. (JSC::dateProtoFuncGetTime):
  5089. (JSC::dateProtoFuncGetFullYear):
  5090. (JSC::dateProtoFuncGetUTCFullYear):
  5091. (JSC::dateProtoFuncToGMTString):
  5092. (JSC::dateProtoFuncGetMonth):
  5093. (JSC::dateProtoFuncGetUTCMonth):
  5094. (JSC::dateProtoFuncGetDate):
  5095. (JSC::dateProtoFuncGetUTCDate):
  5096. (JSC::dateProtoFuncGetDay):
  5097. (JSC::dateProtoFuncGetUTCDay):
  5098. (JSC::dateProtoFuncGetHours):
  5099. (JSC::dateProtoFuncGetUTCHours):
  5100. (JSC::dateProtoFuncGetMinutes):
  5101. (JSC::dateProtoFuncGetUTCMinutes):
  5102. (JSC::dateProtoFuncGetSeconds):
  5103. (JSC::dateProtoFuncGetUTCSeconds):
  5104. (JSC::dateProtoFuncGetMilliSeconds):
  5105. (JSC::dateProtoFuncGetUTCMilliseconds):
  5106. (JSC::dateProtoFuncGetTimezoneOffset):
  5107. (JSC::dateProtoFuncSetTime):
  5108. (JSC::setNewValueFromTimeArgs):
  5109. (JSC::setNewValueFromDateArgs):
  5110. (JSC::dateProtoFuncSetMilliSeconds):
  5111. (JSC::dateProtoFuncSetUTCMilliseconds):
  5112. (JSC::dateProtoFuncSetSeconds):
  5113. (JSC::dateProtoFuncSetUTCSeconds):
  5114. (JSC::dateProtoFuncSetMinutes):
  5115. (JSC::dateProtoFuncSetUTCMinutes):
  5116. (JSC::dateProtoFuncSetHours):
  5117. (JSC::dateProtoFuncSetUTCHours):
  5118. (JSC::dateProtoFuncSetDate):
  5119. (JSC::dateProtoFuncSetUTCDate):
  5120. (JSC::dateProtoFuncSetMonth):
  5121. (JSC::dateProtoFuncSetUTCMonth):
  5122. (JSC::dateProtoFuncSetFullYear):
  5123. (JSC::dateProtoFuncSetUTCFullYear):
  5124. (JSC::dateProtoFuncSetYear):
  5125. (JSC::dateProtoFuncGetYear):
  5126. * runtime/DatePrototype.h:
  5127. (JSC::DatePrototype::createStructure):
  5128. * runtime/ErrorConstructor.cpp:
  5129. (JSC::callErrorConstructor):
  5130. * runtime/ErrorPrototype.cpp:
  5131. (JSC::errorProtoFuncToString):
  5132. * runtime/ExceptionHelpers.cpp:
  5133. (JSC::createInterruptedExecutionException):
  5134. (JSC::createError):
  5135. (JSC::createStackOverflowError):
  5136. (JSC::createUndefinedVariableError):
  5137. (JSC::createErrorMessage):
  5138. (JSC::createInvalidParamError):
  5139. (JSC::createNotAConstructorError):
  5140. (JSC::createNotAFunctionError):
  5141. * runtime/ExceptionHelpers.h:
  5142. * runtime/FunctionConstructor.cpp:
  5143. (JSC::callFunctionConstructor):
  5144. * runtime/FunctionPrototype.cpp:
  5145. (JSC::callFunctionPrototype):
  5146. (JSC::functionProtoFuncToString):
  5147. (JSC::functionProtoFuncApply):
  5148. (JSC::functionProtoFuncCall):
  5149. * runtime/FunctionPrototype.h:
  5150. (JSC::FunctionPrototype::createStructure):
  5151. * runtime/GetterSetter.cpp:
  5152. (JSC::GetterSetter::toPrimitive):
  5153. (JSC::GetterSetter::getPrimitiveNumber):
  5154. * runtime/GetterSetter.h:
  5155. (JSC::asGetterSetter):
  5156. * runtime/InternalFunction.cpp:
  5157. (JSC::InternalFunction::displayName):
  5158. * runtime/InternalFunction.h:
  5159. (JSC::InternalFunction::createStructure):
  5160. (JSC::asInternalFunction):
  5161. * runtime/JSActivation.cpp:
  5162. (JSC::JSActivation::getOwnPropertySlot):
  5163. (JSC::JSActivation::put):
  5164. (JSC::JSActivation::putWithAttributes):
  5165. (JSC::JSActivation::argumentsGetter):
  5166. * runtime/JSActivation.h:
  5167. (JSC::JSActivation::createStructure):
  5168. (JSC::asActivation):
  5169. * runtime/JSArray.cpp:
  5170. (JSC::storageSize):
  5171. (JSC::JSArray::JSArray):
  5172. (JSC::JSArray::getOwnPropertySlot):
  5173. (JSC::JSArray::put):
  5174. (JSC::JSArray::putSlowCase):
  5175. (JSC::JSArray::deleteProperty):
  5176. (JSC::JSArray::setLength):
  5177. (JSC::JSArray::pop):
  5178. (JSC::JSArray::push):
  5179. (JSC::JSArray::mark):
  5180. (JSC::compareNumbersForQSort):
  5181. (JSC::JSArray::sortNumeric):
  5182. (JSC::JSArray::sort):
  5183. (JSC::JSArray::compactForSorting):
  5184. (JSC::JSArray::checkConsistency):
  5185. (JSC::constructArray):
  5186. * runtime/JSArray.h:
  5187. (JSC::JSArray::getIndex):
  5188. (JSC::JSArray::setIndex):
  5189. (JSC::JSArray::createStructure):
  5190. (JSC::asArray):
  5191. (JSC::isJSArray):
  5192. * runtime/JSByteArray.cpp:
  5193. (JSC::JSByteArray::createStructure):
  5194. (JSC::JSByteArray::put):
  5195. * runtime/JSByteArray.h:
  5196. (JSC::JSByteArray::getIndex):
  5197. (JSC::JSByteArray::setIndex):
  5198. (JSC::asByteArray):
  5199. (JSC::isJSByteArray):
  5200. * runtime/JSCell.cpp:
  5201. (JSC::JSCell::put):
  5202. (JSC::JSCell::getJSNumber):
  5203. * runtime/JSCell.h:
  5204. (JSC::asCell):
  5205. (JSC::JSValue::asCell):
  5206. (JSC::JSValue::isString):
  5207. (JSC::JSValue::isGetterSetter):
  5208. (JSC::JSValue::isObject):
  5209. (JSC::JSValue::getString):
  5210. (JSC::JSValue::getObject):
  5211. (JSC::JSValue::getCallData):
  5212. (JSC::JSValue::getConstructData):
  5213. (JSC::JSValue::getUInt32):
  5214. (JSC::JSValue::getTruncatedInt32):
  5215. (JSC::JSValue::getTruncatedUInt32):
  5216. (JSC::JSValue::mark):
  5217. (JSC::JSValue::marked):
  5218. (JSC::JSValue::toPrimitive):
  5219. (JSC::JSValue::getPrimitiveNumber):
  5220. (JSC::JSValue::toBoolean):
  5221. (JSC::JSValue::toNumber):
  5222. (JSC::JSValue::toString):
  5223. (JSC::JSValue::toObject):
  5224. (JSC::JSValue::toThisObject):
  5225. (JSC::JSValue::needsThisConversion):
  5226. (JSC::JSValue::toThisString):
  5227. (JSC::JSValue::getJSNumber):
  5228. * runtime/JSFunction.cpp:
  5229. (JSC::JSFunction::call):
  5230. (JSC::JSFunction::argumentsGetter):
  5231. (JSC::JSFunction::callerGetter):
  5232. (JSC::JSFunction::lengthGetter):
  5233. (JSC::JSFunction::getOwnPropertySlot):
  5234. (JSC::JSFunction::put):
  5235. (JSC::JSFunction::construct):
  5236. * runtime/JSFunction.h:
  5237. (JSC::JSFunction::createStructure):
  5238. (JSC::asFunction):
  5239. * runtime/JSGlobalData.h:
  5240. * runtime/JSGlobalObject.cpp:
  5241. (JSC::markIfNeeded):
  5242. (JSC::JSGlobalObject::put):
  5243. (JSC::JSGlobalObject::putWithAttributes):
  5244. (JSC::JSGlobalObject::reset):
  5245. (JSC::JSGlobalObject::resetPrototype):
  5246. * runtime/JSGlobalObject.h:
  5247. (JSC::JSGlobalObject::createStructure):
  5248. (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
  5249. (JSC::asGlobalObject):
  5250. (JSC::Structure::prototypeForLookup):
  5251. (JSC::Structure::prototypeChain):
  5252. (JSC::Structure::isValid):
  5253. * runtime/JSGlobalObjectFunctions.cpp:
  5254. (JSC::encode):
  5255. (JSC::decode):
  5256. (JSC::globalFuncEval):
  5257. (JSC::globalFuncParseInt):
  5258. (JSC::globalFuncParseFloat):
  5259. (JSC::globalFuncIsNaN):
  5260. (JSC::globalFuncIsFinite):
  5261. (JSC::globalFuncDecodeURI):
  5262. (JSC::globalFuncDecodeURIComponent):
  5263. (JSC::globalFuncEncodeURI):
  5264. (JSC::globalFuncEncodeURIComponent):
  5265. (JSC::globalFuncEscape):
  5266. (JSC::globalFuncUnescape):
  5267. (JSC::globalFuncJSCPrint):
  5268. * runtime/JSGlobalObjectFunctions.h:
  5269. * runtime/JSImmediate.cpp:
  5270. (JSC::JSImmediate::toThisObject):
  5271. (JSC::JSImmediate::toObject):
  5272. (JSC::JSImmediate::prototype):
  5273. (JSC::JSImmediate::toString):
  5274. * runtime/JSImmediate.h:
  5275. (JSC::JSImmediate::isImmediate):
  5276. (JSC::JSImmediate::isNumber):
  5277. (JSC::JSImmediate::isIntegerNumber):
  5278. (JSC::JSImmediate::isDoubleNumber):
  5279. (JSC::JSImmediate::isPositiveIntegerNumber):
  5280. (JSC::JSImmediate::isBoolean):
  5281. (JSC::JSImmediate::isUndefinedOrNull):
  5282. (JSC::JSImmediate::isEitherImmediate):
  5283. (JSC::JSImmediate::areBothImmediate):
  5284. (JSC::JSImmediate::areBothImmediateIntegerNumbers):
  5285. (JSC::JSImmediate::makeValue):
  5286. (JSC::JSImmediate::makeInt):
  5287. (JSC::JSImmediate::makeDouble):
  5288. (JSC::JSImmediate::makeBool):
  5289. (JSC::JSImmediate::makeUndefined):
  5290. (JSC::JSImmediate::makeNull):
  5291. (JSC::JSImmediate::doubleValue):
  5292. (JSC::JSImmediate::intValue):
  5293. (JSC::JSImmediate::uintValue):
  5294. (JSC::JSImmediate::boolValue):
  5295. (JSC::JSImmediate::rawValue):
  5296. (JSC::JSImmediate::trueImmediate):
  5297. (JSC::JSImmediate::falseImmediate):
  5298. (JSC::JSImmediate::undefinedImmediate):
  5299. (JSC::JSImmediate::nullImmediate):
  5300. (JSC::JSImmediate::zeroImmediate):
  5301. (JSC::JSImmediate::oneImmediate):
  5302. (JSC::JSImmediate::impossibleValue):
  5303. (JSC::JSImmediate::toBoolean):
  5304. (JSC::JSImmediate::getTruncatedUInt32):
  5305. (JSC::JSImmediate::fromNumberOutsideIntegerRange):
  5306. (JSC::JSImmediate::from):
  5307. (JSC::JSImmediate::getTruncatedInt32):
  5308. (JSC::JSImmediate::toDouble):
  5309. (JSC::JSImmediate::getUInt32):
  5310. (JSC::JSValue::JSValue):
  5311. (JSC::JSValue::isUndefinedOrNull):
  5312. (JSC::JSValue::isBoolean):
  5313. (JSC::JSValue::getBoolean):
  5314. (JSC::JSValue::toInt32):
  5315. (JSC::JSValue::toUInt32):
  5316. (JSC::JSValue::isCell):
  5317. (JSC::JSValue::isInt32Fast):
  5318. (JSC::JSValue::getInt32Fast):
  5319. (JSC::JSValue::isUInt32Fast):
  5320. (JSC::JSValue::getUInt32Fast):
  5321. (JSC::JSValue::makeInt32Fast):
  5322. (JSC::JSValue::areBothInt32Fast):
  5323. (JSC::JSFastMath::canDoFastBitwiseOperations):
  5324. (JSC::JSFastMath::equal):
  5325. (JSC::JSFastMath::notEqual):
  5326. (JSC::JSFastMath::andImmediateNumbers):
  5327. (JSC::JSFastMath::xorImmediateNumbers):
  5328. (JSC::JSFastMath::orImmediateNumbers):
  5329. (JSC::JSFastMath::canDoFastRshift):
  5330. (JSC::JSFastMath::canDoFastUrshift):
  5331. (JSC::JSFastMath::rightShiftImmediateNumbers):
  5332. (JSC::JSFastMath::canDoFastAdditiveOperations):
  5333. (JSC::JSFastMath::addImmediateNumbers):
  5334. (JSC::JSFastMath::subImmediateNumbers):
  5335. (JSC::JSFastMath::incImmediateNumber):
  5336. (JSC::JSFastMath::decImmediateNumber):
  5337. * runtime/JSNotAnObject.cpp:
  5338. (JSC::JSNotAnObject::toPrimitive):
  5339. (JSC::JSNotAnObject::getPrimitiveNumber):
  5340. (JSC::JSNotAnObject::put):
  5341. * runtime/JSNotAnObject.h:
  5342. (JSC::JSNotAnObject::createStructure):
  5343. * runtime/JSNumberCell.cpp:
  5344. (JSC::JSNumberCell::toPrimitive):
  5345. (JSC::JSNumberCell::getPrimitiveNumber):
  5346. (JSC::JSNumberCell::getJSNumber):
  5347. (JSC::jsNumberCell):
  5348. * runtime/JSNumberCell.h:
  5349. (JSC::JSNumberCell::createStructure):
  5350. (JSC::isNumberCell):
  5351. (JSC::asNumberCell):
  5352. (JSC::jsNumber):
  5353. (JSC::JSValue::isDoubleNumber):
  5354. (JSC::JSValue::getDoubleNumber):
  5355. (JSC::JSValue::isNumber):
  5356. (JSC::JSValue::uncheckedGetNumber):
  5357. (JSC::jsNaN):
  5358. (JSC::JSValue::toJSNumber):
  5359. (JSC::JSValue::getNumber):
  5360. (JSC::JSValue::numberToInt32):
  5361. (JSC::JSValue::numberToUInt32):
  5362. * runtime/JSObject.cpp:
  5363. (JSC::JSObject::mark):
  5364. (JSC::JSObject::put):
  5365. (JSC::JSObject::putWithAttributes):
  5366. (JSC::callDefaultValueFunction):
  5367. (JSC::JSObject::getPrimitiveNumber):
  5368. (JSC::JSObject::defaultValue):
  5369. (JSC::JSObject::defineGetter):
  5370. (JSC::JSObject::defineSetter):
  5371. (JSC::JSObject::lookupGetter):
  5372. (JSC::JSObject::lookupSetter):
  5373. (JSC::JSObject::hasInstance):
  5374. (JSC::JSObject::toNumber):
  5375. (JSC::JSObject::toString):
  5376. (JSC::JSObject::fillGetterPropertySlot):
  5377. * runtime/JSObject.h:
  5378. (JSC::JSObject::getDirect):
  5379. (JSC::JSObject::getDirectLocation):
  5380. (JSC::JSObject::offsetForLocation):
  5381. (JSC::JSObject::locationForOffset):
  5382. (JSC::JSObject::getDirectOffset):
  5383. (JSC::JSObject::putDirectOffset):
  5384. (JSC::JSObject::createStructure):
  5385. (JSC::asObject):
  5386. (JSC::JSObject::prototype):
  5387. (JSC::JSObject::setPrototype):
  5388. (JSC::JSValue::isObject):
  5389. (JSC::JSObject::inlineGetOwnPropertySlot):
  5390. (JSC::JSObject::getOwnPropertySlotForWrite):
  5391. (JSC::JSObject::getPropertySlot):
  5392. (JSC::JSObject::get):
  5393. (JSC::JSObject::putDirect):
  5394. (JSC::JSObject::putDirectWithoutTransition):
  5395. (JSC::JSObject::toPrimitive):
  5396. (JSC::JSValue::get):
  5397. (JSC::JSValue::put):
  5398. (JSC::JSObject::allocatePropertyStorageInline):
  5399. * runtime/JSPropertyNameIterator.cpp:
  5400. (JSC::JSPropertyNameIterator::toPrimitive):
  5401. (JSC::JSPropertyNameIterator::getPrimitiveNumber):
  5402. * runtime/JSPropertyNameIterator.h:
  5403. (JSC::JSPropertyNameIterator::create):
  5404. (JSC::JSPropertyNameIterator::next):
  5405. * runtime/JSStaticScopeObject.cpp:
  5406. (JSC::JSStaticScopeObject::put):
  5407. (JSC::JSStaticScopeObject::putWithAttributes):
  5408. * runtime/JSStaticScopeObject.h:
  5409. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  5410. (JSC::JSStaticScopeObject::createStructure):
  5411. * runtime/JSString.cpp:
  5412. (JSC::JSString::toPrimitive):
  5413. (JSC::JSString::getPrimitiveNumber):
  5414. (JSC::JSString::getOwnPropertySlot):
  5415. * runtime/JSString.h:
  5416. (JSC::JSString::createStructure):
  5417. (JSC::asString):
  5418. (JSC::isJSString):
  5419. (JSC::JSValue::toThisJSString):
  5420. * runtime/JSValue.cpp:
  5421. (JSC::JSValue::toInteger):
  5422. (JSC::JSValue::toIntegerPreserveNaN):
  5423. * runtime/JSValue.h:
  5424. (JSC::JSValue::makeImmediate):
  5425. (JSC::JSValue::asValue):
  5426. (JSC::noValue):
  5427. (JSC::jsImpossibleValue):
  5428. (JSC::jsNull):
  5429. (JSC::jsUndefined):
  5430. (JSC::jsBoolean):
  5431. (JSC::operator==):
  5432. (JSC::operator!=):
  5433. (JSC::JSValue::encode):
  5434. (JSC::JSValue::decode):
  5435. (JSC::JSValue::JSValue):
  5436. (JSC::JSValue::operator bool):
  5437. (JSC::JSValue::operator==):
  5438. (JSC::JSValue::operator!=):
  5439. (JSC::JSValue::isUndefined):
  5440. (JSC::JSValue::isNull):
  5441. * runtime/JSVariableObject.h:
  5442. (JSC::JSVariableObject::symbolTablePut):
  5443. (JSC::JSVariableObject::symbolTablePutWithAttributes):
  5444. * runtime/JSWrapperObject.h:
  5445. (JSC::JSWrapperObject::internalValue):
  5446. (JSC::JSWrapperObject::setInternalValue):
  5447. * runtime/Lookup.cpp:
  5448. (JSC::setUpStaticFunctionSlot):
  5449. * runtime/Lookup.h:
  5450. (JSC::lookupPut):
  5451. * runtime/MathObject.cpp:
  5452. (JSC::mathProtoFuncAbs):
  5453. (JSC::mathProtoFuncACos):
  5454. (JSC::mathProtoFuncASin):
  5455. (JSC::mathProtoFuncATan):
  5456. (JSC::mathProtoFuncATan2):
  5457. (JSC::mathProtoFuncCeil):
  5458. (JSC::mathProtoFuncCos):
  5459. (JSC::mathProtoFuncExp):
  5460. (JSC::mathProtoFuncFloor):
  5461. (JSC::mathProtoFuncLog):
  5462. (JSC::mathProtoFuncMax):
  5463. (JSC::mathProtoFuncMin):
  5464. (JSC::mathProtoFuncPow):
  5465. (JSC::mathProtoFuncRandom):
  5466. (JSC::mathProtoFuncRound):
  5467. (JSC::mathProtoFuncSin):
  5468. (JSC::mathProtoFuncSqrt):
  5469. (JSC::mathProtoFuncTan):
  5470. * runtime/MathObject.h:
  5471. (JSC::MathObject::createStructure):
  5472. * runtime/NativeErrorConstructor.cpp:
  5473. (JSC::callNativeErrorConstructor):
  5474. * runtime/NumberConstructor.cpp:
  5475. (JSC::numberConstructorNaNValue):
  5476. (JSC::numberConstructorNegInfinity):
  5477. (JSC::numberConstructorPosInfinity):
  5478. (JSC::numberConstructorMaxValue):
  5479. (JSC::numberConstructorMinValue):
  5480. (JSC::callNumberConstructor):
  5481. * runtime/NumberConstructor.h:
  5482. (JSC::NumberConstructor::createStructure):
  5483. * runtime/NumberObject.cpp:
  5484. (JSC::NumberObject::getJSNumber):
  5485. (JSC::constructNumber):
  5486. * runtime/NumberObject.h:
  5487. * runtime/NumberPrototype.cpp:
  5488. (JSC::numberProtoFuncToString):
  5489. (JSC::numberProtoFuncToLocaleString):
  5490. (JSC::numberProtoFuncValueOf):
  5491. (JSC::numberProtoFuncToFixed):
  5492. (JSC::numberProtoFuncToExponential):
  5493. (JSC::numberProtoFuncToPrecision):
  5494. * runtime/ObjectConstructor.cpp:
  5495. (JSC::constructObject):
  5496. (JSC::callObjectConstructor):
  5497. * runtime/ObjectPrototype.cpp:
  5498. (JSC::objectProtoFuncValueOf):
  5499. (JSC::objectProtoFuncHasOwnProperty):
  5500. (JSC::objectProtoFuncIsPrototypeOf):
  5501. (JSC::objectProtoFuncDefineGetter):
  5502. (JSC::objectProtoFuncDefineSetter):
  5503. (JSC::objectProtoFuncLookupGetter):
  5504. (JSC::objectProtoFuncLookupSetter):
  5505. (JSC::objectProtoFuncPropertyIsEnumerable):
  5506. (JSC::objectProtoFuncToLocaleString):
  5507. (JSC::objectProtoFuncToString):
  5508. * runtime/ObjectPrototype.h:
  5509. * runtime/Operations.cpp:
  5510. (JSC::JSValue::equalSlowCase):
  5511. (JSC::JSValue::strictEqualSlowCase):
  5512. (JSC::throwOutOfMemoryError):
  5513. (JSC::jsAddSlowCase):
  5514. (JSC::jsTypeStringForValue):
  5515. (JSC::jsIsObjectType):
  5516. (JSC::jsIsFunctionType):
  5517. * runtime/Operations.h:
  5518. (JSC::JSValue::equal):
  5519. (JSC::JSValue::equalSlowCaseInline):
  5520. (JSC::JSValue::strictEqual):
  5521. (JSC::JSValue::strictEqualSlowCaseInline):
  5522. (JSC::jsLess):
  5523. (JSC::jsLessEq):
  5524. (JSC::jsAdd):
  5525. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  5526. (JSC::resolveBase):
  5527. * runtime/PropertySlot.cpp:
  5528. (JSC::PropertySlot::functionGetter):
  5529. * runtime/PropertySlot.h:
  5530. (JSC::PropertySlot::PropertySlot):
  5531. (JSC::PropertySlot::getValue):
  5532. (JSC::PropertySlot::putValue):
  5533. (JSC::PropertySlot::setValueSlot):
  5534. (JSC::PropertySlot::setValue):
  5535. (JSC::PropertySlot::setCustom):
  5536. (JSC::PropertySlot::setCustomIndex):
  5537. (JSC::PropertySlot::slotBase):
  5538. (JSC::PropertySlot::setBase):
  5539. (JSC::PropertySlot::):
  5540. * runtime/Protect.h:
  5541. (JSC::gcProtect):
  5542. (JSC::gcUnprotect):
  5543. (JSC::ProtectedPtr::operator JSValue):
  5544. (JSC::ProtectedJSValue::ProtectedJSValue):
  5545. (JSC::ProtectedJSValue::get):
  5546. (JSC::ProtectedJSValue::operator JSValue):
  5547. (JSC::ProtectedJSValue::operator->):
  5548. (JSC::ProtectedJSValue::~ProtectedJSValue):
  5549. (JSC::ProtectedJSValue::operator=):
  5550. (JSC::operator==):
  5551. (JSC::operator!=):
  5552. * runtime/RegExpConstructor.cpp:
  5553. (JSC::RegExpConstructor::getBackref):
  5554. (JSC::RegExpConstructor::getLastParen):
  5555. (JSC::RegExpConstructor::getLeftContext):
  5556. (JSC::RegExpConstructor::getRightContext):
  5557. (JSC::regExpConstructorDollar1):
  5558. (JSC::regExpConstructorDollar2):
  5559. (JSC::regExpConstructorDollar3):
  5560. (JSC::regExpConstructorDollar4):
  5561. (JSC::regExpConstructorDollar5):
  5562. (JSC::regExpConstructorDollar6):
  5563. (JSC::regExpConstructorDollar7):
  5564. (JSC::regExpConstructorDollar8):
  5565. (JSC::regExpConstructorDollar9):
  5566. (JSC::regExpConstructorInput):
  5567. (JSC::regExpConstructorMultiline):
  5568. (JSC::regExpConstructorLastMatch):
  5569. (JSC::regExpConstructorLastParen):
  5570. (JSC::regExpConstructorLeftContext):
  5571. (JSC::regExpConstructorRightContext):
  5572. (JSC::RegExpConstructor::put):
  5573. (JSC::setRegExpConstructorInput):
  5574. (JSC::setRegExpConstructorMultiline):
  5575. (JSC::constructRegExp):
  5576. (JSC::callRegExpConstructor):
  5577. * runtime/RegExpConstructor.h:
  5578. (JSC::RegExpConstructor::createStructure):
  5579. (JSC::asRegExpConstructor):
  5580. * runtime/RegExpMatchesArray.h:
  5581. (JSC::RegExpMatchesArray::put):
  5582. * runtime/RegExpObject.cpp:
  5583. (JSC::regExpObjectGlobal):
  5584. (JSC::regExpObjectIgnoreCase):
  5585. (JSC::regExpObjectMultiline):
  5586. (JSC::regExpObjectSource):
  5587. (JSC::regExpObjectLastIndex):
  5588. (JSC::RegExpObject::put):
  5589. (JSC::setRegExpObjectLastIndex):
  5590. (JSC::RegExpObject::test):
  5591. (JSC::RegExpObject::exec):
  5592. (JSC::callRegExpObject):
  5593. * runtime/RegExpObject.h:
  5594. (JSC::RegExpObject::createStructure):
  5595. (JSC::asRegExpObject):
  5596. * runtime/RegExpPrototype.cpp:
  5597. (JSC::regExpProtoFuncTest):
  5598. (JSC::regExpProtoFuncExec):
  5599. (JSC::regExpProtoFuncCompile):
  5600. (JSC::regExpProtoFuncToString):
  5601. * runtime/StringConstructor.cpp:
  5602. (JSC::stringFromCharCodeSlowCase):
  5603. (JSC::stringFromCharCode):
  5604. (JSC::callStringConstructor):
  5605. * runtime/StringObject.cpp:
  5606. (JSC::StringObject::put):
  5607. * runtime/StringObject.h:
  5608. (JSC::StringObject::createStructure):
  5609. (JSC::asStringObject):
  5610. * runtime/StringObjectThatMasqueradesAsUndefined.h:
  5611. (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
  5612. * runtime/StringPrototype.cpp:
  5613. (JSC::stringProtoFuncReplace):
  5614. (JSC::stringProtoFuncToString):
  5615. (JSC::stringProtoFuncCharAt):
  5616. (JSC::stringProtoFuncCharCodeAt):
  5617. (JSC::stringProtoFuncConcat):
  5618. (JSC::stringProtoFuncIndexOf):
  5619. (JSC::stringProtoFuncLastIndexOf):
  5620. (JSC::stringProtoFuncMatch):
  5621. (JSC::stringProtoFuncSearch):
  5622. (JSC::stringProtoFuncSlice):
  5623. (JSC::stringProtoFuncSplit):
  5624. (JSC::stringProtoFuncSubstr):
  5625. (JSC::stringProtoFuncSubstring):
  5626. (JSC::stringProtoFuncToLowerCase):
  5627. (JSC::stringProtoFuncToUpperCase):
  5628. (JSC::stringProtoFuncLocaleCompare):
  5629. (JSC::stringProtoFuncBig):
  5630. (JSC::stringProtoFuncSmall):
  5631. (JSC::stringProtoFuncBlink):
  5632. (JSC::stringProtoFuncBold):
  5633. (JSC::stringProtoFuncFixed):
  5634. (JSC::stringProtoFuncItalics):
  5635. (JSC::stringProtoFuncStrike):
  5636. (JSC::stringProtoFuncSub):
  5637. (JSC::stringProtoFuncSup):
  5638. (JSC::stringProtoFuncFontcolor):
  5639. (JSC::stringProtoFuncFontsize):
  5640. (JSC::stringProtoFuncAnchor):
  5641. (JSC::stringProtoFuncLink):
  5642. * runtime/Structure.cpp:
  5643. (JSC::Structure::Structure):
  5644. (JSC::Structure::changePrototypeTransition):
  5645. * runtime/Structure.h:
  5646. (JSC::Structure::create):
  5647. (JSC::Structure::setPrototypeWithoutTransition):
  5648. (JSC::Structure::storedPrototype):
  5649. 2009-05-01 Geoffrey Garen <ggaren@apple.com>
  5650. Reviewed by Sam "That doesn't look like what I thought it looks like" Weinig.
  5651. Beefed up the JSValuePtr class and removed some non-JSValuePtr dependencies
  5652. on JSImmediate, in prepapration for making JSImmediate an implementation
  5653. detail of JSValuePtr.
  5654. SunSpider reports no change.
  5655. * interpreter/Interpreter.cpp:
  5656. (JSC::Interpreter::privateExecute):
  5657. * jit/JIT.cpp:
  5658. (JSC::JIT::privateCompileMainPass):
  5659. * jit/JITArithmetic.cpp:
  5660. (JSC::JIT::compileFastArith_op_mod):
  5661. * runtime/JSGlobalObjectFunctions.cpp:
  5662. (JSC::globalFuncParseInt): Updated for interface changes.
  5663. * runtime/JSImmediate.h:
  5664. (JSC::JSValuePtr::JSValuePtr):
  5665. * runtime/JSValue.h:
  5666. (JSC::JSValuePtr::):
  5667. (JSC::jsImpossibleValue):
  5668. (JSC::jsNull):
  5669. (JSC::jsUndefined):
  5670. (JSC::jsBoolean):
  5671. (JSC::JSValuePtr::encode):
  5672. (JSC::JSValuePtr::decode):
  5673. (JSC::JSValuePtr::JSValuePtr):
  5674. (JSC::JSValuePtr::operator bool):
  5675. (JSC::JSValuePtr::operator==):
  5676. (JSC::JSValuePtr::operator!=):
  5677. (JSC::JSValuePtr::isUndefined):
  5678. (JSC::JSValuePtr::isNull): Changed jsImpossibleValue(), jsNull(),
  5679. jsUndefined(), and jsBoolean() to operate in terms of JSValuePtr instead
  5680. of JSImmediate.
  5681. * wtf/StdLibExtras.h:
  5682. (WTF::bitwise_cast): Fixed up for clarity.
  5683. 2009-04-30 Gavin Barraclough <barraclough@apple.com>
  5684. Reviewed by Geoff Garen.
  5685. Bug fix for rdar:/6845379. If a case-insensitive regex contains
  5686. a character class containing a range with an upper bound of \uFFFF
  5687. the parser will infinite-loop whist adding other-case characters
  5688. for characters in the range that do have another case.
  5689. * yarr/RegexCompiler.cpp:
  5690. (JSC::Yarr::CharacterClassConstructor::putRange):
  5691. 2009-04-30 Gavin Barraclough <barraclough@apple.com>
  5692. Reviewed by Oliver Hunt.
  5693. OPCODE_SAMPLING without CODEBLOCK_SAMPLING is currently broken,
  5694. since SamplingTool::Sample::isNull() checks the m_codeBlock
  5695. member (which is always null without CODEBLOCK_SAMPLING).
  5696. Restructure the checks so make this work again.
  5697. * bytecode/SamplingTool.cpp:
  5698. (JSC::SamplingTool::doRun):
  5699. * bytecode/SamplingTool.h:
  5700. (JSC::SamplingTool::Sample::isNull):
  5701. 2009-04-30 Maciej Stachowiak <mjs@apple.com>
  5702. Reviewed by Gavin Barraclough.
  5703. - Concatenate final three strings in simple replace case at one go
  5704. ~0.2% SunSpider speedup
  5705. * runtime/StringPrototype.cpp:
  5706. (JSC::stringProtoFuncReplace): Use new replaceRange helper instead of
  5707. taking substrings and concatenating three strings.
  5708. * runtime/UString.cpp:
  5709. (JSC::UString::replaceRange): New helper function.
  5710. * runtime/UString.h:
  5711. 2009-04-30 Geoffrey Garen <ggaren@apple.com>
  5712. Rubber Stamped by Gavin Barraclough.
  5713. Changed JSValueEncodedAsPtr* => EncodedJSValuePtr to support a non-pointer
  5714. encoding for JSValuePtrs.
  5715. * API/APICast.h:
  5716. (toJS):
  5717. * bytecompiler/BytecodeGenerator.h:
  5718. (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
  5719. (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  5720. * interpreter/Register.h:
  5721. (JSC::Register::):
  5722. * jit/JIT.cpp:
  5723. (JSC::):
  5724. * jit/JIT.h:
  5725. * jit/JITCode.h:
  5726. (JSC::):
  5727. * jit/JITStubs.cpp:
  5728. (JSC::JITStubs::cti_op_add):
  5729. (JSC::JITStubs::cti_op_pre_inc):
  5730. (JSC::JITStubs::cti_op_get_by_id_generic):
  5731. (JSC::JITStubs::cti_op_get_by_id):
  5732. (JSC::JITStubs::cti_op_get_by_id_second):
  5733. (JSC::JITStubs::cti_op_get_by_id_self_fail):
  5734. (JSC::JITStubs::cti_op_get_by_id_proto_list):
  5735. (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
  5736. (JSC::JITStubs::cti_op_get_by_id_proto_fail):
  5737. (JSC::JITStubs::cti_op_get_by_id_array_fail):
  5738. (JSC::JITStubs::cti_op_get_by_id_string_fail):
  5739. (JSC::JITStubs::cti_op_instanceof):
  5740. (JSC::JITStubs::cti_op_del_by_id):
  5741. (JSC::JITStubs::cti_op_mul):
  5742. (JSC::JITStubs::cti_op_call_NotJSFunction):
  5743. (JSC::JITStubs::cti_op_resolve):
  5744. (JSC::JITStubs::cti_op_construct_NotJSConstruct):
  5745. (JSC::JITStubs::cti_op_get_by_val):
  5746. (JSC::JITStubs::cti_op_get_by_val_string):
  5747. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  5748. (JSC::JITStubs::cti_op_sub):
  5749. (JSC::JITStubs::cti_op_lesseq):
  5750. (JSC::JITStubs::cti_op_negate):
  5751. (JSC::JITStubs::cti_op_resolve_base):
  5752. (JSC::JITStubs::cti_op_resolve_skip):
  5753. (JSC::JITStubs::cti_op_resolve_global):
  5754. (JSC::JITStubs::cti_op_div):
  5755. (JSC::JITStubs::cti_op_pre_dec):
  5756. (JSC::JITStubs::cti_op_not):
  5757. (JSC::JITStubs::cti_op_eq):
  5758. (JSC::JITStubs::cti_op_lshift):
  5759. (JSC::JITStubs::cti_op_bitand):
  5760. (JSC::JITStubs::cti_op_rshift):
  5761. (JSC::JITStubs::cti_op_bitnot):
  5762. (JSC::JITStubs::cti_op_mod):
  5763. (JSC::JITStubs::cti_op_less):
  5764. (JSC::JITStubs::cti_op_neq):
  5765. (JSC::JITStubs::cti_op_urshift):
  5766. (JSC::JITStubs::cti_op_bitxor):
  5767. (JSC::JITStubs::cti_op_bitor):
  5768. (JSC::JITStubs::cti_op_call_eval):
  5769. (JSC::JITStubs::cti_op_throw):
  5770. (JSC::JITStubs::cti_op_next_pname):
  5771. (JSC::JITStubs::cti_op_typeof):
  5772. (JSC::JITStubs::cti_op_is_undefined):
  5773. (JSC::JITStubs::cti_op_is_boolean):
  5774. (JSC::JITStubs::cti_op_is_number):
  5775. (JSC::JITStubs::cti_op_is_string):
  5776. (JSC::JITStubs::cti_op_is_object):
  5777. (JSC::JITStubs::cti_op_is_function):
  5778. (JSC::JITStubs::cti_op_stricteq):
  5779. (JSC::JITStubs::cti_op_nstricteq):
  5780. (JSC::JITStubs::cti_op_to_jsnumber):
  5781. (JSC::JITStubs::cti_op_in):
  5782. (JSC::JITStubs::cti_op_del_by_val):
  5783. (JSC::JITStubs::cti_vm_throw):
  5784. * jit/JITStubs.h:
  5785. * runtime/JSValue.h:
  5786. (JSC::JSValuePtr::encode):
  5787. (JSC::JSValuePtr::decode):
  5788. 2009-04-30 Gavin Barraclough <barraclough@apple.com>
  5789. Reviewed by Oliver "Abandon Ship!" Hunt.
  5790. Fix a leak in Yarr.
  5791. All Disjunctions should be recorded in RegexPattern::m_disjunctions,
  5792. so that they can be freed at the end of compilation - copyDisjunction
  5793. is failing to do so.
  5794. * yarr/RegexCompiler.cpp:
  5795. (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
  5796. 2009-04-30 Oliver Hunt <oliver@apple.com>
  5797. Reviewed by Gavin Barraclough.
  5798. Add function to CallFrame for dumping the current JS caller
  5799. Added debug only method CallFrame::dumpCaller() that provide the call location
  5800. of the deepest currently executing JS function.
  5801. * interpreter/CallFrame.cpp:
  5802. (JSC::CallFrame::dumpCaller):
  5803. * interpreter/CallFrame.h:
  5804. 2009-04-30 Maciej Stachowiak <mjs@apple.com>
  5805. Reviewed by Geoff Garen.
  5806. - make BaseStrings have themselves as a base, instead of nothing, to remove common branches
  5807. ~0.7% SunSpider speedup
  5808. * runtime/UString.h:
  5809. (JSC::UString::Rep::Rep): For the constructor without a base, set self as base instead of null.
  5810. (JSC::UString::Rep::baseString): Just read m_baseString - no more branching.
  5811. 2009-04-30 Gavin Barraclough <barraclough@apple.com>
  5812. Reviewed by Oliver Hunt.
  5813. Two quick improvements to SamplingFlags mechanism.
  5814. SamplingFlags::ScopedFlag class to provide support for automagically
  5815. clearing a flag as it goes out of scope, and add a little more detail
  5816. to the output generated by the tool.
  5817. * bytecode/SamplingTool.cpp:
  5818. (JSC::SamplingFlags::stop):
  5819. * bytecode/SamplingTool.h:
  5820. (JSC::SamplingFlags::ScopedFlag::ScopedFlag):
  5821. (JSC::SamplingFlags::ScopedFlag::~ScopedFlag):
  5822. 2009-04-30 Adam Roben <aroben@apple.com>
  5823. Restore build event steps that were truncated in r43082
  5824. Rubber-stamped by Steve Falkenburg.
  5825. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
  5826. * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
  5827. * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops:
  5828. Re-copied the command lines for the build events from the pre-r43082
  5829. .vcproj files.
  5830. * JavaScriptCore.vcproj/jsc/jsc.vcproj: Removed an unnecessary
  5831. attribute.
  5832. 2009-04-30 Adam Roben <aroben@apple.com>
  5833. Move settings from .vcproj files to .vsprops files within the
  5834. JavaScriptCore directory
  5835. Moving the settings to a .vsprops file means that we will only have to
  5836. change a single setting to affect all configurations, instead of one
  5837. setting per configuration.
  5838. Reviewed by Steve Falkenburg.
  5839. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5840. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  5841. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  5842. * JavaScriptCore.vcproj/testapi/testapi.vcproj:
  5843. Moved settings from these files to the new .vsprops files. Note that
  5844. testapi.vcproj had a lot of overrides of default settings that were
  5845. the same as the defaults, which I've removed.
  5846. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added.
  5847. * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added.
  5848. * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added.
  5849. * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added.
  5850. 2009-04-30 Dimitri Glazkov <dglazkov@chromium.org>
  5851. Reviewed by Timothy Hatcher.
  5852. https://bugs.webkit.org/show_bug.cgi?id=25470
  5853. Extend the cover of ENABLE_JAVASCRIPT_DEBUGGER to profiler.
  5854. * Configurations/FeatureDefines.xcconfig: Added ENABLE_JAVASCRIPT_DEBUGGER define.
  5855. 2009-04-30 Maciej Stachowiak <mjs@apple.com>
  5856. Reviewed by Alexey Proskuryakov.
  5857. - speed up string concatenation by reorganizing some simple cases
  5858. 0.7% SunSpider speedup
  5859. * runtime/UString.cpp:
  5860. (JSC::concatenate): Put fast case for appending a single character
  5861. before the empty string special cases; streamline code a bit to
  5862. delay computing values that are not needed in the fast path.
  5863. 2009-04-30 Gavin Barraclough <barraclough@apple.com>
  5864. Reviewed by Maciej Stachowiak.
  5865. Add SamplingFlags mechanism.
  5866. This mechanism allows fine-grained JSC and JavaScript program aware
  5867. performance measurement. The mechanism provides a set of 32 flags,
  5868. numbered #1..#32. Flag #16 is initially set, and all other flags
  5869. are cleared. Flags may be set and cleared from within
  5870. Enable by setting ENABLE_SAMPLING_FLAGS to 1 in wtf/Platform.h.
  5871. Disabled by default, no performance impact. Flags may be modified
  5872. by calling SamplingFlags::setFlag() and SamplingFlags::clearFlag()
  5873. from within JSC implementation, or by calling setSamplingFlag() and
  5874. clearSamplingFlag() from JavaScript.
  5875. The flags are sampled with a frequency of 10000Hz, and the highest
  5876. set flag in recorded, allowing multiple events to be measured (with
  5877. the highest flag number representing the highest priority).
  5878. Disabled by default; no performance impact.
  5879. * JavaScriptCore.exp:
  5880. * bytecode/SamplingTool.cpp:
  5881. (JSC::SamplingFlags::sample):
  5882. (JSC::SamplingFlags::start):
  5883. (JSC::SamplingFlags::stop):
  5884. (JSC::SamplingThread::threadStartFunc):
  5885. (JSC::SamplingThread::start):
  5886. (JSC::SamplingThread::stop):
  5887. (JSC::ScopeSampleRecord::sample):
  5888. (JSC::SamplingTool::doRun):
  5889. (JSC::SamplingTool::sample):
  5890. (JSC::SamplingTool::start):
  5891. (JSC::SamplingTool::stop):
  5892. * bytecode/SamplingTool.h:
  5893. (JSC::SamplingFlags::setFlag):
  5894. (JSC::SamplingFlags::clearFlag):
  5895. (JSC::SamplingTool::SamplingTool):
  5896. * jsc.cpp:
  5897. (GlobalObject::GlobalObject):
  5898. (functionSetSamplingFlag):
  5899. (functionClearSamplingFlag):
  5900. (runWithScripts):
  5901. * wtf/Platform.h:
  5902. 2009-04-29 Sam Weinig <sam@webkit.org>
  5903. Another attempt to fix the windows build.
  5904. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  5905. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  5906. 2009-04-29 Sam Weinig <sam@webkit.org>
  5907. Try and fix the windows build.
  5908. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  5909. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  5910. 2009-04-29 Gavin Barraclough <barraclough@apple.com>
  5911. Reviewed by Oliver "Peg-Leg" Hunt.
  5912. Coallesce input checking and reduce futzing with the index position
  5913. between alternatives and iterations of the main loop of a regex,
  5914. when run in YARR.
  5915. Consider the following regex: /foo|bar/
  5916. Prior to this patch, this will be implemented something like this pseudo-code description:
  5917. loop:
  5918. check_for_available_input(3) // this increments the index by 3, for the first alterantive.
  5919. if (available) { test "foo" }
  5920. decrement_index(3)
  5921. check_for_available_input(3) // this increments the index by 3, for the second alterantive.
  5922. if (available) { test "bar" }
  5923. decrement_index(3)
  5924. check_for_available_input(1) // can we loop again?
  5925. if (available) { goto loop }
  5926. With these changes it will look more like this:
  5927. check_for_available_input(3) // this increments the index by 3, for the first alterantive.
  5928. if (!available) { goto fail }
  5929. loop:
  5930. test "foo"
  5931. test "bar"
  5932. check_for_available_input(1) // can we loop again?
  5933. if (available) { goto loop }
  5934. fail:
  5935. This gives about a 5% gain on v8-regex, no change on Sunspider.
  5936. * yarr/RegexJIT.cpp:
  5937. (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracksTo):
  5938. (JSC::Yarr::RegexGenerator::generateDisjunction):
  5939. 2009-04-29 Oliver Hunt <oliver@apple.com>
  5940. Reviewed by Gavin Barraclough.
  5941. Clean up ArgList to be a trivial type
  5942. Separate out old ArgList logic to handle buffering and marking arguments
  5943. into a distinct MarkedArgumentBuffer type. ArgList becomes a trivial
  5944. struct of a pointer and length.
  5945. * API/JSObjectRef.cpp:
  5946. (JSObjectMakeFunction):
  5947. (JSObjectMakeArray):
  5948. (JSObjectMakeDate):
  5949. (JSObjectMakeError):
  5950. (JSObjectMakeRegExp):
  5951. (JSObjectCallAsFunction):
  5952. (JSObjectCallAsConstructor):
  5953. * JavaScriptCore.exp:
  5954. * interpreter/CallFrame.h:
  5955. (JSC::ExecState::emptyList):
  5956. * runtime/ArgList.cpp:
  5957. (JSC::ArgList::getSlice):
  5958. (JSC::MarkedArgumentBuffer::markLists):
  5959. (JSC::MarkedArgumentBuffer::slowAppend):
  5960. * runtime/ArgList.h:
  5961. (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
  5962. (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
  5963. (JSC::ArgList::ArgList):
  5964. (JSC::ArgList::at):
  5965. (JSC::ArgList::isEmpty):
  5966. (JSC::ArgList::size):
  5967. (JSC::ArgList::begin):
  5968. (JSC::ArgList::end):
  5969. * runtime/Arguments.cpp:
  5970. (JSC::Arguments::fillArgList):
  5971. * runtime/Arguments.h:
  5972. * runtime/ArrayPrototype.cpp:
  5973. (JSC::arrayProtoFuncConcat):
  5974. (JSC::arrayProtoFuncPush):
  5975. (JSC::arrayProtoFuncSort):
  5976. (JSC::arrayProtoFuncFilter):
  5977. (JSC::arrayProtoFuncMap):
  5978. (JSC::arrayProtoFuncEvery):
  5979. (JSC::arrayProtoFuncForEach):
  5980. (JSC::arrayProtoFuncSome):
  5981. (JSC::arrayProtoFuncReduce):
  5982. (JSC::arrayProtoFuncReduceRight):
  5983. * runtime/Collector.cpp:
  5984. (JSC::Heap::collect):
  5985. * runtime/Collector.h:
  5986. (JSC::Heap::markListSet):
  5987. * runtime/CommonIdentifiers.h:
  5988. * runtime/Error.cpp:
  5989. (JSC::Error::create):
  5990. * runtime/FunctionPrototype.cpp:
  5991. (JSC::functionProtoFuncApply):
  5992. * runtime/JSArray.cpp:
  5993. (JSC::JSArray::JSArray):
  5994. (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
  5995. (JSC::JSArray::fillArgList):
  5996. (JSC::constructArray):
  5997. * runtime/JSArray.h:
  5998. * runtime/JSGlobalData.cpp:
  5999. (JSC::JSGlobalData::JSGlobalData):
  6000. * runtime/JSGlobalData.h:
  6001. * runtime/JSObject.cpp:
  6002. (JSC::JSObject::put):
  6003. * runtime/StringConstructor.cpp:
  6004. (JSC::stringFromCharCodeSlowCase):
  6005. * runtime/StringPrototype.cpp:
  6006. (JSC::stringProtoFuncReplace):
  6007. (JSC::stringProtoFuncConcat):
  6008. (JSC::stringProtoFuncMatch):
  6009. 2009-04-29 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  6010. Reviewed by Sam Weinig.
  6011. https://bugs.webkit.org/show_bug.cgi?id=25334
  6012. Fix Qt build when ENABLE_JIT is explicitly set to 1
  6013. to overrule defaults.
  6014. * JavaScriptCore.pri:
  6015. 2009-04-29 Oliver Hunt <oliver@apple.com>
  6016. Reviewed by Steve Falkenburg.
  6017. Crash in profiler due to incorrect assuming displayName would be a string.
  6018. Fixed by adding a type guard.
  6019. * runtime/InternalFunction.cpp:
  6020. (JSC::InternalFunction::displayName):
  6021. 2009-04-28 Geoffrey Garen <ggaren@apple.com>
  6022. Rubber stamped by Beth Dakin.
  6023. Removed scaffolding supporting dynamically converting between 32bit and
  6024. 64bit value representations.
  6025. * API/JSCallbackConstructor.cpp:
  6026. (JSC::constructJSCallback):
  6027. * API/JSCallbackFunction.cpp:
  6028. (JSC::JSCallbackFunction::call):
  6029. * API/JSCallbackObjectFunctions.h:
  6030. (JSC::::construct):
  6031. (JSC::::call):
  6032. * bytecode/CodeBlock.cpp:
  6033. (JSC::CodeBlock::dump):
  6034. * bytecode/CodeBlock.h:
  6035. (JSC::CodeBlock::getConstant):
  6036. * bytecompiler/BytecodeGenerator.cpp:
  6037. (JSC::BytecodeGenerator::emitEqualityOp):
  6038. * interpreter/CallFrame.cpp:
  6039. (JSC::CallFrame::thisValue):
  6040. * interpreter/Interpreter.cpp:
  6041. (JSC::Interpreter::callEval):
  6042. (JSC::Interpreter::throwException):
  6043. (JSC::Interpreter::createExceptionScope):
  6044. (JSC::Interpreter::privateExecute):
  6045. (JSC::Interpreter::retrieveArguments):
  6046. * interpreter/Register.h:
  6047. (JSC::Register::):
  6048. (JSC::Register::Register):
  6049. (JSC::Register::jsValue):
  6050. (JSC::Register::marked):
  6051. (JSC::Register::mark):
  6052. (JSC::Register::i):
  6053. (JSC::Register::activation):
  6054. (JSC::Register::arguments):
  6055. (JSC::Register::callFrame):
  6056. (JSC::Register::codeBlock):
  6057. (JSC::Register::function):
  6058. (JSC::Register::propertyNameIterator):
  6059. (JSC::Register::scopeChain):
  6060. (JSC::Register::vPC):
  6061. * jit/JITStubs.cpp:
  6062. (JSC::JITStubs::cti_op_call_NotJSFunction):
  6063. (JSC::JITStubs::cti_op_load_varargs):
  6064. (JSC::JITStubs::cti_op_call_eval):
  6065. * jsc.cpp:
  6066. (functionPrint):
  6067. (functionDebug):
  6068. (functionRun):
  6069. (functionLoad):
  6070. * runtime/ArgList.h:
  6071. (JSC::ArgList::at):
  6072. * runtime/Arguments.cpp:
  6073. (JSC::Arguments::copyToRegisters):
  6074. (JSC::Arguments::fillArgList):
  6075. (JSC::Arguments::getOwnPropertySlot):
  6076. * runtime/ArrayConstructor.cpp:
  6077. (JSC::constructArrayWithSizeQuirk):
  6078. * runtime/ArrayPrototype.cpp:
  6079. (JSC::arrayProtoFuncJoin):
  6080. (JSC::arrayProtoFuncConcat):
  6081. (JSC::arrayProtoFuncPush):
  6082. (JSC::arrayProtoFuncSlice):
  6083. (JSC::arrayProtoFuncSort):
  6084. (JSC::arrayProtoFuncSplice):
  6085. (JSC::arrayProtoFuncUnShift):
  6086. (JSC::arrayProtoFuncFilter):
  6087. (JSC::arrayProtoFuncMap):
  6088. (JSC::arrayProtoFuncEvery):
  6089. (JSC::arrayProtoFuncForEach):
  6090. (JSC::arrayProtoFuncSome):
  6091. (JSC::arrayProtoFuncReduce):
  6092. (JSC::arrayProtoFuncReduceRight):
  6093. (JSC::arrayProtoFuncIndexOf):
  6094. (JSC::arrayProtoFuncLastIndexOf):
  6095. * runtime/BooleanConstructor.cpp:
  6096. (JSC::constructBoolean):
  6097. (JSC::callBooleanConstructor):
  6098. * runtime/DateConstructor.cpp:
  6099. (JSC::constructDate):
  6100. (JSC::dateParse):
  6101. (JSC::dateUTC):
  6102. * runtime/DatePrototype.cpp:
  6103. (JSC::formatLocaleDate):
  6104. (JSC::fillStructuresUsingTimeArgs):
  6105. (JSC::fillStructuresUsingDateArgs):
  6106. (JSC::dateProtoFuncSetTime):
  6107. (JSC::dateProtoFuncSetYear):
  6108. * runtime/ErrorConstructor.cpp:
  6109. (JSC::constructError):
  6110. * runtime/FunctionConstructor.cpp:
  6111. (JSC::constructFunction):
  6112. * runtime/FunctionPrototype.cpp:
  6113. (JSC::functionProtoFuncApply):
  6114. (JSC::functionProtoFuncCall):
  6115. * runtime/JSArray.cpp:
  6116. (JSC::JSArray::JSArray):
  6117. (JSC::constructArray):
  6118. * runtime/JSArray.h:
  6119. * runtime/JSGlobalObjectFunctions.cpp:
  6120. (JSC::encode):
  6121. (JSC::decode):
  6122. (JSC::globalFuncEval):
  6123. (JSC::globalFuncParseInt):
  6124. (JSC::globalFuncParseFloat):
  6125. (JSC::globalFuncIsNaN):
  6126. (JSC::globalFuncIsFinite):
  6127. (JSC::globalFuncEscape):
  6128. (JSC::globalFuncUnescape):
  6129. (JSC::globalFuncJSCPrint):
  6130. * runtime/MathObject.cpp:
  6131. (JSC::mathProtoFuncAbs):
  6132. (JSC::mathProtoFuncACos):
  6133. (JSC::mathProtoFuncASin):
  6134. (JSC::mathProtoFuncATan):
  6135. (JSC::mathProtoFuncATan2):
  6136. (JSC::mathProtoFuncCeil):
  6137. (JSC::mathProtoFuncCos):
  6138. (JSC::mathProtoFuncExp):
  6139. (JSC::mathProtoFuncFloor):
  6140. (JSC::mathProtoFuncLog):
  6141. (JSC::mathProtoFuncMax):
  6142. (JSC::mathProtoFuncMin):
  6143. (JSC::mathProtoFuncPow):
  6144. (JSC::mathProtoFuncRound):
  6145. (JSC::mathProtoFuncSin):
  6146. (JSC::mathProtoFuncSqrt):
  6147. (JSC::mathProtoFuncTan):
  6148. * runtime/NativeErrorConstructor.cpp:
  6149. (JSC::NativeErrorConstructor::construct):
  6150. * runtime/NumberConstructor.cpp:
  6151. (JSC::constructWithNumberConstructor):
  6152. (JSC::callNumberConstructor):
  6153. * runtime/NumberPrototype.cpp:
  6154. (JSC::numberProtoFuncToString):
  6155. (JSC::numberProtoFuncToFixed):
  6156. (JSC::numberProtoFuncToExponential):
  6157. (JSC::numberProtoFuncToPrecision):
  6158. * runtime/ObjectConstructor.cpp:
  6159. (JSC::constructObject):
  6160. * runtime/ObjectPrototype.cpp:
  6161. (JSC::objectProtoFuncHasOwnProperty):
  6162. (JSC::objectProtoFuncIsPrototypeOf):
  6163. (JSC::objectProtoFuncDefineGetter):
  6164. (JSC::objectProtoFuncDefineSetter):
  6165. (JSC::objectProtoFuncLookupGetter):
  6166. (JSC::objectProtoFuncLookupSetter):
  6167. (JSC::objectProtoFuncPropertyIsEnumerable):
  6168. * runtime/PropertySlot.h:
  6169. (JSC::PropertySlot::getValue):
  6170. * runtime/RegExpConstructor.cpp:
  6171. (JSC::constructRegExp):
  6172. * runtime/RegExpObject.cpp:
  6173. (JSC::RegExpObject::match):
  6174. * runtime/RegExpPrototype.cpp:
  6175. (JSC::regExpProtoFuncCompile):
  6176. * runtime/StringConstructor.cpp:
  6177. (JSC::stringFromCharCodeSlowCase):
  6178. (JSC::stringFromCharCode):
  6179. (JSC::constructWithStringConstructor):
  6180. (JSC::callStringConstructor):
  6181. * runtime/StringPrototype.cpp:
  6182. (JSC::stringProtoFuncReplace):
  6183. (JSC::stringProtoFuncCharAt):
  6184. (JSC::stringProtoFuncCharCodeAt):
  6185. (JSC::stringProtoFuncConcat):
  6186. (JSC::stringProtoFuncIndexOf):
  6187. (JSC::stringProtoFuncLastIndexOf):
  6188. (JSC::stringProtoFuncMatch):
  6189. (JSC::stringProtoFuncSearch):
  6190. (JSC::stringProtoFuncSlice):
  6191. (JSC::stringProtoFuncSplit):
  6192. (JSC::stringProtoFuncSubstr):
  6193. (JSC::stringProtoFuncSubstring):
  6194. (JSC::stringProtoFuncLocaleCompare):
  6195. (JSC::stringProtoFuncFontcolor):
  6196. (JSC::stringProtoFuncFontsize):
  6197. (JSC::stringProtoFuncAnchor):
  6198. (JSC::stringProtoFuncLink):
  6199. 2009-04-28 David Kilzer <ddkilzer@apple.com>
  6200. A little more hardening for UString
  6201. Reviewed by Maciej Stachowiak.
  6202. Revised fix for <rdar://problem/5861045> in r42644.
  6203. * runtime/UString.cpp:
  6204. (JSC::newCapacityWithOverflowCheck): Added.
  6205. (JSC::concatenate): Used newCapacityWithOverflowCheck().
  6206. (JSC::UString::append): Ditto.
  6207. 2009-04-28 Oliver Hunt <oliver@apple.com>
  6208. Reviewed by Gavin Barraclough.
  6209. Bring back r42969, this time with correct codegen
  6210. Add logic to the codegen for right shift to avoid jumping to a helper function
  6211. when shifting a small floating point value.
  6212. * jit/JITArithmetic.cpp:
  6213. (isSSE2Present):
  6214. (JSC::JIT::compileFastArith_op_rshift):
  6215. (JSC::JIT::compileFastArithSlow_op_rshift):
  6216. 2009-04-28 Kevin Ollivier <kevino@theolliviers.com>
  6217. wxMSW build fix. Switch JSCore build back to static.
  6218. * API/JSBase.h:
  6219. * config.h:
  6220. * jscore.bkl:
  6221. 2009-04-28 Oliver Hunt <oliver@apple.com>
  6222. Reviewed by NOBODY (Build fix).
  6223. Roll out r42969, due to hangs in build bot.
  6224. * jit/JITArithmetic.cpp:
  6225. (JSC::JIT::compileFastArith_op_rshift):
  6226. (JSC::JIT::compileFastArithSlow_op_rshift):
  6227. (JSC::isSSE2Present):
  6228. 2009-04-28 Xan Lopez <xlopez@igalia.com>
  6229. Unreviewed: fix distcheck build, add (even more) missing files to list.
  6230. * GNUmakefile.am:
  6231. 2009-04-28 Oliver Hunt <oliver@apple.com>
  6232. Reviewed by Geoff Garen.
  6233. Improve performance of string indexing
  6234. Add a cti_get_by_val_string function to specialise indexing into a string object.
  6235. This gives us a slight performance win on a number of string tests.
  6236. * jit/JITStubs.cpp:
  6237. (JSC::JITStubs::cti_op_get_by_val):
  6238. (JSC::JITStubs::cti_op_get_by_val_string):
  6239. * jit/JITStubs.h:
  6240. 2009-04-28 Oliver Hunt <oliver@apple.com>
  6241. Reviewed by Geoff Garen.
  6242. Improve performance of right shifts of large or otherwise floating point values.
  6243. Add logic to the codegen for right shift to avoid jumping to a helper function
  6244. when shifting a small floating point value.
  6245. * jit/JITArithmetic.cpp:
  6246. (isSSE2Present): Moved to the head of file.
  6247. (JSC::JIT::compileFastArith_op_rshift):
  6248. (JSC::JIT::compileFastArithSlow_op_rshift):
  6249. 2009-04-28 Xan Lopez <xlopez@igalia.com>
  6250. Unreviewed: fix distcheck build, add (more) missing files to list.
  6251. * GNUmakefile.am:
  6252. 2009-04-28 Xan Lopez <xlopez@igalia.com>
  6253. Unreviewed: fix distcheck build, add missing header to file list.
  6254. * GNUmakefile.am:
  6255. 2009-04-28 Gavin Barraclough <barraclough@apple.com>
  6256. Rubber stamped by Maciej "Henry Morgan" Stachowiak.
  6257. Enable YARR.
  6258. (Again.)
  6259. * wtf/Platform.h:
  6260. 2009-04-27 Gavin Barraclough <barraclough@apple.com>
  6261. Reviewed by Maciej Stachowiak.
  6262. Tweak a loop condition to keep GCC happy,
  6263. some GCCs seem to be having issues with this. :-/
  6264. * bytecompiler/BytecodeGenerator.cpp:
  6265. (JSC::BytecodeGenerator::breakTarget):
  6266. * wtf/Platform.h:
  6267. 2009-04-27 Adam Roben <aroben@apple.com>
  6268. Windows Debug build fix
  6269. Not sure why the buildbots weren't affected by this problem.
  6270. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Let VS
  6271. re-order the file list, and added JavaScriptCore[_debug].def to the
  6272. project. This was not necessary for the fix, but made making the fix
  6273. easier.
  6274. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  6275. Removed a function that no longer exists.
  6276. 2009-04-26 Gavin Barraclough <barraclough@apple.com>
  6277. Reviewed by Weinig Sam.
  6278. Fix for https://bugs.webkit.org/show_bug.cgi?id=25416
  6279. "Cached prototype accesses unsafely hoist property storage load above structure checks."
  6280. Do not hoist the load of the pointer to the property storage array.
  6281. No performance impact.
  6282. * jit/JITPropertyAccess.cpp:
  6283. (JSC::JIT::privateCompileGetByIdProto):
  6284. (JSC::JIT::privateCompileGetByIdProtoList):
  6285. 2009-04-26 Gavin Barraclough <barraclough@apple.com>
  6286. Reviewed by Geoffrey "Gaffe or energy?" Garen.
  6287. Randomize address requested by ExecutableAllocatorFixedVMPool.
  6288. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6289. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6290. 2009-04-26 Sam Weinig <sam@webkit.org>
  6291. Reviewed by Eric Seidel.
  6292. Remove scons-based build system.
  6293. * JavaScriptCore.scons: Removed.
  6294. 2009-04-25 Oliver Hunt <oliver@apple.com>
  6295. Reviewed by NOBODY (Buildfix).
  6296. Make HAVE_MADV_FREE darwin only for now
  6297. * wtf/Platform.h:
  6298. 2009-04-25 Jan Michael Alonzo <jmalonzo@webkit.org>
  6299. Reviewed by Oliver Hunt.
  6300. Gtk build fix - check if we have MADV_FREE before using it.
  6301. * interpreter/RegisterFile.cpp:
  6302. (JSC::RegisterFile::releaseExcessCapacity):
  6303. * wtf/Platform.h:
  6304. 2009-04-24 Kevin Ollivier <kevino@theolliviers.com>
  6305. wx build fix. Switching JSCore from a static lib to a dynamic lib
  6306. to match the Apple build and fix symbol exports.
  6307. * jscore.bkl:
  6308. 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  6309. Rubber-stamped by Mark Rowe.
  6310. https://bugs.webkit.org/show_bug.cgi?id=25337
  6311. Move ThreadingQt.cpp under the qt directory.
  6312. * JavaScriptCore.pri:
  6313. * wtf/ThreadingQt.cpp: Removed.
  6314. * wtf/qt/ThreadingQt.cpp: Copied from JavaScriptCore/wtf/ThreadingQt.cpp.
  6315. 2009-04-24 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  6316. Rubber-stamped by Mark Rowe.
  6317. https://bugs.webkit.org/show_bug.cgi?id=25338
  6318. Move ThreadingGtk.cpp under the gtk directory.
  6319. * GNUmakefile.am:
  6320. * wtf/ThreadingGtk.cpp: Removed.
  6321. * wtf/gtk/ThreadingGtk.cpp: Copied from JavaScriptCore/wtf/ThreadingGtk.cpp.
  6322. 2009-04-24 Gavin Barraclough <barraclough@apple.com>
  6323. Reviewed by Sam "Wesley" Weinig.
  6324. Improve performance to YARR interpreter.
  6325. (From about 3x slower than PCRE on regex-dna to about 30% slower).
  6326. * yarr/RegexCompiler.cpp:
  6327. (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
  6328. * yarr/RegexInterpreter.cpp:
  6329. (JSC::Yarr::Interpreter::checkCharacter):
  6330. (JSC::Yarr::Interpreter::checkCasedCharacter):
  6331. (JSC::Yarr::Interpreter::backtrackPatternCharacter):
  6332. (JSC::Yarr::Interpreter::backtrackPatternCasedCharacter):
  6333. (JSC::Yarr::Interpreter::matchParentheticalAssertionBegin):
  6334. (JSC::Yarr::Interpreter::matchParentheticalAssertionEnd):
  6335. (JSC::Yarr::Interpreter::backtrackParentheticalAssertionBegin):
  6336. (JSC::Yarr::Interpreter::backtrackParentheticalAssertionEnd):
  6337. (JSC::Yarr::Interpreter::matchDisjunction):
  6338. (JSC::Yarr::Interpreter::interpret):
  6339. (JSC::Yarr::ByteCompiler::atomPatternCharacter):
  6340. (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
  6341. (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
  6342. (JSC::Yarr::ByteCompiler::closeAlternative):
  6343. (JSC::Yarr::ByteCompiler::closeBodyAlternative):
  6344. (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
  6345. (JSC::Yarr::ByteCompiler::regexBegin):
  6346. (JSC::Yarr::ByteCompiler::regexEnd):
  6347. (JSC::Yarr::ByteCompiler::alterantiveBodyDisjunction):
  6348. (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
  6349. (JSC::Yarr::ByteCompiler::emitDisjunction):
  6350. * yarr/RegexInterpreter.h:
  6351. (JSC::Yarr::ByteTerm::):
  6352. (JSC::Yarr::ByteTerm::ByteTerm):
  6353. (JSC::Yarr::ByteTerm::BodyAlternativeBegin):
  6354. (JSC::Yarr::ByteTerm::BodyAlternativeDisjunction):
  6355. (JSC::Yarr::ByteTerm::BodyAlternativeEnd):
  6356. (JSC::Yarr::ByteTerm::AlternativeBegin):
  6357. (JSC::Yarr::ByteTerm::AlternativeDisjunction):
  6358. (JSC::Yarr::ByteTerm::AlternativeEnd):
  6359. (JSC::Yarr::ByteTerm::SubpatternBegin):
  6360. (JSC::Yarr::ByteTerm::SubpatternEnd):
  6361. * yarr/RegexJIT.cpp:
  6362. (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
  6363. * yarr/RegexPattern.h:
  6364. 2009-04-24 Rob Raguet-Schofield <ragfield@gmail.com>
  6365. Rubber-stamped by Mark Rowe.
  6366. * wtf/CurrentTime.h: Fix a typo in a comment.
  6367. 2009-04-24 Oliver Hunt <oliver@apple.com>
  6368. Reviewed by NOBODY (Build fix).
  6369. Add reinterpret_cast
  6370. * interpreter/RegisterFile.cpp:
  6371. (JSC::RegisterFile::releaseExcessCapacity):
  6372. 2009-04-23 Oliver Hunt <oliver@apple.com>
  6373. Reviewed by Geoff Garen.
  6374. <rdar://problem/6050421> JavaScript register file should remap to release physical pages accumulated during deep recursion
  6375. We now track the maximum extent of the RegisterFile, and when we reach the final
  6376. return from JS (so the stack portion of the registerfile becomes empty) we see
  6377. if that extent is greater than maxExcessCapacity. If it is we use madvise or
  6378. VirtualFree to release the physical pages that were backing the excess.
  6379. * interpreter/RegisterFile.cpp:
  6380. (JSC::RegisterFile::releaseExcessCapacity):
  6381. * interpreter/RegisterFile.h:
  6382. (JSC::RegisterFile::RegisterFile):
  6383. (JSC::RegisterFile::shrink):
  6384. (JSC::RegisterFile::grow):
  6385. 2009-04-23 Mark Rowe <mrowe@apple.com>
  6386. With great sadness and a heavy heart I switch us back from YARR to WREC in
  6387. order to restore greenness to the world once more.
  6388. * wtf/Platform.h:
  6389. 2009-04-23 Mark Rowe <mrowe@apple.com>
  6390. More Windows build fixage.
  6391. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6392. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore_debug.def:
  6393. 2009-04-23 Mark Rowe <mrowe@apple.com>
  6394. Attempt to fix the Windows build.
  6395. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Remove a symbol that no longer exists.
  6396. 2009-04-23 Francisco Tolmasky <francisco@280north.com>
  6397. BUG 24604: WebKit profiler reports incorrect total times
  6398. <https://bugs.webkit.org/show_bug.cgi?id=24604>
  6399. Reviewed by Timothy Hatcher and Kevin McCullough.
  6400. * JavaScriptCore.exp:
  6401. * JavaScriptCore.xcodeproj/project.pbxproj:
  6402. * profiler/CallIdentifier.h:
  6403. (JSC::CallIdentifier::Hash::hash):
  6404. (JSC::CallIdentifier::Hash::equal):
  6405. (JSC::CallIdentifier::hash):
  6406. (WTF::):
  6407. * profiler/HeavyProfile.cpp: Removed.
  6408. * profiler/HeavyProfile.h: Removed.
  6409. * profiler/Profile.cpp: No more need for TreeProfile/HeavyProfile
  6410. (JSC::Profile::create):
  6411. * profiler/Profile.h:
  6412. * profiler/ProfileNode.cpp:
  6413. * profiler/ProfileNode.h:
  6414. * profiler/TreeProfile.cpp: Removed.
  6415. * profiler/TreeProfile.h: Removed.
  6416. 2009-04-23 Gavin Barraclough <barraclough@apple.com>
  6417. Not Reviewed.
  6418. Speculative Windows build fix II.
  6419. * yarr/RegexInterpreter.cpp:
  6420. 2009-04-23 Gavin Barraclough <barraclough@apple.com>
  6421. Not Reviewed.
  6422. Speculative Windows build fix.
  6423. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6424. * runtime/RegExp.cpp:
  6425. 2009-04-23 Gavin Barraclough <barraclough@apple.com>
  6426. Rubber stamped by salty sea dogs Sam & Geoff.
  6427. Enable YARR_JIT by default (where supported), replacing WREC.
  6428. * wtf/Platform.h:
  6429. 2009-04-23 Gavin Barraclough <barraclough@apple.com>
  6430. Reviewed by Geoff "Dread Pirate Roberts" Garen.
  6431. Various small fixes to YARR JIT, in preparation for enabling it by default.
  6432. * Correctly index into the callframe when storing restart addresses for
  6433. nested alternatives.
  6434. * Allow backtracking back into matched alternatives of parentheses.
  6435. * Fix callframe offset calculation for parenthetical assertions.
  6436. * When a set of parenthese are quantified with a fixed and variable portion,
  6437. and the variable portion is quantified once, this should not reset the
  6438. pattern match on failure to match (the last match from the firxed portion
  6439. should be preserved).
  6440. * Up the pattern size limit to match PCRE's new limit.
  6441. * Unlclosed parentheses should be reported with the message "missing )".
  6442. * wtf/Platform.h:
  6443. * yarr/RegexCompiler.cpp:
  6444. (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
  6445. (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
  6446. * yarr/RegexInterpreter.cpp:
  6447. (JSC::Yarr::Interpreter::matchParentheses):
  6448. (JSC::Yarr::Interpreter::backtrackParentheses):
  6449. (JSC::Yarr::ByteCompiler::emitDisjunction):
  6450. * yarr/RegexJIT.cpp:
  6451. (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
  6452. (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
  6453. (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
  6454. (JSC::Yarr::RegexGenerator::generateTerm):
  6455. (JSC::Yarr::executeRegex):
  6456. * yarr/RegexParser.h:
  6457. (JSC::Yarr::Parser::):
  6458. (JSC::Yarr::Parser::parseTokens):
  6459. (JSC::Yarr::Parser::parse):
  6460. * yarr/RegexPattern.h:
  6461. (JSC::Yarr::PatternTerm::):
  6462. (JSC::Yarr::PatternTerm::PatternTerm):
  6463. 2009-04-22 Mark Rowe <mrowe@apple.com>
  6464. Rubber-stamped by Gavin Barraclough.
  6465. Add the m_ prefix on FixedVMPoolAllocator's member variables, and fix typos in a few comments.
  6466. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6467. (JSC::FixedVMPoolAllocator::addToFreeList):
  6468. (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
  6469. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6470. (JSC::FixedVMPoolAllocator::alloc):
  6471. (JSC::FixedVMPoolAllocator::free):
  6472. (JSC::FixedVMPoolAllocator::isWithinVMPool):
  6473. 2009-04-22 Mark Rowe <mrowe@apple.com>
  6474. Rubber-stamped by Gavin Barraclough.
  6475. Add some assertions to FixedVMPoolAllocator to guard against cases where we
  6476. attempt to free memory that didn't originate from the pool, or we attempt to
  6477. hand out a bogus address from alloc.
  6478. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6479. (JSC::FixedVMPoolAllocator::release):
  6480. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6481. (JSC::FixedVMPoolAllocator::alloc):
  6482. (JSC::FixedVMPoolAllocator::free):
  6483. (JSC::FixedVMPoolAllocator::isWithinVMPool):
  6484. 2009-04-22 Gavin Barraclough <barraclough@apple.com>
  6485. Rubber stamped by Sam "Blackbeard" Weinig.
  6486. Although pirates do spell the word 'generate' as 'genertate',
  6487. webkit developers do not. Fixertate.
  6488. * yarr/RegexJIT.cpp:
  6489. (JSC::Yarr::RegexGenerator::generateAssertionBOL):
  6490. (JSC::Yarr::RegexGenerator::generateAssertionEOL):
  6491. (JSC::Yarr::RegexGenerator::generateAssertionWordBoundary):
  6492. (JSC::Yarr::RegexGenerator::generatePatternCharacterSingle):
  6493. (JSC::Yarr::RegexGenerator::generatePatternCharacterPair):
  6494. (JSC::Yarr::RegexGenerator::generatePatternCharacterFixed):
  6495. (JSC::Yarr::RegexGenerator::generatePatternCharacterGreedy):
  6496. (JSC::Yarr::RegexGenerator::generatePatternCharacterNonGreedy):
  6497. (JSC::Yarr::RegexGenerator::generateCharacterClassSingle):
  6498. (JSC::Yarr::RegexGenerator::generateCharacterClassFixed):
  6499. (JSC::Yarr::RegexGenerator::generateCharacterClassGreedy):
  6500. (JSC::Yarr::RegexGenerator::generateCharacterClassNonGreedy):
  6501. (JSC::Yarr::RegexGenerator::generateTerm):
  6502. 2009-04-22 Gavin Barraclough <barraclough@apple.com>
  6503. Reviewed by Sam "Blackbeard" Weinig.
  6504. Improvements to YARR JIT. This patch expands support in three key areas:
  6505. * Add (temporary) support for falling back to PCRE for expressions not supported.
  6506. * Add support for x86_64 and Windows.
  6507. * Add support for singly quantified parentheses (? and ??), alternatives within
  6508. parentheses, and parenthetical assertions.
  6509. * runtime/RegExp.cpp:
  6510. (JSC::RegExp::match):
  6511. * yarr/RegexJIT.cpp:
  6512. (JSC::Yarr::RegexGenerator::storeToFrame):
  6513. (JSC::Yarr::RegexGenerator::storeToFrameWithPatch):
  6514. (JSC::Yarr::RegexGenerator::loadFromFrameAndJump):
  6515. (JSC::Yarr::RegexGenerator::AlternativeBacktrackRecord::AlternativeBacktrackRecord):
  6516. (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
  6517. (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
  6518. (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
  6519. (JSC::Yarr::RegexGenerator::TermGenerationState::plantJumpToBacktrackIfExists):
  6520. (JSC::Yarr::RegexGenerator::TermGenerationState::addBacktrackJump):
  6521. (JSC::Yarr::RegexGenerator::TermGenerationState::linkAlternativeBacktracks):
  6522. (JSC::Yarr::RegexGenerator::TermGenerationState::propagateBacktrackingFrom):
  6523. (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
  6524. (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
  6525. (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
  6526. (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
  6527. (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
  6528. (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
  6529. (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
  6530. (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
  6531. (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
  6532. (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
  6533. (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
  6534. (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
  6535. (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
  6536. (JSC::Yarr::RegexGenerator::generateParenthesesDisjunction):
  6537. (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
  6538. (JSC::Yarr::RegexGenerator::generateParentheticalAssertion):
  6539. (JSC::Yarr::RegexGenerator::generateTerm):
  6540. (JSC::Yarr::RegexGenerator::generateDisjunction):
  6541. (JSC::Yarr::RegexGenerator::generateEnter):
  6542. (JSC::Yarr::RegexGenerator::generateReturn):
  6543. (JSC::Yarr::RegexGenerator::RegexGenerator):
  6544. (JSC::Yarr::RegexGenerator::generate):
  6545. (JSC::Yarr::RegexGenerator::compile):
  6546. (JSC::Yarr::RegexGenerator::generationFailed):
  6547. (JSC::Yarr::jitCompileRegex):
  6548. (JSC::Yarr::executeRegex):
  6549. * yarr/RegexJIT.h:
  6550. (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
  6551. (JSC::Yarr::RegexCodeBlock::~RegexCodeBlock):
  6552. 2009-04-22 Sam Weinig <sam@webkit.org>
  6553. Rubber-stamped by Darin Adler.
  6554. Fix for <rdar://problem/6816957>
  6555. Turn off Geolocation by default
  6556. * Configurations/FeatureDefines.xcconfig:
  6557. 2009-04-22 Oliver Hunt <oliver@apple.com>
  6558. Reviewed by NOBODY (Buildfix).
  6559. * interpreter/CachedCall.h:
  6560. 2009-04-21 Oliver Hunt <oliver@apple.com>
  6561. Reviewed by NOBODY (Build fix).
  6562. * runtime/StringPrototype.cpp:
  6563. 2009-04-21 Oliver Hunt <oliver@apple.com>
  6564. Reviewed by Maciej Stachowiak.
  6565. Improve String.replace performance slightly
  6566. Apply our vm reentry caching logic to String.replace with global
  6567. regexes.
  6568. * runtime/StringPrototype.cpp:
  6569. (JSC::stringProtoFuncReplace):
  6570. 2009-04-21 Geoffrey Garen <ggaren@apple.com>
  6571. Reviewed by Cameron Zwarich and Oliver Hunt.
  6572. Re-Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
  6573. fast/workers/use-machine-stack.html (22531)
  6574. SunSpider reports no change.
  6575. Use a larger recursion limit on the main thread (because we can, and
  6576. there's some evidence that it may improve compatibility), and a smaller
  6577. recursion limit on secondary threads (because they tend to have smaller
  6578. stacks).
  6579. * interpreter/Interpreter.cpp:
  6580. (JSC::Interpreter::execute):
  6581. (JSC::Interpreter::prepareForRepeatCall):
  6582. * interpreter/Interpreter.h:
  6583. (JSC::): Ditto. I wrote the recursion test slightly funny, so that the
  6584. common case remains a simple compare to constant.
  6585. * runtime/ArrayPrototype.cpp:
  6586. (JSC::arrayProtoFuncToString):
  6587. (JSC::arrayProtoFuncToLocaleString):
  6588. (JSC::arrayProtoFuncJoin): Conservatively, set the array recursion limits
  6589. to the lower, secondary thread limit. We can do something fancier if
  6590. compatibility moves us, but this seems sufficient for now.
  6591. 2009-04-21 Geoffrey Garen <ggaren@apple.com>
  6592. Rubber-stamped by Adam Roben.
  6593. Disabled one more Mozilla JS test because it fails intermittently on Windows.
  6594. (See https://bugs.webkit.org/show_bug.cgi?id=25160.)
  6595. * tests/mozilla/expected.html:
  6596. 2009-04-21 Adam Roben <aroben@apple.com>
  6597. Rename JavaScriptCore_debug.dll to JavaScriptCore.dll in the Debug
  6598. configuration
  6599. This matches the naming scheme for WebKit.dll, and will be necessary
  6600. once Safari links against JavaScriptCore.dll. This change also causes
  6601. run-safari not to fail (because the launcher printed by FindSafari was
  6602. always looking for JavaScriptCore.dll, never
  6603. JavaScriptCore_debug.dll).
  6604. Part of Bug 25305: can't run safari or drt on windows
  6605. <https://bugs.webkit.org/show_bug.cgi?id=25305>
  6606. Reviewed by Steve Falkenburg and Sam Weinig.
  6607. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6608. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  6609. * JavaScriptCore.vcproj/testapi/testapi.vcproj:
  6610. Use $(WebKitDLLConfigSuffix) for naming JavaScriptCore.{dll,lib}.
  6611. 2009-04-21 Adam Roben <aroben@apple.com>
  6612. Fix JavaScriptCore build on VC++ Express
  6613. Reviewed by Steve Falkenburg and Sam Weinig.
  6614. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Link
  6615. explicitly against gdi32.lib and oleaut32.lib.
  6616. 2009-04-21 Geoffrey Garen <ggaren@apple.com>
  6617. Reviewed by Mark Rowe.
  6618. Tiger crash fix: Put VM tags in their own header file, and fixed up the
  6619. #ifdefs so they're not used on Tiger.
  6620. * JavaScriptCore.xcodeproj/project.pbxproj:
  6621. * interpreter/RegisterFile.h:
  6622. (JSC::RegisterFile::RegisterFile):
  6623. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6624. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6625. * jit/ExecutableAllocatorPosix.cpp:
  6626. (JSC::ExecutablePool::systemAlloc):
  6627. * runtime/Collector.cpp:
  6628. (JSC::allocateBlock):
  6629. * wtf/VMTags.h: Added.
  6630. 2009-04-20 Steve Falkenburg <sfalken@apple.com>
  6631. More Windows build fixes.
  6632. * JavaScriptCore.vcproj/JavaScriptCore.make: Copy DLLs, PDBs.
  6633. * JavaScriptCore.vcproj/JavaScriptCore.resources: Added.
  6634. * JavaScriptCore.vcproj/JavaScriptCore.resources/Info.plist: Added.
  6635. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.rc: Added.
  6636. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add version stamping, resource copying.
  6637. 2009-04-20 Steve Falkenburg <sfalken@apple.com>
  6638. Separate JavaScriptCore.dll from WebKit.dll.
  6639. Slight performance improvement or no change on benchmarks.
  6640. Allows us to break a circular dependency between CFNetwork and WebKit on Windows,
  6641. and simplifies standalone JavaScriptCore builds.
  6642. Reviewed by Oliver Hunt.
  6643. * API/JSBase.h: Export symbols with JS_EXPORT when using MSVC.
  6644. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6645. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Build JavaScriptCore as a DLL instead of a static library.
  6646. * config.h: Specify __declspec(dllexport/dllimport) appropriately when exporting data.
  6647. * runtime/InternalFunction.h: Specify JS_EXPORTDATA on exported data.
  6648. * runtime/JSArray.h: Specify JS_EXPORTDATA on exported data.
  6649. * runtime/JSFunction.h: Specify JS_EXPORTDATA on exported data.
  6650. * runtime/StringObject.h: Specify JS_EXPORTDATA on exported data.
  6651. * runtime/UString.h: Specify JS_EXPORTDATA on exported data.
  6652. 2009-04-20 Sam Weinig <sam@webkit.org>
  6653. Reviewed by Kevin McCullough.
  6654. Always tag mmaped memory on darwin and clean up #defines
  6655. now that they are a little bigger.
  6656. * interpreter/RegisterFile.h:
  6657. (JSC::RegisterFile::RegisterFile):
  6658. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6659. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6660. * jit/ExecutableAllocatorPosix.cpp:
  6661. (JSC::ExecutablePool::systemAlloc):
  6662. * runtime/Collector.cpp:
  6663. (JSC::allocateBlock):
  6664. 2009-04-20 Sam Weinig <sam@webkit.org>
  6665. Rubber-stamped by Tim Hatcher.
  6666. Add licenses for xcconfig files.
  6667. * Configurations/Base.xcconfig:
  6668. * Configurations/DebugRelease.xcconfig:
  6669. * Configurations/FeatureDefines.xcconfig:
  6670. * Configurations/JavaScriptCore.xcconfig:
  6671. * Configurations/Version.xcconfig:
  6672. 2009-04-20 Ariya Hidayat <ariya.hidayat@nokia.com>
  6673. Build fix for Qt port (after r42646). Not reviewed.
  6674. * wtf/unicode/qt4/UnicodeQt4.h: Added U16_PREV.
  6675. 2009-04-19 Sam Weinig <sam@webkit.org>
  6676. Reviewed by Darin Adler.
  6677. Better fix for JSStringCreateWithCFString hardening.
  6678. * API/JSStringRefCF.cpp:
  6679. (JSStringCreateWithCFString):
  6680. 2009-04-19 Sam Weinig <sam@webkit.org>
  6681. Reviewed by Dan Bernstein.
  6682. Fix for <rdar://problem/5860954>
  6683. Harden JSStringCreateWithCFString against malformed CFStringRefs.
  6684. * API/JSStringRefCF.cpp:
  6685. (JSStringCreateWithCFString):
  6686. 2009-04-19 David Kilzer <ddkilzer@apple.com>
  6687. Make FEATURE_DEFINES completely dynamic
  6688. Reviewed by Darin Adler.
  6689. Make FEATURE_DEFINES depend on individual ENABLE_FEATURE_NAME
  6690. variables for each feature, making it possible to remove all
  6691. knowledge of FEATURE_DEFINES from build-webkit.
  6692. * Configurations/FeatureDefines.xcconfig: Extract a variable
  6693. from FEATURE_DEFINES for each feature setting.
  6694. 2009-04-18 Sam Weinig <sam@webkit.org>
  6695. Reviewed by Dan Bernstein.
  6696. Fix typo. s/VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE/VM_MEMORY_JAVASCRIPT_CORE/
  6697. * runtime/Collector.cpp:
  6698. (JSC::allocateBlock): Fix bozo typo.
  6699. 2009-04-18 Sam Weinig <sam@webkit.org>
  6700. Reviewed by Anders Carlsson.
  6701. Fix for <rdar://problem/6801555> Tag JavaScript memory on SnowLeopard
  6702. * interpreter/RegisterFile.h:
  6703. (JSC::RegisterFile::RegisterFile):
  6704. * jit/ExecutableAllocatorFixedVMPool.cpp:
  6705. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6706. * jit/ExecutableAllocatorPosix.cpp:
  6707. (JSC::ExecutablePool::systemAlloc):
  6708. * runtime/Collector.cpp:
  6709. (JSC::allocateBlock):
  6710. 2009-04-18 Drew Wilson <amw@apple.com>
  6711. <rdar://problem/6781407> VisiblePosition.characterAfter should return UChar32
  6712. Reviewed by Dan Bernstein.
  6713. * wtf/unicode/icu/UnicodeIcu.h:
  6714. (WTF::Unicode::hasLineBreakingPropertyComplexContextOrIdeographic): Added.
  6715. 2009-04-18 Sam Weinig <sam@webkit.org>
  6716. Reviewed by Mark Rowe.
  6717. Fix for <rdar://problem/5861045>
  6718. A little bit of hardening for UString.
  6719. * runtime/UString.cpp:
  6720. (JSC::concatenate):
  6721. (JSC::UString::append):
  6722. 2009-04-18 Sam Weinig <sam@webkit.org>
  6723. Reviewed by Mark Rowe and Dan Bernstein.
  6724. Fix for <rdar://problem/5861188>
  6725. A little bit of hardening for Vector.
  6726. * wtf/Vector.h:
  6727. (WTF::Vector<T, inlineCapacity>::append):
  6728. (WTF::Vector<T, inlineCapacity>::insert):
  6729. 2009-04-17 Gavin Barraclough <barraclough@apple.com>
  6730. Reviewed by Geoff Garen.
  6731. On x86_64, make all JIT-code allocations from a new heap, managed
  6732. by FixedVMPoolAllocator. This class allocates a single large (2Gb)
  6733. pool of virtual memory from which all further allocations take place.
  6734. Since all JIT code is allocated from this pool, we can continue to
  6735. safely assume (as is already asserted) that it will always be possible
  6736. to link any JIT-code to JIT-code jumps and calls.
  6737. * JavaScriptCore.xcodeproj/project.pbxproj:
  6738. Add new file.
  6739. * jit/ExecutableAllocatorFixedVMPool.cpp: Added.
  6740. (JSC::FreeListEntry::FreeListEntry):
  6741. (JSC::AVLTreeAbstractorForFreeList::get_less):
  6742. (JSC::AVLTreeAbstractorForFreeList::set_less):
  6743. (JSC::AVLTreeAbstractorForFreeList::get_greater):
  6744. (JSC::AVLTreeAbstractorForFreeList::set_greater):
  6745. (JSC::AVLTreeAbstractorForFreeList::get_balance_factor):
  6746. (JSC::AVLTreeAbstractorForFreeList::set_balance_factor):
  6747. (JSC::AVLTreeAbstractorForFreeList::null):
  6748. (JSC::AVLTreeAbstractorForFreeList::compare_key_key):
  6749. (JSC::AVLTreeAbstractorForFreeList::compare_key_node):
  6750. (JSC::AVLTreeAbstractorForFreeList::compare_node_node):
  6751. (JSC::sortFreeListEntriesByPointer):
  6752. (JSC::sortCommonSizedAllocations):
  6753. (JSC::FixedVMPoolAllocator::release):
  6754. (JSC::FixedVMPoolAllocator::reuse):
  6755. (JSC::FixedVMPoolAllocator::addToFreeList):
  6756. (JSC::FixedVMPoolAllocator::coalesceFreeSpace):
  6757. (JSC::FixedVMPoolAllocator::FixedVMPoolAllocator):
  6758. (JSC::FixedVMPoolAllocator::alloc):
  6759. (JSC::FixedVMPoolAllocator::free):
  6760. (JSC::ExecutableAllocator::intializePageSize):
  6761. (JSC::ExecutablePool::systemAlloc):
  6762. (JSC::ExecutablePool::systemRelease):
  6763. The new 2Gb heap class!
  6764. * jit/ExecutableAllocatorPosix.cpp:
  6765. Disable use of this implementation on x86_64.
  6766. * wtf/AVLTree.h:
  6767. Add missing variable initialization.
  6768. (WTF::::remove):
  6769. 2009-04-17 Oliver Hunt <oliver@apple.com>
  6770. Reviewed by Darin Adler.
  6771. Fix bug where the VM reentry cache would not correctly unroll the cached callframe
  6772. Fix a check that was intended to mark a cached call as invalid when the callframe could
  6773. not be constructed. Instead it was just checking that there was a place to put the
  6774. exception. This eventually results in a non-recoverable RegisterFile starvation.
  6775. * interpreter/CachedCall.h:
  6776. (JSC::CachedCall::CachedCall):
  6777. (JSC::CachedCall::call): add assertion to ensure we don't use a bad callframe
  6778. 2009-04-17 David Kilzer <ddkilzer@apple.com>
  6779. Simplify FEATURE_DEFINES definition
  6780. Reviewed by Darin Adler.
  6781. This moves FEATURE_DEFINES and its related ENABLE_FEATURE_NAME
  6782. variables to their own FeatureDefines.xcconfig file. It also
  6783. extracts a new ENABLE_GEOLOCATION variable so that
  6784. FEATURE_DEFINES only needs to be defined once.
  6785. * Configurations/FeatureDefines.xcconfig: Added.
  6786. * Configurations/JavaScriptCore.xcconfig: Removed definition of
  6787. ENABLE_SVG_DOM_OBJC_BINDINGS and FEATURE_DEFINES. Added include
  6788. of FeatureDefines.xcconfig.
  6789. * JavaScriptCore.xcodeproj/project.pbxproj: Added
  6790. FeatureDefines.xcconfig file.
  6791. 2009-04-08 Mihnea Ovidenie <mihnea@adobe.com>
  6792. Reviewed by Oliver Hunt.
  6793. Bug 25027: JavaScript parseInt wrong on negative numbers
  6794. <https://bugs.webkit.org/show_bug.cgi?id=25027>
  6795. When dealing with negative numbers, parseInt should use ceil instead of floor.
  6796. * runtime/JSGlobalObjectFunctions.cpp:
  6797. (JSC::globalFuncParseInt):
  6798. 2009-04-16 Stephanie Lewis <slewis@apple.com>
  6799. Reviewed by Oliver Hunt.
  6800. <rdar://problem/6744652> 32-bit to 64-bit: Javascript hash tables double in size
  6801. Remove perfect hash optimization which removes 1 MB of overhead on 32-bit and almost 2 MB on 64-bit. Removing the optimization was not a regression on SunSpider and the acid 3 test still passes.
  6802. * create_hash_table:
  6803. * runtime/Lookup.cpp:
  6804. (JSC::HashTable::createTable):
  6805. (JSC::HashTable::deleteTable):
  6806. * runtime/Lookup.h:
  6807. (JSC::HashEntry::initialize):
  6808. (JSC::HashEntry::next):
  6809. (JSC::HashTable::entry):
  6810. * runtime/Structure.cpp:
  6811. (JSC::Structure::getEnumerableNamesFromClassInfoTable):
  6812. 2009-04-16 Oliver Hunt <oliver@apple.com>
  6813. Reviewed by Gavin Barraclough.
  6814. Fix subtle error in optimised VM reentry in Array.sort
  6815. Basically to ensure we don't accidentally invalidate the cached callframe
  6816. we should be using the cached callframe rather than our own exec state.
  6817. While the old behaviour was wrong i have been unable to actually create a
  6818. test case where anything actually ends up going wrong.
  6819. * interpreter/CachedCall.h:
  6820. (JSC::CachedCall::newCallFrame):
  6821. * runtime/JSArray.cpp:
  6822. (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
  6823. 2009-04-16 Oliver Hunt <oliver@apple.com>
  6824. Reviewed by Gavin Barraclough.
  6825. Optimise op_resolve_base
  6826. If we can statically find a property we are trying to resolve
  6827. the base of, the base is guaranteed to be the global object.
  6828. * bytecompiler/BytecodeGenerator.cpp:
  6829. (JSC::BytecodeGenerator::emitResolveBase):
  6830. 2009-04-16 Oliver Hunt <oliver@apple.com>
  6831. Reviewed by Gavin Barraclough.
  6832. Improve performance of read-write-modify operators
  6833. Implement cross scope optimisation for read-write-modify
  6834. operators, to avoid unnecessary calls to property resolve
  6835. helper functions.
  6836. * bytecompiler/BytecodeGenerator.cpp:
  6837. (JSC::BytecodeGenerator::BytecodeGenerator):
  6838. (JSC::BytecodeGenerator::emitLoadGlobalObject):
  6839. (JSC::BytecodeGenerator::emitResolveWithBase):
  6840. * bytecompiler/BytecodeGenerator.h:
  6841. 2009-04-16 Oliver Hunt <oliver@apple.com>
  6842. Reviewed by Gavin Barraclough.
  6843. Improve performance of remaining array enumeration functions
  6844. Make use of function entry cache for remaining Array enumeration functions.
  6845. * runtime/ArrayPrototype.cpp:
  6846. (JSC::arrayProtoFuncMap):
  6847. (JSC::arrayProtoFuncEvery):
  6848. (JSC::arrayProtoFuncForEach):
  6849. (JSC::arrayProtoFuncSome):
  6850. 2009-04-15 Oliver Hunt <oliver@apple.com>
  6851. Reviewed by Gavin Barraclough.
  6852. Improve performance of Array.sort
  6853. Cache the VM entry for Array.sort when using a JS comparison function.
  6854. * runtime/JSArray.cpp:
  6855. (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
  6856. (JSC::JSArray::sort):
  6857. 2009-04-15 Oliver Hunt <oliver@apple.com>
  6858. Reviewed by Gavin Barraclough.
  6859. Bug 25229: Need support for Array.prototype.reduceRight
  6860. <https://bugs.webkit.org/show_bug.cgi?id=25229>
  6861. Implement Array.reduceRight
  6862. * runtime/ArrayPrototype.cpp:
  6863. (JSC::arrayProtoFuncReduceRight):
  6864. 2009-04-15 Oliver Hunt <oliver@apple.com>
  6865. Reviewed by Gavin Barraclough.
  6866. Bug 25227: Array.filter triggers an assertion when the target array shrinks while being filtered
  6867. <https://bugs.webkit.org/show_bug.cgi?id=25227>
  6868. We correct this simply by making the fast array path fall back on the slow path if
  6869. we ever discover the fast access is unsafe.
  6870. * runtime/ArrayPrototype.cpp:
  6871. (JSC::arrayProtoFuncFilter):
  6872. 2009-04-13 Oliver Hunt <oliver@apple.com>
  6873. Reviewed by Gavin Barraclough.
  6874. Bug 25159: Support Array.prototype.reduce
  6875. <https://bugs.webkit.org/show_bug.cgi?id=25159>
  6876. Implement Array.prototype.reduce
  6877. * runtime/ArrayPrototype.cpp:
  6878. (JSC::arrayProtoFuncReduce):
  6879. 2009-04-15 Oliver Hunt <oliver@apple.com>
  6880. Reviewed by NOBODY (Build fix).
  6881. Move CallFrameClosure from inside the Interpreter class to its own file.
  6882. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6883. * JavaScriptCore.xcodeproj/project.pbxproj:
  6884. * interpreter/CachedCall.h:
  6885. * interpreter/CallFrameClosure.h: Copied from JavaScriptCore/yarr/RegexJIT.h.
  6886. (JSC::CallFrameClosure::setArgument):
  6887. (JSC::CallFrameClosure::resetCallFrame):
  6888. * interpreter/Interpreter.cpp:
  6889. (JSC::Interpreter::prepareForRepeatCall):
  6890. * interpreter/Interpreter.h:
  6891. 2009-04-14 Oliver Hunt <oliver@apple.com>
  6892. Reviewed by Cameron Zwarich.
  6893. Bug 25202: Improve performance of repeated callbacks into the VM
  6894. Add the concept of a CachedCall to native code for use in Array
  6895. prototype and similar functions where a single callback function
  6896. is called repeatedly with the same number of arguments.
  6897. Used Array.prototype.filter as the test function and got a 50% win
  6898. over a naive non-caching specialised version. This makes the native
  6899. implementation of Array.prototype.filter faster than the JS one once
  6900. more.
  6901. * JavaScriptCore.vcproj/JavaScriptCore.sln:
  6902. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6903. * JavaScriptCore.xcodeproj/project.pbxproj:
  6904. * interpreter/CachedCall.h: Added.
  6905. (JSC::CachedCall::CachedCall):
  6906. (JSC::CachedCall::call):
  6907. (JSC::CachedCall::setThis):
  6908. (JSC::CachedCall::setArgument):
  6909. (JSC::CachedCall::~CachedCall):
  6910. CachedCall is a wrapper that automates the calling and teardown
  6911. for a CallFrameClosure
  6912. * interpreter/CallFrame.h:
  6913. * interpreter/Interpreter.cpp:
  6914. (JSC::Interpreter::prepareForRepeatCall):
  6915. Create the basic entry closure for a function
  6916. (JSC::Interpreter::execute):
  6917. A new ::execute method to enter the interpreter from a closure
  6918. (JSC::Interpreter::endRepeatCall):
  6919. Clear the entry closure
  6920. * interpreter/Interpreter.h:
  6921. (JSC::Interpreter::CallFrameClosure::setArgument):
  6922. (JSC::Interpreter::CallFrameClosure::resetCallFrame):
  6923. Helper functions to simplify setting up the closure's callframe
  6924. * runtime/ArrayPrototype.cpp:
  6925. (JSC::arrayProtoFuncFilter):
  6926. 2009-04-14 Xan Lopez <xlopez@igalia.com>
  6927. Fix the build.
  6928. Add the yarr headers (and only the headers) to the build, so that
  6929. RegExp.cpp can compile. The headers are ifdefed out with yarr
  6930. disabled, so we don't need anything else for now.
  6931. * GNUmakefile.am:
  6932. 2009-04-14 Adam Roben <aroben@apple.com>
  6933. Remove support for profile-guided optimization on Windows
  6934. Rubber-stamped by Steve Falkenburg.
  6935. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Removed
  6936. the Release_PGO configuration. Also let VS re-order the source files
  6937. list.
  6938. 2009-04-14 Xan Lopez <xlopez@igalia.com>
  6939. Unreviewed build fix.
  6940. * GNUmakefile.am:
  6941. 2009-04-14 Jan Michael Alonzo <jmalonzo@webkit.org>
  6942. Gtk build fix when building minidom. Not reviewed.
  6943. Use C-style comment instead of C++ style since autotools builds
  6944. minidom using gcc and not g++.
  6945. * wtf/Platform.h:
  6946. 2009-04-14 Gavin Barraclough <barraclough@apple.com>
  6947. Reviewed by NOBODY - speculative build fix.
  6948. * runtime/RegExp.h:
  6949. 2009-04-13 Gavin Barraclough <barraclough@apple.com>
  6950. Reviewed by Cap'n Geoff Garen.
  6951. Yarr!
  6952. (Yet another regex runtime).
  6953. Currently disabled by default since the interpreter, whilst awesomely
  6954. functional, has not been optimized and is likely slower than PCRE, and
  6955. the JIT, whilst faster than WREC, is presently incomplete and does not
  6956. fallback to using an interpreter for the cases it cannot handle.
  6957. * JavaScriptCore.xcodeproj/project.pbxproj:
  6958. * assembler/MacroAssemblerX86Common.h:
  6959. (JSC::MacroAssemblerX86Common::move):
  6960. (JSC::MacroAssemblerX86Common::swap):
  6961. (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
  6962. (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
  6963. (JSC::MacroAssemblerX86Common::branch32):
  6964. (JSC::MacroAssemblerX86Common::branch16):
  6965. * assembler/X86Assembler.h:
  6966. (JSC::X86Assembler::cmpw_im):
  6967. (JSC::X86Assembler::testw_rr):
  6968. (JSC::X86Assembler::X86InstructionFormatter::immediate16):
  6969. * runtime/RegExp.cpp:
  6970. (JSC::RegExp::RegExp):
  6971. (JSC::RegExp::~RegExp):
  6972. (JSC::RegExp::create):
  6973. (JSC::RegExp::compile):
  6974. (JSC::RegExp::match):
  6975. * runtime/RegExp.h:
  6976. * wtf/Platform.h:
  6977. * yarr: Added.
  6978. * yarr/RegexCompiler.cpp: Added.
  6979. (JSC::Yarr::CharacterClassConstructor::CharacterClassConstructor):
  6980. (JSC::Yarr::CharacterClassConstructor::reset):
  6981. (JSC::Yarr::CharacterClassConstructor::append):
  6982. (JSC::Yarr::CharacterClassConstructor::putChar):
  6983. (JSC::Yarr::CharacterClassConstructor::isUnicodeUpper):
  6984. (JSC::Yarr::CharacterClassConstructor::isUnicodeLower):
  6985. (JSC::Yarr::CharacterClassConstructor::putRange):
  6986. (JSC::Yarr::CharacterClassConstructor::charClass):
  6987. (JSC::Yarr::CharacterClassConstructor::addSorted):
  6988. (JSC::Yarr::CharacterClassConstructor::addSortedRange):
  6989. (JSC::Yarr::newlineCreate):
  6990. (JSC::Yarr::digitsCreate):
  6991. (JSC::Yarr::spacesCreate):
  6992. (JSC::Yarr::wordcharCreate):
  6993. (JSC::Yarr::nondigitsCreate):
  6994. (JSC::Yarr::nonspacesCreate):
  6995. (JSC::Yarr::nonwordcharCreate):
  6996. (JSC::Yarr::RegexPatternConstructor::RegexPatternConstructor):
  6997. (JSC::Yarr::RegexPatternConstructor::~RegexPatternConstructor):
  6998. (JSC::Yarr::RegexPatternConstructor::reset):
  6999. (JSC::Yarr::RegexPatternConstructor::assertionBOL):
  7000. (JSC::Yarr::RegexPatternConstructor::assertionEOL):
  7001. (JSC::Yarr::RegexPatternConstructor::assertionWordBoundary):
  7002. (JSC::Yarr::RegexPatternConstructor::atomPatternCharacter):
  7003. (JSC::Yarr::RegexPatternConstructor::atomBuiltInCharacterClass):
  7004. (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBegin):
  7005. (JSC::Yarr::RegexPatternConstructor::atomCharacterClassAtom):
  7006. (JSC::Yarr::RegexPatternConstructor::atomCharacterClassRange):
  7007. (JSC::Yarr::RegexPatternConstructor::atomCharacterClassBuiltIn):
  7008. (JSC::Yarr::RegexPatternConstructor::atomCharacterClassEnd):
  7009. (JSC::Yarr::RegexPatternConstructor::atomParenthesesSubpatternBegin):
  7010. (JSC::Yarr::RegexPatternConstructor::atomParentheticalAssertionBegin):
  7011. (JSC::Yarr::RegexPatternConstructor::atomParenthesesEnd):
  7012. (JSC::Yarr::RegexPatternConstructor::atomBackReference):
  7013. (JSC::Yarr::RegexPatternConstructor::copyDisjunction):
  7014. (JSC::Yarr::RegexPatternConstructor::copyTerm):
  7015. (JSC::Yarr::RegexPatternConstructor::quantifyAtom):
  7016. (JSC::Yarr::RegexPatternConstructor::disjunction):
  7017. (JSC::Yarr::RegexPatternConstructor::regexBegin):
  7018. (JSC::Yarr::RegexPatternConstructor::regexEnd):
  7019. (JSC::Yarr::RegexPatternConstructor::regexError):
  7020. (JSC::Yarr::RegexPatternConstructor::setupAlternativeOffsets):
  7021. (JSC::Yarr::RegexPatternConstructor::setupDisjunctionOffsets):
  7022. (JSC::Yarr::RegexPatternConstructor::setupOffsets):
  7023. (JSC::Yarr::compileRegex):
  7024. * yarr/RegexCompiler.h: Added.
  7025. * yarr/RegexInterpreter.cpp: Added.
  7026. (JSC::Yarr::Interpreter::appendParenthesesDisjunctionContext):
  7027. (JSC::Yarr::Interpreter::popParenthesesDisjunctionContext):
  7028. (JSC::Yarr::Interpreter::DisjunctionContext::DisjunctionContext):
  7029. (JSC::Yarr::Interpreter::DisjunctionContext::operator new):
  7030. (JSC::Yarr::Interpreter::allocDisjunctionContext):
  7031. (JSC::Yarr::Interpreter::freeDisjunctionContext):
  7032. (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
  7033. (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::operator new):
  7034. (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::restoreOutput):
  7035. (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::getDisjunctionContext):
  7036. (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext):
  7037. (JSC::Yarr::Interpreter::freeParenthesesDisjunctionContext):
  7038. (JSC::Yarr::Interpreter::InputStream::InputStream):
  7039. (JSC::Yarr::Interpreter::InputStream::next):
  7040. (JSC::Yarr::Interpreter::InputStream::rewind):
  7041. (JSC::Yarr::Interpreter::InputStream::read):
  7042. (JSC::Yarr::Interpreter::InputStream::readChecked):
  7043. (JSC::Yarr::Interpreter::InputStream::reread):
  7044. (JSC::Yarr::Interpreter::InputStream::prev):
  7045. (JSC::Yarr::Interpreter::InputStream::getPos):
  7046. (JSC::Yarr::Interpreter::InputStream::setPos):
  7047. (JSC::Yarr::Interpreter::InputStream::atStart):
  7048. (JSC::Yarr::Interpreter::InputStream::atEnd):
  7049. (JSC::Yarr::Interpreter::InputStream::checkInput):
  7050. (JSC::Yarr::Interpreter::InputStream::uncheckInput):
  7051. (JSC::Yarr::Interpreter::testCharacterClass):
  7052. (JSC::Yarr::Interpreter::tryConsumeCharacter):
  7053. (JSC::Yarr::Interpreter::checkCharacter):
  7054. (JSC::Yarr::Interpreter::tryConsumeCharacterClass):
  7055. (JSC::Yarr::Interpreter::checkCharacterClass):
  7056. (JSC::Yarr::Interpreter::tryConsumeBackReference):
  7057. (JSC::Yarr::Interpreter::matchAssertionBOL):
  7058. (JSC::Yarr::Interpreter::matchAssertionEOL):
  7059. (JSC::Yarr::Interpreter::matchAssertionWordBoundary):
  7060. (JSC::Yarr::Interpreter::matchPatternCharacter):
  7061. (JSC::Yarr::Interpreter::backtrackPatternCharacter):
  7062. (JSC::Yarr::Interpreter::matchCharacterClass):
  7063. (JSC::Yarr::Interpreter::backtrackCharacterClass):
  7064. (JSC::Yarr::Interpreter::matchBackReference):
  7065. (JSC::Yarr::Interpreter::backtrackBackReference):
  7066. (JSC::Yarr::Interpreter::recordParenthesesMatch):
  7067. (JSC::Yarr::Interpreter::resetMatches):
  7068. (JSC::Yarr::Interpreter::resetAssertionMatches):
  7069. (JSC::Yarr::Interpreter::parenthesesDoBacktrack):
  7070. (JSC::Yarr::Interpreter::matchParenthesesOnceBegin):
  7071. (JSC::Yarr::Interpreter::matchParenthesesOnceEnd):
  7072. (JSC::Yarr::Interpreter::backtrackParenthesesOnceBegin):
  7073. (JSC::Yarr::Interpreter::backtrackParenthesesOnceEnd):
  7074. (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceBegin):
  7075. (JSC::Yarr::Interpreter::matchParentheticalAssertionOnceEnd):
  7076. (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceBegin):
  7077. (JSC::Yarr::Interpreter::backtrackParentheticalAssertionOnceEnd):
  7078. (JSC::Yarr::Interpreter::matchParentheses):
  7079. (JSC::Yarr::Interpreter::backtrackParentheses):
  7080. (JSC::Yarr::Interpreter::matchTerm):
  7081. (JSC::Yarr::Interpreter::backtrackTerm):
  7082. (JSC::Yarr::Interpreter::matchAlternative):
  7083. (JSC::Yarr::Interpreter::matchDisjunction):
  7084. (JSC::Yarr::Interpreter::matchNonZeroDisjunction):
  7085. (JSC::Yarr::Interpreter::interpret):
  7086. (JSC::Yarr::Interpreter::Interpreter):
  7087. (JSC::Yarr::ByteCompiler::ParenthesesStackEntry::ParenthesesStackEntry):
  7088. (JSC::Yarr::ByteCompiler::ByteCompiler):
  7089. (JSC::Yarr::ByteCompiler::compile):
  7090. (JSC::Yarr::ByteCompiler::checkInput):
  7091. (JSC::Yarr::ByteCompiler::assertionBOL):
  7092. (JSC::Yarr::ByteCompiler::assertionEOL):
  7093. (JSC::Yarr::ByteCompiler::assertionWordBoundary):
  7094. (JSC::Yarr::ByteCompiler::atomPatternCharacter):
  7095. (JSC::Yarr::ByteCompiler::atomCharacterClass):
  7096. (JSC::Yarr::ByteCompiler::atomBackReference):
  7097. (JSC::Yarr::ByteCompiler::atomParenthesesSubpatternBegin):
  7098. (JSC::Yarr::ByteCompiler::atomParentheticalAssertionBegin):
  7099. (JSC::Yarr::ByteCompiler::popParenthesesStack):
  7100. (JSC::Yarr::ByteCompiler::dumpDisjunction):
  7101. (JSC::Yarr::ByteCompiler::closeAlternative):
  7102. (JSC::Yarr::ByteCompiler::atomParenthesesEnd):
  7103. (JSC::Yarr::ByteCompiler::regexBegin):
  7104. (JSC::Yarr::ByteCompiler::regexEnd):
  7105. (JSC::Yarr::ByteCompiler::alterantiveDisjunction):
  7106. (JSC::Yarr::ByteCompiler::emitDisjunction):
  7107. (JSC::Yarr::byteCompileRegex):
  7108. (JSC::Yarr::interpretRegex):
  7109. * yarr/RegexInterpreter.h: Added.
  7110. (JSC::Yarr::ByteTerm::):
  7111. (JSC::Yarr::ByteTerm::ByteTerm):
  7112. (JSC::Yarr::ByteTerm::BOL):
  7113. (JSC::Yarr::ByteTerm::CheckInput):
  7114. (JSC::Yarr::ByteTerm::EOL):
  7115. (JSC::Yarr::ByteTerm::WordBoundary):
  7116. (JSC::Yarr::ByteTerm::BackReference):
  7117. (JSC::Yarr::ByteTerm::AlternativeBegin):
  7118. (JSC::Yarr::ByteTerm::AlternativeDisjunction):
  7119. (JSC::Yarr::ByteTerm::AlternativeEnd):
  7120. (JSC::Yarr::ByteTerm::PatternEnd):
  7121. (JSC::Yarr::ByteTerm::invert):
  7122. (JSC::Yarr::ByteTerm::capture):
  7123. (JSC::Yarr::ByteDisjunction::ByteDisjunction):
  7124. (JSC::Yarr::BytecodePattern::BytecodePattern):
  7125. (JSC::Yarr::BytecodePattern::~BytecodePattern):
  7126. * yarr/RegexJIT.cpp: Added.
  7127. (JSC::Yarr::RegexGenerator::optimizeAlternative):
  7128. (JSC::Yarr::RegexGenerator::matchCharacterClassRange):
  7129. (JSC::Yarr::RegexGenerator::matchCharacterClass):
  7130. (JSC::Yarr::RegexGenerator::jumpIfNoAvailableInput):
  7131. (JSC::Yarr::RegexGenerator::jumpIfAvailableInput):
  7132. (JSC::Yarr::RegexGenerator::checkInput):
  7133. (JSC::Yarr::RegexGenerator::atEndOfInput):
  7134. (JSC::Yarr::RegexGenerator::notAtEndOfInput):
  7135. (JSC::Yarr::RegexGenerator::jumpIfCharEquals):
  7136. (JSC::Yarr::RegexGenerator::jumpIfCharNotEquals):
  7137. (JSC::Yarr::RegexGenerator::readCharacter):
  7138. (JSC::Yarr::RegexGenerator::storeToFrame):
  7139. (JSC::Yarr::RegexGenerator::loadFromFrame):
  7140. (JSC::Yarr::RegexGenerator::TermGenerationState::TermGenerationState):
  7141. (JSC::Yarr::RegexGenerator::TermGenerationState::resetAlternative):
  7142. (JSC::Yarr::RegexGenerator::TermGenerationState::alternativeValid):
  7143. (JSC::Yarr::RegexGenerator::TermGenerationState::nextAlternative):
  7144. (JSC::Yarr::RegexGenerator::TermGenerationState::alternative):
  7145. (JSC::Yarr::RegexGenerator::TermGenerationState::resetTerm):
  7146. (JSC::Yarr::RegexGenerator::TermGenerationState::termValid):
  7147. (JSC::Yarr::RegexGenerator::TermGenerationState::nextTerm):
  7148. (JSC::Yarr::RegexGenerator::TermGenerationState::term):
  7149. (JSC::Yarr::RegexGenerator::TermGenerationState::lookaheadTerm):
  7150. (JSC::Yarr::RegexGenerator::TermGenerationState::isSinglePatternCharacterLookaheadTerm):
  7151. (JSC::Yarr::RegexGenerator::TermGenerationState::inputOffset):
  7152. (JSC::Yarr::RegexGenerator::TermGenerationState::jumpToBacktrack):
  7153. (JSC::Yarr::RegexGenerator::TermGenerationState::setBacktrackGenerated):
  7154. (JSC::Yarr::RegexGenerator::jumpToBacktrackCheckEmitPending):
  7155. (JSC::Yarr::RegexGenerator::genertateAssertionBOL):
  7156. (JSC::Yarr::RegexGenerator::genertateAssertionEOL):
  7157. (JSC::Yarr::RegexGenerator::matchAssertionWordchar):
  7158. (JSC::Yarr::RegexGenerator::genertateAssertionWordBoundary):
  7159. (JSC::Yarr::RegexGenerator::genertatePatternCharacterSingle):
  7160. (JSC::Yarr::RegexGenerator::genertatePatternCharacterPair):
  7161. (JSC::Yarr::RegexGenerator::genertatePatternCharacterFixed):
  7162. (JSC::Yarr::RegexGenerator::genertatePatternCharacterGreedy):
  7163. (JSC::Yarr::RegexGenerator::genertatePatternCharacterNonGreedy):
  7164. (JSC::Yarr::RegexGenerator::genertateCharacterClassSingle):
  7165. (JSC::Yarr::RegexGenerator::genertateCharacterClassFixed):
  7166. (JSC::Yarr::RegexGenerator::genertateCharacterClassGreedy):
  7167. (JSC::Yarr::RegexGenerator::genertateCharacterClassNonGreedy):
  7168. (JSC::Yarr::RegexGenerator::generateParenthesesSingleDisjunctionOneAlternative):
  7169. (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
  7170. (JSC::Yarr::RegexGenerator::generateTerm):
  7171. (JSC::Yarr::RegexGenerator::generateDisjunction):
  7172. (JSC::Yarr::RegexGenerator::RegexGenerator):
  7173. (JSC::Yarr::RegexGenerator::generate):
  7174. (JSC::Yarr::jitCompileRegex):
  7175. (JSC::Yarr::executeRegex):
  7176. * yarr/RegexJIT.h: Added.
  7177. (JSC::Yarr::RegexCodeBlock::RegexCodeBlock):
  7178. * yarr/RegexParser.h: Added.
  7179. (JSC::Yarr::):
  7180. (JSC::Yarr::Parser::):
  7181. (JSC::Yarr::Parser::CharacterClassParserDelegate::CharacterClassParserDelegate):
  7182. (JSC::Yarr::Parser::CharacterClassParserDelegate::begin):
  7183. (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacterUnescaped):
  7184. (JSC::Yarr::Parser::CharacterClassParserDelegate::atomPatternCharacter):
  7185. (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBuiltInCharacterClass):
  7186. (JSC::Yarr::Parser::CharacterClassParserDelegate::end):
  7187. (JSC::Yarr::Parser::CharacterClassParserDelegate::assertionWordBoundary):
  7188. (JSC::Yarr::Parser::CharacterClassParserDelegate::atomBackReference):
  7189. (JSC::Yarr::Parser::CharacterClassParserDelegate::flush):
  7190. (JSC::Yarr::Parser::CharacterClassParserDelegate::):
  7191. (JSC::Yarr::Parser::Parser):
  7192. (JSC::Yarr::Parser::parseEscape):
  7193. (JSC::Yarr::Parser::parseAtomEscape):
  7194. (JSC::Yarr::Parser::parseCharacterClassEscape):
  7195. (JSC::Yarr::Parser::parseCharacterClass):
  7196. (JSC::Yarr::Parser::parseParenthesesBegin):
  7197. (JSC::Yarr::Parser::parseParenthesesEnd):
  7198. (JSC::Yarr::Parser::parseQuantifier):
  7199. (JSC::Yarr::Parser::parseTokens):
  7200. (JSC::Yarr::Parser::parse):
  7201. (JSC::Yarr::Parser::saveState):
  7202. (JSC::Yarr::Parser::restoreState):
  7203. (JSC::Yarr::Parser::atEndOfPattern):
  7204. (JSC::Yarr::Parser::peek):
  7205. (JSC::Yarr::Parser::peekIsDigit):
  7206. (JSC::Yarr::Parser::peekDigit):
  7207. (JSC::Yarr::Parser::consume):
  7208. (JSC::Yarr::Parser::consumeDigit):
  7209. (JSC::Yarr::Parser::consumeNumber):
  7210. (JSC::Yarr::Parser::consumeOctal):
  7211. (JSC::Yarr::Parser::tryConsume):
  7212. (JSC::Yarr::Parser::tryConsumeHex):
  7213. (JSC::Yarr::parse):
  7214. * yarr/RegexPattern.h: Added.
  7215. (JSC::Yarr::CharacterRange::CharacterRange):
  7216. (JSC::Yarr::):
  7217. (JSC::Yarr::PatternTerm::):
  7218. (JSC::Yarr::PatternTerm::PatternTerm):
  7219. (JSC::Yarr::PatternTerm::BOL):
  7220. (JSC::Yarr::PatternTerm::EOL):
  7221. (JSC::Yarr::PatternTerm::WordBoundary):
  7222. (JSC::Yarr::PatternTerm::invert):
  7223. (JSC::Yarr::PatternTerm::capture):
  7224. (JSC::Yarr::PatternTerm::quantify):
  7225. (JSC::Yarr::PatternAlternative::PatternAlternative):
  7226. (JSC::Yarr::PatternAlternative::lastTerm):
  7227. (JSC::Yarr::PatternAlternative::removeLastTerm):
  7228. (JSC::Yarr::PatternDisjunction::PatternDisjunction):
  7229. (JSC::Yarr::PatternDisjunction::~PatternDisjunction):
  7230. (JSC::Yarr::PatternDisjunction::addNewAlternative):
  7231. (JSC::Yarr::RegexPattern::RegexPattern):
  7232. (JSC::Yarr::RegexPattern::~RegexPattern):
  7233. (JSC::Yarr::RegexPattern::reset):
  7234. (JSC::Yarr::RegexPattern::containsIllegalBackReference):
  7235. (JSC::Yarr::RegexPattern::newlineCharacterClass):
  7236. (JSC::Yarr::RegexPattern::digitsCharacterClass):
  7237. (JSC::Yarr::RegexPattern::spacesCharacterClass):
  7238. (JSC::Yarr::RegexPattern::wordcharCharacterClass):
  7239. (JSC::Yarr::RegexPattern::nondigitsCharacterClass):
  7240. (JSC::Yarr::RegexPattern::nonspacesCharacterClass):
  7241. (JSC::Yarr::RegexPattern::nonwordcharCharacterClass):
  7242. 2009-04-13 Oliver Hunt <oliver@apple.com>
  7243. Reviewed by NOBODY (Missed code from last patch).
  7244. * runtime/InternalFunction.cpp:
  7245. (JSC::InternalFunction::displayName):
  7246. (JSC::InternalFunction::calculatedDisplayName):
  7247. * runtime/InternalFunction.h:
  7248. 2009-04-13 Francisco Tolmasky <francisco@280north.com>
  7249. Reviewed by Oliver Hunt.
  7250. BUG 25171: It should be possible to manually set the name of an anonymous function
  7251. <https://bugs.webkit.org/show_bug.cgi?id=25171>
  7252. This change adds the displayName property to functions, which when set overrides the
  7253. normal name when appearing in the console.
  7254. * profiler/Profiler.cpp:
  7255. (JSC::createCallIdentifierFromFunctionImp): Changed call to InternalFunction::name to InternalFunction::calculatedDisplayName
  7256. * runtime/CommonIdentifiers.h: Added displayName common identifier.
  7257. * runtime/InternalFunction.cpp:
  7258. (JSC::InternalFunction::displayName): Access to user settable displayName property
  7259. (JSC::InternalFunction::calculatedDisplayName): Returns displayName if it exists, if not then the natural name
  7260. 2009-04-13 Geoffrey Garen <ggaren@apple.com>
  7261. Reviewed by Sam Weinig.
  7262. Disabled another JavaScriptCore test because it fails on Windows but
  7263. not Mac, so it makes the bots red.
  7264. * tests/mozilla/expected.html:
  7265. 2009-04-13 Geoffrey Garen <ggaren@apple.com>
  7266. Reviewed by Sam Weinig.
  7267. Disabled two JavaScriptCore tests because they fail on Window or Mac but
  7268. not both, so they make the bots red.
  7269. * tests/mozilla/expected.html: Updated expected results.
  7270. 2009-04-09 Ben Murdoch <benm@google.com>
  7271. Reviewed by Alexey Proskuryakov.
  7272. https://bugs.webkit.org/show_bug.cgi?id=25091
  7273. The Android platform requires threads to be registered with the VM.
  7274. This patch implements this behaviour inside ThreadingPthreads.cpp.
  7275. * wtf/ThreadingPthreads.cpp: Add a level above threadEntryPoint that takes care of (un)registering threads with the VM.
  7276. (WTF::runThreadWithRegistration): register the thread and run entryPoint. Unregister the thread afterwards.
  7277. (WTF::createThreadInternal): call runThreadWithRegistration instead of entryPoint directly.
  7278. 2009-04-09 David Kilzer <ddkilzer@apple.com>
  7279. Reinstating <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
  7280. Rolled r42345 back in. The build failure was caused by an
  7281. internal script which had not been updated the same way that
  7282. build-webkit was updated.
  7283. * Configurations/JavaScriptCore.xcconfig:
  7284. 2009-04-09 Alexey Proskuryakov <ap@webkit.org>
  7285. Reverting <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings.
  7286. It broke Mac build, and I don't know how to fix it.
  7287. * Configurations/JavaScriptCore.xcconfig:
  7288. 2009-04-09 Xan Lopez <xlopez@igalia.com>
  7289. Unreviewed build fix.
  7290. Checking for __GLIBCXX__ being bigger than some date is not enough
  7291. to get std::tr1, C++0x has to be in use too. Add another check for
  7292. __GXX_EXPERIMENTAL_CXX0X__.
  7293. * wtf/TypeTraits.h:
  7294. 2009-04-08 Oliver Hunt <oliver@apple.com>
  7295. Reviewed by Adam Roben.
  7296. Fix assertion failure in function.apply
  7297. The result of excess arguments to function.apply is irrelevant
  7298. so we don't need to provide a result register. We were providing
  7299. temporary result register but not ref'ing it resulting in an
  7300. assertion failure.
  7301. * parser/Nodes.cpp:
  7302. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  7303. 2009-04-08 David Kilzer <ddkilzer@apple.com>
  7304. <rdar://problem/6718589> Option to turn off SVG DOM Objective-C bindings
  7305. Reviewed by Darin Adler and Maciej Stachowiak.
  7306. Introduce the ENABLE_SVG_DOM_OBJC_BINDINGS feature define so
  7307. that SVG DOM Objective-C bindings may be optionally disabled.
  7308. * Configurations/JavaScriptCore.xcconfig: Added
  7309. ENABLE_SVG_DOM_OBJC_BINDINGS variable and use it in
  7310. FEATURE_DEFINES.
  7311. 2009-04-08 Paul Pedriana <ppedriana@ea.com>
  7312. Reviewed by Darin Adler.
  7313. https://bugs.webkit.org/show_bug.cgi?id=20422
  7314. Allow custom memory allocation control.
  7315. * wtf/FastAllocBase.h:
  7316. New added file. Implements allocation base class.
  7317. * wtf/TypeTraits.h:
  7318. Augments existing type traits support as needed by FastAllocBase.
  7319. * wtf/FastMalloc.h:
  7320. Changed to support FastMalloc match validation.
  7321. * wtf/FastMalloc.cpp:
  7322. Changed to support FastMalloc match validation.
  7323. * wtf/Platform.h:
  7324. Added ENABLE_FAST_MALLOC_MATCH_VALIDATION; defaults to 0.
  7325. * GNUmakefile.am:
  7326. Updated to include added FastAllocBase.h.
  7327. * JavaScriptCore.xcodeproj/project.pbxproj:
  7328. Updated to include added FastAllocBase.h.
  7329. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  7330. Updated to include added FastAllocBase.h.
  7331. 2009-04-07 Oliver Hunt <oliver@apple.com>
  7332. Reviewed by Geoff Garen.
  7333. Improve function.apply performance
  7334. Jump through a few hoops to improve performance of function.apply in the general case.
  7335. In the case of zero or one arguments, or if there are only two arguments and the
  7336. second is an array literal we treat function.apply as function.call.
  7337. Otherwise we use the new opcodes op_load_varargs and op_call_varargs to do the .apply call
  7338. without re-entering the virtual machine.
  7339. * bytecode/CodeBlock.cpp:
  7340. (JSC::CodeBlock::dump):
  7341. * bytecode/Opcode.h:
  7342. * bytecompiler/BytecodeGenerator.cpp:
  7343. (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
  7344. (JSC::BytecodeGenerator::emitLoadVarargs):
  7345. (JSC::BytecodeGenerator::emitCallVarargs):
  7346. * bytecompiler/BytecodeGenerator.h:
  7347. * interpreter/Interpreter.cpp:
  7348. (JSC::Interpreter::privateExecute):
  7349. * jit/JIT.cpp:
  7350. (JSC::JIT::privateCompileMainPass):
  7351. (JSC::JIT::privateCompileSlowCases):
  7352. * jit/JIT.h:
  7353. * jit/JITCall.cpp:
  7354. (JSC::JIT::compileOpCallSetupArgs):
  7355. (JSC::JIT::compileOpCallVarargsSetupArgs):
  7356. (JSC::JIT::compileOpCallVarargs):
  7357. (JSC::JIT::compileOpCallVarargsSlowCase):
  7358. * jit/JITStubs.cpp:
  7359. (JSC::JITStubs::cti_op_load_varargs):
  7360. * jit/JITStubs.h:
  7361. * parser/Grammar.y:
  7362. * parser/Nodes.cpp:
  7363. (JSC::ArrayNode::isSimpleArray):
  7364. (JSC::ArrayNode::toArgumentList):
  7365. (JSC::CallFunctionCallDotNode::emitBytecode):
  7366. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  7367. * parser/Nodes.h:
  7368. (JSC::ExpressionNode::):
  7369. (JSC::ApplyFunctionCallDotNode::):
  7370. * runtime/Arguments.cpp:
  7371. (JSC::Arguments::copyToRegisters):
  7372. (JSC::Arguments::fillArgList):
  7373. * runtime/Arguments.h:
  7374. (JSC::Arguments::numProvidedArguments):
  7375. * runtime/FunctionPrototype.cpp:
  7376. (JSC::FunctionPrototype::addFunctionProperties):
  7377. * runtime/FunctionPrototype.h:
  7378. * runtime/JSArray.cpp:
  7379. (JSC::JSArray::copyToRegisters):
  7380. * runtime/JSArray.h:
  7381. * runtime/JSGlobalObject.cpp:
  7382. (JSC::JSGlobalObject::reset):
  7383. (JSC::JSGlobalObject::mark):
  7384. * runtime/JSGlobalObject.h:
  7385. 2009-04-08 Alexey Proskuryakov <ap@webkit.org>
  7386. Reviewed by Darin Adler.
  7387. https://bugs.webkit.org/show_bug.cgi?id=25073
  7388. JavaScriptCore tests don't run if time zone is not PST
  7389. * API/tests/testapi.c:
  7390. (timeZoneIsPST): Added a function that checks whether the time zone is PST, using the same
  7391. method as functions in DateMath.cpp do for formatting the result.
  7392. (main): Skip date string format test if the time zone is not PST.
  7393. 2009-04-07 David Levin <levin@chromium.org>
  7394. Reviewed by Sam Weinig and Geoff Garen.
  7395. https://bugs.webkit.org/show_bug.cgi?id=25039
  7396. UString refactoring to support UChar* sharing.
  7397. No change in sunspider perf.
  7398. * runtime/SmallStrings.cpp:
  7399. (JSC::SmallStringsStorage::SmallStringsStorage):
  7400. * runtime/UString.cpp:
  7401. (JSC::initializeStaticBaseString):
  7402. (JSC::initializeUString):
  7403. (JSC::UString::BaseString::isShared):
  7404. Encapsulate the meaning behind the refcount == 1 checks because
  7405. this needs to do slightly more when sharing is added.
  7406. (JSC::concatenate):
  7407. (JSC::UString::append):
  7408. (JSC::UString::operator=):
  7409. * runtime/UString.h:
  7410. Make m_baseString part of a union to get rid of casts, but make it protected because
  7411. it is tricky to use it correctly since it is only valid when the Rep is not a BaseString.
  7412. The void* will be filled in when sharing is added.
  7413. Add constructors due to the making members protected and it make ensuring proper
  7414. initialization work better (like in SmallStringsStorage).
  7415. (JSC::UString::Rep::create):
  7416. (JSC::UString::Rep::Rep):
  7417. (JSC::UString::Rep::):
  7418. (JSC::UString::BaseString::BaseString):
  7419. (JSC::UString::Rep::setBaseString):
  7420. (JSC::UString::Rep::baseString):
  7421. 2009-04-04 Xan Lopez <xlopez@igalia.com>
  7422. Reviewed by Alexey Proskuryakov.
  7423. https://bugs.webkit.org/show_bug.cgi?id=25033
  7424. dtoa.cpp segfaults with g++ 4.4.0
  7425. g++ 4.4.0 seems to be more strict about aliasing rules, so it
  7426. produces incorrect code if dtoa.cpp is compiled with
  7427. -fstrict-aliasing (it also emits a ton of warnings, so fair enough
  7428. I guess). The problem was that we were only casting variables to
  7429. union types in order to do type punning, but GCC and the C
  7430. standard require that we actually use a union to store the value.
  7431. This patch does just that, the code is mostly copied from the dtoa
  7432. version in GCC:
  7433. http://gcc.gnu.org/viewcvs/trunk/libjava/classpath/native/fdlibm/dtoa.c?view=markup.
  7434. * wtf/dtoa.cpp:
  7435. (WTF::ulp):
  7436. (WTF::b2d):
  7437. (WTF::ratio):
  7438. (WTF::hexnan):
  7439. (WTF::strtod):
  7440. (WTF::dtoa):
  7441. 2009-04-04 Kevin Ollivier <kevino@theolliviers.com>
  7442. wx build fix for Win port. Build the assembler sources to get missing functions.
  7443. * JavaScriptCoreSources.bkl:
  7444. * jscore.bkl:
  7445. * wtf/Platform.h:
  7446. 2009-04-02 Darin Adler <darin@apple.com>
  7447. Reviewed by Kevin Decker.
  7448. <rdar://problem/6744471> crash in GC due to uninitialized callFunction pointer
  7449. * runtime/JSGlobalObject.h:
  7450. (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Initialize
  7451. callFunction as we do the other data members that are used in the mark function.
  7452. 2009-04-02 Yael Aharon <yael.aharon@nokia.com>
  7453. Reviewed by Simon Hausmann
  7454. https://bugs.webkit.org/show_bug.cgi?id=24490
  7455. Implement WTF::ThreadSpecific in the Qt build using
  7456. QThreadStorage.
  7457. * wtf/ThreadSpecific.h:
  7458. 2009-04-01 Greg Bolsinga <bolsinga@apple.com>
  7459. Reviewed by Mark Rowe.
  7460. https://bugs.webkit.org/show_bug.cgi?id=24990
  7461. Put SECTORDER_FLAGS into xcconfig files.
  7462. * Configurations/Base.xcconfig:
  7463. * Configurations/DebugRelease.xcconfig:
  7464. * JavaScriptCore.xcodeproj/project.pbxproj:
  7465. 2009-03-27 Oliver Hunt <oliver@apple.com>
  7466. Reviewed by NOBODY (Build fix).
  7467. Fix non-AllInOneFile builds.
  7468. * bytecompiler/BytecodeGenerator.cpp:
  7469. 2009-03-27 Oliver Hunt <oliver@apple.com>
  7470. Reviewed by Gavin Barraclough.
  7471. Improve performance of Function.prototype.call
  7472. <https://bugs.webkit.org/show_bug.cgi?id=24907>
  7473. Optimistically assume that expression.call(..) is going to be a call to
  7474. Function.prototype.call, and handle it specially to attempt to reduce the
  7475. degree of VM reentrancy.
  7476. When everything goes right this removes the vm reentry improving .call()
  7477. by around a factor of 10.
  7478. * JavaScriptCore.xcodeproj/project.pbxproj:
  7479. * bytecode/CodeBlock.cpp:
  7480. (JSC::CodeBlock::dump):
  7481. * bytecode/Opcode.h:
  7482. * bytecompiler/BytecodeGenerator.cpp:
  7483. (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
  7484. * bytecompiler/BytecodeGenerator.h:
  7485. * interpreter/Interpreter.cpp:
  7486. (JSC::Interpreter::privateExecute):
  7487. * jit/JIT.cpp:
  7488. (JSC::JIT::privateCompileMainPass):
  7489. * parser/Grammar.y:
  7490. * parser/Nodes.cpp:
  7491. (JSC::CallFunctionCallDotNode::emitBytecode):
  7492. * parser/Nodes.h:
  7493. (JSC::CallFunctionCallDotNode::):
  7494. * runtime/FunctionPrototype.cpp:
  7495. (JSC::FunctionPrototype::addFunctionProperties):
  7496. * runtime/FunctionPrototype.h:
  7497. * runtime/JSGlobalObject.cpp:
  7498. (JSC::JSGlobalObject::reset):
  7499. (JSC::JSGlobalObject::mark):
  7500. * runtime/JSGlobalObject.h:
  7501. 2009-03-27 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  7502. Reviewed by Darin Adler.
  7503. Bug 24884: Include strings.h for strcasecmp()
  7504. https://bugs.webkit.org/show_bug.cgi?id=24884
  7505. * runtime/DateMath.cpp: Reversed previous change including strings.h
  7506. * wtf/StringExtras.h: Include strings.h here is available
  7507. 2009-03-26 Adam Roben <aroben@apple.com>
  7508. Copy testapi.js to $WebKitOutputDir on Windows
  7509. Part of Bug 24856: run-javascriptcore-tests should run testapi on
  7510. Windows
  7511. <https://bugs.webkit.org/show_bug.cgi?id=24856>
  7512. This matches what Mac does, which will help once we enable running
  7513. testapi from run-javascriptcore-tests on Windows.
  7514. Reviewed by Steve Falkenburg.
  7515. * JavaScriptCore.vcproj/testapi/testapi.vcproj: Copy testapi.js next
  7516. to testapi.exe.
  7517. 2009-03-25 Oliver Hunt <oliver@apple.com>
  7518. Reviewed by Geoff Garen.
  7519. Fix exception handling for instanceof in the interpreter.
  7520. * interpreter/Interpreter.cpp:
  7521. (JSC::Interpreter::privateExecute):
  7522. 2009-03-25 Geoffrey Garen <ggaren@apple.com>
  7523. Reviewed by Cameron Zwarich.
  7524. Fixed <rdar://problem/6724011> Write to freed memory in JSC::Label::deref
  7525. when reloading http://helpme.att.net/speedtest/
  7526. * bytecompiler/BytecodeGenerator.h: Reversed the declaration order for
  7527. m_labelScopes and m_labels to reverse their destruction order.
  7528. m_labelScopes has references to memory within m_labels, so its destructor
  7529. needs to run first.
  7530. 2009-03-24 Eli Fidler <eli.fidler@torchmobile.com>
  7531. Reviewed by George Staikos.
  7532. Correct warnings which in some environments are treated as errors.
  7533. * wtf/dtoa.cpp:
  7534. (WTF::b2d):
  7535. (WTF::d2b):
  7536. (WTF::strtod):
  7537. (WTF::dtoa):
  7538. 2009-03-24 Kevin Ollivier <kevino@theolliviers.com>
  7539. Reviewed by Darin Adler.
  7540. Explicitly define HAVE_LANGINFO_H on Darwin. Fixes the wx build bot jscore
  7541. test failure.
  7542. https://bugs.webkit.org/show_bug.cgi?id=24780
  7543. * wtf/Platform.h:
  7544. 2009-03-23 Oliver Hunt <oliver@apple.com>
  7545. Reviewed by Cameron Zwarich.
  7546. Fix className() for API defined class
  7547. * API/JSCallbackObjectFunctions.h:
  7548. (JSC::::className):
  7549. * API/tests/testapi.c:
  7550. (EmptyObject_class):
  7551. (main):
  7552. * API/tests/testapi.js:
  7553. 2009-03-23 Oliver Hunt <oliver@apple.com>
  7554. Reviewed by Geoff Garen.
  7555. Make testapi assertions run in release builds, so that testapi actually
  7556. works in a release build.
  7557. Many of the testapi assertions have side effects that are necessary, and
  7558. given testapi is a testing program, perf impact of an assertion is not
  7559. important, so it makes sense to apply the assertions in release builds
  7560. anyway.
  7561. * API/tests/testapi.c:
  7562. (EvilExceptionObject_hasInstance):
  7563. 2009-03-23 David Kilzer <ddkilzer@apple.com>
  7564. Provide JavaScript exception information after slow script timeout
  7565. Reviewed by Oliver Hunt.
  7566. * runtime/Completion.cpp:
  7567. (JSC::evaluate): Set the exception object as the Completion
  7568. object's value for slow script timeouts. This is used in
  7569. WebCore when reporting the exception.
  7570. * runtime/ExceptionHelpers.cpp:
  7571. (JSC::InterruptedExecutionError::toString): Added. Provides a
  7572. description message for the exception when it is reported.
  7573. 2009-03-23 Gustavo Noronha Silva <gns@gnome.org> and Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
  7574. Reviewed by Adam Roben.
  7575. https://bugs.webkit.org/show_bug.cgi?id=24674
  7576. Crashes in !PLATFORM(MAC)'s formatLocaleDate, in very specific situations
  7577. Make sure strftime never returns 2-digits years to avoid ambiguity
  7578. and a crash. We wrap this new code option in HAVE_LANGINFO_H,
  7579. since it is apparently not available in all platforms.
  7580. * runtime/DatePrototype.cpp:
  7581. (JSC::formatLocaleDate):
  7582. * wtf/Platform.h:
  7583. 2009-03-22 Oliver Hunt <oliver@apple.com>
  7584. Reviewed by Cameron Zwarich.
  7585. Fix exception handling in API
  7586. We can't just use the ExecState exception slot for returning exceptions
  7587. from class introspection functions provided through the API as many JSC
  7588. functions will explicitly clear the ExecState exception when returning.
  7589. * API/JSCallbackObjectFunctions.h:
  7590. (JSC::JSCallbackObject<Base>::getOwnPropertySlot):
  7591. (JSC::JSCallbackObject<Base>::put):
  7592. (JSC::JSCallbackObject<Base>::deleteProperty):
  7593. (JSC::JSCallbackObject<Base>::construct):
  7594. (JSC::JSCallbackObject<Base>::hasInstance):
  7595. (JSC::JSCallbackObject<Base>::call):
  7596. (JSC::JSCallbackObject<Base>::toNumber):
  7597. (JSC::JSCallbackObject<Base>::toString):
  7598. (JSC::JSCallbackObject<Base>::staticValueGetter):
  7599. (JSC::JSCallbackObject<Base>::callbackGetter):
  7600. * API/tests/testapi.c:
  7601. (MyObject_hasProperty):
  7602. (MyObject_getProperty):
  7603. (MyObject_setProperty):
  7604. (MyObject_deleteProperty):
  7605. (MyObject_callAsFunction):
  7606. (MyObject_callAsConstructor):
  7607. (MyObject_hasInstance):
  7608. (EvilExceptionObject_hasInstance):
  7609. (EvilExceptionObject_convertToType):
  7610. (EvilExceptionObject_class):
  7611. (main):
  7612. * API/tests/testapi.js:
  7613. (EvilExceptionObject.hasInstance):
  7614. (EvilExceptionObject.toNumber):
  7615. (EvilExceptionObject.toStringExplicit):
  7616. 2009-03-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  7617. Reviewed by Oliver Hunt.
  7618. Bug 20049: testapi failure: MyObject - 0 should be NaN but instead is 1.
  7619. <https://bugs.webkit.org/show_bug.cgi?id=20049>
  7620. <rdar://problem/6079127>
  7621. In this case, the test is wrong. According to the ECMA spec, subtraction
  7622. uses ToNumber, not ToPrimitive. Change the test to match the spec.
  7623. * API/tests/testapi.js:
  7624. 2009-03-21 Oliver Hunt <oliver@apple.com>
  7625. Reviewed by Cameron Zwarich.
  7626. Ensure that JSObjectMakeFunction doesn't produce incorrect line numbers.
  7627. Also make test api correctly propagate failures.
  7628. * API/tests/testapi.c:
  7629. (main):
  7630. * runtime/FunctionConstructor.cpp:
  7631. (JSC::constructFunction):
  7632. 2009-03-21 Oliver Hunt <oliver@apple.com>
  7633. Reviewed by Mark Rowe.
  7634. Improve testapi by making it report failures in a way we can pick up
  7635. from our test scripts.
  7636. * API/tests/testapi.c:
  7637. (assertEqualsAsBoolean):
  7638. (assertEqualsAsNumber):
  7639. (assertEqualsAsUTF8String):
  7640. (assertEqualsAsCharactersPtr):
  7641. (main):
  7642. * API/tests/testapi.js:
  7643. (pass):
  7644. (fail):
  7645. (shouldBe):
  7646. (shouldThrow):
  7647. 2009-03-20 Norbert Leser <norbert.leser@nokia.com>
  7648. Reviewed by Darin Adler.
  7649. https://bugs.webkit.org/show_bug.cgi?id=24535
  7650. Fixes missing line terminator character (;) after macro call.
  7651. It is common practice to add the trailing ";" where macros are substituted
  7652. and not where they are defined with #define.
  7653. This change is consistent with other macro declarations across webkit,
  7654. and it also solves compilation failure with symbian compilers.
  7655. * runtime/UString.cpp:
  7656. * wtf/Assertions.h:
  7657. 2009-03-20 Geoffrey Garen <ggaren@apple.com>
  7658. Reviewed by Darin Adler.
  7659. Fixed a JavaScriptCore crash on the Windows buildbot.
  7660. * bytecompiler/BytecodeGenerator.h: Reduced the AST recursion limit.
  7661. Apparently, Windows has small stacks.
  7662. 2009-03-20 Geoffrey Garen <ggaren@apple.com>
  7663. Reviewed by Oliver Hunt.
  7664. A little cleanup in the RegisterFile code.
  7665. Moved large inline functions out of the class declaration, to make it
  7666. more readable.
  7667. Switched over to using the roundUpAllocationSize function to avoid
  7668. duplicate code and subtle bugs.
  7669. Renamed m_maxCommitted to m_commitEnd, to match m_end.
  7670. Renamed allocationSize to commitSize because it's the chunk size for
  7671. committing memory, not allocating memory.
  7672. SunSpider reports no change.
  7673. * interpreter/RegisterFile.h:
  7674. (JSC::RegisterFile::RegisterFile):
  7675. (JSC::RegisterFile::shrink):
  7676. (JSC::RegisterFile::grow):
  7677. * jit/ExecutableAllocator.h:
  7678. (JSC::roundUpAllocationSize):
  7679. 2009-03-19 Geoffrey Garen <ggaren@apple.com>
  7680. Reviewed by Oliver Hunt.
  7681. Fixed <rdar://problem/6033712> -- a little bit of hardening in the Collector.
  7682. SunSpider reports no change. I also verified in the disassembly that
  7683. we end up with a single compare to constant.
  7684. * runtime/Collector.cpp:
  7685. (JSC::Heap::heapAllocate):
  7686. 2009-03-19 Geoffrey Garen <ggaren@apple.com>
  7687. Reviewed by Cameron Zwarich and Oliver Hunt.
  7688. Fixed <rdar://problem/6406045> REGRESSION: Stack overflow on PowerPC on
  7689. fast/workers/use-machine-stack.html (22531)
  7690. Dialed down the re-entry allowance to 64 (from 128).
  7691. On a 512K stack, this leaves about 64K for other code on the stack while
  7692. JavaScript is running. Not perfect, but it solves our crash on PPC.
  7693. Different platforms may want to dial this down even more.
  7694. Also, substantially shrunk BytecodeGenerator. Since we allocate one on
  7695. the stack in order to throw a stack overflow exception -- well, let's
  7696. just say the old code had an appreciation for irony.
  7697. SunSpider reports no change.
  7698. * bytecompiler/BytecodeGenerator.h:
  7699. * interpreter/Interpreter.h:
  7700. (JSC::):
  7701. 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  7702. Reviewed by Oliver Hunt.
  7703. Bug 24350: REGRESSION: Safari 4 breaks SPAW wysiwyg editor multiple instances
  7704. <https://bugs.webkit.org/show_bug.cgi?id=24350>
  7705. <rdar://problem/6674182>
  7706. The SPAW editor's JavaScript assumes that toString() on a function
  7707. constructed with the Function constructor produces a function with
  7708. a newline after the opening brace.
  7709. * runtime/FunctionConstructor.cpp:
  7710. (JSC::constructFunction): Add a newline after the opening brace of the
  7711. function's source code.
  7712. 2009-03-19 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  7713. Reviewed by Geoff Garen.
  7714. Bug 23771: REGRESSION (r36016): JSObjectHasProperty freezes on global class without kJSClassAttributeNoAutomaticPrototype
  7715. <https://bugs.webkit.org/show_bug.cgi?id=23771>
  7716. <rdar://problem/6561016>
  7717. * API/tests/testapi.c:
  7718. (main): Add a test for this bug.
  7719. * runtime/JSGlobalObject.cpp:
  7720. (JSC::JSGlobalObject::resetPrototype): Don't set the prototype of the
  7721. last object in the prototype chain to the object prototype when the
  7722. object prototype is already the last object in the prototype chain.
  7723. 2009-03-19 Timothy Hatcher <timothy@apple.com>
  7724. <rdar://problem/6687342> -[WebView scheduleInRunLoop:forMode:] has no affect on timers
  7725. Reviewed by Darin Adler.
  7726. * wtf/Platform.h: Added HAVE_RUNLOOP_TIMER for PLATFORM(MAC).
  7727. 2009-03-19 Geoffrey Garen <ggaren@apple.com>
  7728. Reviewed by Oliver Hunt.
  7729. Fixed <rdar://problem/6279213> Regular expression run-time complexity
  7730. limit too low for long inputs (21485)
  7731. I raised PCRE's "matchLimit" (limit on backtracking) by an order of
  7732. magnitude. This fixes all the reported examples of timing out on legitimate
  7733. regular expression matches.
  7734. In my testing on a Core Duo MacBook Pro, the longest you can get stuck
  7735. trying to match a string is still under 1s, so this seems like a safe change.
  7736. I can think of a number of better solutions that are more complicated,
  7737. but this is a good improvement for now.
  7738. * pcre/pcre_exec.cpp:
  7739. 2009-03-19 Geoffrey Garen <ggaren@apple.com>
  7740. Reviewed by Sam Weinig.
  7741. Fixed <rdar://problem/6603562> REGRESSION (Safari 4): regular expression
  7742. pattern size limit lower than Safari 3.2, other browsers, breaks SAP (14873)
  7743. Bumped the pattern size limit to 1MB, and standardized it between PCRE
  7744. and WREC. (Empirical testing says that we can easily compile a 1MB regular
  7745. expression without risking a hang. Other browsers support bigger regular
  7746. expressions, but also hang.)
  7747. SunSpider reports no change.
  7748. I started with a patch posted to Bugzilla by Erik Corry (erikcorry@google.com).
  7749. * pcre/pcre_internal.h:
  7750. (put3ByteValue):
  7751. (get3ByteValue):
  7752. (put3ByteValueAndAdvance):
  7753. (putLinkValueAllowZero):
  7754. (getLinkValueAllowZero): Made PCRE's "LINK_SIZE" (the number of bytes
  7755. used to record jumps between bytecodes) 3, to accomodate larger potential
  7756. jumps. Bumped PCRE's "MAX_PATTERN_SIZE" to 1MB. (Technically, at this
  7757. LINK_SIZE, we can support even larger patterns, but we risk a hang during
  7758. compilation, and it's not clear that such large patterns are important
  7759. on the web.)
  7760. * wrec/WREC.cpp:
  7761. (JSC::WREC::Generator::compileRegExp): Match PCRE's maximum pattern size,
  7762. to avoid quirks between platforms.
  7763. 2009-03-18 Ada Chan <adachan@apple.com>
  7764. Rolling out r41818 since it broke the windows build.
  7765. Error: ..\..\runtime\DatePrototype.cpp(30) : fatal error C1083: Cannot open include file: 'langinfo.h': No such file or directory
  7766. * runtime/DatePrototype.cpp:
  7767. (JSC::formatLocaleDate):
  7768. 2009-03-17 Oliver Hunt <oliver@apple.com>
  7769. Reviewed by Cameron Zwarich.
  7770. <rdar://problem/6692138> REGRESSION (Safari 4): Incorrect function return value when using IE "try ... finally" memory leak work-around (24654)
  7771. <https://bugs.webkit.org/show_bug.cgi?id=24654>
  7772. If the return value for a function is in a local register we need
  7773. to copy it before executing any finalisers, otherwise it is possible
  7774. for the finaliser to clobber the result.
  7775. * bytecompiler/BytecodeGenerator.h:
  7776. (JSC::BytecodeGenerator::hasFinaliser):
  7777. * parser/Nodes.cpp:
  7778. (JSC::ReturnNode::emitBytecode):
  7779. 2009-03-17 Kevin Ollivier <kevino@theolliviers.com>
  7780. Reviewed by Mark Rowe.
  7781. Move BUILDING_ON_* defines into Platform.h to make them available to other ports.
  7782. Also tweak the defines so that they work with the default values set by
  7783. AvailabilityMacros.h.
  7784. https://bugs.webkit.org/show_bug.cgi?id=24630
  7785. * JavaScriptCorePrefix.h:
  7786. * wtf/Platform.h:
  7787. 2009-03-15 Simon Fraser <simon.fraser@apple.com>
  7788. Revert r41718 because it broke DumpRenderTree on Tiger.
  7789. * JavaScriptCorePrefix.h:
  7790. * wtf/Platform.h:
  7791. 2009-03-15 Kevin Ollivier <kevino@theolliviers.com>
  7792. Non-Apple Mac ports build fix. Move defines for the BUILDING_ON_ macros into
  7793. Platform.h so that they're defined for all ports building on Mac, and tweak
  7794. the definitions of those macros based on Mark Rowe's suggestions to accomodate
  7795. cases where the values may not be <= to the .0 release for that version.
  7796. * JavaScriptCorePrefix.h:
  7797. * wtf/Platform.h:
  7798. 2009-03-13 Mark Rowe <mrowe@apple.com>
  7799. Rubber-stamped by Dan Bernstein.
  7800. Take advantage of the ability of recent versions of Xcode to easily switch the active
  7801. architecture.
  7802. * Configurations/DebugRelease.xcconfig:
  7803. 2009-03-13 Mark Rowe <mrowe@apple.com>
  7804. Reviewed by David Kilzer.
  7805. Prevent AllInOneFile.cpp and ProfileGenerator.cpp from rebuilding unnecessarily when
  7806. switching between building in Xcode and via build-webkit.
  7807. build-webkit passes FEATURE_DEFINES to xcodebuild, resulting in it being present in the
  7808. Derived Sources build settings. When building in Xcode, this setting isn't present so
  7809. Xcode reruns the script build phases. This results in a new version of TracingDtrace.h
  7810. being generated, and the files that include it being rebuilt.
  7811. * JavaScriptCore.xcodeproj/project.pbxproj: Don't regenerate TracingDtrace.h if it is
  7812. already newer than the input file.
  7813. 2009-03-13 Norbert Leser <norbert.leser@nokia.com>
  7814. Reviewed by Darin Adler.
  7815. Resolved name conflict with globally defined tzname in Symbian.
  7816. Replaced with different name instead of using namespace qualifier
  7817. (appeared to be less clumsy).
  7818. * runtime/DateMath.cpp:
  7819. 2009-03-12 Mark Rowe <mrowe@apple.com>
  7820. Reviewed by Darin Adler.
  7821. <rdar://problem/6548446> TCMalloc_SystemRelease should use madvise rather than re-mmaping span of pages
  7822. * wtf/FastMalloc.cpp:
  7823. (WTF::mergeDecommittedStates): If either of the spans has been released to the system, release the other
  7824. span as well so that the flag in the merged span is accurate.
  7825. * wtf/Platform.h:
  7826. * wtf/TCSystemAlloc.cpp: Track decommitted spans when using MADV_FREE_REUSABLE / MADV_FREE_REUSE.
  7827. (TCMalloc_SystemRelease): Use madvise with MADV_FREE_REUSABLE when it is available.
  7828. (TCMalloc_SystemCommit): Use madvise with MADV_FREE_REUSE when it is available.
  7829. * wtf/TCSystemAlloc.h:
  7830. 2009-03-12 Adam Treat <adam.treat@torchmobile.com>
  7831. Reviewed by NOBODY (Build fix).
  7832. Include string.h for strlen usage.
  7833. * wtf/Threading.cpp:
  7834. 2009-03-12 David Kilzer <ddkilzer@apple.com>
  7835. Add NO_RETURN attribute to runInteractive() when not using readline
  7836. Reviewed by Darin Adler.
  7837. * jsc.cpp:
  7838. (runInteractive): If the readline library is not used, this method
  7839. will never return, thus the NO_RETURN attribute is needed to prevent
  7840. a gcc warning.
  7841. 2009-03-12 Adam Roben <aroben@apple.com>
  7842. Adopt setThreadNameInternal on Windows
  7843. Also changed a Windows-only assertion about thread name length to an
  7844. all-platform log message.
  7845. Reviewed by Adam Treat.
  7846. * wtf/Threading.cpp:
  7847. (WTF::createThread): Warn if the thread name is longer than 31
  7848. characters, as Visual Studio will truncate names longer than that
  7849. length.
  7850. * wtf/ThreadingWin.cpp:
  7851. (WTF::setThreadNameInternal): Renamed from setThreadName and changed
  7852. to always operate on the current thread.
  7853. (WTF::initializeThreading): Changed to use setThreadNameInternal.
  7854. (WTF::createThreadInternal): Removed call to setThreadName. This is
  7855. now handled by threadEntryPoint and setThreadNameInternal.
  7856. 2009-03-11 David Kilzer <ddkilzer@apple.com>
  7857. Clarify comments regarding order of FEATURE_DEFINES
  7858. Rubber-stamped by Mark Rowe.
  7859. * Configurations/JavaScriptCore.xcconfig: Added warning about
  7860. the consequences when FEATURE_DEFINES are not kept in sync.
  7861. 2009-03-11 Dan Bernstein <mitz@apple.com>
  7862. Reviewed by Darin Adler.
  7863. - WTF support for fixing <rdar://problem/3919124> Thai text selection
  7864. in Safari is incorrect
  7865. * wtf/unicode/icu/UnicodeIcu.h:
  7866. (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added. Returns
  7867. whether the character has Unicode line breaking property value SA
  7868. ("Complex Context").
  7869. * wtf/unicode/qt4/UnicodeQt4.h:
  7870. (WTF::Unicode::hasLineBreakingPropertyComplexContext): Added an
  7871. implementation that always returns false.
  7872. 2009-03-11 Darin Adler <darin@apple.com>
  7873. Reviewed by Mark Rowe.
  7874. Give threads names on platforms with pthread_setname_np.
  7875. * wtf/Threading.cpp:
  7876. (WTF::NewThreadContext::NewThreadContext): Initialize thread name.
  7877. (WTF::threadEntryPoint): Call setThreadNameInternal.
  7878. (WTF::createThread): Pass thread name.
  7879. * wtf/Threading.h: Added new comments, setThreadNameInternal.
  7880. * wtf/ThreadingGtk.cpp:
  7881. (WTF::setThreadNameInternal): Added. Empty.
  7882. * wtf/ThreadingNone.cpp:
  7883. (WTF::setThreadNameInternal): Added. Empty.
  7884. * wtf/ThreadingPthreads.cpp:
  7885. (WTF::setThreadNameInternal): Call pthread_setname_np when available.
  7886. * wtf/ThreadingQt.cpp:
  7887. (WTF::setThreadNameInternal): Added. Empty.
  7888. * wtf/ThreadingWin.cpp:
  7889. (WTF::setThreadNameInternal): Added. Empty.
  7890. 2009-03-11 Adam Roben <aroben@apple.com>
  7891. Change the Windows implementation of ThreadSpecific to use functions
  7892. instead of extern globals
  7893. This will make it easier to export ThreadSpecific from WebKit.
  7894. Reviewed by John Sullivan.
  7895. * API/JSBase.cpp:
  7896. (JSEvaluateScript):
  7897. Touched this file to force ThreadSpecific.h to be copied into
  7898. $WebKitOutputDir.
  7899. * wtf/ThreadSpecific.h: Replaced g_tls_key_count with tlsKeyCount()
  7900. and g_tls_keys with tlsKeys().
  7901. (WTF::::ThreadSpecific):
  7902. (WTF::::~ThreadSpecific):
  7903. (WTF::::get):
  7904. (WTF::::set):
  7905. (WTF::::destroy):
  7906. Updated to use the new functions.
  7907. * wtf/ThreadSpecificWin.cpp:
  7908. (WTF::tlsKeyCount):
  7909. (WTF::tlsKeys):
  7910. Added.
  7911. (WTF::ThreadSpecificThreadExit): Changed to use the new functions.
  7912. 2009-03-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  7913. Reviewed by Geoff Garen.
  7914. Bug 24291: REGRESSION (r38635): Single line JavaScript comment prevents HTML button click handler execution
  7915. <https://bugs.webkit.org/show_bug.cgi?id=24291>
  7916. <rdar://problem/6663472>
  7917. Add an extra newline to the end of the body of the program text constructed
  7918. by the Function constructor for parsing. This allows single line comments to
  7919. be handled correctly by the parser.
  7920. * runtime/FunctionConstructor.cpp:
  7921. (JSC::constructFunction):
  7922. 2009-03-09 Oliver Hunt <oliver@apple.com>
  7923. Reviewed by Gavin Barraclough.
  7924. Bug 24447: REGRESSION (r41508): Google Maps does not complete initialization
  7925. <rdar://problem/6657774>
  7926. r41508 actually exposed a pre-existing bug where we were not invalidating the result
  7927. register cache at jump targets. This causes problems when condition loads occur in an
  7928. expression -- namely through the ?: and || operators. This patch corrects these issues
  7929. by marking the target of all forward jumps as being a jump target, and then clears the
  7930. result register cache when ever it starts generating code for a targeted instruction.
  7931. I do not believe it is possible to cause this class of failure outside of a single
  7932. expression, and expressions only provide forward branches, so this should resolve this
  7933. entire class of bug. That said i've included a test case that gets as close as possible
  7934. to hitting this bug with a back branch, to hopefully prevent anyone from introducing the
  7935. problem in future.
  7936. * assembler/AbstractMacroAssembler.h:
  7937. (JSC::AbstractMacroAssembler::Label::isUsed):
  7938. (JSC::AbstractMacroAssembler::Label::used):
  7939. * assembler/X86Assembler.h:
  7940. (JSC::X86Assembler::JmpDst::JmpDst):
  7941. (JSC::X86Assembler::JmpDst::isUsed):
  7942. (JSC::X86Assembler::JmpDst::used):
  7943. * jit/JIT.cpp:
  7944. (JSC::JIT::privateCompileMainPass):
  7945. 2009-03-09 David Levin <levin@chromium.org>
  7946. Reviewed by Darin Adler.
  7947. Bug 23175: String and UString should be able to share a UChar* buffer.
  7948. <https://bugs.webkit.org/show_bug.cgi?id=23175>
  7949. Add CrossThreadRefCounted.
  7950. * wtf/CrossThreadRefCounted.h: Added.
  7951. (WTF::CrossThreadRefCounted::create):
  7952. (WTF::CrossThreadRefCounted::isShared):
  7953. (WTF::CrossThreadRefCounted::dataAccessMustBeThreadSafe):
  7954. (WTF::CrossThreadRefCounted::mayBePassedToAnotherThread):
  7955. (WTF::CrossThreadRefCounted::CrossThreadRefCounted):
  7956. (WTF::CrossThreadRefCounted::~CrossThreadRefCounted):
  7957. (WTF::CrossThreadRefCounted::ref):
  7958. (WTF::CrossThreadRefCounted::deref):
  7959. (WTF::CrossThreadRefCounted::release):
  7960. (WTF::CrossThreadRefCounted::copy):
  7961. (WTF::CrossThreadRefCounted::threadSafeDeref):
  7962. * wtf/RefCounted.h:
  7963. * wtf/Threading.h:
  7964. (WTF::ThreadSafeSharedBase::ThreadSafeSharedBase):
  7965. (WTF::ThreadSafeSharedBase::derefBase):
  7966. (WTF::ThreadSafeShared::ThreadSafeShared):
  7967. (WTF::ThreadSafeShared::deref):
  7968. 2009-03-09 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  7969. Reviewed by George Staikos.
  7970. https://bugs.webkit.org/show_bug.cgi?id=24353
  7971. Allow to overrule default build options for Qt build.
  7972. * JavaScriptCore.pri: Allow to overrule ENABLE_JIT
  7973. 2009-03-08 Oliver Hunt <oliver@apple.com>
  7974. Reviewed by NOBODY (build fix).
  7975. Build fix.
  7976. * runtime/ArrayPrototype.cpp:
  7977. (JSC::arrayProtoFuncConcat):
  7978. 2009-03-01 Oliver Hunt <oliver@apple.com>
  7979. Reviewed by Cameron Zwarich.
  7980. Bug 24268: RuntimeArray is not a fully implemented JSArray
  7981. <https://bugs.webkit.org/show_bug.cgi?id=24268>
  7982. Don't cast a type to JSArray, just because it reportsArray as a supertype
  7983. in the JS type system. Doesn't appear feasible to create a testcase
  7984. unfortunately as setting up the failure conditions requires internal access
  7985. to JSC not present in DRT.
  7986. * runtime/ArrayPrototype.cpp:
  7987. (JSC::arrayProtoFuncConcat):
  7988. 2009-03-06 Gavin Barraclough <barraclough@apple.com>
  7989. Reviewed by Oliver Hunt.
  7990. When preforming an op_mov, preserve any existing register mapping.
  7991. ~0.5% progression on v8 tests x86-64.
  7992. * jit/JIT.cpp:
  7993. (JSC::JIT::privateCompileMainPass):
  7994. 2009-03-05 Simone Fiorentino <simone.fiorentino@consulenti.fastweb.it>
  7995. Bug 24382: request to add SH4 platform
  7996. <https://bugs.webkit.org/show_bug.cgi?id=24382>
  7997. Reviewed by David Kilzer.
  7998. * wtf/Platform.h: Added support for SH4 platform.
  7999. 2009-03-05 Gavin Barraclough <barraclough@apple.com>
  8000. Reviewed by Oliver Hunt.
  8001. Writes of constant values to SF registers should be made with direct memory
  8002. writes where possible, rather than moving the value via a hardware register.
  8003. ~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.
  8004. * assembler/MacroAssemblerX86_64.h:
  8005. (JSC::MacroAssemblerX86_64::storePtr):
  8006. * assembler/X86Assembler.h:
  8007. (JSC::X86Assembler::movq_i32m):
  8008. * jit/JIT.cpp:
  8009. (JSC::JIT::privateCompileMainPass):
  8010. 2009-03-05 Mark Rowe <mrowe@apple.com>
  8011. Fix the build.
  8012. Sprinkle "static" around NumberConstructor.cpp in order to please the compiler.
  8013. * runtime/NumberConstructor.cpp:
  8014. (JSC::numberConstructorNaNValue):
  8015. (JSC::numberConstructorNegInfinity):
  8016. (JSC::numberConstructorPosInfinity):
  8017. (JSC::numberConstructorMaxValue):
  8018. (JSC::numberConstructorMinValue):
  8019. 2009-03-04 Mark Rowe <mrowe@apple.com>
  8020. Reviewed by Oliver Hunt.
  8021. <rdar://problem/6354858> FastMallocZone's enumeration code reports fragmented administration space
  8022. The handling of MALLOC_ADMIN_REGION_RANGE_TYPE in FastMalloc's zone was incorrect. It was attempting
  8023. to record the memory containing and individual span as an administrative region, when all memory
  8024. allocated via MetaDataAlloc should in fact be recorded. This was causing memory regions allocated
  8025. via MetaDataAlloc to appear as "VM_ALLOCATE ?" in vmmap output. They are now correctly reported as
  8026. "MALLOC_OTHER" regions associated with the JavaScriptCore FastMalloc zone.
  8027. Memory is allocated via MetaDataAlloc from two locations: PageHeapAllocator, and TCMalloc_PageMap{2,3}.
  8028. These two cases are handled differently.
  8029. PageHeapAllocator is extended to keep a linked list of memory regions that it has allocated. The
  8030. first object in an allocated region contains the link to the previously allocated region. To record
  8031. the administrative regions of a PageHeapAllocator we can simply walk the linked list and record
  8032. each allocated region we encounter.
  8033. TCMalloc_PageMaps allocate memory via MetaDataAlloc to store each level of the radix tree. To record
  8034. the administrative regions of a TCMalloc_PageMap we walk the tree and record the storage used for nodes
  8035. at each position rather than the nodes themselves.
  8036. A small performance improvement is achieved by coalescing adjacent memory regions inside the PageMapMemoryUsageRecorder
  8037. so that fewer calls in to the range recorder are necessary. We further reduce the number of calls to the
  8038. range recorder by aggregating the in-use ranges of a given memory region into a local buffer before recording
  8039. them with a single call. A similar approach is also used by AdminRegionRecorder.
  8040. * wtf/FastMalloc.cpp:
  8041. (WTF::PageHeapAllocator::Init):
  8042. (WTF::PageHeapAllocator::New):
  8043. (WTF::PageHeapAllocator::recordAdministrativeRegions):
  8044. (WTF::TCMallocStats::FreeObjectFinder::isFreeObject):
  8045. (WTF::TCMallocStats::PageMapMemoryUsageRecorder::~PageMapMemoryUsageRecorder):
  8046. (WTF::TCMallocStats::PageMapMemoryUsageRecorder::recordPendingRegions):
  8047. (WTF::TCMallocStats::PageMapMemoryUsageRecorder::visit):
  8048. (WTF::TCMallocStats::AdminRegionRecorder::AdminRegionRecorder):
  8049. (WTF::TCMallocStats::AdminRegionRecorder::recordRegion):
  8050. (WTF::TCMallocStats::AdminRegionRecorder::visit):
  8051. (WTF::TCMallocStats::AdminRegionRecorder::recordPendingRegions):
  8052. (WTF::TCMallocStats::AdminRegionRecorder::~AdminRegionRecorder):
  8053. (WTF::TCMallocStats::FastMallocZone::enumerate):
  8054. (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
  8055. (WTF::TCMallocStats::FastMallocZone::init):
  8056. * wtf/TCPageMap.h:
  8057. (TCMalloc_PageMap2::visitValues):
  8058. (TCMalloc_PageMap2::visitAllocations):
  8059. (TCMalloc_PageMap3::visitValues):
  8060. (TCMalloc_PageMap3::visitAllocations):
  8061. 2009-03-04 Antti Koivisto <antti@apple.com>
  8062. Reviewed by Dave Hyatt.
  8063. https://bugs.webkit.org/show_bug.cgi?id=24359
  8064. Repaint throttling mechanism
  8065. Set ENABLE_REPAINT_THROTTLING to 0 by default.
  8066. * wtf/Platform.h:
  8067. 2009-03-03 David Kilzer <ddkilzer@apple.com>
  8068. <rdar://problem/6581203> WebCore and WebKit should install the same set of headers during installhdrs phase as build phase
  8069. Reviewed by Mark Rowe.
  8070. * Configurations/Base.xcconfig: Defined REAL_PLATFORM_NAME based
  8071. on PLATFORM_NAME to work around the missing definition on Tiger.
  8072. Updated HAVE_DTRACE to use REAL_PLATFORM_NAME.
  8073. 2009-03-03 Kevin McCullough <kmccullough@apple.com>
  8074. Reviewed by Oliver Hunt.
  8075. <rdar://problem/6639110> console.profile() doesn't work without a title
  8076. * profiler/Profiler.cpp:
  8077. (JSC::Profiler::startProfiling): assert if there is not title to ensure
  8078. we don't start profiling without one.
  8079. 2009-03-02 Sam Weinig <sam@webkit.org>
  8080. Reviewed by Mark Rowe.
  8081. Enable Geolocation (except on Tiger and Leopard).
  8082. * Configurations/JavaScriptCore.xcconfig:
  8083. 2009-03-01 David Kilzer <ddkilzer@apple.com>
  8084. <rdar://problem/6635688> Move HAVE_DTRACE check to Base.xcconfig
  8085. Reviewed by Mark Rowe.
  8086. * Configurations/Base.xcconfig: Set HAVE_DTRACE Xcode variable
  8087. based on PLATFORM_NAME and MAC_OS_X_VERSION_MAJOR. Also define
  8088. it as a preprocessor macro by modifying
  8089. GCC_PREPROCESSOR_DEFINITIONS.
  8090. * JavaScriptCore.xcodeproj/project.pbxproj: Changed "Generate
  8091. DTrace header" script phase to check for HAVE_DTRACE instead of
  8092. MACOSX_DEPLOYMENT_TARGET.
  8093. * wtf/Platform.h: Removed definition of HAVE_DTRACE macro since
  8094. it's defined in Base.xcconfig now.
  8095. 2009-03-01 Horia Olaru <olaru@adobe.com>
  8096. By looking in grammar.y there are only a few types of statement nodes
  8097. on which the debugger should stop.
  8098. Removed isBlock and isLoop virtual calls. No need to emit debug hooks in
  8099. the "statementListEmitCode" method as long as the necessary hooks can be
  8100. added in each "emitCode".
  8101. https://bugs.webkit.org/show_bug.cgi?id=21073
  8102. Reviewed by Kevin McCullough.
  8103. * parser/Nodes.cpp:
  8104. (JSC::ConstStatementNode::emitBytecode):
  8105. (JSC::statementListEmitCode):
  8106. (JSC::EmptyStatementNode::emitBytecode):
  8107. (JSC::ExprStatementNode::emitBytecode):
  8108. (JSC::VarStatementNode::emitBytecode):
  8109. (JSC::IfNode::emitBytecode):
  8110. (JSC::IfElseNode::emitBytecode):
  8111. (JSC::DoWhileNode::emitBytecode):
  8112. (JSC::WhileNode::emitBytecode):
  8113. (JSC::ForNode::emitBytecode):
  8114. (JSC::ForInNode::emitBytecode):
  8115. (JSC::ContinueNode::emitBytecode):
  8116. (JSC::BreakNode::emitBytecode):
  8117. (JSC::ReturnNode::emitBytecode):
  8118. (JSC::WithNode::emitBytecode):
  8119. (JSC::SwitchNode::emitBytecode):
  8120. (JSC::LabelNode::emitBytecode):
  8121. (JSC::ThrowNode::emitBytecode):
  8122. (JSC::TryNode::emitBytecode):
  8123. * parser/Nodes.h:
  8124. 2009-02-26 Gavin Barraclough <barraclough@apple.com>
  8125. Reviewed by Geoff Garen.
  8126. Fix bug #23614. Switches on double precision values were incorrectly
  8127. truncating the scrutinee value. E.g.:
  8128. switch (1.1) { case 1: print("FAIL"); }
  8129. Was resulting in FAIL.
  8130. * interpreter/Interpreter.cpp:
  8131. (JSC::Interpreter::privateExecute):
  8132. * jit/JITStubs.cpp:
  8133. (JSC::JITStubs::cti_op_switch_imm):
  8134. 2009-02-26 Gavin Barraclough <barraclough@apple.com>
  8135. Reviewed by Oliver Hunt.
  8136. Integer Immediate representation need not be canonical in x86 JIT code.
  8137. On x86-64 we already have loosened the requirement that the int immediate
  8138. representation in canonical, we should bring x86 into line.
  8139. This patch is a minor (~0.5%) improvement on sunspider & v8-tests, and
  8140. should reduce memory footoprint (reduces JIT code size).
  8141. * jit/JIT.cpp:
  8142. (JSC::JIT::compileOpStrictEq):
  8143. (JSC::JIT::privateCompileSlowCases):
  8144. * jit/JIT.h:
  8145. (JSC::JIT::emitJumpIfImmediateNumber):
  8146. (JSC::JIT::emitJumpIfNotImmediateNumber):
  8147. * jit/JITArithmetic.cpp:
  8148. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  8149. (JSC::JIT::compileBinaryArithOp):
  8150. 2009-02-26 Carol Szabo <carol.szabo@nokia.com>
  8151. Reviewed by Darin Adler.
  8152. https://bugs.webkit.org/show_bug.cgi?id=24099
  8153. ARM Compiler Warnings in pcre_exec.cpp
  8154. * pcre/pcre_exec.cpp:
  8155. (match):
  8156. 2009-02-25 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  8157. Reviewed by Gavin Barraclough.
  8158. Bug 24086: Regression (r40993): WebKit crashes after logging in to lists.zenbe
  8159. <https://bugs.webkit.org/show_bug.cgi?id=24086>
  8160. <rdar://problem/6625111>
  8161. The numeric sort optimization in r40993 generated bytecode for a function
  8162. without generating JIT code. This breaks an assumption in some parts of
  8163. the JIT's function calling logic that the presence of a CodeBlock implies
  8164. the existence of JIT code.
  8165. In order to fix this, we simply generate JIT code whenever we check whether
  8166. a function is a numeric sort function. This only incurs an additional cost
  8167. in the case when the function is a numeric sort function, in which case it
  8168. is not expensive to generate JIT code for it.
  8169. * runtime/ArrayPrototype.cpp:
  8170. (JSC::isNumericCompareFunction):
  8171. 2009-02-25 Geoffrey Garen <ggaren@apple.com>
  8172. Reviewed by Maciej Stachowiak.
  8173. Fixed <rdar://problem/6611174> REGRESSION (r36701): Unable to select
  8174. messages on hotmail (24052)
  8175. The bug was that for-in enumeration used a cached prototype chain without
  8176. validating that it was up-to-date.
  8177. This led me to refactor prototype chain caching so it was easier to work
  8178. with and harder to get wrong.
  8179. After a bit of inlining, this patch is performance-neutral on SunSpider
  8180. and the v8 benchmarks.
  8181. * interpreter/Interpreter.cpp:
  8182. (JSC::Interpreter::tryCachePutByID):
  8183. (JSC::Interpreter::tryCacheGetByID):
  8184. * jit/JITStubs.cpp:
  8185. (JSC::JITStubs::tryCachePutByID):
  8186. (JSC::JITStubs::tryCacheGetByID):
  8187. (JSC::JITStubs::cti_op_get_by_id_proto_list): Use the new refactored goodness. See
  8188. lines beginning with "-" and smile.
  8189. * runtime/JSGlobalObject.h:
  8190. (JSC::Structure::prototypeForLookup): A shout out to const.
  8191. * runtime/JSPropertyNameIterator.h:
  8192. (JSC::JSPropertyNameIterator::next): We can use a pointer comparison to
  8193. see if our cached structure chain is equal to the object's structure chain,
  8194. since in the case of a cache hit, we share references to the same structure
  8195. chain.
  8196. * runtime/Operations.h:
  8197. (JSC::countPrototypeChainEntriesAndCheckForProxies): Use the new refactored
  8198. goodness.
  8199. * runtime/PropertyNameArray.h:
  8200. (JSC::PropertyNameArray::PropertyNameArray):
  8201. (JSC::PropertyNameArray::setShouldCache):
  8202. (JSC::PropertyNameArray::shouldCache): Renamed "cacheable" to "shouldCache"
  8203. to communicate that the client is specifying a recommendation, not a
  8204. capability.
  8205. * runtime/Structure.cpp:
  8206. (JSC::Structure::Structure): No need to initialize a RefPtr.
  8207. (JSC::Structure::getEnumerablePropertyNames): Moved some code into helper
  8208. functions.
  8209. (JSC::Structure::prototypeChain): New centralized accessor for a prototype
  8210. chain. Revalidates on every access, since the objects in the prototype
  8211. chain may have mutated.
  8212. (JSC::Structure::isValid): Helper function for revalidating a cached
  8213. prototype chain.
  8214. (JSC::Structure::getEnumerableNamesFromPropertyTable):
  8215. (JSC::Structure::getEnumerableNamesFromClassInfoTable): Factored out of
  8216. getEnumerablePropertyNames.
  8217. * runtime/Structure.h:
  8218. * runtime/StructureChain.cpp:
  8219. (JSC::StructureChain::StructureChain):
  8220. * runtime/StructureChain.h:
  8221. (JSC::StructureChain::create): No need for structureChainsAreEqual, since
  8222. we use pointer equality now. Refactored StructureChain to make a little
  8223. more sense and eliminate special cases for null prototypes.
  8224. 2009-02-25 Steve Falkenburg <sfalken@apple.com>
  8225. Use timeBeginPeriod to enable timing resolution greater than 16ms in command line jsc for Windows.
  8226. Allows more accurate reporting of benchmark times via command line jsc.exe. Doesn't affect WebKit's use of JavaScriptCore.
  8227. Reviewed by Adam Roben.
  8228. * jsc.cpp:
  8229. (main):
  8230. 2009-02-24 Geoffrey Garen <ggaren@apple.com>
  8231. Build fix?
  8232. * GNUmakefile.am:
  8233. 2009-02-24 Mark Rowe <mrowe@apple.com>
  8234. Reviewed by Oliver Hunt.
  8235. <rdar://problem/6259220> Rename AVAILABLE_AFTER_WEBKIT_VERSION_3_1 (etc.) to match the other macros
  8236. * API/JSBasePrivate.h:
  8237. * API/JSContextRef.h:
  8238. * API/JSObjectRef.h:
  8239. * API/WebKitAvailability.h:
  8240. 2009-02-23 Geoffrey Garen <ggaren@apple.com>
  8241. Reviewed by Sam Weinig.
  8242. Next step in splitting JIT functionality out of the Interpreter class:
  8243. Moved vptr storage from Interpreter to JSGlobalData, so it could be shared
  8244. between Interpreter and JITStubs, and moved the *Trampoline JIT stubs
  8245. into the JITStubs class. Also added a VPtrSet class to encapsulate vptr
  8246. hacks during JSGlobalData initialization.
  8247. SunSpider says 0.4% faster. Meh.
  8248. * JavaScriptCore.exp:
  8249. * JavaScriptCore.xcodeproj/project.pbxproj:
  8250. * interpreter/Interpreter.cpp:
  8251. (JSC::Interpreter::Interpreter):
  8252. (JSC::Interpreter::tryCacheGetByID):
  8253. (JSC::Interpreter::privateExecute):
  8254. * interpreter/Interpreter.h:
  8255. * jit/JIT.cpp:
  8256. (JSC::JIT::privateCompileMainPass):
  8257. (JSC::JIT::privateCompile):
  8258. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8259. * jit/JIT.h:
  8260. (JSC::JIT::compileCTIMachineTrampolines):
  8261. * jit/JITCall.cpp:
  8262. (JSC::JIT::compileOpCall):
  8263. (JSC::JIT::compileOpCallSlowCase):
  8264. * jit/JITPropertyAccess.cpp:
  8265. (JSC::JIT::privateCompilePatchGetArrayLength):
  8266. * jit/JITStubs.cpp:
  8267. (JSC::JITStubs::JITStubs):
  8268. (JSC::JITStubs::tryCacheGetByID):
  8269. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  8270. (JSC::JITStubs::cti_op_get_by_val):
  8271. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  8272. (JSC::JITStubs::cti_op_put_by_val):
  8273. (JSC::JITStubs::cti_op_put_by_val_array):
  8274. (JSC::JITStubs::cti_op_put_by_val_byte_array):
  8275. (JSC::JITStubs::cti_op_is_string):
  8276. * jit/JITStubs.h:
  8277. (JSC::JITStubs::ctiArrayLengthTrampoline):
  8278. (JSC::JITStubs::ctiStringLengthTrampoline):
  8279. (JSC::JITStubs::ctiVirtualCallPreLink):
  8280. (JSC::JITStubs::ctiVirtualCallLink):
  8281. (JSC::JITStubs::ctiVirtualCall):
  8282. * runtime/ArrayPrototype.cpp:
  8283. (JSC::arrayProtoFuncPop):
  8284. (JSC::arrayProtoFuncPush):
  8285. * runtime/FunctionPrototype.cpp:
  8286. (JSC::functionProtoFuncApply):
  8287. * runtime/JSArray.h:
  8288. (JSC::isJSArray):
  8289. * runtime/JSByteArray.h:
  8290. (JSC::asByteArray):
  8291. (JSC::isJSByteArray):
  8292. * runtime/JSCell.h:
  8293. * runtime/JSFunction.h:
  8294. * runtime/JSGlobalData.cpp:
  8295. (JSC::VPtrSet::VPtrSet):
  8296. (JSC::JSGlobalData::JSGlobalData):
  8297. (JSC::JSGlobalData::create):
  8298. (JSC::JSGlobalData::sharedInstance):
  8299. * runtime/JSGlobalData.h:
  8300. * runtime/JSString.h:
  8301. (JSC::isJSString):
  8302. * runtime/Operations.h:
  8303. (JSC::jsLess):
  8304. (JSC::jsLessEq):
  8305. * wrec/WREC.cpp:
  8306. (JSC::WREC::Generator::compileRegExp):
  8307. 2009-02-23 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  8308. Reviewed by Oliver Hunt.
  8309. Bug 23787: Allow JIT to generate SSE2 code if using GCC
  8310. <https://bugs.webkit.org/show_bug.cgi?id=23787>
  8311. GCC version of the cpuid check.
  8312. * jit/JITArithmetic.cpp:
  8313. (JSC::isSSE2Present): previous assembly code fixed.
  8314. 2009-02-23 David Levin <levin@chromium.org>
  8315. Reviewed by Alexey Proskuryakov.
  8316. Bug 24047: Need to simplify nested if's in WorkerRunLoop::runInMode
  8317. <https://bugs.webkit.org/show_bug.cgi?id=24047>
  8318. * wtf/MessageQueue.h:
  8319. (WTF::MessageQueue::infiniteTime):
  8320. Allows for one to call waitForMessageFilteredWithTimeout and wait forever.
  8321. (WTF::MessageQueue::alwaysTruePredicate):
  8322. (WTF::MessageQueue::waitForMessage):
  8323. Made waitForMessage call waitForMessageFilteredWithTimeout, so that there is less
  8324. duplicate code.
  8325. (WTF::MessageQueue::waitForMessageFilteredWithTimeout):
  8326. * wtf/ThreadingQt.cpp:
  8327. (WTF::ThreadCondition::timedWait):
  8328. * wtf/ThreadingWin.cpp:
  8329. (WTF::ThreadCondition::timedWait):
  8330. Made these two implementations consistent with the pthread and gtk implementations.
  8331. Currently, the time calculations would overflow when passed large values.
  8332. 2009-02-23 Jeremy Moskovich <jeremy@chromium.org>
  8333. Reviewed by Adam Roben.
  8334. https://bugs.webkit.org/show_bug.cgi?id=24096
  8335. PLATFORM(MAC)->PLATFORM(CF) since we want to use the CF functions in Chrome on OS X.
  8336. * wtf/CurrentTime.cpp:
  8337. 2009-02-22 Geoffrey Garen <ggaren@apple.com>
  8338. Build fix?
  8339. * GNUmakefile.am:
  8340. 2009-02-22 Geoffrey Garen <ggaren@apple.com>
  8341. Build fix.
  8342. * GNUmakefile.am:
  8343. 2009-02-22 Geoffrey Garen <ggaren@apple.com>
  8344. Reviewed by Sam Weinig.
  8345. Next step in splitting JIT functionality out of the Interpreter class:
  8346. Created a JITStubs class and renamed Interpreter::cti_* to JITStubs::cti_*.
  8347. Also, moved timeout checking into its own class, located in JSGlobalData,
  8348. so both the Interpreter and the JIT could have access to it.
  8349. * JavaScriptCore.exp:
  8350. * JavaScriptCore.pri:
  8351. * JavaScriptCore.scons:
  8352. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  8353. * JavaScriptCore.xcodeproj/project.pbxproj:
  8354. * JavaScriptCoreSources.bkl:
  8355. * interpreter/CallFrame.h:
  8356. * interpreter/Interpreter.cpp:
  8357. (JSC::Interpreter::Interpreter):
  8358. (JSC::Interpreter::privateExecute):
  8359. * interpreter/Interpreter.h:
  8360. * interpreter/Register.h:
  8361. * jit/JIT.cpp:
  8362. (JSC::):
  8363. (JSC::JIT::emitTimeoutCheck):
  8364. (JSC::JIT::privateCompileMainPass):
  8365. (JSC::JIT::privateCompileSlowCases):
  8366. (JSC::JIT::privateCompile):
  8367. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8368. * jit/JIT.h:
  8369. * jit/JITArithmetic.cpp:
  8370. (JSC::JIT::compileFastArithSlow_op_lshift):
  8371. (JSC::JIT::compileFastArithSlow_op_rshift):
  8372. (JSC::JIT::compileFastArithSlow_op_bitand):
  8373. (JSC::JIT::compileFastArithSlow_op_mod):
  8374. (JSC::JIT::compileFastArith_op_mod):
  8375. (JSC::JIT::compileFastArithSlow_op_post_inc):
  8376. (JSC::JIT::compileFastArithSlow_op_post_dec):
  8377. (JSC::JIT::compileFastArithSlow_op_pre_inc):
  8378. (JSC::JIT::compileFastArithSlow_op_pre_dec):
  8379. (JSC::JIT::compileFastArith_op_add):
  8380. (JSC::JIT::compileFastArith_op_mul):
  8381. (JSC::JIT::compileFastArith_op_sub):
  8382. (JSC::JIT::compileBinaryArithOpSlowCase):
  8383. (JSC::JIT::compileFastArithSlow_op_add):
  8384. (JSC::JIT::compileFastArithSlow_op_mul):
  8385. * jit/JITCall.cpp:
  8386. (JSC::JIT::compileOpCall):
  8387. (JSC::JIT::compileOpCallSlowCase):
  8388. * jit/JITPropertyAccess.cpp:
  8389. (JSC::JIT::compileGetByIdHotPath):
  8390. (JSC::JIT::compilePutByIdHotPath):
  8391. (JSC::JIT::compileGetByIdSlowCase):
  8392. (JSC::JIT::compilePutByIdSlowCase):
  8393. (JSC::JIT::privateCompilePutByIdTransition):
  8394. (JSC::JIT::patchGetByIdSelf):
  8395. (JSC::JIT::patchPutByIdReplace):
  8396. (JSC::JIT::privateCompilePatchGetArrayLength):
  8397. (JSC::JIT::privateCompileGetByIdSelf):
  8398. (JSC::JIT::privateCompileGetByIdProto):
  8399. (JSC::JIT::privateCompileGetByIdChain):
  8400. (JSC::JIT::privateCompilePutByIdReplace):
  8401. * jit/JITStubs.cpp:
  8402. (JSC::JITStubs::tryCachePutByID):
  8403. (JSC::JITStubs::tryCacheGetByID):
  8404. (JSC::JITStubs::cti_op_convert_this):
  8405. (JSC::JITStubs::cti_op_end):
  8406. (JSC::JITStubs::cti_op_add):
  8407. (JSC::JITStubs::cti_op_pre_inc):
  8408. (JSC::JITStubs::cti_timeout_check):
  8409. (JSC::JITStubs::cti_register_file_check):
  8410. (JSC::JITStubs::cti_op_loop_if_less):
  8411. (JSC::JITStubs::cti_op_loop_if_lesseq):
  8412. (JSC::JITStubs::cti_op_new_object):
  8413. (JSC::JITStubs::cti_op_put_by_id_generic):
  8414. (JSC::JITStubs::cti_op_get_by_id_generic):
  8415. (JSC::JITStubs::cti_op_put_by_id):
  8416. (JSC::JITStubs::cti_op_put_by_id_second):
  8417. (JSC::JITStubs::cti_op_put_by_id_fail):
  8418. (JSC::JITStubs::cti_op_get_by_id):
  8419. (JSC::JITStubs::cti_op_get_by_id_second):
  8420. (JSC::JITStubs::cti_op_get_by_id_self_fail):
  8421. (JSC::JITStubs::cti_op_get_by_id_proto_list):
  8422. (JSC::JITStubs::cti_op_get_by_id_proto_list_full):
  8423. (JSC::JITStubs::cti_op_get_by_id_proto_fail):
  8424. (JSC::JITStubs::cti_op_get_by_id_array_fail):
  8425. (JSC::JITStubs::cti_op_get_by_id_string_fail):
  8426. (JSC::JITStubs::cti_op_instanceof):
  8427. (JSC::JITStubs::cti_op_del_by_id):
  8428. (JSC::JITStubs::cti_op_mul):
  8429. (JSC::JITStubs::cti_op_new_func):
  8430. (JSC::JITStubs::cti_op_call_JSFunction):
  8431. (JSC::JITStubs::cti_op_call_arityCheck):
  8432. (JSC::JITStubs::cti_vm_dontLazyLinkCall):
  8433. (JSC::JITStubs::cti_vm_lazyLinkCall):
  8434. (JSC::JITStubs::cti_op_push_activation):
  8435. (JSC::JITStubs::cti_op_call_NotJSFunction):
  8436. (JSC::JITStubs::cti_op_create_arguments):
  8437. (JSC::JITStubs::cti_op_create_arguments_no_params):
  8438. (JSC::JITStubs::cti_op_tear_off_activation):
  8439. (JSC::JITStubs::cti_op_tear_off_arguments):
  8440. (JSC::JITStubs::cti_op_profile_will_call):
  8441. (JSC::JITStubs::cti_op_profile_did_call):
  8442. (JSC::JITStubs::cti_op_ret_scopeChain):
  8443. (JSC::JITStubs::cti_op_new_array):
  8444. (JSC::JITStubs::cti_op_resolve):
  8445. (JSC::JITStubs::cti_op_construct_JSConstruct):
  8446. (JSC::JITStubs::cti_op_construct_NotJSConstruct):
  8447. (JSC::JITStubs::cti_op_get_by_val):
  8448. (JSC::JITStubs::cti_op_get_by_val_byte_array):
  8449. (JSC::JITStubs::cti_op_resolve_func):
  8450. (JSC::JITStubs::cti_op_sub):
  8451. (JSC::JITStubs::cti_op_put_by_val):
  8452. (JSC::JITStubs::cti_op_put_by_val_array):
  8453. (JSC::JITStubs::cti_op_put_by_val_byte_array):
  8454. (JSC::JITStubs::cti_op_lesseq):
  8455. (JSC::JITStubs::cti_op_loop_if_true):
  8456. (JSC::JITStubs::cti_op_negate):
  8457. (JSC::JITStubs::cti_op_resolve_base):
  8458. (JSC::JITStubs::cti_op_resolve_skip):
  8459. (JSC::JITStubs::cti_op_resolve_global):
  8460. (JSC::JITStubs::cti_op_div):
  8461. (JSC::JITStubs::cti_op_pre_dec):
  8462. (JSC::JITStubs::cti_op_jless):
  8463. (JSC::JITStubs::cti_op_not):
  8464. (JSC::JITStubs::cti_op_jtrue):
  8465. (JSC::JITStubs::cti_op_post_inc):
  8466. (JSC::JITStubs::cti_op_eq):
  8467. (JSC::JITStubs::cti_op_lshift):
  8468. (JSC::JITStubs::cti_op_bitand):
  8469. (JSC::JITStubs::cti_op_rshift):
  8470. (JSC::JITStubs::cti_op_bitnot):
  8471. (JSC::JITStubs::cti_op_resolve_with_base):
  8472. (JSC::JITStubs::cti_op_new_func_exp):
  8473. (JSC::JITStubs::cti_op_mod):
  8474. (JSC::JITStubs::cti_op_less):
  8475. (JSC::JITStubs::cti_op_neq):
  8476. (JSC::JITStubs::cti_op_post_dec):
  8477. (JSC::JITStubs::cti_op_urshift):
  8478. (JSC::JITStubs::cti_op_bitxor):
  8479. (JSC::JITStubs::cti_op_new_regexp):
  8480. (JSC::JITStubs::cti_op_bitor):
  8481. (JSC::JITStubs::cti_op_call_eval):
  8482. (JSC::JITStubs::cti_op_throw):
  8483. (JSC::JITStubs::cti_op_get_pnames):
  8484. (JSC::JITStubs::cti_op_next_pname):
  8485. (JSC::JITStubs::cti_op_push_scope):
  8486. (JSC::JITStubs::cti_op_pop_scope):
  8487. (JSC::JITStubs::cti_op_typeof):
  8488. (JSC::JITStubs::cti_op_is_undefined):
  8489. (JSC::JITStubs::cti_op_is_boolean):
  8490. (JSC::JITStubs::cti_op_is_number):
  8491. (JSC::JITStubs::cti_op_is_string):
  8492. (JSC::JITStubs::cti_op_is_object):
  8493. (JSC::JITStubs::cti_op_is_function):
  8494. (JSC::JITStubs::cti_op_stricteq):
  8495. (JSC::JITStubs::cti_op_nstricteq):
  8496. (JSC::JITStubs::cti_op_to_jsnumber):
  8497. (JSC::JITStubs::cti_op_in):
  8498. (JSC::JITStubs::cti_op_push_new_scope):
  8499. (JSC::JITStubs::cti_op_jmp_scopes):
  8500. (JSC::JITStubs::cti_op_put_by_index):
  8501. (JSC::JITStubs::cti_op_switch_imm):
  8502. (JSC::JITStubs::cti_op_switch_char):
  8503. (JSC::JITStubs::cti_op_switch_string):
  8504. (JSC::JITStubs::cti_op_del_by_val):
  8505. (JSC::JITStubs::cti_op_put_getter):
  8506. (JSC::JITStubs::cti_op_put_setter):
  8507. (JSC::JITStubs::cti_op_new_error):
  8508. (JSC::JITStubs::cti_op_debug):
  8509. (JSC::JITStubs::cti_vm_throw):
  8510. * jit/JITStubs.h:
  8511. (JSC::):
  8512. * runtime/JSFunction.h:
  8513. * runtime/JSGlobalData.cpp:
  8514. (JSC::JSGlobalData::JSGlobalData):
  8515. * runtime/JSGlobalData.h:
  8516. * runtime/JSGlobalObject.cpp:
  8517. * runtime/JSGlobalObject.h:
  8518. * runtime/TimeoutChecker.cpp: Copied from interpreter/Interpreter.cpp.
  8519. (JSC::TimeoutChecker::TimeoutChecker):
  8520. (JSC::TimeoutChecker::reset):
  8521. (JSC::TimeoutChecker::didTimeOut):
  8522. * runtime/TimeoutChecker.h: Copied from interpreter/Interpreter.h.
  8523. (JSC::TimeoutChecker::setTimeoutInterval):
  8524. (JSC::TimeoutChecker::ticksUntilNextCheck):
  8525. (JSC::TimeoutChecker::start):
  8526. (JSC::TimeoutChecker::stop):
  8527. 2009-02-20 Gustavo Noronha Silva <gns@gnome.org>
  8528. Unreviewed build fix after r41100.
  8529. * GNUmakefile.am:
  8530. 2009-02-20 Oliver Hunt <oliver@apple.com>
  8531. Reviewed by Mark Rowe.
  8532. <rdar://problem/6606660> 2==null returns true in 64bit jit
  8533. Code for op_eq_null and op_neq_null was incorrectly performing
  8534. a 32bit compare, which truncated the type tag from an integer
  8535. immediate, leading to incorrect behaviour.
  8536. * assembler/MacroAssembler.h:
  8537. (JSC::MacroAssembler::setPtr):
  8538. * assembler/MacroAssemblerX86_64.h:
  8539. (JSC::MacroAssemblerX86_64::setPtr):
  8540. * jit/JIT.cpp:
  8541. (JSC::JIT::privateCompileMainPass):
  8542. 2009-02-19 Geoffrey Garen <ggaren@apple.com>
  8543. Reviewed by Gavin Barraclough.
  8544. First step in splitting JIT functionality out of the Interpreter class:
  8545. Created JITStubs.h/.cpp, and moved Interpreter::cti_* into JITStubs.cpp.
  8546. Functions that the Interpreter and JITStubs share moved to Operations.h/.cpp.
  8547. * GNUmakefile.am:
  8548. * JavaScriptCore.pri:
  8549. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  8550. * JavaScriptCore.xcodeproj/project.pbxproj:
  8551. * interpreter/Interpreter.cpp:
  8552. (JSC::Interpreter::resolveBase):
  8553. (JSC::Interpreter::checkTimeout):
  8554. (JSC::Interpreter::privateExecute):
  8555. * interpreter/Interpreter.h:
  8556. * jit/JITStubs.cpp: Copied from interpreter/Interpreter.cpp.
  8557. (JSC::Interpreter::cti_op_resolve_base):
  8558. * jit/JITStubs.h: Copied from interpreter/Interpreter.h.
  8559. * runtime/Operations.cpp:
  8560. (JSC::jsAddSlowCase):
  8561. (JSC::jsTypeStringForValue):
  8562. (JSC::jsIsObjectType):
  8563. (JSC::jsIsFunctionType):
  8564. * runtime/Operations.h:
  8565. (JSC::jsLess):
  8566. (JSC::jsLessEq):
  8567. (JSC::jsAdd):
  8568. (JSC::cachePrototypeChain):
  8569. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  8570. (JSC::resolveBase):
  8571. 2009-02-19 Gavin Barraclough <barraclough@apple.com>
  8572. Reviewed by Oliver Hunt.
  8573. Fix for x86-64. Where the JavaScriptCore text segment lies outside
  8574. a 2gb range of the heap containing JIT generated code, callbacks
  8575. from JIT code to the stub functions in Interpreter will be incorrectly
  8576. linked.
  8577. No performance impact on Sunspider, 1% regression on v8-tests,
  8578. due to a 3% regression on richards.
  8579. * assembler/AbstractMacroAssembler.h:
  8580. (JSC::AbstractMacroAssembler::Call::Call):
  8581. (JSC::AbstractMacroAssembler::Jump::link):
  8582. (JSC::AbstractMacroAssembler::Jump::linkTo):
  8583. (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
  8584. (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
  8585. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
  8586. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  8587. (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
  8588. (JSC::AbstractMacroAssembler::differenceBetween):
  8589. * assembler/MacroAssembler.h:
  8590. (JSC::MacroAssembler::tailRecursiveCall):
  8591. (JSC::MacroAssembler::makeTailRecursiveCall):
  8592. * assembler/MacroAssemblerX86.h:
  8593. (JSC::MacroAssemblerX86::call):
  8594. * assembler/MacroAssemblerX86Common.h:
  8595. * assembler/MacroAssemblerX86_64.h:
  8596. (JSC::MacroAssemblerX86_64::call):
  8597. (JSC::MacroAssemblerX86_64::moveWithPatch):
  8598. (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
  8599. (JSC::MacroAssemblerX86_64::storePtrWithPatch):
  8600. * assembler/X86Assembler.h:
  8601. (JSC::X86Assembler::jmp_r):
  8602. (JSC::X86Assembler::linkJump):
  8603. (JSC::X86Assembler::patchJump):
  8604. (JSC::X86Assembler::patchCall):
  8605. (JSC::X86Assembler::linkCall):
  8606. (JSC::X86Assembler::patchAddress):
  8607. * interpreter/Interpreter.cpp:
  8608. (JSC::Interpreter::tryCTICachePutByID):
  8609. * jit/JIT.cpp:
  8610. (JSC::JIT::privateCompile):
  8611. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8612. * jit/JIT.h:
  8613. * jit/JITArithmetic.cpp:
  8614. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  8615. (JSC::JIT::compileBinaryArithOp):
  8616. * jit/JITPropertyAccess.cpp:
  8617. (JSC::JIT::privateCompilePutByIdTransition):
  8618. (JSC::JIT::privateCompileGetByIdSelf):
  8619. (JSC::JIT::privateCompilePutByIdReplace):
  8620. 2009-02-18 Geoffrey Garen <ggaren@apple.com>
  8621. Reviewed by Oliver Hunt.
  8622. Simplified .call and .apply in preparation for optimizing them. Also,
  8623. a little cleanup.
  8624. * runtime/FunctionPrototype.cpp:
  8625. (JSC::functionProtoFuncApply):
  8626. (JSC::functionProtoFuncCall): No need to do any specific conversion on
  8627. 'this' -- op_convert_this will do it if necessary.
  8628. * runtime/JSImmediate.cpp:
  8629. (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on
  8630. toThisObject to allow for 'undefined', which can be passed through
  8631. .call and .apply.
  8632. 2009-02-19 David Levin <levin@chromium.org>
  8633. Reviewed by Alexey Proskuryakov.
  8634. Bug 23976: MessageQueue needs a way to wait for a message that satisfies an arbitrary criteria.
  8635. <https://bugs.webkit.org/show_bug.cgi?id=23976>
  8636. * wtf/Deque.h:
  8637. (WTF::Deque<T>::findIf):
  8638. * wtf/MessageQueue.h:
  8639. (WTF::MessageQueue<T>::waitForMessageFiltered):
  8640. 2009-02-18 David Levin <levin@chromium.org>
  8641. Reviewed by Alexey Proskuryakov.
  8642. Bug 23974: Deque::Remove would be a useful method.
  8643. <https://bugs.webkit.org/show_bug.cgi?id=23974>
  8644. Add Deque::remove and DequeIteratorBase<T>::operator=.
  8645. Why was operator= added? Every concrete iterator (DequeIterator..DequeConstReverseIterator)
  8646. was calling DequeIteratorBase::assign(), which called Base::operator=(). Base::operator=()
  8647. was not implemented. This went unnoticed because the iterator copy code has been unused.
  8648. * wtf/Deque.h:
  8649. (WTF::Deque<T>::remove):
  8650. (WTF::DequeIteratorBase<T>::removeFromIteratorsList):
  8651. (WTF::DequeIteratorBase<T>::operator=):
  8652. (WTF::DequeIteratorBase<T>::~DequeIteratorBase):
  8653. 2009-02-18 Gustavo Noronha Silva <gns@gnome.org>
  8654. Reviewed by Holger Freyther.
  8655. Fix symbols.filter location, and add other missing files to the
  8656. autotools build, so that make dist works.
  8657. * GNUmakefile.am:
  8658. 2009-02-17 Geoffrey Garen <ggaren@apple.com>
  8659. Reviewed by Sam Weinig.
  8660. Fixed failure in js1_5/Regress/regress-168347.js, as seen on the Oliver
  8661. bot.
  8662. Technically, both behaviors are OK, but we might as well keep this test
  8663. passing.
  8664. * runtime/FunctionPrototype.cpp:
  8665. (JSC::insertSemicolonIfNeeded): No need to add a trailing semicolon
  8666. after a trailing '}', since '}' ends a block, indicating the end of a
  8667. statement.
  8668. 2009-02-17 Geoffrey Garen <ggaren@apple.com>
  8669. Build fix.
  8670. * runtime/FunctionPrototype.cpp:
  8671. 2009-02-17 Oliver Hunt <oliver@apple.com>
  8672. Reviewed by Geoff Garen.
  8673. Add assertion to guard against oversized pc relative calls.
  8674. * assembler/X86Assembler.h:
  8675. (JSC::X86Assembler::link):
  8676. 2009-02-17 Geoffrey Garen <ggaren@apple.com>
  8677. Reviewed by Sam Weinig.
  8678. Fixed <rdar://problem/6595040> REGRESSION: http://www.amnestyusa.org/
  8679. fails to load.
  8680. amnestyusa.org uses the Optimist JavaScript library, which adds event
  8681. listeners by concatenating string-ified functions. This is only sure to
  8682. be syntactically valid if the string-ified functions end in semicolons.
  8683. * parser/Lexer.cpp:
  8684. (JSC::Lexer::isWhiteSpace):
  8685. * parser/Lexer.h:
  8686. (JSC::Lexer::isWhiteSpace):
  8687. (JSC::Lexer::isLineTerminator): Added some helper functions for examining
  8688. whitespace.
  8689. * runtime/FunctionPrototype.cpp:
  8690. (JSC::appendSemicolonIfNeeded):
  8691. (JSC::functionProtoFuncToString): When string-ifying a function, insert
  8692. a semicolon in the last non-whitespace position, if one doesn't already exist.
  8693. 2009-02-16 Oliver Hunt <oliver@apple.com>
  8694. Reviewed by NOBODY (Build fix).
  8695. Roll out r41022 as it breaks qt and gtk builds
  8696. * jit/JITArithmetic.cpp:
  8697. (JSC::isSSE2Present):
  8698. 2009-02-16 Sam Weinig <sam@webkit.org>
  8699. Reviewed by Geoffrey Garen.
  8700. Fix for <rdar://problem/6468156>
  8701. REGRESSION (r36779): Adding link, images, flash in TinyMCE blocks entire page (21382)
  8702. No performance regression.
  8703. * runtime/Arguments.cpp:
  8704. (JSC::Arguments::fillArgList): Add codepath for when the "length" property has been
  8705. overridden.
  8706. 2009-02-16 Mark Rowe <mrowe@apple.com>
  8707. Build fix.
  8708. * wtf/FastMalloc.cpp:
  8709. (WTF::TCMallocStats::):
  8710. (WTF::TCMallocStats::FastMallocZone::FastMallocZone):
  8711. 2009-02-16 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  8712. Reviewed by Oliver Hunt.
  8713. Bug 23787: Allow JIT to generate SSE2 code if using GCC
  8714. <https://bugs.webkit.org/show_bug.cgi?id=23787>
  8715. GCC version of the cpuid check.
  8716. * jit/JITArithmetic.cpp:
  8717. (JSC::isSSE2Present): GCC assembly code added.
  8718. 6.6% progression on x86 Linux with JIT and WREC on SunSpider if using SSE2 capable machine.
  8719. 2009-02-13 Adam Treat <adam.treat@torchmobile.com>
  8720. Reviewed by George Staikos.
  8721. https://bugs.webkit.org/show_bug.cgi?id=23960
  8722. Crash Fix.
  8723. Don't depend on 'initializeThreading()' to come before a call to 'isMainThread()'
  8724. as QtWebKit only calls 'initializeThreading()' during QWebPage construction.
  8725. A client app may well make a call to QWebSettings::iconForUrl() for instance
  8726. before creating a QWebPage and that call to QWebSettings triggers an
  8727. ASSERT(isMainThread()) deep within WebCore.
  8728. * wtf/ThreadingQt.cpp:
  8729. (WTF::isMainThread):
  8730. 2009-02-13 Gavin Barraclough <barraclough@apple.com>
  8731. Reviewed by Darin Adler.
  8732. Some data in the instruction stream is potentially uninitialized - fix this.
  8733. Change the OperandTypes constructor so that uninitialized memory in the int
  8734. is zeroed, and modify the Instruction constructor taking an Opcode so that
  8735. if !HAVE(COMPUTED_GOTO) (i.e. when Opcode is an enum, and is potentially only
  8736. a byte) it zeros the Instruction first before writing the opcode.
  8737. * bytecode/Instruction.h:
  8738. (JSC::Instruction::Instruction):
  8739. * parser/ResultType.h:
  8740. (JSC::OperandTypes::OperandTypes):
  8741. 2009-02-13 Geoffrey Garen <ggaren@apple.com>
  8742. Build fix for non_JIT platforms.
  8743. * bytecode/CodeBlock.h:
  8744. (JSC::CodeBlock::setIsNumericCompareFunction):
  8745. (JSC::CodeBlock::isNumericCompareFunction):
  8746. 2009-02-13 Geoffrey Garen <ggaren@apple.com>
  8747. Reviewed by Darin Adler.
  8748. Fixed <rdar://problem/6584057> Optimize sort by JS numeric comparison
  8749. function not to run the comparison function
  8750. * bytecode/CodeBlock.cpp:
  8751. (JSC::CodeBlock::CodeBlock):
  8752. * bytecode/CodeBlock.h:
  8753. (JSC::CodeBlock::setIsNumericCompareFunction):
  8754. (JSC::CodeBlock::isNumericCompareFunction): Added the ability to track
  8755. whether a CodeBlock performs a sort-like numeric comparison.
  8756. * bytecompiler/BytecodeGenerator.cpp:
  8757. (JSC::BytecodeGenerator::generate): Set the isNumericCompareFunction bit
  8758. after compiling.
  8759. * parser/Nodes.cpp:
  8760. (JSC::FunctionBodyNode::emitBytecode): Fixed a bug that caused us to
  8761. codegen an extra return at the end of all functions (eek!), since this
  8762. made it harder / weirder to detect the numeric comparison pattern in
  8763. bytecode.
  8764. * runtime/ArrayPrototype.cpp:
  8765. (JSC::arrayProtoFuncSort): Use the isNumericCompareFunction bit to do
  8766. a faster sort if we can.
  8767. * runtime/FunctionConstructor.cpp:
  8768. (JSC::extractFunctionBody):
  8769. (JSC::constructFunction):
  8770. * runtime/FunctionConstructor.h: Renamed and exported extractFunctionBody for
  8771. use in initializing lazyNumericCompareFunction.
  8772. * runtime/JSArray.cpp:
  8773. (JSC::compareNumbersForQSort):
  8774. (JSC::compareByStringPairForQSort):
  8775. (JSC::JSArray::sortNumeric):
  8776. (JSC::JSArray::sort):
  8777. * runtime/JSArray.h: Added a fast numeric sort. Renamed ArrayQSortPair
  8778. to be more specific since we do different kinds of qsort now.
  8779. * runtime/JSGlobalData.cpp:
  8780. (JSC::JSGlobalData::JSGlobalData):
  8781. (JSC::JSGlobalData::numericCompareFunction):
  8782. (JSC::JSGlobalData::ClientData::~ClientData):
  8783. * runtime/JSGlobalData.h: Added helper data for computing the
  8784. isNumericCompareFunction bit.
  8785. 2009-02-13 Darin Adler <darin@apple.com>
  8786. * Configurations/JavaScriptCore.xcconfig: Undo accidental commit of this file.
  8787. 2009-02-12 Darin Adler <darin@apple.com>
  8788. Reviewed by Oliver Hunt and Alexey Proskuryakov.
  8789. Speed up a couple string functions.
  8790. * runtime/StringPrototype.cpp:
  8791. (JSC::stringProtoFuncIndexOf): Added a fast path for cases where the second
  8792. argument is either missing or an integer.
  8793. (JSC::stringProtoFuncBig): Use jsNontrivialString since the string is guaranteed
  8794. to be 2 or more characters long.
  8795. (JSC::stringProtoFuncSmall): Ditto.
  8796. (JSC::stringProtoFuncBlink): Ditto.
  8797. (JSC::stringProtoFuncBold): Ditto.
  8798. (JSC::stringProtoFuncItalics): Ditto.
  8799. (JSC::stringProtoFuncStrike): Ditto.
  8800. (JSC::stringProtoFuncSub): Ditto.
  8801. (JSC::stringProtoFuncSup): Ditto.
  8802. (JSC::stringProtoFuncFontcolor): Ditto.
  8803. (JSC::stringProtoFuncFontsize): Make the fast path Sam recently added even faster
  8804. by avoiding all but the minimum memory allocation.
  8805. (JSC::stringProtoFuncAnchor): Use jsNontrivialString.
  8806. (JSC::stringProtoFuncLink): Added a fast path.
  8807. * runtime/UString.cpp:
  8808. (JSC::UString::find): Added a fast path for single-character search strings.
  8809. 2009-02-13 David Levin <levin@chromium.org>
  8810. Reviewed by Darin Adler.
  8811. Bug 23926: Race condition in callOnMainThreadAndWait
  8812. <https://bugs.webkit.org/show_bug.cgi?id=23926>
  8813. * wtf/MainThread.cpp:
  8814. Removed callOnMainThreadAndWait since it isn't used.
  8815. 2009-02-13 Oliver Hunt <oliver@apple.com>
  8816. Reviewed by Jon Honeycutt.
  8817. Math.random is really slow on windows.
  8818. Math.random calls WTF::randomNumber which is implemented as
  8819. the secure rand_s on windows. Unfortunately rand_s is an order
  8820. of magnitude slower than arc4random. For this reason I've
  8821. added "weakRandomNumber" for use by JavaScript's Math Object.
  8822. In the long term we should look at using our own secure PRNG
  8823. in place of the system, but this will do for now.
  8824. 30% win on SunSpider on Windows, resolving most of the remaining
  8825. disparity vs. Mac.
  8826. * runtime/MathObject.cpp:
  8827. (JSC::MathObject::MathObject):
  8828. (JSC::mathProtoFuncRandom):
  8829. * wtf/RandomNumber.cpp:
  8830. (WTF::weakRandomNumber):
  8831. (WTF::randomNumber):
  8832. * wtf/RandomNumber.h:
  8833. * wtf/RandomNumberSeed.h:
  8834. (WTF::initializeWeakRandomNumberGenerator):
  8835. 2009-02-12 Mark Rowe <mrowe@apple.com>
  8836. Fix the build for other platforms.
  8837. * wtf/RandomNumber.cpp:
  8838. (WTF::randomNumber):
  8839. 2009-02-12 Gavin Barraclough <barraclough@apple.com>
  8840. Reviewed by Sam Weinig.
  8841. Remove (/reduce) use of hard-wired register names from the JIT.
  8842. Currently there is no abstraction of registers used in the JIT,
  8843. which has a number of negative consequences. Hard-wiring x86
  8844. register names makes the JIT less portable to other platforms,
  8845. and prevents us from performing dynamic register allocation to
  8846. attempt to maintain more temporary values in machine registers.
  8847. (The latter will be more important on x86-64, where we have more
  8848. registers to make use of).
  8849. Also, remove MacroAssembler::mod32. This was not providing a
  8850. useful abstraction, and was not in keeping with the rest of the
  8851. MacroAssembler interface, in having specific register requirements.
  8852. * assembler/MacroAssemblerX86Common.h:
  8853. * jit/JIT.cpp:
  8854. (JSC::JIT::compileOpStrictEq):
  8855. (JSC::JIT::emitSlowScriptCheck):
  8856. (JSC::JIT::privateCompileMainPass):
  8857. (JSC::JIT::privateCompileSlowCases):
  8858. (JSC::JIT::privateCompile):
  8859. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8860. * jit/JIT.h:
  8861. * jit/JITArithmetic.cpp:
  8862. (JSC::JIT::compileFastArith_op_lshift):
  8863. (JSC::JIT::compileFastArithSlow_op_lshift):
  8864. (JSC::JIT::compileFastArith_op_rshift):
  8865. (JSC::JIT::compileFastArithSlow_op_rshift):
  8866. (JSC::JIT::compileFastArith_op_bitand):
  8867. (JSC::JIT::compileFastArithSlow_op_bitand):
  8868. (JSC::JIT::compileFastArith_op_mod):
  8869. (JSC::JIT::compileFastArithSlow_op_mod):
  8870. (JSC::JIT::compileFastArith_op_post_inc):
  8871. (JSC::JIT::compileFastArithSlow_op_post_inc):
  8872. (JSC::JIT::compileFastArith_op_post_dec):
  8873. (JSC::JIT::compileFastArithSlow_op_post_dec):
  8874. (JSC::JIT::compileFastArith_op_pre_inc):
  8875. (JSC::JIT::compileFastArithSlow_op_pre_inc):
  8876. (JSC::JIT::compileFastArith_op_pre_dec):
  8877. (JSC::JIT::compileFastArithSlow_op_pre_dec):
  8878. (JSC::JIT::compileFastArith_op_add):
  8879. (JSC::JIT::compileFastArith_op_mul):
  8880. (JSC::JIT::compileFastArith_op_sub):
  8881. (JSC::JIT::compileBinaryArithOp):
  8882. * jit/JITCall.cpp:
  8883. (JSC::JIT::compileOpCallInitializeCallFrame):
  8884. (JSC::JIT::compileOpCallSetupArgs):
  8885. (JSC::JIT::compileOpCallEvalSetupArgs):
  8886. (JSC::JIT::compileOpConstructSetupArgs):
  8887. (JSC::JIT::compileOpCall):
  8888. (JSC::JIT::compileOpCallSlowCase):
  8889. * jit/JITInlineMethods.h:
  8890. (JSC::JIT::emitGetVirtualRegister):
  8891. (JSC::JIT::emitPutVirtualRegister):
  8892. (JSC::JIT::emitNakedCall):
  8893. (JSC::JIT::restoreArgumentReference):
  8894. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  8895. * jit/JITPropertyAccess.cpp:
  8896. (JSC::JIT::compileGetByIdHotPath):
  8897. (JSC::JIT::compilePutByIdHotPath):
  8898. (JSC::JIT::compileGetByIdSlowCase):
  8899. (JSC::JIT::compilePutByIdSlowCase):
  8900. (JSC::JIT::privateCompilePutByIdTransition):
  8901. (JSC::JIT::privateCompilePatchGetArrayLength):
  8902. (JSC::JIT::privateCompileGetByIdSelf):
  8903. (JSC::JIT::privateCompileGetByIdProto):
  8904. (JSC::JIT::privateCompileGetByIdSelfList):
  8905. (JSC::JIT::privateCompileGetByIdProtoList):
  8906. (JSC::JIT::privateCompileGetByIdChainList):
  8907. (JSC::JIT::privateCompileGetByIdChain):
  8908. (JSC::JIT::privateCompilePutByIdReplace):
  8909. 2009-02-12 Horia Olaru <olaru@adobe.com>
  8910. Reviewed by Oliver Hunt.
  8911. https://bugs.webkit.org/show_bug.cgi?id=23400
  8912. When throwing an exception within an eval argument string, the dst parameter was
  8913. modified in the functions below and the return value for eval was altered. Changed
  8914. the emitNode call in JSC::ThrowNode::emitBytecode to use a temporary register
  8915. to store its results instead of dst. The JSC::FunctionCallResolveNode::emitBytecode
  8916. would load the function within the dst registry, also altering the result returned
  8917. by eval. Replaced it with another temporary.
  8918. * parser/Nodes.cpp:
  8919. (JSC::FunctionCallResolveNode::emitBytecode):
  8920. (JSC::ThrowNode::emitBytecode):
  8921. 2009-02-12 Sam Weinig <sam@webkit.org>
  8922. Reviewed by Geoffrey Garen.
  8923. Speed up String.prototype.fontsize.
  8924. * runtime/StringPrototype.cpp:
  8925. (JSC::stringProtoFuncFontsize): Specialize for defined/commonly used values.
  8926. 2009-02-12 Geoffrey Garen <ggaren@apple.com>
  8927. Reviewed by Sam Weinig.
  8928. Correctness fix.
  8929. * wtf/RandomNumber.cpp:
  8930. (WTF::randomNumber): Divide by the maximum representable value, which
  8931. is different on each platform now, to get values between 0 and 1.
  8932. 2009-02-12 Geoffrey Garen <ggaren@apple.com>
  8933. Build fix.
  8934. * wtf/RandomNumber.cpp:
  8935. (WTF::randomNumber):
  8936. 2009-02-12 Geoffrey Garen <ggaren@apple.com>
  8937. Reviewed by Sam Weinig.
  8938. Fixed <rdar://problem/6582048>.
  8939. * wtf/RandomNumber.cpp:
  8940. (WTF::randomNumber): Make only one call to the random number generator
  8941. on platforms where the generator is cryptographically secure. The value
  8942. of randomness over and above cryptographically secure randomness is not
  8943. clear, and it caused some performance problems.
  8944. 2009-02-12 Adam Roben <aroben@apple.com>
  8945. Fix lots of Perl warnings when building JavaScriptCoreGenerated on
  8946. Windows
  8947. Reviewed by John Sullivan.
  8948. * JavaScriptCore.vcproj/JavaScriptCore/build-generated-files.sh:
  8949. Create the docs/ directory so that we can write bytecode.html into it.
  8950. This matches what JavaScriptCore.xcodeproj does.
  8951. 2009-02-12 Simon Hausmann <simon.hausmann@nokia.com>
  8952. Rubber-stamped by Lars.
  8953. Re-enable the JIT in the Qt build with -fno-stack-protector on Linux.
  8954. * JavaScriptCore.pri:
  8955. 2009-02-11 Dmitry Titov <dimich@chromium.org>
  8956. Reviewed by Alexey Proskuryakov.
  8957. https://bugs.webkit.org/show_bug.cgi?id=23705
  8958. Fix the UI freeze caused by Worker generating a flood of messages.
  8959. Measure time we spend in executing posted work items. If too much time is spent
  8960. without returning to the run loop, exit and reschedule.
  8961. * wtf/MainThread.h:
  8962. Added initializeMainThreadPlatform() to initialize low-level mechanism for posting
  8963. work items from thread to thread. This removes #ifdefs for WIN and CHROMIUM from platform-independent code.
  8964. * wtf/MainThread.cpp:
  8965. (WTF::initializeMainThread):
  8966. (WTF::dispatchFunctionsFromMainThread):
  8967. Instead of dispatching all work items in the queue, dispatch them one by one
  8968. and measure elapsed time. After a threshold, reschedule and quit.
  8969. (WTF::callOnMainThread):
  8970. (WTF::callOnMainThreadAndWait):
  8971. Only schedule dispatch if the queue was empty - to avoid many posted messages in the run loop queue.
  8972. * wtf/mac/MainThreadMac.mm:
  8973. (WTF::scheduleDispatchFunctionsOnMainThread):
  8974. Use static instance of the mainThreadCaller instead of allocating and releasing it each time.
  8975. (WTF::initializeMainThreadPlatform):
  8976. * wtf/gtk/MainThreadChromium.cpp:
  8977. (WTF::initializeMainThreadPlatform):
  8978. * wtf/gtk/MainThreadGtk.cpp:
  8979. (WTF::initializeMainThreadPlatform):
  8980. * wtf/qt/MainThreadQt.cpp:
  8981. (WTF::initializeMainThreadPlatform):
  8982. * wtf/win/MainThreadWin.cpp:
  8983. (WTF::initializeMainThreadPlatform):
  8984. * wtf/wx/MainThreadWx.cpp:
  8985. (WTF::initializeMainThreadPlatform):
  8986. 2009-02-11 Sam Weinig <sam@webkit.org>
  8987. Reviewed by Gavin Barraclough.
  8988. Style cleanup.
  8989. * assembler/AbstractMacroAssembler.h:
  8990. (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
  8991. (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
  8992. (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
  8993. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
  8994. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
  8995. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
  8996. (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
  8997. (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
  8998. (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
  8999. (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
  9000. (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
  9001. (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
  9002. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
  9003. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
  9004. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
  9005. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
  9006. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
  9007. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
  9008. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
  9009. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  9010. (JSC::::CodeLocationCommon::labelAtOffset):
  9011. (JSC::::CodeLocationCommon::jumpAtOffset):
  9012. (JSC::::CodeLocationCommon::callAtOffset):
  9013. (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
  9014. (JSC::::CodeLocationCommon::dataLabel32AtOffset):
  9015. 2009-02-11 Sam Weinig <sam@webkit.org>
  9016. Reviewed by Gavin Barraclough.
  9017. * assembler/AbstractMacroAssembler.h: Fix comments.
  9018. 2009-02-11 Alexey Proskuryakov <ap@webkit.org>
  9019. Trying to fix wx build.
  9020. * bytecode/JumpTable.h: Include "MacroAssembler.h", not <MacroAssembler.h>.
  9021. * jscore.bkl: Added assembler directory to search paths.
  9022. 2009-02-10 Gavin Barraclough <barraclough@apple.com>
  9023. Build
  9024. fix.
  9025. (Narrow
  9026. changelog
  9027. for
  9028. dhyatt).
  9029. * bytecode/Instruction.h:
  9030. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
  9031. (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  9032. 2009-02-10 Gavin Barraclough <barraclough@apple.com>
  9033. Reviewed by Oliver Hunt.
  9034. Reduce use of void* / reinterpret_cast in JIT repatching code,
  9035. add strong types for Calls and for the various types of pointers
  9036. we retain into the JIT generated instruction stream.
  9037. No performance impact.
  9038. * assembler/AbstractMacroAssembler.h:
  9039. (JSC::AbstractMacroAssembler::ImmPtr::ImmPtr):
  9040. (JSC::AbstractMacroAssembler::ImmPtr::asIntptr):
  9041. (JSC::AbstractMacroAssembler::Imm32::Imm32):
  9042. (JSC::AbstractMacroAssembler::Label::Label):
  9043. (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
  9044. (JSC::AbstractMacroAssembler::Call::Call):
  9045. (JSC::AbstractMacroAssembler::Call::link):
  9046. (JSC::AbstractMacroAssembler::Call::linkTo):
  9047. (JSC::AbstractMacroAssembler::Jump::Jump):
  9048. (JSC::AbstractMacroAssembler::Jump::linkTo):
  9049. (JSC::AbstractMacroAssembler::CodeLocationCommon::CodeLocationCommon):
  9050. (JSC::AbstractMacroAssembler::CodeLocationCommon::operator bool):
  9051. (JSC::AbstractMacroAssembler::CodeLocationCommon::reset):
  9052. (JSC::AbstractMacroAssembler::CodeLocationLabel::CodeLocationLabel):
  9053. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForSwitch):
  9054. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForExceptionHandler):
  9055. (JSC::AbstractMacroAssembler::CodeLocationLabel::addressForJSR):
  9056. (JSC::AbstractMacroAssembler::CodeLocationLabel::getJumpDestination):
  9057. (JSC::AbstractMacroAssembler::CodeLocationJump::CodeLocationJump):
  9058. (JSC::AbstractMacroAssembler::CodeLocationJump::relink):
  9059. (JSC::AbstractMacroAssembler::CodeLocationCall::CodeLocationCall):
  9060. (JSC::AbstractMacroAssembler::CodeLocationCall::relink):
  9061. (JSC::AbstractMacroAssembler::CodeLocationCall::calleeReturnAddressValue):
  9062. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::CodeLocationDataLabel32):
  9063. (JSC::AbstractMacroAssembler::CodeLocationDataLabel32::repatch):
  9064. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::CodeLocationDataLabelPtr):
  9065. (JSC::AbstractMacroAssembler::CodeLocationDataLabelPtr::repatch):
  9066. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::ProcessorReturnAddress):
  9067. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::relinkCallerToFunction):
  9068. (JSC::AbstractMacroAssembler::ProcessorReturnAddress::operator void*):
  9069. (JSC::AbstractMacroAssembler::PatchBuffer::entry):
  9070. (JSC::AbstractMacroAssembler::PatchBuffer::trampolineAt):
  9071. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  9072. (JSC::AbstractMacroAssembler::PatchBuffer::linkTailRecursive):
  9073. (JSC::AbstractMacroAssembler::PatchBuffer::patch):
  9074. (JSC::AbstractMacroAssembler::PatchBuffer::locationOf):
  9075. (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
  9076. (JSC::AbstractMacroAssembler::differenceBetween):
  9077. (JSC::::CodeLocationCommon::labelAtOffset):
  9078. (JSC::::CodeLocationCommon::jumpAtOffset):
  9079. (JSC::::CodeLocationCommon::callAtOffset):
  9080. (JSC::::CodeLocationCommon::dataLabelPtrAtOffset):
  9081. (JSC::::CodeLocationCommon::dataLabel32AtOffset):
  9082. * assembler/MacroAssemblerX86Common.h:
  9083. (JSC::MacroAssemblerX86Common::call):
  9084. * assembler/X86Assembler.h:
  9085. (JSC::X86Assembler::getCallReturnOffset):
  9086. * bytecode/CodeBlock.h:
  9087. (JSC::CallLinkInfo::CallLinkInfo):
  9088. (JSC::getStructureStubInfoReturnLocation):
  9089. (JSC::getCallLinkInfoReturnLocation):
  9090. * bytecode/Instruction.h:
  9091. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
  9092. (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  9093. * bytecode/JumpTable.h:
  9094. (JSC::StringJumpTable::ctiForValue):
  9095. (JSC::SimpleJumpTable::ctiForValue):
  9096. * bytecode/StructureStubInfo.h:
  9097. (JSC::StructureStubInfo::StructureStubInfo):
  9098. * bytecompiler/BytecodeGenerator.cpp:
  9099. (JSC::BytecodeGenerator::emitCatch):
  9100. (JSC::prepareJumpTableForStringSwitch):
  9101. * interpreter/Interpreter.cpp:
  9102. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  9103. (JSC::getPolymorphicAccessStructureListSlot):
  9104. (JSC::Interpreter::cti_op_throw):
  9105. (JSC::Interpreter::cti_op_switch_imm):
  9106. (JSC::Interpreter::cti_op_switch_char):
  9107. (JSC::Interpreter::cti_op_switch_string):
  9108. (JSC::Interpreter::cti_vm_throw):
  9109. * jit/JIT.cpp:
  9110. (JSC::ctiSetReturnAddress):
  9111. (JSC::ctiPatchCallByReturnAddress):
  9112. (JSC::JIT::privateCompile):
  9113. (JSC::JIT::privateCompileCTIMachineTrampolines):
  9114. * jit/JIT.h:
  9115. (JSC::CallRecord::CallRecord):
  9116. (JSC::JIT::compileGetByIdSelf):
  9117. (JSC::JIT::compileGetByIdProto):
  9118. (JSC::JIT::compileGetByIdChain):
  9119. (JSC::JIT::compilePutByIdReplace):
  9120. (JSC::JIT::compilePutByIdTransition):
  9121. (JSC::JIT::compilePatchGetArrayLength):
  9122. (JSC::JIT::emitCTICall):
  9123. * jit/JITCall.cpp:
  9124. (JSC::JIT::unlinkCall):
  9125. (JSC::JIT::linkCall):
  9126. * jit/JITInlineMethods.h:
  9127. (JSC::JIT::emitNakedCall):
  9128. (JSC::JIT::emitCTICall_internal):
  9129. * jit/JITPropertyAccess.cpp:
  9130. (JSC::JIT::compileGetByIdSlowCase):
  9131. (JSC::JIT::compilePutByIdSlowCase):
  9132. (JSC::JIT::privateCompilePutByIdTransition):
  9133. (JSC::JIT::patchGetByIdSelf):
  9134. (JSC::JIT::patchPutByIdReplace):
  9135. (JSC::JIT::privateCompilePatchGetArrayLength):
  9136. (JSC::JIT::privateCompileGetByIdSelf):
  9137. (JSC::JIT::privateCompileGetByIdProto):
  9138. (JSC::JIT::privateCompileGetByIdSelfList):
  9139. (JSC::JIT::privateCompileGetByIdProtoList):
  9140. (JSC::JIT::privateCompileGetByIdChainList):
  9141. (JSC::JIT::privateCompileGetByIdChain):
  9142. (JSC::JIT::privateCompilePutByIdReplace):
  9143. 2009-02-10 Adam Roben <aroben@apple.com>
  9144. Windows build fix after r40813
  9145. * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added profiler/ to the include
  9146. path so that Profiler.h can be found.
  9147. 2009-02-09 Gavin Barraclough <barraclough@apple.com>
  9148. Reviewed by Oliver Hunt.
  9149. Provide a class type for a generated block of JIT code.
  9150. Also changes the return address -> bytecode index map to
  9151. track the return addess as an unsigned offset into the code
  9152. instead of a ptrdiff_t in terms of void**s - the latter is
  9153. equal to the actual offset / sizeof(void*), making it a
  9154. potentially lossy representation.
  9155. * JavaScriptCore.xcodeproj/project.pbxproj:
  9156. * assembler/AbstractMacroAssembler.h:
  9157. (JSC::AbstractMacroAssembler::PatchBuffer::returnAddressOffset):
  9158. * assembler/X86Assembler.h:
  9159. (JSC::X86Assembler::getCallReturnOffset):
  9160. * bytecode/CodeBlock.h:
  9161. (JSC::CallReturnOffsetToBytecodeIndex::CallReturnOffsetToBytecodeIndex):
  9162. (JSC::getCallReturnOffset):
  9163. (JSC::CodeBlock::getBytecodeIndex):
  9164. (JSC::CodeBlock::jitCode):
  9165. (JSC::CodeBlock::callReturnIndexVector):
  9166. * interpreter/Interpreter.cpp:
  9167. (JSC::Interpreter::execute):
  9168. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  9169. (JSC::Interpreter::cti_vm_lazyLinkCall):
  9170. * jit/JIT.cpp:
  9171. (JSC::JIT::privateCompile):
  9172. * jit/JIT.h:
  9173. (JSC::):
  9174. * jit/JITCall.cpp:
  9175. (JSC::JIT::linkCall):
  9176. * jit/JITCode.h: Added.
  9177. (JSC::):
  9178. (JSC::JITCode::JITCode):
  9179. (JSC::JITCode::operator bool):
  9180. (JSC::JITCode::addressForCall):
  9181. (JSC::JITCode::offsetOf):
  9182. (JSC::JITCode::execute):
  9183. 2009-02-09 John Grabowski <jrg@chromium.org>
  9184. Reviewed by Darin Adler.
  9185. https://bugs.webkit.org/show_bug.cgi?id=23856
  9186. Change the definition of "main thread" for Chromium on OSX.
  9187. It does not match the DARWIN definition.
  9188. * wtf/ThreadingPthreads.cpp:
  9189. (WTF::initializeThreading):
  9190. (WTF::isMainThread):
  9191. 2009-02-09 Gavin Barraclough <barraclough@apple.com>
  9192. Reviewed by Oliver Hunt.
  9193. Minor bugfix, incorrect check meant that subtraction causing integer overflow
  9194. would be missed on x86-64 JIT.
  9195. * jit/JITArithmetic.cpp:
  9196. (JSC::JIT::compileBinaryArithOp):
  9197. 2009-02-09 Gavin Barraclough <barraclough@apple.com>
  9198. Reviewed by Oliver Hunt.
  9199. A more sensible register allocation for x86-64.
  9200. When WREC was ported to x86-64 it stuck with the same register allocation as x86.
  9201. This requires registers to be reordered on entry into WREC generated code, since
  9202. argument passing is different on x86-64 and x86 (regparm(3)). This patch switches
  9203. x86-64 to use a native register allocation, that does not require argument registers
  9204. to be reordered.
  9205. * wrec/WRECGenerator.cpp:
  9206. (JSC::WREC::Generator::generateEnter):
  9207. (JSC::WREC::Generator::generateReturnSuccess):
  9208. (JSC::WREC::Generator::generateReturnFailure):
  9209. * wrec/WRECGenerator.h:
  9210. 2009-02-05 Adam Roben <aroben@apple.com>
  9211. Build fix
  9212. Rubberstamped by Sam Weinig.
  9213. * wtf/TypeTraits.h: Include Platform.h, since this header uses macros
  9214. defined there.
  9215. 2009-02-05 Dimitri Glazkov <dglazkov@chromium.org>
  9216. Reviewed by Eric Seidel.
  9217. https://bugs.webkit.org/show_bug.cgi?id=23747
  9218. Add Chromium threading-related files.
  9219. * wtf/MainThread.cpp: Added platform guard to initializeMainThread.
  9220. * wtf/chromium/ChromiumThreading.h: Added.
  9221. * wtf/chromium/MainThreadChromium.cpp: Added.
  9222. (WTF::initializeMainThread):
  9223. (WTF::scheduleDispatchFunctionsOnMainThread):
  9224. 2009-02-05 David Levin <levin@chromium.org>
  9225. Reviewed by Darin Adler.
  9226. Bug 23713: COMPILE_ASSERTS should be moved out of TypeTraits.h and into .cpp file
  9227. <https://bugs.webkit.org/show_bug.cgi?id=23713>
  9228. * GNUmakefile.am:
  9229. * JavaScriptCore.pri:
  9230. * JavaScriptCore.scons:
  9231. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  9232. * JavaScriptCore.xcodeproj/project.pbxproj:
  9233. * JavaScriptCoreSources.bkl:
  9234. * wtf/HashTraits.h:
  9235. Remove unnecessary header file that I missed when moving out the type traits form this file.
  9236. * wtf/TypeTraits.cpp: Added.
  9237. (WTF::):
  9238. * wtf/TypeTraits.h:
  9239. Moved the compile asserts into TypeTraits.cpp file.
  9240. 2009-02-04 Gavin Barraclough <barraclough@apple.com>
  9241. Reviewed by Oliver 'the nun' Hunt.
  9242. Add -e switch to jsc to enable evaluation of scripts passed on the command line.
  9243. * jsc.cpp:
  9244. (Script::Script):
  9245. (runWithScripts):
  9246. (printUsageStatement):
  9247. (parseArguments):
  9248. (jscmain):
  9249. 2009-02-04 Gavin Barraclough <barraclough@apple.com>
  9250. Rubber stamped by Sam 'Big Mac' Weinig.
  9251. * assembler/AbstractMacroAssembler.h: Copied from assembler/MacroAssembler.h.
  9252. * assembler/MacroAssemblerX86.h: Copied from assembler/MacroAssembler.h.
  9253. * assembler/MacroAssemblerX86Common.h: Copied from assembler/MacroAssembler.h.
  9254. * assembler/MacroAssemblerX86_64.h: Copied from assembler/MacroAssembler.h.
  9255. 2009-02-04 Gavin Barraclough <barraclough@apple.com>
  9256. Reviewed by Sam Weinig.
  9257. This patch tidies up the MacroAssembler, cleaning up the code and refactoring out the
  9258. platform-specific parts. The MacroAssembler gets split up like a beef burger, with the
  9259. platform-agnostic data types being the lower bun (in the form of the class AbstractMacroAssembler),
  9260. the plaform-specific code generation forming a big meaty patty of methods like 'add32',
  9261. 'branch32', etc (MacroAssemblerX86), and finally topped off with the bun-lid of the
  9262. MacroAssembler class itself, providing covenience methods such as the stack peek & poke,
  9263. and backwards branch methods, all of which can be described in a platform independent
  9264. way using methods from the base class. The AbstractMacroAssembler is templated on the
  9265. type of the assembler class that will be used for code generation, and the three layers
  9266. are held together with the cocktail stick of inheritance.
  9267. The above description is a slight simplification since the MacroAssemblerX86 is actually
  9268. formed from two layers (in effect giving us a kind on bacon double cheeseburger) - with the
  9269. bulk of methods that are common between x86 & x86-64 implemented in MacroAssemblerX86Common,
  9270. which forms a base class for MacroAssemblerX86 and MacroAssemblerX86_64 (which add the methods
  9271. specific to the given platform).
  9272. I'm landing these changes first without splitting the classes across multiple files,
  9273. I will follow up with a second patch to split up the file MacroAssembler.h.
  9274. * assembler/MacroAssembler.h:
  9275. (JSC::AbstractMacroAssembler::):
  9276. (JSC::AbstractMacroAssembler::DataLabelPtr::DataLabelPtr):
  9277. (JSC::AbstractMacroAssembler::DataLabelPtr::patch):
  9278. (JSC::AbstractMacroAssembler::DataLabel32::DataLabel32):
  9279. (JSC::AbstractMacroAssembler::DataLabel32::patch):
  9280. (JSC::AbstractMacroAssembler::Label::Label):
  9281. (JSC::AbstractMacroAssembler::Jump::Jump):
  9282. (JSC::AbstractMacroAssembler::Jump::link):
  9283. (JSC::AbstractMacroAssembler::Jump::linkTo):
  9284. (JSC::AbstractMacroAssembler::Jump::patch):
  9285. (JSC::AbstractMacroAssembler::JumpList::link):
  9286. (JSC::AbstractMacroAssembler::JumpList::linkTo):
  9287. (JSC::AbstractMacroAssembler::PatchBuffer::link):
  9288. (JSC::AbstractMacroAssembler::PatchBuffer::addressOf):
  9289. (JSC::AbstractMacroAssembler::PatchBuffer::setPtr):
  9290. (JSC::AbstractMacroAssembler::size):
  9291. (JSC::AbstractMacroAssembler::copyCode):
  9292. (JSC::AbstractMacroAssembler::label):
  9293. (JSC::AbstractMacroAssembler::align):
  9294. (JSC::AbstractMacroAssembler::differenceBetween):
  9295. (JSC::MacroAssemblerX86Common::xor32):
  9296. (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
  9297. (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
  9298. (JSC::MacroAssemblerX86Common::move):
  9299. (JSC::MacroAssemblerX86Common::swap):
  9300. (JSC::MacroAssemblerX86Common::signExtend32ToPtr):
  9301. (JSC::MacroAssemblerX86Common::zeroExtend32ToPtr):
  9302. (JSC::MacroAssemblerX86Common::branch32):
  9303. (JSC::MacroAssemblerX86Common::jump):
  9304. (JSC::MacroAssemblerX86_64::add32):
  9305. (JSC::MacroAssemblerX86_64::sub32):
  9306. (JSC::MacroAssemblerX86_64::load32):
  9307. (JSC::MacroAssemblerX86_64::store32):
  9308. (JSC::MacroAssemblerX86_64::addPtr):
  9309. (JSC::MacroAssemblerX86_64::andPtr):
  9310. (JSC::MacroAssemblerX86_64::orPtr):
  9311. (JSC::MacroAssemblerX86_64::rshiftPtr):
  9312. (JSC::MacroAssemblerX86_64::subPtr):
  9313. (JSC::MacroAssemblerX86_64::xorPtr):
  9314. (JSC::MacroAssemblerX86_64::loadPtr):
  9315. (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
  9316. (JSC::MacroAssemblerX86_64::storePtr):
  9317. (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
  9318. (JSC::MacroAssemblerX86_64::branchPtr):
  9319. (JSC::MacroAssemblerX86_64::branchTestPtr):
  9320. (JSC::MacroAssemblerX86_64::branchAddPtr):
  9321. (JSC::MacroAssemblerX86_64::branchSubPtr):
  9322. (JSC::MacroAssemblerX86_64::branchPtrWithPatch):
  9323. (JSC::MacroAssemblerX86_64::storePtrWithPatch):
  9324. (JSC::MacroAssemblerX86::add32):
  9325. (JSC::MacroAssemblerX86::sub32):
  9326. (JSC::MacroAssemblerX86::load32):
  9327. (JSC::MacroAssemblerX86::store32):
  9328. (JSC::MacroAssemblerX86::branch32):
  9329. (JSC::MacroAssemblerX86::branchPtrWithPatch):
  9330. (JSC::MacroAssemblerX86::storePtrWithPatch):
  9331. (JSC::MacroAssembler::pop):
  9332. (JSC::MacroAssembler::peek):
  9333. (JSC::MacroAssembler::poke):
  9334. (JSC::MacroAssembler::branchPtr):
  9335. (JSC::MacroAssembler::branch32):
  9336. (JSC::MacroAssembler::branch16):
  9337. (JSC::MacroAssembler::branchTestPtr):
  9338. (JSC::MacroAssembler::addPtr):
  9339. (JSC::MacroAssembler::andPtr):
  9340. (JSC::MacroAssembler::orPtr):
  9341. (JSC::MacroAssembler::rshiftPtr):
  9342. (JSC::MacroAssembler::subPtr):
  9343. (JSC::MacroAssembler::xorPtr):
  9344. (JSC::MacroAssembler::loadPtr):
  9345. (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
  9346. (JSC::MacroAssembler::storePtr):
  9347. (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
  9348. (JSC::MacroAssembler::branchAddPtr):
  9349. (JSC::MacroAssembler::branchSubPtr):
  9350. * jit/JITArithmetic.cpp:
  9351. (JSC::JIT::compileBinaryArithOp):
  9352. 2009-02-04 Alexey Proskuryakov <ap@webkit.org>
  9353. Reviewed by Sam Weinig.
  9354. https://bugs.webkit.org/show_bug.cgi?id=23681
  9355. Worker tests crash in debug builds if run --singly
  9356. The crash happened because worker threads continued running while debug-only static objects
  9357. were already being destroyed on main thread.
  9358. * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
  9359. destroyed.
  9360. * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
  9361. 2009-02-03 Gavin Barraclough <barraclough@apple.com>
  9362. Reviewed by Geoff Garen.
  9363. https://bugs.webkit.org/show_bug.cgi?id=23715
  9364. Simplify MacroAssembler interface, by combining comparison methods.
  9365. Seprate operations are combined as follows:
  9366. jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
  9367. j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
  9368. j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
  9369. set*32 -> set32
  9370. Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
  9371. instead of as multiplicands (1,2,4,8).
  9372. This patch singificantly reduces replication of code, and increases functionality supported
  9373. by the MacroAssembler. No performance impact.
  9374. * assembler/MacroAssembler.h:
  9375. (JSC::MacroAssembler::):
  9376. (JSC::MacroAssembler::branchPtr):
  9377. (JSC::MacroAssembler::branchPtrWithPatch):
  9378. (JSC::MacroAssembler::branch32):
  9379. (JSC::MacroAssembler::branch16):
  9380. (JSC::MacroAssembler::branchTestPtr):
  9381. (JSC::MacroAssembler::branchTest32):
  9382. (JSC::MacroAssembler::branchAddPtr):
  9383. (JSC::MacroAssembler::branchAdd32):
  9384. (JSC::MacroAssembler::branchMul32):
  9385. (JSC::MacroAssembler::branchSubPtr):
  9386. (JSC::MacroAssembler::branchSub32):
  9387. (JSC::MacroAssembler::set32):
  9388. (JSC::MacroAssembler::setTest32):
  9389. * assembler/X86Assembler.h:
  9390. (JSC::X86Assembler::):
  9391. (JSC::X86Assembler::jccRel32):
  9392. (JSC::X86Assembler::setccOpcode):
  9393. (JSC::X86Assembler::cmpq_mr):
  9394. (JSC::X86Assembler::setcc_r):
  9395. (JSC::X86Assembler::sete_r):
  9396. (JSC::X86Assembler::setne_r):
  9397. (JSC::X86Assembler::jne):
  9398. (JSC::X86Assembler::je):
  9399. (JSC::X86Assembler::jl):
  9400. (JSC::X86Assembler::jb):
  9401. (JSC::X86Assembler::jle):
  9402. (JSC::X86Assembler::jbe):
  9403. (JSC::X86Assembler::jge):
  9404. (JSC::X86Assembler::jg):
  9405. (JSC::X86Assembler::ja):
  9406. (JSC::X86Assembler::jae):
  9407. (JSC::X86Assembler::jo):
  9408. (JSC::X86Assembler::jp):
  9409. (JSC::X86Assembler::js):
  9410. (JSC::X86Assembler::jcc):
  9411. (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
  9412. * jit/JIT.cpp:
  9413. (JSC::JIT::compileOpStrictEq):
  9414. (JSC::JIT::emitSlowScriptCheck):
  9415. (JSC::JIT::privateCompileMainPass):
  9416. (JSC::JIT::privateCompileSlowCases):
  9417. (JSC::JIT::privateCompile):
  9418. (JSC::JIT::privateCompileCTIMachineTrampolines):
  9419. * jit/JITArithmetic.cpp:
  9420. (JSC::JIT::compileFastArith_op_lshift):
  9421. (JSC::JIT::compileFastArith_op_mod):
  9422. (JSC::JIT::compileFastArith_op_post_inc):
  9423. (JSC::JIT::compileFastArith_op_post_dec):
  9424. (JSC::JIT::compileFastArith_op_pre_inc):
  9425. (JSC::JIT::compileFastArith_op_pre_dec):
  9426. (JSC::JIT::compileBinaryArithOp):
  9427. (JSC::JIT::compileFastArith_op_add):
  9428. (JSC::JIT::compileFastArith_op_mul):
  9429. * jit/JITCall.cpp:
  9430. (JSC::JIT::compileOpCall):
  9431. (JSC::JIT::compileOpCallSlowCase):
  9432. * jit/JITInlineMethods.h:
  9433. (JSC::JIT::checkStructure):
  9434. (JSC::JIT::emitJumpIfJSCell):
  9435. (JSC::JIT::emitJumpIfNotJSCell):
  9436. (JSC::JIT::emitJumpIfImmediateNumber):
  9437. (JSC::JIT::emitJumpIfNotImmediateNumber):
  9438. (JSC::JIT::emitJumpIfImmediateInteger):
  9439. (JSC::JIT::emitJumpIfNotImmediateInteger):
  9440. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  9441. * jit/JITPropertyAccess.cpp:
  9442. (JSC::JIT::compileGetByIdHotPath):
  9443. (JSC::JIT::compilePutByIdHotPath):
  9444. (JSC::JIT::privateCompilePutByIdTransition):
  9445. (JSC::JIT::privateCompilePatchGetArrayLength):
  9446. (JSC::JIT::privateCompileGetByIdProto):
  9447. (JSC::JIT::privateCompileGetByIdProtoList):
  9448. (JSC::JIT::privateCompileGetByIdChainList):
  9449. (JSC::JIT::privateCompileGetByIdChain):
  9450. * runtime/RegExp.cpp:
  9451. (JSC::RegExp::match):
  9452. * wrec/WRECGenerator.cpp:
  9453. (JSC::WREC::Generator::generateEnter):
  9454. (JSC::WREC::Generator::generateIncrementIndex):
  9455. (JSC::WREC::Generator::generateLoadCharacter):
  9456. (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
  9457. (JSC::WREC::Generator::generateBackreferenceQuantifier):
  9458. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  9459. (JSC::WREC::Generator::generateGreedyQuantifier):
  9460. (JSC::WREC::Generator::generatePatternCharacterPair):
  9461. (JSC::WREC::Generator::generatePatternCharacter):
  9462. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  9463. (JSC::WREC::Generator::generateCharacterClassInverted):
  9464. (JSC::WREC::Generator::generateAssertionBOL):
  9465. (JSC::WREC::Generator::generateAssertionEOL):
  9466. (JSC::WREC::Generator::generateAssertionWordBoundary):
  9467. (JSC::WREC::Generator::generateBackreference):
  9468. 2009-02-03 David Hyatt <hyatt@apple.com>
  9469. Fix a bug in Vector's shrinkCapacity method. It did not properly copy elements into the inline buffer
  9470. when shrinking down from a size that was greater than the inline capacity.
  9471. Reviewed by Maciej
  9472. * wtf/Vector.h:
  9473. (WTF::VectorBuffer::VectorBuffer):
  9474. (WTF::VectorBuffer::allocateBuffer):
  9475. 2009-02-03 Simon Hausmann <simon.hausmann@nokia.com>
  9476. Reviewed by Tor Arne Vestbø.
  9477. Added accessor for JSByteArray storage.
  9478. * runtime/JSByteArray.h:
  9479. (JSC::JSByteArray::storage):
  9480. 2009-02-03 Dmitry Titov <dimich@chromium.org>
  9481. Reviewed by Alexey Proskuryakov.
  9482. https://bugs.webkit.org/show_bug.cgi?id=23560
  9483. Implement SharedTimer on WorkerRunLoop
  9484. * JavaScriptCore.exp:
  9485. Forgot to expose ThreadCondition::timedWait() in one of previous patches.
  9486. 2009-02-02 Oliver Hunt <oliver@apple.com>
  9487. Reviewed by Gavin Barraclough.
  9488. <https://bugs.webkit.org/show_bug.cgi?id=21414> REGRESSION: Regular Expressions and character classes, shorthands and ranges
  9489. <rdar://problem/6543487>
  9490. In certain circumstances when WREC::Generator::generateCharacterClassInvertedRange invokes
  9491. itself recursively, it will incorrectly emit (and thus consume) the next single character
  9492. match in the current character class. As WREC uses a binary search this out of sequence
  9493. codegen could result in a character match being missed and so cause the regex to produce
  9494. incorrect results.
  9495. * wrec/WRECGenerator.cpp:
  9496. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  9497. 2009-02-02 Darin Adler <darin@apple.com>
  9498. Reviewed by Dave Hyatt.
  9499. Bug 23676: Speed up uses of reserveCapacity on new vectors by adding a new reserveInitialCapacity
  9500. https://bugs.webkit.org/show_bug.cgi?id=23676
  9501. * API/JSObjectRef.cpp:
  9502. (JSObjectCopyPropertyNames): Use reserveInitialCapacity.
  9503. * parser/Lexer.cpp:
  9504. (JSC::Lexer::Lexer): Ditto.
  9505. (JSC::Lexer::clear): Ditto.
  9506. * wtf/Vector.h: Added reserveInitialCapacity, a more efficient version of
  9507. reserveCapacity for use when the vector is brand new (still size 0 with no
  9508. capacity other than the inline capacity).
  9509. 2009-01-30 Mark Rowe <mrowe@apple.com>
  9510. Rubber-stamped by Oliver Hunt.
  9511. <rdar://problem/6391501> Enable the JIT on Mac OS X x86_64 as it passes all tests.
  9512. * wtf/Platform.h:
  9513. 2009-01-30 Oliver Hunt <oliver@apple.com>
  9514. Reviewed by Mark Rowe and Sam Weinig.
  9515. Finally fix load() to propagate exceptions correctly.
  9516. * jsc.cpp:
  9517. (functionLoad):
  9518. 2009-01-30 David Levin <levin@chromium.org>
  9519. Reviewed by Darin Adler.
  9520. https://bugs.webkit.org/show_bug.cgi?id=23618
  9521. Templated worker tasks should be more error proof to use.
  9522. Fix Chromium build.
  9523. * wtf/TypeTraits.h:
  9524. (WTF::IsConvertibleToInteger::IsConvertibleToDouble):
  9525. Avoid "possible loss of data" warning when using Microsoft's C++ compiler
  9526. by avoiding an implicit conversion of int types to doubles.
  9527. 2009-01-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  9528. Reviewed by Simon Hausmann.
  9529. Bug 23580: GNU mode RVCT compilation support
  9530. <https://bugs.webkit.org/show_bug.cgi?id=23580>
  9531. * pcre/pcre_exec.cpp: Use COMPILER(GCC) instead of __GNUC__.
  9532. * wtf/FastMalloc.cpp: Ditto.
  9533. (WTF::TCMallocStats::):
  9534. * wtf/Platform.h: Don't define COMPILER(GCC) with RVCT --gnu.
  9535. 2009-01-30 David Levin <levin@chromium.org>
  9536. Reviewed by Alexey Proskuryakov.
  9537. Bug 23618: Templated worker tasks should be more error proof to use
  9538. <https://bugs.webkit.org/show_bug.cgi?id=23618>
  9539. Add the type traits needed for the generic worker tasks
  9540. and compile asserts for them.
  9541. Add a summary header to the TypeTraits.h file to explain what is in there.
  9542. Add a note to explain IsPod's deficiencies.
  9543. * wtf/TypeTraits.h:
  9544. 2009-01-30 David Levin <levin@chromium.org>
  9545. Reviewed by Alexey Proskuryakov.
  9546. Bug 23616: Various "template helpers" should be consolidated from isolated files in JavaScriptCore.
  9547. <https://bugs.webkit.org/show_bug.cgi?id=23616>
  9548. * wtf/TypeTraits.h: Moved RemovePointer, IsPod, IsInteger to this file.
  9549. * wtf/OwnPtr.h: Use RemovePointer from TypeTraits.h.
  9550. * wtf/RetainPtr.h: Ditto.
  9551. * wtf/HashTraits.h: Use IsInteger from TypeTraits.h.
  9552. * wtf/VectorTraits.h: Use IsPod from TypeTraits.h.
  9553. * GNUmakefile.am:
  9554. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  9555. * JavaScriptCore.xcodeproj/project.pbxproj:
  9556. Added TypeTraits.h.
  9557. 2009-01-29 Stephanie Lewis <slewis@apple.com>
  9558. RS by Oliver Hunt.
  9559. Update the order files.
  9560. * JavaScriptCore.order:
  9561. 2009-01-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  9562. Reviewed by Oliver Hunt.
  9563. Bug 23551: Crash on page load with profiler enabled and running
  9564. <https://bugs.webkit.org/show_bug.cgi?id=23551>
  9565. <rdar://problem/6529521>
  9566. Interpreter::execute(FunctionBodyNode*, ...) calls Profiler::didExecute()
  9567. with a stale CallFrame. If some part of the scope chain has already been
  9568. freed, Profiler::didExecute() will crash when attempting to get the lexical
  9569. global object. The fix is to make the didExecute() call use the caller's
  9570. CallFrame, not the one made for the function call. In this case, the
  9571. willExecute() call should also be changed to match.
  9572. Since this occurs in the actual inspector JS, it is difficult to reduce.
  9573. I couldn't make a layout test.
  9574. * interpreter/Interpreter.cpp:
  9575. (JSC::Interpreter::execute):
  9576. 2009-01-28 Sam Weinig <sam@webkit.org>
  9577. Reviewed by Gavin Barraclough.
  9578. Fix for <rdar://problem/6525537>
  9579. Hang occurs when closing Installer window (iTunes, Aperture)
  9580. * JavaScriptCore.exp: Export JSGlobalData::sharedInstance.
  9581. 2009-01-28 Sam Weinig <sam@webkit.org>
  9582. Reviewed by Geoff Garen.
  9583. Initial patch by Mark Rowe.
  9584. <rdar://problem/6519356>
  9585. REGRESSION (r36006): "out of memory" alert running dromaeo on Windows
  9586. Report the cost of the ArrayStorage vector more accurately/often.
  9587. * runtime/JSArray.cpp:
  9588. (JSC::JSArray::JSArray): Report the extra cost even for a filled array
  9589. because JSString using the single character optimization and immediates
  9590. wont increase the cost themselves.
  9591. (JSC::JSArray::putSlowCase): Update the cost when increasing the size of
  9592. the array.
  9593. (JSC::JSArray::increaseVectorLength): Ditto.
  9594. 2009-01-28 Sam Weinig <sam@webkit.org>
  9595. Reviewed by Geoff Garen.
  9596. Fix for <rdar://problem/6129678>
  9597. REGRESSION (Safari 3-4): Local variable not accessible from Dashcode console or variables view
  9598. Iterating the properties of activation objects accessed through the WebKit debugging
  9599. APIs was broken by forced conversion of JSActivation to the global object. To fix this,
  9600. we use a proxy activation object that acts more like a normal JSObject.
  9601. * debugger/DebuggerActivation.cpp: Added.
  9602. (JSC::DebuggerActivation::DebuggerActivation):
  9603. (JSC::DebuggerActivation::mark):
  9604. (JSC::DebuggerActivation::className):
  9605. (JSC::DebuggerActivation::getOwnPropertySlot):
  9606. (JSC::DebuggerActivation::put):
  9607. (JSC::DebuggerActivation::putWithAttributes):
  9608. (JSC::DebuggerActivation::deleteProperty):
  9609. (JSC::DebuggerActivation::getPropertyNames):
  9610. (JSC::DebuggerActivation::getPropertyAttributes):
  9611. (JSC::DebuggerActivation::defineGetter):
  9612. (JSC::DebuggerActivation::defineSetter):
  9613. (JSC::DebuggerActivation::lookupGetter):
  9614. (JSC::DebuggerActivation::lookupSetter):
  9615. * debugger/DebuggerActivation.h: Added.
  9616. Proxy JSActivation object for Debugging.
  9617. * runtime/JSActivation.h:
  9618. (JSC::JSActivation::isActivationObject): Added.
  9619. * runtime/JSObject.h:
  9620. (JSC::JSObject::isActivationObject): Added.
  9621. 2009-01-28 David Kilzer <ddkilzer@apple.com>
  9622. Bug 23490: Remove initialRefCount argument from RefCounted class
  9623. <https://bugs.webkit.org/show_bug.cgi?id=23490>
  9624. Reviewed by Darin Adler.
  9625. RefCountedBase now always starts with a ref count of 1, so there
  9626. is no need to pass the initialRefCount into the class anymore.
  9627. * wtf/ByteArray.h:
  9628. (WTF::ByteArray::ByteArray): Removed call to RefCounted(1).
  9629. * wtf/RefCounted.h:
  9630. (WTF::RefCountedBase::RefCountedBase): Changed to start with a
  9631. ref count of 1.
  9632. (WTF::RefCounted::RefCounted): Removed initialRefCount argument
  9633. and removed call to RefCounted(1).
  9634. 2009-01-26 Adele Peterson <adele@apple.com>
  9635. Build fix.
  9636. * debugger/Debugger.cpp:
  9637. 2009-01-26 Gavin Barraclough <barraclough@apple.com>
  9638. Reviewed by Darin Adler.
  9639. Fixes for eq null & neq null, on 64-bit JIT.
  9640. https://bugs.webkit.org/show_bug.cgi?id=23559
  9641. This patch degrades 64-bit JIT performance on some benchmarks,
  9642. due to the whole not-being-incorrect thing.
  9643. * jit/JIT.cpp:
  9644. (JSC::JIT::privateCompileMainPass):
  9645. 2009-01-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  9646. Reviewed by Gavin Barraclough.
  9647. Bug 23552: Dashcode evaluator no longer works after making ExecStates actual call frames
  9648. <https://bugs.webkit.org/show_bug.cgi?id=23552>
  9649. <rdar://problem/6398839>
  9650. * JavaScriptCore.exp:
  9651. * debugger/Debugger.cpp:
  9652. (JSC::evaluateInGlobalCallFrame): Added so that WebScriptCallFrame can
  9653. evaluate JS starting from a global call frame.
  9654. * debugger/Debugger.h:
  9655. 2009-01-25 Mark Rowe <mrowe@apple.com>
  9656. Rubber-stamped by Dan Bernstein.
  9657. Improve the consistency of settings in our .xcconfig files.
  9658. * Configurations/Base.xcconfig: Enable GCC_OBJC_CALL_CXX_CDTORS to match other projects.
  9659. 2009-01-25 Darin Adler <darin@apple.com>
  9660. Reviewed by Mark Rowe.
  9661. Bug 23352: Turn on more compiler warnings in the Mac build
  9662. https://bugs.webkit.org/show_bug.cgi?id=23352
  9663. Turn on the following warnings:
  9664. -Wcast-qual
  9665. -Wextra-tokens
  9666. -Wformat=2
  9667. -Winit-self
  9668. -Wmissing-noreturn
  9669. -Wpacked
  9670. -Wrendundant-decls
  9671. * Configurations/Base.xcconfig: Added the new warnings. Switched to -Wextra instead of
  9672. -W for clarity since we don't have to support the older versions of gcc that require the
  9673. old -W syntax. Since we now use -Wformat=2, removed -Wformat-security. Also removed
  9674. -Wno-format-y2k since we can have that one on now.
  9675. 2009-01-25 Judit Jasz <jasy@inf.u-szeged.hu>
  9676. Reviewed by Darin Adler.
  9677. Compilation problem fixing
  9678. http://bugs.webkit.org/show_bug.cgi?id=23497
  9679. * jit/JITCall.cpp:
  9680. (JSC::JIT::compileOpCall): Use JSValuePtr::encode.
  9681. 2009-01-25 Darin Adler <darin@apple.com>
  9682. Reviewed by Sam Weinig.
  9683. Bug 23352: Turn on more compiler warnings in the Mac build
  9684. https://bugs.webkit.org/show_bug.cgi?id=23352
  9685. Fourth patch: Deal with the last few stray warnings.
  9686. * parser/Parser.cpp: Only declare jscyyparse if it's not already declared.
  9687. This makes both separate compilation and all-in-one compilation work with the
  9688. -Wredundant-decls warning.
  9689. 2009-01-25 Darin Adler <darin@apple.com>
  9690. Reviewed by Sam Weinig.
  9691. Bug 23352: Turn on more compiler warnings in the Mac build
  9692. https://bugs.webkit.org/show_bug.cgi?id=23352
  9693. Third patch: Use the noreturn attribute on functions that don't
  9694. return to prepare for the use of the -Wmissing-noreturn warning.
  9695. * jit/JITCall.cpp:
  9696. (JSC::unreachable): Added NO_RETURN.
  9697. * jsc.cpp:
  9698. (functionQuit): Ditto.
  9699. (printUsageStatement): Ditto.
  9700. * wtf/AlwaysInline.h: Added definition of NO_RETURN.
  9701. 2009-01-24 Oliver Hunt <oliver@apple.com>
  9702. Reviewed by Maciej Stachowiak.
  9703. Force inlining of Lexer::matchPunctuator
  9704. 2.2% win when parsing jQuery, Mootools, Prototype, etc
  9705. * parser/Lexer.h:
  9706. 2009-01-23 Gavin Barraclough <barraclough@apple.com>
  9707. Reviewed by Geoff Garen.
  9708. Fix for <rdar://problem/6126212>
  9709. Ensure that callbacks out from the JSC interface are only allowed
  9710. to return in reverse-chronological order to that in which they were
  9711. made. If we allow earlier callbacks to return first, then this may
  9712. result in setions of the RegisterFile in use by another thread
  9713. being trampled.
  9714. See uber-comment in JSLock.h for details.
  9715. * runtime/JSLock.cpp:
  9716. (JSC::JSLock::DropAllLocks::DropAllLocks):
  9717. (JSC::JSLock::DropAllLocks::~DropAllLocks):
  9718. 2009-01-23 Darin Adler <darin@apple.com>
  9719. Try to fix WX build.
  9720. * runtime/JSGlobalObjectFunctions.h: Include <wtf/unicode/Unicode.h>
  9721. for the definition of UChar.
  9722. 2009-01-23 Anders Carlsson <andersca@apple.com>
  9723. * Configurations/Base.xcconfig:
  9724. GCC 4.0 build fix.
  9725. * runtime/JSNumberCell.h:
  9726. 64-bit build fix.
  9727. 2009-01-23 Anders Carlsson <andersca@apple.com>
  9728. Reviewed by Sam Weinig.
  9729. Turn on -Wmissing-prototypes and fix the warnings.
  9730. * API/JSClassRef.cpp:
  9731. (clearReferenceToPrototype):
  9732. * Configurations/Base.xcconfig:
  9733. * runtime/Collector.cpp:
  9734. (JSC::getPlatformThreadRegisters):
  9735. * runtime/ExceptionHelpers.cpp:
  9736. (JSC::createError):
  9737. * runtime/JSGlobalObjectFunctions.h:
  9738. * runtime/JSNumberCell.h:
  9739. * runtime/UString.cpp:
  9740. (JSC::initializeStaticBaseString):
  9741. (JSC::createRep):
  9742. * wtf/FastMalloc.cpp:
  9743. * wtf/Threading.cpp:
  9744. 2009-01-22 Mark Rowe <mrowe@apple.com>
  9745. Rubber-stamped by Anders Carlsson.
  9746. Disable GCC_WARN_ABOUT_MISSING_PROTOTYPES temporarily.
  9747. Current versions of Xcode only respect it for C and Objective-C files,
  9748. and our code doesn't currently compile if it is applied to C++ and
  9749. Objective-C++ files.
  9750. * Configurations/Base.xcconfig:
  9751. 2009-01-22 Steve Falkenburg <sfalken@apple.com>
  9752. https://bugs.webkit.org/show_bug.cgi?id=23489
  9753. Return currentTime() in correct units for the two early return cases.
  9754. Reviewed by Mark Rowe.
  9755. * wtf/CurrentTime.cpp:
  9756. (WTF::currentTime):
  9757. 2009-01-22 Sam Weinig <sam@webkit.org>
  9758. Reviewed by Mark Rowe.
  9759. Fix for <rdar://problem/6439247>
  9760. FastMalloc allocating an extra 4MB of meta-data on 64-bit
  9761. Rely on the fact that on all known x86-64 platforms only use 48 bits of
  9762. address space to shrink the initial size of the PageMap from ~4MB to 120K.
  9763. For 64-bit we still use a 3-level radix tree, but now each level is only 12
  9764. bits wide.
  9765. No performance change.
  9766. * wtf/FastMalloc.cpp:
  9767. (WTF::MapSelector): Add specialization for 64 bit that takes into account the
  9768. 16 bits of unused address space on x86-64.
  9769. 2009-01-22 Beth Dakin <bdakin@apple.com>
  9770. Reviewed by Sam Weinig.
  9771. Fix for https://bugs.webkit.org/show_bug.cgi?id=23461 LayoutTests/
  9772. fast/js/numeric-conversion.html is broken, and corresponding
  9773. <rdar://problem/6514842>
  9774. The basic problem here is that parseInt(Infinity) should be NaN,
  9775. but we were returning 0. NaN matches Safari 3.2.1 and Firefox.
  9776. * runtime/JSGlobalObjectFunctions.cpp:
  9777. (JSC::globalFuncParseInt):
  9778. 2009-01-22 Oliver Hunt <oliver@apple.com>
  9779. Reviewed by Geoff Garen.
  9780. <rdar://problem/6516853> (r39682-r39736) JSFunFuzz: crash on "(function(){({ x2: x }), })()"
  9781. <https://bugs.webkit.org/show_bug.cgi?id=23479>
  9782. Automatic semicolon insertion was resulting in this being accepted in the initial
  9783. nodeless parsing, but subsequent reparsing for code generation would fail, leading
  9784. to a crash. The solution is to ensure that reparsing a function performs parsing
  9785. in the same state as the initial parse. We do this by modifying the saved source
  9786. ranges to include rather than exclude the opening and closing braces.
  9787. * bytecode/CodeBlock.cpp:
  9788. (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): add an assertion for successful recompile
  9789. * parser/Lexer.h:
  9790. (JSC::Lexer::sourceCode): include rather than exclude braces.
  9791. * parser/Nodes.h:
  9792. (JSC::FunctionBodyNode::toSourceString): No need to append braces anymore.
  9793. 2009-01-22 Dmitry Titov <dimich@chromium.org>
  9794. Reviewed by Alexey Proskuryakov.
  9795. https://bugs.webkit.org/show_bug.cgi?id=23373
  9796. Implement ThreadCondition::timedWait().
  9797. Since we borrow the code for condition variables from other sources,
  9798. I did the same for timedWait(). See comments in ThreadingWin.cpp for
  9799. rationale and more info.
  9800. * wtf/CONTRIBUTORS.pthreads-win32:
  9801. Added. A list of Pthreads-win32 contributors mentioned in their license. The license itself
  9802. is included into wtf/ThreadingWin32.cpp.
  9803. * wtf/Threading.h:
  9804. * wtf/ThreadingWin.cpp:
  9805. Additional info and Pthreads-win32 license at the beginning.
  9806. (WTF::PlatformCondition::timedWait): new method, derived from Pthreads-win32.
  9807. (WTF::PlatformCondition::signal): same
  9808. (WTF::ThreadCondition::ThreadCondition):
  9809. (WTF::ThreadCondition::~ThreadCondition):
  9810. (WTF::ThreadCondition::wait): this now calls PlatformCondition::timedWait.
  9811. (WTF::ThreadCondition::timedWait): same
  9812. (WTF::ThreadCondition::signal): this now calls PlatformCondition::signal.
  9813. (WTF::ThreadCondition::broadcast): same
  9814. 2009-01-21 Gavin Barraclough <barraclough@apple.com>
  9815. Reviewed by Oliver Hunt.
  9816. Fix for https://bugs.webkit.org/show_bug.cgi?id=23469.
  9817. We need to check all numbers in integer switches, not just those
  9818. represented as integer JSImmediates.
  9819. * interpreter/Interpreter.cpp:
  9820. (JSC::Interpreter::privateExecute):
  9821. (JSC::Interpreter::cti_op_switch_imm):
  9822. 2009-01-21 Gavin Barraclough <barraclough@apple.com>
  9823. Reviewed by Geoff Garen.
  9824. Fix for https://bugs.webkit.org/show_bug.cgi?id=23468.
  9825. * interpreter/Interpreter.cpp:
  9826. (JSC::Interpreter::privateExecute):
  9827. 2009-01-21 Alexey Proskuryakov <ap@webkit.org>
  9828. Suggested by Oliver Hunt. Reviewed by Oliver Hunt.
  9829. https://bugs.webkit.org/show_bug.cgi?id=23456
  9830. Function argument names leak
  9831. * parser/Nodes.cpp: (JSC::FunctionBodyNode::~FunctionBodyNode): Destruct parameter names.
  9832. 2009-01-20 Oliver Hunt <oliver@apple.com>
  9833. Reviewed by NOBODY (Build fix).
  9834. Windows build fix
  9835. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  9836. 2009-01-20 Gavin Barraclough <barraclough@apple.com>
  9837. Reviewed by Mark Rowe.
  9838. Structure property table deleted offset maps are being leaked.
  9839. Probably shouldn't be doing that.
  9840. https://bugs.webkit.org/show_bug.cgi?id=23442
  9841. * runtime/Structure.cpp:
  9842. (JSC::Structure::~Structure):
  9843. 2009-01-20 Oliver Hunt <oliver@apple.com>
  9844. Reviewed by NOBODY (build fix).
  9845. Attempt to fix gtk build
  9846. * GNUmakefile.am:
  9847. 2009-01-20 Darin Adler <darin@apple.com>
  9848. * runtime/StringPrototype.cpp:
  9849. (JSC::substituteBackreferences): Add back the initialization to fix the build.
  9850. 2009-01-20 Darin Adler <darin@apple.com>
  9851. Reviewed by Mark Rowe.
  9852. Bug 23352: Turn on more compiler warnings in the Mac build
  9853. https://bugs.webkit.org/show_bug.cgi?id=23352
  9854. First patch: Fix some simple cases of various warnings.
  9855. * pcre/pcre_compile.cpp:
  9856. (jsRegExpCompile): Use const_cast to change const-ness.
  9857. * runtime/StringPrototype.cpp:
  9858. (JSC::substituteBackreferences): Remove unneeded initialization and
  9859. use UChar instead of unsigned short for UTF-16 values.
  9860. * wtf/dtoa.cpp:
  9861. (WTF::strtod): Use const_cast to change const-ness.
  9862. 2009-01-20 Oliver Hunt <oliver@apple.com>
  9863. Reviewed by NOBODY (build fix).
  9864. Whoops, remove runtime/ByteArray references from .pri and .scons builds, update .bkl
  9865. * JavaScriptCore.pri:
  9866. * JavaScriptCore.scons:
  9867. * JavaScriptCoreSources.bkl:
  9868. 2009-01-20 Oliver Hunt <oliver@apple.com>
  9869. RS=Dan Bernstein.
  9870. Move runtime/ByteArray to wtf/ByteArray
  9871. * GNUmakefile.am:
  9872. * JavaScriptCore.exp:
  9873. * JavaScriptCore.pri:
  9874. * JavaScriptCore.scons:
  9875. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  9876. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  9877. * JavaScriptCore.xcodeproj/project.pbxproj:
  9878. * runtime/JSByteArray.cpp:
  9879. * runtime/JSByteArray.h:
  9880. * wtf/ByteArray.cpp: Renamed from JavaScriptCore/runtime/ByteArray.cpp.
  9881. (WTF::ByteArray::create):
  9882. * wtf/ByteArray.h: Renamed from JavaScriptCore/runtime/ByteArray.h.
  9883. (WTF::ByteArray::length):
  9884. (WTF::ByteArray::set):
  9885. (WTF::ByteArray::get):
  9886. (WTF::ByteArray::data):
  9887. (WTF::ByteArray::deref):
  9888. (WTF::ByteArray::ByteArray):
  9889. 2009-01-19 Sam Weinig <sam@webkit.org>
  9890. Rubber-stamped by Gavin Barraclough.
  9891. Remove temporary operator-> from JSValuePtr.
  9892. * API/JSCallbackFunction.cpp:
  9893. (JSC::JSCallbackFunction::call):
  9894. * API/JSCallbackObjectFunctions.h:
  9895. (JSC::::call):
  9896. (JSC::::toNumber):
  9897. (JSC::::toString):
  9898. * API/JSObjectRef.cpp:
  9899. (JSObjectSetPrototype):
  9900. * API/JSValueRef.cpp:
  9901. (JSValueGetType):
  9902. (JSValueIsUndefined):
  9903. (JSValueIsNull):
  9904. (JSValueIsBoolean):
  9905. (JSValueIsNumber):
  9906. (JSValueIsString):
  9907. (JSValueIsObject):
  9908. (JSValueIsObjectOfClass):
  9909. (JSValueToBoolean):
  9910. (JSValueToNumber):
  9911. (JSValueToStringCopy):
  9912. (JSValueToObject):
  9913. * bytecode/CodeBlock.cpp:
  9914. (JSC::valueToSourceString):
  9915. (JSC::CodeBlock::mark):
  9916. * bytecode/CodeBlock.h:
  9917. (JSC::CodeBlock::isKnownNotImmediate):
  9918. * bytecompiler/BytecodeGenerator.cpp:
  9919. (JSC::BytecodeGenerator::emitEqualityOp):
  9920. (JSC::keyForImmediateSwitch):
  9921. * interpreter/Interpreter.cpp:
  9922. (JSC::jsLess):
  9923. (JSC::jsLessEq):
  9924. (JSC::jsAddSlowCase):
  9925. (JSC::jsAdd):
  9926. (JSC::jsTypeStringForValue):
  9927. (JSC::jsIsObjectType):
  9928. (JSC::jsIsFunctionType):
  9929. (JSC::isNotObject):
  9930. (JSC::Interpreter::callEval):
  9931. (JSC::Interpreter::throwException):
  9932. (JSC::cachePrototypeChain):
  9933. (JSC::Interpreter::tryCachePutByID):
  9934. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  9935. (JSC::Interpreter::tryCacheGetByID):
  9936. (JSC::Interpreter::privateExecute):
  9937. (JSC::Interpreter::tryCTICachePutByID):
  9938. (JSC::Interpreter::tryCTICacheGetByID):
  9939. (JSC::Interpreter::cti_op_convert_this):
  9940. (JSC::Interpreter::cti_op_add):
  9941. (JSC::Interpreter::cti_op_pre_inc):
  9942. (JSC::Interpreter::cti_op_put_by_id_generic):
  9943. (JSC::Interpreter::cti_op_get_by_id_generic):
  9944. (JSC::Interpreter::cti_op_put_by_id):
  9945. (JSC::Interpreter::cti_op_put_by_id_second):
  9946. (JSC::Interpreter::cti_op_put_by_id_fail):
  9947. (JSC::Interpreter::cti_op_get_by_id):
  9948. (JSC::Interpreter::cti_op_get_by_id_second):
  9949. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  9950. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  9951. (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
  9952. (JSC::Interpreter::cti_op_get_by_id_proto_fail):
  9953. (JSC::Interpreter::cti_op_get_by_id_array_fail):
  9954. (JSC::Interpreter::cti_op_get_by_id_string_fail):
  9955. (JSC::Interpreter::cti_op_instanceof):
  9956. (JSC::Interpreter::cti_op_del_by_id):
  9957. (JSC::Interpreter::cti_op_mul):
  9958. (JSC::Interpreter::cti_op_call_JSFunction):
  9959. (JSC::Interpreter::cti_op_call_NotJSFunction):
  9960. (JSC::Interpreter::cti_op_construct_JSConstruct):
  9961. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  9962. (JSC::Interpreter::cti_op_get_by_val):
  9963. (JSC::Interpreter::cti_op_get_by_val_byte_array):
  9964. (JSC::Interpreter::cti_op_sub):
  9965. (JSC::Interpreter::cti_op_put_by_val):
  9966. (JSC::Interpreter::cti_op_put_by_val_array):
  9967. (JSC::Interpreter::cti_op_put_by_val_byte_array):
  9968. (JSC::Interpreter::cti_op_loop_if_true):
  9969. (JSC::Interpreter::cti_op_negate):
  9970. (JSC::Interpreter::cti_op_div):
  9971. (JSC::Interpreter::cti_op_pre_dec):
  9972. (JSC::Interpreter::cti_op_not):
  9973. (JSC::Interpreter::cti_op_jtrue):
  9974. (JSC::Interpreter::cti_op_post_inc):
  9975. (JSC::Interpreter::cti_op_lshift):
  9976. (JSC::Interpreter::cti_op_bitand):
  9977. (JSC::Interpreter::cti_op_rshift):
  9978. (JSC::Interpreter::cti_op_bitnot):
  9979. (JSC::Interpreter::cti_op_mod):
  9980. (JSC::Interpreter::cti_op_post_dec):
  9981. (JSC::Interpreter::cti_op_urshift):
  9982. (JSC::Interpreter::cti_op_bitxor):
  9983. (JSC::Interpreter::cti_op_bitor):
  9984. (JSC::Interpreter::cti_op_push_scope):
  9985. (JSC::Interpreter::cti_op_is_undefined):
  9986. (JSC::Interpreter::cti_op_is_boolean):
  9987. (JSC::Interpreter::cti_op_is_number):
  9988. (JSC::Interpreter::cti_op_to_jsnumber):
  9989. (JSC::Interpreter::cti_op_in):
  9990. (JSC::Interpreter::cti_op_put_by_index):
  9991. (JSC::Interpreter::cti_op_switch_imm):
  9992. (JSC::Interpreter::cti_op_switch_char):
  9993. (JSC::Interpreter::cti_op_switch_string):
  9994. (JSC::Interpreter::cti_op_del_by_val):
  9995. (JSC::Interpreter::cti_op_put_getter):
  9996. (JSC::Interpreter::cti_op_put_setter):
  9997. (JSC::Interpreter::cti_op_new_error):
  9998. * interpreter/Interpreter.h:
  9999. (JSC::Interpreter::isJSArray):
  10000. (JSC::Interpreter::isJSString):
  10001. (JSC::Interpreter::isJSByteArray):
  10002. * interpreter/Register.h:
  10003. (JSC::Register::marked):
  10004. (JSC::Register::mark):
  10005. * jit/JITInlineMethods.h:
  10006. (JSC::JIT::getConstantOperandImmediateInt):
  10007. (JSC::JIT::isOperandConstantImmediateInt):
  10008. * jsc.cpp:
  10009. (functionPrint):
  10010. (functionDebug):
  10011. (functionRun):
  10012. (functionLoad):
  10013. (runWithScripts):
  10014. (runInteractive):
  10015. * parser/Nodes.cpp:
  10016. (JSC::processClauseList):
  10017. * profiler/ProfileGenerator.cpp:
  10018. (JSC::ProfileGenerator::addParentForConsoleStart):
  10019. * profiler/Profiler.cpp:
  10020. (JSC::Profiler::createCallIdentifier):
  10021. * runtime/ArrayConstructor.cpp:
  10022. (JSC::constructArrayWithSizeQuirk):
  10023. * runtime/ArrayPrototype.cpp:
  10024. (JSC::arrayProtoFuncToString):
  10025. (JSC::arrayProtoFuncToLocaleString):
  10026. (JSC::arrayProtoFuncJoin):
  10027. (JSC::arrayProtoFuncConcat):
  10028. (JSC::arrayProtoFuncPop):
  10029. (JSC::arrayProtoFuncPush):
  10030. (JSC::arrayProtoFuncReverse):
  10031. (JSC::arrayProtoFuncShift):
  10032. (JSC::arrayProtoFuncSlice):
  10033. (JSC::arrayProtoFuncSort):
  10034. (JSC::arrayProtoFuncSplice):
  10035. (JSC::arrayProtoFuncUnShift):
  10036. (JSC::arrayProtoFuncFilter):
  10037. (JSC::arrayProtoFuncMap):
  10038. (JSC::arrayProtoFuncEvery):
  10039. (JSC::arrayProtoFuncForEach):
  10040. (JSC::arrayProtoFuncSome):
  10041. (JSC::arrayProtoFuncIndexOf):
  10042. (JSC::arrayProtoFuncLastIndexOf):
  10043. * runtime/BooleanConstructor.cpp:
  10044. (JSC::constructBoolean):
  10045. (JSC::callBooleanConstructor):
  10046. * runtime/BooleanPrototype.cpp:
  10047. (JSC::booleanProtoFuncToString):
  10048. (JSC::booleanProtoFuncValueOf):
  10049. * runtime/Collector.cpp:
  10050. (JSC::Heap::protect):
  10051. (JSC::Heap::unprotect):
  10052. (JSC::Heap::heap):
  10053. (JSC::Heap::collect):
  10054. (JSC::typeName):
  10055. * runtime/Completion.cpp:
  10056. (JSC::evaluate):
  10057. * runtime/DateConstructor.cpp:
  10058. (JSC::constructDate):
  10059. (JSC::dateParse):
  10060. (JSC::dateUTC):
  10061. * runtime/DateInstance.h:
  10062. (JSC::DateInstance::internalNumber):
  10063. * runtime/DatePrototype.cpp:
  10064. (JSC::formatLocaleDate):
  10065. (JSC::fillStructuresUsingTimeArgs):
  10066. (JSC::fillStructuresUsingDateArgs):
  10067. (JSC::dateProtoFuncToString):
  10068. (JSC::dateProtoFuncToUTCString):
  10069. (JSC::dateProtoFuncToDateString):
  10070. (JSC::dateProtoFuncToTimeString):
  10071. (JSC::dateProtoFuncToLocaleString):
  10072. (JSC::dateProtoFuncToLocaleDateString):
  10073. (JSC::dateProtoFuncToLocaleTimeString):
  10074. (JSC::dateProtoFuncGetTime):
  10075. (JSC::dateProtoFuncGetFullYear):
  10076. (JSC::dateProtoFuncGetUTCFullYear):
  10077. (JSC::dateProtoFuncToGMTString):
  10078. (JSC::dateProtoFuncGetMonth):
  10079. (JSC::dateProtoFuncGetUTCMonth):
  10080. (JSC::dateProtoFuncGetDate):
  10081. (JSC::dateProtoFuncGetUTCDate):
  10082. (JSC::dateProtoFuncGetDay):
  10083. (JSC::dateProtoFuncGetUTCDay):
  10084. (JSC::dateProtoFuncGetHours):
  10085. (JSC::dateProtoFuncGetUTCHours):
  10086. (JSC::dateProtoFuncGetMinutes):
  10087. (JSC::dateProtoFuncGetUTCMinutes):
  10088. (JSC::dateProtoFuncGetSeconds):
  10089. (JSC::dateProtoFuncGetUTCSeconds):
  10090. (JSC::dateProtoFuncGetMilliSeconds):
  10091. (JSC::dateProtoFuncGetUTCMilliseconds):
  10092. (JSC::dateProtoFuncGetTimezoneOffset):
  10093. (JSC::dateProtoFuncSetTime):
  10094. (JSC::setNewValueFromTimeArgs):
  10095. (JSC::setNewValueFromDateArgs):
  10096. (JSC::dateProtoFuncSetYear):
  10097. (JSC::dateProtoFuncGetYear):
  10098. * runtime/ErrorConstructor.cpp:
  10099. (JSC::constructError):
  10100. * runtime/ErrorPrototype.cpp:
  10101. (JSC::errorProtoFuncToString):
  10102. * runtime/ExceptionHelpers.cpp:
  10103. (JSC::createError):
  10104. (JSC::createErrorMessage):
  10105. * runtime/FunctionConstructor.cpp:
  10106. (JSC::constructFunction):
  10107. * runtime/FunctionPrototype.cpp:
  10108. (JSC::functionProtoFuncToString):
  10109. (JSC::functionProtoFuncApply):
  10110. (JSC::functionProtoFuncCall):
  10111. * runtime/GetterSetter.cpp:
  10112. (JSC::GetterSetter::toObject):
  10113. * runtime/JSActivation.cpp:
  10114. (JSC::JSActivation::getOwnPropertySlot):
  10115. * runtime/JSArray.cpp:
  10116. (JSC::JSArray::put):
  10117. (JSC::JSArray::mark):
  10118. (JSC::JSArray::sort):
  10119. (JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
  10120. (JSC::JSArray::compactForSorting):
  10121. * runtime/JSByteArray.h:
  10122. (JSC::JSByteArray::setIndex):
  10123. * runtime/JSCell.h:
  10124. (JSC::asCell):
  10125. * runtime/JSFunction.cpp:
  10126. (JSC::JSFunction::call):
  10127. (JSC::JSFunction::construct):
  10128. * runtime/JSGlobalObject.cpp:
  10129. (JSC::markIfNeeded):
  10130. (JSC::lastInPrototypeChain):
  10131. * runtime/JSGlobalObjectFunctions.cpp:
  10132. (JSC::encode):
  10133. (JSC::decode):
  10134. (JSC::globalFuncEval):
  10135. (JSC::globalFuncParseInt):
  10136. (JSC::globalFuncParseFloat):
  10137. (JSC::globalFuncIsNaN):
  10138. (JSC::globalFuncIsFinite):
  10139. (JSC::globalFuncEscape):
  10140. (JSC::globalFuncUnescape):
  10141. (JSC::globalFuncJSCPrint):
  10142. * runtime/JSImmediate.cpp:
  10143. (JSC::JSImmediate::toThisObject):
  10144. (JSC::JSImmediate::toObject):
  10145. (JSC::JSImmediate::prototype):
  10146. (JSC::JSImmediate::toString):
  10147. * runtime/JSImmediate.h:
  10148. * runtime/JSObject.cpp:
  10149. (JSC::JSObject::mark):
  10150. (JSC::JSObject::put):
  10151. (JSC::callDefaultValueFunction):
  10152. (JSC::JSObject::getPrimitiveNumber):
  10153. (JSC::JSObject::defineGetter):
  10154. (JSC::JSObject::defineSetter):
  10155. (JSC::JSObject::lookupGetter):
  10156. (JSC::JSObject::lookupSetter):
  10157. (JSC::JSObject::hasInstance):
  10158. (JSC::JSObject::toNumber):
  10159. (JSC::JSObject::toString):
  10160. * runtime/JSObject.h:
  10161. (JSC::JSObject::JSObject):
  10162. (JSC::JSObject::inlineGetOwnPropertySlot):
  10163. (JSC::JSObject::getOwnPropertySlotForWrite):
  10164. (JSC::JSObject::getPropertySlot):
  10165. (JSC::JSValuePtr::get):
  10166. * runtime/JSPropertyNameIterator.h:
  10167. (JSC::JSPropertyNameIterator::create):
  10168. * runtime/JSString.cpp:
  10169. (JSC::JSString::getOwnPropertySlot):
  10170. * runtime/JSValue.h:
  10171. * runtime/JSWrapperObject.cpp:
  10172. (JSC::JSWrapperObject::mark):
  10173. * runtime/JSWrapperObject.h:
  10174. (JSC::JSWrapperObject::setInternalValue):
  10175. * runtime/MathObject.cpp:
  10176. (JSC::mathProtoFuncAbs):
  10177. (JSC::mathProtoFuncACos):
  10178. (JSC::mathProtoFuncASin):
  10179. (JSC::mathProtoFuncATan):
  10180. (JSC::mathProtoFuncATan2):
  10181. (JSC::mathProtoFuncCeil):
  10182. (JSC::mathProtoFuncCos):
  10183. (JSC::mathProtoFuncExp):
  10184. (JSC::mathProtoFuncFloor):
  10185. (JSC::mathProtoFuncLog):
  10186. (JSC::mathProtoFuncMax):
  10187. (JSC::mathProtoFuncMin):
  10188. (JSC::mathProtoFuncPow):
  10189. (JSC::mathProtoFuncRound):
  10190. (JSC::mathProtoFuncSin):
  10191. (JSC::mathProtoFuncSqrt):
  10192. (JSC::mathProtoFuncTan):
  10193. * runtime/NativeErrorConstructor.cpp:
  10194. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  10195. (JSC::NativeErrorConstructor::construct):
  10196. * runtime/NumberConstructor.cpp:
  10197. (JSC::constructWithNumberConstructor):
  10198. (JSC::callNumberConstructor):
  10199. * runtime/NumberPrototype.cpp:
  10200. (JSC::numberProtoFuncToString):
  10201. (JSC::numberProtoFuncToLocaleString):
  10202. (JSC::numberProtoFuncValueOf):
  10203. (JSC::numberProtoFuncToFixed):
  10204. (JSC::numberProtoFuncToExponential):
  10205. (JSC::numberProtoFuncToPrecision):
  10206. * runtime/ObjectConstructor.cpp:
  10207. (JSC::constructObject):
  10208. * runtime/ObjectPrototype.cpp:
  10209. (JSC::objectProtoFuncValueOf):
  10210. (JSC::objectProtoFuncHasOwnProperty):
  10211. (JSC::objectProtoFuncIsPrototypeOf):
  10212. (JSC::objectProtoFuncDefineGetter):
  10213. (JSC::objectProtoFuncDefineSetter):
  10214. (JSC::objectProtoFuncLookupGetter):
  10215. (JSC::objectProtoFuncLookupSetter):
  10216. (JSC::objectProtoFuncPropertyIsEnumerable):
  10217. (JSC::objectProtoFuncToLocaleString):
  10218. (JSC::objectProtoFuncToString):
  10219. * runtime/Operations.h:
  10220. (JSC::JSValuePtr::equalSlowCaseInline):
  10221. (JSC::JSValuePtr::strictEqual):
  10222. (JSC::JSValuePtr::strictEqualSlowCaseInline):
  10223. * runtime/Protect.h:
  10224. (JSC::gcProtect):
  10225. (JSC::gcUnprotect):
  10226. * runtime/RegExpConstructor.cpp:
  10227. (JSC::setRegExpConstructorInput):
  10228. (JSC::setRegExpConstructorMultiline):
  10229. (JSC::constructRegExp):
  10230. * runtime/RegExpObject.cpp:
  10231. (JSC::setRegExpObjectLastIndex):
  10232. (JSC::RegExpObject::match):
  10233. * runtime/RegExpPrototype.cpp:
  10234. (JSC::regExpProtoFuncTest):
  10235. (JSC::regExpProtoFuncExec):
  10236. (JSC::regExpProtoFuncCompile):
  10237. (JSC::regExpProtoFuncToString):
  10238. * runtime/StringConstructor.cpp:
  10239. (JSC::stringFromCharCodeSlowCase):
  10240. (JSC::stringFromCharCode):
  10241. (JSC::constructWithStringConstructor):
  10242. (JSC::callStringConstructor):
  10243. * runtime/StringPrototype.cpp:
  10244. (JSC::stringProtoFuncReplace):
  10245. (JSC::stringProtoFuncToString):
  10246. (JSC::stringProtoFuncCharAt):
  10247. (JSC::stringProtoFuncCharCodeAt):
  10248. (JSC::stringProtoFuncConcat):
  10249. (JSC::stringProtoFuncIndexOf):
  10250. (JSC::stringProtoFuncLastIndexOf):
  10251. (JSC::stringProtoFuncMatch):
  10252. (JSC::stringProtoFuncSearch):
  10253. (JSC::stringProtoFuncSlice):
  10254. (JSC::stringProtoFuncSplit):
  10255. (JSC::stringProtoFuncSubstr):
  10256. (JSC::stringProtoFuncSubstring):
  10257. (JSC::stringProtoFuncToLowerCase):
  10258. (JSC::stringProtoFuncToUpperCase):
  10259. (JSC::stringProtoFuncLocaleCompare):
  10260. (JSC::stringProtoFuncBig):
  10261. (JSC::stringProtoFuncSmall):
  10262. (JSC::stringProtoFuncBlink):
  10263. (JSC::stringProtoFuncBold):
  10264. (JSC::stringProtoFuncFixed):
  10265. (JSC::stringProtoFuncItalics):
  10266. (JSC::stringProtoFuncStrike):
  10267. (JSC::stringProtoFuncSub):
  10268. (JSC::stringProtoFuncSup):
  10269. (JSC::stringProtoFuncFontcolor):
  10270. (JSC::stringProtoFuncFontsize):
  10271. (JSC::stringProtoFuncAnchor):
  10272. (JSC::stringProtoFuncLink):
  10273. * runtime/Structure.cpp:
  10274. (JSC::Structure::Structure):
  10275. (JSC::Structure::getEnumerablePropertyNames):
  10276. (JSC::Structure::createCachedPrototypeChain):
  10277. * runtime/Structure.h:
  10278. (JSC::Structure::mark):
  10279. * runtime/StructureChain.cpp:
  10280. (JSC::StructureChain::StructureChain):
  10281. 2009-01-19 Darin Adler <darin@apple.com>
  10282. Reviewed by Sam Weinig.
  10283. Bug 23409: REGRESSION: RegExp 'replace()' function improperly processes '$$'
  10284. <https://bugs.webkit.org/show_bug.cgi?id=23409>
  10285. <rdar://problem/6505723>
  10286. Test: fast/js/string-replace-3.html
  10287. * runtime/StringPrototype.cpp:
  10288. (JSC::substituteBackreferences): Remove code that adds an extra $ -- not sure
  10289. how this ever worked.
  10290. 2009-01-16 Gavin Barraclough <barraclough@apple.com>
  10291. Reviewed by Oliver Hunt.
  10292. On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
  10293. registers, save reloading them every time they're used.
  10294. Draws x86-64 jit performance close to that of i386 jit.
  10295. * assembler/MacroAssembler.h:
  10296. (JSC::MacroAssembler::subPtr):
  10297. (JSC::MacroAssembler::jnzPtr):
  10298. (JSC::MacroAssembler::jzPtr):
  10299. * jit/JIT.cpp:
  10300. (JSC::JIT::privateCompileMainPass):
  10301. * jit/JIT.h:
  10302. * jit/JITArithmetic.cpp:
  10303. (JSC::JIT::compileBinaryArithOpSlowCase):
  10304. * jit/JITInlineMethods.h:
  10305. (JSC::JIT::emitJumpIfJSCell):
  10306. (JSC::JIT::emitJumpIfNotJSCell):
  10307. (JSC::JIT::emitJumpIfImmediateNumber):
  10308. (JSC::JIT::emitJumpIfNotImmediateNumber):
  10309. (JSC::JIT::emitJumpIfImmediateInteger):
  10310. (JSC::JIT::emitJumpIfNotImmediateInteger):
  10311. (JSC::JIT::emitFastArithIntToImmNoCheck):
  10312. 2009-01-16 Gavin Barraclough <barraclough@apple.com>
  10313. Reviewed by Oliver Hunt.
  10314. Add support to x86-64 JIT for inline double precision arithmetic ops.
  10315. +5/6% on x86-64, JIT enabled, sunspider.
  10316. * assembler/MacroAssembler.h:
  10317. (JSC::MacroAssembler::addPtr):
  10318. * assembler/X86Assembler.h:
  10319. (JSC::X86Assembler::movq_rr):
  10320. * jit/JIT.h:
  10321. * jit/JITArithmetic.cpp:
  10322. (JSC::JIT::compileFastArith_op_pre_inc):
  10323. (JSC::JIT::compileBinaryArithOp):
  10324. (JSC::JIT::compileBinaryArithOpSlowCase):
  10325. (JSC::JIT::compileFastArith_op_add):
  10326. (JSC::JIT::compileFastArithSlow_op_add):
  10327. (JSC::JIT::compileFastArith_op_mul):
  10328. (JSC::JIT::compileFastArithSlow_op_mul):
  10329. (JSC::JIT::compileFastArith_op_sub):
  10330. (JSC::JIT::compileFastArithSlow_op_sub):
  10331. * parser/ResultType.h:
  10332. (JSC::ResultType::isReusable):
  10333. (JSC::ResultType::isInt32):
  10334. (JSC::ResultType::definitelyIsNumber):
  10335. (JSC::ResultType::mightBeNumber):
  10336. (JSC::ResultType::isNotNumber):
  10337. (JSC::ResultType::unknownType):
  10338. 2009-01-16 Gavin Barraclough <barraclough@apple.com>
  10339. Reviewed by Geoff Garen.
  10340. Fixes for SamplingTool.
  10341. https://bugs.webkit.org/show_bug.cgi?id=23390
  10342. * assembler/MacroAssembler.h:
  10343. (JSC::MacroAssembler::storePtr):
  10344. * bytecode/SamplingTool.cpp:
  10345. (JSC::SamplingTool::run):
  10346. (JSC::SamplingTool::dump):
  10347. * bytecode/SamplingTool.h:
  10348. (JSC::SamplingTool::encodeSample):
  10349. * jit/JIT.cpp:
  10350. (JSC::JIT::privateCompileMainPass):
  10351. (JSC::JIT::privateCompile):
  10352. * jit/JIT.h:
  10353. (JSC::JIT::samplingToolTrackCodeBlock):
  10354. * jit/JITCall.cpp:
  10355. (JSC::JIT::compileOpCall):
  10356. (JSC::JIT::compileOpCallSlowCase):
  10357. * jit/JITInlineMethods.h:
  10358. (JSC::JIT::emitCTICall_internal):
  10359. 2009-01-16 Geoffrey Garen <ggaren@apple.com>
  10360. Reviewed by Darin Adler.
  10361. Fixed <rdar://problem/6452301> REGRESSION: Latest WebKit nightlies
  10362. turn "c" into "" when stripping \\c_ character
  10363. * wrec/WRECParser.cpp:
  10364. (JSC::WREC::Parser::consumeEscape): Mimic a Firefox quirk when parsing
  10365. control escapes inside character classes.
  10366. 2009-01-16 Adam Roben <aroben@apple.com>
  10367. Windows build fix
  10368. * wrec/WRECParser.cpp:
  10369. (JSC::WREC::Parser::parseParentheses): Removed unreachable code.
  10370. 2009-01-15 Geoffrey Garen <ggaren@apple.com>
  10371. Reviewed by Cameron Zwarich.
  10372. Fixed <rdar://problem/6471394> REGRESSION (r39164): Discarding quantifier
  10373. on assertion gives incorrect result (23075)
  10374. https://bugs.webkit.org/show_bug.cgi?id=23075
  10375. * pcre/pcre_compile.cpp:
  10376. (compileBranch): Throw away an assertion if it's followed by a quantifier
  10377. with a 0 minimum, to match SpiderMonkey, v8, and the ECMA spec.
  10378. * wrec/WRECParser.cpp:
  10379. (JSC::WREC::Parser::parseParentheses): Fall back on PCRE for the rare
  10380. case of an assertion with a quantifier with a 0 minimum, since we
  10381. don't handle quantified subexpressions yet, and in this special case,
  10382. we can't just throw away the quantifier.
  10383. 2009-01-15 Gavin Barraclough <barraclough@apple.com>
  10384. Reviewed by Oliver Hunt.
  10385. Add support in ResultType to track that the results of bitops
  10386. are always of type int32_t.
  10387. * parser/Nodes.cpp:
  10388. (JSC::ReadModifyResolveNode::emitBytecode):
  10389. (JSC::ReadModifyDotNode::emitBytecode):
  10390. (JSC::ReadModifyBracketNode::emitBytecode):
  10391. * parser/Nodes.h:
  10392. (JSC::ExpressionNode::):
  10393. (JSC::BooleanNode::):
  10394. (JSC::NumberNode::):
  10395. (JSC::StringNode::):
  10396. (JSC::PrePostResolveNode::):
  10397. (JSC::TypeOfResolveNode::):
  10398. (JSC::TypeOfValueNode::):
  10399. (JSC::UnaryPlusNode::):
  10400. (JSC::NegateNode::):
  10401. (JSC::BitwiseNotNode::):
  10402. (JSC::LogicalNotNode::):
  10403. (JSC::MultNode::):
  10404. (JSC::DivNode::):
  10405. (JSC::ModNode::):
  10406. (JSC::SubNode::):
  10407. (JSC::LeftShiftNode::):
  10408. (JSC::RightShiftNode::):
  10409. (JSC::UnsignedRightShiftNode::):
  10410. (JSC::LessNode::):
  10411. (JSC::GreaterNode::):
  10412. (JSC::LessEqNode::):
  10413. (JSC::GreaterEqNode::):
  10414. (JSC::InstanceOfNode::):
  10415. (JSC::EqualNode::):
  10416. (JSC::NotEqualNode::):
  10417. (JSC::StrictEqualNode::):
  10418. (JSC::NotStrictEqualNode::):
  10419. (JSC::BitAndNode::):
  10420. (JSC::BitOrNode::):
  10421. (JSC::BitXOrNode::):
  10422. (JSC::LogicalOpNode::):
  10423. * parser/ResultType.h:
  10424. (JSC::ResultType::isInt32):
  10425. (JSC::ResultType::isNotNumber):
  10426. (JSC::ResultType::booleanType):
  10427. (JSC::ResultType::numberType):
  10428. (JSC::ResultType::numberTypeCanReuse):
  10429. (JSC::ResultType::numberTypeCanReuseIsInt32):
  10430. (JSC::ResultType::stringOrNumberTypeCanReuse):
  10431. (JSC::ResultType::stringType):
  10432. (JSC::ResultType::unknownType):
  10433. (JSC::ResultType::forAdd):
  10434. (JSC::ResultType::forBitOp):
  10435. (JSC::OperandTypes::OperandTypes):
  10436. 2009-01-15 Gavin Barraclough <barraclough@apple.com>
  10437. Reviewed by Oliver Hunt.
  10438. Add support for integer addition, subtraction and multiplication
  10439. in JIT code on x86-64.
  10440. * assembler/MacroAssembler.h:
  10441. (JSC::MacroAssembler::mul32):
  10442. (JSC::MacroAssembler::sub32):
  10443. (JSC::MacroAssembler::joMul32):
  10444. (JSC::MacroAssembler::joSub32):
  10445. * jit/JIT.cpp:
  10446. (JSC::JIT::privateCompileMainPass):
  10447. (JSC::JIT::privateCompileSlowCases):
  10448. * jit/JIT.h:
  10449. * jit/JITArithmetic.cpp:
  10450. (JSC::JIT::compileFastArith_op_add):
  10451. (JSC::JIT::compileFastArithSlow_op_add):
  10452. (JSC::JIT::compileFastArith_op_mul):
  10453. (JSC::JIT::compileFastArithSlow_op_mul):
  10454. (JSC::JIT::compileFastArith_op_sub):
  10455. (JSC::JIT::compileFastArithSlow_op_sub):
  10456. 2009-01-15 Gavin Barraclough <barraclough@apple.com>
  10457. Reviewed by Geoff Garen.
  10458. On x86-64 allow JSImmediate to encode 64-bit double precision values.
  10459. This patch only affects builds that set USE(ALTERNATE_JSIMMEDIATE).
  10460. Updates the implementation of JSValuePtr:: and JSImmediate:: methods
  10461. that operate on neumeric values to be be aware of the new representation.
  10462. When this representation is in use, the class JSNumberCell is redundant
  10463. and is compiled out.
  10464. The format of the new immediate representation is documented in JSImmediate.h.
  10465. * JavaScriptCore.exp:
  10466. * assembler/MacroAssembler.h:
  10467. (JSC::MacroAssembler::subPtr):
  10468. * assembler/X86Assembler.h:
  10469. (JSC::X86Assembler::):
  10470. (JSC::X86Assembler::subq_rr):
  10471. (JSC::X86Assembler::movq_rr):
  10472. (JSC::X86Assembler::ucomisd_rr):
  10473. (JSC::X86Assembler::X86InstructionFormatter::twoByteOp64):
  10474. * interpreter/Interpreter.cpp:
  10475. (JSC::Interpreter::cti_op_stricteq):
  10476. (JSC::Interpreter::cti_op_nstricteq):
  10477. * jit/JIT.cpp:
  10478. (JSC::JIT::compileOpStrictEq):
  10479. (JSC::JIT::privateCompileMainPass):
  10480. (JSC::JIT::privateCompileSlowCases):
  10481. * jit/JIT.h:
  10482. * jit/JITArithmetic.cpp:
  10483. (JSC::JIT::compileFastArith_op_lshift):
  10484. (JSC::JIT::compileFastArith_op_rshift):
  10485. (JSC::JIT::compileFastArith_op_bitand):
  10486. (JSC::JIT::compileFastArith_op_mod):
  10487. (JSC::JIT::compileFastArith_op_add):
  10488. (JSC::JIT::compileFastArith_op_mul):
  10489. (JSC::JIT::compileFastArith_op_post_inc):
  10490. (JSC::JIT::compileFastArith_op_post_dec):
  10491. (JSC::JIT::compileFastArith_op_pre_inc):
  10492. (JSC::JIT::compileFastArith_op_pre_dec):
  10493. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  10494. (JSC::JIT::compileBinaryArithOp):
  10495. * jit/JITInlineMethods.h:
  10496. (JSC::JIT::emitJumpIfBothJSCells):
  10497. (JSC::JIT::emitJumpIfEitherNumber):
  10498. (JSC::JIT::emitJumpIfNotEitherNumber):
  10499. (JSC::JIT::emitJumpIfImmediateIntegerNumber):
  10500. (JSC::JIT::emitJumpIfNotImmediateIntegerNumber):
  10501. (JSC::JIT::emitJumpIfNotImmediateIntegerNumbers):
  10502. (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumber):
  10503. (JSC::JIT::emitJumpSlowCaseIfNotImmediateIntegerNumbers):
  10504. (JSC::JIT::emitFastArithDeTagImmediate):
  10505. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  10506. (JSC::JIT::emitFastArithReTagImmediate):
  10507. (JSC::JIT::emitFastArithIntToImmNoCheck):
  10508. * runtime/JSCell.h:
  10509. * runtime/JSGlobalData.cpp:
  10510. (JSC::JSGlobalData::JSGlobalData):
  10511. * runtime/JSImmediate.cpp:
  10512. (JSC::JSImmediate::toThisObject):
  10513. (JSC::JSImmediate::toObject):
  10514. (JSC::JSImmediate::toString):
  10515. * runtime/JSImmediate.h:
  10516. (JSC::wtf_reinterpret_cast):
  10517. (JSC::JSImmediate::isNumber):
  10518. (JSC::JSImmediate::isIntegerNumber):
  10519. (JSC::JSImmediate::isDoubleNumber):
  10520. (JSC::JSImmediate::isPositiveIntegerNumber):
  10521. (JSC::JSImmediate::areBothImmediateIntegerNumbers):
  10522. (JSC::JSImmediate::makeInt):
  10523. (JSC::JSImmediate::makeDouble):
  10524. (JSC::JSImmediate::doubleValue):
  10525. (JSC::doubleToBoolean):
  10526. (JSC::JSImmediate::toBoolean):
  10527. (JSC::JSImmediate::getTruncatedUInt32):
  10528. (JSC::JSImmediate::makeOutOfIntegerRange):
  10529. (JSC::JSImmediate::from):
  10530. (JSC::JSImmediate::getTruncatedInt32):
  10531. (JSC::JSImmediate::toDouble):
  10532. (JSC::JSImmediate::getUInt32):
  10533. (JSC::JSValuePtr::isInt32Fast):
  10534. (JSC::JSValuePtr::isUInt32Fast):
  10535. (JSC::JSValuePtr::areBothInt32Fast):
  10536. (JSC::JSFastMath::canDoFastBitwiseOperations):
  10537. (JSC::JSFastMath::xorImmediateNumbers):
  10538. (JSC::JSFastMath::canDoFastRshift):
  10539. (JSC::JSFastMath::canDoFastUrshift):
  10540. (JSC::JSFastMath::rightShiftImmediateNumbers):
  10541. (JSC::JSFastMath::canDoFastAdditiveOperations):
  10542. (JSC::JSFastMath::addImmediateNumbers):
  10543. (JSC::JSFastMath::subImmediateNumbers):
  10544. * runtime/JSNumberCell.cpp:
  10545. (JSC::jsNumberCell):
  10546. * runtime/JSNumberCell.h:
  10547. (JSC::createNumberStructure):
  10548. (JSC::isNumberCell):
  10549. (JSC::asNumberCell):
  10550. (JSC::jsNumber):
  10551. (JSC::JSValuePtr::isDoubleNumber):
  10552. (JSC::JSValuePtr::getDoubleNumber):
  10553. (JSC::JSValuePtr::isNumber):
  10554. (JSC::JSValuePtr::uncheckedGetNumber):
  10555. (JSC::jsNaN):
  10556. (JSC::JSValuePtr::getNumber):
  10557. (JSC::JSValuePtr::numberToInt32):
  10558. (JSC::JSValuePtr::numberToUInt32):
  10559. * runtime/JSValue.h:
  10560. * runtime/NumberConstructor.cpp:
  10561. (JSC::numberConstructorNegInfinity):
  10562. (JSC::numberConstructorPosInfinity):
  10563. (JSC::numberConstructorMaxValue):
  10564. (JSC::numberConstructorMinValue):
  10565. * runtime/NumberObject.cpp:
  10566. (JSC::constructNumber):
  10567. * runtime/NumberObject.h:
  10568. * runtime/Operations.h:
  10569. (JSC::JSValuePtr::equal):
  10570. (JSC::JSValuePtr::equalSlowCaseInline):
  10571. (JSC::JSValuePtr::strictEqual):
  10572. (JSC::JSValuePtr::strictEqualSlowCaseInline):
  10573. * wtf/Platform.h:
  10574. 2009-01-15 Sam Weinig <sam@webkit.org>
  10575. Reviewed by Geoffrey Garen.
  10576. <rdar://problem/6045018>
  10577. REGRESSION (r34838): JavaScript objects appear to be leaked after loading google.com
  10578. Subtract the number of JSStrings cached in SmallStrings when calculating the
  10579. number of live JSObjects.
  10580. * runtime/Collector.cpp:
  10581. (JSC::Heap::objectCount):
  10582. * runtime/SmallStrings.cpp:
  10583. (JSC::SmallStrings::count):
  10584. * runtime/SmallStrings.h:
  10585. 2009-01-15 Sam Weinig <sam@webkit.org>
  10586. Fix Qt build.
  10587. * runtime/Collector.cpp:
  10588. 2009-01-15 Sam Weinig <sam@webkit.org>
  10589. Reviewed by Gavin Barraclough.
  10590. Fix crash seen running fast/canvas.
  10591. Make sure to mark the ScopeNode and CodeBlock being created
  10592. in the re-parse for exception information.
  10593. * bytecode/CodeBlock.cpp:
  10594. (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
  10595. * parser/Nodes.h:
  10596. (JSC::ScopeNode::mark):
  10597. * runtime/Collector.cpp:
  10598. (JSC::Heap::collect):
  10599. * runtime/JSGlobalData.cpp:
  10600. (JSC::JSGlobalData::JSGlobalData):
  10601. * runtime/JSGlobalData.h:
  10602. 2009-01-15 Craig Schlenter <craig.schlenter@gmail.com>
  10603. Reviewed by Darin Adler.
  10604. https://bugs.webkit.org/show_bug.cgi?id=23347
  10605. Compilation of JavaScriptCore/wtf/ThreadingPthreads.cpp fails on Linux
  10606. * wtf/ThreadingPthreads.cpp: included limits.h as INT_MAX is defined there.
  10607. 2009-01-15 Oliver Hunt <oliver@apple.com>
  10608. Reviewed by Geoff Garen.
  10609. Bug 23225: REGRESSION: Assertion failure in reparseInPlace() (m_sourceElements) at sfgate.com
  10610. <https://bugs.webkit.org/show_bug.cgi?id=23225> <rdar://problem/6487432>
  10611. Character position for open and closing brace was incorrectly referencing m_position to
  10612. record their position in a source document, however this is unsafe as BOMs may lead to
  10613. m_position being an arbitrary position from the real position of the current character.
  10614. * parser/Lexer.cpp:
  10615. (JSC::Lexer::matchPunctuator):
  10616. 2009-01-14 David Kilzer <ddkilzer@apple.com>
  10617. Bug 23153: JSC build always touches JavaScriptCore/docs/bytecode.html
  10618. <https://bugs.webkit.org/show_bug.cgi?id=23153>
  10619. Reviewed by Darin Adler.
  10620. Instead of building bytecode.html into ${SRCROOT}/docs/bytecode.html, build it
  10621. into ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore/docs/bytecode.html.
  10622. Also fixes make-bytecode-docs.pl to actually generate documentation.
  10623. * DerivedSources.make: Changed bytecode.html to be built into local docs
  10624. directory in ${BUILT_PRODUCTS_DIR}/DerivedSources/JavaScriptCore.
  10625. * JavaScriptCore.xcodeproj/project.pbxproj: Added "/docs" to the end of the
  10626. "mkdir -p" command so that the docs subdirectory is automatically created.
  10627. * docs/make-bytecode-docs.pl: Changed BEGIN_OPCODE to DEFINE_OPCODE so that
  10628. documentation is actually generated.
  10629. 2009-01-14 Adam Treat <adam.treat@torchmobile.com>
  10630. Build fix for Qt from Dmitry Titov.
  10631. * wtf/ThreadingQt.cpp:
  10632. (WTF::ThreadCondition::timedWait):
  10633. 2009-01-14 Oliver Hunt <oliver@apple.com>
  10634. Reviewed by Cameron Zwarich.
  10635. Bug 22903: REGRESSION (r36267): visiting this site reliably crashes WebKit nightly
  10636. EvalCodeBlock's do not reference the functions that are declared inside the eval
  10637. code, this means that simply marking the EvalCodeBlock through the global object
  10638. is insufficient to mark the declared functions. This patch corrects this by
  10639. explicitly marking the CodeBlocks of all the functions declared in the cached
  10640. EvalNode.
  10641. * bytecode/CodeBlock.cpp:
  10642. (JSC::CodeBlock::mark):
  10643. * bytecode/CodeBlock.h:
  10644. (JSC::CodeBlock::hasFunctions):
  10645. * bytecode/EvalCodeCache.h:
  10646. (JSC::EvalCodeCache::mark):
  10647. * parser/Nodes.cpp:
  10648. (JSC::ScopeNodeData::mark):
  10649. (JSC::EvalNode::mark):
  10650. * parser/Nodes.h:
  10651. 2009-01-14 Dmitry Titov <dimich@chromium.org>
  10652. Reviewed by Alexey Proskuryakov.
  10653. https://bugs.webkit.org/show_bug.cgi?id=23312
  10654. Implement MessageQueue::waitForMessageTimed()
  10655. Also fixed ThreadCondition::timedWait() to take absolute time, as discussed on webkit-dev.
  10656. Win32 version of timedWait still has to be implemented.
  10657. * wtf/MessageQueue.h:
  10658. (WTF::MessageQueueWaitResult: new enum for the result of MessageQueue::waitForMessageTimed.
  10659. (WTF::MessageQueue::waitForMessage):
  10660. (WTF::MessageQueue::waitForMessageTimed): New method.
  10661. * wtf/Threading.h:
  10662. * wtf/ThreadingGtk.cpp:
  10663. (WTF::ThreadCondition::timedWait): changed to use absolute time instead of interval.
  10664. * wtf/ThreadingNone.cpp:
  10665. (WTF::ThreadCondition::timedWait): ditto.
  10666. * wtf/ThreadingPthreads.cpp:
  10667. (WTF::ThreadCondition::timedWait): ditto.
  10668. * wtf/ThreadingQt.cpp:
  10669. (WTF::ThreadCondition::timedWait): ditto.
  10670. * wtf/ThreadingWin.cpp:
  10671. (WTF::ThreadCondition::timedWait): ditto. The actual Win32 code is still to be implemented.
  10672. 2009-01-14 Dean McNamee <deanm@chromium.org>
  10673. Reviewed by Darin Adler and Oliver hunt.
  10674. Correctly match allocation functions by implementing a custom deref().
  10675. https://bugs.webkit.org/show_bug.cgi?id=23315
  10676. * runtime/ByteArray.h:
  10677. (JSC::ByteArray::deref):
  10678. (JSC::ByteArray::ByteArray):
  10679. 2009-01-14 Dan Bernstein <mitz@apple.com>
  10680. Reviewed by John Sullivan.
  10681. - update copyright
  10682. * Info.plist:
  10683. 2009-01-13 Beth Dakin <bdakin@apple.com>
  10684. Reviewed by Darin Adler and Oliver Hunt.
  10685. <rdar://problem/6489314> REGRESSION: Business widget's front side
  10686. fails to render correctly when flipping widget
  10687. The problem here is that parseInt was parsing NaN as 0. This patch
  10688. corrects that by parsing NaN as NaN. This matches our old behavior
  10689. and Firefox.
  10690. * runtime/JSGlobalObjectFunctions.cpp:
  10691. (JSC::globalFuncParseInt):
  10692. 2009-01-13 Gavin Barraclough <barraclough@apple.com>
  10693. Reviewed by Oliver Hunt.
  10694. Fix for: https://bugs.webkit.org/show_bug.cgi?id=23292
  10695. Implementation of two argument canDoFastAdditiveOperations does not correlate well with reality.
  10696. * runtime/JSImmediate.h:
  10697. (JSC::JSFastMath::canDoFastAdditiveOperations):
  10698. 2009-01-13 Zalan Bujtas <zbujtas@gmail.com>
  10699. Reviewed by Darin Adler.
  10700. https://bugs.webkit.org/show_bug.cgi?id=23290
  10701. Fix JSImmediate::isImmediate(src) to !src->isCell()
  10702. * interpreter/Interpreter.cpp:
  10703. (JSC::Interpreter::privateExecute):
  10704. 2009-01-13 Dmitry Titov <dimich@chromium.org>
  10705. Reviewed by Darin Adler.
  10706. https://bugs.webkit.org/show_bug.cgi?id=23281
  10707. Fix the Chromium Win build.
  10708. Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN).
  10709. Moved GTK and WX up in #if sequence because they could come with WIN_OS too,
  10710. while they have their own implementation even on Windows.
  10711. * wtf/CurrentTime.cpp:
  10712. (WTF::currentTime):
  10713. 2009-01-12 Gavin Barraclough <barraclough@apple.com>
  10714. Reviewed by Oliver Hunt.
  10715. Make the JSImmediate interface private.
  10716. All manipulation of JS values should be through the JSValuePtr class, not by using JSImmediate
  10717. directly. The key missing methods on JSValuePtr are:
  10718. * isCell() - check for values that are JSCell*s, and as such where asCell() may be used.
  10719. * isInt32Fast() getInt32Fast() - fast check/access for integer immediates.
  10720. * isUInt32Fast() getUInt32Fast() - ditto for unsigned integer immediates.
  10721. The JIT is allowed full access to JSImmediate, since it needs to be able to directly
  10722. manipulate JSValuePtrs. The Interpreter is provided access to perform operations directly
  10723. on JSValuePtrs through the new JSFastMath interface.
  10724. No performance impact.
  10725. * API/JSCallbackObjectFunctions.h:
  10726. (JSC::::toNumber):
  10727. * API/JSValueRef.cpp:
  10728. (JSValueIsEqual):
  10729. (JSValueIsStrictEqual):
  10730. * JavaScriptCore.exp:
  10731. * bytecode/CodeBlock.h:
  10732. (JSC::CodeBlock::isKnownNotImmediate):
  10733. * bytecompiler/BytecodeGenerator.cpp:
  10734. (JSC::keyForImmediateSwitch):
  10735. * bytecompiler/BytecodeGenerator.h:
  10736. (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
  10737. (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  10738. * interpreter/Interpreter.cpp:
  10739. (JSC::jsLess):
  10740. (JSC::jsLessEq):
  10741. (JSC::jsAdd):
  10742. (JSC::jsIsObjectType):
  10743. (JSC::cachePrototypeChain):
  10744. (JSC::Interpreter::tryCachePutByID):
  10745. (JSC::Interpreter::tryCacheGetByID):
  10746. (JSC::Interpreter::privateExecute):
  10747. (JSC::Interpreter::tryCTICachePutByID):
  10748. (JSC::Interpreter::tryCTICacheGetByID):
  10749. (JSC::Interpreter::cti_op_add):
  10750. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  10751. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  10752. (JSC::Interpreter::cti_op_instanceof):
  10753. (JSC::Interpreter::cti_op_mul):
  10754. (JSC::Interpreter::cti_op_get_by_val):
  10755. (JSC::Interpreter::cti_op_get_by_val_byte_array):
  10756. (JSC::Interpreter::cti_op_sub):
  10757. (JSC::Interpreter::cti_op_put_by_val):
  10758. (JSC::Interpreter::cti_op_put_by_val_array):
  10759. (JSC::Interpreter::cti_op_put_by_val_byte_array):
  10760. (JSC::Interpreter::cti_op_negate):
  10761. (JSC::Interpreter::cti_op_div):
  10762. (JSC::Interpreter::cti_op_eq):
  10763. (JSC::Interpreter::cti_op_lshift):
  10764. (JSC::Interpreter::cti_op_bitand):
  10765. (JSC::Interpreter::cti_op_rshift):
  10766. (JSC::Interpreter::cti_op_bitnot):
  10767. (JSC::Interpreter::cti_op_neq):
  10768. (JSC::Interpreter::cti_op_urshift):
  10769. (JSC::Interpreter::cti_op_call_eval):
  10770. (JSC::Interpreter::cti_op_throw):
  10771. (JSC::Interpreter::cti_op_is_undefined):
  10772. (JSC::Interpreter::cti_op_stricteq):
  10773. (JSC::Interpreter::cti_op_nstricteq):
  10774. (JSC::Interpreter::cti_op_switch_imm):
  10775. (JSC::Interpreter::cti_vm_throw):
  10776. * interpreter/Interpreter.h:
  10777. (JSC::Interpreter::isJSArray):
  10778. (JSC::Interpreter::isJSString):
  10779. (JSC::Interpreter::isJSByteArray):
  10780. * jit/JIT.cpp:
  10781. (JSC::JIT::compileOpStrictEq):
  10782. (JSC::JIT::privateCompileMainPass):
  10783. * jit/JIT.h:
  10784. (JSC::JIT::isStrictEqCaseHandledInJITCode):
  10785. * jit/JITArithmetic.cpp:
  10786. (JSC::JIT::compileFastArith_op_rshift):
  10787. (JSC::JIT::compileFastArith_op_bitand):
  10788. (JSC::JIT::compileFastArith_op_mod):
  10789. * jit/JITCall.cpp:
  10790. (JSC::JIT::unlinkCall):
  10791. (JSC::JIT::compileOpCall):
  10792. * jit/JITInlineMethods.h:
  10793. (JSC::JIT::getConstantOperandImmediateInt):
  10794. (JSC::JIT::isOperandConstantImmediateInt):
  10795. * parser/Nodes.cpp:
  10796. (JSC::processClauseList):
  10797. * runtime/ArrayPrototype.cpp:
  10798. (JSC::arrayProtoFuncIndexOf):
  10799. (JSC::arrayProtoFuncLastIndexOf):
  10800. * runtime/BooleanPrototype.cpp:
  10801. (JSC::booleanProtoFuncValueOf):
  10802. * runtime/Collector.cpp:
  10803. (JSC::Heap::protect):
  10804. (JSC::Heap::unprotect):
  10805. (JSC::Heap::heap):
  10806. * runtime/JSByteArray.cpp:
  10807. (JSC::JSByteArray::getOwnPropertySlot):
  10808. * runtime/JSByteArray.h:
  10809. (JSC::JSByteArray::getIndex):
  10810. * runtime/JSCell.cpp:
  10811. * runtime/JSCell.h:
  10812. (JSC::JSValuePtr::isNumberCell):
  10813. (JSC::JSValuePtr::asCell):
  10814. (JSC::JSValuePtr::isNumber):
  10815. * runtime/JSGlobalObjectFunctions.cpp:
  10816. (JSC::globalFuncParseInt):
  10817. * runtime/JSImmediate.h:
  10818. (JSC::js0):
  10819. (JSC::jsImpossibleValue):
  10820. (JSC::JSValuePtr::toInt32):
  10821. (JSC::JSValuePtr::toUInt32):
  10822. (JSC::JSValuePtr::isCell):
  10823. (JSC::JSValuePtr::isInt32Fast):
  10824. (JSC::JSValuePtr::getInt32Fast):
  10825. (JSC::JSValuePtr::isUInt32Fast):
  10826. (JSC::JSValuePtr::getUInt32Fast):
  10827. (JSC::JSValuePtr::makeInt32Fast):
  10828. (JSC::JSValuePtr::areBothInt32Fast):
  10829. (JSC::JSFastMath::canDoFastBitwiseOperations):
  10830. (JSC::JSFastMath::equal):
  10831. (JSC::JSFastMath::notEqual):
  10832. (JSC::JSFastMath::andImmediateNumbers):
  10833. (JSC::JSFastMath::xorImmediateNumbers):
  10834. (JSC::JSFastMath::orImmediateNumbers):
  10835. (JSC::JSFastMath::canDoFastRshift):
  10836. (JSC::JSFastMath::canDoFastUrshift):
  10837. (JSC::JSFastMath::rightShiftImmediateNumbers):
  10838. (JSC::JSFastMath::canDoFastAdditiveOperations):
  10839. (JSC::JSFastMath::addImmediateNumbers):
  10840. (JSC::JSFastMath::subImmediateNumbers):
  10841. (JSC::JSFastMath::incImmediateNumber):
  10842. (JSC::JSFastMath::decImmediateNumber):
  10843. * runtime/JSNumberCell.h:
  10844. (JSC::JSValuePtr::asNumberCell):
  10845. (JSC::jsNumber):
  10846. (JSC::JSValuePtr::uncheckedGetNumber):
  10847. (JSC::JSNumberCell::toInt32):
  10848. (JSC::JSNumberCell::toUInt32):
  10849. (JSC::JSValuePtr::toJSNumber):
  10850. (JSC::JSValuePtr::getNumber):
  10851. (JSC::JSValuePtr::numberToInt32):
  10852. (JSC::JSValuePtr::numberToUInt32):
  10853. * runtime/JSObject.h:
  10854. (JSC::JSValuePtr::isObject):
  10855. (JSC::JSValuePtr::get):
  10856. (JSC::JSValuePtr::put):
  10857. * runtime/JSValue.cpp:
  10858. (JSC::JSValuePtr::toInteger):
  10859. (JSC::JSValuePtr::toIntegerPreserveNaN):
  10860. * runtime/JSValue.h:
  10861. * runtime/Operations.cpp:
  10862. (JSC::JSValuePtr::equalSlowCase):
  10863. (JSC::JSValuePtr::strictEqualSlowCase):
  10864. * runtime/Operations.h:
  10865. (JSC::JSValuePtr::equal):
  10866. (JSC::JSValuePtr::equalSlowCaseInline):
  10867. (JSC::JSValuePtr::strictEqual):
  10868. (JSC::JSValuePtr::strictEqualSlowCaseInline):
  10869. * runtime/Protect.h:
  10870. (JSC::gcProtect):
  10871. (JSC::gcUnprotect):
  10872. * runtime/StringPrototype.cpp:
  10873. (JSC::stringProtoFuncCharAt):
  10874. (JSC::stringProtoFuncCharCodeAt):
  10875. * runtime/Structure.cpp:
  10876. (JSC::Structure::createCachedPrototypeChain):
  10877. 2009-01-12 Kevin Ollivier <kevino@theolliviers.com>
  10878. Since date time functions have moved here, now the wx port JSC
  10879. needs to depend on wx.
  10880. * jscore.bkl:
  10881. 2009-01-11 David Levin <levin@chromium.org>
  10882. Reviewed by Darin Adler.
  10883. https://bugs.webkit.org/show_bug.cgi?id=23245
  10884. Add initializeThreading to key places in JS API to ensure that
  10885. UString is properly initialized.
  10886. * API/JSContextRef.cpp:
  10887. (JSContextGroupCreate):
  10888. (JSGlobalContextCreate):
  10889. * API/JSObjectRef.cpp:
  10890. (JSClassCreate):
  10891. * API/JSStringRef.cpp:
  10892. (JSStringCreateWithCharacters):
  10893. (JSStringCreateWithUTF8CString):
  10894. * API/JSStringRefCF.cpp:
  10895. (JSStringCreateWithCFString):
  10896. 2009-01-11 David Levin <levin@chromium.org>
  10897. Reviewed by Darin Adler.
  10898. https://bugs.webkit.org/show_bug.cgi?id=23175
  10899. Separate out BaseString information from UString::Rep and make all baseString access go through
  10900. a member function, so that it may be used for something else (in the future) in the BaseString
  10901. case.
  10902. * runtime/SmallStrings.cpp:
  10903. (JSC::SmallStringsStorage::rep):
  10904. (JSC::SmallStringsStorage::SmallStringsStorage):
  10905. (JSC::SmallStrings::SmallStrings):
  10906. (JSC::SmallStrings::mark):
  10907. Adjust to account for the changes in UString and put the UString in place in
  10908. SmallStringsStorage to aid in locality of reference among the UChar[] and UString::Rep's.
  10909. * runtime/SmallStrings.h:
  10910. * runtime/UString.cpp:
  10911. (JSC::initializeStaticBaseString):
  10912. (JSC::initializeUString):
  10913. (JSC::UString::Rep::create):
  10914. (JSC::UString::Rep::destroy):
  10915. (JSC::UString::Rep::checkConsistency):
  10916. (JSC::expandCapacity):
  10917. (JSC::UString::expandPreCapacity):
  10918. (JSC::concatenate):
  10919. (JSC::UString::append):
  10920. (JSC::UString::operator=):
  10921. * runtime/UString.h:
  10922. (JSC::UString::Rep::baseIsSelf):
  10923. (JSC::UString::Rep::setBaseString):
  10924. (JSC::UString::Rep::baseString):
  10925. (JSC::UString::Rep::):
  10926. (JSC::UString::Rep::null):
  10927. (JSC::UString::Rep::empty):
  10928. (JSC::UString::Rep::data):
  10929. (JSC::UString::cost):
  10930. Separate out the items out used by base strings from those used in Rep's that only
  10931. point to base strings. (This potentially saves 24 bytes per Rep.)
  10932. 2009-01-11 Darin Adler <darin@apple.com>
  10933. Reviewed by Dan Bernstein.
  10934. Bug 23239: improve handling of unused arguments in JavaScriptCore
  10935. https://bugs.webkit.org/show_bug.cgi?id=23239
  10936. * runtime/DatePrototype.cpp: Moved LocaleDateTimeFormat enum outside #if
  10937. so we can use this on all platforms. Changed valueOf to share the same
  10938. function with getTime, since the contents of the two are identical. Removed
  10939. a FIXME since the idea isn't really specific enough or helpful enough to
  10940. need to sit here in the source code.
  10941. (JSC::formatLocaleDate): Changed the Mac version of this function to take
  10942. the same arguments as the non-Mac version so the caller doesn't have to
  10943. special-case the two platforms. Also made the formatString array be const;
  10944. before the characters were, but the array was a modifiable global variable.
  10945. (JSC::dateProtoFuncToLocaleString): Changed to call the new unified
  10946. version of formatLocaleDate and remove the ifdef.
  10947. (JSC::dateProtoFuncToLocaleDateString): Ditto.
  10948. (JSC::dateProtoFuncToLocaleTimeString): Ditto.
  10949. * runtime/JSNotAnObject.cpp:
  10950. (JSC::JSNotAnObject::toObject): Use the new ASSERT_UNUSED instead of the
  10951. old UNUSED_PARAM.
  10952. * runtime/RegExp.cpp:
  10953. (JSC::RegExp::RegExp): Changed to only use UNUSED_PARAM when the parameter
  10954. is actually unused.
  10955. * wtf/TCSystemAlloc.cpp:
  10956. (TCMalloc_SystemRelease): Changed to only use UNUSED_PARAM when the parameter
  10957. is actually unused.
  10958. (TCMalloc_SystemCommit): Changed to omit the argument names instead of using
  10959. UNUSED_PARAM.
  10960. 2009-01-11 Oliver Hunt <oliver@apple.com>
  10961. Reviewed by NOBODY (Build fix).
  10962. Fix the build (whoops)
  10963. * interpreter/Interpreter.cpp:
  10964. (JSC::Interpreter::cti_op_get_by_val):
  10965. 2009-01-11 Oliver Hunt <oliver@apple.com>
  10966. Reviewed by Darin Adler and Anders Carlsson
  10967. Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
  10968. Restructure the code slightly, and add comments per Darin's suggestions
  10969. * interpreter/Interpreter.cpp:
  10970. (JSC::Interpreter::cti_op_get_by_val):
  10971. (JSC::Interpreter::cti_op_get_by_val_byte_array):
  10972. (JSC::Interpreter::cti_op_put_by_val):
  10973. (JSC::Interpreter::cti_op_put_by_val_byte_array):
  10974. 2009-01-11 Oliver Hunt <oliver@apple.com>
  10975. Reviewed by Anders Carlsson.
  10976. Whoops, I accidentally removed an exception check from fast the
  10977. fast path for string indexing when i originally landed the
  10978. byte array logic.
  10979. * interpreter/Interpreter.cpp:
  10980. (JSC::Interpreter::cti_op_get_by_val):
  10981. 2009-01-11 Oliver Hunt <oliver@apple.com>
  10982. Reviewed by Anders Carlsson.
  10983. Bug 23128: get/put_by_val need to respecialise in the face of ByteArray
  10984. <https://bugs.webkit.org/show_bug.cgi?id=23128>
  10985. Fairly simple patch, add specialised versions of cti_op_get/put_by_val
  10986. that assume ByteArray, thus avoiding a few branches in the case of bytearray
  10987. manipulation.
  10988. No effect on SunSpider. 15% win on the original testcase.
  10989. * interpreter/Interpreter.cpp:
  10990. (JSC::Interpreter::cti_op_get_by_val):
  10991. (JSC::Interpreter::cti_op_get_by_val_byte_array):
  10992. (JSC::Interpreter::cti_op_put_by_val):
  10993. (JSC::Interpreter::cti_op_put_by_val_byte_array):
  10994. * interpreter/Interpreter.h:
  10995. 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
  10996. Try to fix Windows build.
  10997. * wtf/CurrentTime.cpp: Added a definition of msPerSecond (previously, this code was in
  10998. DateMath.cpp, with constant definition in DateTime.h)
  10999. 2009-01-11 Alexey Proskuryakov <ap@webkit.org>
  11000. Try to fix Windows build.
  11001. * wtf/CurrentTime.cpp: Include <sys/types.h> and <sys/timeb.h>, as MSDN says to.
  11002. 2009-01-11 Dmitry Titov <dimich@chromium.org>
  11003. Reviewed by Darin Adler.
  11004. https://bugs.webkit.org/show_bug.cgi?id=23207
  11005. Moved currentTime() to from WebCore to WTF.
  11006. * GNUmakefile.am:
  11007. * JavaScriptCore.exp: added export for WTF::currentTime()
  11008. * JavaScriptCore.pri:
  11009. * JavaScriptCore.scons:
  11010. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  11011. * JavaScriptCore.xcodeproj/project.pbxproj:
  11012. * JavaScriptCoreSources.bkl:
  11013. * runtime/DateMath.cpp:
  11014. (JSC::getCurrentUTCTimeWithMicroseconds): This function had another implementation of currentTime(), essentially. Now uses WTF version.
  11015. * wtf/CurrentTime.cpp: Added.
  11016. (WTF::currentTime):
  11017. (WTF::highResUpTime):
  11018. (WTF::lowResUTCTime):
  11019. (WTF::qpcAvailable):
  11020. * wtf/CurrentTime.h: Added.
  11021. 2009-01-09 Gavin Barraclough <barraclough@apple.com>
  11022. Reviewed by Oliver Hunt.
  11023. Stage two of converting JSValue from a pointer to a class type.
  11024. Remove the class JSValue. The functionallity has been transitioned
  11025. into the wrapper class type JSValuePtr.
  11026. The last stage will be to rename JSValuePtr to JSValue, remove the
  11027. overloaded -> operator, and switch operations on JSValuePtrs from
  11028. using '->' to use '.' instead.
  11029. * API/APICast.h:
  11030. * JavaScriptCore.exp:
  11031. * runtime/JSCell.h:
  11032. (JSC::asCell):
  11033. (JSC::JSValuePtr::asCell):
  11034. (JSC::JSValuePtr::isNumber):
  11035. (JSC::JSValuePtr::isString):
  11036. (JSC::JSValuePtr::isGetterSetter):
  11037. (JSC::JSValuePtr::isObject):
  11038. (JSC::JSValuePtr::getNumber):
  11039. (JSC::JSValuePtr::getString):
  11040. (JSC::JSValuePtr::getObject):
  11041. (JSC::JSValuePtr::getCallData):
  11042. (JSC::JSValuePtr::getConstructData):
  11043. (JSC::JSValuePtr::getUInt32):
  11044. (JSC::JSValuePtr::getTruncatedInt32):
  11045. (JSC::JSValuePtr::getTruncatedUInt32):
  11046. (JSC::JSValuePtr::mark):
  11047. (JSC::JSValuePtr::marked):
  11048. (JSC::JSValuePtr::toPrimitive):
  11049. (JSC::JSValuePtr::getPrimitiveNumber):
  11050. (JSC::JSValuePtr::toBoolean):
  11051. (JSC::JSValuePtr::toNumber):
  11052. (JSC::JSValuePtr::toString):
  11053. (JSC::JSValuePtr::toObject):
  11054. (JSC::JSValuePtr::toThisObject):
  11055. (JSC::JSValuePtr::needsThisConversion):
  11056. (JSC::JSValuePtr::toThisString):
  11057. (JSC::JSValuePtr::getJSNumber):
  11058. * runtime/JSImmediate.h:
  11059. (JSC::JSValuePtr::isUndefined):
  11060. (JSC::JSValuePtr::isNull):
  11061. (JSC::JSValuePtr::isUndefinedOrNull):
  11062. (JSC::JSValuePtr::isBoolean):
  11063. (JSC::JSValuePtr::getBoolean):
  11064. (JSC::JSValuePtr::toInt32):
  11065. (JSC::JSValuePtr::toUInt32):
  11066. * runtime/JSNumberCell.h:
  11067. (JSC::JSValuePtr::uncheckedGetNumber):
  11068. (JSC::JSValuePtr::toJSNumber):
  11069. * runtime/JSObject.h:
  11070. (JSC::JSValuePtr::isObject):
  11071. (JSC::JSValuePtr::get):
  11072. (JSC::JSValuePtr::put):
  11073. * runtime/JSString.h:
  11074. (JSC::JSValuePtr::toThisJSString):
  11075. * runtime/JSValue.cpp:
  11076. (JSC::JSValuePtr::toInteger):
  11077. (JSC::JSValuePtr::toIntegerPreserveNaN):
  11078. (JSC::JSValuePtr::toInt32SlowCase):
  11079. (JSC::JSValuePtr::toUInt32SlowCase):
  11080. * runtime/JSValue.h:
  11081. (JSC::JSValuePtr::makeImmediate):
  11082. (JSC::JSValuePtr::immediateValue):
  11083. (JSC::JSValuePtr::JSValuePtr):
  11084. (JSC::JSValuePtr::operator->):
  11085. (JSC::JSValuePtr::operator bool):
  11086. (JSC::JSValuePtr::operator==):
  11087. (JSC::JSValuePtr::operator!=):
  11088. (JSC::JSValuePtr::encode):
  11089. (JSC::JSValuePtr::decode):
  11090. (JSC::JSValuePtr::toFloat):
  11091. (JSC::JSValuePtr::asValue):
  11092. (JSC::operator==):
  11093. (JSC::operator!=):
  11094. 2009-01-09 David Levin <levin@chromium.org>
  11095. Reviewed by Oliver Hunt.
  11096. https://bugs.webkit.org/show_bug.cgi?id=23175
  11097. Adjustment to previous patch. Remove call to initilizeThreading from JSGlobalCreate
  11098. and fix jsc.cpp instead.
  11099. * jsc.cpp:
  11100. (main):
  11101. (jscmain):
  11102. * runtime/JSGlobalData.cpp:
  11103. (JSC::JSGlobalData::create):
  11104. 2009-01-09 Sam Weinig <sam@webkit.org>
  11105. Roll r39720 back in with a working interpreted mode.
  11106. 2009-01-09 David Levin <levin@chromium.org>
  11107. Reviewed by Oliver Hunt.
  11108. https://bugs.webkit.org/show_bug.cgi?id=23175
  11109. Added a template to make the pointer and flags combination
  11110. in UString more readable and less error prone.
  11111. * GNUmakefile.am:
  11112. * JavaScriptCore.exp:
  11113. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  11114. * JavaScriptCore.xcodeproj/project.pbxproj:
  11115. Added PtrAndFlags.h (and sorted the xcode project file).
  11116. * runtime/Identifier.cpp:
  11117. (JSC::Identifier::add):
  11118. (JSC::Identifier::addSlowCase):
  11119. * runtime/InitializeThreading.cpp:
  11120. (JSC::initializeThreadingOnce):
  11121. Made the init threading initialize the UString globals. Before
  11122. these were initilized using {} but that became harder due to the
  11123. addition of this tempalte class.
  11124. * runtime/JSGlobalData.cpp:
  11125. (JSC::JSGlobalData::create):
  11126. * runtime/PropertyNameArray.cpp:
  11127. (JSC::PropertyNameArray::add):
  11128. * runtime/UString.cpp:
  11129. (JSC::initializeStaticBaseString):
  11130. (JSC::initializeUString):
  11131. (JSC::UString::Rep::create):
  11132. (JSC::UString::Rep::createFromUTF8):
  11133. (JSC::createRep):
  11134. (JSC::UString::UString):
  11135. (JSC::concatenate):
  11136. (JSC::UString::operator=):
  11137. (JSC::UString::makeNull):
  11138. (JSC::UString::nullRep):
  11139. * runtime/UString.h:
  11140. (JSC::UString::Rep::identifierTable):
  11141. (JSC::UString::Rep::setIdentifierTable):
  11142. (JSC::UString::Rep::isStatic):
  11143. (JSC::UString::Rep::setStatic):
  11144. (JSC::UString::Rep::):
  11145. (JSC::UString::Rep::null):
  11146. (JSC::UString::Rep::empty):
  11147. (JSC::UString::isNull):
  11148. (JSC::UString::null):
  11149. (JSC::UString::UString):
  11150. * wtf/PtrAndFlags.h: Added.
  11151. (WTF::PtrAndFlags::PtrAndFlags):
  11152. (WTF::PtrAndFlags::isFlagSet):
  11153. (WTF::PtrAndFlags::setFlag):
  11154. (WTF::PtrAndFlags::clearFlag):
  11155. (WTF::PtrAndFlags::get):
  11156. (WTF::PtrAndFlags::set):
  11157. A simple way to layer together a pointer and 2 flags. It relies on the pointer being 4 byte aligned,
  11158. which should happen for all allocators (due to aligning pointers, int's, etc. on 4 byte boundaries).
  11159. 2009-01-08 Gavin Barraclough <barraclough@apple.com>
  11160. Reviewed by -O-l-i-v-e-r- -H-u-n-t- Sam Weinig (sorry, Sam!).
  11161. Encode immediates in the low word of JSValuePtrs, on x86-64.
  11162. On 32-bit platforms a JSValuePtr may represent a 31-bit signed integer.
  11163. On 64-bit platforms, if USE(ALTERNATE_JSIMMEDIATE) is defined, a full
  11164. 32-bit integer may be stored in an immediate.
  11165. Presently USE(ALTERNATE_JSIMMEDIATE) uses the same encoding as the default
  11166. immediate format - the value is left shifted by one, so a one bit tag can
  11167. be added to indicate the value is an immediate. However this means that
  11168. values must be commonly be detagged (by right shifting by one) before
  11169. arithmetic operations can be performed on immediates. This patch modifies
  11170. the formattting so the the high bits of the immediate mark values as being
  11171. integer.
  11172. * assembler/MacroAssembler.h:
  11173. (JSC::MacroAssembler::not32):
  11174. (JSC::MacroAssembler::orPtr):
  11175. (JSC::MacroAssembler::zeroExtend32ToPtr):
  11176. (JSC::MacroAssembler::jaePtr):
  11177. (JSC::MacroAssembler::jbPtr):
  11178. (JSC::MacroAssembler::jnzPtr):
  11179. (JSC::MacroAssembler::jzPtr):
  11180. * assembler/X86Assembler.h:
  11181. (JSC::X86Assembler::):
  11182. (JSC::X86Assembler::notl_r):
  11183. (JSC::X86Assembler::testq_i32r):
  11184. * jit/JIT.cpp:
  11185. (JSC::JIT::privateCompileMainPass):
  11186. (JSC::JIT::privateCompileSlowCases):
  11187. (JSC::JIT::privateCompileCTIMachineTrampolines):
  11188. * jit/JIT.h:
  11189. * jit/JITArithmetic.cpp:
  11190. (JSC::JIT::compileFastArith_op_lshift):
  11191. (JSC::JIT::compileFastArith_op_rshift):
  11192. (JSC::JIT::compileFastArith_op_bitand):
  11193. (JSC::JIT::compileFastArithSlow_op_bitand):
  11194. (JSC::JIT::compileFastArith_op_mod):
  11195. (JSC::JIT::compileFastArithSlow_op_mod):
  11196. (JSC::JIT::compileFastArith_op_add):
  11197. (JSC::JIT::compileFastArith_op_mul):
  11198. (JSC::JIT::compileFastArith_op_post_inc):
  11199. (JSC::JIT::compileFastArith_op_post_dec):
  11200. (JSC::JIT::compileFastArith_op_pre_inc):
  11201. (JSC::JIT::compileFastArith_op_pre_dec):
  11202. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  11203. (JSC::JIT::compileBinaryArithOp):
  11204. * jit/JITCall.cpp:
  11205. (JSC::JIT::compileOpCallSlowCase):
  11206. * jit/JITInlineMethods.h:
  11207. (JSC::JIT::emitJumpIfJSCell):
  11208. (JSC::JIT::emitJumpIfNotJSCell):
  11209. (JSC::JIT::emitJumpIfImmNum):
  11210. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  11211. (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
  11212. (JSC::JIT::emitFastArithDeTagImmediate):
  11213. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  11214. (JSC::JIT::emitFastArithReTagImmediate):
  11215. (JSC::JIT::emitFastArithImmToInt):
  11216. (JSC::JIT::emitFastArithIntToImmNoCheck):
  11217. (JSC::JIT::emitTagAsBoolImmediate):
  11218. * jit/JITPropertyAccess.cpp:
  11219. (JSC::resizePropertyStorage):
  11220. (JSC::JIT::privateCompilePutByIdTransition):
  11221. (JSC::JIT::privateCompilePatchGetArrayLength):
  11222. (JSC::JIT::privateCompileGetByIdSelf):
  11223. (JSC::JIT::privateCompileGetByIdProto):
  11224. (JSC::JIT::privateCompileGetByIdChain):
  11225. (JSC::JIT::privateCompilePutByIdReplace):
  11226. * runtime/JSImmediate.h:
  11227. (JSC::JSImmediate::isNumber):
  11228. (JSC::JSImmediate::isPositiveNumber):
  11229. (JSC::JSImmediate::areBothImmediateNumbers):
  11230. (JSC::JSImmediate::xorImmediateNumbers):
  11231. (JSC::JSImmediate::rightShiftImmediateNumbers):
  11232. (JSC::JSImmediate::canDoFastAdditiveOperations):
  11233. (JSC::JSImmediate::addImmediateNumbers):
  11234. (JSC::JSImmediate::subImmediateNumbers):
  11235. (JSC::JSImmediate::makeInt):
  11236. (JSC::JSImmediate::toBoolean):
  11237. * wtf/Platform.h:
  11238. 2009-01-08 Sam Weinig <sam@webkit.org>
  11239. Revert r39720. It broke Interpreted mode.
  11240. 2009-01-08 Sam Weinig <sam@webkit.org>
  11241. Reviewed by Oliver Hunt.
  11242. Fix for https://bugs.webkit.org/show_bug.cgi?id=23197
  11243. Delay creating the PCVector until an exception is thrown
  11244. Part of <rdar://problem/6469060>
  11245. Don't store exception information for a CodeBlock until first exception is thrown
  11246. - Change the process for re-parsing/re-generating bytecode for exception information
  11247. to use data from the original CodeBlock (offsets of GlobalResolve instructions) to
  11248. aid in creating an identical instruction stream on re-parse, instead of padding
  11249. interchangeable opcodes, which would result in different JITed code.
  11250. - Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from
  11251. within some odd modified scope chains.
  11252. - Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the
  11253. the pcVector from it.
  11254. Saves ~2MB on Membuster head.
  11255. * bytecode/CodeBlock.cpp:
  11256. (JSC::CodeBlock::dump):
  11257. (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
  11258. (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset):
  11259. (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
  11260. * bytecode/CodeBlock.h:
  11261. (JSC::JITCodeRef::JITCodeRef):
  11262. (JSC::GlobalResolveInfo::GlobalResolveInfo):
  11263. (JSC::CodeBlock::getBytecodeIndex):
  11264. (JSC::CodeBlock::addGlobalResolveInstruction):
  11265. (JSC::CodeBlock::addGlobalResolveInfo):
  11266. (JSC::CodeBlock::addFunctionRegisterInfo):
  11267. (JSC::CodeBlock::hasExceptionInfo):
  11268. (JSC::CodeBlock::pcVector):
  11269. (JSC::EvalCodeBlock::EvalCodeBlock):
  11270. (JSC::EvalCodeBlock::baseScopeDepth):
  11271. * bytecode/Opcode.h:
  11272. * bytecompiler/BytecodeGenerator.cpp:
  11273. (JSC::BytecodeGenerator::BytecodeGenerator):
  11274. (JSC::BytecodeGenerator::emitResolve):
  11275. (JSC::BytecodeGenerator::emitGetScopedVar):
  11276. * bytecompiler/BytecodeGenerator.h:
  11277. (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo):
  11278. * interpreter/Interpreter.cpp:
  11279. (JSC::bytecodeOffsetForPC):
  11280. (JSC::Interpreter::unwindCallFrame):
  11281. (JSC::Interpreter::privateExecute):
  11282. (JSC::Interpreter::retrieveLastCaller):
  11283. (JSC::Interpreter::cti_op_instanceof):
  11284. (JSC::Interpreter::cti_op_call_NotJSFunction):
  11285. (JSC::Interpreter::cti_op_resolve):
  11286. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  11287. (JSC::Interpreter::cti_op_resolve_func):
  11288. (JSC::Interpreter::cti_op_resolve_skip):
  11289. (JSC::Interpreter::cti_op_resolve_global):
  11290. (JSC::Interpreter::cti_op_resolve_with_base):
  11291. (JSC::Interpreter::cti_op_throw):
  11292. (JSC::Interpreter::cti_op_in):
  11293. (JSC::Interpreter::cti_vm_throw):
  11294. * jit/JIT.cpp:
  11295. (JSC::JIT::privateCompile):
  11296. * parser/Nodes.cpp:
  11297. (JSC::EvalNode::generateBytecode):
  11298. (JSC::EvalNode::bytecodeForExceptionInfoReparse):
  11299. (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
  11300. * parser/Nodes.h:
  11301. 2009-01-08 Jian Li <jianli@chromium.org>
  11302. Reviewed by Alexey Proskuryakov.
  11303. Add Win32 implementation of ThreadSpecific.
  11304. https://bugs.webkit.org/show_bug.cgi?id=22614
  11305. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  11306. * wtf/ThreadSpecific.h:
  11307. (WTF::ThreadSpecific::ThreadSpecific):
  11308. (WTF::ThreadSpecific::~ThreadSpecific):
  11309. (WTF::ThreadSpecific::get):
  11310. (WTF::ThreadSpecific::set):
  11311. (WTF::ThreadSpecific::destroy):
  11312. * wtf/ThreadSpecificWin.cpp: Added.
  11313. (WTF::ThreadSpecificThreadExit):
  11314. * wtf/ThreadingWin.cpp:
  11315. (WTF::wtfThreadEntryPoint):
  11316. 2009-01-08 Justin McPherson <justin.mcpherson@nokia.com>
  11317. Reviewed by Simon Hausmann.
  11318. Fix compilation with Qt on NetBSD.
  11319. * runtime/Collector.cpp:
  11320. (JSC::currentThreadStackBase): Use PLATFORM(NETBSD) to enter the
  11321. code path to retrieve the stack base using pthread_attr_get_np.
  11322. The PTHREAD_NP_H define is not used because the header file does
  11323. not exist on NetBSD, but the function is declared nevertheless.
  11324. * wtf/Platform.h: Introduce WTF_PLATFORM_NETBSD.
  11325. 2009-01-07 Sam Weinig <sam@webkit.org>
  11326. Reviewed by Geoffrey Garen.
  11327. <rdar://problem/6469060> Don't store exception information for a CodeBlock until first exception is thrown
  11328. Don't initially store exception information (lineNumber/expressionRange/getByIdExcecptionInfo)
  11329. in CodeBlocks blocks. Instead, re-parse for the data on demand and cache it then.
  11330. One important change that was needed to make this work was to pad op_get_global_var with nops to
  11331. be the same length as op_resolve_global, since one could be replaced for the other on re-parsing,
  11332. and we want to keep the offsets bytecode offsets the same.
  11333. 1.3MB improvement on Membuster head.
  11334. * bytecode/CodeBlock.cpp:
  11335. (JSC::CodeBlock::dump): Update op_get_global_var to account for the padding.
  11336. (JSC::CodeBlock::dumpStatistics): Add more statistic dumping.
  11337. (JSC::CodeBlock::CodeBlock): Initialize m_exceptionInfo.
  11338. (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): Re-parses the CodeBlocks
  11339. associated SourceCode and steals the ExceptionInfo from it.
  11340. (JSC::CodeBlock::lineNumberForBytecodeOffset): Creates the exception info on demand.
  11341. (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
  11342. (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
  11343. * bytecode/CodeBlock.h:
  11344. (JSC::CodeBlock::numberOfExceptionHandlers): Updated to account for m_exceptionInfo indirection.
  11345. (JSC::CodeBlock::addExceptionHandler): Ditto.
  11346. (JSC::CodeBlock::exceptionHandler): Ditto.
  11347. (JSC::CodeBlock::clearExceptionInfo): Ditto.
  11348. (JSC::CodeBlock::addExpressionInfo): Ditto.
  11349. (JSC::CodeBlock::addGetByIdExceptionInfo): Ditto.
  11350. (JSC::CodeBlock::numberOfLineInfos): Ditto.
  11351. (JSC::CodeBlock::addLineInfo): Ditto.
  11352. (JSC::CodeBlock::lastLineInfo): Ditto.
  11353. * bytecode/Opcode.h: Change length of op_get_global_var to match op_resolve_global.
  11354. * bytecode/SamplingTool.cpp:
  11355. (JSC::SamplingTool::dump): Add comment indicating why it is okay not to pass a CallFrame.
  11356. * bytecompiler/BytecodeGenerator.cpp:
  11357. (JSC::BytecodeGenerator::generate): Clear the exception info after generation for Function and Eval
  11358. Code when not in regenerate for exception info mode.
  11359. (JSC::BytecodeGenerator::BytecodeGenerator): Initialize m_regeneratingForExceptionInfo to false.
  11360. (JSC::BytecodeGenerator::emitGetScopedVar): Pad op_get_global_var with 2 nops.
  11361. * bytecompiler/BytecodeGenerator.h:
  11362. (JSC::BytecodeGenerator::setRegeneratingForExcpeptionInfo): Added.
  11363. * interpreter/Interpreter.cpp:
  11364. (JSC::Interpreter::throwException): Pass the CallFrame to exception info accessors.
  11365. (JSC::Interpreter::privateExecute): Ditto.
  11366. (JSC::Interpreter::retrieveLastCaller): Ditto.
  11367. (JSC::Interpreter::cti_op_new_error): Ditto.
  11368. * jit/JIT.cpp:
  11369. (JSC::JIT::privateCompileMainPass): Pass the current bytecode offset instead of hard coding the
  11370. line number, the stub will do the accessing if it gets called.
  11371. * parser/Nodes.cpp:
  11372. (JSC::ProgramNode::emitBytecode): Moved.
  11373. (JSC::ProgramNode::generateBytecode): Moved.
  11374. (JSC::EvalNode::create): Moved.
  11375. (JSC::EvalNode::bytecodeForExceptionInfoReparse): Added.
  11376. (JSC::FunctionBodyNode::generateBytecode): Rename reparse to reparseInPlace.
  11377. (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse): Addded.
  11378. * parser/Nodes.h:
  11379. (JSC::ScopeNode::features): Added getter.
  11380. * parser/Parser.cpp:
  11381. (JSC::Parser::reparseInPlace): Renamed from reparse.
  11382. * parser/Parser.h:
  11383. (JSC::Parser::reparse): Added. Re-parses the passed in Node into
  11384. a new Node.
  11385. * runtime/ExceptionHelpers.cpp:
  11386. (JSC::createUndefinedVariableError): Pass along CallFrame.
  11387. (JSC::createInvalidParamError): Ditto.
  11388. (JSC::createNotAConstructorError): Ditto.
  11389. (JSC::createNotAFunctionError): Ditto.
  11390. (JSC::createNotAnObjectError): Ditto.
  11391. 2009-01-06 Gavin Barraclough <baraclough@apple.com>
  11392. Reviewed by Maciej Stachowiak.
  11393. Replace accidentally removed references in BytecodeGenerator, deleting these
  11394. will be hindering the sharing of constant numbers and strings.
  11395. The code to add a new constant (either number or string) to their respective
  11396. map works by attempting to add a null entry, then checking the result of the
  11397. add for null. The first time, this should return the null (or noValue).
  11398. The code checks for null (to see if this is the initial add), and then allocates
  11399. a new number / string object. This code relies on the result returned from
  11400. the add to the map being stored as a reference, such that the allocated object
  11401. will be stored in the map, and will be resused if the same constant is encountered
  11402. again. By failing to use a reference we will be leaking GC object for each
  11403. additional entry added to the map. As GC objects they should be clollected,
  11404. be we should no be allocatin them in the first place.
  11405. https://bugs.webkit.org/show_bug.cgi?id=23158
  11406. * bytecompiler/BytecodeGenerator.cpp:
  11407. (JSC::BytecodeGenerator::emitLoad):
  11408. 2009-01-06 Oliver Hunt <oliver@apple.com>
  11409. Reviewed by Gavin Barraclough.
  11410. <rdar://problem/6040850> JavaScript register file should use VirtualAlloc on Windows
  11411. Fairly simple, just reserve 4Mb of address space for the
  11412. register file, and then commit one section at a time. We
  11413. don't release committed memory as we drop back, but then
  11414. mac doesn't either so this probably not too much of a
  11415. problem.
  11416. * interpreter/RegisterFile.cpp:
  11417. (JSC::RegisterFile::~RegisterFile):
  11418. * interpreter/RegisterFile.h:
  11419. (JSC::RegisterFile::RegisterFile):
  11420. (JSC::RegisterFile::grow):
  11421. 2009-01-06 Alexey Proskuryakov <ap@webkit.org>
  11422. Reviewed by Darin Adler.
  11423. https://bugs.webkit.org/show_bug.cgi?id=23142
  11424. ThreadGlobalData leaks seen on buildbot
  11425. * wtf/ThreadSpecific.h: (WTF::ThreadSpecific::destroy): Temporarily reset the thread
  11426. specific value to make getter work on Mac OS X.
  11427. * wtf/Platform.h: Touch this file again to make sure all Windows builds use the most recent
  11428. version of ThreadSpecific.h.
  11429. 2009-01-05 Gavin Barraclough <baraclough@apple.com>
  11430. Reviewed by Oliver Hunt.
  11431. Replace all uses of JSValue* with a new smart pointer type, JSValuePtr.
  11432. A JavaScript value may be a heap object or boxed primitive, represented by a
  11433. pointer, or may be an unboxed immediate value, such as an integer. Since a
  11434. value may dynamically need to contain either a pointer value or an immediate,
  11435. we encode immediates as pointer values (since all valid JSCell pointers are
  11436. allocated at alligned addesses, unaligned addresses are available to encode
  11437. immediates). As such all JavaScript values are represented using a JSValue*.
  11438. This implementation is encumbered by a number of constraints. It ties the
  11439. JSValue representation to the size of pointer on the platform, which, for
  11440. example, means that we currently can represent different ranges of integers
  11441. as immediates on x86 and x86-64. It also prevents us from overloading the
  11442. to-boolean conversion used to test for noValue() - effectively forcing us
  11443. to represent noValue() as 0. This would potentially be problematic were we
  11444. to wish to encode integer values differently (e.g. were we to use the v8
  11445. encoding, where pointers are tagged with 1 and integers with 0, then the
  11446. immediate integer 0 would conflict with noValue()).
  11447. This patch replaces all usage of JSValue* with a new class, JSValuePtr,
  11448. which encapsulates the pointer. JSValuePtr maintains the same interface as
  11449. JSValue*, overloading operator-> and operator bool such that previous
  11450. operations in the code on variables of type JSValue* are still supported.
  11451. In order to provide a ProtectPtr<> type with support for the new value
  11452. representation (without using the internal JSValue type directly), a new
  11453. ProtectJSValuePtr type has been added, equivalent to the previous type
  11454. ProtectPtr<JSValue>.
  11455. This patch is likely the first in a sequence of three changes. With the
  11456. value now encapsulated it will likely make sense to migrate the functionality
  11457. from JSValue into JSValuePtr, such that the internal pointer representation
  11458. need not be exposed. Through migrating the functionality to the wrapper
  11459. class the existing JSValue should be rendered redundant, and the class is
  11460. likely to be removed (the JSValuePtr now wrapping a pointer to a JSCell).
  11461. At this stage it will likely make sense to rename JSValuePtr to JSValue.
  11462. https://bugs.webkit.org/show_bug.cgi?id=23114
  11463. * API/APICast.h:
  11464. (toJS):
  11465. (toRef):
  11466. * API/JSBase.cpp:
  11467. (JSEvaluateScript):
  11468. * API/JSCallbackConstructor.h:
  11469. (JSC::JSCallbackConstructor::createStructure):
  11470. * API/JSCallbackFunction.cpp:
  11471. (JSC::JSCallbackFunction::call):
  11472. * API/JSCallbackFunction.h:
  11473. (JSC::JSCallbackFunction::createStructure):
  11474. * API/JSCallbackObject.h:
  11475. (JSC::JSCallbackObject::createStructure):
  11476. * API/JSCallbackObjectFunctions.h:
  11477. (JSC::::asCallbackObject):
  11478. (JSC::::put):
  11479. (JSC::::hasInstance):
  11480. (JSC::::call):
  11481. (JSC::::staticValueGetter):
  11482. (JSC::::staticFunctionGetter):
  11483. (JSC::::callbackGetter):
  11484. * API/JSContextRef.cpp:
  11485. * API/JSObjectRef.cpp:
  11486. (JSObjectMakeConstructor):
  11487. (JSObjectSetPrototype):
  11488. (JSObjectGetProperty):
  11489. (JSObjectSetProperty):
  11490. (JSObjectGetPropertyAtIndex):
  11491. (JSObjectSetPropertyAtIndex):
  11492. * API/JSValueRef.cpp:
  11493. (JSValueGetType):
  11494. (JSValueIsUndefined):
  11495. (JSValueIsNull):
  11496. (JSValueIsBoolean):
  11497. (JSValueIsNumber):
  11498. (JSValueIsString):
  11499. (JSValueIsObject):
  11500. (JSValueIsObjectOfClass):
  11501. (JSValueIsEqual):
  11502. (JSValueIsStrictEqual):
  11503. (JSValueIsInstanceOfConstructor):
  11504. (JSValueToBoolean):
  11505. (JSValueToNumber):
  11506. (JSValueToStringCopy):
  11507. (JSValueToObject):
  11508. (JSValueProtect):
  11509. (JSValueUnprotect):
  11510. * JavaScriptCore.exp:
  11511. * bytecode/CodeBlock.cpp:
  11512. (JSC::valueToSourceString):
  11513. (JSC::constantName):
  11514. (JSC::CodeBlock::dump):
  11515. * bytecode/CodeBlock.h:
  11516. (JSC::CodeBlock::getConstant):
  11517. (JSC::CodeBlock::addUnexpectedConstant):
  11518. (JSC::CodeBlock::unexpectedConstant):
  11519. * bytecode/EvalCodeCache.h:
  11520. (JSC::EvalCodeCache::get):
  11521. * bytecompiler/BytecodeGenerator.cpp:
  11522. (JSC::BytecodeGenerator::BytecodeGenerator):
  11523. (JSC::BytecodeGenerator::addConstant):
  11524. (JSC::BytecodeGenerator::addUnexpectedConstant):
  11525. (JSC::BytecodeGenerator::emitLoad):
  11526. (JSC::BytecodeGenerator::emitLoadJSV):
  11527. (JSC::BytecodeGenerator::emitGetScopedVar):
  11528. (JSC::BytecodeGenerator::emitPutScopedVar):
  11529. (JSC::BytecodeGenerator::emitNewError):
  11530. (JSC::keyForImmediateSwitch):
  11531. * bytecompiler/BytecodeGenerator.h:
  11532. (JSC::BytecodeGenerator::JSValueHashTraits::constructDeletedValue):
  11533. (JSC::BytecodeGenerator::JSValueHashTraits::isDeletedValue):
  11534. * debugger/DebuggerCallFrame.cpp:
  11535. (JSC::DebuggerCallFrame::evaluate):
  11536. * debugger/DebuggerCallFrame.h:
  11537. (JSC::DebuggerCallFrame::DebuggerCallFrame):
  11538. (JSC::DebuggerCallFrame::exception):
  11539. * interpreter/CallFrame.cpp:
  11540. (JSC::CallFrame::thisValue):
  11541. * interpreter/CallFrame.h:
  11542. (JSC::ExecState::setException):
  11543. (JSC::ExecState::exception):
  11544. (JSC::ExecState::exceptionSlot):
  11545. (JSC::ExecState::hadException):
  11546. * interpreter/Interpreter.cpp:
  11547. (JSC::fastIsNumber):
  11548. (JSC::fastToInt32):
  11549. (JSC::fastToUInt32):
  11550. (JSC::jsLess):
  11551. (JSC::jsLessEq):
  11552. (JSC::jsAddSlowCase):
  11553. (JSC::jsAdd):
  11554. (JSC::jsTypeStringForValue):
  11555. (JSC::jsIsObjectType):
  11556. (JSC::jsIsFunctionType):
  11557. (JSC::Interpreter::resolve):
  11558. (JSC::Interpreter::resolveSkip):
  11559. (JSC::Interpreter::resolveGlobal):
  11560. (JSC::inlineResolveBase):
  11561. (JSC::Interpreter::resolveBase):
  11562. (JSC::Interpreter::resolveBaseAndProperty):
  11563. (JSC::Interpreter::resolveBaseAndFunc):
  11564. (JSC::isNotObject):
  11565. (JSC::Interpreter::callEval):
  11566. (JSC::Interpreter::unwindCallFrame):
  11567. (JSC::Interpreter::throwException):
  11568. (JSC::Interpreter::execute):
  11569. (JSC::Interpreter::checkTimeout):
  11570. (JSC::Interpreter::createExceptionScope):
  11571. (JSC::cachePrototypeChain):
  11572. (JSC::Interpreter::tryCachePutByID):
  11573. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  11574. (JSC::Interpreter::tryCacheGetByID):
  11575. (JSC::Interpreter::privateExecute):
  11576. (JSC::Interpreter::retrieveArguments):
  11577. (JSC::Interpreter::retrieveCaller):
  11578. (JSC::Interpreter::retrieveLastCaller):
  11579. (JSC::Interpreter::tryCTICachePutByID):
  11580. (JSC::Interpreter::tryCTICacheGetByID):
  11581. (JSC::returnToThrowTrampoline):
  11582. (JSC::Interpreter::cti_op_convert_this):
  11583. (JSC::Interpreter::cti_op_add):
  11584. (JSC::Interpreter::cti_op_pre_inc):
  11585. (JSC::Interpreter::cti_op_loop_if_less):
  11586. (JSC::Interpreter::cti_op_loop_if_lesseq):
  11587. (JSC::Interpreter::cti_op_get_by_id_generic):
  11588. (JSC::Interpreter::cti_op_get_by_id):
  11589. (JSC::Interpreter::cti_op_get_by_id_second):
  11590. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  11591. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  11592. (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
  11593. (JSC::Interpreter::cti_op_get_by_id_proto_fail):
  11594. (JSC::Interpreter::cti_op_get_by_id_array_fail):
  11595. (JSC::Interpreter::cti_op_get_by_id_string_fail):
  11596. (JSC::Interpreter::cti_op_instanceof):
  11597. (JSC::Interpreter::cti_op_del_by_id):
  11598. (JSC::Interpreter::cti_op_mul):
  11599. (JSC::Interpreter::cti_op_call_NotJSFunction):
  11600. (JSC::Interpreter::cti_op_resolve):
  11601. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  11602. (JSC::Interpreter::cti_op_get_by_val):
  11603. (JSC::Interpreter::cti_op_resolve_func):
  11604. (JSC::Interpreter::cti_op_sub):
  11605. (JSC::Interpreter::cti_op_put_by_val):
  11606. (JSC::Interpreter::cti_op_put_by_val_array):
  11607. (JSC::Interpreter::cti_op_lesseq):
  11608. (JSC::Interpreter::cti_op_loop_if_true):
  11609. (JSC::Interpreter::cti_op_negate):
  11610. (JSC::Interpreter::cti_op_resolve_base):
  11611. (JSC::Interpreter::cti_op_resolve_skip):
  11612. (JSC::Interpreter::cti_op_resolve_global):
  11613. (JSC::Interpreter::cti_op_div):
  11614. (JSC::Interpreter::cti_op_pre_dec):
  11615. (JSC::Interpreter::cti_op_jless):
  11616. (JSC::Interpreter::cti_op_not):
  11617. (JSC::Interpreter::cti_op_jtrue):
  11618. (JSC::Interpreter::cti_op_post_inc):
  11619. (JSC::Interpreter::cti_op_eq):
  11620. (JSC::Interpreter::cti_op_lshift):
  11621. (JSC::Interpreter::cti_op_bitand):
  11622. (JSC::Interpreter::cti_op_rshift):
  11623. (JSC::Interpreter::cti_op_bitnot):
  11624. (JSC::Interpreter::cti_op_resolve_with_base):
  11625. (JSC::Interpreter::cti_op_mod):
  11626. (JSC::Interpreter::cti_op_less):
  11627. (JSC::Interpreter::cti_op_neq):
  11628. (JSC::Interpreter::cti_op_post_dec):
  11629. (JSC::Interpreter::cti_op_urshift):
  11630. (JSC::Interpreter::cti_op_bitxor):
  11631. (JSC::Interpreter::cti_op_bitor):
  11632. (JSC::Interpreter::cti_op_call_eval):
  11633. (JSC::Interpreter::cti_op_throw):
  11634. (JSC::Interpreter::cti_op_next_pname):
  11635. (JSC::Interpreter::cti_op_typeof):
  11636. (JSC::Interpreter::cti_op_is_undefined):
  11637. (JSC::Interpreter::cti_op_is_boolean):
  11638. (JSC::Interpreter::cti_op_is_number):
  11639. (JSC::Interpreter::cti_op_is_string):
  11640. (JSC::Interpreter::cti_op_is_object):
  11641. (JSC::Interpreter::cti_op_is_function):
  11642. (JSC::Interpreter::cti_op_stricteq):
  11643. (JSC::Interpreter::cti_op_nstricteq):
  11644. (JSC::Interpreter::cti_op_to_jsnumber):
  11645. (JSC::Interpreter::cti_op_in):
  11646. (JSC::Interpreter::cti_op_switch_imm):
  11647. (JSC::Interpreter::cti_op_switch_char):
  11648. (JSC::Interpreter::cti_op_switch_string):
  11649. (JSC::Interpreter::cti_op_del_by_val):
  11650. (JSC::Interpreter::cti_op_new_error):
  11651. (JSC::Interpreter::cti_vm_throw):
  11652. * interpreter/Interpreter.h:
  11653. (JSC::Interpreter::isJSArray):
  11654. (JSC::Interpreter::isJSString):
  11655. * interpreter/Register.h:
  11656. (JSC::Register::):
  11657. (JSC::Register::Register):
  11658. (JSC::Register::jsValue):
  11659. (JSC::Register::getJSValue):
  11660. * jit/JIT.cpp:
  11661. (JSC::):
  11662. (JSC::JIT::compileOpStrictEq):
  11663. (JSC::JIT::privateCompileMainPass):
  11664. (JSC::JIT::privateCompileSlowCases):
  11665. * jit/JIT.h:
  11666. (JSC::):
  11667. (JSC::JIT::execute):
  11668. * jit/JITArithmetic.cpp:
  11669. (JSC::JIT::compileFastArith_op_rshift):
  11670. (JSC::JIT::compileFastArithSlow_op_rshift):
  11671. * jit/JITCall.cpp:
  11672. (JSC::JIT::unlinkCall):
  11673. (JSC::JIT::compileOpCallInitializeCallFrame):
  11674. (JSC::JIT::compileOpCall):
  11675. * jit/JITInlineMethods.h:
  11676. (JSC::JIT::emitGetVirtualRegister):
  11677. (JSC::JIT::getConstantOperand):
  11678. (JSC::JIT::isOperandConstant31BitImmediateInt):
  11679. (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
  11680. (JSC::JIT::emitInitRegister):
  11681. * jit/JITPropertyAccess.cpp:
  11682. (JSC::resizePropertyStorage):
  11683. (JSC::JIT::privateCompilePutByIdTransition):
  11684. (JSC::JIT::patchGetByIdSelf):
  11685. (JSC::JIT::patchPutByIdReplace):
  11686. (JSC::JIT::privateCompileGetByIdSelf):
  11687. (JSC::JIT::privateCompileGetByIdProto):
  11688. (JSC::JIT::privateCompileGetByIdSelfList):
  11689. (JSC::JIT::privateCompileGetByIdProtoList):
  11690. (JSC::JIT::privateCompileGetByIdChainList):
  11691. (JSC::JIT::privateCompileGetByIdChain):
  11692. (JSC::JIT::privateCompilePutByIdReplace):
  11693. * jsc.cpp:
  11694. (functionPrint):
  11695. (functionDebug):
  11696. (functionGC):
  11697. (functionVersion):
  11698. (functionRun):
  11699. (functionLoad):
  11700. (functionReadline):
  11701. (functionQuit):
  11702. * parser/Nodes.cpp:
  11703. (JSC::NullNode::emitBytecode):
  11704. (JSC::ArrayNode::emitBytecode):
  11705. (JSC::FunctionCallValueNode::emitBytecode):
  11706. (JSC::FunctionCallResolveNode::emitBytecode):
  11707. (JSC::VoidNode::emitBytecode):
  11708. (JSC::ConstDeclNode::emitCodeSingle):
  11709. (JSC::ReturnNode::emitBytecode):
  11710. (JSC::processClauseList):
  11711. (JSC::EvalNode::emitBytecode):
  11712. (JSC::FunctionBodyNode::emitBytecode):
  11713. (JSC::ProgramNode::emitBytecode):
  11714. * profiler/ProfileGenerator.cpp:
  11715. (JSC::ProfileGenerator::addParentForConsoleStart):
  11716. * profiler/Profiler.cpp:
  11717. (JSC::Profiler::willExecute):
  11718. (JSC::Profiler::didExecute):
  11719. (JSC::Profiler::createCallIdentifier):
  11720. * profiler/Profiler.h:
  11721. * runtime/ArgList.cpp:
  11722. (JSC::ArgList::slowAppend):
  11723. * runtime/ArgList.h:
  11724. (JSC::ArgList::at):
  11725. (JSC::ArgList::append):
  11726. * runtime/Arguments.cpp:
  11727. (JSC::Arguments::put):
  11728. * runtime/Arguments.h:
  11729. (JSC::Arguments::createStructure):
  11730. (JSC::asArguments):
  11731. * runtime/ArrayConstructor.cpp:
  11732. (JSC::callArrayConstructor):
  11733. * runtime/ArrayPrototype.cpp:
  11734. (JSC::getProperty):
  11735. (JSC::putProperty):
  11736. (JSC::arrayProtoFuncToString):
  11737. (JSC::arrayProtoFuncToLocaleString):
  11738. (JSC::arrayProtoFuncJoin):
  11739. (JSC::arrayProtoFuncConcat):
  11740. (JSC::arrayProtoFuncPop):
  11741. (JSC::arrayProtoFuncPush):
  11742. (JSC::arrayProtoFuncReverse):
  11743. (JSC::arrayProtoFuncShift):
  11744. (JSC::arrayProtoFuncSlice):
  11745. (JSC::arrayProtoFuncSort):
  11746. (JSC::arrayProtoFuncSplice):
  11747. (JSC::arrayProtoFuncUnShift):
  11748. (JSC::arrayProtoFuncFilter):
  11749. (JSC::arrayProtoFuncMap):
  11750. (JSC::arrayProtoFuncEvery):
  11751. (JSC::arrayProtoFuncForEach):
  11752. (JSC::arrayProtoFuncSome):
  11753. (JSC::arrayProtoFuncIndexOf):
  11754. (JSC::arrayProtoFuncLastIndexOf):
  11755. * runtime/BooleanConstructor.cpp:
  11756. (JSC::callBooleanConstructor):
  11757. (JSC::constructBooleanFromImmediateBoolean):
  11758. * runtime/BooleanConstructor.h:
  11759. * runtime/BooleanObject.h:
  11760. (JSC::asBooleanObject):
  11761. * runtime/BooleanPrototype.cpp:
  11762. (JSC::booleanProtoFuncToString):
  11763. (JSC::booleanProtoFuncValueOf):
  11764. * runtime/CallData.cpp:
  11765. (JSC::call):
  11766. * runtime/CallData.h:
  11767. * runtime/Collector.cpp:
  11768. (JSC::Heap::protect):
  11769. (JSC::Heap::unprotect):
  11770. (JSC::Heap::heap):
  11771. (JSC::Heap::collect):
  11772. * runtime/Collector.h:
  11773. * runtime/Completion.cpp:
  11774. (JSC::evaluate):
  11775. * runtime/Completion.h:
  11776. (JSC::Completion::Completion):
  11777. (JSC::Completion::value):
  11778. (JSC::Completion::setValue):
  11779. (JSC::Completion::isValueCompletion):
  11780. * runtime/ConstructData.cpp:
  11781. (JSC::construct):
  11782. * runtime/ConstructData.h:
  11783. * runtime/DateConstructor.cpp:
  11784. (JSC::constructDate):
  11785. (JSC::callDate):
  11786. (JSC::dateParse):
  11787. (JSC::dateNow):
  11788. (JSC::dateUTC):
  11789. * runtime/DateInstance.h:
  11790. (JSC::asDateInstance):
  11791. * runtime/DatePrototype.cpp:
  11792. (JSC::dateProtoFuncToString):
  11793. (JSC::dateProtoFuncToUTCString):
  11794. (JSC::dateProtoFuncToDateString):
  11795. (JSC::dateProtoFuncToTimeString):
  11796. (JSC::dateProtoFuncToLocaleString):
  11797. (JSC::dateProtoFuncToLocaleDateString):
  11798. (JSC::dateProtoFuncToLocaleTimeString):
  11799. (JSC::dateProtoFuncValueOf):
  11800. (JSC::dateProtoFuncGetTime):
  11801. (JSC::dateProtoFuncGetFullYear):
  11802. (JSC::dateProtoFuncGetUTCFullYear):
  11803. (JSC::dateProtoFuncToGMTString):
  11804. (JSC::dateProtoFuncGetMonth):
  11805. (JSC::dateProtoFuncGetUTCMonth):
  11806. (JSC::dateProtoFuncGetDate):
  11807. (JSC::dateProtoFuncGetUTCDate):
  11808. (JSC::dateProtoFuncGetDay):
  11809. (JSC::dateProtoFuncGetUTCDay):
  11810. (JSC::dateProtoFuncGetHours):
  11811. (JSC::dateProtoFuncGetUTCHours):
  11812. (JSC::dateProtoFuncGetMinutes):
  11813. (JSC::dateProtoFuncGetUTCMinutes):
  11814. (JSC::dateProtoFuncGetSeconds):
  11815. (JSC::dateProtoFuncGetUTCSeconds):
  11816. (JSC::dateProtoFuncGetMilliSeconds):
  11817. (JSC::dateProtoFuncGetUTCMilliseconds):
  11818. (JSC::dateProtoFuncGetTimezoneOffset):
  11819. (JSC::dateProtoFuncSetTime):
  11820. (JSC::setNewValueFromTimeArgs):
  11821. (JSC::setNewValueFromDateArgs):
  11822. (JSC::dateProtoFuncSetMilliSeconds):
  11823. (JSC::dateProtoFuncSetUTCMilliseconds):
  11824. (JSC::dateProtoFuncSetSeconds):
  11825. (JSC::dateProtoFuncSetUTCSeconds):
  11826. (JSC::dateProtoFuncSetMinutes):
  11827. (JSC::dateProtoFuncSetUTCMinutes):
  11828. (JSC::dateProtoFuncSetHours):
  11829. (JSC::dateProtoFuncSetUTCHours):
  11830. (JSC::dateProtoFuncSetDate):
  11831. (JSC::dateProtoFuncSetUTCDate):
  11832. (JSC::dateProtoFuncSetMonth):
  11833. (JSC::dateProtoFuncSetUTCMonth):
  11834. (JSC::dateProtoFuncSetFullYear):
  11835. (JSC::dateProtoFuncSetUTCFullYear):
  11836. (JSC::dateProtoFuncSetYear):
  11837. (JSC::dateProtoFuncGetYear):
  11838. * runtime/DatePrototype.h:
  11839. (JSC::DatePrototype::createStructure):
  11840. * runtime/ErrorConstructor.cpp:
  11841. (JSC::callErrorConstructor):
  11842. * runtime/ErrorPrototype.cpp:
  11843. (JSC::errorProtoFuncToString):
  11844. * runtime/ExceptionHelpers.cpp:
  11845. (JSC::createInterruptedExecutionException):
  11846. (JSC::createError):
  11847. (JSC::createStackOverflowError):
  11848. (JSC::createUndefinedVariableError):
  11849. (JSC::createErrorMessage):
  11850. (JSC::createInvalidParamError):
  11851. (JSC::createNotAConstructorError):
  11852. (JSC::createNotAFunctionError):
  11853. * runtime/ExceptionHelpers.h:
  11854. * runtime/FunctionConstructor.cpp:
  11855. (JSC::callFunctionConstructor):
  11856. * runtime/FunctionPrototype.cpp:
  11857. (JSC::callFunctionPrototype):
  11858. (JSC::functionProtoFuncToString):
  11859. (JSC::functionProtoFuncApply):
  11860. (JSC::functionProtoFuncCall):
  11861. * runtime/FunctionPrototype.h:
  11862. (JSC::FunctionPrototype::createStructure):
  11863. * runtime/GetterSetter.cpp:
  11864. (JSC::GetterSetter::toPrimitive):
  11865. (JSC::GetterSetter::getPrimitiveNumber):
  11866. * runtime/GetterSetter.h:
  11867. (JSC::asGetterSetter):
  11868. * runtime/InitializeThreading.cpp:
  11869. * runtime/InternalFunction.h:
  11870. (JSC::InternalFunction::createStructure):
  11871. (JSC::asInternalFunction):
  11872. * runtime/JSActivation.cpp:
  11873. (JSC::JSActivation::getOwnPropertySlot):
  11874. (JSC::JSActivation::put):
  11875. (JSC::JSActivation::putWithAttributes):
  11876. (JSC::JSActivation::argumentsGetter):
  11877. * runtime/JSActivation.h:
  11878. (JSC::JSActivation::createStructure):
  11879. (JSC::asActivation):
  11880. * runtime/JSArray.cpp:
  11881. (JSC::storageSize):
  11882. (JSC::JSArray::JSArray):
  11883. (JSC::JSArray::getOwnPropertySlot):
  11884. (JSC::JSArray::put):
  11885. (JSC::JSArray::putSlowCase):
  11886. (JSC::JSArray::deleteProperty):
  11887. (JSC::JSArray::getPropertyNames):
  11888. (JSC::JSArray::setLength):
  11889. (JSC::JSArray::pop):
  11890. (JSC::JSArray::push):
  11891. (JSC::JSArray::mark):
  11892. (JSC::JSArray::sort):
  11893. (JSC::JSArray::compactForSorting):
  11894. (JSC::JSArray::checkConsistency):
  11895. (JSC::constructArray):
  11896. * runtime/JSArray.h:
  11897. (JSC::JSArray::getIndex):
  11898. (JSC::JSArray::setIndex):
  11899. (JSC::JSArray::createStructure):
  11900. (JSC::asArray):
  11901. * runtime/JSCell.cpp:
  11902. (JSC::JSCell::put):
  11903. (JSC::JSCell::getJSNumber):
  11904. * runtime/JSCell.h:
  11905. (JSC::asCell):
  11906. (JSC::JSValue::asCell):
  11907. (JSC::JSValue::toPrimitive):
  11908. (JSC::JSValue::getPrimitiveNumber):
  11909. (JSC::JSValue::getJSNumber):
  11910. * runtime/JSFunction.cpp:
  11911. (JSC::JSFunction::call):
  11912. (JSC::JSFunction::argumentsGetter):
  11913. (JSC::JSFunction::callerGetter):
  11914. (JSC::JSFunction::lengthGetter):
  11915. (JSC::JSFunction::getOwnPropertySlot):
  11916. (JSC::JSFunction::put):
  11917. (JSC::JSFunction::construct):
  11918. * runtime/JSFunction.h:
  11919. (JSC::JSFunction::createStructure):
  11920. (JSC::asFunction):
  11921. * runtime/JSGlobalData.h:
  11922. * runtime/JSGlobalObject.cpp:
  11923. (JSC::markIfNeeded):
  11924. (JSC::JSGlobalObject::put):
  11925. (JSC::JSGlobalObject::putWithAttributes):
  11926. (JSC::JSGlobalObject::reset):
  11927. (JSC::JSGlobalObject::resetPrototype):
  11928. * runtime/JSGlobalObject.h:
  11929. (JSC::JSGlobalObject::createStructure):
  11930. (JSC::JSGlobalObject::GlobalPropertyInfo::GlobalPropertyInfo):
  11931. (JSC::asGlobalObject):
  11932. (JSC::Structure::prototypeForLookup):
  11933. * runtime/JSGlobalObjectFunctions.cpp:
  11934. (JSC::encode):
  11935. (JSC::decode):
  11936. (JSC::globalFuncEval):
  11937. (JSC::globalFuncParseInt):
  11938. (JSC::globalFuncParseFloat):
  11939. (JSC::globalFuncIsNaN):
  11940. (JSC::globalFuncIsFinite):
  11941. (JSC::globalFuncDecodeURI):
  11942. (JSC::globalFuncDecodeURIComponent):
  11943. (JSC::globalFuncEncodeURI):
  11944. (JSC::globalFuncEncodeURIComponent):
  11945. (JSC::globalFuncEscape):
  11946. (JSC::globalFuncUnescape):
  11947. (JSC::globalFuncJSCPrint):
  11948. * runtime/JSGlobalObjectFunctions.h:
  11949. * runtime/JSImmediate.cpp:
  11950. (JSC::JSImmediate::toThisObject):
  11951. (JSC::JSImmediate::toObject):
  11952. (JSC::JSImmediate::prototype):
  11953. (JSC::JSImmediate::toString):
  11954. * runtime/JSImmediate.h:
  11955. (JSC::JSImmediate::isImmediate):
  11956. (JSC::JSImmediate::isNumber):
  11957. (JSC::JSImmediate::isPositiveNumber):
  11958. (JSC::JSImmediate::isBoolean):
  11959. (JSC::JSImmediate::isUndefinedOrNull):
  11960. (JSC::JSImmediate::isNegative):
  11961. (JSC::JSImmediate::isEitherImmediate):
  11962. (JSC::JSImmediate::isAnyImmediate):
  11963. (JSC::JSImmediate::areBothImmediate):
  11964. (JSC::JSImmediate::areBothImmediateNumbers):
  11965. (JSC::JSImmediate::andImmediateNumbers):
  11966. (JSC::JSImmediate::xorImmediateNumbers):
  11967. (JSC::JSImmediate::orImmediateNumbers):
  11968. (JSC::JSImmediate::rightShiftImmediateNumbers):
  11969. (JSC::JSImmediate::canDoFastAdditiveOperations):
  11970. (JSC::JSImmediate::addImmediateNumbers):
  11971. (JSC::JSImmediate::subImmediateNumbers):
  11972. (JSC::JSImmediate::incImmediateNumber):
  11973. (JSC::JSImmediate::decImmediateNumber):
  11974. (JSC::JSImmediate::makeValue):
  11975. (JSC::JSImmediate::makeInt):
  11976. (JSC::JSImmediate::makeBool):
  11977. (JSC::JSImmediate::makeUndefined):
  11978. (JSC::JSImmediate::makeNull):
  11979. (JSC::JSImmediate::intValue):
  11980. (JSC::JSImmediate::uintValue):
  11981. (JSC::JSImmediate::boolValue):
  11982. (JSC::JSImmediate::rawValue):
  11983. (JSC::JSImmediate::trueImmediate):
  11984. (JSC::JSImmediate::falseImmediate):
  11985. (JSC::JSImmediate::undefinedImmediate):
  11986. (JSC::JSImmediate::nullImmediate):
  11987. (JSC::JSImmediate::zeroImmediate):
  11988. (JSC::JSImmediate::oneImmediate):
  11989. (JSC::JSImmediate::impossibleValue):
  11990. (JSC::JSImmediate::toBoolean):
  11991. (JSC::JSImmediate::getTruncatedUInt32):
  11992. (JSC::JSImmediate::from):
  11993. (JSC::JSImmediate::getTruncatedInt32):
  11994. (JSC::JSImmediate::toDouble):
  11995. (JSC::JSImmediate::getUInt32):
  11996. (JSC::jsNull):
  11997. (JSC::jsBoolean):
  11998. (JSC::jsUndefined):
  11999. (JSC::JSValue::isUndefined):
  12000. (JSC::JSValue::isNull):
  12001. (JSC::JSValue::isUndefinedOrNull):
  12002. (JSC::JSValue::isBoolean):
  12003. (JSC::JSValue::getBoolean):
  12004. (JSC::JSValue::toInt32):
  12005. (JSC::JSValue::toUInt32):
  12006. (JSC::toInt32):
  12007. (JSC::toUInt32):
  12008. * runtime/JSNotAnObject.cpp:
  12009. (JSC::JSNotAnObject::toPrimitive):
  12010. (JSC::JSNotAnObject::getPrimitiveNumber):
  12011. (JSC::JSNotAnObject::put):
  12012. * runtime/JSNotAnObject.h:
  12013. (JSC::JSNotAnObject::createStructure):
  12014. * runtime/JSNumberCell.cpp:
  12015. (JSC::JSNumberCell::toPrimitive):
  12016. (JSC::JSNumberCell::getPrimitiveNumber):
  12017. (JSC::JSNumberCell::getJSNumber):
  12018. (JSC::jsNumberCell):
  12019. (JSC::jsNaN):
  12020. * runtime/JSNumberCell.h:
  12021. (JSC::JSNumberCell::createStructure):
  12022. (JSC::asNumberCell):
  12023. (JSC::jsNumber):
  12024. (JSC::JSValue::toJSNumber):
  12025. * runtime/JSObject.cpp:
  12026. (JSC::JSObject::mark):
  12027. (JSC::JSObject::put):
  12028. (JSC::JSObject::putWithAttributes):
  12029. (JSC::callDefaultValueFunction):
  12030. (JSC::JSObject::getPrimitiveNumber):
  12031. (JSC::JSObject::defaultValue):
  12032. (JSC::JSObject::defineGetter):
  12033. (JSC::JSObject::defineSetter):
  12034. (JSC::JSObject::lookupGetter):
  12035. (JSC::JSObject::lookupSetter):
  12036. (JSC::JSObject::hasInstance):
  12037. (JSC::JSObject::toNumber):
  12038. (JSC::JSObject::toString):
  12039. (JSC::JSObject::fillGetterPropertySlot):
  12040. * runtime/JSObject.h:
  12041. (JSC::JSObject::getDirect):
  12042. (JSC::JSObject::getDirectLocation):
  12043. (JSC::JSObject::offsetForLocation):
  12044. (JSC::JSObject::locationForOffset):
  12045. (JSC::JSObject::getDirectOffset):
  12046. (JSC::JSObject::putDirectOffset):
  12047. (JSC::JSObject::createStructure):
  12048. (JSC::asObject):
  12049. (JSC::JSObject::prototype):
  12050. (JSC::JSObject::setPrototype):
  12051. (JSC::JSObject::inlineGetOwnPropertySlot):
  12052. (JSC::JSObject::getOwnPropertySlotForWrite):
  12053. (JSC::JSObject::getPropertySlot):
  12054. (JSC::JSObject::get):
  12055. (JSC::JSObject::putDirect):
  12056. (JSC::JSObject::putDirectWithoutTransition):
  12057. (JSC::JSObject::toPrimitive):
  12058. (JSC::JSValue::get):
  12059. (JSC::JSValue::put):
  12060. (JSC::JSObject::allocatePropertyStorageInline):
  12061. * runtime/JSPropertyNameIterator.cpp:
  12062. (JSC::JSPropertyNameIterator::toPrimitive):
  12063. (JSC::JSPropertyNameIterator::getPrimitiveNumber):
  12064. * runtime/JSPropertyNameIterator.h:
  12065. (JSC::JSPropertyNameIterator::create):
  12066. (JSC::JSPropertyNameIterator::next):
  12067. * runtime/JSStaticScopeObject.cpp:
  12068. (JSC::JSStaticScopeObject::put):
  12069. (JSC::JSStaticScopeObject::putWithAttributes):
  12070. * runtime/JSStaticScopeObject.h:
  12071. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  12072. (JSC::JSStaticScopeObject::createStructure):
  12073. * runtime/JSString.cpp:
  12074. (JSC::JSString::toPrimitive):
  12075. (JSC::JSString::getPrimitiveNumber):
  12076. (JSC::JSString::getOwnPropertySlot):
  12077. * runtime/JSString.h:
  12078. (JSC::JSString::createStructure):
  12079. (JSC::asString):
  12080. * runtime/JSValue.h:
  12081. (JSC::JSValuePtr::makeImmediate):
  12082. (JSC::JSValuePtr::immediateValue):
  12083. (JSC::JSValuePtr::JSValuePtr):
  12084. (JSC::JSValuePtr::operator->):
  12085. (JSC::JSValuePtr::hasValue):
  12086. (JSC::JSValuePtr::operator==):
  12087. (JSC::JSValuePtr::operator!=):
  12088. (JSC::JSValuePtr::encode):
  12089. (JSC::JSValuePtr::decode):
  12090. (JSC::JSValue::asValue):
  12091. (JSC::noValue):
  12092. (JSC::operator==):
  12093. (JSC::operator!=):
  12094. * runtime/JSVariableObject.h:
  12095. (JSC::JSVariableObject::symbolTablePut):
  12096. (JSC::JSVariableObject::symbolTablePutWithAttributes):
  12097. * runtime/JSWrapperObject.cpp:
  12098. (JSC::JSWrapperObject::mark):
  12099. * runtime/JSWrapperObject.h:
  12100. (JSC::JSWrapperObject::internalValue):
  12101. (JSC::JSWrapperObject::setInternalValue):
  12102. * runtime/Lookup.cpp:
  12103. (JSC::setUpStaticFunctionSlot):
  12104. * runtime/Lookup.h:
  12105. (JSC::lookupPut):
  12106. * runtime/MathObject.cpp:
  12107. (JSC::mathProtoFuncAbs):
  12108. (JSC::mathProtoFuncACos):
  12109. (JSC::mathProtoFuncASin):
  12110. (JSC::mathProtoFuncATan):
  12111. (JSC::mathProtoFuncATan2):
  12112. (JSC::mathProtoFuncCeil):
  12113. (JSC::mathProtoFuncCos):
  12114. (JSC::mathProtoFuncExp):
  12115. (JSC::mathProtoFuncFloor):
  12116. (JSC::mathProtoFuncLog):
  12117. (JSC::mathProtoFuncMax):
  12118. (JSC::mathProtoFuncMin):
  12119. (JSC::mathProtoFuncPow):
  12120. (JSC::mathProtoFuncRandom):
  12121. (JSC::mathProtoFuncRound):
  12122. (JSC::mathProtoFuncSin):
  12123. (JSC::mathProtoFuncSqrt):
  12124. (JSC::mathProtoFuncTan):
  12125. * runtime/MathObject.h:
  12126. (JSC::MathObject::createStructure):
  12127. * runtime/NativeErrorConstructor.cpp:
  12128. (JSC::callNativeErrorConstructor):
  12129. * runtime/NumberConstructor.cpp:
  12130. (JSC::numberConstructorNaNValue):
  12131. (JSC::numberConstructorNegInfinity):
  12132. (JSC::numberConstructorPosInfinity):
  12133. (JSC::numberConstructorMaxValue):
  12134. (JSC::numberConstructorMinValue):
  12135. (JSC::callNumberConstructor):
  12136. * runtime/NumberConstructor.h:
  12137. (JSC::NumberConstructor::createStructure):
  12138. * runtime/NumberObject.cpp:
  12139. (JSC::NumberObject::getJSNumber):
  12140. (JSC::constructNumberFromImmediateNumber):
  12141. * runtime/NumberObject.h:
  12142. * runtime/NumberPrototype.cpp:
  12143. (JSC::numberProtoFuncToString):
  12144. (JSC::numberProtoFuncToLocaleString):
  12145. (JSC::numberProtoFuncValueOf):
  12146. (JSC::numberProtoFuncToFixed):
  12147. (JSC::numberProtoFuncToExponential):
  12148. (JSC::numberProtoFuncToPrecision):
  12149. * runtime/ObjectConstructor.cpp:
  12150. (JSC::constructObject):
  12151. (JSC::callObjectConstructor):
  12152. * runtime/ObjectPrototype.cpp:
  12153. (JSC::objectProtoFuncValueOf):
  12154. (JSC::objectProtoFuncHasOwnProperty):
  12155. (JSC::objectProtoFuncIsPrototypeOf):
  12156. (JSC::objectProtoFuncDefineGetter):
  12157. (JSC::objectProtoFuncDefineSetter):
  12158. (JSC::objectProtoFuncLookupGetter):
  12159. (JSC::objectProtoFuncLookupSetter):
  12160. (JSC::objectProtoFuncPropertyIsEnumerable):
  12161. (JSC::objectProtoFuncToLocaleString):
  12162. (JSC::objectProtoFuncToString):
  12163. * runtime/ObjectPrototype.h:
  12164. * runtime/Operations.cpp:
  12165. (JSC::equal):
  12166. (JSC::equalSlowCase):
  12167. (JSC::strictEqual):
  12168. (JSC::strictEqualSlowCase):
  12169. (JSC::throwOutOfMemoryError):
  12170. * runtime/Operations.h:
  12171. (JSC::equalSlowCaseInline):
  12172. (JSC::strictEqualSlowCaseInline):
  12173. * runtime/PropertySlot.cpp:
  12174. (JSC::PropertySlot::functionGetter):
  12175. * runtime/PropertySlot.h:
  12176. (JSC::PropertySlot::PropertySlot):
  12177. (JSC::PropertySlot::getValue):
  12178. (JSC::PropertySlot::putValue):
  12179. (JSC::PropertySlot::setValueSlot):
  12180. (JSC::PropertySlot::setValue):
  12181. (JSC::PropertySlot::setCustom):
  12182. (JSC::PropertySlot::setCustomIndex):
  12183. (JSC::PropertySlot::slotBase):
  12184. (JSC::PropertySlot::setBase):
  12185. (JSC::PropertySlot::):
  12186. * runtime/Protect.h:
  12187. (JSC::gcProtect):
  12188. (JSC::gcUnprotect):
  12189. (JSC::ProtectedPtr::ProtectedPtr):
  12190. (JSC::ProtectedPtr::operator JSValuePtr):
  12191. (JSC::ProtectedJSValuePtr::ProtectedJSValuePtr):
  12192. (JSC::ProtectedJSValuePtr::get):
  12193. (JSC::ProtectedJSValuePtr::operator JSValuePtr):
  12194. (JSC::ProtectedJSValuePtr::operator->):
  12195. (JSC::::ProtectedPtr):
  12196. (JSC::::~ProtectedPtr):
  12197. (JSC::::operator):
  12198. (JSC::ProtectedJSValuePtr::~ProtectedJSValuePtr):
  12199. (JSC::ProtectedJSValuePtr::operator=):
  12200. (JSC::operator==):
  12201. (JSC::operator!=):
  12202. * runtime/RegExpConstructor.cpp:
  12203. (JSC::RegExpConstructor::getBackref):
  12204. (JSC::RegExpConstructor::getLastParen):
  12205. (JSC::RegExpConstructor::getLeftContext):
  12206. (JSC::RegExpConstructor::getRightContext):
  12207. (JSC::regExpConstructorDollar1):
  12208. (JSC::regExpConstructorDollar2):
  12209. (JSC::regExpConstructorDollar3):
  12210. (JSC::regExpConstructorDollar4):
  12211. (JSC::regExpConstructorDollar5):
  12212. (JSC::regExpConstructorDollar6):
  12213. (JSC::regExpConstructorDollar7):
  12214. (JSC::regExpConstructorDollar8):
  12215. (JSC::regExpConstructorDollar9):
  12216. (JSC::regExpConstructorInput):
  12217. (JSC::regExpConstructorMultiline):
  12218. (JSC::regExpConstructorLastMatch):
  12219. (JSC::regExpConstructorLastParen):
  12220. (JSC::regExpConstructorLeftContext):
  12221. (JSC::regExpConstructorRightContext):
  12222. (JSC::RegExpConstructor::put):
  12223. (JSC::setRegExpConstructorInput):
  12224. (JSC::setRegExpConstructorMultiline):
  12225. (JSC::constructRegExp):
  12226. (JSC::callRegExpConstructor):
  12227. * runtime/RegExpConstructor.h:
  12228. (JSC::RegExpConstructor::createStructure):
  12229. (JSC::asRegExpConstructor):
  12230. * runtime/RegExpMatchesArray.h:
  12231. (JSC::RegExpMatchesArray::put):
  12232. * runtime/RegExpObject.cpp:
  12233. (JSC::regExpObjectGlobal):
  12234. (JSC::regExpObjectIgnoreCase):
  12235. (JSC::regExpObjectMultiline):
  12236. (JSC::regExpObjectSource):
  12237. (JSC::regExpObjectLastIndex):
  12238. (JSC::RegExpObject::put):
  12239. (JSC::setRegExpObjectLastIndex):
  12240. (JSC::RegExpObject::test):
  12241. (JSC::RegExpObject::exec):
  12242. (JSC::callRegExpObject):
  12243. * runtime/RegExpObject.h:
  12244. (JSC::RegExpObject::createStructure):
  12245. (JSC::asRegExpObject):
  12246. * runtime/RegExpPrototype.cpp:
  12247. (JSC::regExpProtoFuncTest):
  12248. (JSC::regExpProtoFuncExec):
  12249. (JSC::regExpProtoFuncCompile):
  12250. (JSC::regExpProtoFuncToString):
  12251. * runtime/StringConstructor.cpp:
  12252. (JSC::stringFromCharCodeSlowCase):
  12253. (JSC::stringFromCharCode):
  12254. (JSC::callStringConstructor):
  12255. * runtime/StringObject.cpp:
  12256. (JSC::StringObject::put):
  12257. * runtime/StringObject.h:
  12258. (JSC::StringObject::createStructure):
  12259. (JSC::asStringObject):
  12260. * runtime/StringObjectThatMasqueradesAsUndefined.h:
  12261. (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
  12262. * runtime/StringPrototype.cpp:
  12263. (JSC::stringProtoFuncReplace):
  12264. (JSC::stringProtoFuncToString):
  12265. (JSC::stringProtoFuncCharAt):
  12266. (JSC::stringProtoFuncCharCodeAt):
  12267. (JSC::stringProtoFuncConcat):
  12268. (JSC::stringProtoFuncIndexOf):
  12269. (JSC::stringProtoFuncLastIndexOf):
  12270. (JSC::stringProtoFuncMatch):
  12271. (JSC::stringProtoFuncSearch):
  12272. (JSC::stringProtoFuncSlice):
  12273. (JSC::stringProtoFuncSplit):
  12274. (JSC::stringProtoFuncSubstr):
  12275. (JSC::stringProtoFuncSubstring):
  12276. (JSC::stringProtoFuncToLowerCase):
  12277. (JSC::stringProtoFuncToUpperCase):
  12278. (JSC::stringProtoFuncLocaleCompare):
  12279. (JSC::stringProtoFuncBig):
  12280. (JSC::stringProtoFuncSmall):
  12281. (JSC::stringProtoFuncBlink):
  12282. (JSC::stringProtoFuncBold):
  12283. (JSC::stringProtoFuncFixed):
  12284. (JSC::stringProtoFuncItalics):
  12285. (JSC::stringProtoFuncStrike):
  12286. (JSC::stringProtoFuncSub):
  12287. (JSC::stringProtoFuncSup):
  12288. (JSC::stringProtoFuncFontcolor):
  12289. (JSC::stringProtoFuncFontsize):
  12290. (JSC::stringProtoFuncAnchor):
  12291. (JSC::stringProtoFuncLink):
  12292. * runtime/Structure.cpp:
  12293. (JSC::Structure::Structure):
  12294. (JSC::Structure::changePrototypeTransition):
  12295. (JSC::Structure::createCachedPrototypeChain):
  12296. * runtime/Structure.h:
  12297. (JSC::Structure::create):
  12298. (JSC::Structure::setPrototypeWithoutTransition):
  12299. (JSC::Structure::storedPrototype):
  12300. 2009-01-06 Oliver Hunt <oliver@apple.com>
  12301. Reviewed by Cameron Zwarich.
  12302. <https://bugs.webkit.org/show_bug.cgi?id=23085> [jsfunfuzz] Over released ScopeChainNode
  12303. <rdar://problem/6474110>
  12304. So this delightful bug was caused by our unwind code using a ScopeChain to perform
  12305. the unwind. The ScopeChain would ref the initial top of the scope chain, then deref
  12306. the resultant top of scope chain, which is incorrect.
  12307. This patch removes the dependency on ScopeChain for the unwind, and i've filed
  12308. <https://bugs.webkit.org/show_bug.cgi?id=23144> to look into the unintuitive
  12309. ScopeChain behaviour.
  12310. * interpreter/Interpreter.cpp:
  12311. (JSC::Interpreter::throwException):
  12312. 2009-01-06 Adam Roben <aroben@apple.com>
  12313. Hopeful Windows crash-on-launch fix
  12314. * wtf/Platform.h: Force a world rebuild by touching this file.
  12315. 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
  12316. Reviewed by NOBODY (Build fix).
  12317. * GNUmakefile.am:Add ByteArray.cpp too
  12318. 2009-01-06 Holger Hans Peter Freyther <zecke@selfish.org>
  12319. Reviewed by NOBODY (Speculative build fix).
  12320. AllInOneFile.cpp does not include the JSByteArray.cpp include it...
  12321. * GNUmakefile.am:
  12322. 2009-01-05 Oliver Hunt <oliver@apple.com>
  12323. Reviewed by NOBODY (Build fix).
  12324. Fix Wx build
  12325. * JavaScriptCoreSources.bkl:
  12326. 2009-01-05 Oliver Hunt <oliver@apple.com>
  12327. Windows build fixes
  12328. Rubber-stamped by Alice Liu.
  12329. * interpreter/Interpreter.cpp:
  12330. (JSC::Interpreter::Interpreter):
  12331. * runtime/ByteArray.cpp:
  12332. (JSC::ByteArray::create):
  12333. * runtime/ByteArray.h:
  12334. 2009-01-05 Oliver Hunt <oliver@apple.com>
  12335. Reviewed by Gavin Barraclough.
  12336. CanvasPixelArray performance is too slow
  12337. <https://bugs.webkit.org/show_bug.cgi?id=23123>
  12338. The fix to this is to devirtualise get and put in a manner similar to
  12339. JSString and JSArray. To do this I've added a ByteArray implementation
  12340. and JSByteArray wrapper to JSC. We can then do vptr comparisons to
  12341. devirtualise the calls.
  12342. This devirtualisation improves performance by 1.5-2x in my somewhat ad
  12343. hoc tests.
  12344. * GNUmakefile.am:
  12345. * JavaScriptCore.exp:
  12346. * JavaScriptCore.pri:
  12347. * JavaScriptCore.scons:
  12348. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  12349. * JavaScriptCore.xcodeproj/project.pbxproj:
  12350. * interpreter/Interpreter.cpp:
  12351. (JSC::Interpreter::Interpreter):
  12352. (JSC::Interpreter::privateExecute):
  12353. (JSC::Interpreter::cti_op_get_by_val):
  12354. (JSC::Interpreter::cti_op_put_by_val):
  12355. * interpreter/Interpreter.h:
  12356. (JSC::Interpreter::isJSByteArray):
  12357. * runtime/ByteArray.cpp: Added.
  12358. (JSC::ByteArray::create):
  12359. * runtime/ByteArray.h: Added.
  12360. (JSC::ByteArray::length):
  12361. (JSC::ByteArray::set):
  12362. (JSC::ByteArray::get):
  12363. (JSC::ByteArray::data):
  12364. (JSC::ByteArray::ByteArray):
  12365. * runtime/JSByteArray.cpp: Added.
  12366. (JSC::):
  12367. (JSC::JSByteArray::JSByteArray):
  12368. (JSC::JSByteArray::createStructure):
  12369. (JSC::JSByteArray::getOwnPropertySlot):
  12370. (JSC::JSByteArray::put):
  12371. (JSC::JSByteArray::getPropertyNames):
  12372. * runtime/JSByteArray.h: Added.
  12373. (JSC::JSByteArray::canAccessIndex):
  12374. (JSC::JSByteArray::getIndex):
  12375. (JSC::JSByteArray::setIndex):
  12376. (JSC::JSByteArray::classInfo):
  12377. (JSC::JSByteArray::length):
  12378. (JSC::JSByteArray::):
  12379. (JSC::JSByteArray::JSByteArray):
  12380. (JSC::asByteArray):
  12381. 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
  12382. Reviewed by Darin Adler.
  12383. https://bugs.webkit.org/show_bug.cgi?id=23073
  12384. <rdar://problem/6471129> Workers crash on Windows Release builds
  12385. * wtf/ThreadSpecific.h:
  12386. (WTF::ThreadSpecific::destroy): Changed to clear the pointer only after data object
  12387. destruction is finished - otherwise, WebCore::ThreadGlobalData destructor was re-creating
  12388. the object in order to access atomic string table.
  12389. (WTF::ThreadSpecific::operator T*): Symmetrically, set up the per-thread pointer before
  12390. data constructor is called.
  12391. * wtf/ThreadingWin.cpp: (WTF::wtfThreadEntryPoint): Remove a Windows-only hack to finalize
  12392. a thread - pthreadVC2 is a DLL, so it gets thread detached messages, and cleans up thread
  12393. specific data automatically. Besides, this code wasn't even compiled in for some time now.
  12394. 2009-01-05 Alexey Proskuryakov <ap@webkit.org>
  12395. Reviewed by Darin Adler.
  12396. https://bugs.webkit.org/show_bug.cgi?id=23115
  12397. Create a version of ASSERT for use with otherwise unused variables
  12398. * wtf/Assertions.h: Added ASSERT_UNUSED.
  12399. * jit/ExecutableAllocatorPosix.cpp:
  12400. (JSC::ExecutablePool::systemRelease):
  12401. * runtime/Collector.cpp:
  12402. (JSC::Heap::destroy):
  12403. (JSC::Heap::heapAllocate):
  12404. * runtime/JSNotAnObject.cpp:
  12405. (JSC::JSNotAnObject::toPrimitive):
  12406. (JSC::JSNotAnObject::getPrimitiveNumber):
  12407. (JSC::JSNotAnObject::toBoolean):
  12408. (JSC::JSNotAnObject::toNumber):
  12409. (JSC::JSNotAnObject::toString):
  12410. (JSC::JSNotAnObject::getOwnPropertySlot):
  12411. (JSC::JSNotAnObject::put):
  12412. (JSC::JSNotAnObject::deleteProperty):
  12413. (JSC::JSNotAnObject::getPropertyNames):
  12414. * wtf/TCSystemAlloc.cpp:
  12415. (TCMalloc_SystemRelease):
  12416. Use it in some places that used other idioms for this purpose.
  12417. 2009-01-04 Alice Liu <alice.liu@apple.com>
  12418. <rdar://problem/6341776> Merge m_transitionCount and m_offset in Structure.
  12419. Reviewed by Darin Adler.
  12420. * runtime/Structure.cpp:
  12421. (JSC::Structure::Structure): Remove m_transitionCount
  12422. (JSC::Structure::addPropertyTransitionToExistingStructure): No need to wait until after the assignment to offset to assert if it's notFound; move it up.
  12423. (JSC::Structure::addPropertyTransition): Use method for transitionCount instead of m_transitionCount. Remove line that maintains the m_transitionCount.
  12424. (JSC::Structure::changePrototypeTransition): Remove line that maintains the m_transitionCount.
  12425. (JSC::Structure::getterSetterTransition): Remove line that maintains the m_transitionCount.
  12426. * runtime/Structure.h:
  12427. Changed s_maxTransitionLength and m_offset from size_t to signed char. m_offset will never become greater than 64
  12428. because the structure transitions to a dictionary at that time.
  12429. (JSC::Structure::transitionCount): method to replace the data member
  12430. 2009-01-04 Darin Adler <darin@apple.com>
  12431. Reviewed by David Kilzer.
  12432. Bug 15114: Provide compile-time assertions for sizeof(UChar), sizeof(DeprecatedChar), etc.
  12433. https://bugs.webkit.org/show_bug.cgi?id=15114
  12434. * wtf/unicode/Unicode.h: Assert size of UChar. There is no DeprecatedChar any more.
  12435. 2009-01-03 Sam Weinig <sam@webkit.org>
  12436. Reviewed by Oliver Hunt.
  12437. Change the pcVector from storing native code pointers to storing offsets
  12438. from the base pointer. This will allow us to generate the pcVector on demand
  12439. for exceptions.
  12440. * bytecode/CodeBlock.h:
  12441. (JSC::PC::PC):
  12442. (JSC::getNativePCOffset):
  12443. (JSC::CodeBlock::getBytecodeIndex):
  12444. * jit/JIT.cpp:
  12445. (JSC::JIT::privateCompile):
  12446. 2009-01-02 Oliver Hunt <oliver@apple.com>
  12447. Reviewed by NOBODY (Build fix).
  12448. * runtime/ScopeChain.cpp:
  12449. 2009-01-02 Oliver Hunt <oliver@apple.com>
  12450. Reviewed by Gavin Barraclough.
  12451. [jsfunfuzz] unwind logic for exceptions in eval fails to account for dynamic scope external to the eval
  12452. https://bugs.webkit.org/show_bug.cgi?id=23078
  12453. This bug was caused by eval codeblocks being generated without accounting
  12454. for the depth of the scope chain they inherited. This meant that exception
  12455. handlers would understate their expected scope chain depth, which in turn
  12456. led to incorrectly removing nodes from the scope chain.
  12457. * bytecompiler/BytecodeGenerator.cpp:
  12458. (JSC::BytecodeGenerator::BytecodeGenerator):
  12459. (JSC::BytecodeGenerator::emitCatch):
  12460. * bytecompiler/BytecodeGenerator.h:
  12461. * interpreter/Interpreter.cpp:
  12462. (JSC::depth):
  12463. * runtime/ScopeChain.cpp:
  12464. (JSC::ScopeChain::localDepth):
  12465. * runtime/ScopeChain.h:
  12466. (JSC::ScopeChainNode::deref):
  12467. (JSC::ScopeChainNode::ref):
  12468. 2009-01-02 David Smith <catfish.man@gmail.com>
  12469. Reviewed by Darin Adler.
  12470. https://bugs.webkit.org/show_bug.cgi?id=22699
  12471. Enable NodeList caching for getElementsByTagName
  12472. * wtf/HashFunctions.h: Moved the definition of PHI here and renamed to stringHashingStartValue
  12473. 2009-01-02 David Kilzer <ddkilzer@apple.com>
  12474. Attempt to fix Qt Linux build after r39553
  12475. * wtf/RandomNumberSeed.h: Include <sys/time.h> for gettimeofday().
  12476. Include <sys/types.h> and <unistd.h> for getpid().
  12477. 2009-01-02 David Kilzer <ddkilzer@apple.com>
  12478. Bug 23081: These files are no longer part of the KDE libraries
  12479. <https://bugs.webkit.org/show_bug.cgi?id=23081>
  12480. Reviewed by Darin Adler.
  12481. Removed "This file is part of the KDE libraries" comment from
  12482. source files. Added or updated Apple copyrights as well.
  12483. * parser/Lexer.h:
  12484. * wtf/HashCountedSet.h:
  12485. * wtf/RetainPtr.h:
  12486. * wtf/VectorTraits.h:
  12487. 2009-01-02 David Kilzer <ddkilzer@apple.com>
  12488. Bug 23080: Remove last vestiges of KJS references
  12489. <https://bugs.webkit.org/show_bug.cgi?id=23080>
  12490. Reviewed by Darin Adler.
  12491. Also updated Apple copyright statements.
  12492. * DerivedSources.make: Changed bison "kjsyy" prefix to "jscyy".
  12493. * GNUmakefile.am: Ditto.
  12494. * JavaScriptCore.pri: Ditto. Also changed KJSBISON to JSCBISON
  12495. and kjsbison to jscbison.
  12496. * JavaScriptCoreSources.bkl: Changed JSCORE_KJS_SOURCES to
  12497. JSCORE_JSC_SOURCES.
  12498. * jscore.bkl: Ditto.
  12499. * create_hash_table: Updated copyright and removed old comment.
  12500. * parser/Grammar.y: Changed "kjsyy" prefix to "jscyy" prefix.
  12501. * parser/Lexer.cpp: Ditto. Also changed KJS_DEBUG_LEX to
  12502. JSC_DEBUG_LEX.
  12503. (jscyylex):
  12504. (JSC::Lexer::lex):
  12505. * parser/Parser.cpp: Ditto.
  12506. (JSC::Parser::parse):
  12507. * pcre/dftables: Changed "kjs_pcre_" prefix to "jsc_pcre_".
  12508. * pcre/pcre_compile.cpp: Ditto.
  12509. (getOthercaseRange):
  12510. (encodeUTF8):
  12511. (compileBranch):
  12512. (calculateCompiledPatternLength):
  12513. * pcre/pcre_exec.cpp: Ditto.
  12514. (matchRef):
  12515. (getUTF8CharAndIncrementLength):
  12516. (match):
  12517. * pcre/pcre_internal.h: Ditto.
  12518. (toLowerCase):
  12519. (flipCase):
  12520. (classBitmapForChar):
  12521. (charTypeForChar):
  12522. * pcre/pcre_tables.cpp: Ditto.
  12523. * pcre/pcre_ucp_searchfuncs.cpp: Ditto.
  12524. (jsc_pcre_ucp_othercase):
  12525. * pcre/pcre_xclass.cpp: Ditto.
  12526. (getUTF8CharAndAdvancePointer):
  12527. (jsc_pcre_xclass):
  12528. * runtime/Collector.h: Updated header guards using the
  12529. clean-header-guards script.
  12530. * runtime/CollectorHeapIterator.h: Added missing header guard.
  12531. * runtime/Identifier.h: Updated header guards.
  12532. * runtime/JSFunction.h: Fixed end-of-namespace comment.
  12533. * runtime/JSGlobalObject.cpp:
  12534. (JSC::JSGlobalObject::reset): Renamed "kjsprint" debug function
  12535. to "jscprint". Changed implementation method from
  12536. globalFuncKJSPrint() to globalFuncJSCPrint().
  12537. * runtime/JSGlobalObjectFunctions.cpp:
  12538. (JSC::globalFuncJSCPrint): Renamed from globalFuncKJSPrint().
  12539. * runtime/JSGlobalObjectFunctions.h: Ditto.
  12540. * runtime/JSImmediate.h: Updated header guards.
  12541. * runtime/JSLock.h: Ditto.
  12542. * runtime/JSType.h: Ditto.
  12543. * runtime/JSWrapperObject.h: Ditto.
  12544. * runtime/Lookup.h: Ditto.
  12545. * runtime/Operations.h: Ditto.
  12546. * runtime/Protect.h: Ditto.
  12547. * runtime/RegExp.h: Ditto.
  12548. * runtime/UString.h: Ditto.
  12549. * tests/mozilla/js1_5/Array/regress-157652.js: Changed "KJS"
  12550. reference in comment to "JSC".
  12551. * wrec/CharacterClassConstructor.cpp: Change "kjs_pcre_" function
  12552. prefixes to "jsc_pcre_".
  12553. (JSC::WREC::CharacterClassConstructor::put):
  12554. (JSC::WREC::CharacterClassConstructor::flush):
  12555. * wtf/unicode/Unicode.h: Change "KJS_" header guard to "WTF_".
  12556. * wtf/unicode/icu/UnicodeIcu.h: Ditto.
  12557. * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  12558. 2009-01-02 Oliver Hunt <oliver@apple.com>
  12559. Reviewed by Maciej Stachowiak.
  12560. Make randomNumber generate 2^53 values instead of 2^32 (or 2^31 for rand() platforms)
  12561. * wtf/RandomNumber.cpp:
  12562. (WTF::randomNumber):
  12563. 2009-01-02 David Kilzer <ddkilzer@apple.com>
  12564. Remove declaration for JSC::Identifier::initializeIdentifierThreading()
  12565. Reviewed by Alexey Proskuryakov.
  12566. * runtime/Identifier.h:
  12567. (JSC::Identifier::initializeIdentifierThreading): Removed
  12568. declaration since the implementation was removed in r34412.
  12569. 2009-01-01 Darin Adler <darin@apple.com>
  12570. Reviewed by Oliver Hunt.
  12571. String.replace does not support $& replacement metacharacter when search term is not a RegExp
  12572. <https://bugs.webkit.org/show_bug.cgi?id=21431>
  12573. <rdar://problem/6274993>
  12574. Test: fast/js/string-replace-3.html
  12575. * runtime/StringPrototype.cpp:
  12576. (JSC::substituteBackreferences): Added a null check here so we won't try to handle $$-$9
  12577. backreferences when the search term is a string, not a RegExp. Added a check for 0 so we
  12578. won't try to handle $0 or $00 as a backreference.
  12579. (JSC::stringProtoFuncReplace): Added a call to substituteBackreferences.
  12580. 2009-01-01 Gavin Barraclough <barraclough@apple.com>
  12581. Reviewed by Darin Adler.
  12582. Allow 32-bit integers to be stored in JSImmediates, on x64-bit.
  12583. Presently the top 32-bits of a 64-bit JSImmediate serve as a sign extension of a 31-bit
  12584. int stored in the low word (shifted left by one, to make room for a tag). In the new
  12585. format, the top 31-bits serve as a sign extension of a 32-bit int, still shifted left by
  12586. one.
  12587. The new behavior is enabled using a flag in Platform.h, 'WTF_USE_ALTERNATE_JSIMMEDIATE'.
  12588. When this is set the constants defining the range of ints allowed to be stored as
  12589. JSImmediate values is extended. The code in JSImmediate.h can safely operate on either
  12590. format. This patch updates the JIT so that it can also operate with the new format.
  12591. ~2% progression on x86-64, with & without the JIT, on sunspider & v8 tests.
  12592. * assembler/MacroAssembler.h:
  12593. (JSC::MacroAssembler::addPtr):
  12594. (JSC::MacroAssembler::orPtr):
  12595. (JSC::MacroAssembler::or32):
  12596. (JSC::MacroAssembler::rshiftPtr):
  12597. (JSC::MacroAssembler::rshift32):
  12598. (JSC::MacroAssembler::subPtr):
  12599. (JSC::MacroAssembler::xorPtr):
  12600. (JSC::MacroAssembler::xor32):
  12601. (JSC::MacroAssembler::move):
  12602. (JSC::MacroAssembler::compareImm64ForBranch):
  12603. (JSC::MacroAssembler::compareImm64ForBranchEquality):
  12604. (JSC::MacroAssembler::jePtr):
  12605. (JSC::MacroAssembler::jgePtr):
  12606. (JSC::MacroAssembler::jlPtr):
  12607. (JSC::MacroAssembler::jlePtr):
  12608. (JSC::MacroAssembler::jnePtr):
  12609. (JSC::MacroAssembler::jnzSubPtr):
  12610. (JSC::MacroAssembler::joAddPtr):
  12611. (JSC::MacroAssembler::jzSubPtr):
  12612. * assembler/X86Assembler.h:
  12613. (JSC::X86Assembler::addq_rr):
  12614. (JSC::X86Assembler::orq_ir):
  12615. (JSC::X86Assembler::subq_ir):
  12616. (JSC::X86Assembler::xorq_rr):
  12617. (JSC::X86Assembler::sarq_CLr):
  12618. (JSC::X86Assembler::sarq_i8r):
  12619. (JSC::X86Assembler::cmpq_ir):
  12620. * jit/JIT.cpp:
  12621. (JSC::JIT::compileOpStrictEq):
  12622. (JSC::JIT::privateCompileMainPass):
  12623. (JSC::JIT::privateCompileSlowCases):
  12624. (JSC::JIT::privateCompileCTIMachineTrampolines):
  12625. * jit/JIT.h:
  12626. * jit/JITArithmetic.cpp:
  12627. (JSC::JIT::compileFastArith_op_lshift):
  12628. (JSC::JIT::compileFastArithSlow_op_lshift):
  12629. (JSC::JIT::compileFastArith_op_rshift):
  12630. (JSC::JIT::compileFastArithSlow_op_rshift):
  12631. (JSC::JIT::compileFastArith_op_bitand):
  12632. (JSC::JIT::compileFastArithSlow_op_bitand):
  12633. (JSC::JIT::compileFastArith_op_mod):
  12634. (JSC::JIT::compileFastArithSlow_op_mod):
  12635. (JSC::JIT::compileFastArith_op_add):
  12636. (JSC::JIT::compileFastArithSlow_op_add):
  12637. (JSC::JIT::compileFastArith_op_mul):
  12638. (JSC::JIT::compileFastArithSlow_op_mul):
  12639. (JSC::JIT::compileFastArith_op_post_inc):
  12640. (JSC::JIT::compileFastArithSlow_op_post_inc):
  12641. (JSC::JIT::compileFastArith_op_post_dec):
  12642. (JSC::JIT::compileFastArithSlow_op_post_dec):
  12643. (JSC::JIT::compileFastArith_op_pre_inc):
  12644. (JSC::JIT::compileFastArithSlow_op_pre_inc):
  12645. (JSC::JIT::compileFastArith_op_pre_dec):
  12646. (JSC::JIT::compileFastArithSlow_op_pre_dec):
  12647. (JSC::JIT::compileBinaryArithOp):
  12648. * jit/JITInlineMethods.h:
  12649. (JSC::JIT::getConstantOperand):
  12650. (JSC::JIT::getConstantOperandImmediateInt):
  12651. (JSC::JIT::isOperandConstantImmediateInt):
  12652. (JSC::JIT::isOperandConstant31BitImmediateInt):
  12653. (JSC::JIT::emitFastArithDeTagImmediate):
  12654. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  12655. (JSC::JIT::emitFastArithReTagImmediate):
  12656. (JSC::JIT::emitFastArithImmToInt):
  12657. (JSC::JIT::emitFastArithIntToImmNoCheck):
  12658. * runtime/JSImmediate.h:
  12659. (JSC::JSImmediate::isPositiveNumber):
  12660. (JSC::JSImmediate::isNegative):
  12661. (JSC::JSImmediate::rightShiftImmediateNumbers):
  12662. (JSC::JSImmediate::canDoFastAdditiveOperations):
  12663. (JSC::JSImmediate::makeValue):
  12664. (JSC::JSImmediate::makeInt):
  12665. (JSC::JSImmediate::makeBool):
  12666. (JSC::JSImmediate::intValue):
  12667. (JSC::JSImmediate::rawValue):
  12668. (JSC::JSImmediate::toBoolean):
  12669. (JSC::JSImmediate::from):
  12670. * wtf/Platform.h:
  12671. 2008-12-31 Oliver Hunt <oliver@apple.com>
  12672. Reviewed by Cameron Zwarich.
  12673. [jsfunfuzz] Assertion + incorrect behaviour with dynamically created local variable in a catch block
  12674. <https://bugs.webkit.org/show_bug.cgi?id=23063>
  12675. Eval inside a catch block attempts to use the catch block's static scope in
  12676. an unsafe way by attempting to add new properties to the scope. This patch
  12677. fixes this issue simply by preventing the catch block from using a static
  12678. scope if it contains an eval.
  12679. * parser/Grammar.y:
  12680. * parser/Nodes.cpp:
  12681. (JSC::TryNode::emitBytecode):
  12682. * parser/Nodes.h:
  12683. (JSC::TryNode::):
  12684. 2008-12-31 Oliver Hunt <oliver@apple.com>
  12685. Reviewed by Gavin Barraclough.
  12686. [jsfunfuzz] Computed exception offset wrong when first instruction is attempt to resolve deleted eval
  12687. <https://bugs.webkit.org/show_bug.cgi?id=23062>
  12688. This was caused by the expression information for the initial resolve of
  12689. eval not being emitted. If this resolve was the first instruction that
  12690. could throw an exception the information search would fail leading to an
  12691. assertion failure. If it was not the first throwable opcode the wrong
  12692. expression information would used.
  12693. Fix is simply to emit the expression info.
  12694. * parser/Nodes.cpp:
  12695. (JSC::EvalFunctionCallNode::emitBytecode):
  12696. 2008-12-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12697. Reviewed by Oliver Hunt.
  12698. Bug 23054: Caching of global lookups occurs even when the global object has become a dictionary
  12699. <https://bugs.webkit.org/show_bug.cgi?id=23054>
  12700. <rdar://problem/6469905>
  12701. * interpreter/Interpreter.cpp:
  12702. (JSC::Interpreter::resolveGlobal): Do not cache lookup if the global
  12703. object has transitioned to a dictionary.
  12704. (JSC::Interpreter::cti_op_resolve_global): Do not cache lookup if the
  12705. global object has transitioned to a dictionary.
  12706. 2008-12-30 Oliver Hunt <oliver@apple.com>
  12707. Reviewed by Darin Adler.
  12708. <https://bugs.webkit.org/show_bug.cgi?id=23049> [jsfunfuzz] With blocks do not correctly protect their scope object
  12709. <rdar://problem/6469742> Crash in JSC::TypeInfo::hasStandardGetOwnPropertySlot() running jsfunfuzz
  12710. The problem that caused this was that with nodes were not correctly protecting
  12711. the final object that was placed in the scope chain. We correct this by forcing
  12712. the use of a temporary register (which stops us relying on a local register
  12713. protecting the scope) and changing the behaviour of op_push_scope so that it
  12714. will store the final scope object.
  12715. * bytecompiler/BytecodeGenerator.cpp:
  12716. (JSC::BytecodeGenerator::emitPushScope):
  12717. * interpreter/Interpreter.cpp:
  12718. (JSC::Interpreter::privateExecute):
  12719. (JSC::Interpreter::cti_op_push_scope):
  12720. * interpreter/Interpreter.h:
  12721. * jit/JIT.cpp:
  12722. (JSC::JIT::privateCompileMainPass):
  12723. * parser/Nodes.cpp:
  12724. (JSC::WithNode::emitBytecode):
  12725. 2008-12-30 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12726. Reviewed by Sam Weinig.
  12727. Bug 23037: Parsing and reparsing disagree on automatic semicolon insertion
  12728. <https://bugs.webkit.org/show_bug.cgi?id=23037>
  12729. <rdar://problem/6467124>
  12730. Parsing and reparsing disagree about automatic semicolon insertion, so that a
  12731. function like
  12732. function() { a = 1, }
  12733. is parsed as being syntactically valid but gets a syntax error upon reparsing.
  12734. This leads to an assertion failure in Parser::reparse(). It is not that big of
  12735. an issue in practice, because in a Release build such a function will return
  12736. 'undefined' when called.
  12737. In this case, we are not following the spec and it should be a syntax error.
  12738. However, unless there is a newline separating the ',' and the '}', WebKit would
  12739. not treat it as a syntax error in the past either. It would be a bit of work to
  12740. make the automatic semicolon insertion match the spec exactly, so this patch
  12741. changes it to match our past behaviour.
  12742. The problem is that even during reparsing, the Lexer adds a semicolon at the
  12743. end of the input, which confuses allowAutomaticSemicolon(), because it is
  12744. expecting either a '}', the end of input, or a terminator like a newline.
  12745. * parser/Lexer.cpp:
  12746. (JSC::Lexer::Lexer): Initialize m_isReparsing to false.
  12747. (JSC::Lexer::lex): Do not perform automatic semicolon insertion in the Lexer if
  12748. we are in the middle of reparsing.
  12749. (JSC::Lexer::clear): Set m_isReparsing to false.
  12750. * parser/Lexer.h:
  12751. (JSC::Lexer::setIsReparsing): Added.
  12752. * parser/Parser.cpp:
  12753. (JSC::Parser::reparse): Call Lexer::setIsReparsing() to notify the Lexer of
  12754. reparsing.
  12755. 2008-12-29 Oliver Hunt <oliver@apple.com>
  12756. Reviewed by NOBODY (Build fix).
  12757. Yet another attempt to fix Tiger.
  12758. * wtf/RandomNumber.cpp:
  12759. (WTF::randomNumber):
  12760. 2008-12-29 Oliver Hunt <oliver@apple.com>
  12761. Reviewed by NOBODY (Build fix).
  12762. Tiger build fix (correct this time)
  12763. * wtf/RandomNumber.cpp:
  12764. 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12765. Rubber-stamped by Alexey Proskuryakov.
  12766. Revert r39509, because kjsyydebug is used in the generated code if YYDEBUG is 1.
  12767. * parser/Grammar.y:
  12768. 2008-12-29 Oliver Hunt <oliver@apple.com>
  12769. Reviewed by NOBODY (Build fix).
  12770. Tiger build fix.
  12771. * wtf/RandomNumber.cpp:
  12772. 2008-12-29 Oliver Hunt <oliver@apple.com>
  12773. Reviewed by Mark Rowe.
  12774. <rdar://problem/6358108> Insecure randomness in Math.random() leads to user tracking
  12775. Switch to arc4random on PLATFORM(DARWIN), this is ~1.5x slower than random(), but the
  12776. it is still so fast that there is no fathomable way it could be a bottleneck for anything.
  12777. randomNumber is called in two places
  12778. * During form submission where it is called once per form
  12779. * Math.random in JSC. For this difference to show up you have to be looping on
  12780. a cached local copy of random, for a large (>10000) calls.
  12781. No change in SunSpider.
  12782. * wtf/RandomNumber.cpp:
  12783. (WTF::randomNumber):
  12784. * wtf/RandomNumberSeed.h:
  12785. (WTF::initializeRandomNumberGenerator):
  12786. 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12787. Rubber-stamped by Sam Weinig.
  12788. Remove unused kjsyydebug #define.
  12789. * parser/Grammar.y:
  12790. 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12791. Reviewed by Oliver Hunt and Sam Weinig.
  12792. Bug 23029: REGRESSION (r39337): jsfunfuzz generates identical test files
  12793. <https://bugs.webkit.org/show_bug.cgi?id=23029>
  12794. <rdar://problem/6469185>
  12795. The unification of random number generation in r39337 resulted in random()
  12796. being initialized on Darwin, but rand() actually being used. Fix this by
  12797. making randomNumber() use random() instead of rand() on Darwin.
  12798. * wtf/RandomNumber.cpp:
  12799. (WTF::randomNumber):
  12800. 2008-12-29 Sam Weinig <sam@webkit.org>
  12801. Fix buildbots.
  12802. * runtime/Structure.cpp:
  12803. 2008-12-29 Sam Weinig <sam@webkit.org>
  12804. Reviewed by Oliver Hunt.
  12805. Patch for https://bugs.webkit.org/show_bug.cgi?id=23026
  12806. Move the deleted offsets vector into the PropertyMap
  12807. Saves 3 words per Structure.
  12808. * runtime/PropertyMapHashTable.h:
  12809. * runtime/Structure.cpp:
  12810. (JSC::Structure::addPropertyTransition):
  12811. (JSC::Structure::changePrototypeTransition):
  12812. (JSC::Structure::getterSetterTransition):
  12813. (JSC::Structure::toDictionaryTransition):
  12814. (JSC::Structure::fromDictionaryTransition):
  12815. (JSC::Structure::copyPropertyTable):
  12816. (JSC::Structure::put):
  12817. (JSC::Structure::remove):
  12818. (JSC::Structure::rehashPropertyMapHashTable):
  12819. * runtime/Structure.h:
  12820. (JSC::Structure::propertyStorageSize):
  12821. 2008-12-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12822. Reviewed by Oliver Hunt.
  12823. Change code using m_body.get() as a boolean to take advantage of the
  12824. implicit conversion of RefPtr to boolean.
  12825. * runtime/JSFunction.cpp:
  12826. (JSC::JSFunction::~JSFunction):
  12827. 2008-12-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  12828. Reviewed by Oliver Hunt.
  12829. Bug 22840: REGRESSION (r38349): Gmail doesn't load with profiling enabled
  12830. <https://bugs.webkit.org/show_bug.cgi?id=22840>
  12831. <rdar://problem/6468077>
  12832. * bytecompiler/BytecodeGenerator.cpp:
  12833. (JSC::BytecodeGenerator::emitNewArray): Add an assertion that the range
  12834. of registers passed to op_new_array is sequential.
  12835. (JSC::BytecodeGenerator::emitCall): Correct the relocation of registers
  12836. when emitting profiler hooks so that registers aren't leaked. Also, add
  12837. an assertion that the 'this' register is always ref'd (because it is),
  12838. remove the needless protection of the 'this' register when relocating,
  12839. and add an assertion that the range of registers passed to op_call for
  12840. function call arguments is sequential.
  12841. (JSC::BytecodeGenerator::emitConstruct): Correct the relocation of
  12842. registers when emitting profiler hooks so that registers aren't leaked.
  12843. Also, add an assertion that the range of registers passed to op_construct
  12844. for function call arguments is sequential.
  12845. 2008-12-26 Mark Rowe <mrowe@apple.com>
  12846. Reviewed by Alexey Proskuryakov.
  12847. <rdar://problem/6467376> Race condition in WTF::currentThread can lead to a thread using two different identifiers during its lifetime
  12848. If a newly-created thread calls WTF::currentThread() before WTF::createThread calls establishIdentifierForPthreadHandle
  12849. then more than one identifier will be used for the same thread. We can avoid this by adding some extra synchronization
  12850. during thread creation that delays the execution of the thread function until the thread identifier has been set up, and
  12851. an assertion to catch this problem should it reappear in the future.
  12852. * wtf/Threading.cpp: Added.
  12853. (WTF::NewThreadContext::NewThreadContext):
  12854. (WTF::threadEntryPoint):
  12855. (WTF::createThread): Add cross-platform createThread function that delays the execution of the thread function until
  12856. after the thread identifier has been set up.
  12857. * wtf/Threading.h:
  12858. * wtf/ThreadingGtk.cpp:
  12859. (WTF::establishIdentifierForThread):
  12860. (WTF::createThreadInternal):
  12861. * wtf/ThreadingNone.cpp:
  12862. (WTF::createThreadInternal):
  12863. * wtf/ThreadingPthreads.cpp:
  12864. (WTF::establishIdentifierForPthreadHandle):
  12865. (WTF::createThreadInternal):
  12866. * wtf/ThreadingQt.cpp:
  12867. (WTF::identifierByQthreadHandle):
  12868. (WTF::establishIdentifierForThread):
  12869. (WTF::createThreadInternal):
  12870. * wtf/ThreadingWin.cpp:
  12871. (WTF::storeThreadHandleByIdentifier):
  12872. (WTF::createThreadInternal):
  12873. Add Threading.cpp to the build.
  12874. * GNUmakefile.am:
  12875. * JavaScriptCore.pri:
  12876. * JavaScriptCore.scons:
  12877. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  12878. * JavaScriptCore.xcodeproj/project.pbxproj:
  12879. * JavaScriptCoreSources.bkl:
  12880. 2008-12-26 Sam Weinig <sam@webkit.org>
  12881. Reviewed by Alexey Proskuryakov.
  12882. Remove unused method.
  12883. * runtime/Structure.h: Remove mutableTypeInfo.
  12884. 2008-12-22 Gavin Barraclough <barraclough@apple.com>
  12885. Reviewed by Oliver Hunt.
  12886. Fix rounding / bounds / signed comparison bug in ExecutableAllocator.
  12887. ExecutableAllocator::alloc assumed that m_freePtr would be aligned. This was
  12888. not always true, since the first allocation from an additional pool would not
  12889. be rounded up. Subsequent allocations would be unaligned, and too much memory
  12890. could be erroneously allocated from the pool, when the size requested was
  12891. available, but the size rounded up to word granularity was not available in the
  12892. pool. This may result in the value of m_freePtr being greater than m_end.
  12893. Under these circumstances, the unsigned check for space will always pass,
  12894. resulting in pointers to memory outside of the arena being returned, and
  12895. ultimately segfaulty goodness when attempting to memcpy the hot freshly jitted
  12896. code from the AssemblerBuffer.
  12897. https://bugs.webkit.org/show_bug.cgi?id=22974
  12898. ... and probably many, many more.
  12899. * jit/ExecutableAllocator.h:
  12900. (JSC::ExecutablePool::alloc):
  12901. (JSC::ExecutablePool::roundUpAllocationSize):
  12902. (JSC::ExecutablePool::ExecutablePool):
  12903. (JSC::ExecutablePool::poolAllocate):
  12904. 2008-12-22 Sam Weinig <sam@webkit.org>
  12905. Reviewed by Gavin Barraclough.
  12906. Rename all uses of the term "repatch" to "patch".
  12907. * assembler/MacroAssembler.h:
  12908. (JSC::MacroAssembler::DataLabelPtr::patch):
  12909. (JSC::MacroAssembler::DataLabel32::patch):
  12910. (JSC::MacroAssembler::Jump::patch):
  12911. (JSC::MacroAssembler::PatchBuffer::PatchBuffer):
  12912. (JSC::MacroAssembler::PatchBuffer::setPtr):
  12913. (JSC::MacroAssembler::loadPtrWithAddressOffsetPatch):
  12914. (JSC::MacroAssembler::storePtrWithAddressOffsetPatch):
  12915. (JSC::MacroAssembler::storePtrWithPatch):
  12916. (JSC::MacroAssembler::jnePtrWithPatch):
  12917. * assembler/X86Assembler.h:
  12918. (JSC::X86Assembler::patchAddress):
  12919. (JSC::X86Assembler::patchImmediate):
  12920. (JSC::X86Assembler::patchPointer):
  12921. (JSC::X86Assembler::patchBranchOffset):
  12922. * interpreter/Interpreter.cpp:
  12923. (JSC::Interpreter::tryCTICachePutByID):
  12924. (JSC::Interpreter::tryCTICacheGetByID):
  12925. (JSC::Interpreter::cti_op_put_by_id):
  12926. (JSC::Interpreter::cti_op_get_by_id):
  12927. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  12928. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  12929. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  12930. * jit/JIT.cpp:
  12931. (JSC::ctiPatchCallByReturnAddress):
  12932. (JSC::JIT::privateCompileMainPass):
  12933. (JSC::JIT::privateCompile):
  12934. (JSC::JIT::privateCompileCTIMachineTrampolines):
  12935. * jit/JIT.h:
  12936. * jit/JITCall.cpp:
  12937. (JSC::JIT::unlinkCall):
  12938. (JSC::JIT::linkCall):
  12939. (JSC::JIT::compileOpCall):
  12940. * jit/JITPropertyAccess.cpp:
  12941. (JSC::JIT::compileGetByIdHotPath):
  12942. (JSC::JIT::compilePutByIdHotPath):
  12943. (JSC::JIT::compileGetByIdSlowCase):
  12944. (JSC::JIT::compilePutByIdSlowCase):
  12945. (JSC::JIT::privateCompilePutByIdTransition):
  12946. (JSC::JIT::patchGetByIdSelf):
  12947. (JSC::JIT::patchPutByIdReplace):
  12948. (JSC::JIT::privateCompilePatchGetArrayLength):
  12949. (JSC::JIT::privateCompileGetByIdSelf):
  12950. (JSC::JIT::privateCompileGetByIdProto):
  12951. (JSC::JIT::privateCompileGetByIdSelfList):
  12952. (JSC::JIT::privateCompileGetByIdProtoList):
  12953. (JSC::JIT::privateCompileGetByIdChainList):
  12954. (JSC::JIT::privateCompileGetByIdChain):
  12955. (JSC::JIT::privateCompilePutByIdReplace):
  12956. 2008-12-22 Adam Roben <aroben@apple.com>
  12957. Build fix after r39428
  12958. * jit/JITCall.cpp:
  12959. (JSC::JIT::compileOpCallSlowCase): Added a missing MacroAssembler::
  12960. 2008-12-22 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
  12961. Rubber-stamped by George Staikos.
  12962. Unify all TorchMobile copyright lines. Consolidate in a single line, as requested by Mark Rowe, some time ago.
  12963. * wtf/RandomNumber.cpp:
  12964. * wtf/RandomNumber.h:
  12965. * wtf/RandomNumberSeed.h:
  12966. 2008-12-21 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
  12967. Rubber-stamped by George Staikos.
  12968. Fix copyright of the new RandomNumber* files.
  12969. * wtf/RandomNumber.cpp:
  12970. * wtf/RandomNumber.h:
  12971. * wtf/RandomNumberSeed.h:
  12972. 2008-12-21 Gavin Barraclough <barraclough@apple.com>
  12973. Reviewed by Oliver Hunt & Cameron Zwarich.
  12974. Add support for call and property access repatching on x86-64.
  12975. No change in performance on current configurations (2x impovement on v8-tests with JIT enabled on x86-64).
  12976. * assembler/MacroAssembler.h:
  12977. (JSC::MacroAssembler::DataLabelPtr::repatch):
  12978. (JSC::MacroAssembler::DataLabelPtr::operator X86Assembler::JmpDst):
  12979. (JSC::MacroAssembler::DataLabel32::repatch):
  12980. (JSC::MacroAssembler::RepatchBuffer::addressOf):
  12981. (JSC::MacroAssembler::add32):
  12982. (JSC::MacroAssembler::sub32):
  12983. (JSC::MacroAssembler::loadPtrWithAddressOffsetRepatch):
  12984. (JSC::MacroAssembler::storePtrWithAddressOffsetRepatch):
  12985. (JSC::MacroAssembler::jePtr):
  12986. (JSC::MacroAssembler::jnePtr):
  12987. (JSC::MacroAssembler::jnePtrWithRepatch):
  12988. (JSC::MacroAssembler::differenceBetween):
  12989. * assembler/X86Assembler.h:
  12990. (JSC::X86Assembler::addl_im):
  12991. (JSC::X86Assembler::subl_im):
  12992. (JSC::X86Assembler::cmpl_rm):
  12993. (JSC::X86Assembler::movq_rm_disp32):
  12994. (JSC::X86Assembler::movq_mr_disp32):
  12995. (JSC::X86Assembler::repatchPointer):
  12996. (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64_disp32):
  12997. * jit/JIT.cpp:
  12998. (JSC::JIT::privateCompile):
  12999. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13000. * jit/JIT.h:
  13001. * jit/JITCall.cpp:
  13002. (JSC::JIT::unlinkCall):
  13003. (JSC::JIT::linkCall):
  13004. (JSC::JIT::compileOpCall):
  13005. (JSC::JIT::compileOpCallSlowCase):
  13006. * jit/JITInlineMethods.h:
  13007. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  13008. * jit/JITPropertyAccess.cpp:
  13009. (JSC::JIT::compileGetByIdHotPath):
  13010. (JSC::JIT::compileGetByIdSlowCase):
  13011. (JSC::JIT::compilePutByIdHotPath):
  13012. (JSC::JIT::compilePutByIdSlowCase):
  13013. (JSC::resizePropertyStorage):
  13014. (JSC::JIT::privateCompilePutByIdTransition):
  13015. (JSC::JIT::privateCompileGetByIdProto):
  13016. (JSC::JIT::privateCompileGetByIdProtoList):
  13017. (JSC::JIT::privateCompileGetByIdChainList):
  13018. (JSC::JIT::privateCompileGetByIdChain):
  13019. * wtf/Platform.h:
  13020. 2008-12-20 Gavin Barraclough <barraclough@apple.com>
  13021. Reviewed by Oliver Hunt.
  13022. Port optimized property access generation to the MacroAssembler.
  13023. * assembler/MacroAssembler.h:
  13024. (JSC::MacroAssembler::AbsoluteAddress::AbsoluteAddress):
  13025. (JSC::MacroAssembler::DataLabelPtr::repatch):
  13026. (JSC::MacroAssembler::DataLabel32::DataLabel32):
  13027. (JSC::MacroAssembler::DataLabel32::repatch):
  13028. (JSC::MacroAssembler::Label::operator X86Assembler::JmpDst):
  13029. (JSC::MacroAssembler::Jump::repatch):
  13030. (JSC::MacroAssembler::JumpList::empty):
  13031. (JSC::MacroAssembler::RepatchBuffer::link):
  13032. (JSC::MacroAssembler::add32):
  13033. (JSC::MacroAssembler::and32):
  13034. (JSC::MacroAssembler::sub32):
  13035. (JSC::MacroAssembler::loadPtrWithAddressRepatch):
  13036. (JSC::MacroAssembler::storePtrWithAddressRepatch):
  13037. (JSC::MacroAssembler::push):
  13038. (JSC::MacroAssembler::ja32):
  13039. (JSC::MacroAssembler::jePtr):
  13040. (JSC::MacroAssembler::jnePtr):
  13041. (JSC::MacroAssembler::jnePtrWithRepatch):
  13042. (JSC::MacroAssembler::align):
  13043. (JSC::MacroAssembler::differenceBetween):
  13044. * assembler/X86Assembler.h:
  13045. (JSC::X86Assembler::movl_rm_disp32):
  13046. (JSC::X86Assembler::movl_mr_disp32):
  13047. (JSC::X86Assembler::X86InstructionFormatter::oneByteOp_disp32):
  13048. (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
  13049. * jit/JIT.cpp:
  13050. (JSC::ctiRepatchCallByReturnAddress):
  13051. (JSC::JIT::privateCompileMainPass):
  13052. (JSC::JIT::privateCompile):
  13053. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13054. * jit/JIT.h:
  13055. * jit/JITPropertyAccess.cpp:
  13056. (JSC::JIT::compileGetByIdHotPath):
  13057. (JSC::JIT::compileGetByIdSlowCase):
  13058. (JSC::JIT::compilePutByIdHotPath):
  13059. (JSC::JIT::compilePutByIdSlowCase):
  13060. (JSC::resizePropertyStorage):
  13061. (JSC::JIT::privateCompilePutByIdTransition):
  13062. (JSC::JIT::patchGetByIdSelf):
  13063. (JSC::JIT::patchPutByIdReplace):
  13064. (JSC::JIT::privateCompilePatchGetArrayLength):
  13065. (JSC::JIT::privateCompileGetByIdSelf):
  13066. (JSC::JIT::privateCompileGetByIdProto):
  13067. (JSC::JIT::privateCompileGetByIdSelfList):
  13068. (JSC::JIT::privateCompileGetByIdProtoList):
  13069. (JSC::JIT::privateCompileGetByIdChainList):
  13070. (JSC::JIT::privateCompileGetByIdChain):
  13071. (JSC::JIT::privateCompilePutByIdReplace):
  13072. * wtf/RefCounted.h:
  13073. (WTF::RefCountedBase::addressOfCount):
  13074. 2008-12-19 Gustavo Noronha Silva <gns@gnome.org>
  13075. Reviewed by Holger Freyther.
  13076. https://bugs.webkit.org/show_bug.cgi?id=22686
  13077. Added file which was missing to the javascriptcore_sources
  13078. variable, so that it shows up in the tarball created by `make
  13079. dist'.
  13080. * GNUmakefile.am:
  13081. 2008-12-19 Holger Hans Peter Freyther <zecke@selfish.org>
  13082. Reviewed by Antti Koivisto.
  13083. Build fix when building JS API tests with a c89 c compiler
  13084. Do not use C++ style comments and convert them to C comments.
  13085. * wtf/Platform.h:
  13086. 2008-12-18 Gavin Barraclough <barraclough@apple.com>
  13087. Reviewed by Sam Weinig.
  13088. Same as last revision, adding cases for pre & post inc & dec.
  13089. https://bugs.webkit.org/show_bug.cgi?id=22928
  13090. * jit/JIT.cpp:
  13091. (JSC::JIT::privateCompileMainPass):
  13092. 2008-12-18 Gavin Barraclough <barraclough@apple.com>
  13093. Reviewed by Sam Weinig.
  13094. Fixes for the JIT's handling of JSImmediate values on x86-64.
  13095. On 64-bit systems, the code in JSImmediate.h relies on the upper
  13096. bits of a JSImmediate being a sign extension of the low 32-bits.
  13097. This was not being enforced by the JIT, since a number of inline
  13098. operations were being performed on 32-bit values in registers, and
  13099. when a 32-bit result is written to a register on x86-64 the value
  13100. is zero-extended to 64-bits.
  13101. This fix honors previous behavoir. A better fix in the long run
  13102. (when the JIT is enabled by default) may be to change JSImmediate.h
  13103. so it no longer relies on the upper bits of the pointer,... though
  13104. if we're going to change JSImmediate.h for 64-bit, we probably may
  13105. as well change the format so that the full range of 32-bit ints can
  13106. be stored, rather than just 31-bits.
  13107. https://bugs.webkit.org/show_bug.cgi?id=22925
  13108. * assembler/MacroAssembler.h:
  13109. (JSC::MacroAssembler::addPtr):
  13110. (JSC::MacroAssembler::andPtr):
  13111. (JSC::MacroAssembler::orPtr):
  13112. (JSC::MacroAssembler::or32):
  13113. (JSC::MacroAssembler::xor32):
  13114. (JSC::MacroAssembler::xorPtr):
  13115. (JSC::MacroAssembler::signExtend32ToPtr):
  13116. * assembler/X86Assembler.h:
  13117. (JSC::X86Assembler::):
  13118. (JSC::X86Assembler::andq_rr):
  13119. (JSC::X86Assembler::andq_ir):
  13120. (JSC::X86Assembler::orq_rr):
  13121. (JSC::X86Assembler::xorq_ir):
  13122. (JSC::X86Assembler::movsxd_rr):
  13123. * jit/JIT.cpp:
  13124. (JSC::JIT::privateCompileMainPass):
  13125. * jit/JITInlineMethods.h:
  13126. (JSC::JIT::emitFastArithReTagImmediate):
  13127. (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
  13128. (JSC::JIT::emitFastArithImmToInt):
  13129. 2008-12-18 Gavin Barraclough <barraclough@apple.com>
  13130. Reviewed by Sam Weinig.
  13131. Just a tidy up - rename & refactor some the #defines configuring the JIT.
  13132. * interpreter/Interpreter.cpp:
  13133. (JSC::Interpreter::cti_op_convert_this):
  13134. (JSC::Interpreter::cti_op_end):
  13135. (JSC::Interpreter::cti_op_add):
  13136. (JSC::Interpreter::cti_op_pre_inc):
  13137. (JSC::Interpreter::cti_timeout_check):
  13138. (JSC::Interpreter::cti_register_file_check):
  13139. (JSC::Interpreter::cti_op_loop_if_less):
  13140. (JSC::Interpreter::cti_op_loop_if_lesseq):
  13141. (JSC::Interpreter::cti_op_new_object):
  13142. (JSC::Interpreter::cti_op_put_by_id_generic):
  13143. (JSC::Interpreter::cti_op_get_by_id_generic):
  13144. (JSC::Interpreter::cti_op_put_by_id):
  13145. (JSC::Interpreter::cti_op_put_by_id_second):
  13146. (JSC::Interpreter::cti_op_put_by_id_fail):
  13147. (JSC::Interpreter::cti_op_get_by_id):
  13148. (JSC::Interpreter::cti_op_get_by_id_second):
  13149. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  13150. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  13151. (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
  13152. (JSC::Interpreter::cti_op_get_by_id_proto_fail):
  13153. (JSC::Interpreter::cti_op_get_by_id_array_fail):
  13154. (JSC::Interpreter::cti_op_get_by_id_string_fail):
  13155. (JSC::Interpreter::cti_op_instanceof):
  13156. (JSC::Interpreter::cti_op_del_by_id):
  13157. (JSC::Interpreter::cti_op_mul):
  13158. (JSC::Interpreter::cti_op_new_func):
  13159. (JSC::Interpreter::cti_op_call_JSFunction):
  13160. (JSC::Interpreter::cti_op_call_arityCheck):
  13161. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  13162. (JSC::Interpreter::cti_vm_lazyLinkCall):
  13163. (JSC::Interpreter::cti_op_push_activation):
  13164. (JSC::Interpreter::cti_op_call_NotJSFunction):
  13165. (JSC::Interpreter::cti_op_create_arguments):
  13166. (JSC::Interpreter::cti_op_create_arguments_no_params):
  13167. (JSC::Interpreter::cti_op_tear_off_activation):
  13168. (JSC::Interpreter::cti_op_tear_off_arguments):
  13169. (JSC::Interpreter::cti_op_profile_will_call):
  13170. (JSC::Interpreter::cti_op_profile_did_call):
  13171. (JSC::Interpreter::cti_op_ret_scopeChain):
  13172. (JSC::Interpreter::cti_op_new_array):
  13173. (JSC::Interpreter::cti_op_resolve):
  13174. (JSC::Interpreter::cti_op_construct_JSConstruct):
  13175. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  13176. (JSC::Interpreter::cti_op_get_by_val):
  13177. (JSC::Interpreter::cti_op_resolve_func):
  13178. (JSC::Interpreter::cti_op_sub):
  13179. (JSC::Interpreter::cti_op_put_by_val):
  13180. (JSC::Interpreter::cti_op_put_by_val_array):
  13181. (JSC::Interpreter::cti_op_lesseq):
  13182. (JSC::Interpreter::cti_op_loop_if_true):
  13183. (JSC::Interpreter::cti_op_negate):
  13184. (JSC::Interpreter::cti_op_resolve_base):
  13185. (JSC::Interpreter::cti_op_resolve_skip):
  13186. (JSC::Interpreter::cti_op_resolve_global):
  13187. (JSC::Interpreter::cti_op_div):
  13188. (JSC::Interpreter::cti_op_pre_dec):
  13189. (JSC::Interpreter::cti_op_jless):
  13190. (JSC::Interpreter::cti_op_not):
  13191. (JSC::Interpreter::cti_op_jtrue):
  13192. (JSC::Interpreter::cti_op_post_inc):
  13193. (JSC::Interpreter::cti_op_eq):
  13194. (JSC::Interpreter::cti_op_lshift):
  13195. (JSC::Interpreter::cti_op_bitand):
  13196. (JSC::Interpreter::cti_op_rshift):
  13197. (JSC::Interpreter::cti_op_bitnot):
  13198. (JSC::Interpreter::cti_op_resolve_with_base):
  13199. (JSC::Interpreter::cti_op_new_func_exp):
  13200. (JSC::Interpreter::cti_op_mod):
  13201. (JSC::Interpreter::cti_op_less):
  13202. (JSC::Interpreter::cti_op_neq):
  13203. (JSC::Interpreter::cti_op_post_dec):
  13204. (JSC::Interpreter::cti_op_urshift):
  13205. (JSC::Interpreter::cti_op_bitxor):
  13206. (JSC::Interpreter::cti_op_new_regexp):
  13207. (JSC::Interpreter::cti_op_bitor):
  13208. (JSC::Interpreter::cti_op_call_eval):
  13209. (JSC::Interpreter::cti_op_throw):
  13210. (JSC::Interpreter::cti_op_get_pnames):
  13211. (JSC::Interpreter::cti_op_next_pname):
  13212. (JSC::Interpreter::cti_op_push_scope):
  13213. (JSC::Interpreter::cti_op_pop_scope):
  13214. (JSC::Interpreter::cti_op_typeof):
  13215. (JSC::Interpreter::cti_op_is_undefined):
  13216. (JSC::Interpreter::cti_op_is_boolean):
  13217. (JSC::Interpreter::cti_op_is_number):
  13218. (JSC::Interpreter::cti_op_is_string):
  13219. (JSC::Interpreter::cti_op_is_object):
  13220. (JSC::Interpreter::cti_op_is_function):
  13221. (JSC::Interpreter::cti_op_stricteq):
  13222. (JSC::Interpreter::cti_op_nstricteq):
  13223. (JSC::Interpreter::cti_op_to_jsnumber):
  13224. (JSC::Interpreter::cti_op_in):
  13225. (JSC::Interpreter::cti_op_push_new_scope):
  13226. (JSC::Interpreter::cti_op_jmp_scopes):
  13227. (JSC::Interpreter::cti_op_put_by_index):
  13228. (JSC::Interpreter::cti_op_switch_imm):
  13229. (JSC::Interpreter::cti_op_switch_char):
  13230. (JSC::Interpreter::cti_op_switch_string):
  13231. (JSC::Interpreter::cti_op_del_by_val):
  13232. (JSC::Interpreter::cti_op_put_getter):
  13233. (JSC::Interpreter::cti_op_put_setter):
  13234. (JSC::Interpreter::cti_op_new_error):
  13235. (JSC::Interpreter::cti_op_debug):
  13236. (JSC::Interpreter::cti_vm_throw):
  13237. * interpreter/Interpreter.h:
  13238. * jit/JIT.cpp:
  13239. (JSC::):
  13240. (JSC::JIT::privateCompileMainPass):
  13241. (JSC::JIT::privateCompile):
  13242. * jit/JIT.h:
  13243. * jit/JITInlineMethods.h:
  13244. (JSC::JIT::restoreArgumentReference):
  13245. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  13246. * wtf/Platform.h:
  13247. 2008-12-18 Cameron Zwarich <zwarich@apple.com>
  13248. Reviewed by Geoff Garen.
  13249. Bug 21855: REGRESSION (r37323): Gmail complains about popup blocking when opening a link
  13250. <https://bugs.webkit.org/show_bug.cgi?id=21855>
  13251. <rdar://problem/6278244>
  13252. Move DynamicGlobalObjectScope to JSGlobalObject.h so that it can be used
  13253. from WebCore.
  13254. * interpreter/Interpreter.cpp:
  13255. * runtime/JSGlobalObject.h:
  13256. (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
  13257. (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
  13258. 2008-12-17 Geoffrey Garen <ggaren@apple.com>
  13259. Reviewed by Gavin Barraclough.
  13260. Fixed https://bugs.webkit.org/show_bug.cgi?id=22393
  13261. Segfault when caching property accesses to primitive cells.
  13262. Changed some asObject casts to asCell casts in cases where a primitive
  13263. value may be a cell and not an object.
  13264. Re-enabled property caching for primitives in cases where it had been
  13265. disabled because of this bug.
  13266. Updated a comment to better explain something Darin thought needed
  13267. explaining in an old patch review.
  13268. * interpreter/Interpreter.cpp:
  13269. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  13270. (JSC::Interpreter::tryCacheGetByID):
  13271. (JSC::Interpreter::tryCTICacheGetByID):
  13272. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  13273. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  13274. 2008-12-17 Gavin Barraclough <barraclough@apple.com>
  13275. Reviewed by Cameron Zwarich.
  13276. Fixes for Sunspider failures with the JIT enabled on x86-64.
  13277. * assembler/MacroAssembler.h:
  13278. Switch the order of the RegisterID & Address form of je32, to keep it consistent with jne32.
  13279. * jit/JIT.cpp:
  13280. * jit/JIT.h:
  13281. * jit/JITInlineMethods.h:
  13282. Port the m_ctiVirtualCall tramopline generation to use the MacroAssembler interface.
  13283. * jit/JITCall.cpp:
  13284. Fix bug in the non-optimizing code path, vptr check should have been to the memory address pointer
  13285. to by the register, not to the register itself.
  13286. * wrec/WRECGenerator.cpp:
  13287. See assembler/MacroAssembler.h, above.
  13288. 2008-12-17 Gavin Barraclough <barraclough@apple.com>
  13289. Reviewed by Sam Weinig.
  13290. print("Hello, 64-bit jitted world!");
  13291. Get hello-world working through the JIT, on x86-64.
  13292. * assembler/X86Assembler.h:
  13293. Fix encoding of opcode + RegisterID format instructions for 64-bit.
  13294. * interpreter/Interpreter.cpp:
  13295. * interpreter/Interpreter.h:
  13296. Make VoidPtrPair actually be a pair of void*s.
  13297. (Possibly should make this change for 32-bit Mac platforms, too - but won't change 32-bit behaviour in this patch).
  13298. * jit/JIT.cpp:
  13299. * jit/JIT.h:
  13300. Provide names for the timeoutCheckRegister & callFrameRegister on x86-64,
  13301. force x86-64 ctiTrampoline arguments onto the stack,
  13302. implement the asm trampolines for x86-64,
  13303. implement the restoreArgumentReference methods for x86-64 calling conventions.
  13304. * jit/JITCall.cpp:
  13305. * jit/JITInlineMethods.h:
  13306. * wtf/Platform.h:
  13307. Add switch settings to ENABLE(JIT), on PLATFORM(X86_64) (currently still disabled).
  13308. 2008-12-17 Sam Weinig <sam@webkit.org>
  13309. Reviewed by Gavin Barraclough.
  13310. Add more CodeBlock statistics.
  13311. * bytecode/CodeBlock.cpp:
  13312. (JSC::CodeBlock::dumpStatistics):
  13313. 2008-12-17 Sam Weinig <sam@webkit.org>
  13314. Reviewed by Darin Adler.
  13315. Fix for https://bugs.webkit.org/show_bug.cgi?id=22897
  13316. <rdar://problem/6428342>
  13317. Look into feasibility of discarding bytecode after native codegen
  13318. Clear the bytecode Instruction vector at the end JIT generation.
  13319. Saves 4.8 MB on Membuster head.
  13320. * bytecode/CodeBlock.cpp:
  13321. (JSC::CodeBlock::dump): Add logging for the case that someone tries
  13322. to dump the instructions of a CodeBlock that has had its bytecode
  13323. vector cleared.
  13324. (JSC::CodeBlock::CodeBlock): Initialize the instructionCount
  13325. (JSC::CodeBlock::handlerForBytecodeOffset): Use instructionCount instead
  13326. of the size of the instruction vector in the assertion.
  13327. (JSC::CodeBlock::lineNumberForBytecodeOffset): Ditto.
  13328. (JSC::CodeBlock::expressionRangeForBytecodeOffset): Ditto.
  13329. (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset): Ditto.
  13330. (JSC::CodeBlock::functionRegisterForBytecodeOffset): Ditto.
  13331. * bytecode/CodeBlock.h:
  13332. (JSC::CodeBlock::setInstructionCount): Store the instruction vector size
  13333. in debug builds for assertions.
  13334. * bytecompiler/BytecodeGenerator.cpp:
  13335. (JSC::BytecodeGenerator::generate):
  13336. * jit/JIT.cpp:
  13337. (JSC::JIT::privateCompile): Clear the bytecode vector unless we
  13338. have compiled with Opcode sampling where we will continue to require it
  13339. 2008-12-17 Cary Clark <caryclark@google.com>
  13340. Reviewed by Darin Adler.
  13341. Landed by Adam Barth.
  13342. Add ENABLE_TEXT_CARET to permit the ANDROID platform
  13343. to invalidate and draw the caret in a separate thread.
  13344. * wtf/Platform.h:
  13345. Default ENABLE_TEXT_CARET to 1.
  13346. 2008-12-17 Alexey Proskuryakov <ap@webkit.org>
  13347. Reviewed by Darin Adler.
  13348. Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard, take two.
  13349. * API/JSContextRef.cpp: The previous patch that claimed to do this was making Tiger and
  13350. Leopard always use unique context group instead.
  13351. 2008-12-16 Sam Weinig <sam@webkit.org>
  13352. Reviewed by Geoffrey Garen.
  13353. Fix for https://bugs.webkit.org/show_bug.cgi?id=22838
  13354. Remove dependency on the bytecode Instruction buffer in Interpreter::throwException
  13355. Part of <rdar://problem/6428342>
  13356. * bytecode/CodeBlock.cpp:
  13357. (JSC::CodeBlock::functionRegisterForBytecodeOffset): Added. Function to get
  13358. a function Register index in a callFrame for a bytecode offset.
  13359. (JSC::CodeBlock::shrinkToFit): Shrink m_getByIdExceptionInfo and m_functionRegisterInfos.
  13360. * bytecode/CodeBlock.h:
  13361. (JSC::FunctionRegisterInfo::FunctionRegisterInfo): Added.
  13362. (JSC::CodeBlock::addFunctionRegisterInfo):
  13363. * bytecompiler/BytecodeGenerator.cpp:
  13364. (JSC::BytecodeGenerator::emitCall):
  13365. * interpreter/Interpreter.cpp:
  13366. (JSC::Interpreter::throwException): Use functionRegisterForBytecodeOffset in JIT
  13367. mode.
  13368. 2008-12-16 Sam Weinig <sam@webkit.org>
  13369. Reviewed by Gavin Barraclough.
  13370. Fix for https://bugs.webkit.org/show_bug.cgi?id=22837
  13371. Remove dependency on the bytecode Instruction buffer in Interpreter::cti_op_call_NotJSFunction
  13372. Part of <rdar://problem/6428342>
  13373. * interpreter/CallFrame.h: Added comment regarding returnPC storing a void*.
  13374. * interpreter/Interpreter.cpp:
  13375. (JSC::bytecodeOffsetForPC): We no longer have any cases of the PC
  13376. being in the instruction stream for JIT, so we can remove the check.
  13377. (JSC::Interpreter::cti_op_call_NotJSFunction): Use the CTI_RETURN_ADDRESS
  13378. as the call frame returnPC as it is only necessary for looking up when
  13379. throwing an exception.
  13380. * interpreter/RegisterFile.h:
  13381. (JSC::RegisterFile::): Added comment regarding returnPC storing a void*.
  13382. * jit/JIT.h: Remove ARG_instr4.
  13383. * jit/JITCall.cpp:
  13384. (JSC::JIT::compileOpCallSetupArgs): Don't pass the instruction pointer.
  13385. 2008-12-16 Darin Adler <darin@apple.com>
  13386. Reviewed and landed by Cameron Zwarich.
  13387. Preparatory work for fixing
  13388. Bug 22887: Make UString::Rep use RefCounted rather than implementing its own ref counting
  13389. <https://bugs.webkit.org/show_bug.cgi?id=22887>
  13390. Change the various string translators used by Identifier:add() so that
  13391. they never zero the ref count of a newly created UString::Rep.
  13392. * runtime/Identifier.cpp:
  13393. (JSC::CStringTranslator::translate):
  13394. (JSC::Identifier::add):
  13395. (JSC::UCharBufferTranslator::translate):
  13396. 2008-12-16 Gavin Barraclough <barraclough@apple.com>
  13397. Build fix for 'doze.
  13398. * assembler/AssemblerBuffer.h:
  13399. 2008-12-16 Gavin Barraclough <barraclough@apple.com>
  13400. Reviewed by Cameron Zwarich.
  13401. Make the JIT compile on x86-64.
  13402. This largely involves populting the missing calls in MacroAssembler.h.
  13403. In addition some reinterpret_casts need removing from the JIT, and the
  13404. repatching property access code will need to be fully compiled out for
  13405. now. The changes in interpret.cpp are to reorder the functions so that
  13406. the _generic forms come before all other property access methods, and
  13407. then to place all property access methods other than the generic forms
  13408. under control of the ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS macro.
  13409. No performance impact.
  13410. * assembler/AssemblerBuffer.h:
  13411. (JSC::AssemblerBuffer::putInt64Unchecked):
  13412. * assembler/MacroAssembler.h:
  13413. (JSC::MacroAssembler::loadPtr):
  13414. (JSC::MacroAssembler::load32):
  13415. (JSC::MacroAssembler::storePtr):
  13416. (JSC::MacroAssembler::storePtrWithRepatch):
  13417. (JSC::MacroAssembler::store32):
  13418. (JSC::MacroAssembler::poke):
  13419. (JSC::MacroAssembler::move):
  13420. (JSC::MacroAssembler::testImm64):
  13421. (JSC::MacroAssembler::jePtr):
  13422. (JSC::MacroAssembler::jnePtr):
  13423. (JSC::MacroAssembler::jnzPtr):
  13424. (JSC::MacroAssembler::jzPtr):
  13425. * assembler/X86Assembler.h:
  13426. (JSC::X86Assembler::):
  13427. (JSC::X86Assembler::cmpq_rr):
  13428. (JSC::X86Assembler::cmpq_rm):
  13429. (JSC::X86Assembler::cmpq_im):
  13430. (JSC::X86Assembler::testq_i32m):
  13431. (JSC::X86Assembler::movl_mEAX):
  13432. (JSC::X86Assembler::movl_i32r):
  13433. (JSC::X86Assembler::movl_EAXm):
  13434. (JSC::X86Assembler::movq_rm):
  13435. (JSC::X86Assembler::movq_mEAX):
  13436. (JSC::X86Assembler::movq_mr):
  13437. (JSC::X86Assembler::movq_i64r):
  13438. (JSC::X86Assembler::movl_mr):
  13439. (JSC::X86Assembler::X86InstructionFormatter::oneByteOp64):
  13440. (JSC::X86Assembler::X86InstructionFormatter::immediate64):
  13441. * interpreter/Interpreter.cpp:
  13442. (JSC::Interpreter::cti_op_put_by_id_generic):
  13443. (JSC::Interpreter::cti_op_get_by_id_generic):
  13444. (JSC::Interpreter::cti_op_put_by_id):
  13445. (JSC::Interpreter::cti_op_put_by_id_second):
  13446. * jit/JIT.cpp:
  13447. (JSC::JIT::privateCompileMainPass):
  13448. (JSC::JIT::privateCompile):
  13449. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13450. * jit/JITCall.cpp:
  13451. (JSC::JIT::compileOpCallSetupArgs):
  13452. (JSC::JIT::compileOpCall):
  13453. * jit/JITPropertyAccess.cpp:
  13454. (JSC::JIT::compileGetByIdHotPath):
  13455. (JSC::JIT::compilePutByIdHotPath):
  13456. * runtime/JSImmediate.h:
  13457. (JSC::JSImmediate::makeInt):
  13458. 2008-12-16 Cameron Zwarich <zwarich@apple.com>
  13459. Reviewed by Darin Adler.
  13460. Bug 22869: REGRESSION (r38407): http://news.cnet.com/8301-13579_3-9953533-37.html crashes
  13461. <https://bugs.webkit.org/show_bug.cgi?id=22869>
  13462. <rdar://problem/6402499>
  13463. Before r38407, Structure::m_nameInPrevious was ref'd due to it being
  13464. stored in a PropertyMap. However, PropertyMaps are created lazily after
  13465. r38407, so Structure::m_nameInPrevious is not necessarily ref'd while
  13466. it is being used. Making it a RefPtr instead of a raw pointer fixes
  13467. the problem.
  13468. Unfortunately, the crash in the bug is rather intermittent, and it is
  13469. impossible to add an assertion in UString::Ref::ref() to catch this bug
  13470. because some users of UString::Rep deliberately zero out the reference
  13471. count. Therefore, there is no layout test accompanying this bug fix.
  13472. * runtime/Structure.cpp:
  13473. (JSC::Structure::~Structure): Use get().
  13474. (JSC::Structure::materializePropertyMap): Use get().
  13475. (JSC::Structure::addPropertyTransitionToExistingStructure): Use get().
  13476. (JSC::Structure::addPropertyTransition): Use get().
  13477. * runtime/Structure.h: Make Structure::m_nameInPrevious a RefPtr instead
  13478. of a raw pointer.
  13479. 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
  13480. Not reviewed. Attempt to fix win build. No 'using namespace WTF' in this file, needs manual WTF:: prefix.
  13481. Not sure why the build works as is here.
  13482. * runtime/MathObject.cpp:
  13483. (JSC::mathProtoFuncRandom):
  13484. 2008-12-16 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
  13485. Reviewed by Darin Adler.
  13486. Fixes: https://bugs.webkit.org/show_bug.cgi?id=22876
  13487. Unify random number generation in JavaScriptCore & WebCore, by introducing
  13488. wtf/RandomNumber.h and moving wtf_random/wtf_random_init out of MathExtras.h.
  13489. wtf_random_init() has been renamed to initializeRandomNumberGenerator() and
  13490. lives in it's own private header: wtf/RandomNumberSeed.h, only intended to
  13491. be used from within JavaScriptCore.
  13492. wtf_random() has been renamed to randomNumber() and lives in a public header
  13493. wtf/RandomNumber.h, usable from within JavaScriptCore & WebCore. It encapsulates
  13494. the code taking care of initializing the random number generator (only when
  13495. building without ENABLE(JSC_MULTIPLE_THREADS), otherwhise initializeThreading()
  13496. already took care of that).
  13497. Functional change on darwin: Use random() instead of rand(), as it got a larger
  13498. period (more randomness). HTMLFormElement already contains this implementation
  13499. and I just moved it in randomNumber(), as special case for PLATFORM(DARWIN).
  13500. * GNUmakefile.am: Add RandomNumber.(cpp/h) / RandomNumberSeed.h.
  13501. * JavaScriptCore.exp: Ditto.
  13502. * JavaScriptCore.pri: Ditto.
  13503. * JavaScriptCore.scons: Ditto.
  13504. * JavaScriptCore.vcproj/WTF/WTF.vcproj: Ditto.
  13505. * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  13506. * JavaScriptCoreSources.bkl: Ditto.
  13507. * runtime/MathObject.cpp: Use new WTF::randomNumber() functionality.
  13508. (JSC::mathProtoFuncRandom):
  13509. * wtf/MathExtras.h: Move wtf_random / wtf_random_init to new files.
  13510. * wtf/RandomNumber.cpp: Added.
  13511. (WTF::randomNumber):
  13512. * wtf/RandomNumber.h: Added.
  13513. * wtf/RandomNumberSeed.h: Added. Internal usage within JSC only.
  13514. (WTF::initializeRandomNumberGenerator):
  13515. * wtf/ThreadingGtk.cpp: Rename wtf_random_init() to initializeRandomNumberGenerator().
  13516. (WTF::initializeThreading):
  13517. * wtf/ThreadingPthreads.cpp: Ditto.
  13518. (WTF::initializeThreading):
  13519. * wtf/ThreadingQt.cpp: Ditto.
  13520. (WTF::initializeThreading):
  13521. * wtf/ThreadingWin.cpp: Ditto.
  13522. (WTF::initializeThreading):
  13523. 2008-12-16 Yael Aharon <yael.aharon@nokia.com>
  13524. Reviewed by Tor Arne Vestbø.
  13525. Qt/Win build fix
  13526. * JavaScriptCore.pri:
  13527. 2008-12-15 Mark Rowe <mrowe@apple.com>
  13528. Reviewed by Cameron Zwarich.
  13529. Fix the build with GCC 4.0.
  13530. * Configurations/JavaScriptCore.xcconfig: GCC 4.0 appears to have a bug when compiling with -funwind-tables on,
  13531. so don't use it with that compiler version.
  13532. 2008-12-15 Mark Rowe <mrowe@apple.com>
  13533. Rubber-stamped by Cameron Zwarich.
  13534. <rdar://problem/6289933> Change WebKit-related projects to build with GCC 4.2 on Leopard.
  13535. * Configurations/Base.xcconfig:
  13536. * Configurations/DebugRelease.xcconfig:
  13537. 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
  13538. Reviewed by Darin Adler.
  13539. Don't use unique context group in JSGlobalContextCreate() on Tiger or Leopard.
  13540. * API/JSContextRef.cpp: (JSGlobalContextCreate):
  13541. 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
  13542. Reviewed by Darin Adler.
  13543. <rdar://problem/6445089> Mach ports leak from worker threads
  13544. * interpreter/Interpreter.cpp: (JSC::getCPUTime):
  13545. Deallocate the thread self port.
  13546. 2008-12-15 Gavin Barraclough <barraclough@apple.com>
  13547. Reviewed by Mark Rowe.
  13548. Construct stack frames in JIT code, so that backtracing can still work.
  13549. <rdar://problem/6447870> JIT should play nice with attempts to take stack traces
  13550. * jit/JIT.cpp:
  13551. (JSC::):
  13552. (JSC::JIT::privateCompileMainPass):
  13553. 2008-12-15 Mark Rowe <mrowe@apple.com>
  13554. Reviewed by Gavin Barraclough.
  13555. <rdar://problem/6402262> JavaScriptCore needs exception handling tables in order to get stack traces without frame pointers
  13556. * Configurations/JavaScriptCore.xcconfig:
  13557. 2008-12-15 Gavin Barraclough <barraclough@apple.com>
  13558. Rubber stamped by Mark Rowe.
  13559. Revert r39226 / Bug 22818: Unify JIT callback argument access OS X / Windows
  13560. This causes Acid3 failures – reverting for now & will revisit later.
  13561. https://bugs.webkit.org/show_bug.cgi?id=22873
  13562. * interpreter/Interpreter.h:
  13563. * jit/JIT.cpp:
  13564. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13565. * jit/JIT.h:
  13566. * jit/JITInlineMethods.h:
  13567. (JSC::JIT::restoreArgumentReference):
  13568. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  13569. (JSC::JIT::emitCTICall_internal):
  13570. * jit/JITPropertyAccess.cpp:
  13571. (JSC::JIT::privateCompilePutByIdTransition):
  13572. * wtf/Platform.h:
  13573. 2008-12-15 Darin Adler <darin@apple.com>
  13574. Reviewed by Sam Weinig.
  13575. - fix <rdar://problem/6427048> crash due to infinite recursion after setting window.__proto__ = window
  13576. Replaced toGlobalObject with the more generally useful unwrappedObject and used it to
  13577. fix the cycle detection code in put(__proto__).
  13578. * JavaScriptCore.exp: Updated.
  13579. * runtime/JSGlobalObject.cpp: Removed toGlobalObject. We now use unwrappedObject instead.
  13580. * runtime/JSGlobalObject.h:
  13581. (JSC::JSGlobalObject::isGlobalObject): Ditto.
  13582. * runtime/JSGlobalObjectFunctions.cpp:
  13583. (JSC::globalFuncEval): Use unwrappedObject and isGlobalObject here rather than toGlobalObject.
  13584. * runtime/JSObject.cpp:
  13585. (JSC::JSObject::put): Rewrote prototype cycle checking loop. Use unwrappedObject in the loop now.
  13586. (JSC::JSObject::unwrappedObject): Replaced toGlobalObject with this new function.
  13587. * runtime/JSObject.h: More of the same.
  13588. 2008-12-15 Steve Falkenburg <sfalken@apple.com>
  13589. Windows build fix.
  13590. Visual Studio requires visibility of forward declarations to match class declaration.
  13591. * assembler/X86Assembler.h:
  13592. 2008-12-15 Gustavo Noronha Silva <kov@kov.eti.br>
  13593. Reviewed by Mark Rowe.
  13594. https://bugs.webkit.org/show_bug.cgi?id=22686
  13595. GTK+ build fix.
  13596. * GNUmakefile.am:
  13597. 2008-12-15 Gavin Barraclough <barraclough@apple.com>
  13598. Reviewed by Geoff Garen.
  13599. Add support to X86Assembler emitting instructions that access all 16 registers on x86-64.
  13600. Add a new formating class, that is reponsible for both emitting the opcode bytes and the
  13601. ModRm bytes of an instruction in a single call; this can insert the REX byte as necessary
  13602. before the opcode, but has access to the register numbers to build the REX.
  13603. * assembler/AssemblerBuffer.h:
  13604. (JSC::AssemblerBuffer::isAligned):
  13605. (JSC::AssemblerBuffer::data):
  13606. * assembler/MacroAssembler.h:
  13607. (JSC::MacroAssembler::addPtr):
  13608. (JSC::MacroAssembler::add32):
  13609. (JSC::MacroAssembler::and32):
  13610. (JSC::MacroAssembler::or32):
  13611. (JSC::MacroAssembler::sub32):
  13612. (JSC::MacroAssembler::xor32):
  13613. (JSC::MacroAssembler::loadPtr):
  13614. (JSC::MacroAssembler::load32):
  13615. (JSC::MacroAssembler::load16):
  13616. (JSC::MacroAssembler::storePtr):
  13617. (JSC::MacroAssembler::storePtrWithRepatch):
  13618. (JSC::MacroAssembler::store32):
  13619. (JSC::MacroAssembler::pop):
  13620. (JSC::MacroAssembler::push):
  13621. (JSC::MacroAssembler::compareImm32ForBranch):
  13622. (JSC::MacroAssembler::compareImm32ForBranchEquality):
  13623. (JSC::MacroAssembler::testImm32):
  13624. (JSC::MacroAssembler::jae32):
  13625. (JSC::MacroAssembler::jb32):
  13626. (JSC::MacroAssembler::je16):
  13627. (JSC::MacroAssembler::jg32):
  13628. (JSC::MacroAssembler::jnePtr):
  13629. (JSC::MacroAssembler::jne32):
  13630. (JSC::MacroAssembler::jump):
  13631. * assembler/X86Assembler.h:
  13632. (JSC::X86::):
  13633. (JSC::X86Assembler::):
  13634. (JSC::X86Assembler::size):
  13635. (JSC::X86Assembler::push_r):
  13636. (JSC::X86Assembler::pop_r):
  13637. (JSC::X86Assembler::push_i32):
  13638. (JSC::X86Assembler::push_m):
  13639. (JSC::X86Assembler::pop_m):
  13640. (JSC::X86Assembler::addl_rr):
  13641. (JSC::X86Assembler::addl_mr):
  13642. (JSC::X86Assembler::addl_ir):
  13643. (JSC::X86Assembler::addq_ir):
  13644. (JSC::X86Assembler::addl_im):
  13645. (JSC::X86Assembler::andl_rr):
  13646. (JSC::X86Assembler::andl_ir):
  13647. (JSC::X86Assembler::orl_rr):
  13648. (JSC::X86Assembler::orl_mr):
  13649. (JSC::X86Assembler::orl_ir):
  13650. (JSC::X86Assembler::subl_rr):
  13651. (JSC::X86Assembler::subl_mr):
  13652. (JSC::X86Assembler::subl_ir):
  13653. (JSC::X86Assembler::subl_im):
  13654. (JSC::X86Assembler::xorl_rr):
  13655. (JSC::X86Assembler::xorl_ir):
  13656. (JSC::X86Assembler::sarl_i8r):
  13657. (JSC::X86Assembler::sarl_CLr):
  13658. (JSC::X86Assembler::shll_i8r):
  13659. (JSC::X86Assembler::shll_CLr):
  13660. (JSC::X86Assembler::imull_rr):
  13661. (JSC::X86Assembler::imull_i32r):
  13662. (JSC::X86Assembler::idivl_r):
  13663. (JSC::X86Assembler::cmpl_rr):
  13664. (JSC::X86Assembler::cmpl_rm):
  13665. (JSC::X86Assembler::cmpl_mr):
  13666. (JSC::X86Assembler::cmpl_ir):
  13667. (JSC::X86Assembler::cmpl_ir_force32):
  13668. (JSC::X86Assembler::cmpl_im):
  13669. (JSC::X86Assembler::cmpl_im_force32):
  13670. (JSC::X86Assembler::cmpw_rm):
  13671. (JSC::X86Assembler::testl_rr):
  13672. (JSC::X86Assembler::testl_i32r):
  13673. (JSC::X86Assembler::testl_i32m):
  13674. (JSC::X86Assembler::testq_rr):
  13675. (JSC::X86Assembler::testq_i32r):
  13676. (JSC::X86Assembler::testb_i8r):
  13677. (JSC::X86Assembler::sete_r):
  13678. (JSC::X86Assembler::setz_r):
  13679. (JSC::X86Assembler::setne_r):
  13680. (JSC::X86Assembler::setnz_r):
  13681. (JSC::X86Assembler::cdq):
  13682. (JSC::X86Assembler::xchgl_rr):
  13683. (JSC::X86Assembler::movl_rr):
  13684. (JSC::X86Assembler::movl_rm):
  13685. (JSC::X86Assembler::movl_mr):
  13686. (JSC::X86Assembler::movl_i32r):
  13687. (JSC::X86Assembler::movl_i32m):
  13688. (JSC::X86Assembler::movq_rr):
  13689. (JSC::X86Assembler::movq_rm):
  13690. (JSC::X86Assembler::movq_mr):
  13691. (JSC::X86Assembler::movzwl_mr):
  13692. (JSC::X86Assembler::movzbl_rr):
  13693. (JSC::X86Assembler::leal_mr):
  13694. (JSC::X86Assembler::call):
  13695. (JSC::X86Assembler::jmp):
  13696. (JSC::X86Assembler::jmp_r):
  13697. (JSC::X86Assembler::jmp_m):
  13698. (JSC::X86Assembler::jne):
  13699. (JSC::X86Assembler::jnz):
  13700. (JSC::X86Assembler::je):
  13701. (JSC::X86Assembler::jl):
  13702. (JSC::X86Assembler::jb):
  13703. (JSC::X86Assembler::jle):
  13704. (JSC::X86Assembler::jbe):
  13705. (JSC::X86Assembler::jge):
  13706. (JSC::X86Assembler::jg):
  13707. (JSC::X86Assembler::ja):
  13708. (JSC::X86Assembler::jae):
  13709. (JSC::X86Assembler::jo):
  13710. (JSC::X86Assembler::jp):
  13711. (JSC::X86Assembler::js):
  13712. (JSC::X86Assembler::addsd_rr):
  13713. (JSC::X86Assembler::addsd_mr):
  13714. (JSC::X86Assembler::cvtsi2sd_rr):
  13715. (JSC::X86Assembler::cvttsd2si_rr):
  13716. (JSC::X86Assembler::movd_rr):
  13717. (JSC::X86Assembler::movsd_rm):
  13718. (JSC::X86Assembler::movsd_mr):
  13719. (JSC::X86Assembler::mulsd_rr):
  13720. (JSC::X86Assembler::mulsd_mr):
  13721. (JSC::X86Assembler::pextrw_irr):
  13722. (JSC::X86Assembler::subsd_rr):
  13723. (JSC::X86Assembler::subsd_mr):
  13724. (JSC::X86Assembler::ucomis_rr):
  13725. (JSC::X86Assembler::int3):
  13726. (JSC::X86Assembler::ret):
  13727. (JSC::X86Assembler::predictNotTaken):
  13728. (JSC::X86Assembler::label):
  13729. (JSC::X86Assembler::align):
  13730. (JSC::X86Assembler::link):
  13731. (JSC::X86Assembler::executableCopy):
  13732. (JSC::X86Assembler::X86InstructionFormater::prefix):
  13733. (JSC::X86Assembler::X86InstructionFormater::oneByteOp):
  13734. (JSC::X86Assembler::X86InstructionFormater::twoByteOp):
  13735. (JSC::X86Assembler::X86InstructionFormater::oneByteOp64):
  13736. (JSC::X86Assembler::X86InstructionFormater::oneByteOp8):
  13737. (JSC::X86Assembler::X86InstructionFormater::twoByteOp8):
  13738. (JSC::X86Assembler::X86InstructionFormater::instructionImmediate8):
  13739. (JSC::X86Assembler::X86InstructionFormater::instructionImmediate32):
  13740. (JSC::X86Assembler::X86InstructionFormater::instructionRel32):
  13741. (JSC::X86Assembler::X86InstructionFormater::size):
  13742. (JSC::X86Assembler::X86InstructionFormater::isAligned):
  13743. (JSC::X86Assembler::X86InstructionFormater::data):
  13744. (JSC::X86Assembler::X86InstructionFormater::executableCopy):
  13745. (JSC::X86Assembler::X86InstructionFormater::registerModRM):
  13746. (JSC::X86Assembler::X86InstructionFormater::memoryModRM):
  13747. * jit/JIT.cpp:
  13748. (JSC::JIT::privateCompileMainPass):
  13749. (JSC::JIT::privateCompile):
  13750. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13751. * jit/JITArithmetic.cpp:
  13752. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  13753. (JSC::JIT::compileBinaryArithOp):
  13754. * jit/JITCall.cpp:
  13755. (JSC::JIT::compileOpCall):
  13756. (JSC::JIT::compileOpCallSlowCase):
  13757. * jit/JITPropertyAccess.cpp:
  13758. (JSC::JIT::compileGetByIdHotPath):
  13759. (JSC::JIT::compilePutByIdHotPath):
  13760. (JSC::JIT::privateCompilePutByIdTransition):
  13761. (JSC::JIT::privateCompilePatchGetArrayLength):
  13762. (JSC::JIT::privateCompileGetByIdProto):
  13763. (JSC::JIT::privateCompileGetByIdProtoList):
  13764. (JSC::JIT::privateCompileGetByIdChainList):
  13765. (JSC::JIT::privateCompileGetByIdChain):
  13766. 2008-12-15 Darin Adler <darin@apple.com>
  13767. * interpreter/RegisterFile.h: Tweak include formatting.
  13768. 2008-12-15 Holger Hans Peter Freyther <zecke@selfish.org>
  13769. Build fix for Gtk+.
  13770. * interpreter/RegisterFile.h: Include stdio.h for fprintf
  13771. 2008-12-15 Alexey Proskuryakov <ap@webkit.org>
  13772. Reviewed by Oliver Hunt.
  13773. <rdar://problem/6444455> Worker Thread crash running multiple workers for a moderate amount of time
  13774. * interpreter/RegisterFile.h: (JSC::RegisterFile::RegisterFile):
  13775. Improve error handling: if mmap fails, crash immediately, and print out the reason.
  13776. 2008-12-13 Gavin Barraclough <barraclough@apple.com>
  13777. Reviewed by Cameron Zwarich.
  13778. Re-enable WREC on 64-bit.
  13779. Implements one of the MacroAssembler::jnzPtr methods, previously only implemented for 32-bit x86.
  13780. https://bugs.webkit.org/show_bug.cgi?id=22849
  13781. * assembler/MacroAssembler.h:
  13782. (JSC::MacroAssembler::testImm64):
  13783. (JSC::MacroAssembler::jnzPtr):
  13784. * assembler/X86Assembler.h:
  13785. (JSC::X86Assembler::testq_i32r):
  13786. (JSC::X86Assembler::testq_rr):
  13787. * wtf/Platform.h:
  13788. 2008-12-13 Gavin Barraclough <barraclough@apple.com>
  13789. Fix PPC builds.
  13790. * assembler/MacroAssembler.h:
  13791. 2008-12-13 Gavin Barraclough <barraclough@apple.com>
  13792. Build fix only, no review.
  13793. * bytecode/CodeBlock.h:
  13794. 2008-12-13 Gavin Barraclough <barraclough@apple.com>
  13795. Reviewed by Cameron Zwarich.
  13796. Port the remainder of the JIT, bar calling convention related code, and code
  13797. implementing optimizations which can be disabled, to use the MacroAssembler.
  13798. * assembler/MacroAssembler.h:
  13799. (JSC::MacroAssembler::DataLabelPtr::DataLabelPtr):
  13800. (JSC::MacroAssembler::RepatchBuffer::RepatchBuffer):
  13801. (JSC::MacroAssembler::RepatchBuffer::link):
  13802. (JSC::MacroAssembler::RepatchBuffer::addressOf):
  13803. (JSC::MacroAssembler::RepatchBuffer::setPtr):
  13804. (JSC::MacroAssembler::addPtr):
  13805. (JSC::MacroAssembler::lshift32):
  13806. (JSC::MacroAssembler::mod32):
  13807. (JSC::MacroAssembler::rshift32):
  13808. (JSC::MacroAssembler::storePtrWithRepatch):
  13809. (JSC::MacroAssembler::jnzPtr):
  13810. (JSC::MacroAssembler::jzPtr):
  13811. (JSC::MacroAssembler::jump):
  13812. (JSC::MacroAssembler::label):
  13813. * assembler/X86Assembler.h:
  13814. (JSC::X86Assembler::):
  13815. (JSC::X86Assembler::xchgl_rr):
  13816. (JSC::X86Assembler::jmp_m):
  13817. (JSC::X86Assembler::repatchAddress):
  13818. (JSC::X86Assembler::getRelocatedAddress):
  13819. * bytecode/CodeBlock.cpp:
  13820. (JSC::CodeBlock::CodeBlock):
  13821. * bytecode/CodeBlock.h:
  13822. (JSC::JITCodeRef::JITCodeRef):
  13823. (JSC::CodeBlock::setJITCode):
  13824. (JSC::CodeBlock::jitCode):
  13825. (JSC::CodeBlock::executablePool):
  13826. * jit/JIT.cpp:
  13827. (JSC::JIT::privateCompileMainPass):
  13828. (JSC::JIT::privateCompileLinkPass):
  13829. (JSC::JIT::privateCompile):
  13830. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13831. * jit/JIT.h:
  13832. (JSC::CallRecord::CallRecord):
  13833. (JSC::JumpTable::JumpTable):
  13834. (JSC::JIT::emitCTICall):
  13835. (JSC::JIT::JSRInfo::JSRInfo):
  13836. * jit/JITArithmetic.cpp:
  13837. * jit/JITCall.cpp:
  13838. * jit/JITInlineMethods.h:
  13839. (JSC::JIT::emitNakedCall):
  13840. (JSC::JIT::emitCTICall_internal):
  13841. (JSC::JIT::checkStructure):
  13842. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  13843. (JSC::JIT::addSlowCase):
  13844. (JSC::JIT::addJump):
  13845. (JSC::JIT::emitJumpSlowToHot):
  13846. * jit/JITPropertyAccess.cpp:
  13847. (JSC::JIT::privateCompileGetByIdChainList):
  13848. (JSC::JIT::privateCompileGetByIdChain):
  13849. 2008-12-12 Cameron Zwarich <zwarich@apple.com>
  13850. Reviewed by Sam Weinig.
  13851. Fix the failures of the following layout tests, which regressed in
  13852. r39255:
  13853. fast/dom/StyleSheet/ownerNode-lifetime-2.html
  13854. fast/xsl/transform-xhr-doc.xhtml
  13855. The binary search in CodeBlock::getByIdExceptionInfoForBytecodeOffset()
  13856. doesn't guarantee that it actually finds a match, so add an explicit check
  13857. for this.
  13858. * bytecode/CodeBlock.cpp:
  13859. (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
  13860. 2008-12-12 Gavin Barraclough <barraclough@apple.com>
  13861. Reviewed by Cameron Zwarich.
  13862. Replace emitPutCallArg methods with emitPutJITStubArg methods. Primarily to make the argument numbering
  13863. more sensible (1-based incrementing by 1, rather than 0-based incrementing by 4). The CTI name also seems
  13864. to be being deprecated from the code generally.
  13865. * jit/JIT.cpp:
  13866. (JSC::JIT::privateCompileMainPass):
  13867. (JSC::JIT::privateCompileSlowCases):
  13868. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13869. * jit/JIT.h:
  13870. * jit/JITArithmetic.cpp:
  13871. (JSC::JIT::compileBinaryArithOp):
  13872. (JSC::JIT::compileBinaryArithOpSlowCase):
  13873. * jit/JITCall.cpp:
  13874. (JSC::JIT::compileOpCallSetupArgs):
  13875. (JSC::JIT::compileOpCallEvalSetupArgs):
  13876. (JSC::JIT::compileOpConstructSetupArgs):
  13877. (JSC::JIT::compileOpCall):
  13878. * jit/JITInlineMethods.h:
  13879. (JSC::JIT::emitPutJITStubArg):
  13880. (JSC::JIT::emitPutJITStubArgConstant):
  13881. (JSC::JIT::emitGetJITStubArg):
  13882. (JSC::JIT::emitPutJITStubArgFromVirtualRegister):
  13883. * jit/JITPropertyAccess.cpp:
  13884. (JSC::JIT::compileGetByIdHotPath):
  13885. (JSC::JIT::compilePutByIdHotPath):
  13886. (JSC::JIT::compileGetByIdSlowCase):
  13887. (JSC::JIT::compilePutByIdSlowCase):
  13888. 2008-12-12 Gavin Barraclough <barraclough@apple.com>
  13889. Fix windows builds.
  13890. * jit/JIT.cpp:
  13891. (JSC::JIT::privateCompileMainPass):
  13892. (JSC::JIT::privateCompileSlowCases):
  13893. (JSC::JIT::privateCompile):
  13894. 2008-12-12 Gavin Barraclough <barraclough@apple.com>
  13895. Reviewed by Geoff Garen.
  13896. Remove loop counter 'i' from the JIT generation passes, replace with a member m_bytecodeIndex.
  13897. No impact on performance.
  13898. * jit/JIT.cpp:
  13899. (JSC::JIT::compileOpStrictEq):
  13900. (JSC::JIT::emitSlowScriptCheck):
  13901. (JSC::JIT::privateCompileMainPass):
  13902. (JSC::JIT::privateCompileSlowCases):
  13903. (JSC::JIT::privateCompile):
  13904. * jit/JIT.h:
  13905. (JSC::CallRecord::CallRecord):
  13906. (JSC::JmpTable::JmpTable):
  13907. (JSC::JIT::emitCTICall):
  13908. * jit/JITArithmetic.cpp:
  13909. (JSC::JIT::compileBinaryArithOp):
  13910. (JSC::JIT::compileBinaryArithOpSlowCase):
  13911. * jit/JITCall.cpp:
  13912. (JSC::JIT::compileOpCall):
  13913. (JSC::JIT::compileOpCallSlowCase):
  13914. * jit/JITInlineMethods.h:
  13915. (JSC::JIT::emitGetVirtualRegister):
  13916. (JSC::JIT::emitGetVirtualRegisters):
  13917. (JSC::JIT::emitNakedCall):
  13918. (JSC::JIT::emitCTICall_internal):
  13919. (JSC::JIT::emitJumpSlowCaseIfJSCell):
  13920. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  13921. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  13922. (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
  13923. (JSC::JIT::emitFastArithIntToImmOrSlowCase):
  13924. (JSC::JIT::addSlowCase):
  13925. (JSC::JIT::addJump):
  13926. (JSC::JIT::emitJumpSlowToHot):
  13927. * jit/JITPropertyAccess.cpp:
  13928. (JSC::JIT::compileGetByIdHotPath):
  13929. (JSC::JIT::compileGetByIdSlowCase):
  13930. (JSC::JIT::compilePutByIdHotPath):
  13931. (JSC::JIT::compilePutByIdSlowCase):
  13932. 2008-12-12 Sam Weinig <sam@webkit.org>
  13933. Reviewed by Cameron Zwarich.
  13934. <rdar://problem/6428342> Look into feasibility of discarding bytecode after native codegen
  13935. Move more JIT functionality to using offsets into the Instruction buffer
  13936. instead of raw pointers. Two to go!
  13937. * interpreter/Interpreter.cpp:
  13938. (JSC::bytecodeOffsetForPC): Rename from vPCForPC.
  13939. (JSC::Interpreter::resolve): Pass offset to exception helper.
  13940. (JSC::Interpreter::resolveSkip): Ditto.
  13941. (JSC::Interpreter::resolveGlobal): Ditto.
  13942. (JSC::Interpreter::resolveBaseAndProperty): Ditto.
  13943. (JSC::Interpreter::resolveBaseAndFunc): Ditto.
  13944. (JSC::isNotObject): Ditto.
  13945. (JSC::Interpreter::unwindCallFrame): Call bytecodeOffsetForPC.
  13946. (JSC::Interpreter::throwException): Use offsets instead of vPCs.
  13947. (JSC::Interpreter::privateExecute): Pass offset to exception helper.
  13948. (JSC::Interpreter::retrieveLastCaller): Ditto.
  13949. (JSC::Interpreter::cti_op_instanceof): Ditto.
  13950. (JSC::Interpreter::cti_op_call_NotJSFunction): Ditto.
  13951. (JSC::Interpreter::cti_op_resolve): Pass offset to exception helper.
  13952. (JSC::Interpreter::cti_op_construct_NotJSConstruct): Ditto.
  13953. (JSC::Interpreter::cti_op_resolve_func): Ditto.
  13954. (JSC::Interpreter::cti_op_resolve_skip): Ditto.
  13955. (JSC::Interpreter::cti_op_resolve_global): Ditto.
  13956. (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
  13957. (JSC::Interpreter::cti_op_throw): Ditto.
  13958. (JSC::Interpreter::cti_op_in): Ditto.
  13959. (JSC::Interpreter::cti_vm_throw): Ditto.
  13960. * interpreter/Interpreter.h:
  13961. * jit/JIT.cpp:
  13962. (JSC::JIT::privateCompileMainPass): Don't pass unnecessary vPC to stub.
  13963. * jit/JIT.h: Remove ARG_instr1 - ARG_instr3 and ARG_instr5 - ARG_instr6.
  13964. * jit/JITCall.cpp:
  13965. (JSC::JIT::compileOpCallEvalSetupArgs): Don't pass unnecessary vPC to stub..
  13966. (JSC::JIT::compileOpConstructSetupArgs): Ditto.
  13967. * runtime/ExceptionHelpers.cpp:
  13968. (JSC::createUndefinedVariableError): Take an offset instead of vPC.
  13969. (JSC::createInvalidParamError): Ditto.
  13970. (JSC::createNotAConstructorError): Ditto.
  13971. (JSC::createNotAFunctionError): Ditto.
  13972. (JSC::createNotAnObjectError): Ditto.
  13973. * runtime/ExceptionHelpers.h:
  13974. 2008-12-12 Cameron Zwarich <zwarich@apple.com>
  13975. Reviewed by Oliver Hunt.
  13976. Bug 22835: Crash during bytecode generation when comparing to null
  13977. <https://bugs.webkit.org/show_bug.cgi?id=22835>
  13978. <rdar://problem/6286749>
  13979. Change the special cases in bytecode generation for comparison to null
  13980. to use tempDestination().
  13981. * parser/Nodes.cpp:
  13982. (JSC::BinaryOpNode::emitBytecode):
  13983. (JSC::EqualNode::emitBytecode):
  13984. 2008-12-12 Gavin Barraclough <barraclough@apple.com>
  13985. Reviewed by Geoff Garen.
  13986. Move slow-cases of JIT code generation over to the MacroAssembler interface.
  13987. * assembler/MacroAssembler.h:
  13988. (JSC::MacroAssembler::Label::Label):
  13989. (JSC::MacroAssembler::jae32):
  13990. (JSC::MacroAssembler::jg32):
  13991. (JSC::MacroAssembler::jzPtr):
  13992. * jit/JIT.cpp:
  13993. (JSC::JIT::privateCompileSlowCases):
  13994. (JSC::JIT::privateCompile):
  13995. (JSC::JIT::emitGetVariableObjectRegister):
  13996. (JSC::JIT::emitPutVariableObjectRegister):
  13997. * jit/JIT.h:
  13998. (JSC::SlowCaseEntry::SlowCaseEntry):
  13999. (JSC::JIT::getSlowCase):
  14000. (JSC::JIT::linkSlowCase):
  14001. * jit/JITArithmetic.cpp:
  14002. (JSC::JIT::compileBinaryArithOpSlowCase):
  14003. * jit/JITCall.cpp:
  14004. (JSC::JIT::compileOpCallInitializeCallFrame):
  14005. (JSC::JIT::compileOpCall):
  14006. (JSC::JIT::compileOpCallSlowCase):
  14007. * jit/JITInlineMethods.h:
  14008. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  14009. (JSC::JIT::linkSlowCaseIfNotJSCell):
  14010. * jit/JITPropertyAccess.cpp:
  14011. (JSC::JIT::compileGetByIdHotPath):
  14012. (JSC::JIT::compilePutByIdHotPath):
  14013. (JSC::JIT::compileGetByIdSlowCase):
  14014. (JSC::JIT::compilePutByIdSlowCase):
  14015. 2008-12-12 Cameron Zwarich <zwarich@apple.com>
  14016. Reviewed by Sam Weinig.
  14017. Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
  14018. <https://bugs.webkit.org/show_bug.cgi?id=22828>
  14019. In order to remove the bytecode instruction stream after generating
  14020. native code, all inspection of bytecode instructions at runtime must
  14021. be removed. One particular instance of this is the special handling of
  14022. exceptions thrown by the op_get_by_id emitted directly before an
  14023. op_construct or an op_instanceof. This patch moves that information to
  14024. an auxiliary data structure in CodeBlock.
  14025. * bytecode/CodeBlock.cpp:
  14026. (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
  14027. * bytecode/CodeBlock.h:
  14028. (JSC::CodeBlock::addGetByIdExceptionInfo):
  14029. * bytecompiler/BytecodeGenerator.cpp:
  14030. (JSC::BytecodeGenerator::emitConstruct):
  14031. * bytecompiler/BytecodeGenerator.h:
  14032. (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
  14033. * parser/Nodes.cpp:
  14034. (JSC::InstanceOfNode::emitBytecode):
  14035. * runtime/ExceptionHelpers.cpp:
  14036. (JSC::createNotAnObjectError):
  14037. 2008-12-12 Sam Weinig <sam@webkit.org>
  14038. Reviewed by Geoffrey Garen.
  14039. Change exception information accessors to take offsets into the bytecode
  14040. instruction buffer instead of pointers so that they can work even even
  14041. if the bytecode buffer is purged.
  14042. * bytecode/CodeBlock.cpp:
  14043. (JSC::instructionOffsetForNth):
  14044. (JSC::CodeBlock::handlerForBytecodeOffset):
  14045. (JSC::CodeBlock::lineNumberForBytecodeOffset):
  14046. (JSC::CodeBlock::expressionRangeForBytecodeOffset):
  14047. * bytecode/CodeBlock.h:
  14048. * bytecode/SamplingTool.cpp:
  14049. (JSC::SamplingTool::dump):
  14050. * interpreter/Interpreter.cpp:
  14051. (JSC::Interpreter::throwException):
  14052. (JSC::Interpreter::privateExecute):
  14053. (JSC::Interpreter::retrieveLastCaller):
  14054. * jit/JIT.cpp:
  14055. (JSC::JIT::privateCompileMainPass):
  14056. * runtime/ExceptionHelpers.cpp:
  14057. (JSC::createUndefinedVariableError):
  14058. (JSC::createInvalidParamError):
  14059. (JSC::createNotAConstructorError):
  14060. (JSC::createNotAFunctionError):
  14061. (JSC::createNotAnObjectError):
  14062. 2008-12-12 Geoffrey Garen <ggaren@apple.com>
  14063. Reviewed by Cameron Zwarich.
  14064. Tiny bit of refactoring in quantifier generation.
  14065. * wrec/WRECGenerator.cpp:
  14066. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  14067. (JSC::WREC::Generator::generateGreedyQuantifier):
  14068. 2008-12-11 Sam Weinig <sam@webkit.org>
  14069. Reviewed by Geoffrey Garen.
  14070. Remove dependancy on having the Instruction buffer in order to
  14071. deref Structures used for property access and global resolves.
  14072. Instead, we put references to the necessary Structures in auxiliary
  14073. data structures on the CodeBlock. This is not an ideal solution,
  14074. as we still pay for having the Structures in two places and we
  14075. would like to eventually just hold on to offsets into the machine
  14076. code buffer.
  14077. - Also removes CodeBlock bloat in non-JIT by #ifdefing the JIT
  14078. only data structures.
  14079. * GNUmakefile.am:
  14080. * JavaScriptCore.pri:
  14081. * JavaScriptCore.scons:
  14082. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  14083. * JavaScriptCore.xcodeproj/project.pbxproj:
  14084. * JavaScriptCoreSources.bkl:
  14085. * bytecode/CodeBlock.cpp:
  14086. (JSC::isGlobalResolve):
  14087. (JSC::isPropertyAccess):
  14088. (JSC::instructionOffsetForNth):
  14089. (JSC::printGlobalResolveInfo):
  14090. (JSC::printStructureStubInfo):
  14091. (JSC::CodeBlock::printStructures):
  14092. (JSC::CodeBlock::dump):
  14093. (JSC::CodeBlock::~CodeBlock):
  14094. (JSC::CodeBlock::shrinkToFit):
  14095. * bytecode/CodeBlock.h:
  14096. (JSC::GlobalResolveInfo::GlobalResolveInfo):
  14097. (JSC::getNativePC):
  14098. (JSC::CodeBlock::instructions):
  14099. (JSC::CodeBlock::getStubInfo):
  14100. (JSC::CodeBlock::getBytecodeIndex):
  14101. (JSC::CodeBlock::addPropertyAccessInstruction):
  14102. (JSC::CodeBlock::addGlobalResolveInstruction):
  14103. (JSC::CodeBlock::numberOfStructureStubInfos):
  14104. (JSC::CodeBlock::addStructureStubInfo):
  14105. (JSC::CodeBlock::structureStubInfo):
  14106. (JSC::CodeBlock::addGlobalResolveInfo):
  14107. (JSC::CodeBlock::globalResolveInfo):
  14108. (JSC::CodeBlock::numberOfCallLinkInfos):
  14109. (JSC::CodeBlock::addCallLinkInfo):
  14110. (JSC::CodeBlock::callLinkInfo):
  14111. * bytecode/Instruction.h:
  14112. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
  14113. (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  14114. * bytecode/Opcode.h:
  14115. (JSC::):
  14116. * bytecode/StructureStubInfo.cpp: Copied from bytecode/CodeBlock.cpp.
  14117. (JSC::StructureStubInfo::deref):
  14118. * bytecode/StructureStubInfo.h: Copied from bytecode/CodeBlock.h.
  14119. (JSC::StructureStubInfo::StructureStubInfo):
  14120. (JSC::StructureStubInfo::initGetByIdSelf):
  14121. (JSC::StructureStubInfo::initGetByIdProto):
  14122. (JSC::StructureStubInfo::initGetByIdChain):
  14123. (JSC::StructureStubInfo::initGetByIdSelfList):
  14124. (JSC::StructureStubInfo::initGetByIdProtoList):
  14125. (JSC::StructureStubInfo::initPutByIdTransition):
  14126. (JSC::StructureStubInfo::initPutByIdReplace):
  14127. (JSC::StructureStubInfo::):
  14128. * bytecompiler/BytecodeGenerator.cpp:
  14129. (JSC::BytecodeGenerator::emitResolve):
  14130. (JSC::BytecodeGenerator::emitGetById):
  14131. (JSC::BytecodeGenerator::emitPutById):
  14132. (JSC::BytecodeGenerator::emitCall):
  14133. (JSC::BytecodeGenerator::emitConstruct):
  14134. (JSC::BytecodeGenerator::emitCatch):
  14135. * interpreter/Interpreter.cpp:
  14136. (JSC::Interpreter::tryCTICachePutByID):
  14137. (JSC::Interpreter::tryCTICacheGetByID):
  14138. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  14139. (JSC::getPolymorphicAccessStructureListSlot):
  14140. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  14141. (JSC::Interpreter::cti_op_resolve_global):
  14142. * jit/JIT.cpp:
  14143. (JSC::JIT::JIT):
  14144. (JSC::JIT::privateCompileMainPass):
  14145. (JSC::JIT::privateCompileSlowCases):
  14146. (JSC::JIT::privateCompile):
  14147. * jit/JITPropertyAccess.cpp:
  14148. (JSC::JIT::compileGetByIdHotPath):
  14149. (JSC::JIT::compilePutByIdHotPath):
  14150. (JSC::JIT::compileGetByIdSlowCase):
  14151. (JSC::JIT::compilePutByIdSlowCase):
  14152. (JSC::JIT::privateCompileGetByIdSelfList):
  14153. (JSC::JIT::privateCompileGetByIdProtoList):
  14154. (JSC::JIT::privateCompileGetByIdChainList):
  14155. 2008-12-11 Gavin Barraclough <barraclough@apple.com>
  14156. Reviewed by Oliver Hunt.
  14157. Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
  14158. unifying JIT callback (cti_*) argument access on OS X & Windows
  14159. No performance impact.
  14160. * interpreter/Interpreter.h:
  14161. * jit/JIT.cpp:
  14162. (JSC::JIT::privateCompileCTIMachineTrampolines):
  14163. * jit/JIT.h:
  14164. * jit/JITInlineMethods.h:
  14165. (JSC::JIT::emitCTICall):
  14166. * jit/JITPropertyAccess.cpp:
  14167. (JSC::JIT::privateCompilePutByIdTransition):
  14168. * wtf/Platform.h:
  14169. 2008-12-11 Holger Freyther <zecke@selfish.org>
  14170. Reviewed by Simon Hausmann.
  14171. https://bugs.webkit.org/show_bug.cgi?id=20953
  14172. For Qt it is not pratical to have a FontCache and GlyphPageTreeNode
  14173. implementation. This is one of the reasons why the Qt port is currently not
  14174. using WebCore/platform/graphics/Font.cpp. By allowing to not use
  14175. the simple/fast-path the Qt port will be able to use it.
  14176. Introduce USE(FONT_FAST_PATH) and define it for every port but the
  14177. Qt one.
  14178. * wtf/Platform.h: Enable USE(FONT_FAST_PATH)
  14179. 2008-12-11 Gabor Loki <loki@inf.u-szeged.hu>
  14180. Reviewed by Darin Adler and landed by Holger Freyther.
  14181. <https://bugs.webkit.org/show_bug.cgi?id=22648>
  14182. Fix threading on Qt-port and Gtk-port for Sampling tool.
  14183. * wtf/ThreadingGtk.cpp:
  14184. (WTF::waitForThreadCompletion):
  14185. * wtf/ThreadingQt.cpp:
  14186. (WTF::waitForThreadCompletion):
  14187. 2008-12-10 Cameron Zwarich <zwarich@apple.com>
  14188. Reviewed by Oliver Hunt.
  14189. Bug 22734: Debugger crashes when stepping into a function call in a return statement
  14190. <https://bugs.webkit.org/show_bug.cgi?id=22734>
  14191. <rdar://problem/6426796>
  14192. * bytecompiler/BytecodeGenerator.cpp:
  14193. (JSC::BytecodeGenerator::BytecodeGenerator): The DebuggerCallFrame uses
  14194. the 'this' value stored in a callFrame, so op_convert_this should be
  14195. emitted at the beginning of a function body when generating bytecode
  14196. with debug hooks.
  14197. * debugger/DebuggerCallFrame.cpp:
  14198. (JSC::DebuggerCallFrame::thisObject): The assertion inherent in the call
  14199. to asObject() here is valid, because any 'this' value should have been
  14200. converted to a JSObject*.
  14201. 2008-12-10 Gavin Barraclough <barraclough@apple.com>
  14202. Reviewed by Geoff Garen.
  14203. Port more of the JIT to use the MacroAssembler interface.
  14204. Everything in the main pass, bar a few corner cases (operations with required
  14205. registers, or calling convention code). Slightly refactors array creation,
  14206. moving the offset calculation into the callFrame into C code (reducing code
  14207. planted).
  14208. Overall this appears to be a 1% win on v8-tests, due to the smaller immediates
  14209. being planted (in jfalse in particular).
  14210. * interpreter/Interpreter.cpp:
  14211. (JSC::Interpreter::cti_op_new_array):
  14212. * jit/JIT.cpp:
  14213. (JSC::JIT::privateCompileMainPass):
  14214. (JSC::JIT::privateCompileSlowCases):
  14215. * jit/JIT.h:
  14216. * wrec/WRECGenerator.cpp:
  14217. (JSC::WREC::Generator::generateEnter):
  14218. 2008-12-10 Sam Weinig <sam@webkit.org>
  14219. Fix non-JIT builds.
  14220. * bytecode/CodeBlock.h:
  14221. 2008-12-10 Sam Weinig <sam@webkit.org>
  14222. Reviewed by Geoffrey Garen.
  14223. <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
  14224. Step 2:
  14225. Convert the return address table from a HashMap to a sorted Vector. This
  14226. reduces the size of the data structure by ~4.5MB on Membuster head.
  14227. SunSpider reports a 0.5% progression.
  14228. * bytecode/CodeBlock.cpp:
  14229. (JSC::sizeInBytes): Generic method to get the cost of a Vector.
  14230. (JSC::CodeBlock::dumpStatistics): Add dumping of member sizes.
  14231. * bytecode/CodeBlock.h:
  14232. (JSC::PC::PC): Struct representing NativePC -> VirtualPC mappings.
  14233. (JSC::getNativePC): Helper for binary chop.
  14234. (JSC::CodeBlock::getBytecodeIndex): Used to get the VirtualPC from a
  14235. NativePC using a binary chop of the pcVector.
  14236. (JSC::CodeBlock::pcVector): Accessor.
  14237. * interpreter/Interpreter.cpp:
  14238. (JSC::vPCForPC): Use getBytecodeIndex instead of jitReturnAddressVPCMap().get().
  14239. (JSC::Interpreter::cti_op_instanceof): Ditto.
  14240. (JSC::Interpreter::cti_op_resolve): Ditto.
  14241. (JSC::Interpreter::cti_op_resolve_func): Ditto.
  14242. (JSC::Interpreter::cti_op_resolve_skip): Ditto.
  14243. (JSC::Interpreter::cti_op_resolve_with_base): Ditto.
  14244. (JSC::Interpreter::cti_op_throw): Ditto.
  14245. (JSC::Interpreter::cti_op_in): Ditto.
  14246. (JSC::Interpreter::cti_vm_throw): Ditto.
  14247. * jit/JIT.cpp:
  14248. (JSC::JIT::privateCompile): Reserve exact capacity and fill the pcVector.
  14249. 2008-12-09 Geoffrey Garen <ggaren@apple.com>
  14250. Reviewed by Oliver Hunt.
  14251. Added WREC support for an assertion followed by a quantifier. Fixed
  14252. PCRE to match.
  14253. * wrec/WRECParser.cpp:
  14254. (JSC::WREC::Parser::parseParentheses): Throw away the quantifier, since
  14255. it's meaningless. (Firefox does the same.)
  14256. * pcre/pcre_compile.cpp:
  14257. (compileBranch): ditto.
  14258. 2008-12-09 Geoffrey Garen <ggaren@apple.com>
  14259. Reviewed by Cameron Zwarich.
  14260. In preparation for compiling WREC without PCRE:
  14261. Further relaxed WREC's parsing to be more web-compatible. Fixed PCRE to
  14262. match in cases where it didn't already.
  14263. Changed JavaScriptCore to report syntax errors detected by WREC, rather
  14264. than falling back on PCRE any time WREC sees an error.
  14265. * pcre/pcre_compile.cpp:
  14266. (checkEscape): Relaxed parsing of \c and \N escapes to be more
  14267. web-compatible.
  14268. * runtime/RegExp.cpp:
  14269. (JSC::RegExp::RegExp): Only fall back on PCRE if WREC has not reported
  14270. a syntax error.
  14271. * wrec/WREC.cpp:
  14272. (JSC::WREC::Generator::compileRegExp): Fixed some error reporting to
  14273. match PCRE.
  14274. * wrec/WRECParser.cpp: Added error messages that match PCRE.
  14275. (JSC::WREC::Parser::consumeGreedyQuantifier):
  14276. (JSC::WREC::Parser::parseParentheses):
  14277. (JSC::WREC::Parser::parseCharacterClass):
  14278. (JSC::WREC::Parser::parseNonCharacterEscape): Updated the above functions to
  14279. use the new setError API.
  14280. (JSC::WREC::Parser::consumeEscape): Relaxed parsing of \c \N \u \x \B
  14281. to be more web-compatible.
  14282. (JSC::WREC::Parser::parseAlternative): Distinguish between a malformed
  14283. quantifier and a quantifier with no prefix, like PCRE does.
  14284. (JSC::WREC::Parser::consumeParenthesesType): Updated to use the new setError API.
  14285. * wrec/WRECParser.h:
  14286. (JSC::WREC::Parser::error):
  14287. (JSC::WREC::Parser::syntaxError):
  14288. (JSC::WREC::Parser::parsePattern):
  14289. (JSC::WREC::Parser::reset):
  14290. (JSC::WREC::Parser::setError): Store error messages instead of error codes,
  14291. to provide for exception messages. Use a setter for reporting errors, so
  14292. errors detected early are not overwritten by errors detected later.
  14293. 2008-12-09 Gavin Barraclough <barraclough@apple.com>
  14294. Reviewed by Oliver Hunt.
  14295. Use va_args to access cti function arguments.
  14296. https://bugs.webkit.org/show_bug.cgi?id=22774
  14297. This may be a minor regression, but we'll take the hit if so to reduce fragility.
  14298. * interpreter/Interpreter.cpp:
  14299. * interpreter/Interpreter.h:
  14300. 2008-12-09 Sam Weinig <sam@webkit.org>
  14301. Reviewed twice by Cameron Zwarich.
  14302. Fix for https://bugs.webkit.org/show_bug.cgi?id=22752
  14303. Clear SymbolTable after codegen for Function codeblocks that
  14304. don't require an activation
  14305. This is a ~1.5MB improvement on Membuster-head.
  14306. * bytecode/CodeBlock.cpp:
  14307. (JSC::CodeBlock::dumpStatistics): Add logging of non-empty symbol tables
  14308. and total size used by symbol tables.
  14309. * bytecompiler/BytecodeGenerator.cpp:
  14310. (JSC::BytecodeGenerator::generate): Clear the symbol table here.
  14311. 2008-12-09 Sam Weinig <sam@webkit.org>
  14312. Reviewed by Geoffrey Garen.
  14313. Remove unnecessary extra lookup when throwing an exception.
  14314. We used to first lookup the target offset using getHandlerForVPC
  14315. and then we would lookup the native code stub using
  14316. nativeExceptionCodeForHandlerVPC. Instead, we can just pass around
  14317. the HandlerInfo.
  14318. * bytecode/CodeBlock.cpp:
  14319. (JSC::CodeBlock::handlerForVPC): Return the HandlerInfo.
  14320. * bytecode/CodeBlock.h: Remove nativeExceptionCodeForHandlerVPC.
  14321. * interpreter/Interpreter.cpp:
  14322. (JSC::Interpreter::throwException): Return a HandlerInfo instead of
  14323. and Instruction offset.
  14324. (JSC::Interpreter::privateExecute): Get the offset from HandlerInfo.
  14325. (JSC::Interpreter::cti_op_throw): Get the native code from the HandleInfo.
  14326. (JSC::Interpreter::cti_vm_throw): Ditto.
  14327. * interpreter/Interpreter.h:
  14328. 2008-12-09 Eric Seidel <eric@webkit.org>
  14329. Build fix only, no review.
  14330. Speculative fix for the Chromium-Windows bot.
  14331. Add JavaScriptCore/os-win32 to the include path (for stdint.h)
  14332. Strangely it builds fine on my local windows box (or at least doesn't hit this error)
  14333. * JavaScriptCore.scons:
  14334. 2008-12-09 Eric Seidel <eric@webkit.org>
  14335. No review, build fix only.
  14336. Add ExecutableAllocator files missing from Scons build.
  14337. * JavaScriptCore.scons:
  14338. 2008-12-09 Dimitri Glazkov <dglazkov@chromium.org>
  14339. Reviewed by Timothy Hatcher.
  14340. https://bugs.webkit.org/show_bug.cgi?id=22631
  14341. Allow ScriptCallFrame query names of functions in the call stack.
  14342. * JavaScriptCore.exp: added InternalFunction::name and
  14343. UString operator==() as exported symbol
  14344. 2008-12-08 Judit Jasz <jasy@inf.u-szeged.hu>
  14345. Reviewed and tweaked by Cameron Zwarich.
  14346. Bug 22352: Annotate opcodes with their length
  14347. <https://bugs.webkit.org/show_bug.cgi?id=22352>
  14348. * bytecode/Opcode.cpp:
  14349. * bytecode/Opcode.h:
  14350. * interpreter/Interpreter.cpp:
  14351. (JSC::Interpreter::privateExecute):
  14352. * jit/JIT.cpp:
  14353. (JSC::JIT::privateCompileMainPass):
  14354. (JSC::JIT::privateCompileSlowCases):
  14355. 2008-12-08 Geoffrey Garen <ggaren@apple.com>
  14356. Reviewed by Oliver Hunt.
  14357. Implemented more of the relaxed and somewhat weird rules for deciding
  14358. how to interpret a non-pattern-character.
  14359. * wrec/Escapes.h:
  14360. (JSC::WREC::Escape::):
  14361. (JSC::WREC::Escape::Escape): Eliminated Escape::None because it was
  14362. unused. If you see an '\\', it's either a valid escape or an error.
  14363. * wrec/Quantifier.h:
  14364. (JSC::WREC::Quantifier::Quantifier):
  14365. * wrec/WRECGenerator.cpp:
  14366. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  14367. (JSC::WREC::Generator::generateGreedyQuantifier): Renamed "noMaxSpecified"
  14368. to "Infinity", since that's what it means.
  14369. * wrec/WRECParser.cpp:
  14370. (JSC::WREC::Parser::consumeGreedyQuantifier): Re-wrote {n,m} parsing rules
  14371. because they were too strict before. Added support for backtracking
  14372. in the case where the {n,m} fails to parse as a quantifier, and yet is
  14373. not a syntax error.
  14374. (JSC::WREC::Parser::parseCharacterClass):
  14375. (JSC::WREC::Parser::parseNonCharacterEscape): Eliminated Escape::None,
  14376. as above.
  14377. (JSC::WREC::Parser::consumeEscape): Don't treat ASCII and _ escapes
  14378. as syntax errors. See fast/regex/non-pattern-characters.html.
  14379. * wrec/WRECParser.h:
  14380. (JSC::WREC::Parser::SavedState::SavedState):
  14381. (JSC::WREC::Parser::SavedState::restore): Added a state backtracker,
  14382. since parsing {n,m} forms requires backtracking if the form turns out
  14383. not to be a quantifier.
  14384. 2008-12-08 Geoffrey Garen <ggaren@apple.com>
  14385. Reviewed by Oliver Hunt.
  14386. Refactored WREC parsing so that only one piece of code needs to know
  14387. the relaxed and somewhat weird rules for deciding how to interpret a
  14388. non-pattern-character, in preparation for implementing those rules.
  14389. Also, implemented the relaxed and somewhat weird rules for '}' and ']'.
  14390. * wrec/WREC.cpp: Reduced the regular expression size limit. Now that
  14391. WREC handles ']' properly, it compiles fast/js/regexp-charclass-crash.html,
  14392. which makes it hang at the old limit. (The old limit was based on the
  14393. misimpression that the same value in PCRE limited the regular expression
  14394. pattern size; in reality, it limited the expected compiled regular
  14395. expression size. WREC doesn't have a way to calculate an expected
  14396. compiled regular expression size, but this should be good enough.)
  14397. * wrec/WRECParser.cpp:
  14398. (JSC::WREC::parsePatternCharacterSequence): Nixed this function because
  14399. it contained a second copy of the logic for handling non-pattern-characters,
  14400. which is about to get a lot more complicated.
  14401. (JSC::WREC::PatternCharacterSequence::PatternCharacterSequence):
  14402. (JSC::WREC::PatternCharacterSequence::size):
  14403. (JSC::WREC::PatternCharacterSequence::append):
  14404. (JSC::WREC::PatternCharacterSequence::flush): Helper object for generating
  14405. an optimized sequence of pattern characters.
  14406. (JSC::WREC::Parser::parseNonCharacterEscape): Renamed to reflect the fact
  14407. that the main parseAlternative loop handles character escapes.
  14408. (JSC::WREC::Parser::parseAlternative): Moved pattern character sequence
  14409. logic from parsePatternCharacterSequence to here, using
  14410. PatternCharacterSequence to help with the details.
  14411. * wrec/WRECParser.h: Updated for renames.
  14412. 2008-12-08 Alexey Proskuryakov <ap@webkit.org>
  14413. Reviewed by Geoff Garen.
  14414. <rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
  14415. and un-deprecate it
  14416. * API/JSContextRef.cpp: (JSGlobalContextCreate):
  14417. * API/JSContextRef.h:
  14418. Use a unique context group for the context, unless the application was linked against old
  14419. JavaScriptCore.
  14420. 2008-12-08 Sam Weinig <sam@webkit.org>
  14421. Reviewed by Cameron Zwarich.
  14422. Fix for <rdar://problem/6428332> Remove the CTI return address table from CodeBlock
  14423. Step 1:
  14424. Remove use of jitReturnAddressVPCMap when looking for vPC to store Structures
  14425. in for cached lookup. Instead, use the offset in the StructureStubInfo that is
  14426. already required.
  14427. * bytecode/CodeBlock.cpp:
  14428. (JSC::CodeBlock::dumpStatistics): Fix extraneous semicolon.
  14429. * interpreter/Interpreter.cpp:
  14430. (JSC::Interpreter::tryCTICachePutByID):
  14431. (JSC::Interpreter::tryCTICacheGetByID):
  14432. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  14433. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  14434. * jit/JIT.h:
  14435. (JSC::JIT::compileGetByIdSelf):
  14436. (JSC::JIT::compileGetByIdProto):
  14437. (JSC::JIT::compileGetByIdChain):
  14438. (JSC::JIT::compilePutByIdReplace):
  14439. (JSC::JIT::compilePutByIdTransition):
  14440. * jit/JITPropertyAccess.cpp:
  14441. (JSC::JIT::privateCompilePutByIdTransition):
  14442. (JSC::JIT::patchGetByIdSelf):
  14443. (JSC::JIT::patchPutByIdReplace):
  14444. (JSC::JIT::privateCompilePatchGetArrayLength): Remove extra call to getStubInfo.
  14445. (JSC::JIT::privateCompileGetByIdSelf):
  14446. (JSC::JIT::privateCompileGetByIdProto):
  14447. (JSC::JIT::privateCompileGetByIdChain):
  14448. (JSC::JIT::privateCompilePutByIdReplace):
  14449. 2008-12-08 Gavin Barraclough <barraclough@apple.com>
  14450. Reviewed by Oliver Hunt.
  14451. Port the op_j?n?eq_null JIT code generation to use the MacroAssembler,
  14452. and clean up slightly at the same time. The 'j' forms currently compare,
  14453. then set a register, then compare again, then branch. Branch directly on
  14454. the result of the first compare.
  14455. Around a 1% progression on deltablue, crypto & early boyer, for about 1/2%
  14456. overall on v8-tests.
  14457. * jit/JIT.cpp:
  14458. (JSC::JIT::privateCompileMainPass):
  14459. * jit/JITPropertyAccess.cpp:
  14460. (JSC::JIT::compileGetByIdSlowCase):
  14461. 2008-12-08 Gavin Barraclough <barraclough@apple.com>
  14462. Reviewed by Geoff Garen.
  14463. Expand MacroAssembler to support more operations, required by the JIT.
  14464. Generally adds more operations and permutations of operands to the existing
  14465. interface. Rename 'jset' to 'jnz' and 'jnset' to 'jz', which seem clearer,
  14466. and require that immediate pointer operands (though not pointer addresses to
  14467. load and store instructions) are wrapped in a ImmPtr() type, akin to Imm32().
  14468. No performance impact.
  14469. * assembler/MacroAssembler.h:
  14470. (JSC::MacroAssembler::):
  14471. (JSC::MacroAssembler::ImmPtr::ImmPtr):
  14472. (JSC::MacroAssembler::add32):
  14473. (JSC::MacroAssembler::and32):
  14474. (JSC::MacroAssembler::or32):
  14475. (JSC::MacroAssembler::sub32):
  14476. (JSC::MacroAssembler::xor32):
  14477. (JSC::MacroAssembler::loadPtr):
  14478. (JSC::MacroAssembler::load32):
  14479. (JSC::MacroAssembler::storePtr):
  14480. (JSC::MacroAssembler::store32):
  14481. (JSC::MacroAssembler::poke):
  14482. (JSC::MacroAssembler::move):
  14483. (JSC::MacroAssembler::testImm32):
  14484. (JSC::MacroAssembler::jae32):
  14485. (JSC::MacroAssembler::jb32):
  14486. (JSC::MacroAssembler::jePtr):
  14487. (JSC::MacroAssembler::je32):
  14488. (JSC::MacroAssembler::jnePtr):
  14489. (JSC::MacroAssembler::jne32):
  14490. (JSC::MacroAssembler::jnzPtr):
  14491. (JSC::MacroAssembler::jnz32):
  14492. (JSC::MacroAssembler::jzPtr):
  14493. (JSC::MacroAssembler::jz32):
  14494. (JSC::MacroAssembler::joSub32):
  14495. (JSC::MacroAssembler::jump):
  14496. (JSC::MacroAssembler::sete32):
  14497. (JSC::MacroAssembler::setne32):
  14498. (JSC::MacroAssembler::setnz32):
  14499. (JSC::MacroAssembler::setz32):
  14500. * assembler/X86Assembler.h:
  14501. (JSC::X86Assembler::addl_mr):
  14502. (JSC::X86Assembler::andl_i8r):
  14503. (JSC::X86Assembler::cmpl_rm):
  14504. (JSC::X86Assembler::cmpl_mr):
  14505. (JSC::X86Assembler::cmpl_i8m):
  14506. (JSC::X86Assembler::subl_mr):
  14507. (JSC::X86Assembler::testl_i32m):
  14508. (JSC::X86Assembler::xorl_i32r):
  14509. (JSC::X86Assembler::movl_rm):
  14510. (JSC::X86Assembler::modRm_opmsib):
  14511. * jit/JIT.cpp:
  14512. (JSC::JIT::privateCompileMainPass):
  14513. * jit/JITInlineMethods.h:
  14514. (JSC::JIT::emitGetVirtualRegister):
  14515. (JSC::JIT::emitPutCTIArgConstant):
  14516. (JSC::JIT::emitPutCTIParam):
  14517. (JSC::JIT::emitPutImmediateToCallFrameHeader):
  14518. (JSC::JIT::emitInitRegister):
  14519. (JSC::JIT::checkStructure):
  14520. (JSC::JIT::emitJumpIfJSCell):
  14521. (JSC::JIT::emitJumpIfNotJSCell):
  14522. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  14523. 2008-12-08 Geoffrey Garen <ggaren@apple.com>
  14524. Reviewed by Sam Weinig.
  14525. Fixed a bug where WREC would allow a quantifier whose minimum was
  14526. greater than its maximum.
  14527. * wrec/Quantifier.h:
  14528. (JSC::WREC::Quantifier::Quantifier): ASSERT that the quantifier is not
  14529. backwards.
  14530. * wrec/WRECParser.cpp:
  14531. (JSC::WREC::Parser::consumeGreedyQuantifier): Verify that the minimum
  14532. is not greater than the maximum.
  14533. 2008-12-08 Eric Seidel <eric@webkit.org>
  14534. Build fix only, no review.
  14535. * JavaScriptCore.scons: add bytecode/JumpTable.cpp
  14536. 2008-12-08 Sam Weinig <sam@webkit.org>
  14537. Reviewed by Geoffrey Garen.
  14538. Patch for https://bugs.webkit.org/show_bug.cgi?id=22716
  14539. <rdar://problem/6428315>
  14540. Add RareData structure to CodeBlock for infrequently used auxiliary data
  14541. members.
  14542. Reduces memory on Membuster-head by ~.5MB
  14543. * bytecode/CodeBlock.cpp:
  14544. (JSC::CodeBlock::dump):
  14545. (JSC::CodeBlock::dumpStatistics):
  14546. (JSC::CodeBlock::mark):
  14547. (JSC::CodeBlock::getHandlerForVPC):
  14548. (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
  14549. (JSC::CodeBlock::shrinkToFit):
  14550. * bytecode/CodeBlock.h:
  14551. (JSC::CodeBlock::numberOfExceptionHandlers):
  14552. (JSC::CodeBlock::addExceptionHandler):
  14553. (JSC::CodeBlock::exceptionHandler):
  14554. (JSC::CodeBlock::addFunction):
  14555. (JSC::CodeBlock::function):
  14556. (JSC::CodeBlock::addUnexpectedConstant):
  14557. (JSC::CodeBlock::unexpectedConstant):
  14558. (JSC::CodeBlock::addRegExp):
  14559. (JSC::CodeBlock::regexp):
  14560. (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
  14561. (JSC::CodeBlock::addImmediateSwitchJumpTable):
  14562. (JSC::CodeBlock::immediateSwitchJumpTable):
  14563. (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
  14564. (JSC::CodeBlock::addCharacterSwitchJumpTable):
  14565. (JSC::CodeBlock::characterSwitchJumpTable):
  14566. (JSC::CodeBlock::numberOfStringSwitchJumpTables):
  14567. (JSC::CodeBlock::addStringSwitchJumpTable):
  14568. (JSC::CodeBlock::stringSwitchJumpTable):
  14569. (JSC::CodeBlock::evalCodeCache):
  14570. (JSC::CodeBlock::createRareDataIfNecessary):
  14571. 2008-11-26 Peter Kasting <pkasting@google.com>
  14572. Reviewed by Anders Carlsson.
  14573. https://bugs.webkit.org/show_bug.cgi?id=16814
  14574. Allow ports to disable ActiveX->NPAPI conversion for Media Player.
  14575. Improve handling of miscellaneous ActiveX objects.
  14576. * wtf/Platform.h: Add another ENABLE(...).
  14577. 2008-12-08 Sam Weinig <sam@webkit.org>
  14578. Reviewed by Mark Rowe.
  14579. Add dumping of CodeBlock member structure usage.
  14580. * bytecode/CodeBlock.cpp:
  14581. (JSC::CodeBlock::dumpStatistics):
  14582. * bytecode/EvalCodeCache.h:
  14583. (JSC::EvalCodeCache::isEmpty):
  14584. 2008-12-08 David Kilzer <ddkilzer@apple.com>
  14585. Bug 22555: Sort "children" sections in Xcode project files
  14586. <https://bugs.webkit.org/show_bug.cgi?id=22555>
  14587. Reviewed by Eric Seidel.
  14588. * JavaScriptCore.xcodeproj/project.pbxproj: Sorted.
  14589. 2008-12-08 Tony Chang <tony@chromium.org>
  14590. Reviewed by Eric Seidel.
  14591. Enable Pan scrolling only when building on PLATFORM(WIN_OS)
  14592. Previously platforms like Apple Windows WebKit, Cairo Windows WebKit,
  14593. Wx and Chromium were enabling it explicitly, now we just turn it on
  14594. for all WIN_OS, later platforms can turn it off as needed on Windows
  14595. (or turn it on under Linux, etc.)
  14596. https://bugs.webkit.org/show_bug.cgi?id=22698
  14597. * wtf/Platform.h:
  14598. 2008-12-08 Sam Weinig <sam@webkit.org>
  14599. Reviewed by Cameron Zwarich.
  14600. Add basic memory statistics dumping for CodeBlock.
  14601. * bytecode/CodeBlock.cpp:
  14602. (JSC::CodeBlock::dumpStatistics):
  14603. (JSC::CodeBlock::CodeBlock):
  14604. (JSC::CodeBlock::~CodeBlock):
  14605. * bytecode/CodeBlock.h:
  14606. 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
  14607. Fix the Linux build with newer gcc/glibc.
  14608. * jit/ExecutableAllocatorPosix.cpp: Include unistd.h for
  14609. getpagesize(), according to
  14610. http://opengroup.org/onlinepubs/007908775/xsh/getpagesize.html
  14611. 2008-12-08 Simon Hausmann <simon.hausmann@nokia.com>
  14612. Fix the build with Qt on Windows.
  14613. * JavaScriptCore.pri: Compile ExecutableAllocatorWin.cpp on Windows.
  14614. 2008-12-07 Oliver Hunt <oliver@apple.com>
  14615. Reviewed by NOBODY (Buildfix).
  14616. Fix non-WREC builds
  14617. * runtime/RegExp.cpp:
  14618. (JSC::RegExp::RegExp):
  14619. 2008-12-07 Oliver Hunt <oliver@apple.com>
  14620. Reviewed by NOBODY (Build fix).
  14621. Put ENABLE(ASSEMBLER) guards around use of ExecutableAllocator in global data
  14622. Correct Qt and Gtk project files
  14623. * GNUmakefile.am:
  14624. * JavaScriptCore.pri:
  14625. * runtime/JSGlobalData.h:
  14626. 2008-12-07 Oliver Hunt <oliver@apple.com>
  14627. Reviewed by NOBODY (Build fix).
  14628. Add new files to other projects.
  14629. * GNUmakefile.am:
  14630. * JavaScriptCore.pri:
  14631. * JavaScriptCore.pro:
  14632. 2008-12-07 Oliver Hunt <oliver@apple.com>
  14633. Rubber stamped by Mark Rowe.
  14634. Rename ExecutableAllocatorMMAP to the more sensible ExecutableAllocatorPosix
  14635. * JavaScriptCore.xcodeproj/project.pbxproj:
  14636. * jit/ExecutableAllocator.h:
  14637. * jit/ExecutableAllocatorPosix.cpp: Renamed from JavaScriptCore/jit/ExecutableAllocatorMMAP.cpp.
  14638. (JSC::ExecutableAllocator::intializePageSize):
  14639. (JSC::ExecutablePool::systemAlloc):
  14640. (JSC::ExecutablePool::systemRelease):
  14641. 2008-12-07 Oliver Hunt <oliver@apple.com>
  14642. Reviewed by Cameron Zwarich and Sam Weinig
  14643. <rdar://problem/6309878> Need more granular control over allocation of executable memory (21783)
  14644. <https://bugs.webkit.org/show_bug.cgi?id=21783>
  14645. Add a new allocator for use by the JIT that provides executable pages, so
  14646. we can get rid of the current hack that makes the entire heap executable.
  14647. 1-2% progression on SunSpider-v8, 1% on SunSpider. Reduces memory usage as well!
  14648. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  14649. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  14650. * JavaScriptCore.xcodeproj/project.pbxproj:
  14651. * assembler/AssemblerBuffer.h:
  14652. (JSC::AssemblerBuffer::size):
  14653. (JSC::AssemblerBuffer::executableCopy):
  14654. * assembler/MacroAssembler.h:
  14655. (JSC::MacroAssembler::size):
  14656. (JSC::MacroAssembler::copyCode):
  14657. * assembler/X86Assembler.h:
  14658. (JSC::X86Assembler::size):
  14659. (JSC::X86Assembler::executableCopy):
  14660. * bytecode/CodeBlock.cpp:
  14661. (JSC::CodeBlock::~CodeBlock):
  14662. * bytecode/CodeBlock.h:
  14663. (JSC::CodeBlock::executablePool):
  14664. (JSC::CodeBlock::setExecutablePool):
  14665. * bytecode/Instruction.h:
  14666. (JSC::PolymorphicAccessStructureList::derefStructures):
  14667. * interpreter/Interpreter.cpp:
  14668. (JSC::Interpreter::~Interpreter):
  14669. * interpreter/Interpreter.h:
  14670. * jit/ExecutableAllocator.cpp: Added.
  14671. * jit/ExecutableAllocator.h: Added.
  14672. (JSC::ExecutablePool::create):
  14673. (JSC::ExecutablePool::alloc):
  14674. (JSC::ExecutablePool::~ExecutablePool):
  14675. (JSC::ExecutablePool::available):
  14676. (JSC::ExecutablePool::ExecutablePool):
  14677. (JSC::ExecutablePool::poolAllocate):
  14678. (JSC::ExecutableAllocator::ExecutableAllocator):
  14679. (JSC::ExecutableAllocator::poolForSize):
  14680. (JSC::ExecutablePool::sizeForAllocation):
  14681. * jit/ExecutableAllocatorMMAP.cpp: Added.
  14682. (JSC::ExecutableAllocator::intializePageSize):
  14683. (JSC::ExecutablePool::systemAlloc):
  14684. (JSC::ExecutablePool::systemRelease):
  14685. * jit/ExecutableAllocatorWin.cpp: Added.
  14686. (JSC::ExecutableAllocator::intializePageSize):
  14687. (JSC::ExecutablePool::systemAlloc):
  14688. (JSC::ExecutablePool::systemRelease):
  14689. * jit/JIT.cpp:
  14690. (JSC::JIT::privateCompile):
  14691. (JSC::JIT::privateCompileCTIMachineTrampolines):
  14692. * jit/JIT.h:
  14693. (JSC::JIT::compileCTIMachineTrampolines):
  14694. * jit/JITPropertyAccess.cpp:
  14695. (JSC::JIT::privateCompilePutByIdTransition):
  14696. (JSC::JIT::privateCompilePatchGetArrayLength):
  14697. (JSC::JIT::privateCompileGetByIdSelf):
  14698. (JSC::JIT::privateCompileGetByIdProto):
  14699. (JSC::JIT::privateCompileGetByIdSelfList):
  14700. (JSC::JIT::privateCompileGetByIdProtoList):
  14701. (JSC::JIT::privateCompileGetByIdChainList):
  14702. (JSC::JIT::privateCompileGetByIdChain):
  14703. (JSC::JIT::privateCompilePutByIdReplace):
  14704. * parser/Nodes.cpp:
  14705. (JSC::RegExpNode::emitBytecode):
  14706. * runtime/JSGlobalData.h:
  14707. (JSC::JSGlobalData::poolForSize):
  14708. * runtime/RegExp.cpp:
  14709. (JSC::RegExp::RegExp):
  14710. (JSC::RegExp::create):
  14711. (JSC::RegExp::~RegExp):
  14712. * runtime/RegExp.h:
  14713. * runtime/RegExpConstructor.cpp:
  14714. (JSC::constructRegExp):
  14715. * runtime/RegExpPrototype.cpp:
  14716. (JSC::regExpProtoFuncCompile):
  14717. * runtime/StringPrototype.cpp:
  14718. (JSC::stringProtoFuncMatch):
  14719. (JSC::stringProtoFuncSearch):
  14720. * wrec/WREC.cpp:
  14721. (JSC::WREC::Generator::compileRegExp):
  14722. * wrec/WRECGenerator.h:
  14723. * wtf/FastMalloc.cpp:
  14724. * wtf/FastMalloc.h:
  14725. * wtf/TCSystemAlloc.cpp:
  14726. (TryMmap):
  14727. (TryVirtualAlloc):
  14728. (TryDevMem):
  14729. (TCMalloc_SystemRelease):
  14730. 2008-12-06 Sam Weinig <sam@webkit.org>
  14731. Fix the Gtk build.
  14732. * jit/JITPropertyAccess.cpp:
  14733. (JSC::JIT::compileGetByIdHotPath):
  14734. (JSC::JIT::compilePutByIdHotPath):
  14735. 2008-12-06 Sam Weinig <sam@webkit.org>
  14736. Reviewed by Cameron Zwarich,
  14737. Move CodeBlock constructor into the .cpp file.
  14738. Sunspider reports a .7% progression, but I can only assume this
  14739. is noise.
  14740. * bytecode/CodeBlock.cpp:
  14741. (JSC::CodeBlock::CodeBlock):
  14742. * bytecode/CodeBlock.h:
  14743. 2008-12-06 Sam Weinig <sam@webkit.org>
  14744. Reviewed by Cameron Zwarich.
  14745. Split JumpTable code into its own file.
  14746. * GNUmakefile.am:
  14747. * JavaScriptCore.pri:
  14748. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  14749. * JavaScriptCore.xcodeproj/project.pbxproj:
  14750. * JavaScriptCoreSources.bkl:
  14751. * bytecode/CodeBlock.cpp:
  14752. * bytecode/CodeBlock.h:
  14753. * bytecode/JumpTable.cpp: Copied from bytecode/CodeBlock.cpp.
  14754. * bytecode/JumpTable.h: Copied from bytecode/CodeBlock.h.
  14755. 2008-12-05 Sam Weinig <sam@webkit.org>
  14756. Reviewed by Cameron Zwarich.
  14757. Fix for https://bugs.webkit.org/show_bug.cgi?id=22715
  14758. Encapsulate more CodeBlock members in preparation
  14759. of moving some of them to a rare data structure.
  14760. * bytecode/CodeBlock.cpp:
  14761. (JSC::locationForOffset):
  14762. (JSC::printConditionalJump):
  14763. (JSC::printGetByIdOp):
  14764. (JSC::printPutByIdOp):
  14765. (JSC::CodeBlock::printStructure):
  14766. (JSC::CodeBlock::printStructures):
  14767. (JSC::CodeBlock::dump):
  14768. (JSC::CodeBlock::~CodeBlock):
  14769. (JSC::CodeBlock::unlinkCallers):
  14770. (JSC::CodeBlock::derefStructures):
  14771. (JSC::CodeBlock::refStructures):
  14772. (JSC::CodeBlock::mark):
  14773. (JSC::CodeBlock::getHandlerForVPC):
  14774. (JSC::CodeBlock::nativeExceptionCodeForHandlerVPC):
  14775. (JSC::CodeBlock::lineNumberForVPC):
  14776. (JSC::CodeBlock::expressionRangeForVPC):
  14777. (JSC::CodeBlock::shrinkToFit):
  14778. * bytecode/CodeBlock.h:
  14779. (JSC::CodeBlock::CodeBlock):
  14780. (JSC::CodeBlock::addCaller):
  14781. (JSC::CodeBlock::removeCaller):
  14782. (JSC::CodeBlock::isKnownNotImmediate):
  14783. (JSC::CodeBlock::isConstantRegisterIndex):
  14784. (JSC::CodeBlock::getConstant):
  14785. (JSC::CodeBlock::isTemporaryRegisterIndex):
  14786. (JSC::CodeBlock::getStubInfo):
  14787. (JSC::CodeBlock::getCallLinkInfo):
  14788. (JSC::CodeBlock::instructions):
  14789. (JSC::CodeBlock::setJITCode):
  14790. (JSC::CodeBlock::jitCode):
  14791. (JSC::CodeBlock::ownerNode):
  14792. (JSC::CodeBlock::setGlobalData):
  14793. (JSC::CodeBlock::setThisRegister):
  14794. (JSC::CodeBlock::thisRegister):
  14795. (JSC::CodeBlock::setNeedsFullScopeChain):
  14796. (JSC::CodeBlock::needsFullScopeChain):
  14797. (JSC::CodeBlock::setUsesEval):
  14798. (JSC::CodeBlock::usesEval):
  14799. (JSC::CodeBlock::setUsesArguments):
  14800. (JSC::CodeBlock::usesArguments):
  14801. (JSC::CodeBlock::codeType):
  14802. (JSC::CodeBlock::source):
  14803. (JSC::CodeBlock::sourceOffset):
  14804. (JSC::CodeBlock::addGlobalResolveInstruction):
  14805. (JSC::CodeBlock::numberOfPropertyAccessInstructions):
  14806. (JSC::CodeBlock::addPropertyAccessInstruction):
  14807. (JSC::CodeBlock::propertyAccessInstruction):
  14808. (JSC::CodeBlock::numberOfCallLinkInfos):
  14809. (JSC::CodeBlock::addCallLinkInfo):
  14810. (JSC::CodeBlock::callLinkInfo):
  14811. (JSC::CodeBlock::numberOfJumpTargets):
  14812. (JSC::CodeBlock::addJumpTarget):
  14813. (JSC::CodeBlock::jumpTarget):
  14814. (JSC::CodeBlock::lastJumpTarget):
  14815. (JSC::CodeBlock::numberOfExceptionHandlers):
  14816. (JSC::CodeBlock::addExceptionHandler):
  14817. (JSC::CodeBlock::exceptionHandler):
  14818. (JSC::CodeBlock::addExpressionInfo):
  14819. (JSC::CodeBlock::numberOfLineInfos):
  14820. (JSC::CodeBlock::addLineInfo):
  14821. (JSC::CodeBlock::lastLineInfo):
  14822. (JSC::CodeBlock::jitReturnAddressVPCMap):
  14823. (JSC::CodeBlock::numberOfIdentifiers):
  14824. (JSC::CodeBlock::addIdentifier):
  14825. (JSC::CodeBlock::identifier):
  14826. (JSC::CodeBlock::numberOfConstantRegisters):
  14827. (JSC::CodeBlock::addConstantRegister):
  14828. (JSC::CodeBlock::constantRegister):
  14829. (JSC::CodeBlock::addFunction):
  14830. (JSC::CodeBlock::function):
  14831. (JSC::CodeBlock::addFunctionExpression):
  14832. (JSC::CodeBlock::functionExpression):
  14833. (JSC::CodeBlock::addUnexpectedConstant):
  14834. (JSC::CodeBlock::unexpectedConstant):
  14835. (JSC::CodeBlock::addRegExp):
  14836. (JSC::CodeBlock::regexp):
  14837. (JSC::CodeBlock::symbolTable):
  14838. (JSC::CodeBlock::evalCodeCache):
  14839. New inline setters/getters.
  14840. (JSC::ProgramCodeBlock::ProgramCodeBlock):
  14841. (JSC::ProgramCodeBlock::~ProgramCodeBlock):
  14842. (JSC::ProgramCodeBlock::clearGlobalObject):
  14843. * bytecode/SamplingTool.cpp:
  14844. (JSC::ScopeSampleRecord::sample):
  14845. (JSC::SamplingTool::dump):
  14846. * bytecompiler/BytecodeGenerator.cpp:
  14847. * bytecompiler/BytecodeGenerator.h:
  14848. * bytecompiler/Label.h:
  14849. * interpreter/CallFrame.cpp:
  14850. * interpreter/Interpreter.cpp:
  14851. * jit/JIT.cpp:
  14852. * jit/JITCall.cpp:
  14853. * jit/JITInlineMethods.h:
  14854. * jit/JITPropertyAccess.cpp:
  14855. * parser/Nodes.cpp:
  14856. * runtime/Arguments.h:
  14857. * runtime/ExceptionHelpers.cpp:
  14858. * runtime/JSActivation.cpp:
  14859. * runtime/JSActivation.h:
  14860. * runtime/JSGlobalObject.cpp:
  14861. Change direct access to use new getter/setters.
  14862. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14863. Reviewed by Oliver Hunt.
  14864. Prevent GCC4.2 from hanging when trying to compile Interpreter.cpp.
  14865. Added "-fno-var-tracking" compiler flag.
  14866. https://bugs.webkit.org/show_bug.cgi?id=22704
  14867. * JavaScriptCore.xcodeproj/project.pbxproj:
  14868. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14869. Reviewed by Oliver Hunt.
  14870. Ordering of branch operands in MacroAssembler in unnecessarily inconsistent.
  14871. je, jg etc take an immediate operand as the second argument, but for the
  14872. equality branches (je, jne) the immediate operand was the first argument. This
  14873. was unnecessarily inconsistent. Change je, jne methods to take the immediate
  14874. as the second argument.
  14875. https://bugs.webkit.org/show_bug.cgi?id=22703
  14876. * assembler/MacroAssembler.h:
  14877. (JSC::MacroAssembler::je32):
  14878. (JSC::MacroAssembler::jne32):
  14879. * jit/JIT.cpp:
  14880. (JSC::JIT::compileOpStrictEq):
  14881. * wrec/WRECGenerator.cpp:
  14882. (JSC::WREC::Generator::generateEnter):
  14883. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  14884. (JSC::WREC::Generator::generateGreedyQuantifier):
  14885. (JSC::WREC::Generator::generatePatternCharacterPair):
  14886. (JSC::WREC::Generator::generatePatternCharacter):
  14887. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  14888. (JSC::WREC::Generator::generateCharacterClassInverted):
  14889. (JSC::WREC::Generator::generateAssertionBOL):
  14890. (JSC::WREC::Generator::generateAssertionWordBoundary):
  14891. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14892. Reviewed by Geoff Garen.
  14893. Second tranche of porting JIT.cpp to MacroAssembler interface.
  14894. * assembler/MacroAssembler.h:
  14895. (JSC::MacroAssembler::mul32):
  14896. (JSC::MacroAssembler::jl32):
  14897. (JSC::MacroAssembler::jnzSub32):
  14898. (JSC::MacroAssembler::joAdd32):
  14899. (JSC::MacroAssembler::joMul32):
  14900. (JSC::MacroAssembler::jzSub32):
  14901. * jit/JIT.cpp:
  14902. (JSC::JIT::emitSlowScriptCheck):
  14903. (JSC::JIT::privateCompileMainPass):
  14904. (JSC::JIT::privateCompileSlowCases):
  14905. (JSC::JIT::privateCompileCTIMachineTrampolines):
  14906. * jit/JIT.h:
  14907. * jit/JITInlineMethods.h:
  14908. (JSC::JIT::emitJumpIfNotJSCell):
  14909. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  14910. 2008-12-05 David Kilzer <ddkilzer@apple.com>
  14911. Bug 22609: Provide a build-time choice when generating hash tables for properties of built-in DOM objects
  14912. <https://bugs.webkit.org/show_bug.cgi?id=22609>
  14913. <rdar://problem/6331749>
  14914. Reviewed by Darin Adler.
  14915. Initial patch by Yosen Lin. Adapted for ToT WebKit by David Kilzer.
  14916. Added back the code that generates a "compact" hash (instead of a
  14917. perfect hash) as a build-time option using the
  14918. ENABLE(PERFECT_HASH_SIZE) macro as defined in Lookup.h.
  14919. * create_hash_table: Rename variables to differentiate perfect hash
  14920. values from compact hash values. Added back code to compute compact
  14921. hash tables. Generate both hash table sizes and emit
  14922. conditionalized code based on ENABLE(PERFECT_HASH_SIZE).
  14923. * runtime/Lookup.cpp:
  14924. (JSC::HashTable::createTable): Added version of createTable() for
  14925. use with compact hash tables.
  14926. (JSC::HashTable::deleteTable): Updated to work with compact hash
  14927. tables.
  14928. * runtime/Lookup.h: Defined ENABLE(PERFECT_HASH_SIZE) macro here.
  14929. (JSC::HashEntry::initialize): Set m_next to zero when using compact
  14930. hash tables.
  14931. (JSC::HashEntry::setNext): Added for compact hash tables.
  14932. (JSC::HashEntry::next): Added for compact hash tables.
  14933. (JSC::HashTable::entry): Added version of entry() for use with
  14934. compact hash tables.
  14935. * runtime/Structure.cpp:
  14936. (JSC::Structure::getEnumerablePropertyNames): Updated to work with
  14937. compact hash tables.
  14938. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14939. Reviewed by Geoff Garen.
  14940. Remove redundant calls to JIT::emitSlowScriptCheck.
  14941. This is checked in the hot path, so is not needed on the slow path - and the code
  14942. was being planted before the start of the slow case, so was completely unreachable!
  14943. * jit/JIT.cpp:
  14944. (JSC::JIT::privateCompileSlowCases):
  14945. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14946. Reviewed by Geoff Garen.
  14947. Move JIT::compileOpStrictEq to MacroAssembler interface.
  14948. The rewrite also looks like a small (<1%) performance progression.
  14949. https://bugs.webkit.org/show_bug.cgi?id=22697
  14950. * jit/JIT.cpp:
  14951. (JSC::JIT::compileOpStrictEq):
  14952. (JSC::JIT::privateCompileSlowCases):
  14953. * jit/JIT.h:
  14954. * jit/JITInlineMethods.h:
  14955. (JSC::JIT::emitJumpIfJSCell):
  14956. (JSC::JIT::emitJumpSlowCaseIfJSCell):
  14957. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  14958. Reviewed by Geoff Garen.
  14959. Remove m_assembler from MacroAssembler::Jump.
  14960. Keeping a pointer allowed for some syntactic sugar - "link()" looks nicer
  14961. than "link(this)". But maintaining this doubles the size of Jump, which
  14962. is even more unfortunate for the JIT, since there are many large structures
  14963. holding JmpSrcs. Probably best to remove it.
  14964. https://bugs.webkit.org/show_bug.cgi?id=22693
  14965. * assembler/MacroAssembler.h:
  14966. (JSC::MacroAssembler::Jump::Jump):
  14967. (JSC::MacroAssembler::Jump::link):
  14968. (JSC::MacroAssembler::Jump::linkTo):
  14969. (JSC::MacroAssembler::JumpList::link):
  14970. (JSC::MacroAssembler::JumpList::linkTo):
  14971. (JSC::MacroAssembler::jae32):
  14972. (JSC::MacroAssembler::je32):
  14973. (JSC::MacroAssembler::je16):
  14974. (JSC::MacroAssembler::jg32):
  14975. (JSC::MacroAssembler::jge32):
  14976. (JSC::MacroAssembler::jl32):
  14977. (JSC::MacroAssembler::jle32):
  14978. (JSC::MacroAssembler::jnePtr):
  14979. (JSC::MacroAssembler::jne32):
  14980. (JSC::MacroAssembler::jnset32):
  14981. (JSC::MacroAssembler::jset32):
  14982. (JSC::MacroAssembler::jump):
  14983. (JSC::MacroAssembler::jzSub32):
  14984. (JSC::MacroAssembler::joAdd32):
  14985. (JSC::MacroAssembler::call):
  14986. * wrec/WREC.cpp:
  14987. (JSC::WREC::Generator::compileRegExp):
  14988. * wrec/WRECGenerator.cpp:
  14989. (JSC::WREC::Generator::generateEnter):
  14990. (JSC::WREC::Generator::generateBackreferenceQuantifier):
  14991. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  14992. (JSC::WREC::Generator::generateGreedyQuantifier):
  14993. (JSC::WREC::Generator::generatePatternCharacter):
  14994. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  14995. (JSC::WREC::Generator::generateCharacterClassInverted):
  14996. (JSC::WREC::Generator::generateCharacterClass):
  14997. (JSC::WREC::Generator::generateParenthesesAssertion):
  14998. (JSC::WREC::Generator::generateParenthesesInvertedAssertion):
  14999. (JSC::WREC::Generator::generateParenthesesNonGreedy):
  15000. (JSC::WREC::Generator::generateParenthesesResetTrampoline):
  15001. (JSC::WREC::Generator::generateAssertionBOL):
  15002. (JSC::WREC::Generator::generateAssertionEOL):
  15003. (JSC::WREC::Generator::generateAssertionWordBoundary):
  15004. (JSC::WREC::Generator::generateBackreference):
  15005. (JSC::WREC::Generator::terminateAlternative):
  15006. (JSC::WREC::Generator::terminateDisjunction):
  15007. * wrec/WRECParser.h:
  15008. 2008-12-05 Gavin Barraclough <barraclough@apple.com>
  15009. Reviewed by Geoffrey Garen.
  15010. Simplify JIT generated checks for timeout code, by moving more work into the C function.
  15011. https://bugs.webkit.org/show_bug.cgi?id=22688
  15012. * interpreter/Interpreter.cpp:
  15013. (JSC::Interpreter::cti_timeout_check):
  15014. * interpreter/Interpreter.h:
  15015. * jit/JIT.cpp:
  15016. (JSC::JIT::emitSlowScriptCheck):
  15017. 2008-12-05 Sam Weinig <sam@webkit.org>
  15018. Reviewed by Geoffrey Garen.
  15019. Encapsulate access to jump tables in the CodeBlock in preparation
  15020. of moving them to a rare data structure.
  15021. * bytecode/CodeBlock.cpp:
  15022. (JSC::CodeBlock::dump):
  15023. (JSC::CodeBlock::shrinkToFit):
  15024. * bytecode/CodeBlock.h:
  15025. (JSC::CodeBlock::numberOfImmediateSwitchJumpTables):
  15026. (JSC::CodeBlock::addImmediateSwitchJumpTable):
  15027. (JSC::CodeBlock::immediateSwitchJumpTable):
  15028. (JSC::CodeBlock::numberOfCharacterSwitchJumpTables):
  15029. (JSC::CodeBlock::addCharacterSwitchJumpTable):
  15030. (JSC::CodeBlock::characterSwitchJumpTable):
  15031. (JSC::CodeBlock::numberOfStringSwitchJumpTables):
  15032. (JSC::CodeBlock::addStringSwitchJumpTable):
  15033. (JSC::CodeBlock::stringSwitchJumpTable):
  15034. * bytecompiler/BytecodeGenerator.cpp:
  15035. (JSC::BytecodeGenerator::generate):
  15036. (JSC::BytecodeGenerator::endSwitch):
  15037. * interpreter/Interpreter.cpp:
  15038. (JSC::Interpreter::privateExecute):
  15039. (JSC::Interpreter::cti_op_switch_imm):
  15040. (JSC::Interpreter::cti_op_switch_char):
  15041. (JSC::Interpreter::cti_op_switch_string):
  15042. * jit/JIT.cpp:
  15043. (JSC::JIT::privateCompileMainPass):
  15044. 2008-12-05 Adam Roben <aroben@apple.com>
  15045. Windows build fix after r39020
  15046. * jit/JITInlineMethods.h:
  15047. (JSC::JIT::restoreArgumentReference):
  15048. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  15049. Add some apparently-missing __.
  15050. 2008-12-04 Geoffrey Garen <ggaren@apple.com>
  15051. Reviewed by Darin Adler.
  15052. https://bugs.webkit.org/show_bug.cgi?id=22673
  15053. Added support for the assertion (?=) and inverted assertion (?!) atoms
  15054. in WREC.
  15055. * wrec/WRECGenerator.cpp:
  15056. (JSC::WREC::Generator::generateParenthesesAssertion):
  15057. (JSC::WREC::Generator::generateParenthesesInvertedAssertion): Split the
  15058. old (unused) generateParentheses into these two functions, with more
  15059. limited capabilities.
  15060. * wrec/WRECGenerator.h:
  15061. (JSC::WREC::Generator::): Moved an enum to the top of the class definition,
  15062. to match the WebKit style, and removed a defunct comment.
  15063. * wrec/WRECParser.cpp:
  15064. (JSC::WREC::Parser::parseParentheses):
  15065. (JSC::WREC::Parser::consumeParenthesesType):
  15066. * wrec/WRECParser.h:
  15067. (JSC::WREC::Parser::): Added support for parsing (?=) and (?!).
  15068. 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
  15069. Rubber-stamped by Tor Arne Vestbø.
  15070. Disable the JIT for the Qt build alltogether again, after observing
  15071. more miscompilations in a wider range of newer gcc versions.
  15072. * JavaScriptCore.pri:
  15073. 2008-12-05 Simon Hausmann <simon.hausmann@nokia.com>
  15074. Reviewed by Tor Arne Vestbø.
  15075. Disable the JIT for the Qt build on Linux unless gcc is >= 4.2,
  15076. due to miscompilations.
  15077. * JavaScriptCore.pri:
  15078. 2008-12-04 Gavin Barraclough <barraclough@apple.com>
  15079. Reviewed by Geoff Garen.
  15080. Start porting the JIT to use the MacroAssembler.
  15081. https://bugs.webkit.org/show_bug.cgi?id=22671
  15082. No change in performance.
  15083. * assembler/MacroAssembler.h:
  15084. (JSC::MacroAssembler::Jump::operator X86Assembler::JmpSrc):
  15085. (JSC::MacroAssembler::add32):
  15086. (JSC::MacroAssembler::and32):
  15087. (JSC::MacroAssembler::lshift32):
  15088. (JSC::MacroAssembler::rshift32):
  15089. (JSC::MacroAssembler::storePtr):
  15090. (JSC::MacroAssembler::store32):
  15091. (JSC::MacroAssembler::poke):
  15092. (JSC::MacroAssembler::move):
  15093. (JSC::MacroAssembler::compareImm32ForBranchEquality):
  15094. (JSC::MacroAssembler::jnePtr):
  15095. (JSC::MacroAssembler::jnset32):
  15096. (JSC::MacroAssembler::jset32):
  15097. (JSC::MacroAssembler::jzeroSub32):
  15098. (JSC::MacroAssembler::joverAdd32):
  15099. (JSC::MacroAssembler::call):
  15100. * assembler/X86Assembler.h:
  15101. (JSC::X86Assembler::shll_i8r):
  15102. * jit/JIT.cpp:
  15103. (JSC::JIT::privateCompileMainPass):
  15104. (JSC::JIT::privateCompile):
  15105. (JSC::JIT::privateCompileCTIMachineTrampolines):
  15106. * jit/JIT.h:
  15107. * jit/JITArithmetic.cpp:
  15108. (JSC::JIT::compileBinaryArithOp):
  15109. * jit/JITInlineMethods.h:
  15110. (JSC::JIT::emitGetVirtualRegister):
  15111. (JSC::JIT::emitPutCTIArg):
  15112. (JSC::JIT::emitPutCTIArgConstant):
  15113. (JSC::JIT::emitGetCTIArg):
  15114. (JSC::JIT::emitPutCTIArgFromVirtualRegister):
  15115. (JSC::JIT::emitPutCTIParam):
  15116. (JSC::JIT::emitGetCTIParam):
  15117. (JSC::JIT::emitPutToCallFrameHeader):
  15118. (JSC::JIT::emitPutImmediateToCallFrameHeader):
  15119. (JSC::JIT::emitGetFromCallFrameHeader):
  15120. (JSC::JIT::emitPutVirtualRegister):
  15121. (JSC::JIT::emitInitRegister):
  15122. (JSC::JIT::emitNakedCall):
  15123. (JSC::JIT::restoreArgumentReference):
  15124. (JSC::JIT::restoreArgumentReferenceForTrampoline):
  15125. (JSC::JIT::emitCTICall):
  15126. (JSC::JIT::checkStructure):
  15127. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  15128. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  15129. (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
  15130. (JSC::JIT::emitFastArithDeTagImmediate):
  15131. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  15132. (JSC::JIT::emitFastArithReTagImmediate):
  15133. (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
  15134. (JSC::JIT::emitFastArithImmToInt):
  15135. (JSC::JIT::emitFastArithIntToImmOrSlowCase):
  15136. (JSC::JIT::emitFastArithIntToImmNoCheck):
  15137. (JSC::JIT::emitTagAsBoolImmediate):
  15138. * jit/JITPropertyAccess.cpp:
  15139. (JSC::JIT::privateCompilePutByIdTransition):
  15140. 2008-12-04 Geoffrey Garen <ggaren@apple.com>
  15141. Reviewed by Oliver Hunt.
  15142. Some refactoring for generateGreedyQuantifier.
  15143. SunSpider reports no change (possibly a 0.3% speedup).
  15144. * wrec/WRECGenerator.cpp:
  15145. (JSC::WREC::Generator::generateGreedyQuantifier): Clarified label
  15146. meanings and unified some logic to simplify things.
  15147. * wrec/WRECParser.h:
  15148. (JSC::WREC::Parser::parseAlternative): Added a version of parseAlternative
  15149. that can jump to a Label, instead of a JumpList, upon failure. (Eventually,
  15150. when we have a true Label class, this will be redundant.) This makes
  15151. things easier for generateGreedyQuantifier, because it can avoid
  15152. explicitly linking things.
  15153. 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
  15154. Reviewed by Holger Freyther.
  15155. Fix crashes in the Qt build on Linux/i386 with non-executable memory
  15156. by enabling TCSystemAlloc and the PROT_EXEC flag for mmap.
  15157. * JavaScriptCore.pri: Enable the use of TCSystemAlloc if the JIT is
  15158. enabled.
  15159. * wtf/TCSystemAlloc.cpp: Extend the PROT_EXEC permissions to
  15160. PLATFORM(QT).
  15161. 2008-12-04 Simon Hausmann <simon.hausmann@nokia.com>
  15162. Reviewed by Tor Arne Vestbø.
  15163. Enable ENABLE_JIT_OPTIMIZE_CALL, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS
  15164. and ENABLE_JIT_OPTIMIZE_ARITHMETIC, as suggested by Niko.
  15165. * JavaScriptCore.pri:
  15166. 2008-12-04 Kent Hansen <khansen@trolltech.com>
  15167. Reviewed by Simon Hausmann.
  15168. Enable the JSC jit for the Qt build by default for release builds on
  15169. linux-g++ and win32-msvc.
  15170. * JavaScriptCore.pri:
  15171. 2008-12-04 Gavin Barraclough <barraclough@apple.com>
  15172. Reviewed by Oliver Hunt.
  15173. Allow JIT to function without property access repatching and arithmetic optimizations.
  15174. Controlled by ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS and ENABLE_JIT_OPTIMIZE_ARITHMETIC switches.
  15175. https://bugs.webkit.org/show_bug.cgi?id=22643
  15176. * JavaScriptCore.xcodeproj/project.pbxproj:
  15177. * jit/JIT.cpp:
  15178. (JSC::JIT::privateCompileMainPass):
  15179. (JSC::JIT::privateCompileSlowCases):
  15180. * jit/JIT.h:
  15181. * jit/JITArithmetic.cpp: Copied from jit/JIT.cpp.
  15182. (JSC::JIT::compileBinaryArithOp):
  15183. (JSC::JIT::compileBinaryArithOpSlowCase):
  15184. * jit/JITPropertyAccess.cpp: Copied from jit/JIT.cpp.
  15185. (JSC::JIT::compileGetByIdHotPath):
  15186. (JSC::JIT::compileGetByIdSlowCase):
  15187. (JSC::JIT::compilePutByIdHotPath):
  15188. (JSC::JIT::compilePutByIdSlowCase):
  15189. (JSC::resizePropertyStorage):
  15190. (JSC::transitionWillNeedStorageRealloc):
  15191. (JSC::JIT::privateCompilePutByIdTransition):
  15192. (JSC::JIT::patchGetByIdSelf):
  15193. (JSC::JIT::patchPutByIdReplace):
  15194. (JSC::JIT::privateCompilePatchGetArrayLength):
  15195. * wtf/Platform.h:
  15196. 2008-12-03 Geoffrey Garen <ggaren@apple.com>
  15197. Reviewed by Oliver Hunt.
  15198. Optimized sequences of characters in regular expressions by comparing
  15199. two characters at a time.
  15200. 1-2% speedup on SunSpider, 19-25% speedup on regexp-dna.
  15201. * assembler/MacroAssembler.h:
  15202. (JSC::MacroAssembler::load32):
  15203. (JSC::MacroAssembler::jge32): Filled out a few more macro methods.
  15204. * assembler/X86Assembler.h:
  15205. (JSC::X86Assembler::movl_mr): Added a verion of movl_mr that operates
  15206. without an offset, to allow the macro assembler to optmize for that case.
  15207. * wrec/WREC.cpp:
  15208. (JSC::WREC::Generator::compileRegExp): Test the saved value of index
  15209. instead of the index register when checking for "end of input." The
  15210. index register doesn't increment by 1 in an orderly fashion, so testing
  15211. it for == "end of input" is not valid.
  15212. Also, jump all the way to "return failure" upon reaching "end of input,"
  15213. instead of executing the next alternative. This is more logical, and
  15214. it's a slight optimization in the case of an expression with many alternatives.
  15215. * wrec/WRECGenerator.cpp:
  15216. (JSC::WREC::Generator::generateIncrementIndex): Added support for
  15217. jumping to a failure label in the case where the index has reached "end
  15218. of input."
  15219. (JSC::WREC::Generator::generatePatternCharacterSequence):
  15220. (JSC::WREC::Generator::generatePatternCharacterPair): This is the
  15221. optmization. It's basically like generatePatternCharacter, but it runs two
  15222. characters at a time.
  15223. (JSC::WREC::Generator::generatePatternCharacter): Changed to use isASCII,
  15224. since it's clearer than comparing to a magic hex value.
  15225. * wrec/WRECGenerator.h:
  15226. 2008-12-03 Gavin Barraclough <barraclough@apple.com>
  15227. Reviewed by Cameron Zwarich.
  15228. Allow JIT to operate without the call-repatching optimization.
  15229. Controlled by ENABLE(JIT_OPTIMIZE_CALL), defaults on, disabling
  15230. this leads to significant performance regression.
  15231. https://bugs.webkit.org/show_bug.cgi?id=22639
  15232. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  15233. * JavaScriptCore.xcodeproj/project.pbxproj:
  15234. * jit/JIT.cpp:
  15235. (JSC::JIT::privateCompileSlowCases):
  15236. * jit/JIT.h:
  15237. * jit/JITCall.cpp: Copied from jit/JIT.cpp.
  15238. (JSC::JIT::compileOpCallInitializeCallFrame):
  15239. (JSC::JIT::compileOpCallSetupArgs):
  15240. (JSC::JIT::compileOpCallEvalSetupArgs):
  15241. (JSC::JIT::compileOpConstructSetupArgs):
  15242. (JSC::JIT::compileOpCall):
  15243. (JSC::JIT::compileOpCallSlowCase):
  15244. (JSC::unreachable):
  15245. * jit/JITInlineMethods.h: Copied from jit/JIT.cpp.
  15246. (JSC::JIT::checkStructure):
  15247. (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
  15248. (JSC::JIT::emitTagAsBoolImmediate):
  15249. * wtf/Platform.h:
  15250. 2008-12-03 Eric Seidel <eric@webkit.org>
  15251. Rubber-stamped by David Hyatt.
  15252. Make HAVE_ACCESSIBILITY only define if !defined
  15253. * wtf/Platform.h:
  15254. 2008-12-03 Sam Weinig <sam@webkit.org>
  15255. Fix build.
  15256. * assembler/X86Assembler.h:
  15257. (JSC::X86Assembler::orl_i32r):
  15258. 2008-12-03 Sam Weinig <sam@webkit.org>
  15259. Reviewed by Geoffrey Garen.
  15260. Remove shared AssemblerBuffer 1MB buffer and instead give AssemblerBuffer
  15261. an 256 byte inline capacity.
  15262. 1% progression on Sunspider.
  15263. * assembler/AssemblerBuffer.h:
  15264. (JSC::AssemblerBuffer::AssemblerBuffer):
  15265. (JSC::AssemblerBuffer::~AssemblerBuffer):
  15266. (JSC::AssemblerBuffer::grow):
  15267. * assembler/MacroAssembler.h:
  15268. (JSC::MacroAssembler::MacroAssembler):
  15269. * assembler/X86Assembler.h:
  15270. (JSC::X86Assembler::X86Assembler):
  15271. * interpreter/Interpreter.cpp:
  15272. (JSC::Interpreter::Interpreter):
  15273. * interpreter/Interpreter.h:
  15274. * jit/JIT.cpp:
  15275. (JSC::JIT::JIT):
  15276. * parser/Nodes.cpp:
  15277. (JSC::RegExpNode::emitBytecode):
  15278. * runtime/RegExp.cpp:
  15279. (JSC::RegExp::RegExp):
  15280. (JSC::RegExp::create):
  15281. * runtime/RegExp.h:
  15282. * runtime/RegExpConstructor.cpp:
  15283. (JSC::constructRegExp):
  15284. * runtime/RegExpPrototype.cpp:
  15285. (JSC::regExpProtoFuncCompile):
  15286. * runtime/StringPrototype.cpp:
  15287. (JSC::stringProtoFuncMatch):
  15288. (JSC::stringProtoFuncSearch):
  15289. * wrec/WREC.cpp:
  15290. (JSC::WREC::Generator::compileRegExp):
  15291. * wrec/WRECGenerator.h:
  15292. (JSC::WREC::Generator::Generator):
  15293. * wrec/WRECParser.h:
  15294. (JSC::WREC::Parser::Parser):
  15295. 2008-12-03 Geoffrey Garen <ggaren@apple.com>
  15296. Reviewed by Oliver Hunt, with help from Gavin Barraclough.
  15297. orl_i32r was actually coded as an 8bit OR. So, I renamed orl_i32r to
  15298. orl_i8r, changed all orl_i32r clients to use orl_i8r, and then added
  15299. a new orl_i32r that actually does a 32bit OR.
  15300. (32bit OR is currently unused, but a patch I'm working on uses it.)
  15301. * assembler/MacroAssembler.h:
  15302. (JSC::MacroAssembler::or32): Updated to choose between 8bit and 32bit OR.
  15303. * assembler/X86Assembler.h:
  15304. (JSC::X86Assembler::orl_i8r): The old orl_i32r.
  15305. (JSC::X86Assembler::orl_i32r): The new orl_i32r.
  15306. * jit/JIT.cpp:
  15307. (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
  15308. (JSC::JIT::emitTagAsBoolImmediate): Use orl_i8r, since we're ORing 8bit
  15309. values.
  15310. 2008-12-03 Dean Jackson <dino@apple.com>
  15311. Reviewed by Dan Bernstein.
  15312. Helper functions for turn -> degrees.
  15313. https://bugs.webkit.org/show_bug.cgi?id=22497
  15314. * wtf/MathExtras.h:
  15315. (turn2deg):
  15316. (deg2turn):
  15317. 2008-12-02 Cameron Zwarich <zwarich@apple.com>
  15318. Reviewed by Geoff Garen.
  15319. Bug 22504: Crashes during code generation occur due to refing of ignoredResult()
  15320. <https://bugs.webkit.org/show_bug.cgi?id=22504>
  15321. Since ignoredResult() was implemented by casting 1 to a RegisterID*, any
  15322. attempt to ref ignoredResult() results in a crash. This will occur in
  15323. code generation of a function body where a node emits another node with
  15324. the dst that was passed to it, and then refs the returned RegisterID*.
  15325. To fix this problem, make ignoredResult() a member function of
  15326. BytecodeGenerator that simply returns a pointe to a fixed RegisterID
  15327. member of BytecodeGenerator.
  15328. * bytecompiler/BytecodeGenerator.h:
  15329. (JSC::BytecodeGenerator::ignoredResult):
  15330. * bytecompiler/RegisterID.h:
  15331. * parser/Nodes.cpp:
  15332. (JSC::NullNode::emitBytecode):
  15333. (JSC::BooleanNode::emitBytecode):
  15334. (JSC::NumberNode::emitBytecode):
  15335. (JSC::StringNode::emitBytecode):
  15336. (JSC::RegExpNode::emitBytecode):
  15337. (JSC::ThisNode::emitBytecode):
  15338. (JSC::ResolveNode::emitBytecode):
  15339. (JSC::ObjectLiteralNode::emitBytecode):
  15340. (JSC::PostfixResolveNode::emitBytecode):
  15341. (JSC::PostfixBracketNode::emitBytecode):
  15342. (JSC::PostfixDotNode::emitBytecode):
  15343. (JSC::DeleteValueNode::emitBytecode):
  15344. (JSC::VoidNode::emitBytecode):
  15345. (JSC::TypeOfResolveNode::emitBytecode):
  15346. (JSC::TypeOfValueNode::emitBytecode):
  15347. (JSC::PrefixResolveNode::emitBytecode):
  15348. (JSC::AssignResolveNode::emitBytecode):
  15349. (JSC::CommaNode::emitBytecode):
  15350. (JSC::ForNode::emitBytecode):
  15351. (JSC::ForInNode::emitBytecode):
  15352. (JSC::ReturnNode::emitBytecode):
  15353. (JSC::ThrowNode::emitBytecode):
  15354. (JSC::FunctionBodyNode::emitBytecode):
  15355. (JSC::FuncDeclNode::emitBytecode):
  15356. 2008-12-02 Geoffrey Garen <ggaren@apple.com>
  15357. Reviewed by Cameron Zwarich.
  15358. Fixed https://bugs.webkit.org/show_bug.cgi?id=22537
  15359. REGRESSION (r38745): Assertion failure in jsSubstring() at ge.com
  15360. The bug was that index would become greater than length, so our
  15361. "end of input" checks, which all check "index == length", would fail.
  15362. The solution is to check for end of input before incrementing index,
  15363. to ensure that index is always <= length.
  15364. As a side benefit, generateJumpIfEndOfInput can now use je instead of
  15365. jg, which should be slightly faster.
  15366. * wrec/WREC.cpp:
  15367. (JSC::WREC::Generator::compileRegExp):
  15368. * wrec/WRECGenerator.cpp:
  15369. (JSC::WREC::Generator::generateJumpIfEndOfInput):
  15370. 2008-12-02 Gavin Barraclough <barraclough@apple.com>
  15371. Reviewed by Geoffrey Garen.
  15372. Plant shift right immediate instructions, which are awesome.
  15373. https://bugs.webkit.org/show_bug.cgi?id=22610
  15374. ~5% on the v8-crypto test.
  15375. * jit/JIT.cpp:
  15376. (JSC::JIT::privateCompileMainPass):
  15377. (JSC::JIT::privateCompileSlowCases):
  15378. 2008-12-02 Geoffrey Garen <ggaren@apple.com>
  15379. Reviewed by Sam Weinig.
  15380. Cleaned up SegmentedVector by abstracting segment access into helper
  15381. functions.
  15382. SunSpider reports no change.
  15383. * bytecompiler/SegmentedVector.h:
  15384. (JSC::SegmentedVector::SegmentedVector):
  15385. (JSC::SegmentedVector::~SegmentedVector):
  15386. (JSC::SegmentedVector::size):
  15387. (JSC::SegmentedVector::at):
  15388. (JSC::SegmentedVector::operator[]):
  15389. (JSC::SegmentedVector::last):
  15390. (JSC::SegmentedVector::append):
  15391. (JSC::SegmentedVector::removeLast):
  15392. (JSC::SegmentedVector::grow):
  15393. (JSC::SegmentedVector::clear):
  15394. (JSC::SegmentedVector::deleteAllSegments):
  15395. (JSC::SegmentedVector::segmentFor):
  15396. (JSC::SegmentedVector::subscriptFor):
  15397. (JSC::SegmentedVector::ensureSegmentsFor):
  15398. (JSC::SegmentedVector::ensureSegment):
  15399. 2008-12-02 Geoffrey Garen <ggaren@apple.com>
  15400. Reviewed by Geoffrey Garen. (Patch by Cameron Zwarich <zwarich@apple.com>.)
  15401. Fixed https://bugs.webkit.org/show_bug.cgi?id=22482
  15402. REGRESSION (r37991): Occasionally see "Scene rendered incorrectly"
  15403. message when running the V8 Raytrace benchmark
  15404. Rolled out r37991. It didn't properly save xmm0, which is caller-save,
  15405. before calling helper functions.
  15406. SunSpider and v8 benchmarks show little change -- possibly a .2%
  15407. SunSpider regression, possibly a .2% v8 benchmark speedup.
  15408. * assembler/X86Assembler.h:
  15409. (JSC::X86Assembler::):
  15410. * bytecode/CodeBlock.cpp:
  15411. (JSC::CodeBlock::dump):
  15412. * bytecode/Instruction.h:
  15413. (JSC::Instruction::):
  15414. * bytecompiler/BytecodeGenerator.cpp:
  15415. (JSC::BytecodeGenerator::emitUnaryOp):
  15416. * bytecompiler/BytecodeGenerator.h:
  15417. (JSC::BytecodeGenerator::emitToJSNumber):
  15418. (JSC::BytecodeGenerator::emitTypeOf):
  15419. (JSC::BytecodeGenerator::emitGetPropertyNames):
  15420. * interpreter/Interpreter.cpp:
  15421. (JSC::Interpreter::privateExecute):
  15422. * interpreter/Interpreter.h:
  15423. * jit/JIT.cpp:
  15424. (JSC::JIT::privateCompileMainPass):
  15425. (JSC::JIT::privateCompileSlowCases):
  15426. * jit/JIT.h:
  15427. * parser/Nodes.cpp:
  15428. (JSC::UnaryOpNode::emitBytecode):
  15429. (JSC::BinaryOpNode::emitBytecode):
  15430. (JSC::EqualNode::emitBytecode):
  15431. * parser/ResultType.h:
  15432. (JSC::ResultType::isReusable):
  15433. (JSC::ResultType::mightBeNumber):
  15434. * runtime/JSNumberCell.h:
  15435. 2008-12-01 Gavin Barraclough <barraclough@apple.com>
  15436. Reviewed by Geoffrey Garen.
  15437. Remove unused (sampling only, and derivable) argument to JIT::emitCTICall.
  15438. https://bugs.webkit.org/show_bug.cgi?id=22587
  15439. * jit/JIT.cpp:
  15440. (JSC::JIT::emitCTICall):
  15441. (JSC::JIT::compileOpCall):
  15442. (JSC::JIT::emitSlowScriptCheck):
  15443. (JSC::JIT::compileBinaryArithOpSlowCase):
  15444. (JSC::JIT::privateCompileMainPass):
  15445. (JSC::JIT::privateCompileSlowCases):
  15446. (JSC::JIT::privateCompile):
  15447. * jit/JIT.h:
  15448. 2008-12-02 Dimitri Glazkov <dglazkov@chromium.org>
  15449. Reviewed by Eric Seidel.
  15450. Fix the inheritance chain for JSFunction.
  15451. * runtime/JSFunction.cpp:
  15452. (JSC::JSFunction::info): Add InternalFunction::info as parent class
  15453. 2008-12-02 Simon Hausmann <hausmann@webkit.org>
  15454. Reviewed by Tor Arne Vestbø.
  15455. Fix ability to include JavaScriptCore.pri from other .pro files.
  15456. * JavaScriptCore.pri: Moved -O3 setting into the .pro files.
  15457. * JavaScriptCore.pro:
  15458. * jsc.pro:
  15459. 2008-12-01 Geoffrey Garen <ggaren@apple.com>
  15460. Reviewed by Cameron Zwarich, with help from Gavin Barraclough.
  15461. Fixed https://bugs.webkit.org/show_bug.cgi?id=22583.
  15462. Refactored regular expression parsing to parse sequences of characters
  15463. as a single unit, in preparation for optimizing sequences of characters.
  15464. SunSpider reports no change.
  15465. * JavaScriptCore.xcodeproj/project.pbxproj:
  15466. * wrec/Escapes.h: Added. Set of classes for representing an escaped
  15467. token in a pattern.
  15468. * wrec/Quantifier.h:
  15469. (JSC::WREC::Quantifier::Quantifier): Simplified this constructor slightly,
  15470. to match the new Escape constructor.
  15471. * wrec/WRECGenerator.cpp:
  15472. (JSC::WREC::Generator::generatePatternCharacterSequence):
  15473. * wrec/WRECGenerator.h: Added an interface for generating a sequence
  15474. of pattern characters at a time. It doesn't do anything special yet.
  15475. * wrec/WRECParser.cpp:
  15476. (JSC::WREC::Parser::consumeGreedyQuantifier):
  15477. (JSC::WREC::Parser::consumeQuantifier): Renamed "parse" to "consume" in
  15478. these functions, to match "consumeEscape."
  15479. (JSC::WREC::Parser::parsePatternCharacterSequence): New function for
  15480. iteratively aggregating a sequence of characters in a pattern.
  15481. (JSC::WREC::Parser::parseCharacterClassQuantifier):
  15482. (JSC::WREC::Parser::parseBackreferenceQuantifier): Renamed "parse" to
  15483. "consume" in these functions, to match "consumeEscape."
  15484. (JSC::WREC::Parser::parseCharacterClass): Refactored to use the common
  15485. escape processing code in consumeEscape.
  15486. (JSC::WREC::Parser::parseEscape): Refactored to use the common
  15487. escape processing code in consumeEscape.
  15488. (JSC::WREC::Parser::consumeEscape): Factored escaped token processing
  15489. into a common function, since we were doing this in a few places.
  15490. (JSC::WREC::Parser::parseTerm): Refactored to use the common
  15491. escape processing code in consumeEscape.
  15492. * wrec/WRECParser.h:
  15493. (JSC::WREC::Parser::consumeOctal): Refactored to use a helper function
  15494. for reading a digit.
  15495. 2008-12-01 Cameron Zwarich <zwarich@apple.com>
  15496. Reviewed by Oliver Hunt.
  15497. Bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
  15498. <https://bugs.webkit.org/show_bug.cgi?id=20340>
  15499. SegmentedVector currently frees segments and reallocates them when used
  15500. as a stack. This can lead to unsafe use of pointers into freed segments.
  15501. In order to fix this problem, SegmentedVector will be changed to only
  15502. grow and never shrink. Also, rename the reserveCapacity() member
  15503. function to grow() to match the actual usage in BytecodeGenerator, where
  15504. this function is used to allocate a group of registers at once, rather
  15505. than merely saving space for them.
  15506. * bytecompiler/BytecodeGenerator.cpp:
  15507. (JSC::BytecodeGenerator::BytecodeGenerator): Use grow() instead of
  15508. reserveCapacity().
  15509. * bytecompiler/SegmentedVector.h:
  15510. (JSC::SegmentedVector::SegmentedVector):
  15511. (JSC::SegmentedVector::last):
  15512. (JSC::SegmentedVector::append):
  15513. (JSC::SegmentedVector::removeLast):
  15514. (JSC::SegmentedVector::grow): Renamed from reserveCapacity().
  15515. (JSC::SegmentedVector::clear):
  15516. 2008-12-01 Mark Rowe <mrowe@apple.com>
  15517. Rubber-stamped by Anders Carlsson.
  15518. Disable WREC for x86_64 since memory allocated by the system allocator is not marked executable,
  15519. which causes 64-bit debug builds to crash. Once we have a dedicated allocator for executable
  15520. memory we can turn this back on.
  15521. * wtf/Platform.h:
  15522. 2008-12-01 Antti Koivisto <antti@apple.com>
  15523. Reviewed by Maciej Stachowiak.
  15524. Restore inline buffer after vector is shrunk back below its inline capacity.
  15525. * wtf/Vector.h:
  15526. (WTF::):
  15527. (WTF::VectorBuffer::restoreInlineBufferIfNeeded):
  15528. (WTF::::shrinkCapacity):
  15529. 2008-11-30 Antti Koivisto <antti@apple.com>
  15530. Reviewed by Mark Rowe.
  15531. Try to return free pages in the current thread cache too.
  15532. * wtf/FastMalloc.cpp:
  15533. (WTF::TCMallocStats::releaseFastMallocFreeMemory):
  15534. 2008-12-01 David Levin <levin@chromium.org>
  15535. Reviewed by Alexey Proskuryakov.
  15536. https://bugs.webkit.org/show_bug.cgi?id=22567
  15537. Make HashTable work as expected with respect to threads. Specifically, it has class-level
  15538. thread safety and constant methods work on constant objects without synchronization.
  15539. No observable change in behavior, so no test. This only affects debug builds.
  15540. * wtf/HashTable.cpp:
  15541. (WTF::hashTableStatsMutex):
  15542. (WTF::HashTableStats::~HashTableStats):
  15543. (WTF::HashTableStats::recordCollisionAtCount):
  15544. Guarded variable access with a mutex.
  15545. * wtf/HashTable.h:
  15546. (WTF::::lookup):
  15547. (WTF::::lookupForWriting):
  15548. (WTF::::fullLookupForWriting):
  15549. (WTF::::add):
  15550. (WTF::::reinsert):
  15551. (WTF::::remove):
  15552. (WTF::::rehash):
  15553. Changed increments of static variables to use atomicIncrement.
  15554. (WTF::::invalidateIterators):
  15555. (WTF::addIterator):
  15556. (WTF::removeIterator):
  15557. Guarded mutable access with a mutex.
  15558. 2008-11-29 Gavin Barraclough <barraclough@apple.com>
  15559. Reviewed by Cameron Zwarich.
  15560. Enable WREC on PLATFORM(X86_64). This change predominantly requires changes to the
  15561. WREC::Generator::generateEnter method to support the x86-64 ABI, and addition of
  15562. support for a limited number of quadword operations in the X86Assembler.
  15563. This patch will cause the JS heap to be allocated with RWX permissions on 64-bit Mac
  15564. platforms. This is a regression with respect to previous 64-bit behaviour, but is no
  15565. more permissive than on 32-bit builds. This issue should be addressed at some point.
  15566. (This is tracked by bug #21783.)
  15567. https://bugs.webkit.org/show_bug.cgi?id=22554
  15568. Greater than 4x speedup on regexp-dna, on x86-64.
  15569. * assembler/MacroAssembler.h:
  15570. (JSC::MacroAssembler::addPtr):
  15571. (JSC::MacroAssembler::loadPtr):
  15572. (JSC::MacroAssembler::storePtr):
  15573. (JSC::MacroAssembler::pop):
  15574. (JSC::MacroAssembler::push):
  15575. (JSC::MacroAssembler::move):
  15576. * assembler/X86Assembler.h:
  15577. (JSC::X86Assembler::):
  15578. (JSC::X86Assembler::movq_rr):
  15579. (JSC::X86Assembler::addl_i8m):
  15580. (JSC::X86Assembler::addl_i32r):
  15581. (JSC::X86Assembler::addq_i8r):
  15582. (JSC::X86Assembler::addq_i32r):
  15583. (JSC::X86Assembler::movq_mr):
  15584. (JSC::X86Assembler::movq_rm):
  15585. * wrec/WREC.h:
  15586. * wrec/WRECGenerator.cpp:
  15587. (JSC::WREC::Generator::generateEnter):
  15588. (JSC::WREC::Generator::generateReturnSuccess):
  15589. (JSC::WREC::Generator::generateReturnFailure):
  15590. * wtf/Platform.h:
  15591. * wtf/TCSystemAlloc.cpp:
  15592. 2008-12-01 Cameron Zwarich <zwarich@apple.com>
  15593. Reviewed by Sam Weinig.
  15594. Preliminary work for bug 20340: SegmentedVector segment allocations can lead to unsafe use of temporary registers
  15595. <https://bugs.webkit.org/show_bug.cgi?id=20340>
  15596. SegmentedVector currently frees segments and reallocates them when used
  15597. as a stack. This can lead to unsafe use of pointers into freed segments.
  15598. In order to fix this problem, SegmentedVector will be changed to only
  15599. grow and never shrink, with the sole exception of clearing all of its
  15600. data, a capability that is required by Lexer. This patch changes the
  15601. public interface to only allow for these capabilities.
  15602. * bytecompiler/BytecodeGenerator.cpp:
  15603. (JSC::BytecodeGenerator::BytecodeGenerator): Use reserveCapacity()
  15604. instead of resize() for m_globals and m_parameters.
  15605. * bytecompiler/SegmentedVector.h:
  15606. (JSC::SegmentedVector::resize): Removed.
  15607. (JSC::SegmentedVector::reserveCapacity): Added.
  15608. (JSC::SegmentedVector::clear): Added.
  15609. (JSC::SegmentedVector::shrink): Removed.
  15610. (JSC::SegmentedVector::grow): Removed.
  15611. * parser/Lexer.cpp:
  15612. (JSC::Lexer::clear): Use clear() instead of resize(0).
  15613. 2008-11-30 Sam Weinig <sam@webkit.org>
  15614. Reviewed by Mark Rowe.
  15615. Renames jumps to m_jumps in JumpList.
  15616. * assembler/MacroAssembler.h:
  15617. (JSC::MacroAssembler::JumpList::link):
  15618. (JSC::MacroAssembler::JumpList::linkTo):
  15619. (JSC::MacroAssembler::JumpList::append):
  15620. 2008-11-30 Antti Koivisto <antti@apple.com>
  15621. Reviewed by Mark Rowe.
  15622. https://bugs.webkit.org/show_bug.cgi?id=22557
  15623. Report free size in central and thread caches too.
  15624. * wtf/FastMalloc.cpp:
  15625. (WTF::TCMallocStats::fastMallocStatistics):
  15626. * wtf/FastMalloc.h:
  15627. 2008-11-29 Antti Koivisto <antti@apple.com>
  15628. Reviewed by Dan Bernstein.
  15629. https://bugs.webkit.org/show_bug.cgi?id=22557
  15630. Add statistics for JavaScript GC heap.
  15631. * JavaScriptCore.exp:
  15632. * runtime/Collector.cpp:
  15633. (JSC::Heap::objectCount):
  15634. (JSC::addToStatistics):
  15635. (JSC::Heap::statistics):
  15636. * runtime/Collector.h:
  15637. 2008-11-29 Antti Koivisto <antti@apple.com>
  15638. Fix debug build by adding a stub method.
  15639. * wtf/FastMalloc.cpp:
  15640. (WTF::fastMallocStatistics):
  15641. 2008-11-29 Antti Koivisto <antti@apple.com>
  15642. Reviewed by Alexey Proskuryakov.
  15643. https://bugs.webkit.org/show_bug.cgi?id=22557
  15644. Add function for getting basic statistics from FastMalloc.
  15645. * JavaScriptCore.exp:
  15646. * wtf/FastMalloc.cpp:
  15647. (WTF::DLL_Length):
  15648. (WTF::TCMalloc_PageHeap::ReturnedBytes):
  15649. (WTF::TCMallocStats::fastMallocStatistics):
  15650. * wtf/FastMalloc.h:
  15651. 2008-11-29 Cameron Zwarich <zwarich@apple.com>
  15652. Not reviewed.
  15653. The C++ standard does not automatically grant the friendships of an
  15654. enclosing class to its nested subclasses, so we should do so explicitly.
  15655. This fixes the GCC 4.0 build, although both GCC 4.2 and Visual C++ 2005
  15656. accept the incorrect code as it is.
  15657. * assembler/MacroAssembler.h:
  15658. 2008-11-29 Gavin Barraclough <barraclough@apple.com>
  15659. Reviewed by Cameron Zwarich.
  15660. Add the class MacroAssembler to provide some abstraction of code generation,
  15661. and change WREC to make use of this class, rather than directly accessing
  15662. the X86Assembler.
  15663. This patch also allows WREC to be compiled without the rest of the JIT enabled.
  15664. * JavaScriptCore.xcodeproj/project.pbxproj:
  15665. * assembler/MacroAssembler.h: Added.
  15666. (JSC::MacroAssembler::):
  15667. (JSC::MacroAssembler::MacroAssembler):
  15668. (JSC::MacroAssembler::copyCode):
  15669. (JSC::MacroAssembler::Address::Address):
  15670. (JSC::MacroAssembler::ImplicitAddress::ImplicitAddress):
  15671. (JSC::MacroAssembler::BaseIndex::BaseIndex):
  15672. (JSC::MacroAssembler::Label::Label):
  15673. (JSC::MacroAssembler::Jump::Jump):
  15674. (JSC::MacroAssembler::Jump::link):
  15675. (JSC::MacroAssembler::Jump::linkTo):
  15676. (JSC::MacroAssembler::JumpList::link):
  15677. (JSC::MacroAssembler::JumpList::linkTo):
  15678. (JSC::MacroAssembler::JumpList::append):
  15679. (JSC::MacroAssembler::Imm32::Imm32):
  15680. (JSC::MacroAssembler::add32):
  15681. (JSC::MacroAssembler::or32):
  15682. (JSC::MacroAssembler::sub32):
  15683. (JSC::MacroAssembler::loadPtr):
  15684. (JSC::MacroAssembler::load32):
  15685. (JSC::MacroAssembler::load16):
  15686. (JSC::MacroAssembler::storePtr):
  15687. (JSC::MacroAssembler::store32):
  15688. (JSC::MacroAssembler::pop):
  15689. (JSC::MacroAssembler::push):
  15690. (JSC::MacroAssembler::peek):
  15691. (JSC::MacroAssembler::poke):
  15692. (JSC::MacroAssembler::move):
  15693. (JSC::MacroAssembler::compareImm32ForBranch):
  15694. (JSC::MacroAssembler::compareImm32ForBranchEquality):
  15695. (JSC::MacroAssembler::jae32):
  15696. (JSC::MacroAssembler::je32):
  15697. (JSC::MacroAssembler::je16):
  15698. (JSC::MacroAssembler::jg32):
  15699. (JSC::MacroAssembler::jge32):
  15700. (JSC::MacroAssembler::jl32):
  15701. (JSC::MacroAssembler::jle32):
  15702. (JSC::MacroAssembler::jne32):
  15703. (JSC::MacroAssembler::jump):
  15704. (JSC::MacroAssembler::breakpoint):
  15705. (JSC::MacroAssembler::ret):
  15706. * assembler/X86Assembler.h:
  15707. (JSC::X86Assembler::cmpw_rm):
  15708. * interpreter/Interpreter.cpp:
  15709. (JSC::Interpreter::Interpreter):
  15710. * interpreter/Interpreter.h:
  15711. (JSC::Interpreter::assemblerBuffer):
  15712. * runtime/RegExp.cpp:
  15713. (JSC::RegExp::RegExp):
  15714. * wrec/WREC.cpp:
  15715. (JSC::WREC::Generator::compileRegExp):
  15716. * wrec/WREC.h:
  15717. * wrec/WRECFunctors.cpp:
  15718. (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
  15719. (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
  15720. (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
  15721. (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
  15722. * wrec/WRECFunctors.h:
  15723. (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
  15724. * wrec/WRECGenerator.cpp:
  15725. (JSC::WREC::Generator::generateEnter):
  15726. (JSC::WREC::Generator::generateReturnSuccess):
  15727. (JSC::WREC::Generator::generateSaveIndex):
  15728. (JSC::WREC::Generator::generateIncrementIndex):
  15729. (JSC::WREC::Generator::generateLoadCharacter):
  15730. (JSC::WREC::Generator::generateJumpIfEndOfInput):
  15731. (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
  15732. (JSC::WREC::Generator::generateReturnFailure):
  15733. (JSC::WREC::Generator::generateBacktrack1):
  15734. (JSC::WREC::Generator::generateBacktrackBackreference):
  15735. (JSC::WREC::Generator::generateBackreferenceQuantifier):
  15736. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  15737. (JSC::WREC::Generator::generateGreedyQuantifier):
  15738. (JSC::WREC::Generator::generatePatternCharacter):
  15739. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  15740. (JSC::WREC::Generator::generateCharacterClassInverted):
  15741. (JSC::WREC::Generator::generateCharacterClass):
  15742. (JSC::WREC::Generator::generateParentheses):
  15743. (JSC::WREC::Generator::generateParenthesesNonGreedy):
  15744. (JSC::WREC::Generator::generateParenthesesResetTrampoline):
  15745. (JSC::WREC::Generator::generateAssertionBOL):
  15746. (JSC::WREC::Generator::generateAssertionEOL):
  15747. (JSC::WREC::Generator::generateAssertionWordBoundary):
  15748. (JSC::WREC::Generator::generateBackreference):
  15749. (JSC::WREC::Generator::terminateAlternative):
  15750. (JSC::WREC::Generator::terminateDisjunction):
  15751. * wrec/WRECGenerator.h:
  15752. (JSC::WREC::Generator::Generator):
  15753. * wrec/WRECParser.cpp:
  15754. (JSC::WREC::Parser::parsePatternCharacterQualifier):
  15755. (JSC::WREC::Parser::parseCharacterClassQuantifier):
  15756. (JSC::WREC::Parser::parseBackreferenceQuantifier):
  15757. (JSC::WREC::Parser::parseParentheses):
  15758. (JSC::WREC::Parser::parseCharacterClass):
  15759. (JSC::WREC::Parser::parseOctalEscape):
  15760. (JSC::WREC::Parser::parseEscape):
  15761. (JSC::WREC::Parser::parseTerm):
  15762. (JSC::WREC::Parser::parseDisjunction):
  15763. * wrec/WRECParser.h:
  15764. (JSC::WREC::Parser::Parser):
  15765. (JSC::WREC::Parser::parsePattern):
  15766. (JSC::WREC::Parser::parseAlternative):
  15767. * wtf/Platform.h:
  15768. 2008-11-28 Simon Hausmann <hausmann@webkit.org>
  15769. Reviewed by Tor Arne Vestbø.
  15770. Fix compilation on Windows CE
  15771. Port away from the use of errno after calling strtol(), instead
  15772. detect conversion errors by checking the result and the stop
  15773. position.
  15774. * runtime/DateMath.cpp:
  15775. (JSC::parseLong):
  15776. (JSC::parseDate):
  15777. 2008-11-28 Joerg Bornemann <joerg.bornemann@trolltech.com>
  15778. Reviewed by Simon Hausmann.
  15779. Implement lowResUTCTime() on Windows CE using GetSystemTime as _ftime() is not available.
  15780. * runtime/DateMath.cpp:
  15781. (JSC::lowResUTCTime):
  15782. 2008-11-28 Simon Hausmann <hausmann@webkit.org>
  15783. Rubber-stamped by Tor Arne Vestbø.
  15784. Removed unnecessary inclusion of errno.h, which also fixes compilation on Windows CE.
  15785. * runtime/JSGlobalObjectFunctions.cpp:
  15786. 2008-11-27 Cameron Zwarich <zwarich@apple.com>
  15787. Not reviewed.
  15788. r38825 made JSFunction::m_body private, but some inspector code in
  15789. WebCore sets the field. Add setters for it.
  15790. * runtime/JSFunction.h:
  15791. (JSC::JSFunction::setBody):
  15792. 2008-11-27 Sam Weinig <sam@webkit.org>
  15793. Reviewed by Cameron Zwarich.
  15794. Fix FIXME by adding accessor for JSFunction's m_body property.
  15795. * interpreter/Interpreter.cpp:
  15796. (JSC::Interpreter::cti_op_call_JSFunction):
  15797. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  15798. (JSC::Interpreter::cti_vm_lazyLinkCall):
  15799. * profiler/Profiler.cpp:
  15800. (JSC::createCallIdentifierFromFunctionImp):
  15801. * runtime/Arguments.h:
  15802. (JSC::Arguments::getArgumentsData):
  15803. (JSC::Arguments::Arguments):
  15804. * runtime/FunctionPrototype.cpp:
  15805. (JSC::functionProtoFuncToString):
  15806. * runtime/JSFunction.h:
  15807. (JSC::JSFunction::JSFunction):
  15808. (JSC::JSFunction::body):
  15809. 2008-11-27 Sam Weinig <sam@webkit.org>
  15810. Reviewed by Oliver Hunt.
  15811. Remove unused member variables from ProgramNode.
  15812. * parser/Nodes.h:
  15813. 2008-11-27 Brent Fulgham <bfulgham@gmail.com>
  15814. Reviewed by Alexey Proskuryakov.
  15815. Enable mouse panning feaure on Windows Cairo build.
  15816. See http://bugs.webkit.org/show_bug.cgi?id=22525
  15817. * wtf/Platform.h: Enable mouse panning feaure on Windows Cairo build.
  15818. 2008-11-27 Alp Toker <alp@nuanti.com>
  15819. Change recently introduced C++ comments in Platform.h to C comments to
  15820. fix the minidom build with traditional C.
  15821. Build GtkLauncher and minidom with the '-ansi' compiler flag to detect
  15822. API header breakage at build time.
  15823. * GNUmakefile.am:
  15824. * wtf/Platform.h:
  15825. 2008-11-27 Alp Toker <alp@nuanti.com>
  15826. Remove C++ comment from JavaScriptCore API headers (introduced r35449).
  15827. Fixes build for ANSI C applications using the public API.
  15828. * API/WebKitAvailability.h:
  15829. 2008-11-26 Eric Seidel <eric@webkit.org>
  15830. No review, build fix only.
  15831. Fix the JSC Chromium Mac build by adding JavaScriptCore/icu into the include path
  15832. * JavaScriptCore.scons:
  15833. 2008-11-25 Cameron Zwarich <zwarich@apple.com>
  15834. Reviewed by Maciej Stachowiak.
  15835. Remove the unused member function JSFunction::getParameterName().
  15836. * runtime/JSFunction.cpp:
  15837. * runtime/JSFunction.h:
  15838. 2008-11-24 Gavin Barraclough <barraclough@apple.com>
  15839. Reviewed by Geoff Garen.
  15840. Polymorpic caching for get by id chain. Similar to the polymorphic caching already implemented
  15841. for self and proto accesses (implemented by allowing multiple trampolines to be JIT genertaed,
  15842. and linked together) - the get by id chain caching is implemented as a genericization of the
  15843. proto list caching, allowing cached access lists to contain a mix of proto and proto chain
  15844. accesses (since in JS style inheritance hierarchies you may commonly see a mix of properties
  15845. being overridden on the direct prototype, or higher up its prototype chain).
  15846. In order to allow this patch to compile there is a fix to appease gcc 4.2 compiler issues
  15847. (removing the jumps between fall-through cases in privateExecute).
  15848. This patch also removes redundant immediate checking from the reptach code, and fixes a related
  15849. memory leak (failure to deallocate trampolines).
  15850. ~2% progression on v8 tests (bulk on the win on deltablue)
  15851. * bytecode/Instruction.h:
  15852. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::):
  15853. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
  15854. (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  15855. (JSC::PolymorphicAccessStructureList::derefStructures):
  15856. * interpreter/Interpreter.cpp:
  15857. (JSC::countPrototypeChainEntriesAndCheckForProxies):
  15858. (JSC::Interpreter::tryCacheGetByID):
  15859. (JSC::Interpreter::privateExecute):
  15860. (JSC::Interpreter::tryCTICacheGetByID):
  15861. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  15862. (JSC::getPolymorphicAccessStructureListSlot):
  15863. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  15864. * interpreter/Interpreter.h:
  15865. * jit/JIT.cpp:
  15866. (JSC::JIT::privateCompileGetByIdProto):
  15867. (JSC::JIT::privateCompileGetByIdSelfList):
  15868. (JSC::JIT::privateCompileGetByIdProtoList):
  15869. (JSC::JIT::privateCompileGetByIdChainList):
  15870. (JSC::JIT::privateCompileGetByIdChain):
  15871. (JSC::JIT::privateCompilePatchGetArrayLength):
  15872. * jit/JIT.h:
  15873. (JSC::JIT::compileGetByIdChainList):
  15874. 2008-11-25 Cameron Zwarich <zwarich@apple.com>
  15875. Reviewed by Alexey Proskuryakov.
  15876. Move the collect() call in Heap::heapAllocate() that is conditionally
  15877. compiled under COLLECT_ON_EVERY_ALLOCATION so that it is before we get
  15878. information about the heap. This was causing assertion failures for me
  15879. while I was reducing a bug.
  15880. * runtime/Collector.cpp:
  15881. (JSC::Heap::heapAllocate):
  15882. 2008-11-24 Cameron Zwarich <zwarich@apple.com>
  15883. Reviewed by Geoff Garen.
  15884. Bug 13790: Function declarations are not treated as statements (used to affect starcraft2.com)
  15885. <https://bugs.webkit.org/show_bug.cgi?id=13790>
  15886. Modify the parser to treat function declarations as statements,
  15887. simplifying the grammar in the process. Technically, according to the
  15888. grammar in the ECMA spec, function declarations are not statements and
  15889. can not be used everywhere that statements can, but it is not worth the
  15890. possibility compatibility issues just to stick to the spec in this case.
  15891. * parser/Grammar.y:
  15892. * parser/Nodes.cpp:
  15893. (JSC::FuncDeclNode::emitBytecode): Avoid returning ignoredResult()
  15894. as a result, because it causes a crash in DoWhileNode::emitBytecode().
  15895. 2008-11-24 Geoffrey Garen <ggaren@apple.com>
  15896. Reviewed by Sam Weinig.
  15897. Unroll the regexp matching loop by 1. 10% speedup on simple matching
  15898. stress test. No change on SunSpider.
  15899. (I decided not to unroll to arbitrary levels because the returns diminsh
  15900. quickly.)
  15901. * wrec/WREC.cpp:
  15902. (JSC::WREC::compileRegExp):
  15903. * wrec/WRECGenerator.cpp:
  15904. (JSC::WREC::Generator::generateJumpIfEndOfInput):
  15905. (JSC::WREC::Generator::generateJumpIfNotEndOfInput):
  15906. * wrec/WRECGenerator.h:
  15907. * wrec/WRECParser.h:
  15908. (JSC::WREC::Parser::error):
  15909. (JSC::WREC::Parser::parsePattern):
  15910. 2008-11-24 Geoffrey Garen <ggaren@apple.com>
  15911. Reviewed by Sam Weinig.
  15912. Removed some unnecessary "Generator::" prefixes.
  15913. * wrec/WRECGenerator.cpp:
  15914. (JSC::WREC::Generator::generateEnter):
  15915. (JSC::WREC::Generator::generateReturnSuccess):
  15916. (JSC::WREC::Generator::generateSaveIndex):
  15917. (JSC::WREC::Generator::generateIncrementIndex):
  15918. (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
  15919. (JSC::WREC::Generator::generateReturnFailure):
  15920. 2008-11-24 Geoffrey Garen <ggaren@apple.com>
  15921. Reviewed by Sam Weinig.
  15922. Made a bunch of WREC::Parser functions private, and added an explicit
  15923. "reset()" function, so a parser can be reused.
  15924. * wrec/WRECParser.h:
  15925. (JSC::WREC::Parser::Parser):
  15926. (JSC::WREC::Parser::generator):
  15927. (JSC::WREC::Parser::ignoreCase):
  15928. (JSC::WREC::Parser::multiline):
  15929. (JSC::WREC::Parser::recordSubpattern):
  15930. (JSC::WREC::Parser::numSubpatterns):
  15931. (JSC::WREC::Parser::parsePattern):
  15932. (JSC::WREC::Parser::parseAlternative):
  15933. (JSC::WREC::Parser::reset):
  15934. 2008-11-24 Gavin Barraclough <barraclough@apple.com>
  15935. Reviewed by Cameron Zwarich.
  15936. Implement repatching for get by id chain.
  15937. Previously the access is performed in a function stub, in the repatch form
  15938. the trampoline is not called to; instead the hot path is relinked to jump
  15939. directly to the trampoline, if it fails it will jump to the slow case.
  15940. https://bugs.webkit.org/show_bug.cgi?id=22449
  15941. 3% progression on deltablue.
  15942. * jit/JIT.cpp:
  15943. (JSC::JIT::privateCompileGetByIdProto):
  15944. (JSC::JIT::privateCompileGetByIdChain):
  15945. 2008-11-24 Joerg Bornemann <joerg.bornemann@trolltech.com>
  15946. Reviewed by Simon Hausmann.
  15947. https://bugs.webkit.org/show_bug.cgi?id=20746
  15948. Various small compilation fixes to make the Qt port of WebKit
  15949. compile on Windows CE.
  15950. * config.h: Don't set _CRT_RAND_S for CE, it's not available.
  15951. * jsc.cpp: Disabled use of debugger includes for CE. It
  15952. does not have the debugging functions.
  15953. * runtime/DateMath.cpp: Use localtime() on Windows CE.
  15954. * wtf/Assertions.cpp: Compile on Windows CE without debugger.
  15955. * wtf/Assertions.h: Include windows.h before defining ASSERT.
  15956. * wtf/MathExtras.h: Include stdlib.h instead of xmath.h.
  15957. * wtf/Platform.h: Disable ERRNO_H and detect endianess based
  15958. on the Qt endianess. On Qt for Windows CE the endianess is
  15959. defined by the vendor specific build spec.
  15960. * wtf/Threading.h: Use the volatile-less atomic functions.
  15961. * wtf/dtoa.cpp: Compile without errno.
  15962. * wtf/win/MainThreadWin.cpp: Don't include windows.h on CE after
  15963. Assertions.h due to the redefinition of ASSERT.
  15964. 2008-11-22 Gavin Barraclough <barraclough@apple.com>
  15965. Reviewed by Cameron Zwarich.
  15966. Replace accidentally deleted immediate check from get by id chain trampoline.
  15967. https://bugs.webkit.org/show_bug.cgi?id=22413
  15968. * jit/JIT.cpp:
  15969. (JSC::JIT::privateCompileGetByIdChain):
  15970. 2008-11-21 Gavin Barraclough <barraclough@apple.com>
  15971. Reviewed by Oliver Hunt.
  15972. Add (really) polymorphic caching for get by id self.
  15973. Very similar to caching of prototype accesses, described below.
  15974. Oh, also, probably shouldn't have been leaking those structure list objects.
  15975. 4% preogression on deltablue.
  15976. * bytecode/CodeBlock.cpp:
  15977. (JSC::CodeBlock::dump):
  15978. (JSC::CodeBlock::derefStructures):
  15979. (JSC::PrototypeStructureList::derefStructures):
  15980. * bytecode/Instruction.h:
  15981. * bytecode/Opcode.h:
  15982. * interpreter/Interpreter.cpp:
  15983. (JSC::Interpreter::privateExecute):
  15984. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  15985. * jit/JIT.cpp:
  15986. (JSC::JIT::privateCompileMainPass):
  15987. (JSC::JIT::privateCompileGetByIdSelfList):
  15988. (JSC::JIT::patchGetByIdSelf):
  15989. * jit/JIT.h:
  15990. (JSC::JIT::compileGetByIdSelfList):
  15991. 2008-11-21 Geoffrey Garen <ggaren@apple.com>
  15992. Reviewed by Sam Weinig.
  15993. Fixed many crashes seen 'round the world (but only in release builds).
  15994. Update outputParameter offset to reflect slight re-ordering of push
  15995. instructions in r38669.
  15996. * wrec/WRECGenerator.cpp:
  15997. 2008-11-21 Geoffrey Garen <ggaren@apple.com>
  15998. Reviewed by Sam Weinig.
  15999. A little more RegExp refactoring.
  16000. Deployed a helper function for reading the next character. Used the "link
  16001. vector of jumps" helper in a place I missed before.
  16002. * wrec/WRECGenerator.cpp:
  16003. (JSC::WREC::Generator::generateLoadCharacter):
  16004. (JSC::WREC::Generator::generatePatternCharacter):
  16005. (JSC::WREC::Generator::generateCharacterClass):
  16006. (JSC::WREC::Generator::generateAssertionEOL):
  16007. (JSC::WREC::Generator::generateAssertionWordBoundary):
  16008. * wrec/WRECGenerator.h:
  16009. 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
  16010. Reviewed by Dan Bernstein.
  16011. https://bugs.webkit.org/show_bug.cgi?id=22402
  16012. Replace abort() with CRASH()
  16013. * wtf/Assertions.h: Added a different method to crash, which should work even is 0xbbadbeef
  16014. is a valid memory address.
  16015. * runtime/Collector.cpp:
  16016. * wtf/FastMalloc.cpp:
  16017. * wtf/FastMalloc.h:
  16018. * wtf/TCSpinLock.h:
  16019. Replace abort() with CRASH().
  16020. 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
  16021. Reverted fix for bug 22042 (Replace abort() with CRASH()), because it was breaking
  16022. FOR_EACH_OPCODE_ID macro somehow, making Safari crash.
  16023. * runtime/Collector.cpp:
  16024. (JSC::Heap::heapAllocate):
  16025. (JSC::Heap::collect):
  16026. * wtf/Assertions.h:
  16027. * wtf/FastMalloc.cpp:
  16028. (WTF::fastMalloc):
  16029. (WTF::fastCalloc):
  16030. (WTF::fastRealloc):
  16031. (WTF::InitSizeClasses):
  16032. (WTF::PageHeapAllocator::New):
  16033. (WTF::TCMallocStats::do_malloc):
  16034. * wtf/FastMalloc.h:
  16035. * wtf/TCSpinLock.h:
  16036. (TCMalloc_SpinLock::Init):
  16037. (TCMalloc_SpinLock::Finalize):
  16038. (TCMalloc_SpinLock::Lock):
  16039. (TCMalloc_SpinLock::Unlock):
  16040. 2008-11-21 Geoffrey Garen <ggaren@apple.com>
  16041. Reviewed by Sam Weinig.
  16042. A little more RegExp refactoring.
  16043. Moved all assembly from WREC.cpp into WRECGenerator helper functions.
  16044. This should help with portability and readability.
  16045. Removed ASSERTs after calls to executableCopy(), and changed
  16046. executableCopy() to ASSERT instead.
  16047. * assembler/X86Assembler.h:
  16048. (JSC::X86Assembler::executableCopy):
  16049. * jit/JIT.cpp:
  16050. (JSC::JIT::privateCompile):
  16051. (JSC::JIT::privateCompileGetByIdSelf):
  16052. (JSC::JIT::privateCompileGetByIdProto):
  16053. (JSC::JIT::privateCompileGetByIdChain):
  16054. (JSC::JIT::privateCompilePutByIdReplace):
  16055. (JSC::JIT::privateCompilePutByIdTransition):
  16056. (JSC::JIT::privateCompileCTIMachineTrampolines):
  16057. (JSC::JIT::privateCompilePatchGetArrayLength):
  16058. * wrec/WREC.cpp:
  16059. (JSC::WREC::compileRegExp):
  16060. * wrec/WRECGenerator.cpp:
  16061. (JSC::WREC::Generator::generateEnter):
  16062. (JSC::WREC::Generator::generateReturnSuccess):
  16063. (JSC::WREC::Generator::generateSaveIndex):
  16064. (JSC::WREC::Generator::generateIncrementIndex):
  16065. (JSC::WREC::Generator::generateLoopIfNotEndOfInput):
  16066. (JSC::WREC::Generator::generateReturnFailure):
  16067. * wrec/WRECGenerator.h:
  16068. * wrec/WRECParser.h:
  16069. (JSC::WREC::Parser::ignoreCase):
  16070. (JSC::WREC::Parser::generator):
  16071. 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
  16072. Build fix.
  16073. * wtf/Assertions.h: Use ::abort for C++ code.
  16074. 2008-11-21 Alexey Proskuryakov <ap@webkit.org>
  16075. Reviewed by Sam Weinig.
  16076. https://bugs.webkit.org/show_bug.cgi?id=22402
  16077. Replace abort() with CRASH()
  16078. * wtf/Assertions.h: Added abort() after an attempt to crash for extra safety.
  16079. * runtime/Collector.cpp:
  16080. * wtf/FastMalloc.cpp:
  16081. * wtf/FastMalloc.h:
  16082. * wtf/TCSpinLock.h:
  16083. Replace abort() with CRASH().
  16084. 2008-11-21 Geoffrey Garen <ggaren@apple.com>
  16085. Reviewed by Sam Weinig.
  16086. Renamed wrec => generator.
  16087. * wrec/WRECFunctors.cpp:
  16088. (JSC::WREC::GeneratePatternCharacterFunctor::generateAtom):
  16089. (JSC::WREC::GeneratePatternCharacterFunctor::backtrack):
  16090. (JSC::WREC::GenerateCharacterClassFunctor::generateAtom):
  16091. (JSC::WREC::GenerateCharacterClassFunctor::backtrack):
  16092. (JSC::WREC::GenerateBackreferenceFunctor::generateAtom):
  16093. (JSC::WREC::GenerateBackreferenceFunctor::backtrack):
  16094. (JSC::WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
  16095. 2008-11-19 Gavin Barraclough <barraclough@apple.com>
  16096. Reviewed by Darin Adler.
  16097. Add support for (really) polymorphic caching of prototype accesses.
  16098. If a cached prototype access misses, cti_op_get_by_id_proto_list is called.
  16099. When this occurs the Structure pointers from the instruction stream are copied
  16100. off into a new ProtoStubInfo object. A second prototype access trampoline is
  16101. generated, and chained onto the first. Subsequent missed call to
  16102. cti_op_get_by_id_proto_list_append, which append futher new trampolines, up to
  16103. PROTOTYPE_LIST_CACHE_SIZE (currently 4). If any of the misses result in an
  16104. access other than to a direct prototype property, list formation is halted (or
  16105. for the initial miss, does not take place at all).
  16106. Separate fail case functions are provided for each access since this contributes
  16107. to the performance progression (enables better processor branch prediction).
  16108. Overall this is a near 5% progression on v8, with around 10% wins on richards
  16109. and deltablue.
  16110. * bytecode/CodeBlock.cpp:
  16111. (JSC::CodeBlock::dump):
  16112. (JSC::CodeBlock::derefStructures):
  16113. * bytecode/Instruction.h:
  16114. (JSC::ProtoStructureList::ProtoStubInfo::set):
  16115. (JSC::ProtoStructureList::ProtoStructureList):
  16116. (JSC::Instruction::Instruction):
  16117. (JSC::Instruction::):
  16118. * bytecode/Opcode.h:
  16119. * interpreter/Interpreter.cpp:
  16120. (JSC::Interpreter::privateExecute):
  16121. (JSC::Interpreter::tryCTICacheGetByID):
  16122. (JSC::Interpreter::cti_op_put_by_id_fail):
  16123. (JSC::Interpreter::cti_op_get_by_id_self_fail):
  16124. (JSC::Interpreter::cti_op_get_by_id_proto_list):
  16125. (JSC::Interpreter::cti_op_get_by_id_proto_list_append):
  16126. (JSC::Interpreter::cti_op_get_by_id_proto_list_full):
  16127. (JSC::Interpreter::cti_op_get_by_id_proto_fail):
  16128. (JSC::Interpreter::cti_op_get_by_id_chain_fail):
  16129. (JSC::Interpreter::cti_op_get_by_id_array_fail):
  16130. (JSC::Interpreter::cti_op_get_by_id_string_fail):
  16131. * interpreter/Interpreter.h:
  16132. * jit/JIT.cpp:
  16133. (JSC::JIT::privateCompileMainPass):
  16134. (JSC::JIT::privateCompileGetByIdSelf):
  16135. (JSC::JIT::privateCompileGetByIdProto):
  16136. (JSC::JIT::privateCompileGetByIdProtoList):
  16137. (JSC::JIT::privateCompileGetByIdChain):
  16138. (JSC::JIT::privateCompileCTIMachineTrampolines):
  16139. (JSC::JIT::privateCompilePatchGetArrayLength):
  16140. * jit/JIT.h:
  16141. (JSC::JIT::compileGetByIdProtoList):
  16142. 2008-11-20 Sam Weinig <sam@webkit.org>
  16143. Try and fix the tiger build.
  16144. * parser/Grammar.y:
  16145. 2008-11-20 Eric Seidel <eric@webkit.org>
  16146. Reviewed by Darin Adler.
  16147. Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
  16148. https://bugs.webkit.org/show_bug.cgi?id=22347
  16149. * JavaScriptCore.scons:
  16150. * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
  16151. 2008-11-20 Steve Falkenburg <sfalken@apple.com>
  16152. Fix build.
  16153. Reviewed by Sam Weinig.
  16154. * parser/Parser.cpp:
  16155. (JSC::Parser::reparse):
  16156. 2008-11-20 Geoffrey Garen <ggaren@apple.com>
  16157. Reviewed by Sam Weinig.
  16158. A little more RegExp refactoring.
  16159. Created a helper function in the assembler for linking a vector of
  16160. JmpSrc to a location, and deployed it in a bunch of places.
  16161. * JavaScriptCore.xcodeproj/project.pbxproj:
  16162. * assembler/X86Assembler.h:
  16163. (JSC::X86Assembler::link):
  16164. * wrec/WREC.cpp:
  16165. (JSC::WREC::compileRegExp):
  16166. * wrec/WRECGenerator.cpp:
  16167. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  16168. (JSC::WREC::Generator::generateGreedyQuantifier):
  16169. (JSC::WREC::Generator::generateCharacterClassInverted):
  16170. (JSC::WREC::Generator::generateParentheses):
  16171. (JSC::WREC::Generator::generateParenthesesResetTrampoline):
  16172. (JSC::WREC::Generator::generateAssertionBOL):
  16173. (JSC::WREC::Generator::generateAssertionEOL):
  16174. (JSC::WREC::Generator::generateAssertionWordBoundary):
  16175. (JSC::WREC::Generator::terminateAlternative):
  16176. (JSC::WREC::Generator::terminateDisjunction):
  16177. * wrec/WRECParser.cpp:
  16178. * wrec/WRECParser.h:
  16179. (JSC::WREC::Parser::consumeHex):
  16180. 2008-11-20 Sam Weinig <sam@webkit.org>
  16181. Fix non-mac builds.
  16182. * parser/Lexer.cpp:
  16183. * parser/Parser.cpp:
  16184. 2008-11-20 Sam Weinig <sam@webkit.org>
  16185. Reviewed by Darin Adler.
  16186. Patch for https://bugs.webkit.org/show_bug.cgi?id=22385
  16187. <rdar://problem/6390179>
  16188. Lazily reparse FunctionBodyNodes on first execution.
  16189. - Saves 57MB on Membuster head.
  16190. * bytecompiler/BytecodeGenerator.cpp:
  16191. (JSC::BytecodeGenerator::generate): Remove vector shrinking since this is now
  16192. handled by destroying the ScopeNodeData after generation.
  16193. * parser/Grammar.y: Add alternate NoNode version of the grammar
  16194. that does not create nodes. This is used to lazily create FunctionBodyNodes
  16195. on first execution.
  16196. * parser/Lexer.cpp:
  16197. (JSC::Lexer::setCode): Fix bug where on reparse, the Lexer was confused about
  16198. what position and length meant. Position is the current position in the original
  16199. data buffer (important for getting correct line/column information) and length
  16200. the end offset in the original buffer.
  16201. * parser/Lexer.h:
  16202. (JSC::Lexer::sourceCode): Positions are relative to the beginning of the buffer.
  16203. * parser/Nodes.cpp:
  16204. (JSC::ScopeNodeData::ScopeNodeData): Move initialization of ScopeNode data here.
  16205. (JSC::ScopeNode::ScopeNode): Add constructor that only sets the JSGlobalData
  16206. for FunctionBodyNode stubs.
  16207. (JSC::ScopeNode::~ScopeNode): Release m_children now that we don't inherit from
  16208. BlockNode.
  16209. (JSC::ScopeNode::releaseNodes): Ditto.
  16210. (JSC::EvalNode::generateBytecode): Only shrink m_children, as we need to keep around
  16211. the rest of the data.
  16212. (JSC::FunctionBodyNode::FunctionBodyNode): Add constructor that only sets the
  16213. JSGlobalData.
  16214. (JSC::FunctionBodyNode::create): Ditto.
  16215. (JSC::FunctionBodyNode::generateBytecode): If we don't have the data, do a reparse
  16216. to construct it. Then after generation, destroy the data.
  16217. (JSC::ProgramNode::generateBytecode): After generation, destroy the AST data.
  16218. * parser/Nodes.h:
  16219. (JSC::ExpressionNode::): Add isFuncExprNode for FunctionConstructor.
  16220. (JSC::StatementNode::): Add isExprStatementNode for FunctionConstructor.
  16221. (JSC::ExprStatementNode::): Ditto.
  16222. (JSC::ExprStatementNode::expr): Add accessor for FunctionConstructor.
  16223. (JSC::FuncExprNode::): Add isFuncExprNode for FunctionConstructor
  16224. (JSC::ScopeNode::adoptData): Adopts a ScopeNodeData.
  16225. (JSC::ScopeNode::data): Accessor for ScopeNodeData.
  16226. (JSC::ScopeNode::destroyData): Deletes the ScopeNodeData.
  16227. (JSC::ScopeNode::setFeatures): Added.
  16228. (JSC::ScopeNode::varStack): Added assert.
  16229. (JSC::ScopeNode::functionStack): Ditto.
  16230. (JSC::ScopeNode::children): Ditto.
  16231. (JSC::ScopeNode::neededConstants): Ditto.
  16232. Factor m_varStack, m_functionStack, m_children and m_numConstants into ScopeNodeData.
  16233. * parser/Parser.cpp:
  16234. (JSC::Parser::reparse): Reparse the SourceCode in the FunctionBodyNode and set
  16235. set up the ScopeNodeData for it.
  16236. * parser/Parser.h:
  16237. * parser/SourceCode.h:
  16238. (JSC::SourceCode::endOffset): Added for use in the lexer.
  16239. * runtime/FunctionConstructor.cpp:
  16240. (JSC::getFunctionBody): Assuming a ProgramNode with one FunctionExpression in it,
  16241. get the FunctionBodyNode. Any issues signifies a parse failure in constructFunction.
  16242. (JSC::constructFunction): Make parsing functions in the form new Function(""), easier
  16243. by concatenating the strings together (with some glue) and parsing the function expression
  16244. as a ProgramNode from which we can receive the FunctionBodyNode. This has the added benefit
  16245. of not having special parsing code for the arguments and lazily constructing the
  16246. FunctionBodyNode's AST on first execution.
  16247. * runtime/Identifier.h:
  16248. (JSC::operator!=): Added.
  16249. 2008-11-20 Sam Weinig <sam@webkit.org>
  16250. Reviewed by Geoffrey Garen.
  16251. Speedup the lexer to offset coming re-parsing patch.
  16252. - .6% progression on Sunspider.
  16253. * bytecompiler/SegmentedVector.h:
  16254. (JSC::SegmentedVector::shrink): Fixed bug where m_size would not be
  16255. set when shrinking to 0.
  16256. * parser/Lexer.cpp:
  16257. (JSC::Lexer::Lexer):
  16258. (JSC::Lexer::isIdentStart): Use isASCIIAlpha and isASCII to avoid going into ICU in the common cases.
  16259. (JSC::Lexer::isIdentPart): Use isASCIIAlphanumeric and isASCII to avoid going into ICU in the common cases
  16260. (JSC::isDecimalDigit): Use version in ASCIICType.h. Inlining it was a regression.
  16261. (JSC::Lexer::isHexDigit): Ditto.
  16262. (JSC::Lexer::isOctalDigit): Ditto.
  16263. (JSC::Lexer::clear): Resize the m_identifiers SegmentedVector to initial
  16264. capacity
  16265. * parser/Lexer.h: Remove unused m_strings vector. Make m_identifiers
  16266. a SegmentedVector<Identifier> to avoid allocating a new Identifier* for
  16267. each identifier found. The SegmentedVector is need so we can passes
  16268. references to the Identifier to the parser, which remain valid even when
  16269. the vector is resized.
  16270. (JSC::Lexer::makeIdentifier): Inline and return a reference to the added
  16271. Identifier.
  16272. 2008-11-20 Sam Weinig <sam@webkit.org>
  16273. Reviewed by Darin Adler.
  16274. Add isASCII to ASCIICType. Use coming soon!
  16275. * wtf/ASCIICType.h:
  16276. (WTF::isASCII):
  16277. 2008-11-20 Sam Weinig <sam@webkit.org>
  16278. Reviewed by Darin Adler.
  16279. Add OwnPtr constructor and OwnPtr::adopt that take an auto_ptr.
  16280. * wtf/OwnPtr.h:
  16281. (WTF::OwnPtr::OwnPtr):
  16282. (WTF::OwnPtr::adopt):
  16283. 2008-11-20 Alexey Proskuryakov <ap@webkit.org>
  16284. Reviewed by Darin Adler.
  16285. https://bugs.webkit.org/show_bug.cgi?id=22364
  16286. Crashes seen on Tiger buildbots due to worker threads exhausting pthread keys
  16287. * runtime/Collector.cpp:
  16288. (JSC::Heap::Heap):
  16289. (JSC::Heap::destroy):
  16290. (JSC::Heap::makeUsableFromMultipleThreads):
  16291. (JSC::Heap::registerThread):
  16292. * runtime/Collector.h:
  16293. Pthread key for tracking threads is only created on request now, because this is a limited
  16294. resource, and thread tracking is not needed for worker heaps, or for WebCore heap.
  16295. * API/JSContextRef.cpp: (JSGlobalContextCreateInGroup): Call makeUsableFromMultipleThreads().
  16296. * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::sharedInstance): Ditto.
  16297. * runtime/JSGlobalData.h: (JSC::JSGlobalData::makeUsableFromMultipleThreads): Just forward
  16298. the call to Heap, which clients need not know about, ideally.
  16299. 2008-11-20 Geoffrey Garen <ggaren@apple.com>
  16300. Reviewed by Sam Weinig.
  16301. A little more WREC refactoring.
  16302. Removed the "Register" suffix from register names in WREC, and renamed:
  16303. currentPosition => index
  16304. currentValue => character
  16305. quantifierCount => repeatCount
  16306. Added a top-level parsePattern function to the WREC parser, which
  16307. allowed me to remove the error() and atEndOfPattern() accessors.
  16308. Factored out an MSVC customization into a constant.
  16309. Renamed nextLabel => beginPattern.
  16310. * wrec/WREC.cpp:
  16311. (JSC::WREC::compileRegExp):
  16312. * wrec/WRECGenerator.cpp:
  16313. (JSC::WREC::Generator::generateBacktrack1):
  16314. (JSC::WREC::Generator::generateBacktrackBackreference):
  16315. (JSC::WREC::Generator::generateBackreferenceQuantifier):
  16316. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  16317. (JSC::WREC::Generator::generateGreedyQuantifier):
  16318. (JSC::WREC::Generator::generatePatternCharacter):
  16319. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  16320. (JSC::WREC::Generator::generateCharacterClassInverted):
  16321. (JSC::WREC::Generator::generateCharacterClass):
  16322. (JSC::WREC::Generator::generateParentheses):
  16323. (JSC::WREC::Generator::generateParenthesesResetTrampoline):
  16324. (JSC::WREC::Generator::generateAssertionBOL):
  16325. (JSC::WREC::Generator::generateAssertionEOL):
  16326. (JSC::WREC::Generator::generateAssertionWordBoundary):
  16327. (JSC::WREC::Generator::generateBackreference):
  16328. (JSC::WREC::Generator::generateDisjunction):
  16329. (JSC::WREC::Generator::terminateDisjunction):
  16330. * wrec/WRECGenerator.h:
  16331. * wrec/WRECParser.h:
  16332. (JSC::WREC::Parser::parsePattern):
  16333. 2008-11-19 Geoffrey Garen <ggaren@apple.com>
  16334. Reviewed by Darin Adler.
  16335. https://bugs.webkit.org/show_bug.cgi?id=22361
  16336. A little more RegExp refactoring.
  16337. Consistently named variables holding the starting position at which
  16338. regexp matching should begin to "startOffset".
  16339. A few more "regExpObject" => "regExpConstructor" changes.
  16340. Refactored RegExpObject::match for clarity, and replaced a slow "get"
  16341. of the "global" property with a fast access to the global bit.
  16342. Made the error message you see when RegExpObject::match has no input a
  16343. little more informative, as in Firefox.
  16344. * runtime/RegExp.cpp:
  16345. (JSC::RegExp::match):
  16346. * runtime/RegExp.h:
  16347. * runtime/RegExpObject.cpp:
  16348. (JSC::RegExpObject::match):
  16349. * runtime/StringPrototype.cpp:
  16350. (JSC::stringProtoFuncReplace):
  16351. (JSC::stringProtoFuncMatch):
  16352. (JSC::stringProtoFuncSearch):
  16353. 2008-11-19 Geoffrey Garen <ggaren@apple.com>
  16354. Reviewed by Sam Weinig.
  16355. A little more refactoring.
  16356. Removed the "emit" and "emitUnlinked" prefixes from the assembler.
  16357. Moved the JmpSrc and JmpDst class definitions to the top of the X86
  16358. assembler class, in accordance with WebKit style guidelines.
  16359. * assembler/X86Assembler.h:
  16360. (JSC::X86Assembler::JmpSrc::JmpSrc):
  16361. (JSC::X86Assembler::JmpDst::JmpDst):
  16362. (JSC::X86Assembler::int3):
  16363. (JSC::X86Assembler::pushl_m):
  16364. (JSC::X86Assembler::popl_m):
  16365. (JSC::X86Assembler::movl_rr):
  16366. (JSC::X86Assembler::addl_rr):
  16367. (JSC::X86Assembler::addl_i8r):
  16368. (JSC::X86Assembler::addl_i8m):
  16369. (JSC::X86Assembler::addl_i32r):
  16370. (JSC::X86Assembler::addl_mr):
  16371. (JSC::X86Assembler::andl_rr):
  16372. (JSC::X86Assembler::andl_i32r):
  16373. (JSC::X86Assembler::cmpl_i8r):
  16374. (JSC::X86Assembler::cmpl_rr):
  16375. (JSC::X86Assembler::cmpl_rm):
  16376. (JSC::X86Assembler::cmpl_mr):
  16377. (JSC::X86Assembler::cmpl_i32r):
  16378. (JSC::X86Assembler::cmpl_i32m):
  16379. (JSC::X86Assembler::cmpl_i8m):
  16380. (JSC::X86Assembler::cmpw_rm):
  16381. (JSC::X86Assembler::orl_rr):
  16382. (JSC::X86Assembler::orl_mr):
  16383. (JSC::X86Assembler::orl_i32r):
  16384. (JSC::X86Assembler::subl_rr):
  16385. (JSC::X86Assembler::subl_i8r):
  16386. (JSC::X86Assembler::subl_i8m):
  16387. (JSC::X86Assembler::subl_i32r):
  16388. (JSC::X86Assembler::subl_mr):
  16389. (JSC::X86Assembler::testl_i32r):
  16390. (JSC::X86Assembler::testl_i32m):
  16391. (JSC::X86Assembler::testl_rr):
  16392. (JSC::X86Assembler::xorl_i8r):
  16393. (JSC::X86Assembler::xorl_rr):
  16394. (JSC::X86Assembler::sarl_i8r):
  16395. (JSC::X86Assembler::sarl_CLr):
  16396. (JSC::X86Assembler::shl_i8r):
  16397. (JSC::X86Assembler::shll_CLr):
  16398. (JSC::X86Assembler::imull_rr):
  16399. (JSC::X86Assembler::imull_i32r):
  16400. (JSC::X86Assembler::idivl_r):
  16401. (JSC::X86Assembler::negl_r):
  16402. (JSC::X86Assembler::movl_mr):
  16403. (JSC::X86Assembler::movzbl_rr):
  16404. (JSC::X86Assembler::movzwl_mr):
  16405. (JSC::X86Assembler::movl_rm):
  16406. (JSC::X86Assembler::movl_i32r):
  16407. (JSC::X86Assembler::movl_i32m):
  16408. (JSC::X86Assembler::leal_mr):
  16409. (JSC::X86Assembler::jmp_r):
  16410. (JSC::X86Assembler::jmp_m):
  16411. (JSC::X86Assembler::movsd_mr):
  16412. (JSC::X86Assembler::xorpd_mr):
  16413. (JSC::X86Assembler::movsd_rm):
  16414. (JSC::X86Assembler::movd_rr):
  16415. (JSC::X86Assembler::cvtsi2sd_rr):
  16416. (JSC::X86Assembler::cvttsd2si_rr):
  16417. (JSC::X86Assembler::addsd_mr):
  16418. (JSC::X86Assembler::subsd_mr):
  16419. (JSC::X86Assembler::mulsd_mr):
  16420. (JSC::X86Assembler::addsd_rr):
  16421. (JSC::X86Assembler::subsd_rr):
  16422. (JSC::X86Assembler::mulsd_rr):
  16423. (JSC::X86Assembler::ucomis_rr):
  16424. (JSC::X86Assembler::pextrw_irr):
  16425. (JSC::X86Assembler::call):
  16426. (JSC::X86Assembler::jmp):
  16427. (JSC::X86Assembler::jne):
  16428. (JSC::X86Assembler::jnz):
  16429. (JSC::X86Assembler::je):
  16430. (JSC::X86Assembler::jl):
  16431. (JSC::X86Assembler::jb):
  16432. (JSC::X86Assembler::jle):
  16433. (JSC::X86Assembler::jbe):
  16434. (JSC::X86Assembler::jge):
  16435. (JSC::X86Assembler::jg):
  16436. (JSC::X86Assembler::ja):
  16437. (JSC::X86Assembler::jae):
  16438. (JSC::X86Assembler::jo):
  16439. (JSC::X86Assembler::jp):
  16440. (JSC::X86Assembler::js):
  16441. (JSC::X86Assembler::predictNotTaken):
  16442. (JSC::X86Assembler::convertToFastCall):
  16443. (JSC::X86Assembler::restoreArgumentReference):
  16444. (JSC::X86Assembler::restoreArgumentReferenceForTrampoline):
  16445. (JSC::X86Assembler::modRm_rr):
  16446. (JSC::X86Assembler::modRm_rr_Unchecked):
  16447. (JSC::X86Assembler::modRm_rm):
  16448. (JSC::X86Assembler::modRm_rm_Unchecked):
  16449. (JSC::X86Assembler::modRm_rmsib):
  16450. (JSC::X86Assembler::modRm_opr):
  16451. (JSC::X86Assembler::modRm_opr_Unchecked):
  16452. (JSC::X86Assembler::modRm_opm):
  16453. (JSC::X86Assembler::modRm_opm_Unchecked):
  16454. (JSC::X86Assembler::modRm_opmsib):
  16455. * jit/JIT.cpp:
  16456. (JSC::JIT::emitNakedCall):
  16457. (JSC::JIT::emitNakedFastCall):
  16458. (JSC::JIT::emitCTICall):
  16459. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  16460. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  16461. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  16462. (JSC::JIT::emitFastArithIntToImmOrSlowCase):
  16463. (JSC::JIT::emitArithIntToImmWithJump):
  16464. (JSC::JIT::compileOpCall):
  16465. (JSC::JIT::compileOpStrictEq):
  16466. (JSC::JIT::emitSlowScriptCheck):
  16467. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  16468. (JSC::JIT::compileBinaryArithOp):
  16469. (JSC::JIT::privateCompileMainPass):
  16470. (JSC::JIT::privateCompileSlowCases):
  16471. (JSC::JIT::privateCompile):
  16472. (JSC::JIT::privateCompileGetByIdSelf):
  16473. (JSC::JIT::privateCompileGetByIdProto):
  16474. (JSC::JIT::privateCompileGetByIdChain):
  16475. (JSC::JIT::privateCompilePutByIdReplace):
  16476. (JSC::JIT::privateCompilePutByIdTransition):
  16477. (JSC::JIT::privateCompileCTIMachineTrampolines):
  16478. (JSC::JIT::privateCompilePatchGetArrayLength):
  16479. * wrec/WREC.cpp:
  16480. (JSC::WREC::compileRegExp):
  16481. * wrec/WRECGenerator.cpp:
  16482. (JSC::WREC::Generator::generateBackreferenceQuantifier):
  16483. (JSC::WREC::Generator::generateNonGreedyQuantifier):
  16484. (JSC::WREC::Generator::generateGreedyQuantifier):
  16485. (JSC::WREC::Generator::generatePatternCharacter):
  16486. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  16487. (JSC::WREC::Generator::generateCharacterClassInverted):
  16488. (JSC::WREC::Generator::generateCharacterClass):
  16489. (JSC::WREC::Generator::generateParentheses):
  16490. (JSC::WREC::Generator::generateParenthesesNonGreedy):
  16491. (JSC::WREC::Generator::generateParenthesesResetTrampoline):
  16492. (JSC::WREC::Generator::generateAssertionBOL):
  16493. (JSC::WREC::Generator::generateAssertionEOL):
  16494. (JSC::WREC::Generator::generateAssertionWordBoundary):
  16495. (JSC::WREC::Generator::generateBackreference):
  16496. (JSC::WREC::Generator::generateDisjunction):
  16497. 2008-11-19 Simon Hausmann <hausmann@webkit.org>
  16498. Sun CC build fix, removed trailing comman for last enum value.
  16499. * wtf/unicode/qt4/UnicodeQt4.h:
  16500. (WTF::Unicode::):
  16501. 2008-11-19 Mark Rowe <mrowe@apple.com>
  16502. Reviewed by Alexey Proskuryakov.
  16503. Expand the workaround for Apple GCC compiler bug <rdar://problem/6354696> to all versions of GCC 4.0.1.
  16504. It has been observed with builds 5465 (Xcode 3.0) and 5484 (Xcode 3.1), and there is no evidence
  16505. that it has been fixed in newer builds of GCC 4.0.1.
  16506. This addresses <https://bugs.webkit.org/show_bug.cgi?id=22351> (WebKit nightly crashes on launch on 10.4.11).
  16507. * wtf/StdLibExtras.h:
  16508. 2008-11-18 Cameron Zwarich <zwarich@apple.com>
  16509. Reviewed by Maciej Stachowiak and Geoff Garen.
  16510. Bug 22287: ASSERTION FAILED: Not enough jumps linked in slow case codegen in CTI::privateCompileSlowCases())
  16511. <https://bugs.webkit.org/show_bug.cgi?id=22287>
  16512. Fix a typo in the number cell reuse code where the first and second
  16513. operands are sometimes confused.
  16514. * jit/JIT.cpp:
  16515. (JSC::JIT::compileBinaryArithOpSlowCase):
  16516. 2008-11-18 Dan Bernstein <mitz@apple.com>
  16517. - try to fix the Windows build
  16518. * interpreter/Interpreter.cpp:
  16519. (JSC::Interpreter::privateExecute):
  16520. 2008-11-18 Geoffrey Garen <ggaren@apple.com>
  16521. Reviewed by Sam Weinig.
  16522. Minor RegExp cleanup.
  16523. SunSpider says no change.
  16524. * runtime/RegExpObject.cpp:
  16525. (JSC::RegExpObject::match): Renamed "regExpObj" to "regExpConstructor".
  16526. * wrec/WREC.cpp:
  16527. (JSC::WREC::compileRegExp): Instead of checking for a NULL output vector,
  16528. ASSERT that the output vector is not NULL. (The rest of WREC is not
  16529. safe to use with a NULL output vector, and we probably don't want to
  16530. spend the time and/or performance to make it safe.)
  16531. 2008-11-18 Geoffrey Garen <ggaren@apple.com>
  16532. Reviewed by Darin Adler.
  16533. A little more renaming and refactoring.
  16534. VM_CHECK_EXCEPTION() => CHECK_FOR_EXCEPTION().
  16535. NEXT_INSTRUCTION => NEXT_INSTRUCTION().
  16536. Removed the "Error_" and "TempError_" prefixes from WREC error types.
  16537. Refactored the WREC parser so it doesn't need a "setError" function,
  16538. and changed "isEndOfPattern" and its use -- they read kind of backwards
  16539. before.
  16540. Changed our "TODO:" error messages at least to say something, since you
  16541. can't say "TODO:" in shipping software.
  16542. * interpreter/Interpreter.cpp:
  16543. (JSC::Interpreter::privateExecute):
  16544. (JSC::Interpreter::cti_op_convert_this):
  16545. (JSC::Interpreter::cti_op_add):
  16546. (JSC::Interpreter::cti_op_pre_inc):
  16547. (JSC::Interpreter::cti_op_loop_if_less):
  16548. (JSC::Interpreter::cti_op_loop_if_lesseq):
  16549. (JSC::Interpreter::cti_op_put_by_id):
  16550. (JSC::Interpreter::cti_op_put_by_id_second):
  16551. (JSC::Interpreter::cti_op_put_by_id_generic):
  16552. (JSC::Interpreter::cti_op_put_by_id_fail):
  16553. (JSC::Interpreter::cti_op_get_by_id):
  16554. (JSC::Interpreter::cti_op_get_by_id_second):
  16555. (JSC::Interpreter::cti_op_get_by_id_generic):
  16556. (JSC::Interpreter::cti_op_get_by_id_fail):
  16557. (JSC::Interpreter::cti_op_instanceof):
  16558. (JSC::Interpreter::cti_op_del_by_id):
  16559. (JSC::Interpreter::cti_op_mul):
  16560. (JSC::Interpreter::cti_op_call_NotJSFunction):
  16561. (JSC::Interpreter::cti_op_resolve):
  16562. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  16563. (JSC::Interpreter::cti_op_get_by_val):
  16564. (JSC::Interpreter::cti_op_resolve_func):
  16565. (JSC::Interpreter::cti_op_sub):
  16566. (JSC::Interpreter::cti_op_put_by_val):
  16567. (JSC::Interpreter::cti_op_put_by_val_array):
  16568. (JSC::Interpreter::cti_op_lesseq):
  16569. (JSC::Interpreter::cti_op_loop_if_true):
  16570. (JSC::Interpreter::cti_op_negate):
  16571. (JSC::Interpreter::cti_op_resolve_skip):
  16572. (JSC::Interpreter::cti_op_resolve_global):
  16573. (JSC::Interpreter::cti_op_div):
  16574. (JSC::Interpreter::cti_op_pre_dec):
  16575. (JSC::Interpreter::cti_op_jless):
  16576. (JSC::Interpreter::cti_op_not):
  16577. (JSC::Interpreter::cti_op_jtrue):
  16578. (JSC::Interpreter::cti_op_post_inc):
  16579. (JSC::Interpreter::cti_op_eq):
  16580. (JSC::Interpreter::cti_op_lshift):
  16581. (JSC::Interpreter::cti_op_bitand):
  16582. (JSC::Interpreter::cti_op_rshift):
  16583. (JSC::Interpreter::cti_op_bitnot):
  16584. (JSC::Interpreter::cti_op_resolve_with_base):
  16585. (JSC::Interpreter::cti_op_mod):
  16586. (JSC::Interpreter::cti_op_less):
  16587. (JSC::Interpreter::cti_op_neq):
  16588. (JSC::Interpreter::cti_op_post_dec):
  16589. (JSC::Interpreter::cti_op_urshift):
  16590. (JSC::Interpreter::cti_op_bitxor):
  16591. (JSC::Interpreter::cti_op_bitor):
  16592. (JSC::Interpreter::cti_op_push_scope):
  16593. (JSC::Interpreter::cti_op_to_jsnumber):
  16594. (JSC::Interpreter::cti_op_in):
  16595. (JSC::Interpreter::cti_op_del_by_val):
  16596. * wrec/WREC.cpp:
  16597. (JSC::WREC::compileRegExp):
  16598. * wrec/WRECParser.cpp:
  16599. (JSC::WREC::Parser::parseGreedyQuantifier):
  16600. (JSC::WREC::Parser::parseParentheses):
  16601. (JSC::WREC::Parser::parseCharacterClass):
  16602. (JSC::WREC::Parser::parseEscape):
  16603. * wrec/WRECParser.h:
  16604. (JSC::WREC::Parser::):
  16605. (JSC::WREC::Parser::atEndOfPattern):
  16606. 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
  16607. Reviewed by Darin Adler.
  16608. https://bugs.webkit.org/show_bug.cgi?id=22337
  16609. Enable workers by default
  16610. * Configurations/JavaScriptCore.xcconfig: Define ENABLE_WORKERS.
  16611. 2008-11-18 Alexey Proskuryakov <ap@webkit.org>
  16612. - Windows build fix
  16613. * wrec/WRECFunctors.h:
  16614. * wrec/WRECGenerator.h:
  16615. * wrec/WRECParser.h:
  16616. CharacterClass is a struct, not a class, fix forward declarations.
  16617. 2008-11-18 Dan Bernstein <mitz@apple.com>
  16618. - Windows build fix
  16619. * assembler/X86Assembler.h:
  16620. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16621. Not reviewed.
  16622. Try to fix gtk build.
  16623. * wrec/Quantifier.h:
  16624. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16625. Not reviewed.
  16626. Try to fix gtk build.
  16627. * assembler/AssemblerBuffer.h:
  16628. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16629. Reviewed by Sam Weinig.
  16630. Split WREC classes out into individual files, with a few modifications
  16631. to more closely match the WebKit coding style.
  16632. * GNUmakefile.am:
  16633. * JavaScriptCore.scons:
  16634. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16635. * JavaScriptCore.xcodeproj/project.pbxproj:
  16636. * assembler/X86Assembler.h:
  16637. * runtime/RegExp.cpp:
  16638. * wrec/CharacterClass.cpp: Copied from wrec/CharacterClassConstructor.cpp.
  16639. (JSC::WREC::CharacterClass::newline):
  16640. (JSC::WREC::CharacterClass::digits):
  16641. (JSC::WREC::CharacterClass::spaces):
  16642. (JSC::WREC::CharacterClass::wordchar):
  16643. (JSC::WREC::CharacterClass::nondigits):
  16644. (JSC::WREC::CharacterClass::nonspaces):
  16645. (JSC::WREC::CharacterClass::nonwordchar):
  16646. * wrec/CharacterClass.h: Copied from wrec/CharacterClassConstructor.h.
  16647. * wrec/CharacterClassConstructor.cpp:
  16648. (JSC::WREC::CharacterClassConstructor::addSortedRange):
  16649. (JSC::WREC::CharacterClassConstructor::append):
  16650. * wrec/CharacterClassConstructor.h:
  16651. * wrec/Quantifier.h: Copied from wrec/WREC.h.
  16652. * wrec/WREC.cpp:
  16653. (JSC::WREC::compileRegExp):
  16654. * wrec/WREC.h:
  16655. * wrec/WRECFunctors.cpp: Copied from wrec/WREC.cpp.
  16656. * wrec/WRECFunctors.h: Copied from wrec/WREC.cpp.
  16657. (JSC::WREC::GenerateAtomFunctor::~GenerateAtomFunctor):
  16658. (JSC::WREC::GeneratePatternCharacterFunctor::GeneratePatternCharacterFunctor):
  16659. (JSC::WREC::GenerateCharacterClassFunctor::GenerateCharacterClassFunctor):
  16660. (JSC::WREC::GenerateBackreferenceFunctor::GenerateBackreferenceFunctor):
  16661. (JSC::WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
  16662. * wrec/WRECGenerator.cpp: Copied from wrec/WREC.cpp.
  16663. (JSC::WREC::Generator::generatePatternCharacter):
  16664. (JSC::WREC::Generator::generateCharacterClassInvertedRange):
  16665. (JSC::WREC::Generator::generateCharacterClassInverted):
  16666. (JSC::WREC::Generator::generateCharacterClass):
  16667. (JSC::WREC::Generator::generateParentheses):
  16668. (JSC::WREC::Generator::generateAssertionBOL):
  16669. (JSC::WREC::Generator::generateAssertionEOL):
  16670. (JSC::WREC::Generator::generateAssertionWordBoundary):
  16671. * wrec/WRECGenerator.h: Copied from wrec/WREC.h.
  16672. * wrec/WRECParser.cpp: Copied from wrec/WREC.cpp.
  16673. (JSC::WREC::Parser::parseGreedyQuantifier):
  16674. (JSC::WREC::Parser::parseCharacterClassQuantifier):
  16675. (JSC::WREC::Parser::parseParentheses):
  16676. (JSC::WREC::Parser::parseCharacterClass):
  16677. (JSC::WREC::Parser::parseEscape):
  16678. (JSC::WREC::Parser::parseTerm):
  16679. * wrec/WRECParser.h: Copied from wrec/WREC.h.
  16680. (JSC::WREC::Parser::):
  16681. (JSC::WREC::Parser::Parser):
  16682. (JSC::WREC::Parser::setError):
  16683. (JSC::WREC::Parser::error):
  16684. (JSC::WREC::Parser::recordSubpattern):
  16685. (JSC::WREC::Parser::numSubpatterns):
  16686. (JSC::WREC::Parser::ignoreCase):
  16687. (JSC::WREC::Parser::multiline):
  16688. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16689. Not reviewed.
  16690. Try to fix a few builds.
  16691. * JavaScriptCoreSources.bkl:
  16692. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16693. Not reviewed.
  16694. Try to fix a few builds.
  16695. * JavaScriptCore.pri:
  16696. * JavaScriptCore.scons:
  16697. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16698. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16699. Reviewed by Sam Weinig.
  16700. Moved VM/CTI.* => jit/JIT.*.
  16701. Removed VM.
  16702. * GNUmakefile.am:
  16703. * JavaScriptCore.pri:
  16704. * JavaScriptCore.scons:
  16705. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16706. * JavaScriptCore.xcodeproj/project.pbxproj:
  16707. * VM/CTI.cpp: Removed.
  16708. * VM/CTI.h: Removed.
  16709. * bytecode/CodeBlock.cpp:
  16710. * interpreter/Interpreter.cpp:
  16711. * jit: Added.
  16712. * jit/JIT.cpp: Copied from VM/CTI.cpp.
  16713. * jit/JIT.h: Copied from VM/CTI.h.
  16714. * runtime/RegExp.cpp:
  16715. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16716. Reviewed by Sam Weinig.
  16717. Moved runtime/ExecState.* => interpreter/CallFrame.*.
  16718. * API/JSBase.cpp:
  16719. * API/OpaqueJSString.cpp:
  16720. * GNUmakefile.am:
  16721. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16722. * JavaScriptCore.xcodeproj/project.pbxproj:
  16723. * debugger/DebuggerCallFrame.h:
  16724. * interpreter/CallFrame.cpp: Copied from runtime/ExecState.cpp.
  16725. * interpreter/CallFrame.h: Copied from runtime/ExecState.h.
  16726. * interpreter/Interpreter.cpp:
  16727. * parser/Nodes.cpp:
  16728. * profiler/ProfileGenerator.cpp:
  16729. * profiler/Profiler.cpp:
  16730. * runtime/ClassInfo.h:
  16731. * runtime/Collector.cpp:
  16732. * runtime/Completion.cpp:
  16733. * runtime/ExceptionHelpers.cpp:
  16734. * runtime/ExecState.cpp: Removed.
  16735. * runtime/ExecState.h: Removed.
  16736. * runtime/Identifier.cpp:
  16737. * runtime/JSFunction.cpp:
  16738. * runtime/JSGlobalObjectFunctions.cpp:
  16739. * runtime/JSLock.cpp:
  16740. * runtime/JSNumberCell.h:
  16741. * runtime/JSObject.h:
  16742. * runtime/JSString.h:
  16743. * runtime/Lookup.h:
  16744. * runtime/PropertyNameArray.h:
  16745. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16746. Not reviewed.
  16747. Try to fix Windows build.
  16748. * API/APICast.h:
  16749. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16750. Not reviewed.
  16751. Try to fix Windows build.
  16752. * API/APICast.h:
  16753. * runtime/ExecState.h:
  16754. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16755. Reviewed by Sam Weinig.
  16756. Moved VM/SamplingTool.* => bytecode/SamplingTool.*.
  16757. * GNUmakefile.am:
  16758. * JavaScriptCore.pri:
  16759. * JavaScriptCore.scons:
  16760. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16761. * JavaScriptCore.xcodeproj/project.pbxproj:
  16762. * JavaScriptCoreSources.bkl:
  16763. * VM/SamplingTool.cpp: Removed.
  16764. * VM/SamplingTool.h: Removed.
  16765. * bytecode/SamplingTool.cpp: Copied from VM/SamplingTool.cpp.
  16766. * bytecode/SamplingTool.h: Copied from VM/SamplingTool.h.
  16767. * jsc.cpp:
  16768. (runWithScripts):
  16769. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16770. Not reviewed.
  16771. Try to fix Windows build.
  16772. * runtime/ExecState.h:
  16773. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16774. Reviewed by Sam Weinig.
  16775. Moved VM/ExceptionHelpers.cpp => runtime/ExceptionHelpers.cpp.
  16776. * GNUmakefile.am:
  16777. * JavaScriptCore.pri:
  16778. * JavaScriptCore.scons:
  16779. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16780. * JavaScriptCore.xcodeproj/project.pbxproj:
  16781. * JavaScriptCoreSources.bkl:
  16782. * VM/ExceptionHelpers.cpp: Removed.
  16783. * runtime/ExceptionHelpers.cpp: Copied from VM/ExceptionHelpers.cpp.
  16784. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16785. Reviewed by Sam Weinig.
  16786. Moved VM/RegisterFile.cpp => interpreter/RegisterFile.cpp.
  16787. * AllInOneFile.cpp:
  16788. * GNUmakefile.am:
  16789. * JavaScriptCore.pri:
  16790. * JavaScriptCore.scons:
  16791. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16792. * JavaScriptCore.xcodeproj/project.pbxproj:
  16793. * JavaScriptCoreSources.bkl:
  16794. * VM/RegisterFile.cpp: Removed.
  16795. * interpreter/RegisterFile.cpp: Copied from VM/RegisterFile.cpp.
  16796. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16797. Not reviewed.
  16798. Try to fix Windows build.
  16799. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16800. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16801. Not reviewed.
  16802. Try to fix Windows build.
  16803. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  16804. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16805. Not reviewed.
  16806. Try to fix Windows build.
  16807. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16808. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16809. Reviewed by Sam Weinig.
  16810. Moved:
  16811. VM/ExceptionHelpers.h => runtime/ExceptionHelpers.h
  16812. VM/Register.h => interpreter/Register.h
  16813. VM/RegisterFile.h => interpreter/RegisterFile.h
  16814. * GNUmakefile.am:
  16815. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16816. * JavaScriptCore.xcodeproj/project.pbxproj:
  16817. * VM/ExceptionHelpers.h: Removed.
  16818. * VM/Register.h: Removed.
  16819. * VM/RegisterFile.h: Removed.
  16820. * interpreter/Register.h: Copied from VM/Register.h.
  16821. * interpreter/RegisterFile.h: Copied from VM/RegisterFile.h.
  16822. * runtime/ExceptionHelpers.h: Copied from VM/ExceptionHelpers.h.
  16823. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16824. Not reviewed.
  16825. Try to fix Qt build.
  16826. * JavaScriptCore.pri:
  16827. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16828. Reviewed by Sam Weinig.
  16829. Moved VM/Machine.cpp => interpreter/Interpreter.cpp.
  16830. * DerivedSources.make:
  16831. * GNUmakefile.am:
  16832. * JavaScriptCore.pri:
  16833. * JavaScriptCore.scons:
  16834. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16835. * JavaScriptCore.xcodeproj/project.pbxproj:
  16836. * JavaScriptCoreSources.bkl:
  16837. * VM/Machine.cpp: Removed.
  16838. * interpreter/Interpreter.cpp: Copied from VM/Machine.cpp.
  16839. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16840. Reviewed by Sam Weinig.
  16841. Moved VM/Machine.h => interpreter/Interpreter.h
  16842. * GNUmakefile.am:
  16843. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16844. * JavaScriptCore.xcodeproj/project.pbxproj:
  16845. * VM/CTI.cpp:
  16846. * VM/CTI.h:
  16847. * VM/ExceptionHelpers.cpp:
  16848. * VM/Machine.cpp:
  16849. * VM/Machine.h: Removed.
  16850. * VM/SamplingTool.cpp:
  16851. * bytecode/CodeBlock.cpp:
  16852. * bytecompiler/BytecodeGenerator.cpp:
  16853. * bytecompiler/BytecodeGenerator.h:
  16854. * debugger/DebuggerCallFrame.cpp:
  16855. * interpreter: Added.
  16856. * interpreter/Interpreter.h: Copied from VM/Machine.h.
  16857. * profiler/ProfileGenerator.cpp:
  16858. * runtime/Arguments.h:
  16859. * runtime/ArrayPrototype.cpp:
  16860. * runtime/Collector.cpp:
  16861. * runtime/Completion.cpp:
  16862. * runtime/ExecState.h:
  16863. * runtime/FunctionPrototype.cpp:
  16864. * runtime/JSActivation.cpp:
  16865. * runtime/JSFunction.cpp:
  16866. * runtime/JSGlobalData.cpp:
  16867. * runtime/JSGlobalObject.cpp:
  16868. * runtime/JSGlobalObjectFunctions.cpp:
  16869. * wrec/WREC.cpp:
  16870. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16871. Reviewed by Sam Weinig.
  16872. Moved runtime/Interpreter.cpp => runtime/Completion.cpp.
  16873. Moved functions from Interpreter.h to Completion.h, and removed
  16874. Interpreter.h from the project.
  16875. * API/JSBase.cpp:
  16876. * AllInOneFile.cpp:
  16877. * GNUmakefile.am:
  16878. * JavaScriptCore.pri:
  16879. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16880. * JavaScriptCore.xcodeproj/project.pbxproj:
  16881. * JavaScriptCoreSources.bkl:
  16882. * jsc.cpp:
  16883. * runtime/Completion.cpp: Copied from runtime/Interpreter.cpp.
  16884. * runtime/Completion.h:
  16885. * runtime/Interpreter.cpp: Removed.
  16886. * runtime/Interpreter.h: Removed.
  16887. 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
  16888. Reviewed by Darin Adler.
  16889. <https://bugs.webkit.org/show_bug.cgi?id=22312>
  16890. Fix PCRE include path problem on Qt-port
  16891. * JavaScriptCore.pri:
  16892. * pcre/pcre.pri:
  16893. 2008-11-17 Gabor Loki <loki@inf.u-szeged.hu>
  16894. Reviewed by Darin Adler.
  16895. <https://bugs.webkit.org/show_bug.cgi?id=22313>
  16896. Add missing CTI source to the build system on Qt-port
  16897. * JavaScriptCore.pri:
  16898. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16899. Not reviewed.
  16900. Try to fix JSGlue build.
  16901. * JavaScriptCore.xcodeproj/project.pbxproj:
  16902. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16903. Not reviewed.
  16904. Try to fix Qt build.
  16905. * jsc.pro:
  16906. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16907. Not reviewed.
  16908. Try to fix Qt build.
  16909. * JavaScriptCore.pri:
  16910. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16911. Not reviewed.
  16912. Try to fix Qt build.
  16913. * JavaScriptCore.pri:
  16914. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16915. Reviewed by Sam Weinig.
  16916. More file moves:
  16917. VM/CodeBlock.* => bytecode/CodeBlock.*
  16918. VM/EvalCodeCache.h => bytecode/EvalCodeCache.h
  16919. VM/Instruction.h => bytecode/Instruction.h
  16920. VM/Opcode.* => bytecode/Opcode.*
  16921. * GNUmakefile.am:
  16922. * JavaScriptCore.scons:
  16923. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16924. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  16925. * JavaScriptCore.xcodeproj/project.pbxproj:
  16926. * JavaScriptCoreSources.bkl:
  16927. * VM/CodeBlock.cpp: Removed.
  16928. * VM/CodeBlock.h: Removed.
  16929. * VM/EvalCodeCache.h: Removed.
  16930. * VM/Instruction.h: Removed.
  16931. * VM/Opcode.cpp: Removed.
  16932. * VM/Opcode.h: Removed.
  16933. * bytecode: Added.
  16934. * bytecode/CodeBlock.cpp: Copied from VM/CodeBlock.cpp.
  16935. * bytecode/CodeBlock.h: Copied from VM/CodeBlock.h.
  16936. * bytecode/EvalCodeCache.h: Copied from VM/EvalCodeCache.h.
  16937. * bytecode/Instruction.h: Copied from VM/Instruction.h.
  16938. * bytecode/Opcode.cpp: Copied from VM/Opcode.cpp.
  16939. * bytecode/Opcode.h: Copied from VM/Opcode.h.
  16940. * jsc.pro:
  16941. * jscore.bkl:
  16942. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16943. Not reviewed.
  16944. Try to fix a few more builds.
  16945. * GNUmakefile.am:
  16946. * JavaScriptCore.pri:
  16947. * JavaScriptCore.scons:
  16948. * JavaScriptCoreSources.bkl:
  16949. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16950. Not reviewed.
  16951. Try to fix gtk build.
  16952. * GNUmakefile.am:
  16953. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16954. Not reviewed.
  16955. Try to fix Windows build.
  16956. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16957. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16958. Reviewed by Sam Weinig.
  16959. Some file moves:
  16960. VM/LabelID.h => bytecompiler/Label.h
  16961. VM/RegisterID.h => bytecompiler/RegisterID.h
  16962. VM/SegmentedVector.h => bytecompiler/SegmentedVector.h
  16963. bytecompiler/CodeGenerator.* => bytecompiler/BytecodeGenerator.*
  16964. * AllInOneFile.cpp:
  16965. * JavaScriptCore.xcodeproj/project.pbxproj:
  16966. * VM/LabelID.h: Removed.
  16967. * VM/RegisterID.h: Removed.
  16968. * VM/SegmentedVector.h: Removed.
  16969. * bytecompiler/BytecodeGenerator.cpp: Copied from bytecompiler/CodeGenerator.cpp.
  16970. * bytecompiler/BytecodeGenerator.h: Copied from bytecompiler/CodeGenerator.h.
  16971. * bytecompiler/CodeGenerator.cpp: Removed.
  16972. * bytecompiler/CodeGenerator.h: Removed.
  16973. * bytecompiler/Label.h: Copied from VM/LabelID.h.
  16974. * bytecompiler/LabelScope.h:
  16975. * bytecompiler/RegisterID.h: Copied from VM/RegisterID.h.
  16976. * bytecompiler/SegmentedVector.h: Copied from VM/SegmentedVector.h.
  16977. * jsc.cpp:
  16978. * parser/Nodes.cpp:
  16979. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16980. Not reviewed.
  16981. Try to fix Windows build.
  16982. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16983. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16984. Not reviewed.
  16985. Try to fix Windows build.
  16986. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16987. 2008-11-17 Geoffrey Garen <ggaren@apple.com>
  16988. Not reviewed.
  16989. Try to fix Windows build.
  16990. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16991. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  16992. Not reviewed.
  16993. Try to fix Windows build.
  16994. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  16995. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  16996. Not reviewed.
  16997. Try to fix Windows build.
  16998. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16999. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17000. Reviewed by Sam Weinig.
  17001. Moved masm => assembler and split "AssemblerBuffer.h" out of "X86Assembler.h".
  17002. Also renamed ENABLE_MASM to ENABLE_ASSEMBLER.
  17003. * GNUmakefile.am:
  17004. * JavaScriptCore.xcodeproj/project.pbxproj:
  17005. * assembler: Added.
  17006. * assembler/AssemblerBuffer.h: Copied from masm/X86Assembler.h.
  17007. (JSC::AssemblerBuffer::AssemblerBuffer):
  17008. (JSC::AssemblerBuffer::~AssemblerBuffer):
  17009. (JSC::AssemblerBuffer::ensureSpace):
  17010. (JSC::AssemblerBuffer::isAligned):
  17011. (JSC::AssemblerBuffer::putByteUnchecked):
  17012. (JSC::AssemblerBuffer::putByte):
  17013. (JSC::AssemblerBuffer::putShortUnchecked):
  17014. (JSC::AssemblerBuffer::putShort):
  17015. (JSC::AssemblerBuffer::putIntUnchecked):
  17016. (JSC::AssemblerBuffer::putInt):
  17017. (JSC::AssemblerBuffer::data):
  17018. (JSC::AssemblerBuffer::size):
  17019. (JSC::AssemblerBuffer::reset):
  17020. (JSC::AssemblerBuffer::executableCopy):
  17021. (JSC::AssemblerBuffer::grow):
  17022. * assembler/X86Assembler.h: Copied from masm/X86Assembler.h.
  17023. * masm: Removed.
  17024. * masm/X86Assembler.h: Removed.
  17025. * wtf/Platform.h:
  17026. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17027. Not reviewed.
  17028. Try to fix gtk build.
  17029. * GNUmakefile.am:
  17030. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17031. Not reviewed.
  17032. Fixed tyop.
  17033. * VM/CTI.cpp:
  17034. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17035. Not reviewed.
  17036. Try to fix windows build.
  17037. * VM/CTI.cpp:
  17038. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17039. Not reviewed.
  17040. Try to fix gtk build.
  17041. * GNUmakefile.am:
  17042. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17043. Reviewed by Sam Weinig.
  17044. Renamed ENABLE_CTI and ENABLE(CTI) to ENABLE_JIT and ENABLE(JIT).
  17045. * VM/CTI.cpp:
  17046. * VM/CTI.h:
  17047. * VM/CodeBlock.cpp:
  17048. (JSC::CodeBlock::~CodeBlock):
  17049. * VM/CodeBlock.h:
  17050. (JSC::CodeBlock::CodeBlock):
  17051. * VM/Machine.cpp:
  17052. (JSC::Interpreter::Interpreter):
  17053. (JSC::Interpreter::initialize):
  17054. (JSC::Interpreter::~Interpreter):
  17055. (JSC::Interpreter::execute):
  17056. (JSC::Interpreter::privateExecute):
  17057. * VM/Machine.h:
  17058. * bytecompiler/CodeGenerator.cpp:
  17059. (JSC::prepareJumpTableForStringSwitch):
  17060. * runtime/JSFunction.cpp:
  17061. (JSC::JSFunction::~JSFunction):
  17062. * runtime/JSGlobalData.h:
  17063. * wrec/WREC.h:
  17064. * wtf/Platform.h:
  17065. * wtf/TCSystemAlloc.cpp:
  17066. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17067. Not reviewed.
  17068. Try to fix gtk build.
  17069. * VM/CTI.cpp:
  17070. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17071. Reviewed by a few people on squirrelfish-dev.
  17072. Renamed CTI => JIT.
  17073. * VM/CTI.cpp:
  17074. (JSC::JIT::killLastResultRegister):
  17075. (JSC::JIT::emitGetVirtualRegister):
  17076. (JSC::JIT::emitGetVirtualRegisters):
  17077. (JSC::JIT::emitPutCTIArgFromVirtualRegister):
  17078. (JSC::JIT::emitPutCTIArg):
  17079. (JSC::JIT::emitGetCTIArg):
  17080. (JSC::JIT::emitPutCTIArgConstant):
  17081. (JSC::JIT::getConstantImmediateNumericArg):
  17082. (JSC::JIT::emitPutCTIParam):
  17083. (JSC::JIT::emitGetCTIParam):
  17084. (JSC::JIT::emitPutToCallFrameHeader):
  17085. (JSC::JIT::emitGetFromCallFrameHeader):
  17086. (JSC::JIT::emitPutVirtualRegister):
  17087. (JSC::JIT::emitInitRegister):
  17088. (JSC::JIT::printBytecodeOperandTypes):
  17089. (JSC::JIT::emitAllocateNumber):
  17090. (JSC::JIT::emitNakedCall):
  17091. (JSC::JIT::emitNakedFastCall):
  17092. (JSC::JIT::emitCTICall):
  17093. (JSC::JIT::emitJumpSlowCaseIfNotJSCell):
  17094. (JSC::JIT::linkSlowCaseIfNotJSCell):
  17095. (JSC::JIT::emitJumpSlowCaseIfNotImmNum):
  17096. (JSC::JIT::emitJumpSlowCaseIfNotImmNums):
  17097. (JSC::JIT::getDeTaggedConstantImmediate):
  17098. (JSC::JIT::emitFastArithDeTagImmediate):
  17099. (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  17100. (JSC::JIT::emitFastArithReTagImmediate):
  17101. (JSC::JIT::emitFastArithPotentiallyReTagImmediate):
  17102. (JSC::JIT::emitFastArithImmToInt):
  17103. (JSC::JIT::emitFastArithIntToImmOrSlowCase):
  17104. (JSC::JIT::emitFastArithIntToImmNoCheck):
  17105. (JSC::JIT::emitArithIntToImmWithJump):
  17106. (JSC::JIT::emitTagAsBoolImmediate):
  17107. (JSC::JIT::JIT):
  17108. (JSC::JIT::compileOpCallInitializeCallFrame):
  17109. (JSC::JIT::compileOpCallSetupArgs):
  17110. (JSC::JIT::compileOpCallEvalSetupArgs):
  17111. (JSC::JIT::compileOpConstructSetupArgs):
  17112. (JSC::JIT::compileOpCall):
  17113. (JSC::JIT::compileOpStrictEq):
  17114. (JSC::JIT::emitSlowScriptCheck):
  17115. (JSC::JIT::putDoubleResultToJSNumberCellOrJSImmediate):
  17116. (JSC::JIT::compileBinaryArithOp):
  17117. (JSC::JIT::compileBinaryArithOpSlowCase):
  17118. (JSC::JIT::privateCompileMainPass):
  17119. (JSC::JIT::privateCompileLinkPass):
  17120. (JSC::JIT::privateCompileSlowCases):
  17121. (JSC::JIT::privateCompile):
  17122. (JSC::JIT::privateCompileGetByIdSelf):
  17123. (JSC::JIT::privateCompileGetByIdProto):
  17124. (JSC::JIT::privateCompileGetByIdChain):
  17125. (JSC::JIT::privateCompilePutByIdReplace):
  17126. (JSC::JIT::privateCompilePutByIdTransition):
  17127. (JSC::JIT::unlinkCall):
  17128. (JSC::JIT::linkCall):
  17129. (JSC::JIT::privateCompileCTIMachineTrampolines):
  17130. (JSC::JIT::freeCTIMachineTrampolines):
  17131. (JSC::JIT::patchGetByIdSelf):
  17132. (JSC::JIT::patchPutByIdReplace):
  17133. (JSC::JIT::privateCompilePatchGetArrayLength):
  17134. (JSC::JIT::emitGetVariableObjectRegister):
  17135. (JSC::JIT::emitPutVariableObjectRegister):
  17136. * VM/CTI.h:
  17137. (JSC::JIT::compile):
  17138. (JSC::JIT::compileGetByIdSelf):
  17139. (JSC::JIT::compileGetByIdProto):
  17140. (JSC::JIT::compileGetByIdChain):
  17141. (JSC::JIT::compilePutByIdReplace):
  17142. (JSC::JIT::compilePutByIdTransition):
  17143. (JSC::JIT::compileCTIMachineTrampolines):
  17144. (JSC::JIT::compilePatchGetArrayLength):
  17145. * VM/CodeBlock.cpp:
  17146. (JSC::CodeBlock::unlinkCallers):
  17147. * VM/Machine.cpp:
  17148. (JSC::Interpreter::initialize):
  17149. (JSC::Interpreter::~Interpreter):
  17150. (JSC::Interpreter::execute):
  17151. (JSC::Interpreter::tryCTICachePutByID):
  17152. (JSC::Interpreter::tryCTICacheGetByID):
  17153. (JSC::Interpreter::cti_op_call_JSFunction):
  17154. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  17155. (JSC::Interpreter::cti_vm_lazyLinkCall):
  17156. * VM/Machine.h:
  17157. * VM/RegisterFile.h:
  17158. * parser/Nodes.h:
  17159. * runtime/JSArray.h:
  17160. * runtime/JSCell.h:
  17161. * runtime/JSFunction.h:
  17162. * runtime/JSImmediate.h:
  17163. * runtime/JSNumberCell.h:
  17164. * runtime/JSObject.h:
  17165. * runtime/JSString.h:
  17166. * runtime/JSVariableObject.h:
  17167. * runtime/ScopeChain.h:
  17168. * runtime/Structure.h:
  17169. * runtime/TypeInfo.h:
  17170. * runtime/UString.h:
  17171. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17172. Not reviewed.
  17173. Try to fix wx build.
  17174. * jscore.bkl:
  17175. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17176. Reviewed by Sam Weinig.
  17177. Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs.
  17178. * VM/CTI.cpp:
  17179. (JSC::CTI::emitGetVirtualRegister):
  17180. (JSC::CTI::emitGetVirtualRegisters):
  17181. (JSC::CTI::emitPutCTIArgFromVirtualRegister):
  17182. (JSC::CTI::emitPutCTIArg):
  17183. (JSC::CTI::emitGetCTIArg):
  17184. (JSC::CTI::emitPutCTIParam):
  17185. (JSC::CTI::emitGetCTIParam):
  17186. (JSC::CTI::emitPutToCallFrameHeader):
  17187. (JSC::CTI::emitGetFromCallFrameHeader):
  17188. (JSC::CTI::emitPutVirtualRegister):
  17189. (JSC::CTI::emitNakedCall):
  17190. (JSC::CTI::emitNakedFastCall):
  17191. (JSC::CTI::emitCTICall):
  17192. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  17193. (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
  17194. (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
  17195. (JSC::CTI::emitFastArithDeTagImmediate):
  17196. (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
  17197. (JSC::CTI::emitFastArithReTagImmediate):
  17198. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  17199. (JSC::CTI::emitFastArithImmToInt):
  17200. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  17201. (JSC::CTI::emitFastArithIntToImmNoCheck):
  17202. (JSC::CTI::emitArithIntToImmWithJump):
  17203. (JSC::CTI::emitTagAsBoolImmediate):
  17204. (JSC::CTI::compileOpCall):
  17205. (JSC::CTI::compileOpStrictEq):
  17206. (JSC::CTI::emitSlowScriptCheck):
  17207. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  17208. (JSC::CTI::compileBinaryArithOp):
  17209. (JSC::CTI::compileBinaryArithOpSlowCase):
  17210. (JSC::CTI::privateCompileMainPass):
  17211. (JSC::CTI::privateCompileSlowCases):
  17212. (JSC::CTI::privateCompile):
  17213. (JSC::CTI::privateCompileGetByIdSelf):
  17214. (JSC::CTI::privateCompileGetByIdProto):
  17215. (JSC::CTI::privateCompileGetByIdChain):
  17216. (JSC::CTI::privateCompilePutByIdReplace):
  17217. (JSC::CTI::privateCompilePutByIdTransition):
  17218. (JSC::CTI::privateCompileCTIMachineTrampolines):
  17219. (JSC::CTI::privateCompilePatchGetArrayLength):
  17220. (JSC::CTI::emitGetVariableObjectRegister):
  17221. (JSC::CTI::emitPutVariableObjectRegister):
  17222. * VM/CTI.h:
  17223. (JSC::CallRecord::CallRecord):
  17224. (JSC::JmpTable::JmpTable):
  17225. (JSC::SlowCaseEntry::SlowCaseEntry):
  17226. (JSC::CTI::JSRInfo::JSRInfo):
  17227. * wrec/WREC.h:
  17228. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17229. Not reviewed.
  17230. Try to fix Qt build.
  17231. * JavaScriptCore.pri:
  17232. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17233. Reviewed by Sam Weinig.
  17234. Renamed OBJECT_OFFSET => FIELD_OFFSET
  17235. Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in
  17236. more places.
  17237. * VM/CTI.cpp:
  17238. (JSC::CTI::compileOpCallInitializeCallFrame):
  17239. (JSC::CTI::compileOpCall):
  17240. (JSC::CTI::emitSlowScriptCheck):
  17241. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  17242. (JSC::CTI::compileBinaryArithOp):
  17243. (JSC::CTI::privateCompileMainPass):
  17244. (JSC::CTI::privateCompileSlowCases):
  17245. (JSC::CTI::privateCompile):
  17246. (JSC::CTI::privateCompileGetByIdSelf):
  17247. (JSC::CTI::privateCompileGetByIdProto):
  17248. (JSC::CTI::privateCompileGetByIdChain):
  17249. (JSC::CTI::privateCompilePutByIdReplace):
  17250. (JSC::CTI::privateCompilePutByIdTransition):
  17251. (JSC::CTI::privateCompileCTIMachineTrampolines):
  17252. (JSC::CTI::privateCompilePatchGetArrayLength):
  17253. (JSC::CTI::emitGetVariableObjectRegister):
  17254. (JSC::CTI::emitPutVariableObjectRegister):
  17255. * runtime/JSValue.h:
  17256. * runtime/JSVariableObject.h:
  17257. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17258. Reviewed by Sam Weinig.
  17259. Renames:
  17260. X86Assembler::copy => X86Assembler::executableCopy
  17261. AssemblerBuffer::copy => AssemblerBuffer::executableCopy
  17262. * VM/CTI.cpp:
  17263. (JSC::CTI::privateCompile):
  17264. (JSC::CTI::privateCompileGetByIdSelf):
  17265. (JSC::CTI::privateCompileGetByIdProto):
  17266. (JSC::CTI::privateCompileGetByIdChain):
  17267. (JSC::CTI::privateCompilePutByIdReplace):
  17268. (JSC::CTI::privateCompilePutByIdTransition):
  17269. (JSC::CTI::privateCompileCTIMachineTrampolines):
  17270. (JSC::CTI::privateCompilePatchGetArrayLength):
  17271. * masm/X86Assembler.h:
  17272. (JSC::AssemblerBuffer::executableCopy):
  17273. (JSC::X86Assembler::executableCopy):
  17274. * wrec/WREC.cpp:
  17275. (JSC::WREC::compileRegExp):
  17276. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17277. Reviewed by Sam Weinig.
  17278. Renamed WREC => JSC::WREC, removing JSC:: prefix in a lot of places.
  17279. Renamed WRECFunction => WREC::CompiledRegExp, and deployed this type
  17280. name in place of a few casts.
  17281. * runtime/RegExp.cpp:
  17282. (JSC::RegExp::RegExp):
  17283. (JSC::RegExp::~RegExp):
  17284. (JSC::RegExp::match):
  17285. * runtime/RegExp.h:
  17286. * wrec/CharacterClassConstructor.cpp:
  17287. * wrec/CharacterClassConstructor.h:
  17288. * wrec/WREC.cpp:
  17289. (JSC::WREC::compileRegExp):
  17290. * wrec/WREC.h:
  17291. (JSC::WREC::Generator::Generator):
  17292. (JSC::WREC::Parser::Parser):
  17293. (JSC::WREC::Parser::parseAlternative):
  17294. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17295. Reviewed by Sam Weinig.
  17296. Renamed BytecodeInterpreter => Interpreter.
  17297. * JavaScriptCore.exp:
  17298. * VM/CTI.cpp:
  17299. (JSC::):
  17300. (JSC::CTI::compileOpCall):
  17301. (JSC::CTI::emitSlowScriptCheck):
  17302. (JSC::CTI::compileBinaryArithOpSlowCase):
  17303. (JSC::CTI::privateCompileMainPass):
  17304. (JSC::CTI::privateCompileSlowCases):
  17305. (JSC::CTI::privateCompile):
  17306. (JSC::CTI::privateCompileGetByIdSelf):
  17307. (JSC::CTI::privateCompileGetByIdProto):
  17308. (JSC::CTI::privateCompileGetByIdChain):
  17309. (JSC::CTI::privateCompilePutByIdReplace):
  17310. (JSC::CTI::privateCompilePutByIdTransition):
  17311. (JSC::CTI::privateCompileCTIMachineTrampolines):
  17312. (JSC::CTI::freeCTIMachineTrampolines):
  17313. (JSC::CTI::patchGetByIdSelf):
  17314. (JSC::CTI::patchPutByIdReplace):
  17315. (JSC::CTI::privateCompilePatchGetArrayLength):
  17316. * VM/CTI.h:
  17317. * VM/CodeBlock.cpp:
  17318. (JSC::CodeBlock::printStructures):
  17319. (JSC::CodeBlock::derefStructures):
  17320. (JSC::CodeBlock::refStructures):
  17321. * VM/Machine.cpp:
  17322. (JSC::jsLess):
  17323. (JSC::jsLessEq):
  17324. (JSC::Interpreter::resolve):
  17325. (JSC::Interpreter::resolveSkip):
  17326. (JSC::Interpreter::resolveGlobal):
  17327. (JSC::Interpreter::resolveBase):
  17328. (JSC::Interpreter::resolveBaseAndProperty):
  17329. (JSC::Interpreter::resolveBaseAndFunc):
  17330. (JSC::Interpreter::slideRegisterWindowForCall):
  17331. (JSC::Interpreter::callEval):
  17332. (JSC::Interpreter::Interpreter):
  17333. (JSC::Interpreter::initialize):
  17334. (JSC::Interpreter::~Interpreter):
  17335. (JSC::Interpreter::dumpCallFrame):
  17336. (JSC::Interpreter::dumpRegisters):
  17337. (JSC::Interpreter::isOpcode):
  17338. (JSC::Interpreter::unwindCallFrame):
  17339. (JSC::Interpreter::throwException):
  17340. (JSC::Interpreter::execute):
  17341. (JSC::Interpreter::debug):
  17342. (JSC::Interpreter::resetTimeoutCheck):
  17343. (JSC::Interpreter::checkTimeout):
  17344. (JSC::Interpreter::createExceptionScope):
  17345. (JSC::Interpreter::tryCachePutByID):
  17346. (JSC::Interpreter::uncachePutByID):
  17347. (JSC::Interpreter::tryCacheGetByID):
  17348. (JSC::Interpreter::uncacheGetByID):
  17349. (JSC::Interpreter::privateExecute):
  17350. (JSC::Interpreter::retrieveArguments):
  17351. (JSC::Interpreter::retrieveCaller):
  17352. (JSC::Interpreter::retrieveLastCaller):
  17353. (JSC::Interpreter::findFunctionCallFrame):
  17354. (JSC::Interpreter::tryCTICachePutByID):
  17355. (JSC::Interpreter::tryCTICacheGetByID):
  17356. (JSC::Interpreter::cti_op_convert_this):
  17357. (JSC::Interpreter::cti_op_end):
  17358. (JSC::Interpreter::cti_op_add):
  17359. (JSC::Interpreter::cti_op_pre_inc):
  17360. (JSC::Interpreter::cti_timeout_check):
  17361. (JSC::Interpreter::cti_register_file_check):
  17362. (JSC::Interpreter::cti_op_loop_if_less):
  17363. (JSC::Interpreter::cti_op_loop_if_lesseq):
  17364. (JSC::Interpreter::cti_op_new_object):
  17365. (JSC::Interpreter::cti_op_put_by_id):
  17366. (JSC::Interpreter::cti_op_put_by_id_second):
  17367. (JSC::Interpreter::cti_op_put_by_id_generic):
  17368. (JSC::Interpreter::cti_op_put_by_id_fail):
  17369. (JSC::Interpreter::cti_op_get_by_id):
  17370. (JSC::Interpreter::cti_op_get_by_id_second):
  17371. (JSC::Interpreter::cti_op_get_by_id_generic):
  17372. (JSC::Interpreter::cti_op_get_by_id_fail):
  17373. (JSC::Interpreter::cti_op_instanceof):
  17374. (JSC::Interpreter::cti_op_del_by_id):
  17375. (JSC::Interpreter::cti_op_mul):
  17376. (JSC::Interpreter::cti_op_new_func):
  17377. (JSC::Interpreter::cti_op_call_JSFunction):
  17378. (JSC::Interpreter::cti_op_call_arityCheck):
  17379. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  17380. (JSC::Interpreter::cti_vm_lazyLinkCall):
  17381. (JSC::Interpreter::cti_op_push_activation):
  17382. (JSC::Interpreter::cti_op_call_NotJSFunction):
  17383. (JSC::Interpreter::cti_op_create_arguments):
  17384. (JSC::Interpreter::cti_op_create_arguments_no_params):
  17385. (JSC::Interpreter::cti_op_tear_off_activation):
  17386. (JSC::Interpreter::cti_op_tear_off_arguments):
  17387. (JSC::Interpreter::cti_op_profile_will_call):
  17388. (JSC::Interpreter::cti_op_profile_did_call):
  17389. (JSC::Interpreter::cti_op_ret_scopeChain):
  17390. (JSC::Interpreter::cti_op_new_array):
  17391. (JSC::Interpreter::cti_op_resolve):
  17392. (JSC::Interpreter::cti_op_construct_JSConstruct):
  17393. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  17394. (JSC::Interpreter::cti_op_get_by_val):
  17395. (JSC::Interpreter::cti_op_resolve_func):
  17396. (JSC::Interpreter::cti_op_sub):
  17397. (JSC::Interpreter::cti_op_put_by_val):
  17398. (JSC::Interpreter::cti_op_put_by_val_array):
  17399. (JSC::Interpreter::cti_op_lesseq):
  17400. (JSC::Interpreter::cti_op_loop_if_true):
  17401. (JSC::Interpreter::cti_op_negate):
  17402. (JSC::Interpreter::cti_op_resolve_base):
  17403. (JSC::Interpreter::cti_op_resolve_skip):
  17404. (JSC::Interpreter::cti_op_resolve_global):
  17405. (JSC::Interpreter::cti_op_div):
  17406. (JSC::Interpreter::cti_op_pre_dec):
  17407. (JSC::Interpreter::cti_op_jless):
  17408. (JSC::Interpreter::cti_op_not):
  17409. (JSC::Interpreter::cti_op_jtrue):
  17410. (JSC::Interpreter::cti_op_post_inc):
  17411. (JSC::Interpreter::cti_op_eq):
  17412. (JSC::Interpreter::cti_op_lshift):
  17413. (JSC::Interpreter::cti_op_bitand):
  17414. (JSC::Interpreter::cti_op_rshift):
  17415. (JSC::Interpreter::cti_op_bitnot):
  17416. (JSC::Interpreter::cti_op_resolve_with_base):
  17417. (JSC::Interpreter::cti_op_new_func_exp):
  17418. (JSC::Interpreter::cti_op_mod):
  17419. (JSC::Interpreter::cti_op_less):
  17420. (JSC::Interpreter::cti_op_neq):
  17421. (JSC::Interpreter::cti_op_post_dec):
  17422. (JSC::Interpreter::cti_op_urshift):
  17423. (JSC::Interpreter::cti_op_bitxor):
  17424. (JSC::Interpreter::cti_op_new_regexp):
  17425. (JSC::Interpreter::cti_op_bitor):
  17426. (JSC::Interpreter::cti_op_call_eval):
  17427. (JSC::Interpreter::cti_op_throw):
  17428. (JSC::Interpreter::cti_op_get_pnames):
  17429. (JSC::Interpreter::cti_op_next_pname):
  17430. (JSC::Interpreter::cti_op_push_scope):
  17431. (JSC::Interpreter::cti_op_pop_scope):
  17432. (JSC::Interpreter::cti_op_typeof):
  17433. (JSC::Interpreter::cti_op_is_undefined):
  17434. (JSC::Interpreter::cti_op_is_boolean):
  17435. (JSC::Interpreter::cti_op_is_number):
  17436. (JSC::Interpreter::cti_op_is_string):
  17437. (JSC::Interpreter::cti_op_is_object):
  17438. (JSC::Interpreter::cti_op_is_function):
  17439. (JSC::Interpreter::cti_op_stricteq):
  17440. (JSC::Interpreter::cti_op_nstricteq):
  17441. (JSC::Interpreter::cti_op_to_jsnumber):
  17442. (JSC::Interpreter::cti_op_in):
  17443. (JSC::Interpreter::cti_op_push_new_scope):
  17444. (JSC::Interpreter::cti_op_jmp_scopes):
  17445. (JSC::Interpreter::cti_op_put_by_index):
  17446. (JSC::Interpreter::cti_op_switch_imm):
  17447. (JSC::Interpreter::cti_op_switch_char):
  17448. (JSC::Interpreter::cti_op_switch_string):
  17449. (JSC::Interpreter::cti_op_del_by_val):
  17450. (JSC::Interpreter::cti_op_put_getter):
  17451. (JSC::Interpreter::cti_op_put_setter):
  17452. (JSC::Interpreter::cti_op_new_error):
  17453. (JSC::Interpreter::cti_op_debug):
  17454. (JSC::Interpreter::cti_vm_throw):
  17455. * VM/Machine.h:
  17456. * VM/Register.h:
  17457. * VM/SamplingTool.h:
  17458. (JSC::SamplingTool::SamplingTool):
  17459. * bytecompiler/CodeGenerator.cpp:
  17460. (JSC::BytecodeGenerator::generate):
  17461. (JSC::BytecodeGenerator::BytecodeGenerator):
  17462. * jsc.cpp:
  17463. (runWithScripts):
  17464. * runtime/ExecState.h:
  17465. (JSC::ExecState::interpreter):
  17466. * runtime/JSCell.h:
  17467. * runtime/JSFunction.h:
  17468. * runtime/JSGlobalData.cpp:
  17469. (JSC::JSGlobalData::JSGlobalData):
  17470. * runtime/JSGlobalData.h:
  17471. * runtime/JSString.h:
  17472. * wrec/WREC.cpp:
  17473. (WREC::compileRegExp):
  17474. * wrec/WREC.h:
  17475. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17476. Roll out r38461 (my last patch) because it broke the world.
  17477. 2008-11-16 Geoffrey Garen <ggaren@apple.com>
  17478. Reviewed by Sam Weinig.
  17479. A few more renames:
  17480. BytecodeInterpreter => Interpreter
  17481. WREC => JSC::WREC, removing JSC:: prefix in a lot of places
  17482. X86Assembler::copy => X86Assembler::executableCopy
  17483. AssemblerBuffer::copy => AssemblerBuffer::executableCopy
  17484. WRECFunction => WREC::RegExpFunction
  17485. OBJECT_OFFSET => FIELD_OFFSET
  17486. Also:
  17487. Nixed use of OBJECT_OFFSET outside of CTI.cpp by making CTI a friend in more places.
  17488. Nixed X86:: and X86Assembler:: prefixes in a lot of places using typedefs
  17489. * JavaScriptCore.exp:
  17490. * VM/CTI.cpp:
  17491. (JSC::):
  17492. (JSC::CTI::emitGetVirtualRegister):
  17493. (JSC::CTI::emitGetVirtualRegisters):
  17494. (JSC::CTI::emitPutCTIArgFromVirtualRegister):
  17495. (JSC::CTI::emitPutCTIArg):
  17496. (JSC::CTI::emitGetCTIArg):
  17497. (JSC::CTI::emitPutCTIParam):
  17498. (JSC::CTI::emitGetCTIParam):
  17499. (JSC::CTI::emitPutToCallFrameHeader):
  17500. (JSC::CTI::emitGetFromCallFrameHeader):
  17501. (JSC::CTI::emitPutVirtualRegister):
  17502. (JSC::CTI::emitNakedCall):
  17503. (JSC::CTI::emitNakedFastCall):
  17504. (JSC::CTI::emitCTICall):
  17505. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  17506. (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
  17507. (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
  17508. (JSC::CTI::emitFastArithDeTagImmediate):
  17509. (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
  17510. (JSC::CTI::emitFastArithReTagImmediate):
  17511. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  17512. (JSC::CTI::emitFastArithImmToInt):
  17513. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  17514. (JSC::CTI::emitFastArithIntToImmNoCheck):
  17515. (JSC::CTI::emitArithIntToImmWithJump):
  17516. (JSC::CTI::emitTagAsBoolImmediate):
  17517. (JSC::CTI::compileOpCallInitializeCallFrame):
  17518. (JSC::CTI::compileOpCall):
  17519. (JSC::CTI::compileOpStrictEq):
  17520. (JSC::CTI::emitSlowScriptCheck):
  17521. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  17522. (JSC::CTI::compileBinaryArithOp):
  17523. (JSC::CTI::compileBinaryArithOpSlowCase):
  17524. (JSC::CTI::privateCompileMainPass):
  17525. (JSC::CTI::privateCompileSlowCases):
  17526. (JSC::CTI::privateCompile):
  17527. (JSC::CTI::privateCompileGetByIdSelf):
  17528. (JSC::CTI::privateCompileGetByIdProto):
  17529. (JSC::CTI::privateCompileGetByIdChain):
  17530. (JSC::CTI::privateCompilePutByIdReplace):
  17531. (JSC::CTI::privateCompilePutByIdTransition):
  17532. (JSC::CTI::privateCompileCTIMachineTrampolines):
  17533. (JSC::CTI::freeCTIMachineTrampolines):
  17534. (JSC::CTI::patchGetByIdSelf):
  17535. (JSC::CTI::patchPutByIdReplace):
  17536. (JSC::CTI::privateCompilePatchGetArrayLength):
  17537. (JSC::CTI::emitGetVariableObjectRegister):
  17538. (JSC::CTI::emitPutVariableObjectRegister):
  17539. * VM/CTI.h:
  17540. (JSC::CallRecord::CallRecord):
  17541. (JSC::JmpTable::JmpTable):
  17542. (JSC::SlowCaseEntry::SlowCaseEntry):
  17543. (JSC::CTI::JSRInfo::JSRInfo):
  17544. * VM/CodeBlock.cpp:
  17545. (JSC::CodeBlock::printStructures):
  17546. (JSC::CodeBlock::derefStructures):
  17547. (JSC::CodeBlock::refStructures):
  17548. * VM/Machine.cpp:
  17549. (JSC::jsLess):
  17550. (JSC::jsLessEq):
  17551. (JSC::Interpreter::resolve):
  17552. (JSC::Interpreter::resolveSkip):
  17553. (JSC::Interpreter::resolveGlobal):
  17554. (JSC::Interpreter::resolveBase):
  17555. (JSC::Interpreter::resolveBaseAndProperty):
  17556. (JSC::Interpreter::resolveBaseAndFunc):
  17557. (JSC::Interpreter::slideRegisterWindowForCall):
  17558. (JSC::Interpreter::callEval):
  17559. (JSC::Interpreter::Interpreter):
  17560. (JSC::Interpreter::initialize):
  17561. (JSC::Interpreter::~Interpreter):
  17562. (JSC::Interpreter::dumpCallFrame):
  17563. (JSC::Interpreter::dumpRegisters):
  17564. (JSC::Interpreter::isOpcode):
  17565. (JSC::Interpreter::unwindCallFrame):
  17566. (JSC::Interpreter::throwException):
  17567. (JSC::Interpreter::execute):
  17568. (JSC::Interpreter::debug):
  17569. (JSC::Interpreter::resetTimeoutCheck):
  17570. (JSC::Interpreter::checkTimeout):
  17571. (JSC::Interpreter::createExceptionScope):
  17572. (JSC::Interpreter::tryCachePutByID):
  17573. (JSC::Interpreter::uncachePutByID):
  17574. (JSC::Interpreter::tryCacheGetByID):
  17575. (JSC::Interpreter::uncacheGetByID):
  17576. (JSC::Interpreter::privateExecute):
  17577. (JSC::Interpreter::retrieveArguments):
  17578. (JSC::Interpreter::retrieveCaller):
  17579. (JSC::Interpreter::retrieveLastCaller):
  17580. (JSC::Interpreter::findFunctionCallFrame):
  17581. (JSC::Interpreter::tryCTICachePutByID):
  17582. (JSC::Interpreter::tryCTICacheGetByID):
  17583. (JSC::):
  17584. (JSC::Interpreter::cti_op_convert_this):
  17585. (JSC::Interpreter::cti_op_end):
  17586. (JSC::Interpreter::cti_op_add):
  17587. (JSC::Interpreter::cti_op_pre_inc):
  17588. (JSC::Interpreter::cti_timeout_check):
  17589. (JSC::Interpreter::cti_register_file_check):
  17590. (JSC::Interpreter::cti_op_loop_if_less):
  17591. (JSC::Interpreter::cti_op_loop_if_lesseq):
  17592. (JSC::Interpreter::cti_op_new_object):
  17593. (JSC::Interpreter::cti_op_put_by_id):
  17594. (JSC::Interpreter::cti_op_put_by_id_second):
  17595. (JSC::Interpreter::cti_op_put_by_id_generic):
  17596. (JSC::Interpreter::cti_op_put_by_id_fail):
  17597. (JSC::Interpreter::cti_op_get_by_id):
  17598. (JSC::Interpreter::cti_op_get_by_id_second):
  17599. (JSC::Interpreter::cti_op_get_by_id_generic):
  17600. (JSC::Interpreter::cti_op_get_by_id_fail):
  17601. (JSC::Interpreter::cti_op_instanceof):
  17602. (JSC::Interpreter::cti_op_del_by_id):
  17603. (JSC::Interpreter::cti_op_mul):
  17604. (JSC::Interpreter::cti_op_new_func):
  17605. (JSC::Interpreter::cti_op_call_JSFunction):
  17606. (JSC::Interpreter::cti_op_call_arityCheck):
  17607. (JSC::Interpreter::cti_vm_dontLazyLinkCall):
  17608. (JSC::Interpreter::cti_vm_lazyLinkCall):
  17609. (JSC::Interpreter::cti_op_push_activation):
  17610. (JSC::Interpreter::cti_op_call_NotJSFunction):
  17611. (JSC::Interpreter::cti_op_create_arguments):
  17612. (JSC::Interpreter::cti_op_create_arguments_no_params):
  17613. (JSC::Interpreter::cti_op_tear_off_activation):
  17614. (JSC::Interpreter::cti_op_tear_off_arguments):
  17615. (JSC::Interpreter::cti_op_profile_will_call):
  17616. (JSC::Interpreter::cti_op_profile_did_call):
  17617. (JSC::Interpreter::cti_op_ret_scopeChain):
  17618. (JSC::Interpreter::cti_op_new_array):
  17619. (JSC::Interpreter::cti_op_resolve):
  17620. (JSC::Interpreter::cti_op_construct_JSConstruct):
  17621. (JSC::Interpreter::cti_op_construct_NotJSConstruct):
  17622. (JSC::Interpreter::cti_op_get_by_val):
  17623. (JSC::Interpreter::cti_op_resolve_func):
  17624. (JSC::Interpreter::cti_op_sub):
  17625. (JSC::Interpreter::cti_op_put_by_val):
  17626. (JSC::Interpreter::cti_op_put_by_val_array):
  17627. (JSC::Interpreter::cti_op_lesseq):
  17628. (JSC::Interpreter::cti_op_loop_if_true):
  17629. (JSC::Interpreter::cti_op_negate):
  17630. (JSC::Interpreter::cti_op_resolve_base):
  17631. (JSC::Interpreter::cti_op_resolve_skip):
  17632. (JSC::Interpreter::cti_op_resolve_global):
  17633. (JSC::Interpreter::cti_op_div):
  17634. (JSC::Interpreter::cti_op_pre_dec):
  17635. (JSC::Interpreter::cti_op_jless):
  17636. (JSC::Interpreter::cti_op_not):
  17637. (JSC::Interpreter::cti_op_jtrue):
  17638. (JSC::Interpreter::cti_op_post_inc):
  17639. (JSC::Interpreter::cti_op_eq):
  17640. (JSC::Interpreter::cti_op_lshift):
  17641. (JSC::Interpreter::cti_op_bitand):
  17642. (JSC::Interpreter::cti_op_rshift):
  17643. (JSC::Interpreter::cti_op_bitnot):
  17644. (JSC::Interpreter::cti_op_resolve_with_base):
  17645. (JSC::Interpreter::cti_op_new_func_exp):
  17646. (JSC::Interpreter::cti_op_mod):
  17647. (JSC::Interpreter::cti_op_less):
  17648. (JSC::Interpreter::cti_op_neq):
  17649. (JSC::Interpreter::cti_op_post_dec):
  17650. (JSC::Interpreter::cti_op_urshift):
  17651. (JSC::Interpreter::cti_op_bitxor):
  17652. (JSC::Interpreter::cti_op_new_regexp):
  17653. (JSC::Interpreter::cti_op_bitor):
  17654. (JSC::Interpreter::cti_op_call_eval):
  17655. (JSC::Interpreter::cti_op_throw):
  17656. (JSC::Interpreter::cti_op_get_pnames):
  17657. (JSC::Interpreter::cti_op_next_pname):
  17658. (JSC::Interpreter::cti_op_push_scope):
  17659. (JSC::Interpreter::cti_op_pop_scope):
  17660. (JSC::Interpreter::cti_op_typeof):
  17661. (JSC::Interpreter::cti_op_is_undefined):
  17662. (JSC::Interpreter::cti_op_is_boolean):
  17663. (JSC::Interpreter::cti_op_is_number):
  17664. (JSC::Interpreter::cti_op_is_string):
  17665. (JSC::Interpreter::cti_op_is_object):
  17666. (JSC::Interpreter::cti_op_is_function):
  17667. (JSC::Interpreter::cti_op_stricteq):
  17668. (JSC::Interpreter::cti_op_nstricteq):
  17669. (JSC::Interpreter::cti_op_to_jsnumber):
  17670. (JSC::Interpreter::cti_op_in):
  17671. (JSC::Interpreter::cti_op_push_new_scope):
  17672. (JSC::Interpreter::cti_op_jmp_scopes):
  17673. (JSC::Interpreter::cti_op_put_by_index):
  17674. (JSC::Interpreter::cti_op_switch_imm):
  17675. (JSC::Interpreter::cti_op_switch_char):
  17676. (JSC::Interpreter::cti_op_switch_string):
  17677. (JSC::Interpreter::cti_op_del_by_val):
  17678. (JSC::Interpreter::cti_op_put_getter):
  17679. (JSC::Interpreter::cti_op_put_setter):
  17680. (JSC::Interpreter::cti_op_new_error):
  17681. (JSC::Interpreter::cti_op_debug):
  17682. (JSC::Interpreter::cti_vm_throw):
  17683. * VM/Machine.h:
  17684. * VM/Register.h:
  17685. * VM/SamplingTool.cpp:
  17686. (JSC::SamplingTool::dump):
  17687. * VM/SamplingTool.h:
  17688. (JSC::SamplingTool::SamplingTool):
  17689. * bytecompiler/CodeGenerator.cpp:
  17690. (JSC::BytecodeGenerator::generate):
  17691. (JSC::BytecodeGenerator::BytecodeGenerator):
  17692. * jsc.cpp:
  17693. (runWithScripts):
  17694. * masm/X86Assembler.h:
  17695. (JSC::AssemblerBuffer::executableCopy):
  17696. (JSC::X86Assembler::executableCopy):
  17697. * runtime/ExecState.h:
  17698. (JSC::ExecState::interpreter):
  17699. * runtime/JSCell.h:
  17700. * runtime/JSFunction.h:
  17701. * runtime/JSGlobalData.cpp:
  17702. (JSC::JSGlobalData::JSGlobalData):
  17703. * runtime/JSGlobalData.h:
  17704. * runtime/JSImmediate.h:
  17705. * runtime/JSString.h:
  17706. * runtime/JSValue.h:
  17707. * runtime/JSVariableObject.h:
  17708. * runtime/RegExp.cpp:
  17709. (JSC::RegExp::RegExp):
  17710. (JSC::RegExp::~RegExp):
  17711. (JSC::RegExp::match):
  17712. * runtime/RegExp.h:
  17713. * wrec/CharacterClassConstructor.cpp:
  17714. * wrec/CharacterClassConstructor.h:
  17715. * wrec/WREC.cpp:
  17716. (JSC::WREC::compileRegExp):
  17717. * wrec/WREC.h:
  17718. (JSC::WREC::Generator::Generator):
  17719. (JSC::WREC::Parser::):
  17720. (JSC::WREC::Parser::Parser):
  17721. (JSC::WREC::Parser::parseAlternative):
  17722. 2008-11-16 Greg Bolsinga <bolsinga@apple.com>
  17723. Reviewed by Darin Adler.
  17724. https://bugs.webkit.org/show_bug.cgi?id=21810
  17725. Remove use of static C++ objects that are destroyed at exit time (destructors)
  17726. Conditionally have the DEFINE_STATIC_LOCAL workaround <rdar://problem/6354696>
  17727. (Codegen issue with C++ static reference in gcc build 5465) based upon the compiler
  17728. build versions. It will use the:
  17729. static T& = *new T;
  17730. style for all other compilers.
  17731. * wtf/StdLibExtras.h:
  17732. 2008-11-16 Alexey Proskuryakov <ap@webkit.org>
  17733. Reviewed by Dan Bernstein.
  17734. https://bugs.webkit.org/show_bug.cgi?id=22290
  17735. Remove cross-heap GC and MessagePort multi-threading support
  17736. It is broken (and may not be implementable at all), and no longer needed, as we
  17737. don't use MessagePorts for communication with workers any more.
  17738. * JavaScriptCore.exp:
  17739. * runtime/Collector.cpp:
  17740. (JSC::Heap::collect):
  17741. * runtime/JSGlobalObject.cpp:
  17742. * runtime/JSGlobalObject.h:
  17743. Remove hooks for cross-heap GC.
  17744. 2008-11-15 Sam Weinig <sam@webkit.org>
  17745. Reviewed by Cameron Zwarich.
  17746. Cleanup jsc command line code a little.
  17747. * jsc.cpp:
  17748. (functionQuit):
  17749. (main): Use standard exit status macros
  17750. (cleanupGlobalData): Factor out cleanup code into this function.
  17751. (printUsageStatement): Use standard exit status macros.
  17752. 2008-11-15 Sam Weinig <sam@webkit.org>
  17753. Reviewed by Cameron Zwarich.
  17754. Cleanup BytecodeGenerator constructors.
  17755. * bytecompiler/CodeGenerator.cpp:
  17756. (JSC::BytecodeGenerator::BytecodeGenerator):
  17757. * bytecompiler/CodeGenerator.h:
  17758. * parser/Nodes.cpp:
  17759. (JSC::ProgramNode::generateBytecode):
  17760. 2008-11-15 Darin Adler <darin@apple.com>
  17761. Rubber stamped by Geoff Garen.
  17762. - do the long-planned StructureID -> Structure rename
  17763. * API/JSCallbackConstructor.cpp:
  17764. (JSC::JSCallbackConstructor::JSCallbackConstructor):
  17765. * API/JSCallbackConstructor.h:
  17766. (JSC::JSCallbackConstructor::createStructure):
  17767. * API/JSCallbackFunction.h:
  17768. (JSC::JSCallbackFunction::createStructure):
  17769. * API/JSCallbackObject.h:
  17770. (JSC::JSCallbackObject::createStructure):
  17771. * API/JSCallbackObjectFunctions.h:
  17772. (JSC::::JSCallbackObject):
  17773. * API/JSValueRef.cpp:
  17774. (JSValueIsInstanceOfConstructor):
  17775. * GNUmakefile.am:
  17776. * JavaScriptCore.exp:
  17777. * JavaScriptCore.pri:
  17778. * JavaScriptCore.scons:
  17779. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  17780. * JavaScriptCore.xcodeproj/project.pbxproj:
  17781. * JavaScriptCoreSources.bkl:
  17782. * VM/CTI.cpp:
  17783. (JSC::CTI::compileBinaryArithOp):
  17784. (JSC::CTI::privateCompileMainPass):
  17785. (JSC::CTI::privateCompileGetByIdSelf):
  17786. (JSC::CTI::privateCompileGetByIdProto):
  17787. (JSC::CTI::privateCompileGetByIdChain):
  17788. (JSC::CTI::privateCompilePutByIdReplace):
  17789. (JSC::transitionWillNeedStorageRealloc):
  17790. (JSC::CTI::privateCompilePutByIdTransition):
  17791. (JSC::CTI::patchGetByIdSelf):
  17792. (JSC::CTI::patchPutByIdReplace):
  17793. * VM/CTI.h:
  17794. (JSC::CTI::compileGetByIdSelf):
  17795. (JSC::CTI::compileGetByIdProto):
  17796. (JSC::CTI::compileGetByIdChain):
  17797. (JSC::CTI::compilePutByIdReplace):
  17798. (JSC::CTI::compilePutByIdTransition):
  17799. * VM/CodeBlock.cpp:
  17800. (JSC::CodeBlock::printStructure):
  17801. (JSC::CodeBlock::printStructures):
  17802. (JSC::CodeBlock::dump):
  17803. (JSC::CodeBlock::~CodeBlock):
  17804. (JSC::CodeBlock::derefStructures):
  17805. (JSC::CodeBlock::refStructures):
  17806. * VM/CodeBlock.h:
  17807. * VM/Instruction.h:
  17808. (JSC::Instruction::Instruction):
  17809. (JSC::Instruction::):
  17810. * VM/Machine.cpp:
  17811. (JSC::jsTypeStringForValue):
  17812. (JSC::jsIsObjectType):
  17813. (JSC::BytecodeInterpreter::resolveGlobal):
  17814. (JSC::BytecodeInterpreter::BytecodeInterpreter):
  17815. (JSC::cachePrototypeChain):
  17816. (JSC::BytecodeInterpreter::tryCachePutByID):
  17817. (JSC::BytecodeInterpreter::uncachePutByID):
  17818. (JSC::BytecodeInterpreter::tryCacheGetByID):
  17819. (JSC::BytecodeInterpreter::uncacheGetByID):
  17820. (JSC::BytecodeInterpreter::privateExecute):
  17821. (JSC::BytecodeInterpreter::tryCTICachePutByID):
  17822. (JSC::BytecodeInterpreter::tryCTICacheGetByID):
  17823. (JSC::BytecodeInterpreter::cti_op_instanceof):
  17824. (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
  17825. (JSC::BytecodeInterpreter::cti_op_resolve_global):
  17826. (JSC::BytecodeInterpreter::cti_op_is_undefined):
  17827. * runtime/Arguments.h:
  17828. (JSC::Arguments::createStructure):
  17829. * runtime/ArrayConstructor.cpp:
  17830. (JSC::ArrayConstructor::ArrayConstructor):
  17831. * runtime/ArrayConstructor.h:
  17832. * runtime/ArrayPrototype.cpp:
  17833. (JSC::ArrayPrototype::ArrayPrototype):
  17834. * runtime/ArrayPrototype.h:
  17835. * runtime/BatchedTransitionOptimizer.h:
  17836. (JSC::BatchedTransitionOptimizer::BatchedTransitionOptimizer):
  17837. (JSC::BatchedTransitionOptimizer::~BatchedTransitionOptimizer):
  17838. * runtime/BooleanConstructor.cpp:
  17839. (JSC::BooleanConstructor::BooleanConstructor):
  17840. * runtime/BooleanConstructor.h:
  17841. * runtime/BooleanObject.cpp:
  17842. (JSC::BooleanObject::BooleanObject):
  17843. * runtime/BooleanObject.h:
  17844. * runtime/BooleanPrototype.cpp:
  17845. (JSC::BooleanPrototype::BooleanPrototype):
  17846. * runtime/BooleanPrototype.h:
  17847. * runtime/DateConstructor.cpp:
  17848. (JSC::DateConstructor::DateConstructor):
  17849. * runtime/DateConstructor.h:
  17850. * runtime/DateInstance.cpp:
  17851. (JSC::DateInstance::DateInstance):
  17852. * runtime/DateInstance.h:
  17853. * runtime/DatePrototype.cpp:
  17854. (JSC::DatePrototype::DatePrototype):
  17855. * runtime/DatePrototype.h:
  17856. (JSC::DatePrototype::createStructure):
  17857. * runtime/ErrorConstructor.cpp:
  17858. (JSC::ErrorConstructor::ErrorConstructor):
  17859. * runtime/ErrorConstructor.h:
  17860. * runtime/ErrorInstance.cpp:
  17861. (JSC::ErrorInstance::ErrorInstance):
  17862. * runtime/ErrorInstance.h:
  17863. * runtime/ErrorPrototype.cpp:
  17864. (JSC::ErrorPrototype::ErrorPrototype):
  17865. * runtime/ErrorPrototype.h:
  17866. * runtime/FunctionConstructor.cpp:
  17867. (JSC::FunctionConstructor::FunctionConstructor):
  17868. * runtime/FunctionConstructor.h:
  17869. * runtime/FunctionPrototype.cpp:
  17870. (JSC::FunctionPrototype::FunctionPrototype):
  17871. (JSC::FunctionPrototype::addFunctionProperties):
  17872. * runtime/FunctionPrototype.h:
  17873. (JSC::FunctionPrototype::createStructure):
  17874. * runtime/GlobalEvalFunction.cpp:
  17875. (JSC::GlobalEvalFunction::GlobalEvalFunction):
  17876. * runtime/GlobalEvalFunction.h:
  17877. * runtime/Identifier.h:
  17878. * runtime/InternalFunction.cpp:
  17879. (JSC::InternalFunction::InternalFunction):
  17880. * runtime/InternalFunction.h:
  17881. (JSC::InternalFunction::createStructure):
  17882. (JSC::InternalFunction::InternalFunction):
  17883. * runtime/JSActivation.cpp:
  17884. (JSC::JSActivation::JSActivation):
  17885. * runtime/JSActivation.h:
  17886. (JSC::JSActivation::createStructure):
  17887. * runtime/JSArray.cpp:
  17888. (JSC::JSArray::JSArray):
  17889. * runtime/JSArray.h:
  17890. (JSC::JSArray::createStructure):
  17891. * runtime/JSCell.h:
  17892. (JSC::JSCell::JSCell):
  17893. (JSC::JSCell::isObject):
  17894. (JSC::JSCell::isString):
  17895. (JSC::JSCell::structure):
  17896. (JSC::JSValue::needsThisConversion):
  17897. * runtime/JSFunction.cpp:
  17898. (JSC::JSFunction::construct):
  17899. * runtime/JSFunction.h:
  17900. (JSC::JSFunction::JSFunction):
  17901. (JSC::JSFunction::createStructure):
  17902. * runtime/JSGlobalData.cpp:
  17903. (JSC::JSGlobalData::JSGlobalData):
  17904. (JSC::JSGlobalData::createLeaked):
  17905. * runtime/JSGlobalData.h:
  17906. * runtime/JSGlobalObject.cpp:
  17907. (JSC::markIfNeeded):
  17908. (JSC::JSGlobalObject::reset):
  17909. * runtime/JSGlobalObject.h:
  17910. (JSC::JSGlobalObject::JSGlobalObject):
  17911. (JSC::JSGlobalObject::argumentsStructure):
  17912. (JSC::JSGlobalObject::arrayStructure):
  17913. (JSC::JSGlobalObject::booleanObjectStructure):
  17914. (JSC::JSGlobalObject::callbackConstructorStructure):
  17915. (JSC::JSGlobalObject::callbackFunctionStructure):
  17916. (JSC::JSGlobalObject::callbackObjectStructure):
  17917. (JSC::JSGlobalObject::dateStructure):
  17918. (JSC::JSGlobalObject::emptyObjectStructure):
  17919. (JSC::JSGlobalObject::errorStructure):
  17920. (JSC::JSGlobalObject::functionStructure):
  17921. (JSC::JSGlobalObject::numberObjectStructure):
  17922. (JSC::JSGlobalObject::prototypeFunctionStructure):
  17923. (JSC::JSGlobalObject::regExpMatchesArrayStructure):
  17924. (JSC::JSGlobalObject::regExpStructure):
  17925. (JSC::JSGlobalObject::stringObjectStructure):
  17926. (JSC::JSGlobalObject::createStructure):
  17927. (JSC::Structure::prototypeForLookup):
  17928. * runtime/JSNotAnObject.h:
  17929. (JSC::JSNotAnObject::createStructure):
  17930. * runtime/JSNumberCell.h:
  17931. (JSC::JSNumberCell::createStructure):
  17932. (JSC::JSNumberCell::JSNumberCell):
  17933. * runtime/JSObject.cpp:
  17934. (JSC::JSObject::mark):
  17935. (JSC::JSObject::put):
  17936. (JSC::JSObject::deleteProperty):
  17937. (JSC::JSObject::defineGetter):
  17938. (JSC::JSObject::defineSetter):
  17939. (JSC::JSObject::getPropertyAttributes):
  17940. (JSC::JSObject::getPropertyNames):
  17941. (JSC::JSObject::removeDirect):
  17942. (JSC::JSObject::createInheritorID):
  17943. * runtime/JSObject.h:
  17944. (JSC::JSObject::getDirect):
  17945. (JSC::JSObject::getDirectLocation):
  17946. (JSC::JSObject::hasCustomProperties):
  17947. (JSC::JSObject::hasGetterSetterProperties):
  17948. (JSC::JSObject::createStructure):
  17949. (JSC::JSObject::JSObject):
  17950. (JSC::JSObject::~JSObject):
  17951. (JSC::JSObject::prototype):
  17952. (JSC::JSObject::setPrototype):
  17953. (JSC::JSObject::setStructure):
  17954. (JSC::JSObject::inheritorID):
  17955. (JSC::JSObject::inlineGetOwnPropertySlot):
  17956. (JSC::JSObject::getOwnPropertySlotForWrite):
  17957. (JSC::JSCell::fastGetOwnPropertySlot):
  17958. (JSC::JSObject::putDirect):
  17959. (JSC::JSObject::putDirectWithoutTransition):
  17960. (JSC::JSObject::transitionTo):
  17961. * runtime/JSPropertyNameIterator.h:
  17962. (JSC::JSPropertyNameIterator::next):
  17963. * runtime/JSStaticScopeObject.h:
  17964. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  17965. (JSC::JSStaticScopeObject::createStructure):
  17966. * runtime/JSString.h:
  17967. (JSC::JSString::JSString):
  17968. (JSC::JSString::createStructure):
  17969. * runtime/JSVariableObject.h:
  17970. (JSC::JSVariableObject::JSVariableObject):
  17971. * runtime/JSWrapperObject.h:
  17972. (JSC::JSWrapperObject::JSWrapperObject):
  17973. * runtime/MathObject.cpp:
  17974. (JSC::MathObject::MathObject):
  17975. * runtime/MathObject.h:
  17976. (JSC::MathObject::createStructure):
  17977. * runtime/NativeErrorConstructor.cpp:
  17978. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  17979. * runtime/NativeErrorConstructor.h:
  17980. * runtime/NativeErrorPrototype.cpp:
  17981. (JSC::NativeErrorPrototype::NativeErrorPrototype):
  17982. * runtime/NativeErrorPrototype.h:
  17983. * runtime/NumberConstructor.cpp:
  17984. (JSC::NumberConstructor::NumberConstructor):
  17985. * runtime/NumberConstructor.h:
  17986. (JSC::NumberConstructor::createStructure):
  17987. * runtime/NumberObject.cpp:
  17988. (JSC::NumberObject::NumberObject):
  17989. * runtime/NumberObject.h:
  17990. * runtime/NumberPrototype.cpp:
  17991. (JSC::NumberPrototype::NumberPrototype):
  17992. * runtime/NumberPrototype.h:
  17993. * runtime/ObjectConstructor.cpp:
  17994. (JSC::ObjectConstructor::ObjectConstructor):
  17995. * runtime/ObjectConstructor.h:
  17996. * runtime/ObjectPrototype.cpp:
  17997. (JSC::ObjectPrototype::ObjectPrototype):
  17998. * runtime/ObjectPrototype.h:
  17999. * runtime/Operations.h:
  18000. (JSC::equalSlowCaseInline):
  18001. * runtime/PropertyNameArray.h:
  18002. (JSC::PropertyNameArrayData::setCachedStructure):
  18003. (JSC::PropertyNameArrayData::cachedStructure):
  18004. (JSC::PropertyNameArrayData::setCachedPrototypeChain):
  18005. (JSC::PropertyNameArrayData::cachedPrototypeChain):
  18006. (JSC::PropertyNameArrayData::PropertyNameArrayData):
  18007. * runtime/PrototypeFunction.cpp:
  18008. (JSC::PrototypeFunction::PrototypeFunction):
  18009. * runtime/PrototypeFunction.h:
  18010. * runtime/RegExpConstructor.cpp:
  18011. (JSC::RegExpConstructor::RegExpConstructor):
  18012. * runtime/RegExpConstructor.h:
  18013. (JSC::RegExpConstructor::createStructure):
  18014. * runtime/RegExpObject.cpp:
  18015. (JSC::RegExpObject::RegExpObject):
  18016. * runtime/RegExpObject.h:
  18017. (JSC::RegExpObject::createStructure):
  18018. * runtime/RegExpPrototype.cpp:
  18019. (JSC::RegExpPrototype::RegExpPrototype):
  18020. * runtime/RegExpPrototype.h:
  18021. * runtime/StringConstructor.cpp:
  18022. (JSC::StringConstructor::StringConstructor):
  18023. * runtime/StringConstructor.h:
  18024. * runtime/StringObject.cpp:
  18025. (JSC::StringObject::StringObject):
  18026. * runtime/StringObject.h:
  18027. (JSC::StringObject::createStructure):
  18028. * runtime/StringObjectThatMasqueradesAsUndefined.h:
  18029. (JSC::StringObjectThatMasqueradesAsUndefined::create):
  18030. (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
  18031. (JSC::StringObjectThatMasqueradesAsUndefined::createStructure):
  18032. * runtime/StringPrototype.cpp:
  18033. (JSC::StringPrototype::StringPrototype):
  18034. * runtime/StringPrototype.h:
  18035. * runtime/Structure.cpp: Copied from JavaScriptCore/runtime/StructureID.cpp.
  18036. (JSC::Structure::dumpStatistics):
  18037. (JSC::Structure::Structure):
  18038. (JSC::Structure::~Structure):
  18039. (JSC::Structure::startIgnoringLeaks):
  18040. (JSC::Structure::stopIgnoringLeaks):
  18041. (JSC::Structure::materializePropertyMap):
  18042. (JSC::Structure::getEnumerablePropertyNames):
  18043. (JSC::Structure::clearEnumerationCache):
  18044. (JSC::Structure::growPropertyStorageCapacity):
  18045. (JSC::Structure::addPropertyTransitionToExistingStructure):
  18046. (JSC::Structure::addPropertyTransition):
  18047. (JSC::Structure::removePropertyTransition):
  18048. (JSC::Structure::changePrototypeTransition):
  18049. (JSC::Structure::getterSetterTransition):
  18050. (JSC::Structure::toDictionaryTransition):
  18051. (JSC::Structure::fromDictionaryTransition):
  18052. (JSC::Structure::addPropertyWithoutTransition):
  18053. (JSC::Structure::removePropertyWithoutTransition):
  18054. (JSC::Structure::createCachedPrototypeChain):
  18055. (JSC::Structure::checkConsistency):
  18056. (JSC::Structure::copyPropertyTable):
  18057. (JSC::Structure::get):
  18058. (JSC::Structure::put):
  18059. (JSC::Structure::remove):
  18060. (JSC::Structure::insertIntoPropertyMapHashTable):
  18061. (JSC::Structure::createPropertyMapHashTable):
  18062. (JSC::Structure::expandPropertyMapHashTable):
  18063. (JSC::Structure::rehashPropertyMapHashTable):
  18064. (JSC::Structure::getEnumerablePropertyNamesInternal):
  18065. * runtime/Structure.h: Copied from JavaScriptCore/runtime/StructureID.h.
  18066. (JSC::Structure::create):
  18067. (JSC::Structure::previousID):
  18068. (JSC::Structure::setCachedPrototypeChain):
  18069. (JSC::Structure::cachedPrototypeChain):
  18070. (JSC::Structure::):
  18071. (JSC::Structure::get):
  18072. * runtime/StructureChain.cpp: Copied from JavaScriptCore/runtime/StructureIDChain.cpp.
  18073. (JSC::StructureChain::StructureChain):
  18074. (JSC::structureChainsAreEqual):
  18075. * runtime/StructureChain.h: Copied from JavaScriptCore/runtime/StructureIDChain.h.
  18076. (JSC::StructureChain::create):
  18077. (JSC::StructureChain::head):
  18078. * runtime/StructureID.cpp: Removed.
  18079. * runtime/StructureID.h: Removed.
  18080. * runtime/StructureIDChain.cpp: Removed.
  18081. * runtime/StructureIDChain.h: Removed.
  18082. * runtime/StructureIDTransitionTable.h: Removed.
  18083. * runtime/StructureTransitionTable.h: Copied from JavaScriptCore/runtime/StructureIDTransitionTable.h.
  18084. 2008-11-15 Darin Adler <darin@apple.com>
  18085. - fix non-WREC build
  18086. * runtime/RegExp.cpp: Put "using namespace WREC" inside #if ENABLE(WREC).
  18087. 2008-11-15 Kevin Ollivier <kevino@theolliviers.com>
  18088. Reviewed by Timothy Hatcher.
  18089. As ThreadingNone doesn't implement threads, isMainThread should return true,
  18090. not false.
  18091. https://bugs.webkit.org/show_bug.cgi?id=22285
  18092. * wtf/ThreadingNone.cpp:
  18093. (WTF::isMainThread):
  18094. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18095. Reviewed by Sam Weinig.
  18096. Moved all WREC-related code into WREC.cpp and put it in a WREC namespace.
  18097. Removed the WREC prefix from class names.
  18098. * VM/CTI.cpp:
  18099. * VM/CTI.h:
  18100. * VM/Machine.h:
  18101. (JSC::BytecodeInterpreter::assemblerBuffer):
  18102. * masm/X86Assembler.h:
  18103. * runtime/RegExp.cpp:
  18104. (JSC::RegExp::RegExp):
  18105. * wrec/CharacterClassConstructor.cpp:
  18106. * wrec/CharacterClassConstructor.h:
  18107. * wrec/WREC.cpp:
  18108. (WREC::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
  18109. (WREC::GeneratePatternCharacterFunctor::generateAtom):
  18110. (WREC::GeneratePatternCharacterFunctor::backtrack):
  18111. (WREC::GenerateCharacterClassFunctor::generateAtom):
  18112. (WREC::GenerateCharacterClassFunctor::backtrack):
  18113. (WREC::GenerateBackreferenceFunctor::generateAtom):
  18114. (WREC::GenerateBackreferenceFunctor::backtrack):
  18115. (WREC::GenerateParenthesesNonGreedyFunctor::generateAtom):
  18116. (WREC::GenerateParenthesesNonGreedyFunctor::backtrack):
  18117. (WREC::Generator::generateBacktrack1):
  18118. (WREC::Generator::generateBacktrackBackreference):
  18119. (WREC::Generator::generateBackreferenceQuantifier):
  18120. (WREC::Generator::generateNonGreedyQuantifier):
  18121. (WREC::Generator::generateGreedyQuantifier):
  18122. (WREC::Generator::generatePatternCharacter):
  18123. (WREC::Generator::generateCharacterClassInvertedRange):
  18124. (WREC::Generator::generateCharacterClassInverted):
  18125. (WREC::Generator::generateCharacterClass):
  18126. (WREC::Generator::generateParentheses):
  18127. (WREC::Generator::generateParenthesesNonGreedy):
  18128. (WREC::Generator::generateParenthesesResetTrampoline):
  18129. (WREC::Generator::generateAssertionBOL):
  18130. (WREC::Generator::generateAssertionEOL):
  18131. (WREC::Generator::generateAssertionWordBoundary):
  18132. (WREC::Generator::generateBackreference):
  18133. (WREC::Generator::generateDisjunction):
  18134. (WREC::Generator::terminateDisjunction):
  18135. (WREC::Parser::parseGreedyQuantifier):
  18136. (WREC::Parser::parseQuantifier):
  18137. (WREC::Parser::parsePatternCharacterQualifier):
  18138. (WREC::Parser::parseCharacterClassQuantifier):
  18139. (WREC::Parser::parseBackreferenceQuantifier):
  18140. (WREC::Parser::parseParentheses):
  18141. (WREC::Parser::parseCharacterClass):
  18142. (WREC::Parser::parseOctalEscape):
  18143. (WREC::Parser::parseEscape):
  18144. (WREC::Parser::parseTerm):
  18145. (WREC::Parser::parseDisjunction):
  18146. (WREC::compileRegExp):
  18147. * wrec/WREC.h:
  18148. (WREC::Generator::Generator):
  18149. (WREC::Parser::Parser):
  18150. (WREC::Parser::parseAlternative):
  18151. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18152. Reviewed by Sam Weinig.
  18153. Changed another case of "m_jit" to "m_assembler".
  18154. * VM/CTI.cpp:
  18155. * wrec/WREC.cpp:
  18156. * wrec/WREC.h:
  18157. (JSC::WRECGenerator::WRECGenerator):
  18158. (JSC::WRECParser::WRECParser):
  18159. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18160. Reviewed by Sam Weinig.
  18161. Renamed "jit" to "assembler" and, for brevity, replaced *jit.* with __
  18162. using a macro.
  18163. * VM/CTI.cpp:
  18164. (JSC::CTI::emitGetVirtualRegister):
  18165. (JSC::CTI::emitPutCTIArgFromVirtualRegister):
  18166. (JSC::CTI::emitPutCTIArg):
  18167. (JSC::CTI::emitGetCTIArg):
  18168. (JSC::CTI::emitPutCTIArgConstant):
  18169. (JSC::CTI::emitPutCTIParam):
  18170. (JSC::CTI::emitGetCTIParam):
  18171. (JSC::CTI::emitPutToCallFrameHeader):
  18172. (JSC::CTI::emitGetFromCallFrameHeader):
  18173. (JSC::CTI::emitPutVirtualRegister):
  18174. (JSC::CTI::emitInitRegister):
  18175. (JSC::CTI::emitAllocateNumber):
  18176. (JSC::CTI::emitNakedCall):
  18177. (JSC::CTI::emitNakedFastCall):
  18178. (JSC::CTI::emitCTICall):
  18179. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  18180. (JSC::CTI::linkSlowCaseIfNotJSCell):
  18181. (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
  18182. (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
  18183. (JSC::CTI::emitFastArithDeTagImmediate):
  18184. (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
  18185. (JSC::CTI::emitFastArithReTagImmediate):
  18186. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  18187. (JSC::CTI::emitFastArithImmToInt):
  18188. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  18189. (JSC::CTI::emitFastArithIntToImmNoCheck):
  18190. (JSC::CTI::emitArithIntToImmWithJump):
  18191. (JSC::CTI::emitTagAsBoolImmediate):
  18192. (JSC::CTI::CTI):
  18193. (JSC::CTI::compileOpCallInitializeCallFrame):
  18194. (JSC::CTI::compileOpCall):
  18195. (JSC::CTI::compileOpStrictEq):
  18196. (JSC::CTI::emitSlowScriptCheck):
  18197. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  18198. (JSC::CTI::compileBinaryArithOp):
  18199. (JSC::CTI::compileBinaryArithOpSlowCase):
  18200. (JSC::CTI::privateCompileMainPass):
  18201. (JSC::CTI::privateCompileLinkPass):
  18202. (JSC::CTI::privateCompileSlowCases):
  18203. (JSC::CTI::privateCompile):
  18204. (JSC::CTI::privateCompileGetByIdSelf):
  18205. (JSC::CTI::privateCompileGetByIdProto):
  18206. (JSC::CTI::privateCompileGetByIdChain):
  18207. (JSC::CTI::privateCompilePutByIdReplace):
  18208. (JSC::CTI::privateCompilePutByIdTransition):
  18209. (JSC::CTI::privateCompileCTIMachineTrampolines):
  18210. (JSC::CTI::privateCompilePatchGetArrayLength):
  18211. (JSC::CTI::emitGetVariableObjectRegister):
  18212. (JSC::CTI::emitPutVariableObjectRegister):
  18213. (JSC::CTI::compileRegExp):
  18214. * VM/CTI.h:
  18215. * wrec/WREC.cpp:
  18216. (JSC::WRECGenerator::generateBacktrack1):
  18217. (JSC::WRECGenerator::generateBacktrackBackreference):
  18218. (JSC::WRECGenerator::generateBackreferenceQuantifier):
  18219. (JSC::WRECGenerator::generateNonGreedyQuantifier):
  18220. (JSC::WRECGenerator::generateGreedyQuantifier):
  18221. (JSC::WRECGenerator::generatePatternCharacter):
  18222. (JSC::WRECGenerator::generateCharacterClassInvertedRange):
  18223. (JSC::WRECGenerator::generateCharacterClassInverted):
  18224. (JSC::WRECGenerator::generateCharacterClass):
  18225. (JSC::WRECGenerator::generateParentheses):
  18226. (JSC::WRECGenerator::generateParenthesesNonGreedy):
  18227. (JSC::WRECGenerator::generateParenthesesResetTrampoline):
  18228. (JSC::WRECGenerator::generateAssertionBOL):
  18229. (JSC::WRECGenerator::generateAssertionEOL):
  18230. (JSC::WRECGenerator::generateAssertionWordBoundary):
  18231. (JSC::WRECGenerator::generateBackreference):
  18232. (JSC::WRECGenerator::generateDisjunction):
  18233. (JSC::WRECGenerator::terminateDisjunction):
  18234. 2008-11-15 Sam Weinig <sam@webkit.org>
  18235. Reviewed by Geoffrey Garen.
  18236. Remove dead method declaration.
  18237. * bytecompiler/CodeGenerator.h:
  18238. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18239. Reviewed by Sam Weinig.
  18240. Renamed LabelID to Label, Label::isForwardLabel to Label::isForward.
  18241. * VM/LabelID.h:
  18242. (JSC::Label::Label):
  18243. (JSC::Label::isForward):
  18244. * bytecompiler/CodeGenerator.cpp:
  18245. (JSC::BytecodeGenerator::newLabel):
  18246. (JSC::BytecodeGenerator::emitLabel):
  18247. (JSC::BytecodeGenerator::emitJump):
  18248. (JSC::BytecodeGenerator::emitJumpIfTrue):
  18249. (JSC::BytecodeGenerator::emitJumpIfFalse):
  18250. (JSC::BytecodeGenerator::pushFinallyContext):
  18251. (JSC::BytecodeGenerator::emitComplexJumpScopes):
  18252. (JSC::BytecodeGenerator::emitJumpScopes):
  18253. (JSC::BytecodeGenerator::emitNextPropertyName):
  18254. (JSC::BytecodeGenerator::emitCatch):
  18255. (JSC::BytecodeGenerator::emitJumpSubroutine):
  18256. (JSC::prepareJumpTableForImmediateSwitch):
  18257. (JSC::prepareJumpTableForCharacterSwitch):
  18258. (JSC::prepareJumpTableForStringSwitch):
  18259. (JSC::BytecodeGenerator::endSwitch):
  18260. * bytecompiler/CodeGenerator.h:
  18261. * bytecompiler/LabelScope.h:
  18262. (JSC::LabelScope::LabelScope):
  18263. (JSC::LabelScope::breakTarget):
  18264. (JSC::LabelScope::continueTarget):
  18265. * parser/Nodes.cpp:
  18266. (JSC::LogicalOpNode::emitBytecode):
  18267. (JSC::ConditionalNode::emitBytecode):
  18268. (JSC::IfNode::emitBytecode):
  18269. (JSC::IfElseNode::emitBytecode):
  18270. (JSC::DoWhileNode::emitBytecode):
  18271. (JSC::WhileNode::emitBytecode):
  18272. (JSC::ForNode::emitBytecode):
  18273. (JSC::ForInNode::emitBytecode):
  18274. (JSC::ReturnNode::emitBytecode):
  18275. (JSC::CaseBlockNode::emitBytecodeForBlock):
  18276. (JSC::TryNode::emitBytecode):
  18277. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18278. Reviewed by Sam Weinig.
  18279. Renamed JITCodeBuffer to AssemblerBuffer and renamed its data members
  18280. to be more like the rest of our buffer classes, with a size and a
  18281. capacity.
  18282. Added an assert in the unchecked put case to match the test in the checked
  18283. put case.
  18284. Changed a C-style cast to a C++-style cast.
  18285. Renamed MAX_INSTRUCTION_SIZE to maxInstructionSize.
  18286. * VM/CTI.cpp:
  18287. (JSC::CTI::CTI):
  18288. (JSC::CTI::compileRegExp):
  18289. * VM/Machine.cpp:
  18290. (JSC::BytecodeInterpreter::BytecodeInterpreter):
  18291. * VM/Machine.h:
  18292. (JSC::BytecodeInterpreter::assemblerBuffer):
  18293. * masm/X86Assembler.h:
  18294. (JSC::AssemblerBuffer::AssemblerBuffer):
  18295. (JSC::AssemblerBuffer::~AssemblerBuffer):
  18296. (JSC::AssemblerBuffer::ensureSpace):
  18297. (JSC::AssemblerBuffer::isAligned):
  18298. (JSC::AssemblerBuffer::putByteUnchecked):
  18299. (JSC::AssemblerBuffer::putByte):
  18300. (JSC::AssemblerBuffer::putShortUnchecked):
  18301. (JSC::AssemblerBuffer::putShort):
  18302. (JSC::AssemblerBuffer::putIntUnchecked):
  18303. (JSC::AssemblerBuffer::putInt):
  18304. (JSC::AssemblerBuffer::data):
  18305. (JSC::AssemblerBuffer::size):
  18306. (JSC::AssemblerBuffer::reset):
  18307. (JSC::AssemblerBuffer::copy):
  18308. (JSC::AssemblerBuffer::grow):
  18309. (JSC::X86Assembler::):
  18310. (JSC::X86Assembler::X86Assembler):
  18311. (JSC::X86Assembler::testl_i32r):
  18312. (JSC::X86Assembler::movl_mr):
  18313. (JSC::X86Assembler::movl_rm):
  18314. (JSC::X86Assembler::movl_i32m):
  18315. (JSC::X86Assembler::emitCall):
  18316. (JSC::X86Assembler::label):
  18317. (JSC::X86Assembler::emitUnlinkedJmp):
  18318. (JSC::X86Assembler::emitUnlinkedJne):
  18319. (JSC::X86Assembler::emitUnlinkedJe):
  18320. (JSC::X86Assembler::emitUnlinkedJl):
  18321. (JSC::X86Assembler::emitUnlinkedJb):
  18322. (JSC::X86Assembler::emitUnlinkedJle):
  18323. (JSC::X86Assembler::emitUnlinkedJbe):
  18324. (JSC::X86Assembler::emitUnlinkedJge):
  18325. (JSC::X86Assembler::emitUnlinkedJg):
  18326. (JSC::X86Assembler::emitUnlinkedJa):
  18327. (JSC::X86Assembler::emitUnlinkedJae):
  18328. (JSC::X86Assembler::emitUnlinkedJo):
  18329. (JSC::X86Assembler::emitUnlinkedJp):
  18330. (JSC::X86Assembler::emitUnlinkedJs):
  18331. (JSC::X86Assembler::link):
  18332. (JSC::X86Assembler::emitModRm_rr):
  18333. (JSC::X86Assembler::emitModRm_rm):
  18334. (JSC::X86Assembler::emitModRm_opr):
  18335. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18336. Suggested by Maciej Stachowiak.
  18337. Reverted most "opcode" => "bytecode" renames. We use "bytecode" as a
  18338. mass noun to refer to a stream of instructions. Each instruction may be
  18339. an opcode or an operand.
  18340. * VM/CTI.cpp:
  18341. (JSC::CTI::emitCTICall):
  18342. (JSC::CTI::compileOpCall):
  18343. (JSC::CTI::compileBinaryArithOp):
  18344. (JSC::CTI::compileBinaryArithOpSlowCase):
  18345. (JSC::CTI::privateCompileMainPass):
  18346. (JSC::CTI::privateCompileSlowCases):
  18347. (JSC::CTI::privateCompile):
  18348. * VM/CTI.h:
  18349. * VM/CodeBlock.cpp:
  18350. (JSC::CodeBlock::printStructureIDs):
  18351. (JSC::CodeBlock::dump):
  18352. (JSC::CodeBlock::derefStructureIDs):
  18353. (JSC::CodeBlock::refStructureIDs):
  18354. * VM/CodeBlock.h:
  18355. * VM/ExceptionHelpers.cpp:
  18356. (JSC::createNotAnObjectError):
  18357. * VM/Instruction.h:
  18358. (JSC::Instruction::Instruction):
  18359. (JSC::Instruction::):
  18360. * VM/Machine.cpp:
  18361. (JSC::BytecodeInterpreter::isOpcode):
  18362. (JSC::BytecodeInterpreter::throwException):
  18363. (JSC::BytecodeInterpreter::tryCachePutByID):
  18364. (JSC::BytecodeInterpreter::uncachePutByID):
  18365. (JSC::BytecodeInterpreter::tryCacheGetByID):
  18366. (JSC::BytecodeInterpreter::uncacheGetByID):
  18367. (JSC::BytecodeInterpreter::privateExecute):
  18368. (JSC::BytecodeInterpreter::tryCTICachePutByID):
  18369. (JSC::BytecodeInterpreter::tryCTICacheGetByID):
  18370. * VM/Machine.h:
  18371. (JSC::BytecodeInterpreter::getOpcode):
  18372. (JSC::BytecodeInterpreter::getOpcodeID):
  18373. (JSC::BytecodeInterpreter::isCallBytecode):
  18374. * VM/Opcode.cpp:
  18375. (JSC::):
  18376. (JSC::OpcodeStats::OpcodeStats):
  18377. (JSC::compareOpcodeIndices):
  18378. (JSC::compareOpcodePairIndices):
  18379. (JSC::OpcodeStats::~OpcodeStats):
  18380. (JSC::OpcodeStats::recordInstruction):
  18381. (JSC::OpcodeStats::resetLastInstruction):
  18382. * VM/Opcode.h:
  18383. (JSC::):
  18384. (JSC::padOpcodeName):
  18385. * VM/SamplingTool.cpp:
  18386. (JSC::ScopeSampleRecord::sample):
  18387. (JSC::SamplingTool::run):
  18388. (JSC::compareOpcodeIndicesSampling):
  18389. (JSC::SamplingTool::dump):
  18390. * VM/SamplingTool.h:
  18391. (JSC::ScopeSampleRecord::ScopeSampleRecord):
  18392. (JSC::SamplingTool::SamplingTool):
  18393. * bytecompiler/CodeGenerator.cpp:
  18394. (JSC::BytecodeGenerator::BytecodeGenerator):
  18395. (JSC::BytecodeGenerator::emitLabel):
  18396. (JSC::BytecodeGenerator::emitOpcode):
  18397. (JSC::BytecodeGenerator::emitJump):
  18398. (JSC::BytecodeGenerator::emitJumpIfTrue):
  18399. (JSC::BytecodeGenerator::emitJumpIfFalse):
  18400. (JSC::BytecodeGenerator::emitMove):
  18401. (JSC::BytecodeGenerator::emitUnaryOp):
  18402. (JSC::BytecodeGenerator::emitPreInc):
  18403. (JSC::BytecodeGenerator::emitPreDec):
  18404. (JSC::BytecodeGenerator::emitPostInc):
  18405. (JSC::BytecodeGenerator::emitPostDec):
  18406. (JSC::BytecodeGenerator::emitBinaryOp):
  18407. (JSC::BytecodeGenerator::emitEqualityOp):
  18408. (JSC::BytecodeGenerator::emitUnexpectedLoad):
  18409. (JSC::BytecodeGenerator::emitInstanceOf):
  18410. (JSC::BytecodeGenerator::emitResolve):
  18411. (JSC::BytecodeGenerator::emitGetScopedVar):
  18412. (JSC::BytecodeGenerator::emitPutScopedVar):
  18413. (JSC::BytecodeGenerator::emitResolveBase):
  18414. (JSC::BytecodeGenerator::emitResolveWithBase):
  18415. (JSC::BytecodeGenerator::emitResolveFunction):
  18416. (JSC::BytecodeGenerator::emitGetById):
  18417. (JSC::BytecodeGenerator::emitPutById):
  18418. (JSC::BytecodeGenerator::emitPutGetter):
  18419. (JSC::BytecodeGenerator::emitPutSetter):
  18420. (JSC::BytecodeGenerator::emitDeleteById):
  18421. (JSC::BytecodeGenerator::emitGetByVal):
  18422. (JSC::BytecodeGenerator::emitPutByVal):
  18423. (JSC::BytecodeGenerator::emitDeleteByVal):
  18424. (JSC::BytecodeGenerator::emitPutByIndex):
  18425. (JSC::BytecodeGenerator::emitNewObject):
  18426. (JSC::BytecodeGenerator::emitNewArray):
  18427. (JSC::BytecodeGenerator::emitNewFunction):
  18428. (JSC::BytecodeGenerator::emitNewRegExp):
  18429. (JSC::BytecodeGenerator::emitNewFunctionExpression):
  18430. (JSC::BytecodeGenerator::emitCall):
  18431. (JSC::BytecodeGenerator::emitReturn):
  18432. (JSC::BytecodeGenerator::emitUnaryNoDstOp):
  18433. (JSC::BytecodeGenerator::emitConstruct):
  18434. (JSC::BytecodeGenerator::emitPopScope):
  18435. (JSC::BytecodeGenerator::emitDebugHook):
  18436. (JSC::BytecodeGenerator::emitComplexJumpScopes):
  18437. (JSC::BytecodeGenerator::emitJumpScopes):
  18438. (JSC::BytecodeGenerator::emitNextPropertyName):
  18439. (JSC::BytecodeGenerator::emitCatch):
  18440. (JSC::BytecodeGenerator::emitNewError):
  18441. (JSC::BytecodeGenerator::emitJumpSubroutine):
  18442. (JSC::BytecodeGenerator::emitSubroutineReturn):
  18443. (JSC::BytecodeGenerator::emitPushNewScope):
  18444. (JSC::BytecodeGenerator::beginSwitch):
  18445. * bytecompiler/CodeGenerator.h:
  18446. * jsc.cpp:
  18447. (runWithScripts):
  18448. * masm/X86Assembler.h:
  18449. (JSC::X86Assembler::):
  18450. (JSC::X86Assembler::emitModRm_opr):
  18451. (JSC::X86Assembler::emitModRm_opr_Unchecked):
  18452. (JSC::X86Assembler::emitModRm_opm):
  18453. (JSC::X86Assembler::emitModRm_opm_Unchecked):
  18454. (JSC::X86Assembler::emitModRm_opmsib):
  18455. * parser/Nodes.cpp:
  18456. (JSC::UnaryOpNode::emitBytecode):
  18457. (JSC::BinaryOpNode::emitBytecode):
  18458. (JSC::ReverseBinaryOpNode::emitBytecode):
  18459. (JSC::ThrowableBinaryOpNode::emitBytecode):
  18460. (JSC::emitReadModifyAssignment):
  18461. (JSC::ScopeNode::ScopeNode):
  18462. * parser/Nodes.h:
  18463. (JSC::UnaryPlusNode::):
  18464. (JSC::NegateNode::):
  18465. (JSC::BitwiseNotNode::):
  18466. (JSC::LogicalNotNode::):
  18467. (JSC::MultNode::):
  18468. (JSC::DivNode::):
  18469. (JSC::ModNode::):
  18470. (JSC::AddNode::):
  18471. (JSC::SubNode::):
  18472. (JSC::LeftShiftNode::):
  18473. (JSC::RightShiftNode::):
  18474. (JSC::UnsignedRightShiftNode::):
  18475. (JSC::LessNode::):
  18476. (JSC::GreaterNode::):
  18477. (JSC::LessEqNode::):
  18478. (JSC::GreaterEqNode::):
  18479. (JSC::InstanceOfNode::):
  18480. (JSC::InNode::):
  18481. (JSC::EqualNode::):
  18482. (JSC::NotEqualNode::):
  18483. (JSC::StrictEqualNode::):
  18484. (JSC::NotStrictEqualNode::):
  18485. (JSC::BitAndNode::):
  18486. (JSC::BitOrNode::):
  18487. (JSC::BitXOrNode::):
  18488. * runtime/StructureID.cpp:
  18489. (JSC::StructureID::fromDictionaryTransition):
  18490. * wtf/Platform.h:
  18491. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18492. Reviewed by Sam Weinig.
  18493. Renames:
  18494. CodeGenerator => BytecodeGenerator
  18495. emitCodeForBlock => emitBytecodeForBlock
  18496. generatedByteCode => generatedBytecode
  18497. generateCode => generateBytecode
  18498. * JavaScriptCore.exp:
  18499. * bytecompiler/CodeGenerator.cpp:
  18500. (JSC::BytecodeGenerator::setDumpsGeneratedCode):
  18501. (JSC::BytecodeGenerator::generate):
  18502. (JSC::BytecodeGenerator::addVar):
  18503. (JSC::BytecodeGenerator::addGlobalVar):
  18504. (JSC::BytecodeGenerator::allocateConstants):
  18505. (JSC::BytecodeGenerator::BytecodeGenerator):
  18506. (JSC::BytecodeGenerator::addParameter):
  18507. (JSC::BytecodeGenerator::registerFor):
  18508. (JSC::BytecodeGenerator::constRegisterFor):
  18509. (JSC::BytecodeGenerator::isLocal):
  18510. (JSC::BytecodeGenerator::isLocalConstant):
  18511. (JSC::BytecodeGenerator::newRegister):
  18512. (JSC::BytecodeGenerator::newTemporary):
  18513. (JSC::BytecodeGenerator::highestUsedRegister):
  18514. (JSC::BytecodeGenerator::newLabelScope):
  18515. (JSC::BytecodeGenerator::newLabel):
  18516. (JSC::BytecodeGenerator::emitLabel):
  18517. (JSC::BytecodeGenerator::emitBytecode):
  18518. (JSC::BytecodeGenerator::retrieveLastBinaryOp):
  18519. (JSC::BytecodeGenerator::retrieveLastUnaryOp):
  18520. (JSC::BytecodeGenerator::rewindBinaryOp):
  18521. (JSC::BytecodeGenerator::rewindUnaryOp):
  18522. (JSC::BytecodeGenerator::emitJump):
  18523. (JSC::BytecodeGenerator::emitJumpIfTrue):
  18524. (JSC::BytecodeGenerator::emitJumpIfFalse):
  18525. (JSC::BytecodeGenerator::addConstant):
  18526. (JSC::BytecodeGenerator::addUnexpectedConstant):
  18527. (JSC::BytecodeGenerator::addRegExp):
  18528. (JSC::BytecodeGenerator::emitMove):
  18529. (JSC::BytecodeGenerator::emitUnaryOp):
  18530. (JSC::BytecodeGenerator::emitPreInc):
  18531. (JSC::BytecodeGenerator::emitPreDec):
  18532. (JSC::BytecodeGenerator::emitPostInc):
  18533. (JSC::BytecodeGenerator::emitPostDec):
  18534. (JSC::BytecodeGenerator::emitBinaryOp):
  18535. (JSC::BytecodeGenerator::emitEqualityOp):
  18536. (JSC::BytecodeGenerator::emitLoad):
  18537. (JSC::BytecodeGenerator::emitUnexpectedLoad):
  18538. (JSC::BytecodeGenerator::findScopedProperty):
  18539. (JSC::BytecodeGenerator::emitInstanceOf):
  18540. (JSC::BytecodeGenerator::emitResolve):
  18541. (JSC::BytecodeGenerator::emitGetScopedVar):
  18542. (JSC::BytecodeGenerator::emitPutScopedVar):
  18543. (JSC::BytecodeGenerator::emitResolveBase):
  18544. (JSC::BytecodeGenerator::emitResolveWithBase):
  18545. (JSC::BytecodeGenerator::emitResolveFunction):
  18546. (JSC::BytecodeGenerator::emitGetById):
  18547. (JSC::BytecodeGenerator::emitPutById):
  18548. (JSC::BytecodeGenerator::emitPutGetter):
  18549. (JSC::BytecodeGenerator::emitPutSetter):
  18550. (JSC::BytecodeGenerator::emitDeleteById):
  18551. (JSC::BytecodeGenerator::emitGetByVal):
  18552. (JSC::BytecodeGenerator::emitPutByVal):
  18553. (JSC::BytecodeGenerator::emitDeleteByVal):
  18554. (JSC::BytecodeGenerator::emitPutByIndex):
  18555. (JSC::BytecodeGenerator::emitNewObject):
  18556. (JSC::BytecodeGenerator::emitNewArray):
  18557. (JSC::BytecodeGenerator::emitNewFunction):
  18558. (JSC::BytecodeGenerator::emitNewRegExp):
  18559. (JSC::BytecodeGenerator::emitNewFunctionExpression):
  18560. (JSC::BytecodeGenerator::emitCall):
  18561. (JSC::BytecodeGenerator::emitCallEval):
  18562. (JSC::BytecodeGenerator::emitReturn):
  18563. (JSC::BytecodeGenerator::emitUnaryNoDstOp):
  18564. (JSC::BytecodeGenerator::emitConstruct):
  18565. (JSC::BytecodeGenerator::emitPushScope):
  18566. (JSC::BytecodeGenerator::emitPopScope):
  18567. (JSC::BytecodeGenerator::emitDebugHook):
  18568. (JSC::BytecodeGenerator::pushFinallyContext):
  18569. (JSC::BytecodeGenerator::popFinallyContext):
  18570. (JSC::BytecodeGenerator::breakTarget):
  18571. (JSC::BytecodeGenerator::continueTarget):
  18572. (JSC::BytecodeGenerator::emitComplexJumpScopes):
  18573. (JSC::BytecodeGenerator::emitJumpScopes):
  18574. (JSC::BytecodeGenerator::emitNextPropertyName):
  18575. (JSC::BytecodeGenerator::emitCatch):
  18576. (JSC::BytecodeGenerator::emitNewError):
  18577. (JSC::BytecodeGenerator::emitJumpSubroutine):
  18578. (JSC::BytecodeGenerator::emitSubroutineReturn):
  18579. (JSC::BytecodeGenerator::emitPushNewScope):
  18580. (JSC::BytecodeGenerator::beginSwitch):
  18581. (JSC::BytecodeGenerator::endSwitch):
  18582. (JSC::BytecodeGenerator::emitThrowExpressionTooDeepException):
  18583. * bytecompiler/CodeGenerator.h:
  18584. * jsc.cpp:
  18585. (runWithScripts):
  18586. * parser/Nodes.cpp:
  18587. (JSC::ThrowableExpressionData::emitThrowError):
  18588. (JSC::NullNode::emitBytecode):
  18589. (JSC::BooleanNode::emitBytecode):
  18590. (JSC::NumberNode::emitBytecode):
  18591. (JSC::StringNode::emitBytecode):
  18592. (JSC::RegExpNode::emitBytecode):
  18593. (JSC::ThisNode::emitBytecode):
  18594. (JSC::ResolveNode::isPure):
  18595. (JSC::ResolveNode::emitBytecode):
  18596. (JSC::ArrayNode::emitBytecode):
  18597. (JSC::ObjectLiteralNode::emitBytecode):
  18598. (JSC::PropertyListNode::emitBytecode):
  18599. (JSC::BracketAccessorNode::emitBytecode):
  18600. (JSC::DotAccessorNode::emitBytecode):
  18601. (JSC::ArgumentListNode::emitBytecode):
  18602. (JSC::NewExprNode::emitBytecode):
  18603. (JSC::EvalFunctionCallNode::emitBytecode):
  18604. (JSC::FunctionCallValueNode::emitBytecode):
  18605. (JSC::FunctionCallResolveNode::emitBytecode):
  18606. (JSC::FunctionCallBracketNode::emitBytecode):
  18607. (JSC::FunctionCallDotNode::emitBytecode):
  18608. (JSC::emitPreIncOrDec):
  18609. (JSC::emitPostIncOrDec):
  18610. (JSC::PostfixResolveNode::emitBytecode):
  18611. (JSC::PostfixBracketNode::emitBytecode):
  18612. (JSC::PostfixDotNode::emitBytecode):
  18613. (JSC::PostfixErrorNode::emitBytecode):
  18614. (JSC::DeleteResolveNode::emitBytecode):
  18615. (JSC::DeleteBracketNode::emitBytecode):
  18616. (JSC::DeleteDotNode::emitBytecode):
  18617. (JSC::DeleteValueNode::emitBytecode):
  18618. (JSC::VoidNode::emitBytecode):
  18619. (JSC::TypeOfResolveNode::emitBytecode):
  18620. (JSC::TypeOfValueNode::emitBytecode):
  18621. (JSC::PrefixResolveNode::emitBytecode):
  18622. (JSC::PrefixBracketNode::emitBytecode):
  18623. (JSC::PrefixDotNode::emitBytecode):
  18624. (JSC::PrefixErrorNode::emitBytecode):
  18625. (JSC::UnaryOpNode::emitBytecode):
  18626. (JSC::BinaryOpNode::emitBytecode):
  18627. (JSC::EqualNode::emitBytecode):
  18628. (JSC::StrictEqualNode::emitBytecode):
  18629. (JSC::ReverseBinaryOpNode::emitBytecode):
  18630. (JSC::ThrowableBinaryOpNode::emitBytecode):
  18631. (JSC::InstanceOfNode::emitBytecode):
  18632. (JSC::LogicalOpNode::emitBytecode):
  18633. (JSC::ConditionalNode::emitBytecode):
  18634. (JSC::emitReadModifyAssignment):
  18635. (JSC::ReadModifyResolveNode::emitBytecode):
  18636. (JSC::AssignResolveNode::emitBytecode):
  18637. (JSC::AssignDotNode::emitBytecode):
  18638. (JSC::ReadModifyDotNode::emitBytecode):
  18639. (JSC::AssignErrorNode::emitBytecode):
  18640. (JSC::AssignBracketNode::emitBytecode):
  18641. (JSC::ReadModifyBracketNode::emitBytecode):
  18642. (JSC::CommaNode::emitBytecode):
  18643. (JSC::ConstDeclNode::emitCodeSingle):
  18644. (JSC::ConstDeclNode::emitBytecode):
  18645. (JSC::ConstStatementNode::emitBytecode):
  18646. (JSC::statementListEmitCode):
  18647. (JSC::BlockNode::emitBytecode):
  18648. (JSC::EmptyStatementNode::emitBytecode):
  18649. (JSC::DebuggerStatementNode::emitBytecode):
  18650. (JSC::ExprStatementNode::emitBytecode):
  18651. (JSC::VarStatementNode::emitBytecode):
  18652. (JSC::IfNode::emitBytecode):
  18653. (JSC::IfElseNode::emitBytecode):
  18654. (JSC::DoWhileNode::emitBytecode):
  18655. (JSC::WhileNode::emitBytecode):
  18656. (JSC::ForNode::emitBytecode):
  18657. (JSC::ForInNode::emitBytecode):
  18658. (JSC::ContinueNode::emitBytecode):
  18659. (JSC::BreakNode::emitBytecode):
  18660. (JSC::ReturnNode::emitBytecode):
  18661. (JSC::WithNode::emitBytecode):
  18662. (JSC::CaseBlockNode::emitBytecodeForBlock):
  18663. (JSC::SwitchNode::emitBytecode):
  18664. (JSC::LabelNode::emitBytecode):
  18665. (JSC::ThrowNode::emitBytecode):
  18666. (JSC::TryNode::emitBytecode):
  18667. (JSC::EvalNode::emitBytecode):
  18668. (JSC::EvalNode::generateBytecode):
  18669. (JSC::FunctionBodyNode::generateBytecode):
  18670. (JSC::FunctionBodyNode::emitBytecode):
  18671. (JSC::ProgramNode::emitBytecode):
  18672. (JSC::ProgramNode::generateBytecode):
  18673. (JSC::FuncDeclNode::emitBytecode):
  18674. (JSC::FuncExprNode::emitBytecode):
  18675. * parser/Nodes.h:
  18676. (JSC::ExpressionNode::):
  18677. (JSC::BooleanNode::):
  18678. (JSC::NumberNode::):
  18679. (JSC::StringNode::):
  18680. (JSC::ProgramNode::):
  18681. (JSC::EvalNode::):
  18682. (JSC::FunctionBodyNode::):
  18683. * runtime/Arguments.h:
  18684. (JSC::Arguments::getArgumentsData):
  18685. (JSC::JSActivation::copyRegisters):
  18686. * runtime/JSActivation.cpp:
  18687. (JSC::JSActivation::mark):
  18688. * runtime/JSActivation.h:
  18689. (JSC::JSActivation::JSActivationData::JSActivationData):
  18690. * runtime/JSFunction.cpp:
  18691. (JSC::JSFunction::~JSFunction):
  18692. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18693. Reviewed by Sam Weinig.
  18694. Renamed all forms of "byte code" "opcode" "op code" "code" "bitcode"
  18695. etc. to "bytecode".
  18696. * VM/CTI.cpp:
  18697. (JSC::CTI::printBytecodeOperandTypes):
  18698. (JSC::CTI::emitAllocateNumber):
  18699. (JSC::CTI::emitNakedCall):
  18700. (JSC::CTI::emitNakedFastCall):
  18701. (JSC::CTI::emitCTICall):
  18702. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  18703. (JSC::CTI::emitJumpSlowCaseIfNotImmNum):
  18704. (JSC::CTI::emitJumpSlowCaseIfNotImmNums):
  18705. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  18706. (JSC::CTI::compileOpCall):
  18707. (JSC::CTI::emitSlowScriptCheck):
  18708. (JSC::CTI::compileBinaryArithOp):
  18709. (JSC::CTI::compileBinaryArithOpSlowCase):
  18710. (JSC::CTI::privateCompileMainPass):
  18711. (JSC::CTI::privateCompileSlowCases):
  18712. (JSC::CTI::privateCompile):
  18713. * VM/CTI.h:
  18714. (JSC::CallRecord::CallRecord):
  18715. (JSC::SwitchRecord::SwitchRecord):
  18716. * VM/CodeBlock.cpp:
  18717. (JSC::CodeBlock::printStructureIDs):
  18718. (JSC::CodeBlock::dump):
  18719. (JSC::CodeBlock::~CodeBlock):
  18720. (JSC::CodeBlock::derefStructureIDs):
  18721. (JSC::CodeBlock::refStructureIDs):
  18722. * VM/CodeBlock.h:
  18723. (JSC::StructureStubInfo::StructureStubInfo):
  18724. * VM/ExceptionHelpers.cpp:
  18725. (JSC::createNotAnObjectError):
  18726. * VM/Instruction.h:
  18727. (JSC::Instruction::Instruction):
  18728. (JSC::Instruction::):
  18729. * VM/Machine.cpp:
  18730. (JSC::BytecodeInterpreter::isBytecode):
  18731. (JSC::BytecodeInterpreter::throwException):
  18732. (JSC::BytecodeInterpreter::execute):
  18733. (JSC::BytecodeInterpreter::tryCachePutByID):
  18734. (JSC::BytecodeInterpreter::uncachePutByID):
  18735. (JSC::BytecodeInterpreter::tryCacheGetByID):
  18736. (JSC::BytecodeInterpreter::uncacheGetByID):
  18737. (JSC::BytecodeInterpreter::privateExecute):
  18738. (JSC::BytecodeInterpreter::tryCTICachePutByID):
  18739. (JSC::BytecodeInterpreter::tryCTICacheGetByID):
  18740. (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
  18741. (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
  18742. (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
  18743. * VM/Machine.h:
  18744. (JSC::BytecodeInterpreter::getBytecode):
  18745. (JSC::BytecodeInterpreter::getBytecodeID):
  18746. (JSC::BytecodeInterpreter::isCallBytecode):
  18747. * VM/Opcode.cpp:
  18748. (JSC::):
  18749. (JSC::BytecodeStats::BytecodeStats):
  18750. (JSC::compareBytecodeIndices):
  18751. (JSC::compareBytecodePairIndices):
  18752. (JSC::BytecodeStats::~BytecodeStats):
  18753. (JSC::BytecodeStats::recordInstruction):
  18754. (JSC::BytecodeStats::resetLastInstruction):
  18755. * VM/Opcode.h:
  18756. (JSC::):
  18757. (JSC::padBytecodeName):
  18758. * VM/SamplingTool.cpp:
  18759. (JSC::ScopeSampleRecord::sample):
  18760. (JSC::SamplingTool::run):
  18761. (JSC::compareBytecodeIndicesSampling):
  18762. (JSC::SamplingTool::dump):
  18763. * VM/SamplingTool.h:
  18764. (JSC::ScopeSampleRecord::ScopeSampleRecord):
  18765. (JSC::SamplingTool::SamplingTool):
  18766. * bytecompiler/CodeGenerator.cpp:
  18767. (JSC::CodeGenerator::generate):
  18768. (JSC::CodeGenerator::CodeGenerator):
  18769. (JSC::CodeGenerator::emitLabel):
  18770. (JSC::CodeGenerator::emitBytecode):
  18771. (JSC::CodeGenerator::emitJump):
  18772. (JSC::CodeGenerator::emitJumpIfTrue):
  18773. (JSC::CodeGenerator::emitJumpIfFalse):
  18774. (JSC::CodeGenerator::emitMove):
  18775. (JSC::CodeGenerator::emitUnaryOp):
  18776. (JSC::CodeGenerator::emitPreInc):
  18777. (JSC::CodeGenerator::emitPreDec):
  18778. (JSC::CodeGenerator::emitPostInc):
  18779. (JSC::CodeGenerator::emitPostDec):
  18780. (JSC::CodeGenerator::emitBinaryOp):
  18781. (JSC::CodeGenerator::emitEqualityOp):
  18782. (JSC::CodeGenerator::emitUnexpectedLoad):
  18783. (JSC::CodeGenerator::emitInstanceOf):
  18784. (JSC::CodeGenerator::emitResolve):
  18785. (JSC::CodeGenerator::emitGetScopedVar):
  18786. (JSC::CodeGenerator::emitPutScopedVar):
  18787. (JSC::CodeGenerator::emitResolveBase):
  18788. (JSC::CodeGenerator::emitResolveWithBase):
  18789. (JSC::CodeGenerator::emitResolveFunction):
  18790. (JSC::CodeGenerator::emitGetById):
  18791. (JSC::CodeGenerator::emitPutById):
  18792. (JSC::CodeGenerator::emitPutGetter):
  18793. (JSC::CodeGenerator::emitPutSetter):
  18794. (JSC::CodeGenerator::emitDeleteById):
  18795. (JSC::CodeGenerator::emitGetByVal):
  18796. (JSC::CodeGenerator::emitPutByVal):
  18797. (JSC::CodeGenerator::emitDeleteByVal):
  18798. (JSC::CodeGenerator::emitPutByIndex):
  18799. (JSC::CodeGenerator::emitNewObject):
  18800. (JSC::CodeGenerator::emitNewArray):
  18801. (JSC::CodeGenerator::emitNewFunction):
  18802. (JSC::CodeGenerator::emitNewRegExp):
  18803. (JSC::CodeGenerator::emitNewFunctionExpression):
  18804. (JSC::CodeGenerator::emitCall):
  18805. (JSC::CodeGenerator::emitReturn):
  18806. (JSC::CodeGenerator::emitUnaryNoDstOp):
  18807. (JSC::CodeGenerator::emitConstruct):
  18808. (JSC::CodeGenerator::emitPopScope):
  18809. (JSC::CodeGenerator::emitDebugHook):
  18810. (JSC::CodeGenerator::emitComplexJumpScopes):
  18811. (JSC::CodeGenerator::emitJumpScopes):
  18812. (JSC::CodeGenerator::emitNextPropertyName):
  18813. (JSC::CodeGenerator::emitCatch):
  18814. (JSC::CodeGenerator::emitNewError):
  18815. (JSC::CodeGenerator::emitJumpSubroutine):
  18816. (JSC::CodeGenerator::emitSubroutineReturn):
  18817. (JSC::CodeGenerator::emitPushNewScope):
  18818. (JSC::CodeGenerator::beginSwitch):
  18819. (JSC::CodeGenerator::endSwitch):
  18820. * bytecompiler/CodeGenerator.h:
  18821. (JSC::CodeGenerator::emitNode):
  18822. * jsc.cpp:
  18823. (runWithScripts):
  18824. * masm/X86Assembler.h:
  18825. (JSC::X86Assembler::):
  18826. (JSC::X86Assembler::emitModRm_opr):
  18827. (JSC::X86Assembler::emitModRm_opr_Unchecked):
  18828. (JSC::X86Assembler::emitModRm_opm):
  18829. (JSC::X86Assembler::emitModRm_opm_Unchecked):
  18830. (JSC::X86Assembler::emitModRm_opmsib):
  18831. * parser/Nodes.cpp:
  18832. (JSC::NullNode::emitBytecode):
  18833. (JSC::BooleanNode::emitBytecode):
  18834. (JSC::NumberNode::emitBytecode):
  18835. (JSC::StringNode::emitBytecode):
  18836. (JSC::RegExpNode::emitBytecode):
  18837. (JSC::ThisNode::emitBytecode):
  18838. (JSC::ResolveNode::emitBytecode):
  18839. (JSC::ArrayNode::emitBytecode):
  18840. (JSC::ObjectLiteralNode::emitBytecode):
  18841. (JSC::PropertyListNode::emitBytecode):
  18842. (JSC::BracketAccessorNode::emitBytecode):
  18843. (JSC::DotAccessorNode::emitBytecode):
  18844. (JSC::ArgumentListNode::emitBytecode):
  18845. (JSC::NewExprNode::emitBytecode):
  18846. (JSC::EvalFunctionCallNode::emitBytecode):
  18847. (JSC::FunctionCallValueNode::emitBytecode):
  18848. (JSC::FunctionCallResolveNode::emitBytecode):
  18849. (JSC::FunctionCallBracketNode::emitBytecode):
  18850. (JSC::FunctionCallDotNode::emitBytecode):
  18851. (JSC::PostfixResolveNode::emitBytecode):
  18852. (JSC::PostfixBracketNode::emitBytecode):
  18853. (JSC::PostfixDotNode::emitBytecode):
  18854. (JSC::PostfixErrorNode::emitBytecode):
  18855. (JSC::DeleteResolveNode::emitBytecode):
  18856. (JSC::DeleteBracketNode::emitBytecode):
  18857. (JSC::DeleteDotNode::emitBytecode):
  18858. (JSC::DeleteValueNode::emitBytecode):
  18859. (JSC::VoidNode::emitBytecode):
  18860. (JSC::TypeOfResolveNode::emitBytecode):
  18861. (JSC::TypeOfValueNode::emitBytecode):
  18862. (JSC::PrefixResolveNode::emitBytecode):
  18863. (JSC::PrefixBracketNode::emitBytecode):
  18864. (JSC::PrefixDotNode::emitBytecode):
  18865. (JSC::PrefixErrorNode::emitBytecode):
  18866. (JSC::UnaryOpNode::emitBytecode):
  18867. (JSC::BinaryOpNode::emitBytecode):
  18868. (JSC::EqualNode::emitBytecode):
  18869. (JSC::StrictEqualNode::emitBytecode):
  18870. (JSC::ReverseBinaryOpNode::emitBytecode):
  18871. (JSC::ThrowableBinaryOpNode::emitBytecode):
  18872. (JSC::InstanceOfNode::emitBytecode):
  18873. (JSC::LogicalOpNode::emitBytecode):
  18874. (JSC::ConditionalNode::emitBytecode):
  18875. (JSC::emitReadModifyAssignment):
  18876. (JSC::ReadModifyResolveNode::emitBytecode):
  18877. (JSC::AssignResolveNode::emitBytecode):
  18878. (JSC::AssignDotNode::emitBytecode):
  18879. (JSC::ReadModifyDotNode::emitBytecode):
  18880. (JSC::AssignErrorNode::emitBytecode):
  18881. (JSC::AssignBracketNode::emitBytecode):
  18882. (JSC::ReadModifyBracketNode::emitBytecode):
  18883. (JSC::CommaNode::emitBytecode):
  18884. (JSC::ConstDeclNode::emitBytecode):
  18885. (JSC::ConstStatementNode::emitBytecode):
  18886. (JSC::BlockNode::emitBytecode):
  18887. (JSC::EmptyStatementNode::emitBytecode):
  18888. (JSC::DebuggerStatementNode::emitBytecode):
  18889. (JSC::ExprStatementNode::emitBytecode):
  18890. (JSC::VarStatementNode::emitBytecode):
  18891. (JSC::IfNode::emitBytecode):
  18892. (JSC::IfElseNode::emitBytecode):
  18893. (JSC::DoWhileNode::emitBytecode):
  18894. (JSC::WhileNode::emitBytecode):
  18895. (JSC::ForNode::emitBytecode):
  18896. (JSC::ForInNode::emitBytecode):
  18897. (JSC::ContinueNode::emitBytecode):
  18898. (JSC::BreakNode::emitBytecode):
  18899. (JSC::ReturnNode::emitBytecode):
  18900. (JSC::WithNode::emitBytecode):
  18901. (JSC::SwitchNode::emitBytecode):
  18902. (JSC::LabelNode::emitBytecode):
  18903. (JSC::ThrowNode::emitBytecode):
  18904. (JSC::TryNode::emitBytecode):
  18905. (JSC::ScopeNode::ScopeNode):
  18906. (JSC::EvalNode::emitBytecode):
  18907. (JSC::FunctionBodyNode::emitBytecode):
  18908. (JSC::ProgramNode::emitBytecode):
  18909. (JSC::FuncDeclNode::emitBytecode):
  18910. (JSC::FuncExprNode::emitBytecode):
  18911. * parser/Nodes.h:
  18912. (JSC::UnaryPlusNode::):
  18913. (JSC::NegateNode::):
  18914. (JSC::BitwiseNotNode::):
  18915. (JSC::LogicalNotNode::):
  18916. (JSC::MultNode::):
  18917. (JSC::DivNode::):
  18918. (JSC::ModNode::):
  18919. (JSC::AddNode::):
  18920. (JSC::SubNode::):
  18921. (JSC::LeftShiftNode::):
  18922. (JSC::RightShiftNode::):
  18923. (JSC::UnsignedRightShiftNode::):
  18924. (JSC::LessNode::):
  18925. (JSC::GreaterNode::):
  18926. (JSC::LessEqNode::):
  18927. (JSC::GreaterEqNode::):
  18928. (JSC::InstanceOfNode::):
  18929. (JSC::InNode::):
  18930. (JSC::EqualNode::):
  18931. (JSC::NotEqualNode::):
  18932. (JSC::StrictEqualNode::):
  18933. (JSC::NotStrictEqualNode::):
  18934. (JSC::BitAndNode::):
  18935. (JSC::BitOrNode::):
  18936. (JSC::BitXOrNode::):
  18937. (JSC::ProgramNode::):
  18938. (JSC::EvalNode::):
  18939. (JSC::FunctionBodyNode::):
  18940. * runtime/JSNotAnObject.h:
  18941. * runtime/StructureID.cpp:
  18942. (JSC::StructureID::fromDictionaryTransition):
  18943. * wtf/Platform.h:
  18944. 2008-11-15 Geoffrey Garen <ggaren@apple.com>
  18945. Reviewed by Sam Weinig.
  18946. Renamed Machine to BytecodeInterpreter.
  18947. Nixed the Interpreter class, and changed its two functions to stand-alone
  18948. functions.
  18949. * JavaScriptCore.exp:
  18950. * VM/CTI.cpp:
  18951. (JSC::):
  18952. (JSC::CTI::emitCTICall):
  18953. (JSC::CTI::CTI):
  18954. (JSC::CTI::compileOpCall):
  18955. (JSC::CTI::emitSlowScriptCheck):
  18956. (JSC::CTI::compileBinaryArithOpSlowCase):
  18957. (JSC::CTI::privateCompileMainPass):
  18958. (JSC::CTI::privateCompileSlowCases):
  18959. (JSC::CTI::privateCompile):
  18960. (JSC::CTI::privateCompileGetByIdSelf):
  18961. (JSC::CTI::privateCompileGetByIdProto):
  18962. (JSC::CTI::privateCompileGetByIdChain):
  18963. (JSC::CTI::privateCompilePutByIdReplace):
  18964. (JSC::CTI::privateCompilePutByIdTransition):
  18965. (JSC::CTI::privateCompileCTIMachineTrampolines):
  18966. (JSC::CTI::freeCTIMachineTrampolines):
  18967. (JSC::CTI::patchGetByIdSelf):
  18968. (JSC::CTI::patchPutByIdReplace):
  18969. (JSC::CTI::privateCompilePatchGetArrayLength):
  18970. (JSC::CTI::compileRegExp):
  18971. * VM/CTI.h:
  18972. * VM/CodeBlock.cpp:
  18973. (JSC::CodeBlock::printStructureIDs):
  18974. (JSC::CodeBlock::dump):
  18975. (JSC::CodeBlock::derefStructureIDs):
  18976. (JSC::CodeBlock::refStructureIDs):
  18977. * VM/ExceptionHelpers.cpp:
  18978. (JSC::createNotAnObjectError):
  18979. * VM/Machine.cpp:
  18980. (JSC::jsLess):
  18981. (JSC::jsLessEq):
  18982. (JSC::BytecodeInterpreter::resolve):
  18983. (JSC::BytecodeInterpreter::resolveSkip):
  18984. (JSC::BytecodeInterpreter::resolveGlobal):
  18985. (JSC::BytecodeInterpreter::resolveBase):
  18986. (JSC::BytecodeInterpreter::resolveBaseAndProperty):
  18987. (JSC::BytecodeInterpreter::resolveBaseAndFunc):
  18988. (JSC::BytecodeInterpreter::slideRegisterWindowForCall):
  18989. (JSC::BytecodeInterpreter::callEval):
  18990. (JSC::BytecodeInterpreter::BytecodeInterpreter):
  18991. (JSC::BytecodeInterpreter::initialize):
  18992. (JSC::BytecodeInterpreter::~BytecodeInterpreter):
  18993. (JSC::BytecodeInterpreter::dumpCallFrame):
  18994. (JSC::BytecodeInterpreter::dumpRegisters):
  18995. (JSC::BytecodeInterpreter::isOpcode):
  18996. (JSC::BytecodeInterpreter::unwindCallFrame):
  18997. (JSC::BytecodeInterpreter::throwException):
  18998. (JSC::BytecodeInterpreter::execute):
  18999. (JSC::BytecodeInterpreter::debug):
  19000. (JSC::BytecodeInterpreter::resetTimeoutCheck):
  19001. (JSC::BytecodeInterpreter::checkTimeout):
  19002. (JSC::BytecodeInterpreter::createExceptionScope):
  19003. (JSC::BytecodeInterpreter::tryCachePutByID):
  19004. (JSC::BytecodeInterpreter::uncachePutByID):
  19005. (JSC::BytecodeInterpreter::tryCacheGetByID):
  19006. (JSC::BytecodeInterpreter::uncacheGetByID):
  19007. (JSC::BytecodeInterpreter::privateExecute):
  19008. (JSC::BytecodeInterpreter::retrieveArguments):
  19009. (JSC::BytecodeInterpreter::retrieveCaller):
  19010. (JSC::BytecodeInterpreter::retrieveLastCaller):
  19011. (JSC::BytecodeInterpreter::findFunctionCallFrame):
  19012. (JSC::BytecodeInterpreter::tryCTICachePutByID):
  19013. (JSC::BytecodeInterpreter::tryCTICacheGetByID):
  19014. (JSC::BytecodeInterpreter::cti_op_convert_this):
  19015. (JSC::BytecodeInterpreter::cti_op_end):
  19016. (JSC::BytecodeInterpreter::cti_op_add):
  19017. (JSC::BytecodeInterpreter::cti_op_pre_inc):
  19018. (JSC::BytecodeInterpreter::cti_timeout_check):
  19019. (JSC::BytecodeInterpreter::cti_register_file_check):
  19020. (JSC::BytecodeInterpreter::cti_op_loop_if_less):
  19021. (JSC::BytecodeInterpreter::cti_op_loop_if_lesseq):
  19022. (JSC::BytecodeInterpreter::cti_op_new_object):
  19023. (JSC::BytecodeInterpreter::cti_op_put_by_id):
  19024. (JSC::BytecodeInterpreter::cti_op_put_by_id_second):
  19025. (JSC::BytecodeInterpreter::cti_op_put_by_id_generic):
  19026. (JSC::BytecodeInterpreter::cti_op_put_by_id_fail):
  19027. (JSC::BytecodeInterpreter::cti_op_get_by_id):
  19028. (JSC::BytecodeInterpreter::cti_op_get_by_id_second):
  19029. (JSC::BytecodeInterpreter::cti_op_get_by_id_generic):
  19030. (JSC::BytecodeInterpreter::cti_op_get_by_id_fail):
  19031. (JSC::BytecodeInterpreter::cti_op_instanceof):
  19032. (JSC::BytecodeInterpreter::cti_op_del_by_id):
  19033. (JSC::BytecodeInterpreter::cti_op_mul):
  19034. (JSC::BytecodeInterpreter::cti_op_new_func):
  19035. (JSC::BytecodeInterpreter::cti_op_call_JSFunction):
  19036. (JSC::BytecodeInterpreter::cti_op_call_arityCheck):
  19037. (JSC::BytecodeInterpreter::cti_vm_dontLazyLinkCall):
  19038. (JSC::BytecodeInterpreter::cti_vm_lazyLinkCall):
  19039. (JSC::BytecodeInterpreter::cti_op_push_activation):
  19040. (JSC::BytecodeInterpreter::cti_op_call_NotJSFunction):
  19041. (JSC::BytecodeInterpreter::cti_op_create_arguments):
  19042. (JSC::BytecodeInterpreter::cti_op_create_arguments_no_params):
  19043. (JSC::BytecodeInterpreter::cti_op_tear_off_activation):
  19044. (JSC::BytecodeInterpreter::cti_op_tear_off_arguments):
  19045. (JSC::BytecodeInterpreter::cti_op_profile_will_call):
  19046. (JSC::BytecodeInterpreter::cti_op_profile_did_call):
  19047. (JSC::BytecodeInterpreter::cti_op_ret_scopeChain):
  19048. (JSC::BytecodeInterpreter::cti_op_new_array):
  19049. (JSC::BytecodeInterpreter::cti_op_resolve):
  19050. (JSC::BytecodeInterpreter::cti_op_construct_JSConstruct):
  19051. (JSC::BytecodeInterpreter::cti_op_construct_NotJSConstruct):
  19052. (JSC::BytecodeInterpreter::cti_op_get_by_val):
  19053. (JSC::BytecodeInterpreter::cti_op_resolve_func):
  19054. (JSC::BytecodeInterpreter::cti_op_sub):
  19055. (JSC::BytecodeInterpreter::cti_op_put_by_val):
  19056. (JSC::BytecodeInterpreter::cti_op_put_by_val_array):
  19057. (JSC::BytecodeInterpreter::cti_op_lesseq):
  19058. (JSC::BytecodeInterpreter::cti_op_loop_if_true):
  19059. (JSC::BytecodeInterpreter::cti_op_negate):
  19060. (JSC::BytecodeInterpreter::cti_op_resolve_base):
  19061. (JSC::BytecodeInterpreter::cti_op_resolve_skip):
  19062. (JSC::BytecodeInterpreter::cti_op_resolve_global):
  19063. (JSC::BytecodeInterpreter::cti_op_div):
  19064. (JSC::BytecodeInterpreter::cti_op_pre_dec):
  19065. (JSC::BytecodeInterpreter::cti_op_jless):
  19066. (JSC::BytecodeInterpreter::cti_op_not):
  19067. (JSC::BytecodeInterpreter::cti_op_jtrue):
  19068. (JSC::BytecodeInterpreter::cti_op_post_inc):
  19069. (JSC::BytecodeInterpreter::cti_op_eq):
  19070. (JSC::BytecodeInterpreter::cti_op_lshift):
  19071. (JSC::BytecodeInterpreter::cti_op_bitand):
  19072. (JSC::BytecodeInterpreter::cti_op_rshift):
  19073. (JSC::BytecodeInterpreter::cti_op_bitnot):
  19074. (JSC::BytecodeInterpreter::cti_op_resolve_with_base):
  19075. (JSC::BytecodeInterpreter::cti_op_new_func_exp):
  19076. (JSC::BytecodeInterpreter::cti_op_mod):
  19077. (JSC::BytecodeInterpreter::cti_op_less):
  19078. (JSC::BytecodeInterpreter::cti_op_neq):
  19079. (JSC::BytecodeInterpreter::cti_op_post_dec):
  19080. (JSC::BytecodeInterpreter::cti_op_urshift):
  19081. (JSC::BytecodeInterpreter::cti_op_bitxor):
  19082. (JSC::BytecodeInterpreter::cti_op_new_regexp):
  19083. (JSC::BytecodeInterpreter::cti_op_bitor):
  19084. (JSC::BytecodeInterpreter::cti_op_call_eval):
  19085. (JSC::BytecodeInterpreter::cti_op_throw):
  19086. (JSC::BytecodeInterpreter::cti_op_get_pnames):
  19087. (JSC::BytecodeInterpreter::cti_op_next_pname):
  19088. (JSC::BytecodeInterpreter::cti_op_push_scope):
  19089. (JSC::BytecodeInterpreter::cti_op_pop_scope):
  19090. (JSC::BytecodeInterpreter::cti_op_typeof):
  19091. (JSC::BytecodeInterpreter::cti_op_is_undefined):
  19092. (JSC::BytecodeInterpreter::cti_op_is_boolean):
  19093. (JSC::BytecodeInterpreter::cti_op_is_number):
  19094. (JSC::BytecodeInterpreter::cti_op_is_string):
  19095. (JSC::BytecodeInterpreter::cti_op_is_object):
  19096. (JSC::BytecodeInterpreter::cti_op_is_function):
  19097. (JSC::BytecodeInterpreter::cti_op_stricteq):
  19098. (JSC::BytecodeInterpreter::cti_op_nstricteq):
  19099. (JSC::BytecodeInterpreter::cti_op_to_jsnumber):
  19100. (JSC::BytecodeInterpreter::cti_op_in):
  19101. (JSC::BytecodeInterpreter::cti_op_push_new_scope):
  19102. (JSC::BytecodeInterpreter::cti_op_jmp_scopes):
  19103. (JSC::BytecodeInterpreter::cti_op_put_by_index):
  19104. (JSC::BytecodeInterpreter::cti_op_switch_imm):
  19105. (JSC::BytecodeInterpreter::cti_op_switch_char):
  19106. (JSC::BytecodeInterpreter::cti_op_switch_string):
  19107. (JSC::BytecodeInterpreter::cti_op_del_by_val):
  19108. (JSC::BytecodeInterpreter::cti_op_put_getter):
  19109. (JSC::BytecodeInterpreter::cti_op_put_setter):
  19110. (JSC::BytecodeInterpreter::cti_op_new_error):
  19111. (JSC::BytecodeInterpreter::cti_op_debug):
  19112. (JSC::BytecodeInterpreter::cti_vm_throw):
  19113. * VM/Machine.h:
  19114. * VM/Register.h:
  19115. * VM/SamplingTool.cpp:
  19116. (JSC::SamplingTool::run):
  19117. * VM/SamplingTool.h:
  19118. (JSC::SamplingTool::SamplingTool):
  19119. * bytecompiler/CodeGenerator.cpp:
  19120. (JSC::CodeGenerator::generate):
  19121. (JSC::CodeGenerator::CodeGenerator):
  19122. (JSC::CodeGenerator::emitOpcode):
  19123. * debugger/DebuggerCallFrame.cpp:
  19124. (JSC::DebuggerCallFrame::evaluate):
  19125. * jsc.cpp:
  19126. (runWithScripts):
  19127. * parser/Nodes.cpp:
  19128. (JSC::ScopeNode::ScopeNode):
  19129. * profiler/ProfileGenerator.cpp:
  19130. (JSC::ProfileGenerator::addParentForConsoleStart):
  19131. * runtime/ArrayPrototype.cpp:
  19132. (JSC::arrayProtoFuncPop):
  19133. (JSC::arrayProtoFuncPush):
  19134. * runtime/Collector.cpp:
  19135. (JSC::Heap::collect):
  19136. * runtime/ExecState.h:
  19137. (JSC::ExecState::interpreter):
  19138. * runtime/FunctionPrototype.cpp:
  19139. (JSC::functionProtoFuncApply):
  19140. * runtime/Interpreter.cpp:
  19141. (JSC::Interpreter::evaluate):
  19142. * runtime/JSCell.h:
  19143. * runtime/JSFunction.cpp:
  19144. (JSC::JSFunction::call):
  19145. (JSC::JSFunction::argumentsGetter):
  19146. (JSC::JSFunction::callerGetter):
  19147. (JSC::JSFunction::construct):
  19148. * runtime/JSFunction.h:
  19149. * runtime/JSGlobalData.cpp:
  19150. (JSC::JSGlobalData::JSGlobalData):
  19151. (JSC::JSGlobalData::~JSGlobalData):
  19152. * runtime/JSGlobalData.h:
  19153. * runtime/JSGlobalObject.cpp:
  19154. (JSC::JSGlobalObject::~JSGlobalObject):
  19155. (JSC::JSGlobalObject::setTimeoutTime):
  19156. (JSC::JSGlobalObject::startTimeoutCheck):
  19157. (JSC::JSGlobalObject::stopTimeoutCheck):
  19158. (JSC::JSGlobalObject::mark):
  19159. * runtime/JSGlobalObjectFunctions.cpp:
  19160. (JSC::globalFuncEval):
  19161. * runtime/JSString.h:
  19162. * runtime/RegExp.cpp:
  19163. (JSC::RegExp::RegExp):
  19164. 2008-11-15 Maciej Stachowiak <mjs@apple.com>
  19165. Reviewed by Sam Weinig.
  19166. - Remove SymbolTable from FunctionBodyNode and move it to CodeBlock
  19167. It's not needed for functions that have never been executed, so no
  19168. need to waste the memory. Saves ~4M on membuster after 30 pages.
  19169. * VM/CodeBlock.h:
  19170. * VM/Machine.cpp:
  19171. (JSC::Machine::retrieveArguments):
  19172. * parser/Nodes.cpp:
  19173. (JSC::EvalNode::generateCode):
  19174. (JSC::FunctionBodyNode::generateCode):
  19175. * parser/Nodes.h:
  19176. * runtime/JSActivation.h:
  19177. (JSC::JSActivation::JSActivationData::JSActivationData):
  19178. 2008-11-14 Cameron Zwarich <zwarich@apple.com>
  19179. Reviewed by Darin Adler.
  19180. Bug 22259: Make all opcodes use eax as their final result register
  19181. <https://bugs.webkit.org/show_bug.cgi?id=22259>
  19182. Change one case of op_add (and the corresponding slow case) to use eax
  19183. rather than edx. Also, change the order in which the two results of
  19184. resolve_func and resolve_base are emitted so that the retrieved value is
  19185. put last into eax.
  19186. This gives no performance change on SunSpider or the V8 benchmark suite
  19187. when run in either harness.
  19188. * VM/CTI.cpp:
  19189. (JSC::CTI::privateCompileMainPass):
  19190. (JSC::CTI::privateCompileSlowCases):
  19191. 2008-11-14 Gavin Barraclough <barraclough@apple.com>
  19192. Reviewed by Geoff Garen.
  19193. Geoff has this wacky notion that emitGetArg and emitPutArg should be related to
  19194. doing the same thing. Crazy.
  19195. Rename the methods for accessing virtual registers to say 'VirtualRegister' in the
  19196. name, and those for setting up the arguments for CTI methods to contain 'CTIArg'.
  19197. * VM/CTI.cpp:
  19198. (JSC::CTI::emitGetVirtualRegister):
  19199. (JSC::CTI::emitGetVirtualRegisters):
  19200. (JSC::CTI::emitPutCTIArgFromVirtualRegister):
  19201. (JSC::CTI::emitPutCTIArg):
  19202. (JSC::CTI::emitGetCTIArg):
  19203. (JSC::CTI::emitPutCTIArgConstant):
  19204. (JSC::CTI::emitPutVirtualRegister):
  19205. (JSC::CTI::compileOpCallSetupArgs):
  19206. (JSC::CTI::compileOpCallEvalSetupArgs):
  19207. (JSC::CTI::compileOpConstructSetupArgs):
  19208. (JSC::CTI::compileOpCall):
  19209. (JSC::CTI::compileOpStrictEq):
  19210. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  19211. (JSC::CTI::compileBinaryArithOp):
  19212. (JSC::CTI::compileBinaryArithOpSlowCase):
  19213. (JSC::CTI::privateCompileMainPass):
  19214. (JSC::CTI::privateCompileSlowCases):
  19215. (JSC::CTI::privateCompileCTIMachineTrampolines):
  19216. * VM/CTI.h:
  19217. 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
  19218. Reviewed by Antti Koivisto
  19219. Fix potential build break by adding StdLibExtras.h
  19220. * GNUmakefile.am:
  19221. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  19222. 2008-11-14 Gavin Barraclough <barraclough@apple.com>
  19223. Reviewed by Geoff Garen.
  19224. Generate less code for the slow cases of op_call and op_construct.
  19225. https://bugs.webkit.org/show_bug.cgi?id=22272
  19226. 1% progression on v8 tests.
  19227. * VM/CTI.cpp:
  19228. (JSC::CTI::emitRetrieveArg):
  19229. (JSC::CTI::emitNakedCall):
  19230. (JSC::CTI::compileOpCallInitializeCallFrame):
  19231. (JSC::CTI::compileOpCall):
  19232. (JSC::CTI::privateCompileSlowCases):
  19233. (JSC::CTI::privateCompileCTIMachineTrampolines):
  19234. * VM/CTI.h:
  19235. * VM/CodeBlock.h:
  19236. (JSC::getCallLinkInfoReturnLocation):
  19237. (JSC::CodeBlock::getCallLinkInfo):
  19238. * VM/Machine.cpp:
  19239. (JSC::Machine::Machine):
  19240. (JSC::Machine::cti_vm_dontLazyLinkCall):
  19241. (JSC::Machine::cti_vm_lazyLinkCall):
  19242. * VM/Machine.h:
  19243. 2008-11-14 Greg Bolsinga <bolsinga@apple.com>
  19244. Reviewed by Darin Alder.
  19245. https://bugs.webkit.org/show_bug.cgi?id=21810
  19246. Remove use of static C++ objects that are destroyed at exit time (destructors)
  19247. Create DEFINE_STATIC_LOCAL macro. Change static local objects to leak to avoid
  19248. exit-time destructor. Update code that was changed to fix this issue that ran
  19249. into a gcc bug (<rdar://problem/6354696> Codegen issue with C++ static reference
  19250. in gcc build 5465). Also typdefs for template types needed to be added in some
  19251. cases so the type could make it through the macro successfully.
  19252. Basically code of the form:
  19253. static T m;
  19254. becomes:
  19255. DEFINE_STATIC_LOCAL(T, m, ());
  19256. Also any code of the form:
  19257. static T& m = *new T;
  19258. also becomes:
  19259. DEFINE_STATIC_LOCAL(T, m, ());
  19260. * JavaScriptCore.xcodeproj/project.pbxproj:
  19261. * wtf/MainThread.cpp:
  19262. (WTF::mainThreadFunctionQueueMutex):
  19263. (WTF::functionQueue):
  19264. * wtf/StdLibExtras.h: Added. Add DEFINE_STATIC_LOCAL macro
  19265. * wtf/ThreadingPthreads.cpp:
  19266. (WTF::threadMapMutex):
  19267. (WTF::threadMap):
  19268. (WTF::identifierByPthreadHandle):
  19269. 2008-11-13 Sam Weinig <sam@webkit.org>
  19270. Reviewed by Darin Adler
  19271. Fix for https://bugs.webkit.org/show_bug.cgi?id=22269
  19272. Reduce PropertyMap usage
  19273. From observation of StructureID statistics, it became clear that many
  19274. StructureID's were not being used as StructureIDs themselves, but rather
  19275. only being necessary as links in the transition chain. Acknowledging this
  19276. and that PropertyMaps stored in StructureIDs can be treated as caches, that
  19277. is that they can be reconstructed on demand, it became clear that we could
  19278. reduce the memory consumption of StructureIDs by only keeping PropertyMaps
  19279. for the StructureIDs that need them the most.
  19280. The specific strategy used to reduce the number of StructureIDs with
  19281. PropertyMaps is to take the previous StructureIDs PropertyMap when initially
  19282. transitioning (addPropertyTransition) from it and clearing out the pointer
  19283. in the process. The next time we need to do the same transition, for instance
  19284. repeated calls to the same constructor, we use the new addPropertyTransitionToExistingStructure
  19285. first, which allows us not to need the PropertyMap to determine if the property
  19286. exists already, since a transition to that property would require it not already
  19287. be present in the StructureID. Should there be no transition, the PropertyMap
  19288. can be constructed on demand (via materializePropertyMap) to determine if the put is a
  19289. replace or a transition to a new StructureID.
  19290. Reduces memory use on Membuster head test (30 pages open) by ~15MB.
  19291. * JavaScriptCore.exp:
  19292. * runtime/JSObject.h:
  19293. (JSC::JSObject::putDirect): First use addPropertyTransitionToExistingStructure
  19294. so that we can avoid building the PropertyMap on subsequent similar object
  19295. creations.
  19296. * runtime/PropertyMapHashTable.h:
  19297. (JSC::PropertyMapEntry::PropertyMapEntry): Add version of constructor which takes
  19298. all values to be used when lazily building the PropertyMap.
  19299. * runtime/StructureID.cpp:
  19300. (JSC::StructureID::dumpStatistics): Add statistics on the number of StructureIDs
  19301. with PropertyMaps.
  19302. (JSC::StructureID::StructureID): Rename m_cachedTransistionOffset to m_offset
  19303. (JSC::isPowerOf2):
  19304. (JSC::nextPowerOf2):
  19305. (JSC::sizeForKeyCount): Returns the expected size of a PropertyMap for a key count.
  19306. (JSC::StructureID::materializePropertyMap): Builds the PropertyMap out of its previous pointer chain.
  19307. (JSC::StructureID::addPropertyTransitionToExistingStructure): Only transitions if there is a
  19308. an existing transition.
  19309. (JSC::StructureID::addPropertyTransition): Instead of always copying the ProperyMap, try and take
  19310. it from it previous pointer.
  19311. (JSC::StructureID::removePropertyTransition): Simplify by calling toDictionaryTransition() to do
  19312. transition work.
  19313. (JSC::StructureID::changePrototypeTransition): Build the PropertyMap if necessary before transitioning
  19314. because once you have transitioned, you will not be able to reconstruct it afterwards as there is no
  19315. previous pointer, pinning the ProperyMap as well.
  19316. (JSC::StructureID::getterSetterTransition): Ditto.
  19317. (JSC::StructureID::toDictionaryTransition): Pin the PropertyMap so that it is not destroyed on further transitions.
  19318. (JSC::StructureID::fromDictionaryTransition): We can only transition back from a dictionary transition if there
  19319. are no deleted offsets.
  19320. (JSC::StructureID::addPropertyWithoutTransition): Build PropertyMap on demands and pin.
  19321. (JSC::StructureID::removePropertyWithoutTransition): Ditto.
  19322. (JSC::StructureID::get): Build on demand.
  19323. (JSC::StructureID::createPropertyMapHashTable): Add version of create that takes a size
  19324. for on demand building.
  19325. (JSC::StructureID::expandPropertyMapHashTable):
  19326. (JSC::StructureID::rehashPropertyMapHashTable):
  19327. (JSC::StructureID::getEnumerablePropertyNamesInternal): Build PropertyMap on demand.
  19328. * runtime/StructureID.h:
  19329. (JSC::StructureID::propertyStorageSize): Account for StructureIDs without PropertyMaps.
  19330. (JSC::StructureID::isEmpty): Ditto.
  19331. (JSC::StructureID::materializePropertyMapIfNecessary):
  19332. (JSC::StructureID::get): Build PropertyMap on demand
  19333. 2008-11-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  19334. Reviewed by Simon Hausmann.
  19335. <https://bugs.webkit.org/show_bug.cgi?id=21500>
  19336. JavaScriptCore build with -O3 flag instead of -O2 (gcc).
  19337. 2.02% speedup on SunSpider (Qt-port on Linux)
  19338. 1.10% speedup on V8 (Qt-port on Linux)
  19339. 3.45% speedup on WindScorpion (Qt-port on Linux)
  19340. * JavaScriptCore.pri:
  19341. 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
  19342. Reviewed by Darin Adler.
  19343. Compile fix for RVCT.
  19344. In reality, it is two fixes:
  19345. 1. Remove typename. I believe typename can only be used when the named
  19346. type depends on the template parameters, which it doesn't in this
  19347. case, so I think this is more correct.
  19348. 2. Replace ::iterator scope with specialized typedef. This is to work
  19349. around a bug in RVCT.
  19350. https://bugs.webkit.org/show_bug.cgi?id=22260
  19351. * wtf/ListHashSet.h:
  19352. (WTF::::find):
  19353. 2008-11-14 Kristian Amlie <kristian.amlie@trolltech.com>
  19354. Reviewed by Darin Adler.
  19355. Compile fix for WINSCW.
  19356. This fix doesn't protect against implicit conversions from bool to
  19357. integers, but most likely that will be caught on another platform.
  19358. https://bugs.webkit.org/show_bug.cgi?id=22260
  19359. * wtf/PassRefPtr.h:
  19360. (WTF::PassRefPtr::operator bool):
  19361. * wtf/RefPtr.h:
  19362. (WTF::RefPtr::operator bool):
  19363. 2008-11-14 Cameron Zwarich <zwarich@apple.com>
  19364. Reviewed by Darin Adler.
  19365. Bug 22245: Move wtf/dtoa.h into the WTF namespace
  19366. <https://bugs.webkit.org/show_bug.cgi?id=22245>
  19367. Move wtf/dtoa.h into the WTF namespace from the JSC namespace. This
  19368. introduces some ambiguities in name lookups, so I changed all uses of
  19369. the functions in wtf/dtoa.h to explicitly state the namespace.
  19370. * JavaScriptCore.exp:
  19371. * parser/Lexer.cpp:
  19372. (JSC::Lexer::lex):
  19373. * runtime/InitializeThreading.cpp:
  19374. * runtime/JSGlobalObjectFunctions.cpp:
  19375. (JSC::parseInt):
  19376. * runtime/NumberPrototype.cpp:
  19377. (JSC::integerPartNoExp):
  19378. (JSC::numberProtoFuncToExponential):
  19379. * runtime/UString.cpp:
  19380. (JSC::concatenate):
  19381. (JSC::UString::from):
  19382. (JSC::UString::toDouble):
  19383. * wtf/dtoa.cpp:
  19384. * wtf/dtoa.h:
  19385. 2008-11-14 Cameron Zwarich <zwarich@apple.com>
  19386. Reviewed by Maciej Stachowiak.
  19387. Bug 22257: Enable redundant read optimizations for results generated by compileBinaryArithOp()
  19388. <https://bugs.webkit.org/show_bug.cgi?id=22257>
  19389. This shows no change in performance on either SunSpider or the V8
  19390. benchmark suite, but it removes an ugly special case and allows for
  19391. future optimizations to be implemented in a cleaner fashion.
  19392. This patch was essentially given to me by Gavin Barraclough upon my
  19393. request, but I did regression and performance testing so that he could
  19394. work on something else.
  19395. * VM/CTI.cpp:
  19396. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate): Move the final
  19397. result to eax if it is not already there.
  19398. (JSC::CTI::compileBinaryArithOp): Remove the killing of the final result
  19399. register that disables the optimization.
  19400. 2008-11-13 Eric Seidel <eric@webkit.org>
  19401. Reviewed by Adam Roben.
  19402. Add a Scons-based build system for building
  19403. the Chromium-Mac build of JavaScriptCore.
  19404. https://bugs.webkit.org/show_bug.cgi?id=21991
  19405. * JavaScriptCore.scons: Added.
  19406. * SConstruct: Added.
  19407. 2008-11-13 Eric Seidel <eric@webkit.org>
  19408. Reviewed by Adam Roben.
  19409. Add PLATFORM(CHROMIUM) to the "we don't use cairo" blacklist
  19410. until https://bugs.webkit.org/show_bug.cgi?id=22250 is fixed.
  19411. * wtf/Platform.h:
  19412. 2008-11-13 Cameron Zwarich <zwarich@apple.com>
  19413. Reviewed by Sam Weinig.
  19414. In r38375 the 'jsc' shell was changed to improve teardown on quit. The
  19415. main() function in jsc.cpp uses Structured Exception Handling, so Visual
  19416. C++ emits a warning when destructors are used.
  19417. In order to speculatively fix the Windows build, this patch changes that
  19418. code to use explicit pointer manipulation and locking rather than smart
  19419. pointers and RAII.
  19420. * jsc.cpp:
  19421. (main):
  19422. 2008-11-13 Cameron Zwarich <zwarich@apple.com>
  19423. Reviewed by Darin Adler.
  19424. Bug 22246: Get arguments for opcodes together to eliminate more redundant memory reads
  19425. <https://bugs.webkit.org/show_bug.cgi?id=22246>
  19426. It is common for opcodes to read their first operand into eax and their
  19427. second operand into edx. If the value intended for the second operand is
  19428. in eax, we should first move eax to the register for the second operand
  19429. and then read the first operand into eax.
  19430. This is a 0.5% speedup on SunSpider and a 2.0% speedup on the V8
  19431. benchmark suite when measured using the V8 harness.
  19432. * VM/CTI.cpp:
  19433. (JSC::CTI::emitGetArgs):
  19434. (JSC::CTI::compileOpStrictEq):
  19435. (JSC::CTI::compileBinaryArithOp):
  19436. (JSC::CTI::privateCompileMainPass):
  19437. (JSC::CTI::privateCompileSlowCases):
  19438. * VM/CTI.h:
  19439. 2008-11-13 Cameron Zwarich <zwarich@apple.com>
  19440. Reviewed by Darin Adler.
  19441. Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax
  19442. <https://bugs.webkit.org/show_bug.cgi?id=22238>
  19443. Enable the optimization of not reading a value back from memory that we
  19444. just wrote when the target machine register is not eax. In order to do
  19445. this, the code generation for op_put_global_var must be changed to
  19446. read its argument into a register before overwriting eax.
  19447. This is a 0.5% speedup on SunSpider and shows no change on the V8
  19448. benchmark suite when run in either harness.
  19449. * VM/CTI.cpp:
  19450. (JSC::CTI::emitGetArg):
  19451. (JSC::CTI::privateCompileMainPass):
  19452. 2008-11-13 Cameron Zwarich <zwarich@apple.com>
  19453. Reviewed by Alexey Proskuryakov.
  19454. Perform teardown in the 'jsc' shell in order to suppress annoying and
  19455. misleading leak messages. There is still a lone JSC::Node leaking when
  19456. quit() is called, but hopefully that can be fixed as well.
  19457. * jsc.cpp:
  19458. (functionQuit):
  19459. (main):
  19460. 2008-11-13 Mike Pinkerton <pinkerton@chromium.org>
  19461. Reviewed by Sam Weinig.
  19462. Fix for https://bugs.webkit.org/show_bug.cgi?id=22087
  19463. Need correct platform defines for Mac Chromium
  19464. Set the appropriate platform defines for Mac Chromium, which is
  19465. similar to PLATFORM(MAC), but isn't.
  19466. * wtf/Platform.h:
  19467. 2008-11-13 Maciej Stachowiak <mjs@apple.com>
  19468. Reviewed by Cameron Zwarich.
  19469. - remove immediate checks from native codegen for known non-immediate cases like "this"
  19470. ~.5% speedup on v8 benchmarks
  19471. In the future we can extend this model to remove all sorts of
  19472. typechecks based on local type info or type inference.
  19473. I also added an assertion to verify that all slow cases linked as
  19474. many slow case jumps as the corresponding fast case generated, and
  19475. fixed the pre-existing cases where this was not true.
  19476. * VM/CTI.cpp:
  19477. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  19478. (JSC::CTI::linkSlowCaseIfNotJSCell):
  19479. (JSC::CTI::compileBinaryArithOp):
  19480. (JSC::CTI::compileBinaryArithOpSlowCase):
  19481. (JSC::CTI::privateCompileMainPass):
  19482. (JSC::CTI::privateCompileSlowCases):
  19483. * VM/CTI.h:
  19484. * VM/CodeBlock.h:
  19485. (JSC::CodeBlock::isKnownNotImmediate):
  19486. 2008-11-13 Cameron Zwarich <zwarich@apple.com>
  19487. Reviewed by Maciej Stachowiak.
  19488. Bug 21943: Avoid needless reads of temporary values in CTI code
  19489. <https://bugs.webkit.org/show_bug.cgi?id=21943>
  19490. If an opcode needs to load a virtual register and a previous opcode left
  19491. the contents of that virtual register in a machine register, use the
  19492. value in the machine register rather than getting it from memory.
  19493. In order to perform this optimization, it is necessary to know the
  19494. jump tagets in the CodeBlock. For temporaries, the only problematic
  19495. jump targets are binary logical operators and the ternary conditional
  19496. operator. However, if this optimization were to be extended to local
  19497. variable registers as well, other jump targets would need to be
  19498. included, like switch statement cases and the beginnings of catch
  19499. blocks.
  19500. This optimization also requires that the fast case and the slow case
  19501. of an opcode use emitPutResult() on the same register, which was chosen
  19502. to be eax, as that is the register into which we read the first operand
  19503. of opcodes. In order to make this the case, we needed to add some mov
  19504. instructions to the slow cases of some instructions.
  19505. This optimizaton is not applied whenever compileBinaryArithOp() is used
  19506. to compile an opcode, because different machine registers may be used to
  19507. store the final result. It seems possible to rewrite the code generation
  19508. in compileBinaryArithOp() to allow for this optimization.
  19509. This optimization is also not applied when generating slow cases,
  19510. because some fast cases overwrite the value of eax before jumping to the
  19511. slow case. In the future, it may be possible to apply this optimization
  19512. to slow cases as well, but it did not seem to be a speedup when testing
  19513. an early version of this patch.
  19514. This is a 1.0% speedup on SunSpider and a 6.3% speedup on the V8
  19515. benchmark suite.
  19516. * VM/CTI.cpp:
  19517. (JSC::CTI::killLastResultRegister):
  19518. (JSC::CTI::emitGetArg):
  19519. (JSC::CTI::emitGetPutArg):
  19520. (JSC::CTI::emitGetCTIParam):
  19521. (JSC::CTI::emitGetFromCallFrameHeader):
  19522. (JSC::CTI::emitPutResult):
  19523. (JSC::CTI::emitCTICall):
  19524. (JSC::CTI::CTI):
  19525. (JSC::CTI::compileOpCall):
  19526. (JSC::CTI::compileOpStrictEq):
  19527. (JSC::CTI::emitSlowScriptCheck):
  19528. (JSC::CTI::compileBinaryArithOp):
  19529. (JSC::CTI::privateCompileMainPass):
  19530. (JSC::CTI::privateCompileSlowCases):
  19531. (JSC::CTI::privateCompileGetByIdProto):
  19532. (JSC::CTI::privateCompilePatchGetArrayLength):
  19533. * VM/CTI.h:
  19534. * VM/CodeBlock.h:
  19535. (JSC::CodeBlock::isTemporaryRegisterIndex):
  19536. * bytecompiler/CodeGenerator.cpp:
  19537. (JSC::CodeGenerator::emitLabel):
  19538. 2008-11-12 Alp Toker <alp@nuanti.com>
  19539. autotools build system fix-up only. Add FloatQuad.h to the source
  19540. lists and sort them.
  19541. * GNUmakefile.am:
  19542. 2008-11-12 Geoffrey Garen <ggaren@apple.com>
  19543. Reviewed by Sam Weinig.
  19544. Fixed https://bugs.webkit.org/show_bug.cgi?id=22192
  19545. +37 failures in fast/profiler
  19546. along with Darin's review comments in
  19547. https://bugs.webkit.org/show_bug.cgi?id=22174
  19548. Simplified op_call by nixing its responsibility for moving the value of
  19549. "this" into the first argument slot
  19550. * VM/Machine.cpp:
  19551. (JSC::returnToThrowTrampoline):
  19552. (JSC::throwStackOverflowError):
  19553. (JSC::Machine::cti_register_file_check):
  19554. (JSC::Machine::cti_op_call_arityCheck):
  19555. (JSC::Machine::cti_vm_throw): Moved the throw logic into a function, since
  19556. functions are better than macros.
  19557. * bytecompiler/CodeGenerator.cpp:
  19558. (JSC::CodeGenerator::emitCall):
  19559. (JSC::CodeGenerator::emitConstruct): Ensure that the function register
  19560. is preserved if profiling is enabled, since the profiler uses that
  19561. register.
  19562. * runtime/JSGlobalData.h: Renamed throwReturnAddress to exceptionLocation,
  19563. because I had a hard time understanding what "throwReturnAddress" meant.
  19564. 2008-11-12 Geoffrey Garen <ggaren@apple.com>
  19565. Reviewed by Sam Weinig.
  19566. Roll in r38322, now that test failures have been fixed.
  19567. * VM/CTI.cpp:
  19568. (JSC::CTI::compileOpCallSetupArgs):
  19569. (JSC::CTI::compileOpCallEvalSetupArgs):
  19570. (JSC::CTI::compileOpConstructSetupArgs):
  19571. (JSC::CTI::compileOpCall):
  19572. (JSC::CTI::privateCompileMainPass):
  19573. (JSC::CTI::privateCompileSlowCases):
  19574. * VM/CTI.h:
  19575. * VM/CodeBlock.cpp:
  19576. (JSC::CodeBlock::dump):
  19577. * VM/Machine.cpp:
  19578. (JSC::Machine::callEval):
  19579. (JSC::Machine::dumpCallFrame):
  19580. (JSC::Machine::dumpRegisters):
  19581. (JSC::Machine::execute):
  19582. (JSC::Machine::privateExecute):
  19583. (JSC::Machine::cti_register_file_check):
  19584. (JSC::Machine::cti_op_call_arityCheck):
  19585. (JSC::Machine::cti_op_call_NotJSFunction):
  19586. (JSC::Machine::cti_op_construct_JSConstruct):
  19587. (JSC::Machine::cti_op_construct_NotJSConstruct):
  19588. (JSC::Machine::cti_op_call_eval):
  19589. (JSC::Machine::cti_vm_throw):
  19590. * VM/Machine.h:
  19591. * bytecompiler/CodeGenerator.cpp:
  19592. (JSC::CodeGenerator::emitCall):
  19593. (JSC::CodeGenerator::emitCallEval):
  19594. (JSC::CodeGenerator::emitConstruct):
  19595. * bytecompiler/CodeGenerator.h:
  19596. * parser/Nodes.cpp:
  19597. (JSC::EvalFunctionCallNode::emitCode):
  19598. (JSC::FunctionCallValueNode::emitCode):
  19599. (JSC::FunctionCallResolveNode::emitCode):
  19600. (JSC::FunctionCallBracketNode::emitCode):
  19601. (JSC::FunctionCallDotNode::emitCode):
  19602. * parser/Nodes.h:
  19603. (JSC::ScopeNode::neededConstants):
  19604. 2008-11-12 Gavin Barraclough <barraclough@apple.com>
  19605. Reviewed by Cameron Zwarich.
  19606. Fix for https://bugs.webkit.org/show_bug.cgi?id=22201
  19607. Integer conversion in array.length was safe signed values,
  19608. but the length is unsigned.
  19609. * VM/CTI.cpp:
  19610. (JSC::CTI::privateCompilePatchGetArrayLength):
  19611. 2008-11-12 Cameron Zwarich <zwarich@apple.com>
  19612. Rubber-stamped by Mark Rowe.
  19613. Roll out r38322 due to test failures on the bots.
  19614. * VM/CTI.cpp:
  19615. (JSC::CTI::compileOpCallSetupArgs):
  19616. (JSC::CTI::compileOpCall):
  19617. (JSC::CTI::privateCompileMainPass):
  19618. (JSC::CTI::privateCompileSlowCases):
  19619. * VM/CTI.h:
  19620. * VM/CodeBlock.cpp:
  19621. (JSC::CodeBlock::dump):
  19622. * VM/Machine.cpp:
  19623. (JSC::Machine::callEval):
  19624. (JSC::Machine::dumpCallFrame):
  19625. (JSC::Machine::dumpRegisters):
  19626. (JSC::Machine::execute):
  19627. (JSC::Machine::privateExecute):
  19628. (JSC::Machine::throwStackOverflowPreviousFrame):
  19629. (JSC::Machine::cti_register_file_check):
  19630. (JSC::Machine::cti_op_call_arityCheck):
  19631. (JSC::Machine::cti_op_call_NotJSFunction):
  19632. (JSC::Machine::cti_op_construct_JSConstruct):
  19633. (JSC::Machine::cti_op_construct_NotJSConstruct):
  19634. (JSC::Machine::cti_op_call_eval):
  19635. (JSC::Machine::cti_vm_throw):
  19636. * VM/Machine.h:
  19637. * bytecompiler/CodeGenerator.cpp:
  19638. (JSC::CodeGenerator::emitCall):
  19639. (JSC::CodeGenerator::emitCallEval):
  19640. (JSC::CodeGenerator::emitConstruct):
  19641. * bytecompiler/CodeGenerator.h:
  19642. * parser/Nodes.cpp:
  19643. (JSC::EvalFunctionCallNode::emitCode):
  19644. (JSC::FunctionCallValueNode::emitCode):
  19645. (JSC::FunctionCallResolveNode::emitCode):
  19646. (JSC::FunctionCallBracketNode::emitCode):
  19647. (JSC::FunctionCallDotNode::emitCode):
  19648. * parser/Nodes.h:
  19649. (JSC::ScopeNode::neededConstants):
  19650. 2008-11-11 Geoffrey Garen <ggaren@apple.com>
  19651. Reviewed by Darin Adler.
  19652. Fixed https://bugs.webkit.org/show_bug.cgi?id=22174
  19653. Simplified op_call by nixing its responsibility for moving the value of
  19654. "this" into the first argument slot.
  19655. Instead, the caller emits an explicit load or mov instruction, or relies
  19656. on implicit knowledge that "this" is already in the first argument slot.
  19657. As a result, two operands to op_call are gone: firstArg and thisVal.
  19658. SunSpider and v8 tests show no change in bytecode or CTI.
  19659. * VM/CTI.cpp:
  19660. (JSC::CTI::compileOpCallSetupArgs):
  19661. (JSC::CTI::compileOpCallEvalSetupArgs):
  19662. (JSC::CTI::compileOpConstructSetupArgs): Split apart these three versions
  19663. of setting up arguments to op_call, because they're more different than
  19664. they are the same -- even more so with this patch.
  19665. (JSC::CTI::compileOpCall): Updated for the fact that op_construct doesn't
  19666. match op_call anymore.
  19667. (JSC::CTI::privateCompileMainPass):
  19668. (JSC::CTI::privateCompileSlowCases): Merged a few call cases. Updated
  19669. for changes mentioned above.
  19670. * VM/CTI.h:
  19671. * VM/CodeBlock.cpp:
  19672. (JSC::CodeBlock::dump): Updated for new bytecode format of call / construct.
  19673. * VM/Machine.cpp:
  19674. (JSC::Machine::callEval): Updated for new bytecode format of call / construct.
  19675. (JSC::Machine::dumpCallFrame):
  19676. (JSC::Machine::dumpRegisters): Simplified these debugging functions,
  19677. taking advantage of the new call frame layout.
  19678. (JSC::Machine::execute): Fixed up the eval version of execute to be
  19679. friendlier to calls in the new format.
  19680. (JSC::Machine::privateExecute): Implemented the new call format in
  19681. bytecode.
  19682. (JSC::Machine::cti_op_call_NotJSFunction):
  19683. (JSC::Machine::cti_op_construct_JSConstruct):
  19684. (JSC::Machine::cti_op_construct_NotJSConstruct):
  19685. (JSC::Machine::cti_op_call_eval): Updated CTI helpers to match the new
  19686. call format.
  19687. Fixed a latent bug in stack overflow checking that is now hit because
  19688. the register layout has changed a bit -- namely: when throwing a stack
  19689. overflow exception inside an op_call helper, we need to account for the
  19690. fact that the current call frame is only half-constructed, and use the
  19691. parent call frame instead.
  19692. * VM/Machine.h:
  19693. * bytecompiler/CodeGenerator.cpp:
  19694. (JSC::CodeGenerator::emitCall):
  19695. (JSC::CodeGenerator::emitCallEval):
  19696. (JSC::CodeGenerator::emitConstruct):
  19697. * bytecompiler/CodeGenerator.h: Updated codegen to match the new call
  19698. format.
  19699. * parser/Nodes.cpp:
  19700. (JSC::EvalFunctionCallNode::emitCode):
  19701. (JSC::FunctionCallValueNode::emitCode):
  19702. (JSC::FunctionCallResolveNode::emitCode):
  19703. (JSC::FunctionCallBracketNode::emitCode):
  19704. (JSC::FunctionCallDotNode::emitCode):
  19705. * parser/Nodes.h:
  19706. (JSC::ScopeNode::neededConstants): ditto
  19707. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19708. Reviewed by Geoff Garen.
  19709. Remove an unused forwarding header for a file that no longer exists.
  19710. * ForwardingHeaders/JavaScriptCore/JSLock.h: Removed.
  19711. 2008-11-11 Mark Rowe <mrowe@apple.com>
  19712. Fix broken dependencies building JavaScriptCore on a freezing cold cat, caused
  19713. by failure to update all instances of "kjs" to their new locations.
  19714. * JavaScriptCore.xcodeproj/project.pbxproj:
  19715. 2008-11-11 Alexey Proskuryakov <ap@webkit.org>
  19716. Rubber-stamped by Adam Roben.
  19717. * wtf/AVLTree.h: (WTF::AVLTree::Iterator::start_iter):
  19718. Fix indentation a little more.
  19719. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19720. Rubber-stamped by Sam Weinig.
  19721. Clean up EvalCodeCache to match our coding style a bit more.
  19722. * VM/EvalCodeCache.h:
  19723. (JSC::EvalCodeCache::get):
  19724. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19725. Rubber-stamped by Sam Weinig.
  19726. Bug 22179: Move EvalCodeCache from CodeBlock.h into its own file
  19727. <https://bugs.webkit.org/show_bug.cgi?id=22179>
  19728. * GNUmakefile.am:
  19729. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  19730. * JavaScriptCore.xcodeproj/project.pbxproj:
  19731. * VM/CodeBlock.h:
  19732. * VM/EvalCodeCache.h: Copied from VM/CodeBlock.h.
  19733. * VM/Machine.cpp:
  19734. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19735. Reviewed by Sam Weinig.
  19736. Remove the 'm_' prefix from the fields of the SwitchRecord struct.
  19737. * VM/CTI.cpp:
  19738. (JSC::CTI::privateCompile):
  19739. * VM/CTI.h:
  19740. (JSC::SwitchRecord):
  19741. (JSC::SwitchRecord::SwitchRecord):
  19742. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19743. Rubber-stamped by Sam Weinig.
  19744. Make asInteger() a static function so that it has internal linkage.
  19745. * VM/CTI.cpp:
  19746. (JSC::asInteger):
  19747. 2008-11-11 Maciej Stachowiak <mjs@apple.com>
  19748. Reviewed by Mark Rowe.
  19749. - shrink CodeBlock and AST related Vectors to exact fit (5-10M savings on membuster test)
  19750. No perf regression combined with the last patch (each seems like a small regression individually)
  19751. * bytecompiler/CodeGenerator.cpp:
  19752. (JSC::CodeGenerator::generate):
  19753. * parser/Nodes.h:
  19754. (JSC::SourceElements::releaseContentsIntoVector):
  19755. * wtf/Vector.h:
  19756. (WTF::Vector::shrinkToFit):
  19757. 2008-11-11 Maciej Stachowiak <mjs@apple.com>
  19758. Reviewed by Mark Rowe.
  19759. - remove inline capacity from declaration stacks (15M savings on membuster test)
  19760. No perf regression on SunSpider or V8 test combined with other upcoming memory improvement patch.
  19761. * JavaScriptCore.exp:
  19762. * parser/Nodes.h:
  19763. 2008-11-11 Cameron Zwarich <zwarich@apple.com>
  19764. Reviewed by Oliver Hunt.
  19765. While r38286 removed the need for the m_callFrame member variable of
  19766. CTI, it should be also be removed.
  19767. * VM/CTI.h:
  19768. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19769. Reviewed by Oliver Hunt.
  19770. Make CTI::asInteger() a non-member function, since it needs no access to
  19771. any of CTI's member variables.
  19772. * VM/CTI.cpp:
  19773. (JSC::asInteger):
  19774. * VM/CTI.h:
  19775. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19776. Reviewed by Maciej Stachowiak.
  19777. Use 'value' instead of 'js' in CTI as a name for JSValue* to match our
  19778. usual convention elsewhere.
  19779. * VM/CTI.cpp:
  19780. (JSC::CTI::emitGetArg):
  19781. (JSC::CTI::emitGetPutArg):
  19782. (JSC::CTI::getConstantImmediateNumericArg):
  19783. (JSC::CTI::printOpcodeOperandTypes):
  19784. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19785. Reviewed by Maciej Stachowiak.
  19786. Make CTI::getConstant() a member function of CodeBlock instead.
  19787. * VM/CTI.cpp:
  19788. (JSC::CTI::emitGetArg):
  19789. (JSC::CTI::emitGetPutArg):
  19790. (JSC::CTI::getConstantImmediateNumericArg):
  19791. (JSC::CTI::printOpcodeOperandTypes):
  19792. (JSC::CTI::privateCompileMainPass):
  19793. * VM/CTI.h:
  19794. * VM/CodeBlock.h:
  19795. (JSC::CodeBlock::getConstant):
  19796. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19797. Reviewed by Sam Weinig.
  19798. Rename CodeBlock::isConstant() to isConstantRegisterIndex().
  19799. * VM/CTI.cpp:
  19800. (JSC::CTI::emitGetArg):
  19801. (JSC::CTI::emitGetPutArg):
  19802. (JSC::CTI::getConstantImmediateNumericArg):
  19803. (JSC::CTI::printOpcodeOperandTypes):
  19804. (JSC::CTI::privateCompileMainPass):
  19805. * VM/CodeBlock.h:
  19806. (JSC::CodeBlock::isConstantRegisterIndex):
  19807. * bytecompiler/CodeGenerator.cpp:
  19808. (JSC::CodeGenerator::emitEqualityOp):
  19809. 2008-11-10 Gavin Barraclough <barraclough@apple.com>
  19810. Build fix for non-CTI builds.
  19811. * VM/Machine.cpp:
  19812. (JSC::Machine::initialize):
  19813. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19814. Reviewed by Sam Weinig.
  19815. Remove the unused labels member variable of CodeBlock.
  19816. * VM/CodeBlock.h:
  19817. * VM/LabelID.h:
  19818. (JSC::LabelID::setLocation):
  19819. 2008-11-10 Gavin Barraclough <barraclough@apple.com>
  19820. Reviewed by Cameron Zwarich.
  19821. Batch compile the set of static trampolines at the point Machine is constructed, using a single allocation.
  19822. Refactor out m_callFrame from CTI, since this is only needed to access the global data (instead store a
  19823. pointer to the global data directly, since this is available at the point the Machine is constructed).
  19824. Add a method to align the code buffer, to allow JIT generation for multiple trampolines in one block.
  19825. * VM/CTI.cpp:
  19826. (JSC::CTI::getConstant):
  19827. (JSC::CTI::emitGetArg):
  19828. (JSC::CTI::emitGetPutArg):
  19829. (JSC::CTI::getConstantImmediateNumericArg):
  19830. (JSC::CTI::printOpcodeOperandTypes):
  19831. (JSC::CTI::CTI):
  19832. (JSC::CTI::compileBinaryArithOp):
  19833. (JSC::CTI::privateCompileMainPass):
  19834. (JSC::CTI::privateCompileGetByIdProto):
  19835. (JSC::CTI::privateCompileGetByIdChain):
  19836. (JSC::CTI::privateCompileCTIMachineTrampolines):
  19837. (JSC::CTI::freeCTIMachineTrampolines):
  19838. * VM/CTI.h:
  19839. (JSC::CTI::compile):
  19840. (JSC::CTI::compileGetByIdSelf):
  19841. (JSC::CTI::compileGetByIdProto):
  19842. (JSC::CTI::compileGetByIdChain):
  19843. (JSC::CTI::compilePutByIdReplace):
  19844. (JSC::CTI::compilePutByIdTransition):
  19845. (JSC::CTI::compileCTIMachineTrampolines):
  19846. (JSC::CTI::compilePatchGetArrayLength):
  19847. * VM/Machine.cpp:
  19848. (JSC::Machine::initialize):
  19849. (JSC::Machine::~Machine):
  19850. (JSC::Machine::execute):
  19851. (JSC::Machine::tryCTICachePutByID):
  19852. (JSC::Machine::tryCTICacheGetByID):
  19853. (JSC::Machine::cti_op_call_JSFunction):
  19854. (JSC::Machine::cti_vm_lazyLinkCall):
  19855. * VM/Machine.h:
  19856. * masm/X86Assembler.h:
  19857. (JSC::JITCodeBuffer::isAligned):
  19858. (JSC::X86Assembler::):
  19859. (JSC::X86Assembler::align):
  19860. * runtime/JSGlobalData.cpp:
  19861. (JSC::JSGlobalData::JSGlobalData):
  19862. 2008-11-10 Maciej Stachowiak <mjs@apple.com>
  19863. Reviewed by Antti Koivisto.
  19864. - Make Vector::clear() release the Vector's memory (1MB savings on membuster)
  19865. https://bugs.webkit.org/show_bug.cgi?id=22170
  19866. * wtf/Vector.h:
  19867. (WTF::VectorBufferBase::deallocateBuffer): Set capacity to 0 as
  19868. well as size, otherwise shrinking capacity to 0 can fail to reset
  19869. the capacity and thus cause a future crash.
  19870. (WTF::Vector::~Vector): Shrink size not capacity; we only need
  19871. to call destructors, the buffer will be freed anyway.
  19872. (WTF::Vector::clear): Change this to shrinkCapacity(0), not just shrink(0).
  19873. (WTF::::shrinkCapacity): Use shrink() instead of resize() for case where
  19874. the size is greater than the new capacity, to work with types that have no
  19875. default constructor.
  19876. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19877. Reviewed by Maciej Stachowiak.
  19878. Split multiple definitions into separate lines.
  19879. * VM/CTI.cpp:
  19880. (JSC::CTI::compileBinaryArithOp):
  19881. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19882. Reviewed by Geoff Garen.
  19883. Bug 22162: Remove cachedValueGetter from the JavaScriptCore API implementation
  19884. <https://bugs.webkit.org/show_bug.cgi?id=22162>
  19885. There is no more need for the cachedValueGetter hack now that we have
  19886. PropertySlot::setValue(), so we should remove it.
  19887. * API/JSCallbackObject.h:
  19888. * API/JSCallbackObjectFunctions.h:
  19889. (JSC::::getOwnPropertySlot):
  19890. 2008-11-10 Cameron Zwarich <zwarich@apple.com>
  19891. Reviewed by Darin Adler.
  19892. Bug 22152: Remove asObject() call from JSCallbackObject::getOwnPropertySlot()
  19893. <https://bugs.webkit.org/show_bug.cgi?id=22152>
  19894. With the recent change to adopt asType() style cast functions with
  19895. assertions instead of static_casts in many places, the assertion for
  19896. the asObject() call in JSCallbackObject::getOwnPropertySlot() has been
  19897. failing when using any nontrivial client of the JavaScriptCore API.
  19898. The cast isn't even necessary to call slot.setCustom(), so it should
  19899. be removed.
  19900. * API/JSCallbackObjectFunctions.h:
  19901. (JSC::JSCallbackObject::getOwnPropertySlot):
  19902. 2008-11-10 Alexey Proskuryakov <ap@webkit.org>
  19903. Reviewed by Adam Roben.
  19904. A few coding style fixes for AVLTree.
  19905. * wtf/AVLTree.h: Moved to WTF namespace, Removed "KJS_" from include guards.
  19906. (WTF::AVLTree::Iterator::start_iter): Fixed indentation
  19907. * runtime/JSArray.cpp: Added "using namepace WTF".
  19908. 2008-11-09 Cameron Zwarich <zwarich@apple.com>
  19909. Not reviewed.
  19910. Speculatively fix the non-AllInOne build.
  19911. * runtime/NativeErrorConstructor.cpp:
  19912. 2008-11-09 Darin Adler <darin@apple.com>
  19913. Reviewed by Tim Hatcher.
  19914. - https://bugs.webkit.org/show_bug.cgi?id=22149
  19915. remove unused code from the parser
  19916. * AllInOneFile.cpp: Removed nodes2string.cpp.
  19917. * GNUmakefile.am: Ditto.
  19918. * JavaScriptCore.exp: Ditto.
  19919. * JavaScriptCore.pri: Ditto.
  19920. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
  19921. * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  19922. * JavaScriptCoreSources.bkl: Ditto.
  19923. * VM/CodeBlock.h: Added include.
  19924. * VM/Machine.cpp: (JSC::Machine::execute): Use the types from
  19925. DeclarationStacks as DeclarationStacks:: rather than Node:: since
  19926. "Node" really has little to do with it.
  19927. * bytecompiler/CodeGenerator.cpp:
  19928. (JSC::CodeGenerator::CodeGenerator): Ditto.
  19929. * jsc.cpp:
  19930. (Options::Options): Removed prettyPrint option.
  19931. (runWithScripts): Ditto.
  19932. (printUsageStatement): Ditto.
  19933. (parseArguments): Ditto.
  19934. (jscmain): Ditto.
  19935. * parser/Grammar.y: Removed use of obsolete ImmediateNumberNode.
  19936. * parser/Nodes.cpp:
  19937. (JSC::ThrowableExpressionData::emitThrowError): Use inline functions
  19938. instead of direct member access for ThrowableExpressionData values.
  19939. (JSC::BracketAccessorNode::emitCode): Ditto.
  19940. (JSC::DotAccessorNode::emitCode): Ditto.
  19941. (JSC::NewExprNode::emitCode): Ditto.
  19942. (JSC::EvalFunctionCallNode::emitCode): Ditto.
  19943. (JSC::FunctionCallValueNode::emitCode): Ditto.
  19944. (JSC::FunctionCallResolveNode::emitCode): Ditto.
  19945. (JSC::FunctionCallBracketNode::emitCode): Ditto.
  19946. (JSC::FunctionCallDotNode::emitCode): Ditto.
  19947. (JSC::PostfixResolveNode::emitCode): Ditto.
  19948. (JSC::PostfixBracketNode::emitCode): Ditto.
  19949. (JSC::PostfixDotNode::emitCode): Ditto.
  19950. (JSC::DeleteResolveNode::emitCode): Ditto.
  19951. (JSC::DeleteBracketNode::emitCode): Ditto.
  19952. (JSC::DeleteDotNode::emitCode): Ditto.
  19953. (JSC::PrefixResolveNode::emitCode): Ditto.
  19954. (JSC::PrefixBracketNode::emitCode): Ditto.
  19955. (JSC::PrefixDotNode::emitCode): Ditto.
  19956. (JSC::ThrowableBinaryOpNode::emitCode): Ditto.
  19957. (JSC::InstanceOfNode::emitCode): Ditto.
  19958. (JSC::ReadModifyResolveNode::emitCode): Ditto.
  19959. (JSC::AssignResolveNode::emitCode): Ditto.
  19960. (JSC::AssignDotNode::emitCode): Ditto.
  19961. (JSC::ReadModifyDotNode::emitCode): Ditto.
  19962. (JSC::AssignBracketNode::emitCode): Ditto.
  19963. (JSC::ReadModifyBracketNode::emitCode): Ditto.
  19964. (JSC::statementListEmitCode): Take a const StatementVector instead
  19965. of a non-const one. Also removed unused statementListPushFIFO.
  19966. (JSC::ForInNode::emitCode): Inline functions instead of member access.
  19967. (JSC::ThrowNode::emitCode): Ditto.
  19968. (JSC::EvalNode::emitCode): Ditto.
  19969. (JSC::FunctionBodyNode::emitCode): Ditto.
  19970. (JSC::ProgramNode::emitCode): Ditto.
  19971. * parser/Nodes.h: Removed unused includes and forward declarations.
  19972. Removed Precedence enum. Made many more members private instead of
  19973. protected or public. Removed unused NodeStack typedef. Moved the
  19974. VarStack and FunctionStack typedefs from Node to ScopeNode. Made
  19975. Node::emitCode pure virtual and changed classes that don't emit
  19976. any code to inherit from ParserRefCounted rather than Node.
  19977. Moved isReturnNode from Node to StatementNode. Removed the
  19978. streamTo, precedence, and needsParensIfLeftmost functions from
  19979. all classes. Removed the ImmediateNumberNode class and make
  19980. NumberNode::setValue nonvirtual.
  19981. * parser/nodes2string.cpp: Removed.
  19982. 2008-11-09 Darin Adler <darin@apple.com>
  19983. Reviewed by Sam Weinig and Maciej Stachowiak.
  19984. Includes some work done by Chris Brichford.
  19985. - fix https://bugs.webkit.org/show_bug.cgi?id=14886
  19986. Stack overflow due to deeply nested parse tree doing repeated string concatentation
  19987. Test: fast/js/large-expressions.html
  19988. 1) Code generation is recursive, so takes stack proportional to the complexity
  19989. of the source code expression. Fixed by setting an arbitrary recursion limit
  19990. of 10,000 nodes.
  19991. 2) Destruction of the syntax tree was recursive. Fixed by introducing a
  19992. non-recursive mechanism for destroying the tree.
  19993. * bytecompiler/CodeGenerator.cpp:
  19994. (JSC::CodeGenerator::CodeGenerator): Initialize depth to 0.
  19995. (JSC::CodeGenerator::emitThrowExpressionTooDeepException): Added. Emits the code
  19996. to throw a "too deep" exception.
  19997. * bytecompiler/CodeGenerator.h:
  19998. (JSC::CodeGenerator::emitNode): Check depth and emit an exception if we exceed
  19999. the maximum depth.
  20000. * parser/Nodes.cpp:
  20001. (JSC::NodeReleaser::releaseAllNodes): Added. To be called inside node destructors
  20002. to avoid recursive calls to destructors for nodes inside this one.
  20003. (JSC::NodeReleaser::release): Added. To be called inside releaseNodes functions.
  20004. Also added releaseNodes functions and calls to releaseAllNodes inside destructors
  20005. for each class derived from Node that has RefPtr to other nodes.
  20006. (JSC::NodeReleaser::adopt): Added. Used by the release function.
  20007. (JSC::NodeReleaser::adoptFunctionBodyNode): Added.
  20008. * parser/Nodes.h: Added declarations of releaseNodes and destructors in all classes
  20009. that needed it. Eliminated use of ListRefPtr and releaseNext, which are the two parts
  20010. of an older solution to the non-recursive destruction problem that works only for
  20011. lists, whereas the new solution works for other graphs. Changed ReverseBinaryOpNode
  20012. to use BinaryOpNode as a base class to avoid some duplicated code.
  20013. 2008-11-08 Kevin Ollivier <kevino@theolliviers.com>
  20014. wx build fixes after addition of JSCore parser and bycompiler dirs. Also cleanup
  20015. the JSCore Bakefile's group names to be consistent.
  20016. * JavaScriptCoreSources.bkl:
  20017. * jscore.bkl:
  20018. 2008-11-07 Cameron Zwarich <zwarich@apple.com>
  20019. Reviewed by Geoff Garen.
  20020. Bug 21801: REGRESSION (r37821): YUI date formatting JavaScript puts the letter 'd' in place of the day
  20021. <https://bugs.webkit.org/show_bug.cgi?id=21801>
  20022. Fix the constant register check in the 'typeof' optimization in
  20023. CodeGenerator, which was completely broken after r37821.
  20024. * bytecompiler/CodeGenerator.cpp:
  20025. (JSC::CodeGenerator::emitEqualityOp):
  20026. 2008-11-07 Cameron Zwarich <zwarich@apple.com>
  20027. Reviewed by Geoff Garen.
  20028. Bug 22129: Move CTI::isConstant() to CodeBlock
  20029. <https://bugs.webkit.org/show_bug.cgi?id=22129>
  20030. * VM/CTI.cpp:
  20031. (JSC::CTI::emitGetArg):
  20032. (JSC::CTI::emitGetPutArg):
  20033. (JSC::CTI::getConstantImmediateNumericArg):
  20034. (JSC::CTI::printOpcodeOperandTypes):
  20035. (JSC::CTI::privateCompileMainPass):
  20036. * VM/CTI.h:
  20037. * VM/CodeBlock.h:
  20038. (JSC::CodeBlock::isConstant):
  20039. 2008-11-07 Alp Toker <alp@nuanti.com>
  20040. autotools fix. Always use the configured perl binary (which may be
  20041. different to the one in $PATH) when generating sources.
  20042. * GNUmakefile.am:
  20043. 2008-11-07 Cameron Zwarich <zwarich@apple.com>
  20044. Not reviewed.
  20045. Change grammar.cpp to Grammar.cpp and grammar.h to Grammar.h in several
  20046. build scripts.
  20047. * DerivedSources.make:
  20048. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20049. * JavaScriptCoreSources.bkl:
  20050. 2008-11-07 Alp Toker <alp@nuanti.com>
  20051. More grammar.cpp -> Grammar.cpp build fixes.
  20052. * AllInOneFile.cpp:
  20053. * GNUmakefile.am:
  20054. 2008-11-07 Simon Hausmann <hausmann@webkit.org>
  20055. Fix the build on case-sensitive file systems. grammar.y was renamed to
  20056. Grammar.y but Lexer.cpp includes grammar.h. The build bots didn't
  20057. notice this change because of stale files.
  20058. * parser/Lexer.cpp:
  20059. 2008-11-07 Cameron Zwarich <zwarich@apple.com>
  20060. Reviewed by Alexey Proskuryakov.
  20061. Rename the m_nextGlobal, m_nextParameter, and m_nextConstant member
  20062. variables of CodeGenerator to m_nextGlobalIndex, m_nextParameterIndex,
  20063. and m_nextConstantIndex respectively. This is to distinguish these from
  20064. member variables like m_lastConstant, which are actually RefPtrs to
  20065. Registers.
  20066. * bytecompiler/CodeGenerator.cpp:
  20067. (JSC::CodeGenerator::addGlobalVar):
  20068. (JSC::CodeGenerator::allocateConstants):
  20069. (JSC::CodeGenerator::CodeGenerator):
  20070. (JSC::CodeGenerator::addParameter):
  20071. (JSC::CodeGenerator::addConstant):
  20072. * bytecompiler/CodeGenerator.h:
  20073. 2008-11-06 Gavin Barraclough barraclough@apple.com
  20074. Reviewed by Oliver Hunt.
  20075. Do not make a cti_* call to perform an op_call unless either:
  20076. (1) The codeblock for the function body has not been generated.
  20077. (2) The number of arguments passed does not match the callee arity.
  20078. ~1% progression on sunspider --v8
  20079. * VM/CTI.cpp:
  20080. (JSC::CTI::compileOpCallInitializeCallFrame):
  20081. (JSC::CTI::compileOpCall):
  20082. (JSC::CTI::privateCompileSlowCases):
  20083. * VM/CTI.h:
  20084. * VM/Machine.cpp:
  20085. (JSC::Machine::cti_op_call_JSFunction):
  20086. (JSC::Machine::cti_op_call_arityCheck):
  20087. (JSC::Machine::cti_op_construct_JSConstruct):
  20088. * VM/Machine.h:
  20089. * kjs/nodes.h:
  20090. 2008-11-06 Cameron Zwarich <zwarich@apple.com>
  20091. Reviewed by Geoff Garen.
  20092. Move the remaining files in the kjs subdirectory of JavaScriptCore to
  20093. a new parser subdirectory, and remove the kjs subdirectory entirely.
  20094. * AllInOneFile.cpp:
  20095. * DerivedSources.make:
  20096. * GNUmakefile.am:
  20097. * JavaScriptCore.pri:
  20098. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20099. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  20100. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  20101. * JavaScriptCore.xcodeproj/project.pbxproj:
  20102. * JavaScriptCoreSources.bkl:
  20103. * VM/CodeBlock.h:
  20104. * VM/ExceptionHelpers.cpp:
  20105. * VM/SamplingTool.h:
  20106. * bytecompiler/CodeGenerator.h:
  20107. * jsc.pro:
  20108. * jscore.bkl:
  20109. * kjs: Removed.
  20110. * kjs/NodeInfo.h: Removed.
  20111. * kjs/Parser.cpp: Removed.
  20112. * kjs/Parser.h: Removed.
  20113. * kjs/ResultType.h: Removed.
  20114. * kjs/SourceCode.h: Removed.
  20115. * kjs/SourceProvider.h: Removed.
  20116. * kjs/grammar.y: Removed.
  20117. * kjs/keywords.table: Removed.
  20118. * kjs/lexer.cpp: Removed.
  20119. * kjs/lexer.h: Removed.
  20120. * kjs/nodes.cpp: Removed.
  20121. * kjs/nodes.h: Removed.
  20122. * kjs/nodes2string.cpp: Removed.
  20123. * parser: Added.
  20124. * parser/Grammar.y: Copied from kjs/grammar.y.
  20125. * parser/Keywords.table: Copied from kjs/keywords.table.
  20126. * parser/Lexer.cpp: Copied from kjs/lexer.cpp.
  20127. * parser/Lexer.h: Copied from kjs/lexer.h.
  20128. * parser/NodeInfo.h: Copied from kjs/NodeInfo.h.
  20129. * parser/Nodes.cpp: Copied from kjs/nodes.cpp.
  20130. * parser/Nodes.h: Copied from kjs/nodes.h.
  20131. * parser/Parser.cpp: Copied from kjs/Parser.cpp.
  20132. * parser/Parser.h: Copied from kjs/Parser.h.
  20133. * parser/ResultType.h: Copied from kjs/ResultType.h.
  20134. * parser/SourceCode.h: Copied from kjs/SourceCode.h.
  20135. * parser/SourceProvider.h: Copied from kjs/SourceProvider.h.
  20136. * parser/nodes2string.cpp: Copied from kjs/nodes2string.cpp.
  20137. * pcre/pcre.pri:
  20138. * pcre/pcre_exec.cpp:
  20139. * runtime/FunctionConstructor.cpp:
  20140. * runtime/JSActivation.h:
  20141. * runtime/JSFunction.h:
  20142. * runtime/JSGlobalData.cpp:
  20143. * runtime/JSGlobalObjectFunctions.cpp:
  20144. * runtime/JSObject.cpp:
  20145. (JSC::JSObject::toNumber):
  20146. * runtime/RegExp.cpp:
  20147. 2008-11-06 Adam Roben <aroben@apple.com>
  20148. Windows build fix after r38196
  20149. * JavaScriptCore.vcproj/jsc/jsc.vcproj: Added bytecompiler/ to the
  20150. include path.
  20151. 2008-11-06 Cameron Zwarich <zwarich@apple.com>
  20152. Rubber-stamped by Sam Weinig.
  20153. Create a new bytecompiler subdirectory of JavaScriptCore and move some
  20154. relevant files to it.
  20155. * AllInOneFile.cpp:
  20156. * GNUmakefile.am:
  20157. * JavaScriptCore.pri:
  20158. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20159. * JavaScriptCore.xcodeproj/project.pbxproj:
  20160. * JavaScriptCoreSources.bkl:
  20161. * VM/CodeGenerator.cpp: Removed.
  20162. * VM/CodeGenerator.h: Removed.
  20163. * bytecompiler: Added.
  20164. * bytecompiler/CodeGenerator.cpp: Copied from VM/CodeGenerator.cpp.
  20165. * bytecompiler/CodeGenerator.h: Copied from VM/CodeGenerator.h.
  20166. * bytecompiler/LabelScope.h: Copied from kjs/LabelScope.h.
  20167. * jscore.bkl:
  20168. * kjs/LabelScope.h: Removed.
  20169. 2008-11-06 Adam Roben <aroben@apple.com>
  20170. Windows clean build fix after r38155
  20171. Rubberstamped by Cameron Zwarich.
  20172. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
  20173. the post-build event for the move of create_hash_table out of kjs/.
  20174. 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  20175. Reviewed by Darin Adler.
  20176. https://bugs.webkit.org/show_bug.cgi?id=22107
  20177. Bug uncovered during RVCT port in functions not used. get_lt() and
  20178. get_gt() takes only one argument - remove second argument where
  20179. applicable.
  20180. * wtf/AVLTree.h:
  20181. (JSC::AVLTree::remove): Remove second argument of get_lt/get_gt().
  20182. (JSC::AVLTree::subst): Ditto.
  20183. 2008-11-06 Alp Toker <alp@nuanti.com>
  20184. Reviewed by Cameron Zwarich.
  20185. https://bugs.webkit.org/show_bug.cgi?id=22033
  20186. [GTK] CTI/Linux r38064 crashes; JIT requires executable memory
  20187. Mark pages allocated by the FastMalloc mmap code path executable with
  20188. PROT_EXEC. This fixes crashes seen on CPUs and kernels that enforce
  20189. non-executable memory (like ExecShield on Fedora Linux) when the JIT
  20190. is enabled.
  20191. This patch does not resolve the issue on debug builds so affected
  20192. developers may still need to pass --disable-jit to configure.
  20193. * wtf/TCSystemAlloc.cpp:
  20194. (TryMmap):
  20195. (TryDevMem):
  20196. (TCMalloc_SystemRelease):
  20197. 2008-11-06 Peter Gal <galpeter@inf.u-szeged.hu>
  20198. Reviewed by Cameron Zwarich.
  20199. Bug 22099: Make the Qt port build the JSC shell in the correct place
  20200. <https://bugs.webkit.org/show_bug.cgi?id=22099>
  20201. Adjust include paths and build destination dir for the 'jsc' executable
  20202. in the Qt build.
  20203. * jsc.pro:
  20204. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20205. Reviewed by Simon Hausmann.
  20206. Implemented the block allocation on Symbian through heap allocation.
  20207. Unfortunately there is no way to allocate virtual memory. The Posix
  20208. layer provides mmap() but no anonymous mapping. So this is a very slow
  20209. solution but it should work as a start.
  20210. * runtime/Collector.cpp:
  20211. (JSC::allocateBlock):
  20212. (JSC::freeBlock):
  20213. 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  20214. Reviewed by Simon Hausmann.
  20215. Borrow some math functions from the MSVC port to the build with the
  20216. RVCT compiler.
  20217. * wtf/MathExtras.h:
  20218. (isinf):
  20219. (isnan):
  20220. (signbit):
  20221. 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  20222. Reviewed by Simon Hausmann.
  20223. Include strings.h for strncasecmp().
  20224. This is needed for compilation inside Symbian and it is also
  20225. confirmed by the man-page on Linux.
  20226. * runtime/DateMath.cpp:
  20227. 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
  20228. Reviewed by Simon Hausmann.
  20229. Implemented currentThreadStackBase for Symbian.
  20230. * runtime/Collector.cpp:
  20231. (JSC::currentThreadStackBase):
  20232. 2008-11-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
  20233. Reviewed by Simon Hausmann.
  20234. RVCT does not support tm_gmtoff field, so disable that code just like
  20235. for MSVC.
  20236. * runtime/DateMath.h:
  20237. (JSC::GregorianDateTime::GregorianDateTime):
  20238. (JSC::GregorianDateTime::operator tm):
  20239. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20240. Reviewed by Simon Hausmann.
  20241. Define PLATFORM(UNIX) for S60. Effectively WebKit on S60 is compiled
  20242. on top of the Posix layer.
  20243. * wtf/Platform.h:
  20244. 2008-11-06 Norbert Leser <norbert.leser@nokia.com>
  20245. Reviewed by Simon Hausmann.
  20246. Added __SYMBIAN32__ condition for defining PLATFORM(SYMBIAN).
  20247. * wtf/Platform.h:
  20248. 2008-11-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
  20249. Reviewed by Simon Hausmann.
  20250. Added WINSCW compiler define for Symbian S60.
  20251. * wtf/Platform.h:
  20252. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20253. Reviewed by Simon Hausmann.
  20254. Use the GCC defines of the WTF_ALIGN* macros for the RVCT and the
  20255. MINSCW compiler.
  20256. * wtf/Vector.h:
  20257. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20258. Reviewed by Simon Hausmann.
  20259. Define capabilities of the SYMBIAN platform. Some of the system
  20260. headers are actually dependent on RVCT.
  20261. * wtf/Platform.h:
  20262. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20263. Reviewed by Simon Hausmann.
  20264. Add missing stddef.h header needed for compilation in Symbian.
  20265. * runtime/Collector.h:
  20266. 2008-11-06 Kristian Amlie <kristian.amlie@nokia.com>
  20267. Reviewed by Simon Hausmann.
  20268. Added COMPILER(RVCT) to detect the ARM RVCT compiler used in the Symbian environment.
  20269. * wtf/Platform.h:
  20270. 2008-11-06 Simon Hausmann <hausmann@webkit.org>
  20271. Fix the Qt build, adjust include paths after move of jsc.pro.
  20272. * jsc.pro:
  20273. 2008-11-06 Cameron Zwarich <zwarich@apple.com>
  20274. Rubber-stamped by Sam Weinig.
  20275. Move kjs/Shell.cpp to the top level of the JavaScriptCore directory and
  20276. rename it to jsc.cpp to reflect the name of the binary compiled from it.
  20277. * GNUmakefile.am:
  20278. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  20279. * JavaScriptCore.xcodeproj/project.pbxproj:
  20280. * jsc.cpp: Copied from kjs/Shell.cpp.
  20281. * jsc.pro:
  20282. * jscore.bkl:
  20283. * kjs/Shell.cpp: Removed.
  20284. 2008-11-06 Cameron Zwarich <zwarich@apple.com>
  20285. Rubber-stamped by Sam Weinig.
  20286. Move create_hash_table and jsc.pro out of the kjs directory and into the
  20287. root directory of JavaScriptCore.
  20288. * DerivedSources.make:
  20289. * JavaScriptCore.pri:
  20290. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20291. * JavaScriptCore.xcodeproj/project.pbxproj:
  20292. * create_hash_table: Copied from kjs/create_hash_table.
  20293. * jsc.pro: Copied from kjs/jsc.pro.
  20294. * kjs/create_hash_table: Removed.
  20295. * kjs/jsc.pro: Removed.
  20296. * make-generated-sources.sh:
  20297. 2008-11-05 Gavin Barraclough <barraclough@apple.com>
  20298. Reviewed by Maciej Stachowiak.
  20299. https://bugs.webkit.org/show_bug.cgi?id=22094
  20300. Fix for bug where the callee incorrectly recieves the caller's lexical
  20301. global object as this, rather than its own. Implementation closely
  20302. follows the spec, passing jsNull, checking in the callee and replacing
  20303. with the global object where necessary.
  20304. * VM/CTI.cpp:
  20305. (JSC::CTI::compileOpCall):
  20306. * VM/Machine.cpp:
  20307. (JSC::Machine::cti_op_call_NotJSFunction):
  20308. (JSC::Machine::cti_op_call_eval):
  20309. * runtime/JSCell.h:
  20310. (JSC::JSValue::toThisObject):
  20311. * runtime/JSImmediate.cpp:
  20312. (JSC::JSImmediate::toThisObject):
  20313. * runtime/JSImmediate.h:
  20314. 2008-11-05 Kevin Ollivier <kevino@theolliviers.com>
  20315. wx build fix after Operations.cpp move.
  20316. * JavaScriptCoreSources.bkl:
  20317. 2008-11-05 Cameron Zwarich <zwarich@apple.com>
  20318. Not reviewed.
  20319. Fix the build for case-sensitive build systems and wxWindows.
  20320. * JavaScriptCoreSources.bkl:
  20321. * kjs/create_hash_table:
  20322. 2008-11-05 Cameron Zwarich <zwarich@apple.com>
  20323. Not reviewed.
  20324. Fix the build for case-sensitive build systems.
  20325. * JavaScriptCoreSources.bkl:
  20326. * kjs/Shell.cpp:
  20327. * runtime/Interpreter.cpp:
  20328. * runtime/JSArray.cpp:
  20329. 2008-11-05 Cameron Zwarich <zwarich@apple.com>
  20330. Not reviewed.
  20331. Fix the build for case-sensitive build systems.
  20332. * API/JSBase.cpp:
  20333. * API/JSObjectRef.cpp:
  20334. * runtime/CommonIdentifiers.h:
  20335. * runtime/Identifier.cpp:
  20336. * runtime/InitializeThreading.cpp:
  20337. * runtime/InternalFunction.h:
  20338. * runtime/JSString.h:
  20339. * runtime/Lookup.h:
  20340. * runtime/PropertyNameArray.h:
  20341. * runtime/PropertySlot.h:
  20342. * runtime/StructureID.cpp:
  20343. * runtime/StructureID.h:
  20344. * runtime/UString.cpp:
  20345. 2008-11-05 Cameron Zwarich <zwarich@apple.com>
  20346. Rubber-stamped by Sam Weinig.
  20347. Move more files to the runtime subdirectory of JavaScriptCore.
  20348. * API/APICast.h:
  20349. * API/JSBase.cpp:
  20350. * API/JSCallbackObject.cpp:
  20351. * API/JSClassRef.cpp:
  20352. * API/JSClassRef.h:
  20353. * API/JSStringRefCF.cpp:
  20354. * API/JSValueRef.cpp:
  20355. * API/OpaqueJSString.cpp:
  20356. * API/OpaqueJSString.h:
  20357. * AllInOneFile.cpp:
  20358. * GNUmakefile.am:
  20359. * JavaScriptCore.pri:
  20360. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20361. * JavaScriptCore.xcodeproj/project.pbxproj:
  20362. * JavaScriptCoreSources.bkl:
  20363. * VM/CodeBlock.h:
  20364. * VM/CodeGenerator.cpp:
  20365. * VM/Machine.cpp:
  20366. * VM/RegisterFile.h:
  20367. * debugger/Debugger.h:
  20368. * kjs/SourceProvider.h:
  20369. * kjs/TypeInfo.h: Removed.
  20370. * kjs/collector.cpp: Removed.
  20371. * kjs/collector.h: Removed.
  20372. * kjs/completion.h: Removed.
  20373. * kjs/create_hash_table:
  20374. * kjs/identifier.cpp: Removed.
  20375. * kjs/identifier.h: Removed.
  20376. * kjs/interpreter.cpp: Removed.
  20377. * kjs/interpreter.h: Removed.
  20378. * kjs/lexer.cpp:
  20379. * kjs/lexer.h:
  20380. * kjs/lookup.cpp: Removed.
  20381. * kjs/lookup.h: Removed.
  20382. * kjs/nodes.cpp:
  20383. * kjs/nodes.h:
  20384. * kjs/operations.cpp: Removed.
  20385. * kjs/operations.h: Removed.
  20386. * kjs/protect.h: Removed.
  20387. * kjs/regexp.cpp: Removed.
  20388. * kjs/regexp.h: Removed.
  20389. * kjs/ustring.cpp: Removed.
  20390. * kjs/ustring.h: Removed.
  20391. * pcre/pcre_exec.cpp:
  20392. * profiler/CallIdentifier.h:
  20393. * profiler/Profile.h:
  20394. * runtime/ArrayConstructor.cpp:
  20395. * runtime/ArrayPrototype.cpp:
  20396. * runtime/ArrayPrototype.h:
  20397. * runtime/Collector.cpp: Copied from kjs/collector.cpp.
  20398. * runtime/Collector.h: Copied from kjs/collector.h.
  20399. * runtime/CollectorHeapIterator.h:
  20400. * runtime/Completion.h: Copied from kjs/completion.h.
  20401. * runtime/ErrorPrototype.cpp:
  20402. * runtime/Identifier.cpp: Copied from kjs/identifier.cpp.
  20403. * runtime/Identifier.h: Copied from kjs/identifier.h.
  20404. * runtime/InitializeThreading.cpp:
  20405. * runtime/Interpreter.cpp: Copied from kjs/interpreter.cpp.
  20406. * runtime/Interpreter.h: Copied from kjs/interpreter.h.
  20407. * runtime/JSCell.h:
  20408. * runtime/JSGlobalData.cpp:
  20409. * runtime/JSGlobalData.h:
  20410. * runtime/JSLock.cpp:
  20411. * runtime/JSNumberCell.cpp:
  20412. * runtime/JSNumberCell.h:
  20413. * runtime/JSObject.cpp:
  20414. * runtime/JSValue.h:
  20415. * runtime/Lookup.cpp: Copied from kjs/lookup.cpp.
  20416. * runtime/Lookup.h: Copied from kjs/lookup.h.
  20417. * runtime/MathObject.cpp:
  20418. * runtime/NativeErrorPrototype.cpp:
  20419. * runtime/NumberPrototype.cpp:
  20420. * runtime/Operations.cpp: Copied from kjs/operations.cpp.
  20421. * runtime/Operations.h: Copied from kjs/operations.h.
  20422. * runtime/PropertyMapHashTable.h:
  20423. * runtime/Protect.h: Copied from kjs/protect.h.
  20424. * runtime/RegExp.cpp: Copied from kjs/regexp.cpp.
  20425. * runtime/RegExp.h: Copied from kjs/regexp.h.
  20426. * runtime/RegExpConstructor.cpp:
  20427. * runtime/RegExpObject.h:
  20428. * runtime/RegExpPrototype.cpp:
  20429. * runtime/SmallStrings.h:
  20430. * runtime/StringObjectThatMasqueradesAsUndefined.h:
  20431. * runtime/StructureID.cpp:
  20432. * runtime/StructureID.h:
  20433. * runtime/StructureIDTransitionTable.h:
  20434. * runtime/SymbolTable.h:
  20435. * runtime/TypeInfo.h: Copied from kjs/TypeInfo.h.
  20436. * runtime/UString.cpp: Copied from kjs/ustring.cpp.
  20437. * runtime/UString.h: Copied from kjs/ustring.h.
  20438. * wrec/CharacterClassConstructor.h:
  20439. * wrec/WREC.h:
  20440. 2008-11-05 Geoffrey Garen <ggaren@apple.com>
  20441. Suggested by Darin Adler.
  20442. Removed two copy constructors that the compiler can generate for us
  20443. automatically.
  20444. * VM/LabelID.h:
  20445. (JSC::LabelID::setLocation):
  20446. (JSC::LabelID::offsetFrom):
  20447. (JSC::LabelID::ref):
  20448. (JSC::LabelID::refCount):
  20449. * kjs/LabelScope.h:
  20450. 2008-11-05 Anders Carlsson <andersca@apple.com>
  20451. Fix Snow Leopard build.
  20452. * JavaScriptCore.xcodeproj/project.pbxproj:
  20453. 2008-11-04 Cameron Zwarich <zwarich@apple.com>
  20454. Rubber-stamped by Steve Falkenburg.
  20455. Move dtoa.cpp and dtoa.h to the WTF Visual Studio project to reflect
  20456. their movement in the filesystem.
  20457. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20458. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  20459. 2008-11-04 Cameron Zwarich <zwarich@apple.com>
  20460. Rubber-stamped by Sam Weinig.
  20461. Move kjs/dtoa.h to the wtf subdirectory of JavaScriptCore.
  20462. * AllInOneFile.cpp:
  20463. * GNUmakefile.am:
  20464. * JavaScriptCore.pri:
  20465. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20466. * JavaScriptCore.xcodeproj/project.pbxproj:
  20467. * JavaScriptCoreSources.bkl:
  20468. * kjs/dtoa.cpp: Removed.
  20469. * kjs/dtoa.h: Removed.
  20470. * wtf/dtoa.cpp: Copied from kjs/dtoa.cpp.
  20471. * wtf/dtoa.h: Copied from kjs/dtoa.h.
  20472. 2008-11-04 Cameron Zwarich <zwarich@apple.com>
  20473. Rubber-stamped by Sam Weinig.
  20474. Move kjs/config.h to the top level of JavaScriptCore.
  20475. * GNUmakefile.am:
  20476. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20477. * JavaScriptCore.xcodeproj/project.pbxproj:
  20478. * config.h: Copied from kjs/config.h.
  20479. * kjs/config.h: Removed.
  20480. 2008-11-04 Darin Adler <darin@apple.com>
  20481. Reviewed by Tim Hatcher.
  20482. * wtf/ThreadingNone.cpp: Tweak formatting.
  20483. 2008-11-03 Darin Adler <darin@apple.com>
  20484. Reviewed by Tim Hatcher.
  20485. - https://bugs.webkit.org/show_bug.cgi?id=22061
  20486. create script to check for exit-time destructors
  20487. * JavaScriptCore.exp: Changed to export functions rather than
  20488. a global for the atomically initialized static mutex.
  20489. * JavaScriptCore.xcodeproj/project.pbxproj: Added a script
  20490. phase that runs the check-for-exit-time-destructors script.
  20491. * wtf/MainThread.cpp:
  20492. (WTF::mainThreadFunctionQueueMutex): Changed to leak an object
  20493. rather than using an exit time destructor.
  20494. (WTF::functionQueue): Ditto.
  20495. * wtf/unicode/icu/CollatorICU.cpp:
  20496. (WTF::cachedCollatorMutex): Ditto.
  20497. * wtf/Threading.h: Changed other platforms to share the Windows
  20498. approach where the mutex is internal and the functions are exported.
  20499. * wtf/ThreadingGtk.cpp:
  20500. (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
  20501. (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
  20502. * wtf/ThreadingNone.cpp:
  20503. (WTF::lockAtomicallyInitializedStaticMutex): Ditto.
  20504. (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
  20505. * wtf/ThreadingPthreads.cpp:
  20506. (WTF::threadMapMutex): Changed to leak an object rather than using
  20507. an exit time destructor.
  20508. (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
  20509. (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
  20510. (WTF::threadMap): Changed to leak an object rather than using
  20511. an exit time destructor.
  20512. * wtf/ThreadingQt.cpp:
  20513. (WTF::lockAtomicallyInitializedStaticMutex): Mutex change.
  20514. (WTF::unlockAtomicallyInitializedStaticMutex): Ditto.
  20515. * wtf/ThreadingWin.cpp:
  20516. (WTF::lockAtomicallyInitializedStaticMutex): Added an assertion.
  20517. 2008-11-04 Adam Roben <aroben@apple.com>
  20518. Windows build fix
  20519. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Update
  20520. the location of JSStaticScopeObject.{cpp,h}.
  20521. 2008-11-04 Cameron Zwarich <zwarich@apple.com>
  20522. Reviewed by Alexey Proskuryakov.
  20523. Move AllInOneFile.cpp to the top level of JavaScriptCore.
  20524. * AllInOneFile.cpp: Copied from kjs/AllInOneFile.cpp.
  20525. * GNUmakefile.am:
  20526. * JavaScriptCore.xcodeproj/project.pbxproj:
  20527. * kjs/AllInOneFile.cpp: Removed.
  20528. 2008-11-04 Cameron Zwarich <zwarich@apple.com>
  20529. Rubber-stamped by Alexey Proskuryakov.
  20530. Add NodeInfo.h to the JavaScriptCore Xcode project.
  20531. * JavaScriptCore.xcodeproj/project.pbxproj:
  20532. 2008-11-03 Cameron Zwarich <zwarich@apple.com>
  20533. Rubber-stamped by Maciej Stachowiak.
  20534. Move more files into the runtime subdirectory of JavaScriptCore.
  20535. * API/JSBase.cpp:
  20536. * API/JSCallbackConstructor.cpp:
  20537. * API/JSCallbackFunction.cpp:
  20538. * API/JSClassRef.cpp:
  20539. * API/OpaqueJSString.cpp:
  20540. * GNUmakefile.am:
  20541. * JavaScriptCore.pri:
  20542. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20543. * JavaScriptCore.xcodeproj/project.pbxproj:
  20544. * JavaScriptCoreSources.bkl:
  20545. * kjs/AllInOneFile.cpp:
  20546. * kjs/ArgList.cpp: Removed.
  20547. * kjs/ArgList.h: Removed.
  20548. * kjs/Arguments.cpp: Removed.
  20549. * kjs/Arguments.h: Removed.
  20550. * kjs/BatchedTransitionOptimizer.h: Removed.
  20551. * kjs/CollectorHeapIterator.h: Removed.
  20552. * kjs/CommonIdentifiers.cpp: Removed.
  20553. * kjs/CommonIdentifiers.h: Removed.
  20554. * kjs/ExecState.cpp: Removed.
  20555. * kjs/ExecState.h: Removed.
  20556. * kjs/GetterSetter.cpp: Removed.
  20557. * kjs/GetterSetter.h: Removed.
  20558. * kjs/InitializeThreading.cpp: Removed.
  20559. * kjs/InitializeThreading.h: Removed.
  20560. * kjs/JSActivation.cpp: Removed.
  20561. * kjs/JSActivation.h: Removed.
  20562. * kjs/JSGlobalData.cpp: Removed.
  20563. * kjs/JSGlobalData.h: Removed.
  20564. * kjs/JSLock.cpp: Removed.
  20565. * kjs/JSLock.h: Removed.
  20566. * kjs/JSStaticScopeObject.cpp: Removed.
  20567. * kjs/JSStaticScopeObject.h: Removed.
  20568. * kjs/JSType.h: Removed.
  20569. * kjs/PropertyNameArray.cpp: Removed.
  20570. * kjs/PropertyNameArray.h: Removed.
  20571. * kjs/ScopeChain.cpp: Removed.
  20572. * kjs/ScopeChain.h: Removed.
  20573. * kjs/ScopeChainMark.h: Removed.
  20574. * kjs/SymbolTable.h: Removed.
  20575. * kjs/Tracing.d: Removed.
  20576. * kjs/Tracing.h: Removed.
  20577. * runtime/ArgList.cpp: Copied from kjs/ArgList.cpp.
  20578. * runtime/ArgList.h: Copied from kjs/ArgList.h.
  20579. * runtime/Arguments.cpp: Copied from kjs/Arguments.cpp.
  20580. * runtime/Arguments.h: Copied from kjs/Arguments.h.
  20581. * runtime/BatchedTransitionOptimizer.h: Copied from kjs/BatchedTransitionOptimizer.h.
  20582. * runtime/CollectorHeapIterator.h: Copied from kjs/CollectorHeapIterator.h.
  20583. * runtime/CommonIdentifiers.cpp: Copied from kjs/CommonIdentifiers.cpp.
  20584. * runtime/CommonIdentifiers.h: Copied from kjs/CommonIdentifiers.h.
  20585. * runtime/ExecState.cpp: Copied from kjs/ExecState.cpp.
  20586. * runtime/ExecState.h: Copied from kjs/ExecState.h.
  20587. * runtime/GetterSetter.cpp: Copied from kjs/GetterSetter.cpp.
  20588. * runtime/GetterSetter.h: Copied from kjs/GetterSetter.h.
  20589. * runtime/InitializeThreading.cpp: Copied from kjs/InitializeThreading.cpp.
  20590. * runtime/InitializeThreading.h: Copied from kjs/InitializeThreading.h.
  20591. * runtime/JSActivation.cpp: Copied from kjs/JSActivation.cpp.
  20592. * runtime/JSActivation.h: Copied from kjs/JSActivation.h.
  20593. * runtime/JSGlobalData.cpp: Copied from kjs/JSGlobalData.cpp.
  20594. * runtime/JSGlobalData.h: Copied from kjs/JSGlobalData.h.
  20595. * runtime/JSLock.cpp: Copied from kjs/JSLock.cpp.
  20596. * runtime/JSLock.h: Copied from kjs/JSLock.h.
  20597. * runtime/JSStaticScopeObject.cpp: Copied from kjs/JSStaticScopeObject.cpp.
  20598. * runtime/JSStaticScopeObject.h: Copied from kjs/JSStaticScopeObject.h.
  20599. * runtime/JSType.h: Copied from kjs/JSType.h.
  20600. * runtime/PropertyNameArray.cpp: Copied from kjs/PropertyNameArray.cpp.
  20601. * runtime/PropertyNameArray.h: Copied from kjs/PropertyNameArray.h.
  20602. * runtime/ScopeChain.cpp: Copied from kjs/ScopeChain.cpp.
  20603. * runtime/ScopeChain.h: Copied from kjs/ScopeChain.h.
  20604. * runtime/ScopeChainMark.h: Copied from kjs/ScopeChainMark.h.
  20605. * runtime/SymbolTable.h: Copied from kjs/SymbolTable.h.
  20606. * runtime/Tracing.d: Copied from kjs/Tracing.d.
  20607. * runtime/Tracing.h: Copied from kjs/Tracing.h.
  20608. 2008-11-03 Sam Weinig <sam@webkit.org>
  20609. Reviewed by Mark Rowe.
  20610. Move #define to turn on dumping StructureID statistics to StructureID.cpp so that
  20611. turning it on does not require a full rebuild.
  20612. * runtime/StructureID.cpp:
  20613. (JSC::StructureID::dumpStatistics):
  20614. * runtime/StructureID.h:
  20615. 2008-11-03 Alp Toker <alp@nuanti.com>
  20616. Reviewed by Geoffrey Garen.
  20617. Fix warning when building on Darwin without JSC_MULTIPLE_THREADS
  20618. enabled.
  20619. * kjs/InitializeThreading.cpp:
  20620. 2008-11-02 Matt Lilek <webkit@mattlilek.com>
  20621. Reviewed by Cameron Zwarich.
  20622. Bug 22042: REGRESSION(r38066): ASSERTION FAILED: source in CodeBlock
  20623. <https://bugs.webkit.org/show_bug.cgi?id=22042>
  20624. Rename parameter name to avoid ASSERT.
  20625. * VM/CodeBlock.h:
  20626. (JSC::CodeBlock::CodeBlock):
  20627. (JSC::ProgramCodeBlock::ProgramCodeBlock):
  20628. (JSC::EvalCodeBlock::EvalCodeBlock):
  20629. 2008-11-02 Cameron Zwarich <zwarich@apple.com>
  20630. Reviewed by Oliver Hunt.
  20631. Bug 22035: Remove the '_' suffix on constructor parameter names for structs
  20632. <https://bugs.webkit.org/show_bug.cgi?id=22035>
  20633. * API/JSCallbackObject.h:
  20634. (JSC::JSCallbackObject::JSCallbackObjectData::JSCallbackObjectData):
  20635. * VM/CodeBlock.h:
  20636. (JSC::CodeBlock::CodeBlock):
  20637. (JSC::ProgramCodeBlock::ProgramCodeBlock):
  20638. (JSC::EvalCodeBlock::EvalCodeBlock):
  20639. * wrec/WREC.h:
  20640. (JSC::Quantifier::Quantifier):
  20641. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20642. Rubber-stamped by Geoff Garen.
  20643. Rename SourceRange.h to SourceCode.h.
  20644. * API/JSBase.cpp:
  20645. * GNUmakefile.am:
  20646. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20647. * JavaScriptCore.xcodeproj/project.pbxproj:
  20648. * VM/CodeBlock.h:
  20649. * kjs/SourceCode.h: Copied from kjs/SourceRange.h.
  20650. * kjs/SourceRange.h: Removed.
  20651. * kjs/grammar.y:
  20652. * kjs/lexer.h:
  20653. * kjs/nodes.cpp:
  20654. (JSC::ForInNode::ForInNode):
  20655. * kjs/nodes.h:
  20656. (JSC::ThrowableExpressionData::setExceptionSourceCode):
  20657. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20658. Reviewed by Darin Adler.
  20659. Bug 22019: Move JSC::Interpreter::shouldPrintExceptions() to WebCore::Console
  20660. <https://bugs.webkit.org/show_bug.cgi?id=22019>
  20661. The JSC::Interpreter::shouldPrintExceptions() function is not used at
  20662. all in JavaScriptCore, so it should be moved to WebCore::Console, its
  20663. only user.
  20664. * JavaScriptCore.exp:
  20665. * kjs/interpreter.cpp:
  20666. * kjs/interpreter.h:
  20667. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20668. Not reviewed.
  20669. Windows build fix.
  20670. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20671. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20672. Rubber-stamped by Sam Weinig.
  20673. Remove the call to Interpreter::setShouldPrintExceptions() from the
  20674. GlobalObject constructor in the shell. The shouldPrintExceptions()
  20675. information is not used anywhere in JavaScriptCore, only in WebCore.
  20676. * kjs/Shell.cpp:
  20677. (GlobalObject::GlobalObject):
  20678. 2008-10-31 Kevin Ollivier <kevino@theolliviers.com>
  20679. wxMSW build fix.
  20680. * wtf/Threading.h:
  20681. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20682. Rubber-stamped by Sam Weinig.
  20683. Move more files from the kjs subdirectory of JavaScriptCore to the
  20684. runtime subdirectory.
  20685. * GNUmakefile.am:
  20686. * JavaScriptCore.pri:
  20687. * JavaScriptCore.xcodeproj/project.pbxproj:
  20688. * JavaScriptCoreSources.bkl:
  20689. * kjs/AllInOneFile.cpp:
  20690. * kjs/RegExpConstructor.cpp: Removed.
  20691. * kjs/RegExpConstructor.h: Removed.
  20692. * kjs/RegExpMatchesArray.h: Removed.
  20693. * kjs/RegExpObject.cpp: Removed.
  20694. * kjs/RegExpObject.h: Removed.
  20695. * kjs/RegExpPrototype.cpp: Removed.
  20696. * kjs/RegExpPrototype.h: Removed.
  20697. * runtime/RegExpConstructor.cpp: Copied from kjs/RegExpConstructor.cpp.
  20698. * runtime/RegExpConstructor.h: Copied from kjs/RegExpConstructor.h.
  20699. * runtime/RegExpMatchesArray.h: Copied from kjs/RegExpMatchesArray.h.
  20700. * runtime/RegExpObject.cpp: Copied from kjs/RegExpObject.cpp.
  20701. * runtime/RegExpObject.h: Copied from kjs/RegExpObject.h.
  20702. * runtime/RegExpPrototype.cpp: Copied from kjs/RegExpPrototype.cpp.
  20703. * runtime/RegExpPrototype.h: Copied from kjs/RegExpPrototype.h.
  20704. 2008-10-31 Mark Rowe <mrowe@apple.com>
  20705. Revert an incorrect portion of r38034.
  20706. * profiler/ProfilerServer.mm:
  20707. 2008-10-31 Mark Rowe <mrowe@apple.com>
  20708. Fix the 64-bit build.
  20709. Disable strict aliasing in ProfilerServer.mm as it leads to the compiler being unhappy
  20710. with the common Obj-C idiom self = [super init];
  20711. * JavaScriptCore.xcodeproj/project.pbxproj:
  20712. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20713. Reviewed by Alexey Proskuryakov.
  20714. Change a header guard to match our coding style.
  20715. * kjs/InitializeThreading.h:
  20716. 2008-10-30 Geoffrey Garen <ggaren@apple.com>
  20717. Reviewed by Oliver Hunt.
  20718. Fixed a small bit of https://bugs.webkit.org/show_bug.cgi?id=21962
  20719. AST uses way too much memory
  20720. Removed a word from StatementNode by nixing LabelStack and turning it
  20721. into a compile-time data structure managed by CodeGenerator.
  20722. v8 tests and SunSpider, run by Gavin, report no change.
  20723. * GNUmakefile.am:
  20724. * JavaScriptCore.order:
  20725. * JavaScriptCore.pri:
  20726. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20727. * JavaScriptCore.xcodeproj/project.pbxproj:
  20728. * kjs/AllInOneFile.cpp:
  20729. * JavaScriptCoreSources.bkl: I sure hope this builds!
  20730. * VM/CodeGenerator.cpp:
  20731. (JSC::CodeGenerator::CodeGenerator):
  20732. (JSC::CodeGenerator::newLabelScope):
  20733. (JSC::CodeGenerator::breakTarget):
  20734. (JSC::CodeGenerator::continueTarget):
  20735. * VM/CodeGenerator.h: Nixed the JumpContext system because it depended
  20736. on a LabelStack in the AST, and it was a little cumbersome on the client
  20737. side. Replaced with LabelScope, which tracks all break / continue
  20738. information in the CodeGenerator, just like we track LabelIDs and other
  20739. stacks of compile-time data.
  20740. * kjs/LabelScope.h: Added.
  20741. (JSC::LabelScope::):
  20742. (JSC::LabelScope::LabelScope):
  20743. (JSC::LabelScope::ref):
  20744. (JSC::LabelScope::deref):
  20745. (JSC::LabelScope::refCount):
  20746. (JSC::LabelScope::breakTarget):
  20747. (JSC::LabelScope::continueTarget):
  20748. (JSC::LabelScope::type):
  20749. (JSC::LabelScope::name):
  20750. (JSC::LabelScope::scopeDepth): Simple abstraction for holding everything
  20751. you might want to know about a break-able / continue-able scope.
  20752. * kjs/LabelStack.cpp: Removed.
  20753. * kjs/LabelStack.h: Removed.
  20754. * kjs/grammar.y: No need to push labels at parse time -- we don't store
  20755. LabelStacks in the AST anymore.
  20756. * kjs/nodes.cpp:
  20757. (JSC::DoWhileNode::emitCode):
  20758. (JSC::WhileNode::emitCode):
  20759. (JSC::ForNode::emitCode):
  20760. (JSC::ForInNode::emitCode):
  20761. (JSC::ContinueNode::emitCode):
  20762. (JSC::BreakNode::emitCode):
  20763. (JSC::SwitchNode::emitCode):
  20764. (JSC::LabelNode::emitCode):
  20765. * kjs/nodes.h:
  20766. (JSC::StatementNode::):
  20767. (JSC::LabelNode::): Use LabelScope where we used to use JumpContext.
  20768. Simplified a bunch of code. Touched up label-related error messages a
  20769. bit.
  20770. * kjs/nodes2string.cpp:
  20771. (JSC::LabelNode::streamTo): Updated for rename.
  20772. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20773. Reviewed by Darin Adler.
  20774. Bug 22005: Move StructureIDChain into its own file
  20775. <https://bugs.webkit.org/show_bug.cgi?id=22005>
  20776. * GNUmakefile.am:
  20777. * JavaScriptCore.pri:
  20778. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20779. * JavaScriptCore.xcodeproj/project.pbxproj:
  20780. * JavaScriptCoreSources.bkl:
  20781. * runtime/StructureID.cpp:
  20782. * runtime/StructureID.h:
  20783. * runtime/StructureIDChain.cpp: Copied from runtime/StructureID.cpp.
  20784. * runtime/StructureIDChain.h: Copied from runtime/StructureID.h.
  20785. 2008-10-31 Steve Falkenburg <sfalken@apple.com>
  20786. Build fix.
  20787. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  20788. 2008-10-31 Steve Falkenburg <sfalken@apple.com>
  20789. Build fix.
  20790. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20791. 2008-10-31 Darin Adler <darin@apple.com>
  20792. Reviewed by Dan Bernstein.
  20793. - fix storage leak seen on buildbot
  20794. Some other cleanup too. The storage leak was caused by the fact
  20795. that HashTraits<CallIdentifier>::needsDestruction was false, so
  20796. the call identifier objects didn't get deleted.
  20797. * profiler/CallIdentifier.h:
  20798. Added a default constructor to create empty call identifiers.
  20799. Changed the normal constructor to use const UString&
  20800. to avoid extra copying and reference count thrash.
  20801. Removed the explicit copy constructor definition, since it's what
  20802. the compiler will automatically generate. (Rule of thumb: Either
  20803. you need both a custom copy constructor and a custom assignment
  20804. operator, or neither.)
  20805. Moved the CallIdentifier hash function out of the WTF namespace;
  20806. there's no reason to put it there.
  20807. Changed the CallIdentifier hash function to be a struct rather than
  20808. a specialization of the IntHash struct template. Having it be
  20809. a specialization made no sense, since CallIdentifier is not an integer,
  20810. and did no good.
  20811. Removed explicit definition of emptyValueIsZero in the hash traits,
  20812. since inheriting from GenericHashTraits already makes that false.
  20813. Removed explicit definition of emptyValue, instead relying on the
  20814. default constructor and GenericHashTraits.
  20815. Removed explicit definition of needsDestruction, because we want it
  20816. to have its default value: true, not false. This fixes the leak!
  20817. Changed constructDeletedValue and isDeletedValue to use a line number
  20818. of numeric_limits<unsigned>::max() to indicate a value is deleted.
  20819. Previously this used empty strings for the empty value and null strings
  20820. for the deleted value, but it's more efficient to use null for both.
  20821. 2008-10-31 Timothy Hatcher <timothy@apple.com>
  20822. Emit the WillExecuteStatement debugger hook before the for loop body
  20823. when the statement node for the body isn't a block. This allows
  20824. breakpoints on those statements in the Web Inspector.
  20825. https://bugs.webkit.org/show_bug.cgi?id=22004
  20826. Reviewed by Darin Adler.
  20827. * kjs/nodes.cpp:
  20828. (JSC::ForNode::emitCode): Emit the WillExecuteStatement
  20829. debugger hook before the statement node if isn't a block.
  20830. Also emit the WillExecuteStatement debugger hook for the
  20831. loop as the first op-code.
  20832. (JSC::ForInNode::emitCode): Ditto.
  20833. 2008-10-31 Timothy Hatcher <timothy@apple.com>
  20834. Fixes console warnings about not having an autorelease pool.
  20835. Also fixes the build for Snow Leopard, by including individual
  20836. Foundation headers instead of Foundation.h.
  20837. https://bugs.webkit.org/show_bug.cgi?id=21995
  20838. Reviewed by Oliver Hunt.
  20839. * profiler/ProfilerServer.mm:
  20840. (-[ProfilerServer init]): Create a NSAutoreleasePool and drain it.
  20841. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20842. Not reviewed.
  20843. Speculative wxWindows build fix.
  20844. * JavaScriptCoreSources.bkl:
  20845. * jscore.bkl:
  20846. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20847. Rubber-stamped by Maciej Stachowiak.
  20848. Move VM/JSPropertyNameIterator.cpp and VM/JSPropertyNameIterator.h to
  20849. the runtime directory.
  20850. * GNUmakefile.am:
  20851. * JavaScriptCore.pri:
  20852. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20853. * JavaScriptCore.xcodeproj/project.pbxproj:
  20854. * JavaScriptCoreSources.bkl:
  20855. * VM/JSPropertyNameIterator.cpp: Removed.
  20856. * VM/JSPropertyNameIterator.h: Removed.
  20857. * runtime/JSPropertyNameIterator.cpp: Copied from VM/JSPropertyNameIterator.cpp.
  20858. * runtime/JSPropertyNameIterator.h: Copied from VM/JSPropertyNameIterator.h.
  20859. 2008-10-31 Cameron Zwarich <zwarich@apple.com>
  20860. Not reviewed.
  20861. Speculative wxWindows build fix.
  20862. * jscore.bkl:
  20863. 2008-10-30 Mark Rowe <mrowe@apple.com>
  20864. Reviewed by Jon Homeycutt.
  20865. Explicitly default to building for only the native architecture in debug and release builds.
  20866. * Configurations/DebugRelease.xcconfig:
  20867. 2008-10-30 Cameron Zwarich <zwarich@apple.com>
  20868. Rubber-stamped by Sam Weinig.
  20869. Create a debugger directory in JavaScriptCore and move the relevant
  20870. files to it.
  20871. * GNUmakefile.am:
  20872. * JavaScriptCore.pri:
  20873. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20874. * JavaScriptCore.xcodeproj/project.pbxproj:
  20875. * VM/CodeBlock.cpp:
  20876. * VM/CodeGenerator.h:
  20877. * VM/Machine.cpp:
  20878. * debugger: Added.
  20879. * debugger/Debugger.cpp: Copied from kjs/debugger.cpp.
  20880. * debugger/Debugger.h: Copied from kjs/debugger.h.
  20881. * debugger/DebuggerCallFrame.cpp: Copied from kjs/DebuggerCallFrame.cpp.
  20882. * debugger/DebuggerCallFrame.h: Copied from kjs/DebuggerCallFrame.h.
  20883. * kjs/AllInOneFile.cpp:
  20884. * kjs/DebuggerCallFrame.cpp: Removed.
  20885. * kjs/DebuggerCallFrame.h: Removed.
  20886. * kjs/Parser.cpp:
  20887. * kjs/Parser.h:
  20888. * kjs/debugger.cpp: Removed.
  20889. * kjs/debugger.h: Removed.
  20890. * kjs/interpreter.cpp:
  20891. * kjs/nodes.cpp:
  20892. * runtime/FunctionConstructor.cpp:
  20893. * runtime/JSGlobalObject.cpp:
  20894. 2008-10-30 Benjamin K. Stuhl <bks24@cornell.edu>
  20895. gcc 4.3.3/linux-x86 generates "suggest parentheses around && within ||"
  20896. warnings; add some parentheses to disambiguate things. No functional
  20897. changes, so no tests.
  20898. https://bugs.webkit.org/show_bug.cgi?id=21973
  20899. Add parentheses to clean up some gcc warnings
  20900. Reviewed by Dan Bernstein.
  20901. * wtf/ASCIICType.h:
  20902. (WTF::isASCIIAlphanumeric):
  20903. (WTF::isASCIIHexDigit):
  20904. 2008-10-30 Kevin Lindeman <klindeman@apple.com>
  20905. Adds ProfilerServer, which is a distributed notification listener
  20906. that allows starting and stopping the profiler remotely for use
  20907. in conjunction with the profiler's DTace probes.
  20908. https://bugs.webkit.org/show_bug.cgi?id=21719
  20909. Reviewed by Timothy Hatcher.
  20910. * JavaScriptCore.xcodeproj/project.pbxproj:
  20911. * kjs/JSGlobalData.cpp:
  20912. (JSC::JSGlobalData::JSGlobalData): Calls startProfilerServerIfNeeded.
  20913. * profiler/ProfilerServer.h: Added.
  20914. * profiler/ProfilerServer.mm: Added.
  20915. (+[ProfilerServer sharedProfileServer]):
  20916. (-[ProfilerServer init]):
  20917. (-[ProfilerServer startProfiling]):
  20918. (-[ProfilerServer stopProfiling]):
  20919. (JSC::startProfilerServerIfNeeded):
  20920. 2008-10-30 Kevin Ollivier <kevino@theolliviers.com>
  20921. wx build fix after PropertyMap and StructureID merge.
  20922. * JavaScriptCoreSources.bkl:
  20923. 2008-10-30 Cameron Zwarich <zwarich@apple.com>
  20924. Reviewed by Mark Rowe.
  20925. Change the JavaScriptCore Xcode project to use relative paths for the
  20926. PCRE source files.
  20927. * JavaScriptCore.xcodeproj/project.pbxproj:
  20928. 2008-10-30 Sam Weinig <sam@webkit.org>
  20929. Reviewed by Cameron Zwarich and Geoffrey Garen.
  20930. Fix for https://bugs.webkit.org/show_bug.cgi?id=21989
  20931. Merge PropertyMap and StructureID
  20932. - Move PropertyMap code into StructureID in preparation for lazily
  20933. creating the map on gets.
  20934. - Make remove with transition explicit by adding removePropertyTransition.
  20935. - Make the put/remove without transition explicit.
  20936. - Make cache invalidation part of put/remove without transition.
  20937. 1% speedup on SunSpider; 0.5% speedup on v8 suite.
  20938. * GNUmakefile.am:
  20939. * JavaScriptCore.exp:
  20940. * JavaScriptCore.pri:
  20941. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  20942. * JavaScriptCore.xcodeproj/project.pbxproj:
  20943. * JavaScriptCoreSources.bkl:
  20944. * kjs/AllInOneFile.cpp:
  20945. * kjs/identifier.h:
  20946. * runtime/JSObject.cpp:
  20947. (JSC::JSObject::removeDirect):
  20948. * runtime/JSObject.h:
  20949. (JSC::JSObject::putDirect):
  20950. * runtime/PropertyMap.cpp: Removed.
  20951. * runtime/PropertyMap.h: Removed.
  20952. * runtime/PropertyMapHashTable.h: Copied from runtime/PropertyMap.h.
  20953. * runtime/StructureID.cpp:
  20954. (JSC::StructureID::dumpStatistics):
  20955. (JSC::StructureID::StructureID):
  20956. (JSC::StructureID::~StructureID):
  20957. (JSC::StructureID::getEnumerablePropertyNames):
  20958. (JSC::StructureID::addPropertyTransition):
  20959. (JSC::StructureID::removePropertyTransition):
  20960. (JSC::StructureID::toDictionaryTransition):
  20961. (JSC::StructureID::changePrototypeTransition):
  20962. (JSC::StructureID::getterSetterTransition):
  20963. (JSC::StructureID::addPropertyWithoutTransition):
  20964. (JSC::StructureID::removePropertyWithoutTransition):
  20965. (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
  20966. (JSC::StructureID::checkConsistency):
  20967. (JSC::StructureID::copyPropertyTable):
  20968. (JSC::StructureID::get):
  20969. (JSC::StructureID::put):
  20970. (JSC::StructureID::remove):
  20971. (JSC::StructureID::insertIntoPropertyMapHashTable):
  20972. (JSC::StructureID::expandPropertyMapHashTable):
  20973. (JSC::StructureID::createPropertyMapHashTable):
  20974. (JSC::StructureID::rehashPropertyMapHashTable):
  20975. (JSC::comparePropertyMapEntryIndices):
  20976. (JSC::StructureID::getEnumerablePropertyNamesInternal):
  20977. * runtime/StructureID.h:
  20978. (JSC::StructureID::propertyStorageSize):
  20979. (JSC::StructureID::isEmpty):
  20980. (JSC::StructureID::get):
  20981. 2008-10-30 Cameron Zwarich <zwarich@apple.com>
  20982. Reviewed by Oliver Hunt.
  20983. Bug 21987: CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result register
  20984. <https://bugs.webkit.org/show_bug.cgi?id=21987>
  20985. CTI::putDoubleResultToJSNumberCellOrJSImmediate() hardcodes its result
  20986. register as ecx, but it should be tempReg1, which is ecx at all of its
  20987. callsites.
  20988. * VM/CTI.cpp:
  20989. (JSC::CTI::putDoubleResultToJSNumberCellOrJSImmediate):
  20990. 2008-10-30 Cameron Zwarich <zwarich@apple.com>
  20991. Reviewed by Sam Weinig.
  20992. Bug 21985: Opcodes should use eax as their destination register whenever possible
  20993. <https://bugs.webkit.org/show_bug.cgi?id=21985>
  20994. Change more opcodes to use eax as the register for their final result,
  20995. and change calls to emitPutResult() that pass eax to rely on the default
  20996. value of eax.
  20997. * VM/CTI.cpp:
  20998. (JSC::CTI::privateCompileMainPass):
  20999. 2008-10-30 Alp Toker <alp@nuanti.com>
  21000. Build fix attempt for older gcc on the trunk-mac-intel build bot
  21001. (error: initializer for scalar variable requires one element).
  21002. Modify the initializer syntax slightly with an additional comma.
  21003. * VM/Machine.cpp:
  21004. (JSC::Machine::cti_op_call_JSFunction):
  21005. (JSC::Machine::cti_op_construct_JSConstruct):
  21006. (JSC::Machine::cti_op_resolve_func):
  21007. (JSC::Machine::cti_op_post_inc):
  21008. (JSC::Machine::cti_op_resolve_with_base):
  21009. (JSC::Machine::cti_op_post_dec):
  21010. 2008-10-30 Alp Toker <alp@nuanti.com>
  21011. Reviewed by Alexey Proskuryakov.
  21012. https://bugs.webkit.org/show_bug.cgi?id=21571
  21013. VoidPtrPair breaks CTI on Linux
  21014. The VoidPtrPair return change made in r37457 does not work on Linux
  21015. since POD structs aren't passed in registers.
  21016. This patch uses a union to vectorize VoidPtrPair to a uint64_t and
  21017. matches Darwin/MSVC fixing CTI/WREC on Linux.
  21018. Alexey reports no measurable change in Mac performance with this fix.
  21019. * VM/Machine.cpp:
  21020. (JSC::Machine::cti_op_call_JSFunction):
  21021. (JSC::Machine::cti_op_construct_JSConstruct):
  21022. (JSC::Machine::cti_op_resolve_func):
  21023. (JSC::Machine::cti_op_post_inc):
  21024. (JSC::Machine::cti_op_resolve_with_base):
  21025. (JSC::Machine::cti_op_post_dec):
  21026. * VM/Machine.h:
  21027. (JSC::):
  21028. 2008-10-29 Oliver Hunt <oliver@apple.com>
  21029. Reviewed by Geoff Garen.
  21030. Initial work to reduce cost of JSNumberCell allocation
  21031. This does the initial work needed to bring more of number
  21032. allocation into CTI code directly, rather than just falling
  21033. back onto the slow paths if we can't guarantee that a number
  21034. cell can be reused.
  21035. Initial implementation only used by op_negate to make sure
  21036. it all works. In a negate heavy (though not dominated) test
  21037. it results in a 10% win in the non-reusable cell case.
  21038. * VM/CTI.cpp:
  21039. (JSC::):
  21040. (JSC::CTI::emitAllocateNumber):
  21041. (JSC::CTI::emitNakedFastCall):
  21042. (JSC::CTI::emitArithIntToImmWithJump):
  21043. (JSC::CTI::privateCompileMainPass):
  21044. (JSC::CTI::privateCompileSlowCases):
  21045. * VM/CTI.h:
  21046. * VM/CodeBlock.cpp:
  21047. (JSC::CodeBlock::dump):
  21048. * VM/CodeGenerator.cpp:
  21049. (JSC::CodeGenerator::emitUnaryOp):
  21050. * VM/CodeGenerator.h:
  21051. (JSC::CodeGenerator::emitToJSNumber):
  21052. (JSC::CodeGenerator::emitTypeOf):
  21053. (JSC::CodeGenerator::emitGetPropertyNames):
  21054. * VM/Machine.cpp:
  21055. (JSC::Machine::privateExecute):
  21056. * VM/Machine.h:
  21057. * kjs/ResultType.h:
  21058. (JSC::ResultType::isReusableNumber):
  21059. (JSC::ResultType::toInt):
  21060. * kjs/nodes.cpp:
  21061. (JSC::UnaryOpNode::emitCode):
  21062. (JSC::BinaryOpNode::emitCode):
  21063. (JSC::EqualNode::emitCode):
  21064. * masm/X86Assembler.h:
  21065. (JSC::X86Assembler::):
  21066. (JSC::X86Assembler::negl_r):
  21067. (JSC::X86Assembler::xorpd_mr):
  21068. * runtime/JSNumberCell.h:
  21069. (JSC::JSNumberCell::JSNumberCell):
  21070. 2008-10-29 Steve Falkenburg <sfalken@apple.com>
  21071. <rdar://problem/6326563> Crash on launch
  21072. For Windows, export explicit functions rather than exporting data for atomicallyInitializedStaticMutex.
  21073. Exporting data from a DLL on Windows requires specifying __declspec(dllimport) in the header used by
  21074. callers, but __declspec(dllexport) when defined in the DLL implementation. By instead exporting
  21075. the explicit lock/unlock functions, we can avoid this.
  21076. Fixes a crash on launch, since we were previously erroneously exporting atomicallyInitializedStaticMutex as a function.
  21077. Reviewed by Darin Adler.
  21078. * wtf/Threading.h:
  21079. (WTF::lockAtomicallyInitializedStaticMutex):
  21080. (WTF::unlockAtomicallyInitializedStaticMutex):
  21081. * wtf/ThreadingWin.cpp:
  21082. (WTF::lockAtomicallyInitializedStaticMutex):
  21083. (WTF::unlockAtomicallyInitializedStaticMutex):
  21084. 2008-10-29 Sam Weinig <sam@webkit.org>
  21085. Reviewed by Oliver Hunt.
  21086. Remove direct use of PropertyMap.
  21087. * JavaScriptCore.exp:
  21088. * runtime/JSObject.cpp:
  21089. (JSC::JSObject::mark):
  21090. (JSC::JSObject::put):
  21091. (JSC::JSObject::deleteProperty):
  21092. (JSC::JSObject::getPropertyAttributes):
  21093. (JSC::JSObject::removeDirect):
  21094. * runtime/JSObject.h:
  21095. (JSC::JSObject::getDirect):
  21096. (JSC::JSObject::getDirectLocation):
  21097. (JSC::JSObject::hasCustomProperties):
  21098. (JSC::JSObject::JSObject):
  21099. (JSC::JSObject::putDirect):
  21100. * runtime/PropertyMap.cpp:
  21101. (JSC::PropertyMap::get):
  21102. * runtime/PropertyMap.h:
  21103. (JSC::PropertyMap::isEmpty):
  21104. (JSC::PropertyMap::get):
  21105. * runtime/StructureID.cpp:
  21106. (JSC::StructureID::dumpStatistics):
  21107. * runtime/StructureID.h:
  21108. (JSC::StructureID::propertyStorageSize):
  21109. (JSC::StructureID::get):
  21110. (JSC::StructureID::put):
  21111. (JSC::StructureID::remove):
  21112. (JSC::StructureID::isEmpty):
  21113. 2008-10-29 Sam Weinig <sam@webkit.org>
  21114. Reviewed by Geoffrey Garen.
  21115. Rename and move the StructureID transition table to its own file.
  21116. * GNUmakefile.am:
  21117. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  21118. * JavaScriptCore.xcodeproj/project.pbxproj:
  21119. * runtime/StructureID.cpp:
  21120. (JSC::StructureID::addPropertyTransition):
  21121. * runtime/StructureID.h:
  21122. (JSC::StructureID::):
  21123. * runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h.
  21124. (JSC::StructureIDTransitionTableHash::hash):
  21125. (JSC::StructureIDTransitionTableHash::equal):
  21126. 2008-10-29 Sam Weinig <sam@webkit.org>
  21127. Reviewed by Cameron Zwarich.
  21128. Fix for https://bugs.webkit.org/show_bug.cgi?id=21958
  21129. Pack bits in StructureID to reduce the size of each StructureID by 2 words.
  21130. * runtime/PropertyMap.h:
  21131. (JSC::PropertyMap::propertyMapSize):
  21132. * runtime/StructureID.cpp:
  21133. (JSC::StructureID::dumpStatistics): Add additional size statistics when dumping.
  21134. (JSC::StructureID::StructureID):
  21135. * runtime/StructureID.h:
  21136. 2008-10-29 Kevin Ollivier <kevino@theolliviers.com>
  21137. wx build fixes after addition of runtime and ImageBuffer changes.
  21138. * JavaScriptCoreSources.bkl:
  21139. * jscore.bkl:
  21140. 2008-10-29 Timothy Hatcher <timothy@apple.com>
  21141. Emit the WillExecuteStatement debugger hook before the "else" body
  21142. when there is no block for the "else" body. This allows breakpoints
  21143. on those statements in the Web Inspector.
  21144. https://bugs.webkit.org/show_bug.cgi?id=21944
  21145. Reviewed by Maciej Stachowiak.
  21146. * kjs/nodes.cpp:
  21147. (JSC::IfElseNode::emitCode): Emit the WillExecuteStatement
  21148. debugger hook before the else node if isn't a block.
  21149. 2008-10-29 Alexey Proskuryakov <ap@webkit.org>
  21150. Build fix.
  21151. * JavaScriptCore.exp: Export HashTable::deleteTable().
  21152. 2008-10-28 Alp Toker <alp@nuanti.com>
  21153. Fix builddir != srcdir builds after kjs -> runtime breakage. Sources
  21154. may now be generated in both kjs/ and runtime/.
  21155. Also sort the sources list for readability.
  21156. * GNUmakefile.am:
  21157. 2008-10-28 Alp Toker <alp@nuanti.com>
  21158. Reviewed by Cameron Zwarich.
  21159. Build fix attempt after kjs -> runtime rename.
  21160. * GNUmakefile.am:
  21161. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21162. Not reviewed.
  21163. Remove a duplicate includes directory.
  21164. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  21165. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21166. Not reviewed.
  21167. Attempt to fix the Windows build.
  21168. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  21169. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  21170. 2008-10-28 Dan Bernstein <mitz@apple.com>
  21171. Reviewed by Mark Rowe.
  21172. - export WTF::atomicallyInitializedStaticMutex
  21173. * JavaScriptCore.exp:
  21174. 2008-10-28 Geoffrey Garen <ggaren@apple.com>
  21175. Reviewed by Cameron Zwarich.
  21176. Fixed CodeBlock dumping to accurately report constant register indices.
  21177. * VM/CodeBlock.cpp:
  21178. (JSC::CodeBlock::dump):
  21179. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21180. Not reviewed.
  21181. More Qt build fixes.
  21182. * JavaScriptCore.pri:
  21183. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21184. Not reviewed.
  21185. Fix the Qt build, hopefully for real this time.
  21186. * JavaScriptCore.pri:
  21187. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21188. Not reviewed.
  21189. Fix the Qt build.
  21190. * JavaScriptCore.pri:
  21191. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21192. Not reviewed.
  21193. Fix the Windows build.
  21194. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  21195. 2008-10-28 Cameron Zwarich <zwarich@apple.com>
  21196. Rubber-stamped by Sam Weinig.
  21197. Create a runtime directory in JavaScriptCore and begin moving files to
  21198. it. This is the first step towards removing the kjs directory and
  21199. placing files in more meaningful subdirectories of JavaScriptCore.
  21200. * API/JSBase.cpp:
  21201. * API/JSCallbackConstructor.cpp:
  21202. * API/JSCallbackConstructor.h:
  21203. * API/JSCallbackFunction.cpp:
  21204. * API/JSClassRef.cpp:
  21205. * API/JSClassRef.h:
  21206. * API/JSStringRefCF.cpp:
  21207. * API/JSValueRef.cpp:
  21208. * API/OpaqueJSString.cpp:
  21209. * DerivedSources.make:
  21210. * GNUmakefile.am:
  21211. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  21212. * JavaScriptCore.xcodeproj/project.pbxproj:
  21213. * kjs/AllInOneFile.cpp:
  21214. * kjs/ArrayConstructor.cpp: Removed.
  21215. * kjs/ArrayConstructor.h: Removed.
  21216. * kjs/ArrayPrototype.cpp: Removed.
  21217. * kjs/ArrayPrototype.h: Removed.
  21218. * kjs/BooleanConstructor.cpp: Removed.
  21219. * kjs/BooleanConstructor.h: Removed.
  21220. * kjs/BooleanObject.cpp: Removed.
  21221. * kjs/BooleanObject.h: Removed.
  21222. * kjs/BooleanPrototype.cpp: Removed.
  21223. * kjs/BooleanPrototype.h: Removed.
  21224. * kjs/CallData.cpp: Removed.
  21225. * kjs/CallData.h: Removed.
  21226. * kjs/ClassInfo.h: Removed.
  21227. * kjs/ConstructData.cpp: Removed.
  21228. * kjs/ConstructData.h: Removed.
  21229. * kjs/DateConstructor.cpp: Removed.
  21230. * kjs/DateConstructor.h: Removed.
  21231. * kjs/DateInstance.cpp: Removed.
  21232. * kjs/DateInstance.h: Removed.
  21233. * kjs/DateMath.cpp: Removed.
  21234. * kjs/DateMath.h: Removed.
  21235. * kjs/DatePrototype.cpp: Removed.
  21236. * kjs/DatePrototype.h: Removed.
  21237. * kjs/Error.cpp: Removed.
  21238. * kjs/Error.h: Removed.
  21239. * kjs/ErrorConstructor.cpp: Removed.
  21240. * kjs/ErrorConstructor.h: Removed.
  21241. * kjs/ErrorInstance.cpp: Removed.
  21242. * kjs/ErrorInstance.h: Removed.
  21243. * kjs/ErrorPrototype.cpp: Removed.
  21244. * kjs/ErrorPrototype.h: Removed.
  21245. * kjs/FunctionConstructor.cpp: Removed.
  21246. * kjs/FunctionConstructor.h: Removed.
  21247. * kjs/FunctionPrototype.cpp: Removed.
  21248. * kjs/FunctionPrototype.h: Removed.
  21249. * kjs/GlobalEvalFunction.cpp: Removed.
  21250. * kjs/GlobalEvalFunction.h: Removed.
  21251. * kjs/InternalFunction.cpp: Removed.
  21252. * kjs/InternalFunction.h: Removed.
  21253. * kjs/JSArray.cpp: Removed.
  21254. * kjs/JSArray.h: Removed.
  21255. * kjs/JSCell.cpp: Removed.
  21256. * kjs/JSCell.h: Removed.
  21257. * kjs/JSFunction.cpp: Removed.
  21258. * kjs/JSFunction.h: Removed.
  21259. * kjs/JSGlobalObject.cpp: Removed.
  21260. * kjs/JSGlobalObject.h: Removed.
  21261. * kjs/JSGlobalObjectFunctions.cpp: Removed.
  21262. * kjs/JSGlobalObjectFunctions.h: Removed.
  21263. * kjs/JSImmediate.cpp: Removed.
  21264. * kjs/JSImmediate.h: Removed.
  21265. * kjs/JSNotAnObject.cpp: Removed.
  21266. * kjs/JSNotAnObject.h: Removed.
  21267. * kjs/JSNumberCell.cpp: Removed.
  21268. * kjs/JSNumberCell.h: Removed.
  21269. * kjs/JSObject.cpp: Removed.
  21270. * kjs/JSObject.h: Removed.
  21271. * kjs/JSString.cpp: Removed.
  21272. * kjs/JSString.h: Removed.
  21273. * kjs/JSValue.cpp: Removed.
  21274. * kjs/JSValue.h: Removed.
  21275. * kjs/JSVariableObject.cpp: Removed.
  21276. * kjs/JSVariableObject.h: Removed.
  21277. * kjs/JSWrapperObject.cpp: Removed.
  21278. * kjs/JSWrapperObject.h: Removed.
  21279. * kjs/MathObject.cpp: Removed.
  21280. * kjs/MathObject.h: Removed.
  21281. * kjs/NativeErrorConstructor.cpp: Removed.
  21282. * kjs/NativeErrorConstructor.h: Removed.
  21283. * kjs/NativeErrorPrototype.cpp: Removed.
  21284. * kjs/NativeErrorPrototype.h: Removed.
  21285. * kjs/NumberConstructor.cpp: Removed.
  21286. * kjs/NumberConstructor.h: Removed.
  21287. * kjs/NumberObject.cpp: Removed.
  21288. * kjs/NumberObject.h: Removed.
  21289. * kjs/NumberPrototype.cpp: Removed.
  21290. * kjs/NumberPrototype.h: Removed.
  21291. * kjs/ObjectConstructor.cpp: Removed.
  21292. * kjs/ObjectConstructor.h: Removed.
  21293. * kjs/ObjectPrototype.cpp: Removed.
  21294. * kjs/ObjectPrototype.h: Removed.
  21295. * kjs/PropertyMap.cpp: Removed.
  21296. * kjs/PropertyMap.h: Removed.
  21297. * kjs/PropertySlot.cpp: Removed.
  21298. * kjs/PropertySlot.h: Removed.
  21299. * kjs/PrototypeFunction.cpp: Removed.
  21300. * kjs/PrototypeFunction.h: Removed.
  21301. * kjs/PutPropertySlot.h: Removed.
  21302. * kjs/SmallStrings.cpp: Removed.
  21303. * kjs/SmallStrings.h: Removed.
  21304. * kjs/StringConstructor.cpp: Removed.
  21305. * kjs/StringConstructor.h: Removed.
  21306. * kjs/StringObject.cpp: Removed.
  21307. * kjs/StringObject.h: Removed.
  21308. * kjs/StringObjectThatMasqueradesAsUndefined.h: Removed.
  21309. * kjs/StringPrototype.cpp: Removed.
  21310. * kjs/StringPrototype.h: Removed.
  21311. * kjs/StructureID.cpp: Removed.
  21312. * kjs/StructureID.h: Removed.
  21313. * kjs/completion.h:
  21314. * kjs/interpreter.h:
  21315. * runtime: Added.
  21316. * runtime/ArrayConstructor.cpp: Copied from kjs/ArrayConstructor.cpp.
  21317. * runtime/ArrayConstructor.h: Copied from kjs/ArrayConstructor.h.
  21318. * runtime/ArrayPrototype.cpp: Copied from kjs/ArrayPrototype.cpp.
  21319. * runtime/ArrayPrototype.h: Copied from kjs/ArrayPrototype.h.
  21320. * runtime/BooleanConstructor.cpp: Copied from kjs/BooleanConstructor.cpp.
  21321. * runtime/BooleanConstructor.h: Copied from kjs/BooleanConstructor.h.
  21322. * runtime/BooleanObject.cpp: Copied from kjs/BooleanObject.cpp.
  21323. * runtime/BooleanObject.h: Copied from kjs/BooleanObject.h.
  21324. * runtime/BooleanPrototype.cpp: Copied from kjs/BooleanPrototype.cpp.
  21325. * runtime/BooleanPrototype.h: Copied from kjs/BooleanPrototype.h.
  21326. * runtime/CallData.cpp: Copied from kjs/CallData.cpp.
  21327. * runtime/CallData.h: Copied from kjs/CallData.h.
  21328. * runtime/ClassInfo.h: Copied from kjs/ClassInfo.h.
  21329. * runtime/ConstructData.cpp: Copied from kjs/ConstructData.cpp.
  21330. * runtime/ConstructData.h: Copied from kjs/ConstructData.h.
  21331. * runtime/DateConstructor.cpp: Copied from kjs/DateConstructor.cpp.
  21332. * runtime/DateConstructor.h: Copied from kjs/DateConstructor.h.
  21333. * runtime/DateInstance.cpp: Copied from kjs/DateInstance.cpp.
  21334. * runtime/DateInstance.h: Copied from kjs/DateInstance.h.
  21335. * runtime/DateMath.cpp: Copied from kjs/DateMath.cpp.
  21336. * runtime/DateMath.h: Copied from kjs/DateMath.h.
  21337. * runtime/DatePrototype.cpp: Copied from kjs/DatePrototype.cpp.
  21338. * runtime/DatePrototype.h: Copied from kjs/DatePrototype.h.
  21339. * runtime/Error.cpp: Copied from kjs/Error.cpp.
  21340. * runtime/Error.h: Copied from kjs/Error.h.
  21341. * runtime/ErrorConstructor.cpp: Copied from kjs/ErrorConstructor.cpp.
  21342. * runtime/ErrorConstructor.h: Copied from kjs/ErrorConstructor.h.
  21343. * runtime/ErrorInstance.cpp: Copied from kjs/ErrorInstance.cpp.
  21344. * runtime/ErrorInstance.h: Copied from kjs/ErrorInstance.h.
  21345. * runtime/ErrorPrototype.cpp: Copied from kjs/ErrorPrototype.cpp.
  21346. * runtime/ErrorPrototype.h: Copied from kjs/ErrorPrototype.h.
  21347. * runtime/FunctionConstructor.cpp: Copied from kjs/FunctionConstructor.cpp.
  21348. * runtime/FunctionConstructor.h: Copied from kjs/FunctionConstructor.h.
  21349. * runtime/FunctionPrototype.cpp: Copied from kjs/FunctionPrototype.cpp.
  21350. * runtime/FunctionPrototype.h: Copied from kjs/FunctionPrototype.h.
  21351. * runtime/GlobalEvalFunction.cpp: Copied from kjs/GlobalEvalFunction.cpp.
  21352. * runtime/GlobalEvalFunction.h: Copied from kjs/GlobalEvalFunction.h.
  21353. * runtime/InternalFunction.cpp: Copied from kjs/InternalFunction.cpp.
  21354. * runtime/InternalFunction.h: Copied from kjs/InternalFunction.h.
  21355. * runtime/JSArray.cpp: Copied from kjs/JSArray.cpp.
  21356. * runtime/JSArray.h: Copied from kjs/JSArray.h.
  21357. * runtime/JSCell.cpp: Copied from kjs/JSCell.cpp.
  21358. * runtime/JSCell.h: Copied from kjs/JSCell.h.
  21359. * runtime/JSFunction.cpp: Copied from kjs/JSFunction.cpp.
  21360. * runtime/JSFunction.h: Copied from kjs/JSFunction.h.
  21361. * runtime/JSGlobalObject.cpp: Copied from kjs/JSGlobalObject.cpp.
  21362. * runtime/JSGlobalObject.h: Copied from kjs/JSGlobalObject.h.
  21363. * runtime/JSGlobalObjectFunctions.cpp: Copied from kjs/JSGlobalObjectFunctions.cpp.
  21364. * runtime/JSGlobalObjectFunctions.h: Copied from kjs/JSGlobalObjectFunctions.h.
  21365. * runtime/JSImmediate.cpp: Copied from kjs/JSImmediate.cpp.
  21366. * runtime/JSImmediate.h: Copied from kjs/JSImmediate.h.
  21367. * runtime/JSNotAnObject.cpp: Copied from kjs/JSNotAnObject.cpp.
  21368. * runtime/JSNotAnObject.h: Copied from kjs/JSNotAnObject.h.
  21369. * runtime/JSNumberCell.cpp: Copied from kjs/JSNumberCell.cpp.
  21370. * runtime/JSNumberCell.h: Copied from kjs/JSNumberCell.h.
  21371. * runtime/JSObject.cpp: Copied from kjs/JSObject.cpp.
  21372. * runtime/JSObject.h: Copied from kjs/JSObject.h.
  21373. * runtime/JSString.cpp: Copied from kjs/JSString.cpp.
  21374. * runtime/JSString.h: Copied from kjs/JSString.h.
  21375. * runtime/JSValue.cpp: Copied from kjs/JSValue.cpp.
  21376. * runtime/JSValue.h: Copied from kjs/JSValue.h.
  21377. * runtime/JSVariableObject.cpp: Copied from kjs/JSVariableObject.cpp.
  21378. * runtime/JSVariableObject.h: Copied from kjs/JSVariableObject.h.
  21379. * runtime/JSWrapperObject.cpp: Copied from kjs/JSWrapperObject.cpp.
  21380. * runtime/JSWrapperObject.h: Copied from kjs/JSWrapperObject.h.
  21381. * runtime/MathObject.cpp: Copied from kjs/MathObject.cpp.
  21382. * runtime/MathObject.h: Copied from kjs/MathObject.h.
  21383. * runtime/NativeErrorConstructor.cpp: Copied from kjs/NativeErrorConstructor.cpp.
  21384. * runtime/NativeErrorConstructor.h: Copied from kjs/NativeErrorConstructor.h.
  21385. * runtime/NativeErrorPrototype.cpp: Copied from kjs/NativeErrorPrototype.cpp.
  21386. * runtime/NativeErrorPrototype.h: Copied from kjs/NativeErrorPrototype.h.
  21387. * runtime/NumberConstructor.cpp: Copied from kjs/NumberConstructor.cpp.
  21388. * runtime/NumberConstructor.h: Copied from kjs/NumberConstructor.h.
  21389. * runtime/NumberObject.cpp: Copied from kjs/NumberObject.cpp.
  21390. * runtime/NumberObject.h: Copied from kjs/NumberObject.h.
  21391. * runtime/NumberPrototype.cpp: Copied from kjs/NumberPrototype.cpp.
  21392. * runtime/NumberPrototype.h: Copied from kjs/NumberPrototype.h.
  21393. * runtime/ObjectConstructor.cpp: Copied from kjs/ObjectConstructor.cpp.
  21394. * runtime/ObjectConstructor.h: Copied from kjs/ObjectConstructor.h.
  21395. * runtime/ObjectPrototype.cpp: Copied from kjs/ObjectPrototype.cpp.
  21396. * runtime/ObjectPrototype.h: Copied from kjs/ObjectPrototype.h.
  21397. * runtime/PropertyMap.cpp: Copied from kjs/PropertyMap.cpp.
  21398. * runtime/PropertyMap.h: Copied from kjs/PropertyMap.h.
  21399. * runtime/PropertySlot.cpp: Copied from kjs/PropertySlot.cpp.
  21400. * runtime/PropertySlot.h: Copied from kjs/PropertySlot.h.
  21401. * runtime/PrototypeFunction.cpp: Copied from kjs/PrototypeFunction.cpp.
  21402. * runtime/PrototypeFunction.h: Copied from kjs/PrototypeFunction.h.
  21403. * runtime/PutPropertySlot.h: Copied from kjs/PutPropertySlot.h.
  21404. * runtime/SmallStrings.cpp: Copied from kjs/SmallStrings.cpp.
  21405. * runtime/SmallStrings.h: Copied from kjs/SmallStrings.h.
  21406. * runtime/StringConstructor.cpp: Copied from kjs/StringConstructor.cpp.
  21407. * runtime/StringConstructor.h: Copied from kjs/StringConstructor.h.
  21408. * runtime/StringObject.cpp: Copied from kjs/StringObject.cpp.
  21409. * runtime/StringObject.h: Copied from kjs/StringObject.h.
  21410. * runtime/StringObjectThatMasqueradesAsUndefined.h: Copied from kjs/StringObjectThatMasqueradesAsUndefined.h.
  21411. * runtime/StringPrototype.cpp: Copied from kjs/StringPrototype.cpp.
  21412. * runtime/StringPrototype.h: Copied from kjs/StringPrototype.h.
  21413. * runtime/StructureID.cpp: Copied from kjs/StructureID.cpp.
  21414. * runtime/StructureID.h: Copied from kjs/StructureID.h.
  21415. 2008-10-28 Geoffrey Garen <ggaren@apple.com>
  21416. Reviewed by Sam Weinig.
  21417. Fixed https://bugs.webkit.org/show_bug.cgi?id=21919
  21418. Sampler reports bogus time in op_enter during 3d-raytrace.js
  21419. Fixed a bug where we would pass the incorrect Instruction* during some
  21420. parts of CTI codegen.
  21421. * VM/CTI.cpp:
  21422. (JSC::CTI::privateCompileMainPass):
  21423. (JSC::CTI::privateCompileSlowCases):
  21424. * VM/SamplingTool.cpp:
  21425. (JSC::SamplingTool::run):
  21426. * wtf/Platform.h:
  21427. 2008-10-28 Kevin McCullough <kmccullough@apple.com>
  21428. Reviewed by Dan Bernstein.
  21429. -Removed unused includes.
  21430. Apparent .4% speedup in Sunspider
  21431. * kjs/JSObject.cpp:
  21432. * kjs/interpreter.cpp:
  21433. 2008-10-28 Alp Toker <alp@nuanti.com>
  21434. Include copyright license files in the autotools dist target.
  21435. Change suggested by Mike Hommey.
  21436. * GNUmakefile.am:
  21437. 2008-10-27 Geoffrey Garen <ggaren@apple.com>
  21438. Reviewed by Maciej Stachowiak.
  21439. Stop discarding CodeBlock samples that can't be charged to a specific
  21440. opcode. Instead, charge the relevant CodeBlock, and provide a footnote
  21441. explaining the situation.
  21442. This will help us tell which CodeBlocks are hot, even if we can't
  21443. identify specific lines of code within the CodeBlocks.
  21444. * VM/SamplingTool.cpp:
  21445. (JSC::ScopeSampleRecord::sample):
  21446. (JSC::compareScopeSampleRecords):
  21447. (JSC::SamplingTool::dump):
  21448. * VM/SamplingTool.h:
  21449. (JSC::ScopeSampleRecord::ScopeSampleRecord):
  21450. (JSC::ScopeSampleRecord::~ScopeSampleRecord):
  21451. 2008-10-27 Geoffrey Garen <ggaren@apple.com>
  21452. Reviewed by Sam Weinig.
  21453. Added a mutex around the SamplingTool's ScopeNode* map, to solve a crash
  21454. when sampling the v8 tests.
  21455. * VM/SamplingTool.cpp:
  21456. (JSC::SamplingTool::run):
  21457. (JSC::SamplingTool::notifyOfScope):
  21458. * VM/SamplingTool.h: Since new ScopeNodes can be created after
  21459. the SamplingTools has begun sampling, reads and writes to / from the
  21460. map need to be synchronized. Shark says this doesn't measurably increase
  21461. sampling overhead.
  21462. 2008-10-25 Geoffrey Garen <ggaren@apple.com>
  21463. Not reviewed.
  21464. Try to fix Windows build.
  21465. * VM/Machine.cpp:
  21466. (JSC::Machine::privateExecute): Provide a dummy value to the
  21467. HostCallRecord in CTI non-sampling builds, to silence compiler warning.
  21468. 2008-10-25 Geoffrey Garen <ggaren@apple.com>
  21469. Not reviewed.
  21470. Try to fix Windows build.
  21471. * VM/SamplingTool.h:
  21472. (JSC::SamplingTool::encodeSample): Explicitly cast bool to int, to
  21473. silence compiler warning.
  21474. 2008-10-25 Geoffrey Garen <ggaren@apple.com>
  21475. Reviewed by Sam Weinig, with Gavin Barraclough's help.
  21476. Fixed Sampling Tool:
  21477. - Made CodeBlock sampling work with CTI
  21478. - Improved accuracy by unifying most sampling data into a single
  21479. 32bit word, which can be written / read atomically.
  21480. - Split out three different #ifdefs for modularity: OPCODE_SAMPLING;
  21481. CODEBLOCK_SAMPLING; OPCODE_STATS.
  21482. - Improved reporting clarity
  21483. - Refactored for code clarity
  21484. * JavaScriptCore.exp: Exported another symbol.
  21485. * VM/CTI.cpp:
  21486. (JSC::CTI::emitCTICall):
  21487. (JSC::CTI::compileOpCall):
  21488. (JSC::CTI::emitSlowScriptCheck):
  21489. (JSC::CTI::compileBinaryArithOpSlowCase):
  21490. (JSC::CTI::privateCompileMainPass):
  21491. (JSC::CTI::privateCompileSlowCases):
  21492. (JSC::CTI::privateCompile):
  21493. * VM/CTI.h: Updated CTI codegen to use the unified SamplingTool interface
  21494. for encoding samples. (This required passing the current vPC to a lot
  21495. more functions, since the unified interface samples the current vPC.)
  21496. Added hooks for writing the current CodeBlock* on function entry and
  21497. after a function call, for the sake of the CodeBlock sampler. Removed
  21498. obsolete hook for clearing the current sample inside op_end. Also removed
  21499. the custom enum used to differentiate flavors of op_call, since the
  21500. OpcodeID enum works just as well. (This was important in an earlier
  21501. version of the patch, but now it's just cleanup.)
  21502. * VM/CodeBlock.cpp:
  21503. (JSC::CodeBlock::lineNumberForVPC):
  21504. * VM/CodeBlock.h: Upated for refactored #ifdefs. Changed lineNumberForVPC
  21505. to be robust against vPCs not recorded for exception handling, since
  21506. the Sampler may ask for an arbitrary vPC.
  21507. * VM/Machine.cpp:
  21508. (JSC::Machine::execute):
  21509. (JSC::Machine::privateExecute):
  21510. (JSC::Machine::cti_op_call_NotJSFunction):
  21511. (JSC::Machine::cti_op_construct_NotJSConstruct):
  21512. * VM/Machine.h:
  21513. (JSC::Machine::setSampler):
  21514. (JSC::Machine::sampler):
  21515. (JSC::Machine::jitCodeBuffer): Upated for refactored #ifdefs. Changed
  21516. Machine to use SamplingTool helper objects to record movement in and
  21517. out of host code. This makes samples a bit more precise.
  21518. * VM/Opcode.cpp:
  21519. (JSC::OpcodeStats::~OpcodeStats):
  21520. * VM/Opcode.h: Upated for refactored #ifdefs. Added a little more padding,
  21521. to accomodate our more verbose opcode names.
  21522. * VM/SamplingTool.cpp:
  21523. (JSC::ScopeSampleRecord::sample): Only count a sample toward our total
  21524. if we actually record it. This solves cases where a CodeBlock will
  21525. claim to have been sampled many times, with reported samples that don't
  21526. match.
  21527. (JSC::SamplingTool::run): Read the current sample into a Sample helper
  21528. object, to ensure that the data doesn't change while we're analyzing it,
  21529. and to help decode the data. Only access the CodeBlock sampling hash
  21530. table if CodeBlock sampling has been enabled, so non-CodeBlock sampling
  21531. runs can operate with even less overhead.
  21532. (JSC::SamplingTool::dump): I reorganized this code a lot to print the
  21533. most important info at the top, print as a table, annotate and document
  21534. the stuff I didn't understand when I started, etc.
  21535. * VM/SamplingTool.h: New helper classes, described above.
  21536. * kjs/Parser.h:
  21537. * kjs/Shell.cpp:
  21538. (runWithScripts):
  21539. * kjs/nodes.cpp:
  21540. (JSC::ScopeNode::ScopeNode): Updated for new sampling APIs.
  21541. * wtf/Platform.h: Moved sampling #defines here, since our custom is to
  21542. put ENABLE #defines into Platform.h. Made explicit the fact that
  21543. CODEBLOCK_SAMPLING depends on OPCODE_SAMPLING.
  21544. 2008-10-25 Jan Michael Alonzo <jmalonzo@webkit.org>
  21545. JSC Build fix, not reviewed.
  21546. * VM/CTI.cpp: add missing include stdio.h for debug builds
  21547. 2008-10-24 Eric Seidel <eric@webkit.org>
  21548. Reviewed by Darin Adler.
  21549. Get rid of a bonus ASSERT when using a null string as a regexp.
  21550. Specifically calling: RegularExpression::match() with String::empty()
  21551. will hit this ASSERT.
  21552. Chromium hits this, but I don't know of any way to make a layout test.
  21553. * pcre/pcre_exec.cpp:
  21554. (jsRegExpExecute):
  21555. 2008-10-24 Alexey Proskuryakov <ap@webkit.org>
  21556. Suggested and rubber-stamped by Geoff Garen.
  21557. Fix a crash when opening Font Picker.
  21558. The change also hopefully fixes this bug, which I could never reproduce:
  21559. https://bugs.webkit.org/show_bug.cgi?id=20241
  21560. <rdar://problem/6290576> Safari crashes at JSValueUnprotect() when fontpicker view close
  21561. * API/JSContextRef.cpp: (JSContextGetGlobalObject): Use lexical global object instead of
  21562. dynamic one.
  21563. 2008-10-24 Cameron Zwarich <zwarich@apple.com>
  21564. Reviewed by Geoff Garen.
  21565. Remove ScopeChainNode::bottom() and inline it into its only caller,
  21566. ScopeChainnode::globalObject().
  21567. * kjs/JSGlobalObject.h:
  21568. (JSC::ScopeChainNode::globalObject):
  21569. * kjs/ScopeChain.h:
  21570. (JSC::ScopeChain::bottom):
  21571. 2008-10-24 Cameron Zwarich <zwarich@apple.com>
  21572. Reviewed by Maciej Stachowiak.
  21573. Bug 21862: Create JSFunction prototype property lazily
  21574. <https://bugs.webkit.org/show_bug.cgi?id=21862>
  21575. This is a 1.5% speedup on SunSpider and a 1.4% speedup on the V8
  21576. benchmark suite, including a 3.8% speedup on Earley-Boyer.
  21577. * kjs/JSFunction.cpp:
  21578. (JSC::JSFunction::getOwnPropertySlot):
  21579. * kjs/nodes.cpp:
  21580. (JSC::FuncDeclNode::makeFunction):
  21581. (JSC::FuncExprNode::makeFunction):
  21582. 2008-10-24 Greg Bolsinga <bolsinga@apple.com>
  21583. Reviewed by Sam Weinig.
  21584. https://bugs.webkit.org/show_bug.cgi?id=21475
  21585. Provide support for the Geolocation API
  21586. http://dev.w3.org/geo/api/spec-source.html
  21587. * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
  21588. 2008-10-24 Darin Adler <darin@apple.com>
  21589. - finish rolling out https://bugs.webkit.org/show_bug.cgi?id=21732
  21590. * API/APICast.h:
  21591. * API/JSCallbackConstructor.h:
  21592. * API/JSCallbackFunction.cpp:
  21593. * API/JSCallbackFunction.h:
  21594. * API/JSCallbackObject.h:
  21595. * API/JSCallbackObjectFunctions.h:
  21596. * API/JSContextRef.cpp:
  21597. * API/JSObjectRef.cpp:
  21598. * API/JSValueRef.cpp:
  21599. * VM/CTI.cpp:
  21600. * VM/CTI.h:
  21601. * VM/CodeBlock.cpp:
  21602. * VM/CodeBlock.h:
  21603. * VM/CodeGenerator.cpp:
  21604. * VM/CodeGenerator.h:
  21605. * VM/ExceptionHelpers.cpp:
  21606. * VM/ExceptionHelpers.h:
  21607. * VM/JSPropertyNameIterator.cpp:
  21608. * VM/JSPropertyNameIterator.h:
  21609. * VM/Machine.cpp:
  21610. * VM/Machine.h:
  21611. * VM/Register.h:
  21612. * kjs/ArgList.cpp:
  21613. * kjs/ArgList.h:
  21614. * kjs/Arguments.cpp:
  21615. * kjs/Arguments.h:
  21616. * kjs/ArrayConstructor.cpp:
  21617. * kjs/ArrayPrototype.cpp:
  21618. * kjs/BooleanConstructor.cpp:
  21619. * kjs/BooleanConstructor.h:
  21620. * kjs/BooleanObject.h:
  21621. * kjs/BooleanPrototype.cpp:
  21622. * kjs/CallData.cpp:
  21623. * kjs/CallData.h:
  21624. * kjs/ConstructData.cpp:
  21625. * kjs/ConstructData.h:
  21626. * kjs/DateConstructor.cpp:
  21627. * kjs/DateInstance.h:
  21628. * kjs/DatePrototype.cpp:
  21629. * kjs/DatePrototype.h:
  21630. * kjs/DebuggerCallFrame.cpp:
  21631. * kjs/DebuggerCallFrame.h:
  21632. * kjs/ErrorConstructor.cpp:
  21633. * kjs/ErrorPrototype.cpp:
  21634. * kjs/ExecState.cpp:
  21635. * kjs/ExecState.h:
  21636. * kjs/FunctionConstructor.cpp:
  21637. * kjs/FunctionPrototype.cpp:
  21638. * kjs/FunctionPrototype.h:
  21639. * kjs/GetterSetter.cpp:
  21640. * kjs/GetterSetter.h:
  21641. * kjs/InternalFunction.h:
  21642. * kjs/JSActivation.cpp:
  21643. * kjs/JSActivation.h:
  21644. * kjs/JSArray.cpp:
  21645. * kjs/JSArray.h:
  21646. * kjs/JSCell.cpp:
  21647. * kjs/JSCell.h:
  21648. * kjs/JSFunction.cpp:
  21649. * kjs/JSFunction.h:
  21650. * kjs/JSGlobalData.h:
  21651. * kjs/JSGlobalObject.cpp:
  21652. * kjs/JSGlobalObject.h:
  21653. * kjs/JSGlobalObjectFunctions.cpp:
  21654. * kjs/JSGlobalObjectFunctions.h:
  21655. * kjs/JSImmediate.cpp:
  21656. * kjs/JSImmediate.h:
  21657. * kjs/JSNotAnObject.cpp:
  21658. * kjs/JSNotAnObject.h:
  21659. * kjs/JSNumberCell.cpp:
  21660. * kjs/JSNumberCell.h:
  21661. * kjs/JSObject.cpp:
  21662. * kjs/JSObject.h:
  21663. * kjs/JSStaticScopeObject.cpp:
  21664. * kjs/JSStaticScopeObject.h:
  21665. * kjs/JSString.cpp:
  21666. * kjs/JSString.h:
  21667. * kjs/JSValue.h:
  21668. * kjs/JSVariableObject.h:
  21669. * kjs/JSWrapperObject.h:
  21670. * kjs/MathObject.cpp:
  21671. * kjs/MathObject.h:
  21672. * kjs/NativeErrorConstructor.cpp:
  21673. * kjs/NumberConstructor.cpp:
  21674. * kjs/NumberConstructor.h:
  21675. * kjs/NumberObject.cpp:
  21676. * kjs/NumberObject.h:
  21677. * kjs/NumberPrototype.cpp:
  21678. * kjs/ObjectConstructor.cpp:
  21679. * kjs/ObjectPrototype.cpp:
  21680. * kjs/ObjectPrototype.h:
  21681. * kjs/PropertyMap.h:
  21682. * kjs/PropertySlot.cpp:
  21683. * kjs/PropertySlot.h:
  21684. * kjs/RegExpConstructor.cpp:
  21685. * kjs/RegExpConstructor.h:
  21686. * kjs/RegExpMatchesArray.h:
  21687. * kjs/RegExpObject.cpp:
  21688. * kjs/RegExpObject.h:
  21689. * kjs/RegExpPrototype.cpp:
  21690. * kjs/Shell.cpp:
  21691. * kjs/StringConstructor.cpp:
  21692. * kjs/StringObject.cpp:
  21693. * kjs/StringObject.h:
  21694. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  21695. * kjs/StringPrototype.cpp:
  21696. * kjs/StructureID.cpp:
  21697. * kjs/StructureID.h:
  21698. * kjs/collector.cpp:
  21699. * kjs/collector.h:
  21700. * kjs/completion.h:
  21701. * kjs/grammar.y:
  21702. * kjs/interpreter.cpp:
  21703. * kjs/interpreter.h:
  21704. * kjs/lookup.cpp:
  21705. * kjs/lookup.h:
  21706. * kjs/nodes.h:
  21707. * kjs/operations.cpp:
  21708. * kjs/operations.h:
  21709. * kjs/protect.h:
  21710. * profiler/ProfileGenerator.cpp:
  21711. * profiler/Profiler.cpp:
  21712. * profiler/Profiler.h:
  21713. Use JSValue* instead of JSValuePtr.
  21714. 2008-10-24 David Kilzer <ddkilzer@apple.com>
  21715. Rolled out r37840.
  21716. * wtf/Platform.h:
  21717. 2008-10-23 Greg Bolsinga <bolsinga@apple.com>
  21718. Reviewed by Sam Weinig.
  21719. https://bugs.webkit.org/show_bug.cgi?id=21475
  21720. Provide support for the Geolocation API
  21721. http://dev.w3.org/geo/api/spec-source.html
  21722. * wtf/Platform.h: ENABLE_GEOLOCATION defaults to 0
  21723. 2008-10-23 David Kilzer <ddkilzer@apple.com>
  21724. Bug 21832: Fix scripts using 'new File::Temp' for Perl 5.10
  21725. <https://bugs.webkit.org/show_bug.cgi?id=21832>
  21726. Reviewed by Sam Weinig.
  21727. * pcre/dftables: Use imported tempfile() from File::Temp instead of
  21728. 'new File::Temp' to make the script work with Perl 5.10.
  21729. 2008-10-23 Gavin Barraclough <barraclough@apple.com>
  21730. Reviewed by Oliver Hunt.
  21731. Fix hideous pathological case performance when looking up repatch info, bug #21727.
  21732. When repatching JIT code to optimize we look up records providing information about
  21733. the generated code (also used to track recsources used in linking to be later released).
  21734. The lookup was being performed using a linear scan of all such records.
  21735. (1) Split up the different types of reptach information. This means we can search them
  21736. separately, and in some cases should reduce their size.
  21737. (2) In the case of property accesses, search with a binary chop over the data.
  21738. (3) In the case of calls, pass a pointer to the repatch info into the relink function.
  21739. * VM/CTI.cpp:
  21740. (JSC::CTI::CTI):
  21741. (JSC::CTI::compileOpCall):
  21742. (JSC::CTI::privateCompileMainPass):
  21743. (JSC::CTI::privateCompileSlowCases):
  21744. (JSC::CTI::privateCompile):
  21745. (JSC::CTI::unlinkCall):
  21746. (JSC::CTI::linkCall):
  21747. * VM/CTI.h:
  21748. * VM/CodeBlock.cpp:
  21749. (JSC::CodeBlock::dump):
  21750. (JSC::CodeBlock::~CodeBlock):
  21751. (JSC::CodeBlock::unlinkCallers):
  21752. (JSC::CodeBlock::derefStructureIDs):
  21753. * VM/CodeBlock.h:
  21754. (JSC::StructureStubInfo::StructureStubInfo):
  21755. (JSC::CallLinkInfo::CallLinkInfo):
  21756. (JSC::CallLinkInfo::setUnlinked):
  21757. (JSC::CallLinkInfo::isLinked):
  21758. (JSC::getStructureStubInfoReturnLocation):
  21759. (JSC::binaryChop):
  21760. (JSC::CodeBlock::addCaller):
  21761. (JSC::CodeBlock::getStubInfo):
  21762. * VM/CodeGenerator.cpp:
  21763. (JSC::CodeGenerator::emitResolve):
  21764. (JSC::CodeGenerator::emitGetById):
  21765. (JSC::CodeGenerator::emitPutById):
  21766. (JSC::CodeGenerator::emitCall):
  21767. (JSC::CodeGenerator::emitConstruct):
  21768. * VM/Machine.cpp:
  21769. (JSC::Machine::cti_vm_lazyLinkCall):
  21770. 2008-10-23 Peter Kasting <pkasting@google.com>
  21771. Reviewed by Adam Roben.
  21772. https://bugs.webkit.org/show_bug.cgi?id=21833
  21773. Place JavaScript Debugger hooks under #if ENABLE(JAVASCRIPT_DEBUGGER).
  21774. * wtf/Platform.h:
  21775. 2008-10-23 David Kilzer <ddkilzer@apple.com>
  21776. Bug 21831: Fix create_hash_table for Perl 5.10
  21777. <https://bugs.webkit.org/show_bug.cgi?id=21831>
  21778. Reviewed by Sam Weinig.
  21779. * kjs/create_hash_table: Escaped square brackets so that Perl 5.10
  21780. doesn't try to use @nameEntries.
  21781. 2008-10-23 Darin Adler <darin@apple.com>
  21782. - roll out https://bugs.webkit.org/show_bug.cgi?id=21732
  21783. to remove the JSValuePtr class, to fix two problems
  21784. 1) slowness under MSVC, since it doesn't handle a
  21785. class with a single pointer in it as efficiently
  21786. as a pointer
  21787. 2) uninitialized pointers in Vector
  21788. * JavaScriptCore.exp: Updated.
  21789. * API/APICast.h:
  21790. (toRef):
  21791. * VM/CTI.cpp:
  21792. (JSC::CTI::asInteger):
  21793. * VM/CodeGenerator.cpp:
  21794. (JSC::CodeGenerator::addConstant):
  21795. * VM/CodeGenerator.h:
  21796. (JSC::CodeGenerator::JSValueHashTraits::constructDeletedValue):
  21797. (JSC::CodeGenerator::JSValueHashTraits::isDeletedValue):
  21798. * VM/Machine.cpp:
  21799. (JSC::Machine::cti_op_add):
  21800. (JSC::Machine::cti_op_pre_inc):
  21801. (JSC::Machine::cti_op_get_by_id):
  21802. (JSC::Machine::cti_op_get_by_id_second):
  21803. (JSC::Machine::cti_op_get_by_id_generic):
  21804. (JSC::Machine::cti_op_get_by_id_fail):
  21805. (JSC::Machine::cti_op_instanceof):
  21806. (JSC::Machine::cti_op_del_by_id):
  21807. (JSC::Machine::cti_op_mul):
  21808. (JSC::Machine::cti_op_call_NotJSFunction):
  21809. (JSC::Machine::cti_op_resolve):
  21810. (JSC::Machine::cti_op_construct_NotJSConstruct):
  21811. (JSC::Machine::cti_op_get_by_val):
  21812. (JSC::Machine::cti_op_sub):
  21813. (JSC::Machine::cti_op_lesseq):
  21814. (JSC::Machine::cti_op_negate):
  21815. (JSC::Machine::cti_op_resolve_base):
  21816. (JSC::Machine::cti_op_resolve_skip):
  21817. (JSC::Machine::cti_op_resolve_global):
  21818. (JSC::Machine::cti_op_div):
  21819. (JSC::Machine::cti_op_pre_dec):
  21820. (JSC::Machine::cti_op_not):
  21821. (JSC::Machine::cti_op_eq):
  21822. (JSC::Machine::cti_op_lshift):
  21823. (JSC::Machine::cti_op_bitand):
  21824. (JSC::Machine::cti_op_rshift):
  21825. (JSC::Machine::cti_op_bitnot):
  21826. (JSC::Machine::cti_op_mod):
  21827. (JSC::Machine::cti_op_less):
  21828. (JSC::Machine::cti_op_neq):
  21829. (JSC::Machine::cti_op_urshift):
  21830. (JSC::Machine::cti_op_bitxor):
  21831. (JSC::Machine::cti_op_bitor):
  21832. (JSC::Machine::cti_op_call_eval):
  21833. (JSC::Machine::cti_op_throw):
  21834. (JSC::Machine::cti_op_next_pname):
  21835. (JSC::Machine::cti_op_typeof):
  21836. (JSC::Machine::cti_op_is_undefined):
  21837. (JSC::Machine::cti_op_is_boolean):
  21838. (JSC::Machine::cti_op_is_number):
  21839. (JSC::Machine::cti_op_is_string):
  21840. (JSC::Machine::cti_op_is_object):
  21841. (JSC::Machine::cti_op_is_function):
  21842. (JSC::Machine::cti_op_stricteq):
  21843. (JSC::Machine::cti_op_nstricteq):
  21844. (JSC::Machine::cti_op_to_jsnumber):
  21845. (JSC::Machine::cti_op_in):
  21846. (JSC::Machine::cti_op_del_by_val):
  21847. (JSC::Machine::cti_vm_throw):
  21848. Removed calls to payload functions.
  21849. * VM/Register.h:
  21850. (JSC::Register::Register): Removed overload for JSCell and call
  21851. to payload function.
  21852. * kjs/JSCell.h: Changed JSCell to derive from JSValue again.
  21853. Removed JSValuePtr constructor.
  21854. (JSC::asCell): Changed cast from reinterpret_cast to static_cast.
  21855. * kjs/JSImmediate.h: Removed JSValuePtr class. Added typedef back.
  21856. * kjs/JSValue.h:
  21857. (JSC::JSValue::JSValue): Added empty protected inline constructor back.
  21858. (JSC::JSValue::~JSValue): Same for destructor.
  21859. Removed == and != operator for JSValuePtr.
  21860. * kjs/PropertySlot.h:
  21861. (JSC::PropertySlot::PropertySlot): Chnaged argument to const JSValue*
  21862. and added a const_cast.
  21863. * kjs/protect.h: Removed overloads and specialization for JSValuePtr.
  21864. 2008-10-22 Oliver Hunt <oliver@apple.com>
  21865. Reviewed by Maciej Stachowiak.
  21866. Really "fix" CTI mode on windows 2k3.
  21867. This adds new methods fastMallocExecutable and fastFreeExecutable
  21868. to wrap allocation for cti code. This still just makes fastMalloc
  21869. return executable memory all the time, which will be fixed in a
  21870. later patch.
  21871. However in windows debug builds all executable allocations will be
  21872. allocated on separate executable pages, which should resolve any
  21873. remaining 2k3 issues. Conveniently the 2k3 bot will now also fail
  21874. if there are any fastFree vs. fastFreeExecutable errors.
  21875. * ChangeLog:
  21876. * VM/CodeBlock.cpp:
  21877. (JSC::CodeBlock::~CodeBlock):
  21878. * kjs/regexp.cpp:
  21879. (JSC::RegExp::~RegExp):
  21880. * masm/X86Assembler.h:
  21881. (JSC::JITCodeBuffer::copy):
  21882. * wtf/FastMalloc.cpp:
  21883. (WTF::fastMallocExecutable):
  21884. (WTF::fastFreeExecutable):
  21885. (WTF::TCMallocStats::fastMallocExecutable):
  21886. (WTF::TCMallocStats::fastFreeExecutable):
  21887. * wtf/FastMalloc.h:
  21888. 2008-10-22 Darin Adler <darin@apple.com>
  21889. Reviewed by Sam Weinig.
  21890. - fix https://bugs.webkit.org/show_bug.cgi?id=21294
  21891. Bug 21294: Devirtualize getOwnPropertySlot()
  21892. A bit over 3% faster on V8 tests.
  21893. * JavascriptCore.exp: Export leak-related functions..
  21894. * API/JSCallbackConstructor.h:
  21895. (JSC::JSCallbackConstructor::createStructureID): Set HasStandardGetOwnPropertySlot
  21896. since this class doesn't override getPropertySlot.
  21897. * API/JSCallbackFunction.h:
  21898. (JSC::JSCallbackFunction::createStructureID): Ditto.
  21899. * VM/ExceptionHelpers.cpp:
  21900. (JSC::InterruptedExecutionError::InterruptedExecutionError): Use a structure
  21901. that's created just for this class instead of trying to share a single "null
  21902. prototype" structure.
  21903. * VM/Machine.cpp:
  21904. (JSC::Machine::cti_op_create_arguments_no_params): Rename
  21905. Arguments::ArgumentsNoParameters to Arguments::NoParameters.
  21906. * kjs/Arguments.h: Rename the enum from Arguments::ArgumentsParameters to
  21907. Arguments::NoParametersType and the value from Arguments::ArgumentsNoParameters
  21908. to Arguments::NoParameters.
  21909. (JSC::Arguments::createStructureID): Added. Returns a structure without
  21910. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21911. (JSC::Arguments::Arguments): Added an assertion that there are no parameters.
  21912. * kjs/DatePrototype.h:
  21913. (JSC::DatePrototype::createStructureID): Added. Returns a structure without
  21914. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21915. * kjs/FunctionPrototype.h:
  21916. (JSC::FunctionPrototype::createStructureID): Set HasStandardGetOwnPropertySlot
  21917. since this class doesn't override getPropertySlot.
  21918. * kjs/InternalFunction.h:
  21919. (JSC::InternalFunction::createStructureID): Ditto.
  21920. * kjs/JSArray.h:
  21921. (JSC::JSArray::createStructureID): Added. Returns a structure without
  21922. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21923. * kjs/JSCell.h: Added declaration of fastGetOwnPropertySlot; a non-virtual
  21924. version that uses the structure bit to decide whether to call the virtual
  21925. version.
  21926. * kjs/JSFunction.h:
  21927. (JSC::JSFunction::createStructureID): Added. Returns a structure without
  21928. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21929. * kjs/JSGlobalData.cpp:
  21930. (JSC::JSGlobalData::JSGlobalData): Initialize new structures; removed
  21931. nullProtoStructureID.
  21932. * kjs/JSGlobalData.h: Added new structures. Removed nullProtoStructureID.
  21933. * kjs/JSGlobalObject.h:
  21934. (JSC::JSGlobalObject::createStructureID): Added. Returns a structure without
  21935. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21936. * kjs/JSNotAnObject.h:
  21937. (JSC::JSNotAnObjectErrorStub::JSNotAnObjectErrorStub): Use a structure
  21938. that's created just for this class instead of trying to share a single "null
  21939. prototype" structure.
  21940. (JSC::JSNotAnObjectErrorStub::isNotAnObjectErrorStub): Marked this function
  21941. virtual for clarity and made it private since no one should call it if they
  21942. already have a pointer to this specific type.
  21943. (JSC::JSNotAnObject::JSNotAnObject): Use a structure that's created just
  21944. for this class instead of trying to share a single "null prototype" structure.
  21945. (JSC::JSNotAnObject::createStructureID): Added. Returns a structure without
  21946. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21947. * kjs/JSObject.h:
  21948. (JSC::JSObject::createStructureID): Added HasStandardGetOwnPropertySlot.
  21949. (JSC::JSObject::inlineGetOwnPropertySlot): Added. Used so we can share code
  21950. between getOwnPropertySlot and fastGetOwnPropertySlot.
  21951. (JSC::JSObject::getOwnPropertySlot): Moved so that functions are above the
  21952. functions that call them. Moved the guts of this function into
  21953. inlineGetOwnPropertySlot.
  21954. (JSC::JSCell::fastGetOwnPropertySlot): Added. Checks the
  21955. HasStandardGetOwnPropertySlot bit and if it's set, calls
  21956. inlineGetOwnPropertySlot, otherwise calls getOwnPropertySlot.
  21957. (JSC::JSObject::getPropertySlot): Changed to call fastGetOwnPropertySlot.
  21958. (JSC::JSValue::get): Changed to call fastGetOwnPropertySlot.
  21959. * kjs/JSWrapperObject.h: Made constructor protected to emphasize that
  21960. this class is only a base class and never instantiated.
  21961. * kjs/MathObject.h:
  21962. (JSC::MathObject::createStructureID): Added. Returns a structure without
  21963. HasStandardGetOwnPropertySlot since this class overrides getOwnPropertySlot.
  21964. * kjs/NumberConstructor.h:
  21965. (JSC::NumberConstructor::createStructureID): Ditto.
  21966. * kjs/RegExpConstructor.h:
  21967. (JSC::RegExpConstructor::createStructureID): Ditto.
  21968. * kjs/RegExpObject.h:
  21969. (JSC::RegExpObject::createStructureID): Ditto.
  21970. * kjs/StringObject.h:
  21971. (JSC::StringObject::createStructureID): Ditto.
  21972. * kjs/TypeInfo.h: Added HasStandardGetOwnPropertySlot flag and
  21973. hasStandardGetOwnPropertySlot accessor function.
  21974. 2008-10-22 Cameron Zwarich <zwarich@apple.com>
  21975. Reviewed by Geoff Garen.
  21976. Bug 21803: Fuse op_jfalse with op_eq_null and op_neq_null
  21977. <https://bugs.webkit.org/show_bug.cgi?id=21803>
  21978. Fuse op_jfalse with op_eq_null and op_neq_null to make the new opcodes
  21979. op_jeq_null and op_jneq_null.
  21980. This is a 2.6% speedup on the V8 Raytrace benchmark, and strangely also
  21981. a 4.7% speedup on the V8 Arguments benchmark, even though it uses
  21982. neither of the two new opcodes.
  21983. * VM/CTI.cpp:
  21984. (JSC::CTI::privateCompileMainPass):
  21985. * VM/CodeBlock.cpp:
  21986. (JSC::CodeBlock::dump):
  21987. * VM/CodeGenerator.cpp:
  21988. (JSC::CodeGenerator::emitJumpIfTrue):
  21989. (JSC::CodeGenerator::emitJumpIfFalse):
  21990. * VM/Machine.cpp:
  21991. (JSC::Machine::privateExecute):
  21992. * VM/Opcode.h:
  21993. 2008-10-22 Darin Fisher <darin@chromium.org>
  21994. Reviewed by Eric Seidel.
  21995. Should not define PLATFORM(WIN,MAC,GTK) when PLATFORM(CHROMIUM) is defined
  21996. https://bugs.webkit.org/show_bug.cgi?id=21757
  21997. PLATFORM(CHROMIUM) implies HAVE_ACCESSIBILITY
  21998. * wtf/Platform.h:
  21999. 2008-10-22 Cameron Zwarich <zwarich@apple.com>
  22000. Reviewed by Alexey Proskuryakov.
  22001. Correct opcode names in documentation.
  22002. * VM/Machine.cpp:
  22003. (JSC::Machine::privateExecute):
  22004. 2008-10-21 Oliver Hunt <oliver@apple.com>
  22005. RS=Maciej Stachowiak.
  22006. Force FastMalloc to make all allocated pages executable in
  22007. a vague hope this will allow the Win2k3 bot to be able to
  22008. run tests.
  22009. Filed Bug 21783: Need more granular control over allocation of executable memory
  22010. to cover a more granular version of this patch.
  22011. * wtf/TCSystemAlloc.cpp:
  22012. (TryVirtualAlloc):
  22013. 2008-10-21 Alexey Proskuryakov <ap@webkit.org>
  22014. Reviewed by Darin Adler.
  22015. https://bugs.webkit.org/show_bug.cgi?id=21769
  22016. MessagePort should be GC protected if there are messages to be delivered
  22017. * wtf/MessageQueue.h:
  22018. (WTF::::isEmpty): Added. Also added a warning for methods that return a snapshot of queue
  22019. state, thus likely to cause race conditions.
  22020. 2008-10-21 Darin Adler <darin@apple.com>
  22021. Reviewed by Maciej Stachowiak.
  22022. - convert post-increment to pre-increment in a couple more places for speed
  22023. Speeds up V8 benchmarks a little on most computers. (But, strangely, slows
  22024. them down a little on my computer.)
  22025. * kjs/nodes.cpp:
  22026. (JSC::statementListEmitCode): Removed default argument, since we always want
  22027. to specify this explicitly.
  22028. (JSC::ForNode::emitCode): Tolerate ignoredResult() as the dst -- means the
  22029. same thing as 0.
  22030. (JSC::ReturnNode::emitCode): Ditto.
  22031. (JSC::ThrowNode::emitCode): Ditto.
  22032. (JSC::FunctionBodyNode::emitCode): Pass ignoredResult() so that we know we
  22033. don't have to compute the result of function statements.
  22034. 2008-10-21 Peter Kasting <pkasting@google.com>
  22035. Reviewed by Maciej Stachowiak.
  22036. Fix an include of a non-public header to use "" instead of <>.
  22037. * API/JSProfilerPrivate.cpp:
  22038. 2008-10-20 Sam Weinig <sam@webkit.org>
  22039. Reviewed by Cameron Zwarich.
  22040. Fix for https://bugs.webkit.org/show_bug.cgi?id=21766
  22041. REGRESSION: 12 JSC tests fail
  22042. The JSGlobalObject was mutating the shared nullProtoStructureID when
  22043. used in jsc. Instead of using nullProtoStructureID, use a new StructureID.
  22044. * API/JSCallbackObject.h:
  22045. * API/JSCallbackObjectFunctions.h:
  22046. (JSC::::JSCallbackObject):
  22047. * API/JSContextRef.cpp:
  22048. (JSGlobalContextCreateInGroup):
  22049. * kjs/JSGlobalObject.h:
  22050. (JSC::JSGlobalObject::JSGlobalObject):
  22051. * kjs/Shell.cpp:
  22052. (GlobalObject::GlobalObject):
  22053. (jscmain):
  22054. 2008-10-20 Cameron Zwarich <zwarich@apple.com>
  22055. Reviewed by Maciej Stachowiak.
  22056. Remove an untaken branch in CodeGenerator::emitJumpIfFalse(). This
  22057. function is never called with a backwards target LabelID, and there is
  22058. even an assertion to this effect at the top of the function body.
  22059. * VM/CodeGenerator.cpp:
  22060. (JSC::CodeGenerator::emitJumpIfFalse):
  22061. 2008-10-20 Cameron Zwarich <zwarich@apple.com>
  22062. Rubber-stamped by Sam Weinig.
  22063. Add opcode documentation for undocumented opcodes.
  22064. * VM/Machine.cpp:
  22065. (JSC::Machine::privateExecute):
  22066. 2008-10-16 Sam Weinig <sam@webkit.org>
  22067. Reviewed by Cameron Zwarich.
  22068. Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
  22069. Don't create intermediate StructureIDs for builtin objects
  22070. Second stage in reduce number of StructureIDs created when initializing the
  22071. JSGlobalObject.
  22072. - Use putDirectWithoutTransition for the remaining singleton objects to reduce
  22073. the number of StructureIDs create for about:blank from 132 to 73.
  22074. * kjs/ArrayConstructor.cpp:
  22075. (JSC::ArrayConstructor::ArrayConstructor):
  22076. * kjs/BooleanConstructor.cpp:
  22077. (JSC::BooleanConstructor::BooleanConstructor):
  22078. * kjs/BooleanPrototype.cpp:
  22079. (JSC::BooleanPrototype::BooleanPrototype):
  22080. * kjs/DateConstructor.cpp:
  22081. (JSC::DateConstructor::DateConstructor):
  22082. * kjs/ErrorConstructor.cpp:
  22083. (JSC::ErrorConstructor::ErrorConstructor):
  22084. * kjs/ErrorPrototype.cpp:
  22085. (JSC::ErrorPrototype::ErrorPrototype):
  22086. * kjs/FunctionConstructor.cpp:
  22087. (JSC::FunctionConstructor::FunctionConstructor):
  22088. * kjs/FunctionPrototype.cpp:
  22089. (JSC::FunctionPrototype::FunctionPrototype):
  22090. (JSC::FunctionPrototype::addFunctionProperties):
  22091. * kjs/FunctionPrototype.h:
  22092. (JSC::FunctionPrototype::createStructureID):
  22093. * kjs/InternalFunction.cpp:
  22094. * kjs/InternalFunction.h:
  22095. (JSC::InternalFunction::InternalFunction):
  22096. * kjs/JSGlobalObject.cpp:
  22097. (JSC::JSGlobalObject::reset):
  22098. * kjs/JSObject.h:
  22099. * kjs/MathObject.cpp:
  22100. (JSC::MathObject::MathObject):
  22101. * kjs/NumberConstructor.cpp:
  22102. (JSC::NumberConstructor::NumberConstructor):
  22103. * kjs/NumberPrototype.cpp:
  22104. (JSC::NumberPrototype::NumberPrototype):
  22105. * kjs/ObjectConstructor.cpp:
  22106. (JSC::ObjectConstructor::ObjectConstructor):
  22107. * kjs/RegExpConstructor.cpp:
  22108. (JSC::RegExpConstructor::RegExpConstructor):
  22109. * kjs/RegExpPrototype.cpp:
  22110. (JSC::RegExpPrototype::RegExpPrototype):
  22111. * kjs/StringConstructor.cpp:
  22112. (JSC::StringConstructor::StringConstructor):
  22113. * kjs/StringPrototype.cpp:
  22114. (JSC::StringPrototype::StringPrototype):
  22115. * kjs/StructureID.cpp:
  22116. (JSC::StructureID::dumpStatistics):
  22117. * kjs/StructureID.h:
  22118. (JSC::StructureID::setPrototypeWithoutTransition):
  22119. 2008-10-20 Alp Toker <alp@nuanti.com>
  22120. Fix autotools dist build target by listing recently added header
  22121. files only. Not reviewed.
  22122. * GNUmakefile.am:
  22123. 2008-10-20 Geoffrey Garen <ggaren@apple.com>
  22124. Reviewed by Anders Carlsson.
  22125. * VM/Machine.cpp:
  22126. (JSC::Machine::tryCacheGetByID): Removed a redundant and sometimes
  22127. incorrect cast, which started ASSERTing after Darin's last checkin.
  22128. 2008-10-20 Geoffrey Garen <ggaren@apple.com>
  22129. Not reviewed.
  22130. Re-enable CTI, which I accidentally disabled while checking in fixes
  22131. to bytecode.
  22132. * wtf/Platform.h:
  22133. 2008-10-20 Alp Toker <alp@nuanti.com>
  22134. Rubber-stamped by Mark Rowe.
  22135. Typo fix in function name: mimimum -> minimum.
  22136. * kjs/DateMath.cpp:
  22137. (JSC::minimumYearForDST):
  22138. (JSC::equivalentYearForDST):
  22139. 2008-10-20 Alp Toker <alp@nuanti.com>
  22140. Reviewed by Mark Rowe.
  22141. Use pthread instead of GThread where possible in the GTK+ port. This
  22142. fixes issues with global initialisation, particularly on GTK+/Win32
  22143. where a late g_thread_init() will cause hangs.
  22144. * GNUmakefile.am:
  22145. * wtf/Platform.h:
  22146. * wtf/Threading.h:
  22147. * wtf/ThreadingGtk.cpp:
  22148. * wtf/ThreadingPthreads.cpp:
  22149. 2008-10-20 Geoffrey Garen <ggaren@apple.com>
  22150. Reviewed by Darin Adler.
  22151. Fixed https://bugs.webkit.org/show_bug.cgi?id=21735
  22152. Emit profiling instrumentation only if the Web Inspector's profiling
  22153. feature is enabled
  22154. 22.2% speedup on empty function call benchmark.
  22155. 2.9% speedup on v8 benchmark.
  22156. 0.7% speedup on SunSpider.
  22157. Lesser but similar speedups in bytecode.
  22158. * VM/CTI.cpp:
  22159. (JSC::CTI::compileOpCall):
  22160. (JSC::CTI::privateCompileMainPass):
  22161. (JSC::CTI::privateCompileSlowCases): Nixed JITed profiler hooks. Profiler
  22162. hooks now have their own opcodes. Added support for compiling profiler
  22163. hook opcodes.
  22164. (JSC::CodeBlock::dump): Dump support for the new profiling opcodes.
  22165. * VM/CodeGenerator.h:
  22166. * VM/CodeGenerator.cpp:
  22167. (JSC::CodeGenerator::CodeGenerator):
  22168. (JSC::CodeGenerator::emitCall):
  22169. (JSC::CodeGenerator::emitConstruct): Conditionally emit profiling hooks
  22170. around call and construct, at the call site. (It's easier to get things
  22171. right this way, if you have profiled code calling non-profiled code.
  22172. Also, you get a slightly more accurate profile, since you charge the full
  22173. cost of the call / construct operation to the callee.)
  22174. Also, fixed a bug where construct would fetch the ".prototype" property
  22175. from the constructor before evaluating the arguments to the constructor,
  22176. incorrectly allowing an "invalid constructor" exception to short-circuit
  22177. argument evaluation. I encountered this bug when trying to make
  22178. constructor exceptions work with profiling.
  22179. * VM/Machine.cpp:
  22180. (JSC::Machine::callEval): Removed obsolete profiler hooks.
  22181. (JSC::Machine::throwException): Added a check for an exception thrown
  22182. within a call instruction. We didn't need this before because the call
  22183. instruction would check for a valid call before involing the profiler.
  22184. (JSC::Machine::execute): Added a didExecute hook at the end of top-level
  22185. function invocation, since op_ret no longer does this for us.
  22186. (JSC::Machine::privateExecute): Removed obsolete profiler hooks. Added
  22187. profiler opcodes. Changed some ++vPC to vPC[x] notation, since the
  22188. latter is better for performance, and it makes reasoning about the
  22189. current opcode in exception handling much simpler.
  22190. (JSC::Machine::cti_op_call_NotJSFunction): Removed obsolete profiler
  22191. hooks.
  22192. (JSC::Machine::cti_op_create_arguments_no_params): Added missing
  22193. CTI_STACK_HACK that I noticed when adding CTI_STACK_HACK to the new
  22194. profiler opcode functions.
  22195. (JSC::Machine::cti_op_profile_will_call):
  22196. (JSC::Machine::cti_op_profile_did_call): The new profiler opcode
  22197. functions.
  22198. (JSC::Machine::cti_op_construct_NotJSConstruct): Removed obsolete profiler
  22199. hooks.
  22200. * VM/Machine.h:
  22201. (JSC::Machine::isCallOpcode): Helper for exception handling.
  22202. * VM/Opcode.h: Declare new opcodes.
  22203. * kjs/JSGlobalObject.h:
  22204. (JSC::JSGlobalObject::supportsProfiling): Added virtual interface that
  22205. allows WebCore to specify whether the target global object has the Web
  22206. Inspector's profiling feature enabled.
  22207. * profiler/Profiler.cpp:
  22208. (JSC::Profiler::willExecute):
  22209. (JSC::Profiler::didExecute):
  22210. (JSC::Profiler::createCallIdentifier):
  22211. * profiler/Profiler.h: Added support for invoking the profiler with
  22212. an arbitrary JSValue*, and not a known object. We didn't need this
  22213. before because the call instruction would check for a valid call before
  22214. involing the profiler.
  22215. 2008-10-20 Darin Adler <darin@apple.com>
  22216. Reviewed by Geoff Garen.
  22217. - get CTI working on Windows again
  22218. * VM/CTI.cpp:
  22219. (JSC::CTI::emitCTICall): Add an overload for functions that
  22220. return JSObject*.
  22221. * VM/CTI.h: Use JSValue* and JSObject* as return types for
  22222. cti_op functions. Apparently, MSVC doesn't handle returning
  22223. the JSValuePtr struct in a register. We'll have to look into
  22224. this more.
  22225. * VM/Machine.cpp:
  22226. (JSC::Machine::cti_op_convert_this):
  22227. (JSC::Machine::cti_op_add):
  22228. (JSC::Machine::cti_op_pre_inc):
  22229. (JSC::Machine::cti_op_new_object):
  22230. (JSC::Machine::cti_op_get_by_id):
  22231. (JSC::Machine::cti_op_get_by_id_second):
  22232. (JSC::Machine::cti_op_get_by_id_generic):
  22233. (JSC::Machine::cti_op_get_by_id_fail):
  22234. (JSC::Machine::cti_op_instanceof):
  22235. (JSC::Machine::cti_op_del_by_id):
  22236. (JSC::Machine::cti_op_mul):
  22237. (JSC::Machine::cti_op_new_func):
  22238. (JSC::Machine::cti_op_push_activation):
  22239. (JSC::Machine::cti_op_call_NotJSFunction):
  22240. (JSC::Machine::cti_op_new_array):
  22241. (JSC::Machine::cti_op_resolve):
  22242. (JSC::Machine::cti_op_construct_JSConstructFast):
  22243. (JSC::Machine::cti_op_construct_NotJSConstruct):
  22244. (JSC::Machine::cti_op_get_by_val):
  22245. (JSC::Machine::cti_op_sub):
  22246. (JSC::Machine::cti_op_lesseq):
  22247. (JSC::Machine::cti_op_negate):
  22248. (JSC::Machine::cti_op_resolve_base):
  22249. (JSC::Machine::cti_op_resolve_skip):
  22250. (JSC::Machine::cti_op_resolve_global):
  22251. (JSC::Machine::cti_op_div):
  22252. (JSC::Machine::cti_op_pre_dec):
  22253. (JSC::Machine::cti_op_not):
  22254. (JSC::Machine::cti_op_eq):
  22255. (JSC::Machine::cti_op_lshift):
  22256. (JSC::Machine::cti_op_bitand):
  22257. (JSC::Machine::cti_op_rshift):
  22258. (JSC::Machine::cti_op_bitnot):
  22259. (JSC::Machine::cti_op_new_func_exp):
  22260. (JSC::Machine::cti_op_mod):
  22261. (JSC::Machine::cti_op_less):
  22262. (JSC::Machine::cti_op_neq):
  22263. (JSC::Machine::cti_op_urshift):
  22264. (JSC::Machine::cti_op_bitxor):
  22265. (JSC::Machine::cti_op_new_regexp):
  22266. (JSC::Machine::cti_op_bitor):
  22267. (JSC::Machine::cti_op_call_eval):
  22268. (JSC::Machine::cti_op_throw):
  22269. (JSC::Machine::cti_op_next_pname):
  22270. (JSC::Machine::cti_op_typeof):
  22271. (JSC::Machine::cti_op_is_undefined):
  22272. (JSC::Machine::cti_op_is_boolean):
  22273. (JSC::Machine::cti_op_is_number):
  22274. (JSC::Machine::cti_op_is_string):
  22275. (JSC::Machine::cti_op_is_object):
  22276. (JSC::Machine::cti_op_is_function):
  22277. (JSC::Machine::cti_op_stricteq):
  22278. (JSC::Machine::cti_op_nstricteq):
  22279. (JSC::Machine::cti_op_to_jsnumber):
  22280. (JSC::Machine::cti_op_in):
  22281. (JSC::Machine::cti_op_push_new_scope):
  22282. (JSC::Machine::cti_op_del_by_val):
  22283. (JSC::Machine::cti_op_new_error):
  22284. (JSC::Machine::cti_vm_throw):
  22285. Change these functions to return pointer types, and never
  22286. JSValuePtr.
  22287. * VM/Machine.h: Ditto.
  22288. 2008-10-20 Geoffrey Garen <ggaren@apple.com>
  22289. Reviewed by Darin Adler.
  22290. Fixed some recent break-age in bytecode mode.
  22291. * VM/CodeBlock.cpp:
  22292. (JSC::CodeBlock::printStructureIDs): Fixed up an ASSERT caused by
  22293. Gavin's last checkin. This is a temporary fix so I can keep on moving.
  22294. I'll send email about what I think is an underlying problem soon.
  22295. * VM/Machine.cpp:
  22296. (JSC::Machine::privateExecute): Removed a redundant and sometimes
  22297. incorrect cast, which started ASSERTing after Darin's last checkin.
  22298. 2008-10-20 Darin Adler <darin@apple.com>
  22299. - another similar Windows build fix
  22300. * VM/CTI.cpp: Changed return type to JSObject* instead of JSValuePtr.
  22301. 2008-10-20 Darin Adler <darin@apple.com>
  22302. - try to fix Windows build
  22303. * VM/CTI.cpp: Use JSValue* instead of JSValuePtr for ctiTrampoline.
  22304. * VM/CTI.h: Ditto.
  22305. 2008-10-19 Darin Adler <darin@apple.com>
  22306. Reviewed by Cameron Zwarich.
  22307. - finish https://bugs.webkit.org/show_bug.cgi?id=21732
  22308. improve performance by eliminating JSValue as a base class for JSCell
  22309. * VM/Machine.cpp:
  22310. (JSC::Machine::cti_op_call_profiler): Use asFunction.
  22311. (JSC::Machine::cti_vm_lazyLinkCall): Ditto.
  22312. (JSC::Machine::cti_op_construct_JSConstructFast): Use asObject.
  22313. * kjs/JSCell.h: Re-sort friend classes. Eliminate inheritance from
  22314. JSValue. Changed cast in asCell from static_cast to reinterpret_cast.
  22315. Removed JSValue::getNumber(double&) and one of JSValue::getObject
  22316. overloads.
  22317. * kjs/JSValue.h: Made the private constructor and destructor both
  22318. non-virtual and also remove the definitions. This class can never
  22319. be instantiated or derived.
  22320. 2008-10-19 Darin Adler <darin@apple.com>
  22321. Reviewed by Cameron Zwarich.
  22322. - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
  22323. improve performance by eliminating JSValue as a base class for JSCell
  22324. Change JSValuePtr from a typedef into a class. This allows us to support
  22325. conversion from JSCell* to JSValuePtr even if JSCell isn't derived from
  22326. JSValue.
  22327. * JavaScriptCore.exp: Updated symbols that involve JSValuePtr, since
  22328. it's now a distinct type.
  22329. * API/APICast.h:
  22330. (toRef): Extract the JSValuePtr payload explicitly since we can't just
  22331. cast any more.
  22332. * VM/CTI.cpp:
  22333. (JSC::CTI::asInteger): Ditto.
  22334. * VM/CodeGenerator.cpp:
  22335. (JSC::CodeGenerator::addConstant): Get at the payload directly.
  22336. (JSC::CodeGenerator::emitLoad): Added an overload of JSCell* because
  22337. otherwise classes derived from JSValue end up calling the bool
  22338. overload instead of JSValuePtr.
  22339. * VM/CodeGenerator.h: Ditto. Also update traits to use JSValue*
  22340. and the payload functions.
  22341. * VM/Register.h: Added a JSCell* overload and use of payload functions.
  22342. * kjs/JSCell.h:
  22343. (JSC::asCell): Use payload function.
  22344. (JSC::JSValue::asCell): Use JSValue* instead of JSValuePtr.
  22345. (JSC::JSValuePtr::JSValuePtr): Added. Constructor that takes JSCell*
  22346. and creates a JSValuePtr.
  22347. * kjs/JSImmediate.h: Added JSValuePtr class. Also updated makeValue
  22348. and makeInt to work with JSValue* and the payload function.
  22349. * kjs/JSValue.h: Added == and != operators for JSValuePtr. Put them
  22350. here because eventually all the JSValue functions should go here
  22351. except what's needed by JSImmediate. Also fix asValue to use
  22352. JSValue* instead of JSValuePtr.
  22353. * kjs/PropertySlot.h: Change constructor to take JSValuePtr.
  22354. * kjs/protect.h: Update gcProtect functions to work with JSCell*
  22355. as well as JSValuePtr. Also updated the ProtectedPtr<JSValuePtr>
  22356. specialization to work more directly. Also changed all the call
  22357. sites to use gcProtectNullTolerant.
  22358. 2008-10-19 Darin Adler <darin@apple.com>
  22359. Reviewed by Oliver Hunt.
  22360. - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
  22361. improve performance by eliminating JSValue as a base class for JSCell
  22362. Remove most uses of JSValue, which will be removed in a future patch.
  22363. * VM/Machine.cpp:
  22364. (JSC::fastToUInt32): Call toUInt32SlowCase function; no longer a member
  22365. of JSValue.
  22366. * kjs/JSNumberCell.h:
  22367. (JSC::JSNumberCell::toInt32): Ditto.
  22368. (JSC::JSNumberCell::toUInt32): Ditto.
  22369. * kjs/JSValue.cpp:
  22370. (JSC::toInt32SlowCase): Made a non-member function.
  22371. (JSC::JSValue::toInt32SlowCase): Changed to call non-member function.
  22372. (JSC::toUInt32SlowCase): More of the same.
  22373. (JSC::JSValue::toUInt32SlowCase): Ditto.
  22374. * kjs/JSValue.h: Moved static member function so they are no longer
  22375. member functions at all.
  22376. * VM/CTI.h: Removed forward declaration of JSValue.
  22377. * VM/ExceptionHelpers.h: Ditto.
  22378. * kjs/CallData.h: Ditto.
  22379. * kjs/ConstructData.h: Ditto.
  22380. * kjs/JSGlobalObjectFunctions.h: Ditto.
  22381. * kjs/PropertyMap.h: Ditto.
  22382. * kjs/StructureID.h: Ditto.
  22383. * kjs/collector.h: Ditto.
  22384. * kjs/completion.h: Ditto.
  22385. * kjs/grammar.y:
  22386. (JSC::makeBitwiseNotNode): Call new non-member toInt32 function.
  22387. (JSC::makeLeftShiftNode): More of the same.
  22388. (JSC::makeRightShiftNode): Ditto.
  22389. * kjs/protect.h: Added a specialization for ProtectedPtr<JSValuePtr>
  22390. so this can be used with JSValuePtr.
  22391. 2008-10-18 Darin Adler <darin@apple.com>
  22392. Reviewed by Oliver Hunt.
  22393. - next step of https://bugs.webkit.org/show_bug.cgi?id=21732
  22394. improve performance by eliminating JSValue as a base class for JSCell
  22395. Tweak a little more to get closer to where we can make JSValuePtr a class.
  22396. * API/APICast.h:
  22397. (toJS): Change back to JSValue* here, since we're converting the
  22398. pointer type.
  22399. * VM/CTI.cpp:
  22400. (JSC::CTI::unlinkCall): Call asPointer.
  22401. * VM/CTI.h: Cast to JSValue* here, since it's a pointer cast.
  22402. * kjs/DebuggerCallFrame.h:
  22403. (JSC::DebuggerCallFrame::DebuggerCallFrame): Call noValue.
  22404. * kjs/JSGlobalData.cpp:
  22405. (JSC::JSGlobalData::JSGlobalData): Call noValue.
  22406. * kjs/JSImmediate.cpp:
  22407. (JSC::JSImmediate::toObject): Remove unneeded const_cast.
  22408. * kjs/JSWrapperObject.h:
  22409. (JSC::JSWrapperObject::JSWrapperObject): Call noValue.
  22410. 2008-10-18 Darin Adler <darin@apple.com>
  22411. - fix non-all-in-one build
  22412. * kjs/completion.h:
  22413. (JSC::Completion::Completion): Add include of JSValue.h.
  22414. 2008-10-18 Darin Adler <darin@apple.com>
  22415. Reviewed by Oliver Hunt.
  22416. - fix assertions I introduced with my casting changes
  22417. These were showing up as failures in the JavaScriptCore tests.
  22418. * VM/Machine.cpp:
  22419. (JSC::Machine::cti_op_instanceof): Remove the bogus asCell casting that
  22420. was at the top of the function, and instead cast at the point of use.
  22421. (JSC::Machine::cti_op_construct_NotJSConstruct): Moved the cast to
  22422. object after checking the construct type.
  22423. 2008-10-18 Darin Adler <darin@apple.com>
  22424. - fix non-all-in-one build
  22425. * kjs/JSGlobalObjectFunctions.h: Add include of JSImmedate.h (for now).
  22426. 2008-10-18 Darin Adler <darin@apple.com>
  22427. - fix build
  22428. * kjs/interpreter.h: Include JSValue.h instead of JSImmediate.h.
  22429. 2008-10-18 Darin Adler <darin@apple.com>
  22430. * kjs/interpreter.h: Fix include of JSImmediate.h.
  22431. 2008-10-18 Darin Adler <darin@apple.com>
  22432. - fix non-all-in-one build
  22433. * kjs/interpreter.h: Add include of JSImmediate.h.
  22434. 2008-10-18 Darin Adler <darin@apple.com>
  22435. - fix non-all-in-one build
  22436. * kjs/ConstructData.h: Add include of JSImmedate.h (for now).
  22437. 2008-10-18 Darin Adler <darin@apple.com>
  22438. - try to fix Windows build
  22439. * VM/Machine.cpp:
  22440. (JSC::Machine::Machine): Use JSCell* type since MSVC seems to only allow
  22441. calling ~JSCell directly if it's a JSCell*.
  22442. 2008-10-18 Darin Adler <darin@apple.com>
  22443. Reviewed by Cameron Zwarich.
  22444. - next step on https://bugs.webkit.org/show_bug.cgi?id=21732
  22445. improve performance by eliminating JSValue as a base class for JSCell
  22446. Use JSValuePtr everywhere instead of JSValue*. In the future, we'll be
  22447. changing JSValuePtr to be a class, and then eventually renaming it
  22448. to JSValue once that's done.
  22449. * JavaScriptCore.exp: Update entry points, since some now take JSValue*
  22450. instead of const JSValue*.
  22451. * API/APICast.h:
  22452. * API/JSCallbackConstructor.h:
  22453. * API/JSCallbackFunction.cpp:
  22454. * API/JSCallbackFunction.h:
  22455. * API/JSCallbackObject.h:
  22456. * API/JSCallbackObjectFunctions.h:
  22457. * API/JSContextRef.cpp:
  22458. * API/JSObjectRef.cpp:
  22459. * API/JSValueRef.cpp:
  22460. * VM/CTI.cpp:
  22461. * VM/CTI.h:
  22462. * VM/CodeBlock.cpp:
  22463. * VM/CodeBlock.h:
  22464. * VM/CodeGenerator.cpp:
  22465. * VM/CodeGenerator.h:
  22466. * VM/ExceptionHelpers.cpp:
  22467. * VM/ExceptionHelpers.h:
  22468. * VM/JSPropertyNameIterator.cpp:
  22469. * VM/JSPropertyNameIterator.h:
  22470. * VM/Machine.cpp:
  22471. * VM/Machine.h:
  22472. * VM/Register.h:
  22473. * kjs/ArgList.cpp:
  22474. * kjs/ArgList.h:
  22475. * kjs/Arguments.cpp:
  22476. * kjs/Arguments.h:
  22477. * kjs/ArrayConstructor.cpp:
  22478. * kjs/ArrayPrototype.cpp:
  22479. * kjs/BooleanConstructor.cpp:
  22480. * kjs/BooleanConstructor.h:
  22481. * kjs/BooleanObject.h:
  22482. * kjs/BooleanPrototype.cpp:
  22483. * kjs/CallData.cpp:
  22484. * kjs/CallData.h:
  22485. * kjs/ConstructData.cpp:
  22486. * kjs/ConstructData.h:
  22487. * kjs/DateConstructor.cpp:
  22488. * kjs/DateInstance.h:
  22489. * kjs/DatePrototype.cpp:
  22490. * kjs/DebuggerCallFrame.cpp:
  22491. * kjs/DebuggerCallFrame.h:
  22492. * kjs/ErrorConstructor.cpp:
  22493. * kjs/ErrorPrototype.cpp:
  22494. * kjs/ExecState.cpp:
  22495. * kjs/ExecState.h:
  22496. * kjs/FunctionConstructor.cpp:
  22497. * kjs/FunctionPrototype.cpp:
  22498. * kjs/GetterSetter.cpp:
  22499. * kjs/GetterSetter.h:
  22500. * kjs/InternalFunction.h:
  22501. * kjs/JSActivation.cpp:
  22502. * kjs/JSActivation.h:
  22503. * kjs/JSArray.cpp:
  22504. * kjs/JSArray.h:
  22505. * kjs/JSCell.cpp:
  22506. * kjs/JSCell.h:
  22507. * kjs/JSFunction.cpp:
  22508. * kjs/JSFunction.h:
  22509. * kjs/JSGlobalData.h:
  22510. * kjs/JSGlobalObject.cpp:
  22511. * kjs/JSGlobalObject.h:
  22512. * kjs/JSGlobalObjectFunctions.cpp:
  22513. * kjs/JSGlobalObjectFunctions.h:
  22514. * kjs/JSImmediate.cpp:
  22515. * kjs/JSImmediate.h:
  22516. * kjs/JSNotAnObject.cpp:
  22517. * kjs/JSNotAnObject.h:
  22518. * kjs/JSNumberCell.cpp:
  22519. * kjs/JSNumberCell.h:
  22520. * kjs/JSObject.cpp:
  22521. * kjs/JSObject.h:
  22522. * kjs/JSStaticScopeObject.cpp:
  22523. * kjs/JSStaticScopeObject.h:
  22524. * kjs/JSString.cpp:
  22525. * kjs/JSString.h:
  22526. * kjs/JSValue.h:
  22527. * kjs/JSVariableObject.h:
  22528. * kjs/JSWrapperObject.h:
  22529. * kjs/MathObject.cpp:
  22530. * kjs/NativeErrorConstructor.cpp:
  22531. * kjs/NumberConstructor.cpp:
  22532. * kjs/NumberConstructor.h:
  22533. * kjs/NumberObject.cpp:
  22534. * kjs/NumberObject.h:
  22535. * kjs/NumberPrototype.cpp:
  22536. * kjs/ObjectConstructor.cpp:
  22537. * kjs/ObjectPrototype.cpp:
  22538. * kjs/ObjectPrototype.h:
  22539. * kjs/PropertyMap.h:
  22540. * kjs/PropertySlot.cpp:
  22541. * kjs/PropertySlot.h:
  22542. * kjs/RegExpConstructor.cpp:
  22543. * kjs/RegExpConstructor.h:
  22544. * kjs/RegExpMatchesArray.h:
  22545. * kjs/RegExpObject.cpp:
  22546. * kjs/RegExpObject.h:
  22547. * kjs/RegExpPrototype.cpp:
  22548. * kjs/Shell.cpp:
  22549. * kjs/StringConstructor.cpp:
  22550. * kjs/StringObject.cpp:
  22551. * kjs/StringObject.h:
  22552. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  22553. * kjs/StringPrototype.cpp:
  22554. * kjs/StructureID.cpp:
  22555. * kjs/StructureID.h:
  22556. * kjs/collector.cpp:
  22557. * kjs/collector.h:
  22558. * kjs/completion.h:
  22559. * kjs/grammar.y:
  22560. * kjs/interpreter.cpp:
  22561. * kjs/interpreter.h:
  22562. * kjs/lookup.cpp:
  22563. * kjs/lookup.h:
  22564. * kjs/nodes.h:
  22565. * kjs/operations.cpp:
  22566. * kjs/operations.h:
  22567. * kjs/protect.h:
  22568. * profiler/ProfileGenerator.cpp:
  22569. Replace JSValue* with JSValuePtr.
  22570. 2008-10-18 Darin Adler <darin@apple.com>
  22571. * VM/Machine.cpp:
  22572. (JSC::Machine::cti_op_call_eval): Removed stray parentheses from my
  22573. last check-in.
  22574. 2008-10-18 Darin Adler <darin@apple.com>
  22575. Reviewed by Oliver Hunt.
  22576. - first step of https://bugs.webkit.org/show_bug.cgi?id=21732
  22577. improve performance by eliminating JSValue as a base class for JSCell
  22578. Remove casts from JSValue* to derived classes, replacing them with
  22579. calls to inline casting functions. These functions are also a bit
  22580. better than aidrect cast because they also do a runtime assertion.
  22581. Removed use of 0 as for JSValue*, changing call sites to use a
  22582. noValue() function instead.
  22583. Move things needed by classes derived from JSValue out of the class,
  22584. since the classes won't be deriving from JSValue any more soon.
  22585. I did most of these changes by changing JSValue to not be JSValue* any
  22586. more, then fixing a lot of the compilation problems, then rolling out
  22587. the JSValue change.
  22588. 1.011x as fast on SunSpider (presumably due to some of the Machine.cpp changes)
  22589. * API/APICast.h: Removed unneeded forward declarations.
  22590. * API/JSCallbackObject.h: Added an asCallbackObject function for casting.
  22591. * API/JSCallbackObjectFunctions.h:
  22592. (JSC::JSCallbackObject::asCallbackObject): Added.
  22593. (JSC::JSCallbackObject::getOwnPropertySlot): Use asObject.
  22594. (JSC::JSCallbackObject::call): Use noValue.
  22595. (JSC::JSCallbackObject::staticValueGetter): Use asCallbackObject.
  22596. (JSC::JSCallbackObject::staticFunctionGetter): Ditto.
  22597. (JSC::JSCallbackObject::callbackGetter): Ditto.
  22598. * JavaScriptCore.exp: Updated.
  22599. * JavaScriptCore.xcodeproj/project.pbxproj: Added RegExpMatchesArray.h.
  22600. * VM/CTI.cpp:
  22601. (JSC::CTI::asInteger): Added. For use casting a JSValue to an integer.
  22602. (JSC::CTI::emitGetArg): Use asInteger.
  22603. (JSC::CTI::emitGetPutArg): Ditto.
  22604. (JSC::CTI::getConstantImmediateNumericArg): Ditto. Also use noValue.
  22605. (JSC::CTI::emitInitRegister): Use asInteger.
  22606. (JSC::CTI::getDeTaggedConstantImmediate): Ditto.
  22607. (JSC::CTI::compileOpCallInitializeCallFrame): Ditto.
  22608. (JSC::CTI::compileOpCall): Ditto.
  22609. (JSC::CTI::compileOpStrictEq): Ditto.
  22610. (JSC::CTI::privateCompileMainPass): Ditto.
  22611. (JSC::CTI::privateCompileGetByIdProto): Ditto.
  22612. (JSC::CTI::privateCompileGetByIdChain): Ditto.
  22613. (JSC::CTI::privateCompilePutByIdTransition): Ditto.
  22614. * VM/CTI.h: Rewrite the ARG-related macros to use C++ casts instead of
  22615. C casts and get rid of some extra parentheses. Addd declaration of
  22616. asInteger.
  22617. * VM/CodeGenerator.cpp:
  22618. (JSC::CodeGenerator::emitEqualityOp): Use asString.
  22619. (JSC::CodeGenerator::emitLoad): Use noValue.
  22620. (JSC::CodeGenerator::findScopedProperty): Change globalObject argument
  22621. to JSObject* instead of JSValue*.
  22622. (JSC::CodeGenerator::emitResolve): Remove unneeded cast.
  22623. (JSC::CodeGenerator::emitGetScopedVar): Use asCell.
  22624. (JSC::CodeGenerator::emitPutScopedVar): Ditto.
  22625. * VM/CodeGenerator.h: Changed out argument of findScopedProperty.
  22626. Also change the JSValueMap to use PtrHash explicitly instead of
  22627. getting it from DefaultHash.
  22628. * VM/JSPropertyNameIterator.cpp:
  22629. (JSC::JSPropertyNameIterator::toPrimitive): Use noValue.
  22630. * VM/JSPropertyNameIterator.h:
  22631. (JSC::JSPropertyNameIterator::next): Ditto.
  22632. * VM/Machine.cpp:
  22633. (JSC::fastIsNumber): Moved isImmediate check here instead of
  22634. checking for 0 inside Heap::isNumber. Use asCell and asNumberCell.
  22635. (JSC::fastToInt32): Ditto.
  22636. (JSC::fastToUInt32): Ditto.
  22637. (JSC::jsLess): Use asString.
  22638. (JSC::jsLessEq): Ditto.
  22639. (JSC::jsAdd): Ditto.
  22640. (JSC::jsTypeStringForValue): Use asObject.
  22641. (JSC::jsIsObjectType): Ditto.
  22642. (JSC::jsIsFunctionType): Ditto.
  22643. (JSC::inlineResolveBase): Use noValue.
  22644. (JSC::Machine::callEval): Use asString. Initialize result to
  22645. undefined, not 0.
  22646. (JSC::Machine::Machine): Remove unneeded casts to JSCell*.
  22647. (JSC::Machine::throwException): Use asObject.
  22648. (JSC::Machine::debug): Remove explicit calls to the DebuggerCallFrame
  22649. constructor.
  22650. (JSC::Machine::checkTimeout): Use noValue.
  22651. (JSC::cachePrototypeChain): Use asObject.
  22652. (JSC::Machine::tryCachePutByID): Use asCell.
  22653. (JSC::Machine::tryCacheGetByID): Use aCell and asObject.
  22654. (JSC::Machine::privateExecute): Use noValue, asCell, asObject, asString,
  22655. asArray, asActivation, asFunction. Changed code that creates call frames
  22656. for host functions to pass 0 for the function pointer -- the call frame
  22657. needs a JSFunction* and a host function object is not one. This was
  22658. caught by the assertions in the casting functions. Also remove some
  22659. unneeded casts in cases where two values are compared.
  22660. (JSC::Machine::retrieveLastCaller): Use noValue.
  22661. (JSC::Machine::tryCTICachePutByID): Use asCell.
  22662. (JSC::Machine::tryCTICacheGetByID): Use aCell and asObject.
  22663. (JSC::setUpThrowTrampolineReturnAddress): Added this function to restore
  22664. the PIC-branch-avoidance that was recently lost.
  22665. (JSC::Machine::cti_op_add): Use asString.
  22666. (JSC::Machine::cti_op_instanceof): Use asCell and asObject.
  22667. (JSC::Machine::cti_op_call_JSFunction): Use asFunction.
  22668. (JSC::Machine::cti_op_call_NotJSFunction): Changed code to pass 0 for
  22669. the function pointer, since we don't have a JSFunction. Use asObject.
  22670. (JSC::Machine::cti_op_tear_off_activation): Use asActivation.
  22671. (JSC::Machine::cti_op_construct_JSConstruct): Use asFunction and asObject.
  22672. (JSC::Machine::cti_op_construct_NotJSConstruct): use asObject.
  22673. (JSC::Machine::cti_op_get_by_val): Use asArray and asString.
  22674. (JSC::Machine::cti_op_resolve_func): Use asPointer; this helps prepare
  22675. us for a situation where JSValue is not a pointer.
  22676. (JSC::Machine::cti_op_put_by_val): Use asArray.
  22677. (JSC::Machine::cti_op_put_by_val_array): Ditto.
  22678. (JSC::Machine::cti_op_resolve_global): Use asGlobalObject.
  22679. (JSC::Machine::cti_op_post_inc): Change VM_CHECK_EXCEPTION_2 to
  22680. VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
  22681. that point. Also use asPointer.
  22682. (JSC::Machine::cti_op_resolve_with_base): Use asPointer.
  22683. (JSC::Machine::cti_op_post_dec): Change VM_CHECK_EXCEPTION_2 to
  22684. VM_CHECK_EXCEPTION_AT_END, since there's no observable work done after
  22685. that point. Also use asPointer.
  22686. (JSC::Machine::cti_op_call_eval): Use asObject, noValue, and change
  22687. VM_CHECK_EXCEPTION_ARG to VM_THROW_EXCEPTION_AT_END.
  22688. (JSC::Machine::cti_op_throw): Change return value to a JSValue*.
  22689. (JSC::Machine::cti_op_in): Use asObject.
  22690. (JSC::Machine::cti_op_switch_char): Use asString.
  22691. (JSC::Machine::cti_op_switch_string): Ditto.
  22692. (JSC::Machine::cti_op_put_getter): Use asObject.
  22693. (JSC::Machine::cti_op_put_setter): Ditto.
  22694. (JSC::Machine::cti_vm_throw): Change return value to a JSValue*.
  22695. Use noValue.
  22696. * VM/Machine.h: Change return values of both cti_op_throw and
  22697. cti_vm_throw to JSValue*.
  22698. * VM/Register.h: Remove nullJSValue, which is the same thing
  22699. as noValue(). Also removed unneeded definition of JSValue.
  22700. * kjs/ArgList.h: Removed unneeded definition of JSValue.
  22701. * kjs/Arguments.h:
  22702. (JSC::asArguments): Added.
  22703. * kjs/ArrayPrototype.cpp:
  22704. (JSC::getProperty): Use noValue.
  22705. (JSC::arrayProtoFuncToString): Use asArray.
  22706. (JSC::arrayProtoFuncToLocaleString): Ditto.
  22707. (JSC::arrayProtoFuncConcat): Ditto.
  22708. (JSC::arrayProtoFuncPop): Ditto. Also removed unneeded initialization
  22709. of the result, which is set in both sides of the branch.
  22710. (JSC::arrayProtoFuncPush): Ditto.
  22711. (JSC::arrayProtoFuncShift): Removed unneeded initialization
  22712. of the result, which is set in both sides of the branch.
  22713. (JSC::arrayProtoFuncSort): Use asArray.
  22714. * kjs/BooleanObject.h:
  22715. (JSC::asBooleanObject): Added.
  22716. * kjs/BooleanPrototype.cpp:
  22717. (JSC::booleanProtoFuncToString): Use asBooleanObject.
  22718. (JSC::booleanProtoFuncValueOf): Ditto.
  22719. * kjs/CallData.cpp:
  22720. (JSC::call): Use asObject and asFunction.
  22721. * kjs/ConstructData.cpp:
  22722. (JSC::construct): Ditto.
  22723. * kjs/DateConstructor.cpp:
  22724. (JSC::constructDate): Use asDateInstance.
  22725. * kjs/DateInstance.h:
  22726. (JSC::asDateInstance): Added.
  22727. * kjs/DatePrototype.cpp:
  22728. (JSC::dateProtoFuncToString): Use asDateInstance.
  22729. (JSC::dateProtoFuncToUTCString): Ditto.
  22730. (JSC::dateProtoFuncToDateString): Ditto.
  22731. (JSC::dateProtoFuncToTimeString): Ditto.
  22732. (JSC::dateProtoFuncToLocaleString): Ditto.
  22733. (JSC::dateProtoFuncToLocaleDateString): Ditto.
  22734. (JSC::dateProtoFuncToLocaleTimeString): Ditto.
  22735. (JSC::dateProtoFuncValueOf): Ditto.
  22736. (JSC::dateProtoFuncGetTime): Ditto.
  22737. (JSC::dateProtoFuncGetFullYear): Ditto.
  22738. (JSC::dateProtoFuncGetUTCFullYear): Ditto.
  22739. (JSC::dateProtoFuncToGMTString): Ditto.
  22740. (JSC::dateProtoFuncGetMonth): Ditto.
  22741. (JSC::dateProtoFuncGetUTCMonth): Ditto.
  22742. (JSC::dateProtoFuncGetDate): Ditto.
  22743. (JSC::dateProtoFuncGetUTCDate): Ditto.
  22744. (JSC::dateProtoFuncGetDay): Ditto.
  22745. (JSC::dateProtoFuncGetUTCDay): Ditto.
  22746. (JSC::dateProtoFuncGetHours): Ditto.
  22747. (JSC::dateProtoFuncGetUTCHours): Ditto.
  22748. (JSC::dateProtoFuncGetMinutes): Ditto.
  22749. (JSC::dateProtoFuncGetUTCMinutes): Ditto.
  22750. (JSC::dateProtoFuncGetSeconds): Ditto.
  22751. (JSC::dateProtoFuncGetUTCSeconds): Ditto.
  22752. (JSC::dateProtoFuncGetMilliSeconds): Ditto.
  22753. (JSC::dateProtoFuncGetUTCMilliseconds): Ditto.
  22754. (JSC::dateProtoFuncGetTimezoneOffset): Ditto.
  22755. (JSC::dateProtoFuncSetTime): Ditto.
  22756. (JSC::setNewValueFromTimeArgs): Ditto.
  22757. (JSC::setNewValueFromDateArgs): Ditto.
  22758. (JSC::dateProtoFuncSetYear): Ditto.
  22759. (JSC::dateProtoFuncGetYear): Ditto.
  22760. * kjs/DebuggerCallFrame.cpp:
  22761. (JSC::DebuggerCallFrame::thisObject): Use asObject.
  22762. (JSC::DebuggerCallFrame::evaluate): Use noValue.
  22763. * kjs/DebuggerCallFrame.h: Added a constructor that
  22764. takes only a callFrame.
  22765. * kjs/ExecState.h:
  22766. (JSC::ExecState::clearException): Use noValue.
  22767. * kjs/FunctionPrototype.cpp:
  22768. (JSC::functionProtoFuncToString): Use asFunction.
  22769. (JSC::functionProtoFuncApply): Use asArguments and asArray.
  22770. * kjs/GetterSetter.cpp:
  22771. (JSC::GetterSetter::getPrimitiveNumber): Use noValue.
  22772. * kjs/GetterSetter.h:
  22773. (JSC::asGetterSetter): Added.
  22774. * kjs/InternalFunction.cpp:
  22775. (JSC::InternalFunction::name): Use asString.
  22776. * kjs/InternalFunction.h:
  22777. (JSC::asInternalFunction): Added.
  22778. * kjs/JSActivation.cpp:
  22779. (JSC::JSActivation::argumentsGetter): Use asActivation.
  22780. * kjs/JSActivation.h:
  22781. (JSC::asActivation): Added.
  22782. * kjs/JSArray.cpp:
  22783. (JSC::JSArray::putSlowCase): Use noValue.
  22784. (JSC::JSArray::deleteProperty): Ditto.
  22785. (JSC::JSArray::increaseVectorLength): Ditto.
  22786. (JSC::JSArray::setLength): Ditto.
  22787. (JSC::JSArray::pop): Ditto.
  22788. (JSC::JSArray::sort): Ditto.
  22789. (JSC::JSArray::compactForSorting): Ditto.
  22790. * kjs/JSArray.h:
  22791. (JSC::asArray): Added.
  22792. * kjs/JSCell.cpp:
  22793. (JSC::JSCell::getJSNumber): Use noValue.
  22794. * kjs/JSCell.h:
  22795. (JSC::asCell): Added.
  22796. (JSC::JSValue::asCell): Changed to not preserve const.
  22797. Given the wide use of JSValue* and JSCell*, it's not
  22798. really useful to use const.
  22799. (JSC::JSValue::isNumber): Use asValue.
  22800. (JSC::JSValue::isString): Ditto.
  22801. (JSC::JSValue::isGetterSetter): Ditto.
  22802. (JSC::JSValue::isObject): Ditto.
  22803. (JSC::JSValue::getNumber): Ditto.
  22804. (JSC::JSValue::getString): Ditto.
  22805. (JSC::JSValue::getObject): Ditto.
  22806. (JSC::JSValue::getCallData): Ditto.
  22807. (JSC::JSValue::getConstructData): Ditto.
  22808. (JSC::JSValue::getUInt32): Ditto.
  22809. (JSC::JSValue::getTruncatedInt32): Ditto.
  22810. (JSC::JSValue::getTruncatedUInt32): Ditto.
  22811. (JSC::JSValue::mark): Ditto.
  22812. (JSC::JSValue::marked): Ditto.
  22813. (JSC::JSValue::toPrimitive): Ditto.
  22814. (JSC::JSValue::getPrimitiveNumber): Ditto.
  22815. (JSC::JSValue::toBoolean): Ditto.
  22816. (JSC::JSValue::toNumber): Ditto.
  22817. (JSC::JSValue::toString): Ditto.
  22818. (JSC::JSValue::toObject): Ditto.
  22819. (JSC::JSValue::toThisObject): Ditto.
  22820. (JSC::JSValue::needsThisConversion): Ditto.
  22821. (JSC::JSValue::toThisString): Ditto.
  22822. (JSC::JSValue::getJSNumber): Ditto.
  22823. * kjs/JSFunction.cpp:
  22824. (JSC::JSFunction::argumentsGetter): Use asFunction.
  22825. (JSC::JSFunction::callerGetter): Ditto.
  22826. (JSC::JSFunction::lengthGetter): Ditto.
  22827. (JSC::JSFunction::construct): Use asObject.
  22828. * kjs/JSFunction.h:
  22829. (JSC::asFunction): Added.
  22830. * kjs/JSGlobalObject.cpp:
  22831. (JSC::lastInPrototypeChain): Use asObject.
  22832. * kjs/JSGlobalObject.h:
  22833. (JSC::asGlobalObject): Added.
  22834. (JSC::ScopeChainNode::globalObject): Use asGlobalObject.
  22835. * kjs/JSImmediate.h: Added noValue, asPointer, and makeValue
  22836. functions. Use rawValue, makeValue, and noValue consistently
  22837. instead of doing reinterpret_cast in various functions.
  22838. * kjs/JSNumberCell.h:
  22839. (JSC::asNumberCell): Added.
  22840. (JSC::JSValue::uncheckedGetNumber): Use asValue and asNumberCell.
  22841. (JSC::JSValue::toJSNumber): Use asValue.
  22842. * kjs/JSObject.cpp:
  22843. (JSC::JSObject::put): Use asObject and asGetterSetter.
  22844. (JSC::callDefaultValueFunction): Use noValue.
  22845. (JSC::JSObject::defineGetter): Use asGetterSetter.
  22846. (JSC::JSObject::defineSetter): Ditto.
  22847. (JSC::JSObject::lookupGetter): Ditto. Also use asObject.
  22848. (JSC::JSObject::lookupSetter): Ditto.
  22849. (JSC::JSObject::hasInstance): Use asObject.
  22850. (JSC::JSObject::fillGetterPropertySlot): Use asGetterSetter.
  22851. * kjs/JSObject.h:
  22852. (JSC::JSObject::getDirect): Use noValue.
  22853. (JSC::asObject): Added.
  22854. (JSC::JSValue::isObject): Use asValue.
  22855. (JSC::JSObject::get): Removed unneeded const_cast.
  22856. (JSC::JSObject::getPropertySlot): Use asObject.
  22857. (JSC::JSValue::get): Removed unneeded const_cast.
  22858. Use asValue, asCell, and asObject.
  22859. (JSC::JSValue::put): Ditto.
  22860. (JSC::JSObject::allocatePropertyStorageInline): Fixed spelling
  22861. of "oldPropertStorage".
  22862. * kjs/JSString.cpp:
  22863. (JSC::JSString::getOwnPropertySlot): Use asObject.
  22864. * kjs/JSString.h:
  22865. (JSC::asString): Added.
  22866. (JSC::JSValue::toThisJSString): Use asValue.
  22867. * kjs/JSValue.h: Make PreferredPrimitiveType a top level enum
  22868. instead of a member of JSValue. Added an asValue function that
  22869. returns this. Removed overload of asCell for const. Use asValue
  22870. instead of getting right at this.
  22871. * kjs/ObjectPrototype.cpp:
  22872. (JSC::objectProtoFuncIsPrototypeOf): Use asObject.
  22873. (JSC::objectProtoFuncDefineGetter): Ditto.
  22874. (JSC::objectProtoFuncDefineSetter): Ditto.
  22875. * kjs/PropertySlot.h:
  22876. (JSC::PropertySlot::PropertySlot): Take a const JSValue* so the
  22877. callers don't have to worry about const.
  22878. (JSC::PropertySlot::clearBase): Use noValue.
  22879. (JSC::PropertySlot::clearValue): Ditto.
  22880. * kjs/RegExpConstructor.cpp:
  22881. (JSC::regExpConstructorDollar1): Use asRegExpConstructor.
  22882. (JSC::regExpConstructorDollar2): Ditto.
  22883. (JSC::regExpConstructorDollar3): Ditto.
  22884. (JSC::regExpConstructorDollar4): Ditto.
  22885. (JSC::regExpConstructorDollar5): Ditto.
  22886. (JSC::regExpConstructorDollar6): Ditto.
  22887. (JSC::regExpConstructorDollar7): Ditto.
  22888. (JSC::regExpConstructorDollar8): Ditto.
  22889. (JSC::regExpConstructorDollar9): Ditto.
  22890. (JSC::regExpConstructorInput): Ditto.
  22891. (JSC::regExpConstructorMultiline): Ditto.
  22892. (JSC::regExpConstructorLastMatch): Ditto.
  22893. (JSC::regExpConstructorLastParen): Ditto.
  22894. (JSC::regExpConstructorLeftContext): Ditto.
  22895. (JSC::regExpConstructorRightContext): Ditto.
  22896. (JSC::setRegExpConstructorInput): Ditto.
  22897. (JSC::setRegExpConstructorMultiline): Ditto.
  22898. (JSC::constructRegExp): Use asObject.
  22899. * kjs/RegExpConstructor.h:
  22900. (JSC::asRegExpConstructor): Added.
  22901. * kjs/RegExpObject.cpp:
  22902. (JSC::regExpObjectGlobal): Use asRegExpObject.
  22903. (JSC::regExpObjectIgnoreCase): Ditto.
  22904. (JSC::regExpObjectMultiline): Ditto.
  22905. (JSC::regExpObjectSource): Ditto.
  22906. (JSC::regExpObjectLastIndex): Ditto.
  22907. (JSC::setRegExpObjectLastIndex): Ditto.
  22908. (JSC::callRegExpObject): Ditto.
  22909. * kjs/RegExpObject.h:
  22910. (JSC::asRegExpObject): Added.
  22911. * kjs/RegExpPrototype.cpp:
  22912. (JSC::regExpProtoFuncTest): Use asRegExpObject.
  22913. (JSC::regExpProtoFuncExec): Ditto.
  22914. (JSC::regExpProtoFuncCompile): Ditto.
  22915. (JSC::regExpProtoFuncToString): Ditto.
  22916. * kjs/StringObject.h:
  22917. (JSC::StringObject::internalValue): Use asString.
  22918. (JSC::asStringObject): Added.
  22919. * kjs/StringPrototype.cpp:
  22920. (JSC::stringProtoFuncReplace): Use asRegExpObject.
  22921. (JSC::stringProtoFuncToString): Ue asStringObject.
  22922. (JSC::stringProtoFuncMatch): Use asRegExpObject.
  22923. (JSC::stringProtoFuncSearch): Ditto.
  22924. (JSC::stringProtoFuncSplit): Ditto.
  22925. * kjs/StructureID.cpp:
  22926. (JSC::StructureID::getEnumerablePropertyNames): Use asObject.
  22927. (JSC::StructureID::createCachedPrototypeChain): Ditto.
  22928. (JSC::StructureIDChain::StructureIDChain): Use asCell and asObject.
  22929. * kjs/collector.h:
  22930. (JSC::Heap::isNumber): Removed null handling. This can only be called
  22931. on valid cells.
  22932. (JSC::Heap::cellBlock): Removed overload for const and non-const.
  22933. Whether the JSCell* is const or not really should have no effect on
  22934. whether you can modify the collector block it's in.
  22935. * kjs/interpreter.cpp:
  22936. (JSC::Interpreter::evaluate): Use noValue and noObject.
  22937. * kjs/nodes.cpp:
  22938. (JSC::FunctionCallResolveNode::emitCode): Use JSObject for the global
  22939. object rather than JSValue.
  22940. (JSC::PostfixResolveNode::emitCode): Ditto.
  22941. (JSC::PrefixResolveNode::emitCode): Ditto.
  22942. (JSC::ReadModifyResolveNode::emitCode): Ditto.
  22943. (JSC::AssignResolveNode::emitCode): Ditto.
  22944. * kjs/operations.h:
  22945. (JSC::equalSlowCaseInline): Use asString, asCell, asNumberCell,
  22946. (JSC::strictEqualSlowCaseInline): Ditto.
  22947. 2008-10-18 Cameron Zwarich <zwarich@apple.com>
  22948. Reviewed by Oliver Hunt.
  22949. Bug 21702: Special op_create_activation for the case where there are no named parameters
  22950. <https://bugs.webkit.org/show_bug.cgi?id=21702>
  22951. This is a 2.5% speedup on the V8 Raytrace benchmark and a 1.1% speedup
  22952. on the V8 Earley-Boyer benchmark.
  22953. * VM/CTI.cpp:
  22954. (JSC::CTI::privateCompileMainPass):
  22955. * VM/Machine.cpp:
  22956. (JSC::Machine::cti_op_create_arguments_no_params):
  22957. * VM/Machine.h:
  22958. * kjs/Arguments.h:
  22959. (JSC::Arguments::):
  22960. (JSC::Arguments::Arguments):
  22961. 2008-10-17 Maciej Stachowiak <mjs@apple.com>
  22962. Reviewed by Cameron Zwarich.
  22963. - in debug builds, alter the stack to avoid blowing out MallocStackLogging
  22964. (In essence, while executing a CTI function we alter the return
  22965. address to jscGeneratedNativeCode so that a single consistent
  22966. function is on the stack instead of many random functions without
  22967. symbols.)
  22968. * VM/CTI.h:
  22969. * VM/Machine.cpp:
  22970. (JSC::doSetReturnAddress):
  22971. (JSC::):
  22972. (JSC::StackHack::StackHack):
  22973. (JSC::StackHack::~StackHack):
  22974. (JSC::Machine::cti_op_convert_this):
  22975. (JSC::Machine::cti_op_end):
  22976. (JSC::Machine::cti_op_add):
  22977. (JSC::Machine::cti_op_pre_inc):
  22978. (JSC::Machine::cti_timeout_check):
  22979. (JSC::Machine::cti_register_file_check):
  22980. (JSC::Machine::cti_op_loop_if_less):
  22981. (JSC::Machine::cti_op_loop_if_lesseq):
  22982. (JSC::Machine::cti_op_new_object):
  22983. (JSC::Machine::cti_op_put_by_id):
  22984. (JSC::Machine::cti_op_put_by_id_second):
  22985. (JSC::Machine::cti_op_put_by_id_generic):
  22986. (JSC::Machine::cti_op_put_by_id_fail):
  22987. (JSC::Machine::cti_op_get_by_id):
  22988. (JSC::Machine::cti_op_get_by_id_second):
  22989. (JSC::Machine::cti_op_get_by_id_generic):
  22990. (JSC::Machine::cti_op_get_by_id_fail):
  22991. (JSC::Machine::cti_op_instanceof):
  22992. (JSC::Machine::cti_op_del_by_id):
  22993. (JSC::Machine::cti_op_mul):
  22994. (JSC::Machine::cti_op_new_func):
  22995. (JSC::Machine::cti_op_call_profiler):
  22996. (JSC::Machine::cti_op_call_JSFunction):
  22997. (JSC::Machine::cti_vm_lazyLinkCall):
  22998. (JSC::Machine::cti_vm_compile):
  22999. (JSC::Machine::cti_op_push_activation):
  23000. (JSC::Machine::cti_op_call_NotJSFunction):
  23001. (JSC::Machine::cti_op_create_arguments):
  23002. (JSC::Machine::cti_op_tear_off_activation):
  23003. (JSC::Machine::cti_op_tear_off_arguments):
  23004. (JSC::Machine::cti_op_ret_profiler):
  23005. (JSC::Machine::cti_op_ret_scopeChain):
  23006. (JSC::Machine::cti_op_new_array):
  23007. (JSC::Machine::cti_op_resolve):
  23008. (JSC::Machine::cti_op_construct_JSConstructFast):
  23009. (JSC::Machine::cti_op_construct_JSConstruct):
  23010. (JSC::Machine::cti_op_construct_NotJSConstruct):
  23011. (JSC::Machine::cti_op_get_by_val):
  23012. (JSC::Machine::cti_op_resolve_func):
  23013. (JSC::Machine::cti_op_sub):
  23014. (JSC::Machine::cti_op_put_by_val):
  23015. (JSC::Machine::cti_op_put_by_val_array):
  23016. (JSC::Machine::cti_op_lesseq):
  23017. (JSC::Machine::cti_op_loop_if_true):
  23018. (JSC::Machine::cti_op_negate):
  23019. (JSC::Machine::cti_op_resolve_base):
  23020. (JSC::Machine::cti_op_resolve_skip):
  23021. (JSC::Machine::cti_op_resolve_global):
  23022. (JSC::Machine::cti_op_div):
  23023. (JSC::Machine::cti_op_pre_dec):
  23024. (JSC::Machine::cti_op_jless):
  23025. (JSC::Machine::cti_op_not):
  23026. (JSC::Machine::cti_op_jtrue):
  23027. (JSC::Machine::cti_op_post_inc):
  23028. (JSC::Machine::cti_op_eq):
  23029. (JSC::Machine::cti_op_lshift):
  23030. (JSC::Machine::cti_op_bitand):
  23031. (JSC::Machine::cti_op_rshift):
  23032. (JSC::Machine::cti_op_bitnot):
  23033. (JSC::Machine::cti_op_resolve_with_base):
  23034. (JSC::Machine::cti_op_new_func_exp):
  23035. (JSC::Machine::cti_op_mod):
  23036. (JSC::Machine::cti_op_less):
  23037. (JSC::Machine::cti_op_neq):
  23038. (JSC::Machine::cti_op_post_dec):
  23039. (JSC::Machine::cti_op_urshift):
  23040. (JSC::Machine::cti_op_bitxor):
  23041. (JSC::Machine::cti_op_new_regexp):
  23042. (JSC::Machine::cti_op_bitor):
  23043. (JSC::Machine::cti_op_call_eval):
  23044. (JSC::Machine::cti_op_throw):
  23045. (JSC::Machine::cti_op_get_pnames):
  23046. (JSC::Machine::cti_op_next_pname):
  23047. (JSC::Machine::cti_op_push_scope):
  23048. (JSC::Machine::cti_op_pop_scope):
  23049. (JSC::Machine::cti_op_typeof):
  23050. (JSC::Machine::cti_op_is_undefined):
  23051. (JSC::Machine::cti_op_is_boolean):
  23052. (JSC::Machine::cti_op_is_number):
  23053. (JSC::Machine::cti_op_is_string):
  23054. (JSC::Machine::cti_op_is_object):
  23055. (JSC::Machine::cti_op_is_function):
  23056. (JSC::Machine::cti_op_stricteq):
  23057. (JSC::Machine::cti_op_nstricteq):
  23058. (JSC::Machine::cti_op_to_jsnumber):
  23059. (JSC::Machine::cti_op_in):
  23060. (JSC::Machine::cti_op_push_new_scope):
  23061. (JSC::Machine::cti_op_jmp_scopes):
  23062. (JSC::Machine::cti_op_put_by_index):
  23063. (JSC::Machine::cti_op_switch_imm):
  23064. (JSC::Machine::cti_op_switch_char):
  23065. (JSC::Machine::cti_op_switch_string):
  23066. (JSC::Machine::cti_op_del_by_val):
  23067. (JSC::Machine::cti_op_put_getter):
  23068. (JSC::Machine::cti_op_put_setter):
  23069. (JSC::Machine::cti_op_new_error):
  23070. (JSC::Machine::cti_op_debug):
  23071. (JSC::Machine::cti_vm_throw):
  23072. 2008-10-17 Gavin Barraclough <barraclough@apple.com>
  23073. Optimize op_call by allowing call sites to be directly linked to callees.
  23074. For the hot path of op_call, CTI now generates a check (initially for an impossible
  23075. value), and the first time the call is executed we attempt to link the call directly
  23076. to the callee. We can currently only do so if the arity of the caller and callee
  23077. match. The (optimized) setup for the call on the hot path is linked directly to
  23078. the ctiCode for the callee, without indirection.
  23079. Two forms of the slow case of the call are generated, the first will be executed the
  23080. first time the call is reached. As well as this path attempting to link the call to
  23081. a callee, it also relinks the slow case to a second slow case, which will not continue
  23082. to attempt relinking the call. (This policy could be changed in future, but for not
  23083. this is intended to prevent thrashing).
  23084. If a callee that the caller has been linked to is garbage collected, then the link
  23085. in the caller's JIt code will be reset back to a value that cannot match - to prevent
  23086. any false positive matches.
  23087. ~20% progression on deltablue & richards, >12% overall reduction in v8-tests
  23088. runtime, one or two percent progression on sunspider.
  23089. Reviewed by Oliver Hunt.
  23090. * VM/CTI.cpp:
  23091. (JSC::):
  23092. (JSC::CTI::emitNakedCall):
  23093. (JSC::unreachable):
  23094. (JSC::CTI::compileOpCallInitializeCallFrame):
  23095. (JSC::CTI::compileOpCallSetupArgs):
  23096. (JSC::CTI::compileOpCall):
  23097. (JSC::CTI::privateCompileMainPass):
  23098. (JSC::CTI::privateCompileSlowCases):
  23099. (JSC::CTI::privateCompile):
  23100. (JSC::CTI::unlinkCall):
  23101. (JSC::CTI::linkCall):
  23102. * VM/CTI.h:
  23103. * VM/CodeBlock.cpp:
  23104. (JSC::CodeBlock::~CodeBlock):
  23105. (JSC::CodeBlock::unlinkCallers):
  23106. (JSC::CodeBlock::derefStructureIDs):
  23107. * VM/CodeBlock.h:
  23108. (JSC::StructureStubInfo::StructureStubInfo):
  23109. (JSC::CallLinkInfo::CallLinkInfo):
  23110. (JSC::CodeBlock::addCaller):
  23111. (JSC::CodeBlock::removeCaller):
  23112. (JSC::CodeBlock::getStubInfo):
  23113. * VM/CodeGenerator.cpp:
  23114. (JSC::CodeGenerator::emitCall):
  23115. (JSC::CodeGenerator::emitConstruct):
  23116. * VM/Machine.cpp:
  23117. (JSC::Machine::cti_op_call_profiler):
  23118. (JSC::Machine::cti_op_call_JSFunction):
  23119. (JSC::Machine::cti_vm_lazyLinkCall):
  23120. (JSC::Machine::cti_op_construct_JSConstructFast):
  23121. (JSC::Machine::cti_op_construct_JSConstruct):
  23122. (JSC::Machine::cti_op_construct_NotJSConstruct):
  23123. * VM/Machine.h:
  23124. * kjs/JSFunction.cpp:
  23125. (JSC::JSFunction::~JSFunction):
  23126. * kjs/JSFunction.h:
  23127. * kjs/nodes.h:
  23128. (JSC::FunctionBodyNode::):
  23129. * masm/X86Assembler.h:
  23130. (JSC::X86Assembler::getDifferenceBetweenLabels):
  23131. 2008-10-17 Maciej Stachowiak <mjs@apple.com>
  23132. Reviewed by Geoff Garen.
  23133. - remove ASSERT that makes the leaks buildbot cry
  23134. * kjs/JSFunction.cpp:
  23135. (JSC::JSFunction::JSFunction):
  23136. 2008-10-17 Maciej Stachowiak <mjs@apple.com>
  23137. Reviewed by Cameron Zwarich
  23138. - don't bother to do arguments tearoff when it will have no effect
  23139. ~1% on v8 raytrace
  23140. * VM/CodeGenerator.cpp:
  23141. (JSC::CodeGenerator::emitReturn):
  23142. 2008-10-17 Marco Barisione <marco.barisione@collabora.co.uk>
  23143. Reviewed by Sam Weinig. Landed by Jan Alonzo.
  23144. https://bugs.webkit.org/show_bug.cgi?id=21603
  23145. [GTK] Minor fixes to GOwnPtr
  23146. * wtf/GOwnPtr.cpp:
  23147. (WTF::GError):
  23148. (WTF::GList):
  23149. (WTF::GCond):
  23150. (WTF::GMutex):
  23151. (WTF::GPatternSpec):
  23152. (WTF::GDir):
  23153. * wtf/GOwnPtr.h:
  23154. (WTF::freeOwnedGPtr):
  23155. (WTF::GOwnPtr::~GOwnPtr):
  23156. (WTF::GOwnPtr::outPtr):
  23157. (WTF::GOwnPtr::set):
  23158. (WTF::GOwnPtr::clear):
  23159. * wtf/Threading.h:
  23160. 2008-10-17 Maciej Stachowiak <mjs@apple.com>
  23161. Reviewed by Cameron Zwarich.
  23162. - speed up transitions that resize the property storage a fair bit
  23163. ~3% speedup on v8 RayTrace benchmark, ~1% on DeltaBlue
  23164. * VM/CTI.cpp:
  23165. (JSC::resizePropertyStorage): renamed from transitionObject, and reduced to just resize
  23166. the object's property storage with one inline call.
  23167. (JSC::CTI::privateCompilePutByIdTransition): Use a separate function for property storage
  23168. resize, but still do all the rest of the work in assembly in that case, and pass the known
  23169. compile-time constants of old and new size rather than structureIDs, saving a bunch of
  23170. redundant memory access.
  23171. * kjs/JSObject.cpp:
  23172. (JSC::JSObject::allocatePropertyStorage): Just call the inline version.
  23173. * kjs/JSObject.h:
  23174. (JSC::JSObject::allocatePropertyStorageInline): Inline version of allocatePropertyStorage
  23175. * masm/X86Assembler.h:
  23176. (JSC::X86Assembler::):
  23177. (JSC::X86Assembler::pushl_i32): Add code to assmeble push of a constant; code originally by Cameron Zwarich.
  23178. 2008-10-17 Cameron Zwarich <zwarich@apple.com>
  23179. Reviewed by Maciej Stachowiak.
  23180. Remove some C style casts.
  23181. * masm/X86Assembler.h:
  23182. (JSC::JITCodeBuffer::putIntUnchecked):
  23183. (JSC::X86Assembler::link):
  23184. (JSC::X86Assembler::linkAbsoluteAddress):
  23185. (JSC::X86Assembler::getRelocatedAddress):
  23186. 2008-10-17 Cameron Zwarich <zwarich@apple.com>
  23187. Rubber-stamped by Maciej Stachowiak.
  23188. Remove some C style casts.
  23189. * VM/CTI.cpp:
  23190. (JSC::CTI::patchGetByIdSelf):
  23191. (JSC::CTI::patchPutByIdReplace):
  23192. * VM/Machine.cpp:
  23193. (JSC::Machine::tryCTICachePutByID):
  23194. (JSC::Machine::tryCTICacheGetByID):
  23195. (JSC::Machine::cti_op_put_by_id):
  23196. (JSC::Machine::cti_op_put_by_id_fail):
  23197. (JSC::Machine::cti_op_get_by_id):
  23198. (JSC::Machine::cti_op_get_by_id_fail):
  23199. 2008-10-17 Maciej Stachowiak <mjs@apple.com>
  23200. Reviewed by Cameron Zwarich.
  23201. - Avoid restoring the caller's 'r' value in op_ret
  23202. https://bugs.webkit.org/show_bug.cgi?id=21319
  23203. This patch stops writing the call frame at call and return points;
  23204. instead it does so immediately before any CTI call.
  23205. 0.5% speedup or so on the v8 benchmark
  23206. * VM/CTI.cpp:
  23207. (JSC::CTI::emitCTICall):
  23208. (JSC::CTI::compileOpCall):
  23209. (JSC::CTI::emitSlowScriptCheck):
  23210. (JSC::CTI::compileBinaryArithOpSlowCase):
  23211. (JSC::CTI::privateCompileMainPass):
  23212. (JSC::CTI::privateCompileSlowCases):
  23213. (JSC::CTI::privateCompile):
  23214. * VM/CTI.h:
  23215. 2008-10-17 Cameron Zwarich <zwarich@apple.com>
  23216. Reviewed by Sam Weinig.
  23217. Make WREC require CTI because it won't actually compile otherwise.
  23218. * wtf/Platform.h:
  23219. 2008-10-16 Maciej Stachowiak <mjs@apple.com>
  23220. Reviewed by Geoff Garen.
  23221. - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
  23222. - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
  23223. This time there is no performance regression; we can avoid having
  23224. to use the fastcall calling convention for CTI functions by using
  23225. varargs to prevent the compiler from moving things around on the
  23226. stack.
  23227. * Configurations/DebugRelease.xcconfig:
  23228. * JavaScriptCore.xcodeproj/project.pbxproj:
  23229. * VM/CTI.cpp:
  23230. * VM/Machine.h:
  23231. * wtf/Platform.h:
  23232. 2008-10-16 Maciej Stachowiak <mjs@apple.com>
  23233. Reviewed by Oliver Hunt.
  23234. - fix for REGRESSION: r37631 causing crashes on buildbot
  23235. https://bugs.webkit.org/show_bug.cgi?id=21682
  23236. * kjs/collector.cpp:
  23237. (JSC::Heap::collect): Avoid crashing when a GC occurs while no global objects are live.
  23238. 2008-10-16 Sam Weinig <sam@webkit.org>
  23239. Reviewed by Maciej Stachowiak.
  23240. Fix for https://bugs.webkit.org/show_bug.cgi?id=21683
  23241. Don't create intermediate StructureIDs for builtin objects
  23242. First step in reduce number of StructureIDs created when initializing the
  23243. JSGlobalObject.
  23244. - In order to avoid creating the intermediate StructureIDs use the new putDirectWithoutTransition
  23245. and putDirectFunctionWithoutTransition to add properties to JSObjects without transitioning
  23246. the StructureID. This patch just implements this strategy for ObjectPrototype but alone
  23247. reduces the number of StructureIDs create for about:blank by 10, from 142 to 132.
  23248. * kjs/JSGlobalObject.cpp:
  23249. (JSC::JSGlobalObject::reset):
  23250. * kjs/JSObject.cpp:
  23251. (JSC::JSObject::putDirectFunctionWithoutTransition):
  23252. * kjs/JSObject.h:
  23253. (JSC::JSObject::putDirectWithoutTransition):
  23254. * kjs/ObjectPrototype.cpp:
  23255. (JSC::ObjectPrototype::ObjectPrototype):
  23256. * kjs/ObjectPrototype.h:
  23257. * kjs/StructureID.cpp:
  23258. (JSC::StructureID::addPropertyWithoutTransition):
  23259. * kjs/StructureID.h:
  23260. 2008-10-16 Maciej Stachowiak <mjs@apple.com>
  23261. Reviewed by Cameron Zwarich.
  23262. - fix for: REGRESSION: over 100 StructureIDs leak loading about:blank (result of fix for bug 21633)
  23263. Apparent slight progression (< 0.5%) on v8 benchmarks and SunSpider.
  23264. * kjs/StructureID.cpp:
  23265. (JSC::StructureID::~StructureID): Don't deref this object's parent's pointer to
  23266. itself from the destructor; that doesn't even make sense.
  23267. (JSC::StructureID::addPropertyTransition): Don't refer the single transition;
  23268. the rule is that parent StructureIDs are ref'd but child ones are not. Refing
  23269. the child creates a cycle.
  23270. 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
  23271. Reviewed by Darin Adler.
  23272. https://bugs.webkit.org/show_bug.cgi?id=21609
  23273. Make MessagePorts protect their peers across heaps
  23274. * JavaScriptCore.exp:
  23275. * kjs/JSGlobalObject.cpp:
  23276. (JSC::JSGlobalObject::markCrossHeapDependentObjects):
  23277. * kjs/JSGlobalObject.h:
  23278. * kjs/collector.cpp:
  23279. (JSC::Heap::collect):
  23280. Before GC sweep phase, a function supplied by global object is now called for all global
  23281. objects in the heap, making it possible to implement cross-heap dependencies.
  23282. 2008-10-15 Alexey Proskuryakov <ap@webkit.org>
  23283. Reviewed by Darin Adler.
  23284. https://bugs.webkit.org/show_bug.cgi?id=21610
  23285. run-webkit-threads --threaded crashes in StructureID destructor
  23286. * kjs/StructureID.cpp:
  23287. (JSC::StructureID::StructureID):
  23288. (JSC::StructureID::~StructureID):
  23289. Protect access to a static (debug-only) HashSet with a lock.
  23290. 2008-10-15 Sam Weinig <sam@webkit.org>
  23291. Reviewed by Goeffrey Garen.
  23292. Add function to dump statistics for StructureIDs.
  23293. * kjs/StructureID.cpp:
  23294. (JSC::StructureID::dumpStatistics):
  23295. (JSC::StructureID::StructureID):
  23296. (JSC::StructureID::~StructureID):
  23297. * kjs/StructureID.h:
  23298. 2008-10-15 Cameron Zwarich <zwarich@apple.com>
  23299. Reviewed by Maciej Stachowiak.
  23300. Bug 21633: Avoid using a HashMap when there is only a single transition
  23301. <https://bugs.webkit.org/show_bug.cgi?id=21633>
  23302. This is a 0.8% speedup on SunSpider and between a 0.5% and 1.0% speedup
  23303. on the V8 benchmark suite, depending on which harness we use. It will
  23304. also slightly reduce the memory footprint of a StructureID.
  23305. * kjs/StructureID.cpp:
  23306. (JSC::StructureID::StructureID):
  23307. (JSC::StructureID::~StructureID):
  23308. (JSC::StructureID::addPropertyTransition):
  23309. * kjs/StructureID.h:
  23310. (JSC::StructureID::):
  23311. 2008-10-15 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  23312. Reviewed by Geoffrey Garen.
  23313. 1.40% speedup on SunSpider, 1.44% speedup on V8. (Linux)
  23314. No change on Mac.
  23315. * VM/Machine.cpp:
  23316. (JSC::fastIsNumber): ALWAYS_INLINE modifier added.
  23317. 2008-10-15 Geoffrey Garen <ggaren@apple.com>
  23318. Reviewed by Cameron Zwarich.
  23319. Fixed https://bugs.webkit.org/show_bug.cgi?id=21345
  23320. Start the debugger without reloading the inspected page
  23321. * JavaScriptCore.exp: New symbols.
  23322. * JavaScriptCore.xcodeproj/project.pbxproj: New files.
  23323. * VM/CodeBlock.h:
  23324. (JSC::EvalCodeCache::get): Updated for tweak to parsing API.
  23325. * kjs/CollectorHeapIterator.h: Added. An iterator for the object heap,
  23326. which we use to find all the live functions and recompile them.
  23327. * kjs/DebuggerCallFrame.cpp:
  23328. (JSC::DebuggerCallFrame::evaluate): Updated for tweak to parsing API.
  23329. * kjs/FunctionConstructor.cpp:
  23330. (JSC::constructFunction): Updated for tweak to parsing API.
  23331. * kjs/JSFunction.cpp:
  23332. (JSC::JSFunction::JSFunction): Try to validate our SourceCode in debug
  23333. builds by ASSERTing that it's syntactically valid. This doesn't catch
  23334. all SourceCode bugs, but it catches a lot of them.
  23335. * kjs/JSGlobalObjectFunctions.cpp:
  23336. (JSC::globalFuncEval): Updated for tweak to parsing API.
  23337. * kjs/Parser.cpp:
  23338. (JSC::Parser::parse):
  23339. * kjs/Parser.h:
  23340. (JSC::Parser::parse): Tweaked the parser to make it possible to parse
  23341. without an ExecState, and to allow the client to specify a debugger to
  23342. notify (or not) about the source we parse. This allows the inspector
  23343. to recompile even though no JavaScript is executing, then notify the
  23344. debugger about all source code when it's done.
  23345. * kjs/Shell.cpp:
  23346. (prettyPrintScript): Updated for tweak to parsing API.
  23347. * kjs/SourceRange.h:
  23348. (JSC::SourceCode::isNull): Added to help with ASSERTs.
  23349. * kjs/collector.cpp:
  23350. (JSC::Heap::heapAllocate):
  23351. (JSC::Heap::sweep):
  23352. (JSC::Heap::primaryHeapBegin):
  23353. (JSC::Heap::primaryHeapEnd):
  23354. * kjs/collector.h:
  23355. (JSC::): Moved a bunch of declarations around to enable compilation of
  23356. CollectorHeapIterator.
  23357. * kjs/interpreter.cpp:
  23358. (JSC::Interpreter::checkSyntax):
  23359. (JSC::Interpreter::evaluate): Updated for tweak to parsing API.
  23360. * kjs/lexer.h:
  23361. (JSC::Lexer::sourceCode): BUG FIX: Calculate SourceCode ranges relative
  23362. to the SourceCode range in which we're lexing, otherwise nested functions
  23363. that are compiled individually get SourceCode ranges that don't reflect
  23364. their nesting.
  23365. * kjs/nodes.cpp:
  23366. (JSC::FunctionBodyNode::FunctionBodyNode):
  23367. (JSC::FunctionBodyNode::finishParsing):
  23368. (JSC::FunctionBodyNode::create):
  23369. (JSC::FunctionBodyNode::copyParameters):
  23370. * kjs/nodes.h:
  23371. (JSC::ScopeNode::setSource):
  23372. (JSC::FunctionBodyNode::parameterCount): Added some helper functions for
  23373. copying one FunctionBodyNode's parameters to another. The recompiler uses
  23374. these when calling "finishParsing".
  23375. 2008-10-15 Joerg Bornemann <joerg.bornemann@trolltech.com>
  23376. Reviewed by Darin Adler.
  23377. - part of https://bugs.webkit.org/show_bug.cgi?id=20746
  23378. Fix compilation on Windows CE.
  23379. str(n)icmp, strdup and vsnprintf are not available on Windows CE,
  23380. they are called _str(n)icmp, etc. instead
  23381. * wtf/StringExtras.h: Added inline function implementations.
  23382. 2008-10-15 Gabor Loki <loki@inf.u-szeged.hu>
  23383. Reviewed by Cameron Zwarich.
  23384. <https://bugs.webkit.org/show_bug.cgi?id=20912>
  23385. Use simple uint32_t multiplication on op_mul if both operands are
  23386. immediate number and they are between zero and 0x7FFF.
  23387. * VM/Machine.cpp:
  23388. (JSC::Machine::privateExecute):
  23389. 2008-10-09 Darin Fisher <darin@chromium.org>
  23390. Reviewed by Sam Weinig.
  23391. Make pan scrolling a platform configurable option.
  23392. https://bugs.webkit.org/show_bug.cgi?id=21515
  23393. * wtf/Platform.h: Add ENABLE_PAN_SCROLLING
  23394. 2008-10-14 Maciej Stachowiak <mjs@apple.com>
  23395. Rubber stamped by Sam Weinig.
  23396. - revert r37572 and r37581 for now
  23397. Turns out GCC 4.2 is still a (small) regression, we'll have to do
  23398. more work to turn it on.
  23399. * Configurations/DebugRelease.xcconfig:
  23400. * JavaScriptCore.xcodeproj/project.pbxproj:
  23401. * VM/CTI.cpp:
  23402. * VM/CTI.h:
  23403. * VM/Machine.cpp:
  23404. (JSC::Machine::cti_op_convert_this):
  23405. (JSC::Machine::cti_op_end):
  23406. (JSC::Machine::cti_op_add):
  23407. (JSC::Machine::cti_op_pre_inc):
  23408. (JSC::Machine::cti_timeout_check):
  23409. (JSC::Machine::cti_register_file_check):
  23410. (JSC::Machine::cti_op_loop_if_less):
  23411. (JSC::Machine::cti_op_loop_if_lesseq):
  23412. (JSC::Machine::cti_op_new_object):
  23413. (JSC::Machine::cti_op_put_by_id):
  23414. (JSC::Machine::cti_op_put_by_id_second):
  23415. (JSC::Machine::cti_op_put_by_id_generic):
  23416. (JSC::Machine::cti_op_put_by_id_fail):
  23417. (JSC::Machine::cti_op_get_by_id):
  23418. (JSC::Machine::cti_op_get_by_id_second):
  23419. (JSC::Machine::cti_op_get_by_id_generic):
  23420. (JSC::Machine::cti_op_get_by_id_fail):
  23421. (JSC::Machine::cti_op_instanceof):
  23422. (JSC::Machine::cti_op_del_by_id):
  23423. (JSC::Machine::cti_op_mul):
  23424. (JSC::Machine::cti_op_new_func):
  23425. (JSC::Machine::cti_op_call_JSFunction):
  23426. (JSC::Machine::cti_vm_compile):
  23427. (JSC::Machine::cti_op_push_activation):
  23428. (JSC::Machine::cti_op_call_NotJSFunction):
  23429. (JSC::Machine::cti_op_create_arguments):
  23430. (JSC::Machine::cti_op_tear_off_activation):
  23431. (JSC::Machine::cti_op_tear_off_arguments):
  23432. (JSC::Machine::cti_op_ret_profiler):
  23433. (JSC::Machine::cti_op_ret_scopeChain):
  23434. (JSC::Machine::cti_op_new_array):
  23435. (JSC::Machine::cti_op_resolve):
  23436. (JSC::Machine::cti_op_construct_JSConstruct):
  23437. (JSC::Machine::cti_op_construct_NotJSConstruct):
  23438. (JSC::Machine::cti_op_get_by_val):
  23439. (JSC::Machine::cti_op_resolve_func):
  23440. (JSC::Machine::cti_op_sub):
  23441. (JSC::Machine::cti_op_put_by_val):
  23442. (JSC::Machine::cti_op_put_by_val_array):
  23443. (JSC::Machine::cti_op_lesseq):
  23444. (JSC::Machine::cti_op_loop_if_true):
  23445. (JSC::Machine::cti_op_negate):
  23446. (JSC::Machine::cti_op_resolve_base):
  23447. (JSC::Machine::cti_op_resolve_skip):
  23448. (JSC::Machine::cti_op_resolve_global):
  23449. (JSC::Machine::cti_op_div):
  23450. (JSC::Machine::cti_op_pre_dec):
  23451. (JSC::Machine::cti_op_jless):
  23452. (JSC::Machine::cti_op_not):
  23453. (JSC::Machine::cti_op_jtrue):
  23454. (JSC::Machine::cti_op_post_inc):
  23455. (JSC::Machine::cti_op_eq):
  23456. (JSC::Machine::cti_op_lshift):
  23457. (JSC::Machine::cti_op_bitand):
  23458. (JSC::Machine::cti_op_rshift):
  23459. (JSC::Machine::cti_op_bitnot):
  23460. (JSC::Machine::cti_op_resolve_with_base):
  23461. (JSC::Machine::cti_op_new_func_exp):
  23462. (JSC::Machine::cti_op_mod):
  23463. (JSC::Machine::cti_op_less):
  23464. (JSC::Machine::cti_op_neq):
  23465. (JSC::Machine::cti_op_post_dec):
  23466. (JSC::Machine::cti_op_urshift):
  23467. (JSC::Machine::cti_op_bitxor):
  23468. (JSC::Machine::cti_op_new_regexp):
  23469. (JSC::Machine::cti_op_bitor):
  23470. (JSC::Machine::cti_op_call_eval):
  23471. (JSC::Machine::cti_op_throw):
  23472. (JSC::Machine::cti_op_get_pnames):
  23473. (JSC::Machine::cti_op_next_pname):
  23474. (JSC::Machine::cti_op_push_scope):
  23475. (JSC::Machine::cti_op_pop_scope):
  23476. (JSC::Machine::cti_op_typeof):
  23477. (JSC::Machine::cti_op_is_undefined):
  23478. (JSC::Machine::cti_op_is_boolean):
  23479. (JSC::Machine::cti_op_is_number):
  23480. (JSC::Machine::cti_op_is_string):
  23481. (JSC::Machine::cti_op_is_object):
  23482. (JSC::Machine::cti_op_is_function):
  23483. (JSC::Machine::cti_op_stricteq):
  23484. (JSC::Machine::cti_op_nstricteq):
  23485. (JSC::Machine::cti_op_to_jsnumber):
  23486. (JSC::Machine::cti_op_in):
  23487. (JSC::Machine::cti_op_push_new_scope):
  23488. (JSC::Machine::cti_op_jmp_scopes):
  23489. (JSC::Machine::cti_op_put_by_index):
  23490. (JSC::Machine::cti_op_switch_imm):
  23491. (JSC::Machine::cti_op_switch_char):
  23492. (JSC::Machine::cti_op_switch_string):
  23493. (JSC::Machine::cti_op_del_by_val):
  23494. (JSC::Machine::cti_op_put_getter):
  23495. (JSC::Machine::cti_op_put_setter):
  23496. (JSC::Machine::cti_op_new_error):
  23497. (JSC::Machine::cti_op_debug):
  23498. (JSC::Machine::cti_vm_throw):
  23499. * VM/Machine.h:
  23500. * masm/X86Assembler.h:
  23501. (JSC::X86Assembler::emitRestoreArgumentReference):
  23502. (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
  23503. * wtf/Platform.h:
  23504. 2008-10-14 Alexey Proskuryakov <ap@webkit.org>
  23505. Reviewed by Darin Adler.
  23506. https://bugs.webkit.org/show_bug.cgi?id=20256
  23507. Array.push and other standard methods disappear
  23508. * kjs/JSGlobalData.cpp:
  23509. (JSC::JSGlobalData::JSGlobalData):
  23510. (JSC::JSGlobalData::~JSGlobalData):
  23511. Don't use static hash tables even on platforms that don't enable JSC_MULTIPLE_THREADS -
  23512. these tables reference IdentifierTable, which is always per-GlobalData.
  23513. 2008-10-14 Maciej Stachowiak <mjs@apple.com>
  23514. Reviewed by Cameron Zwarich.
  23515. - always use CTI_ARGUMENTS and CTI_ARGUMENTS_FASTCALL
  23516. This is a small regression for GCC 4.0, but simplifies the code
  23517. for future improvements and lets us focus on GCC 4.2+ and MSVC.
  23518. * VM/CTI.cpp:
  23519. * VM/CTI.h:
  23520. * VM/Machine.cpp:
  23521. (JSC::Machine::cti_op_convert_this):
  23522. (JSC::Machine::cti_op_end):
  23523. (JSC::Machine::cti_op_add):
  23524. (JSC::Machine::cti_op_pre_inc):
  23525. (JSC::Machine::cti_timeout_check):
  23526. (JSC::Machine::cti_register_file_check):
  23527. (JSC::Machine::cti_op_loop_if_less):
  23528. (JSC::Machine::cti_op_loop_if_lesseq):
  23529. (JSC::Machine::cti_op_new_object):
  23530. (JSC::Machine::cti_op_put_by_id):
  23531. (JSC::Machine::cti_op_put_by_id_second):
  23532. (JSC::Machine::cti_op_put_by_id_generic):
  23533. (JSC::Machine::cti_op_put_by_id_fail):
  23534. (JSC::Machine::cti_op_get_by_id):
  23535. (JSC::Machine::cti_op_get_by_id_second):
  23536. (JSC::Machine::cti_op_get_by_id_generic):
  23537. (JSC::Machine::cti_op_get_by_id_fail):
  23538. (JSC::Machine::cti_op_instanceof):
  23539. (JSC::Machine::cti_op_del_by_id):
  23540. (JSC::Machine::cti_op_mul):
  23541. (JSC::Machine::cti_op_new_func):
  23542. (JSC::Machine::cti_op_call_JSFunction):
  23543. (JSC::Machine::cti_vm_compile):
  23544. (JSC::Machine::cti_op_push_activation):
  23545. (JSC::Machine::cti_op_call_NotJSFunction):
  23546. (JSC::Machine::cti_op_create_arguments):
  23547. (JSC::Machine::cti_op_tear_off_activation):
  23548. (JSC::Machine::cti_op_tear_off_arguments):
  23549. (JSC::Machine::cti_op_ret_profiler):
  23550. (JSC::Machine::cti_op_ret_scopeChain):
  23551. (JSC::Machine::cti_op_new_array):
  23552. (JSC::Machine::cti_op_resolve):
  23553. (JSC::Machine::cti_op_construct_JSConstruct):
  23554. (JSC::Machine::cti_op_construct_NotJSConstruct):
  23555. (JSC::Machine::cti_op_get_by_val):
  23556. (JSC::Machine::cti_op_resolve_func):
  23557. (JSC::Machine::cti_op_sub):
  23558. (JSC::Machine::cti_op_put_by_val):
  23559. (JSC::Machine::cti_op_put_by_val_array):
  23560. (JSC::Machine::cti_op_lesseq):
  23561. (JSC::Machine::cti_op_loop_if_true):
  23562. (JSC::Machine::cti_op_negate):
  23563. (JSC::Machine::cti_op_resolve_base):
  23564. (JSC::Machine::cti_op_resolve_skip):
  23565. (JSC::Machine::cti_op_resolve_global):
  23566. (JSC::Machine::cti_op_div):
  23567. (JSC::Machine::cti_op_pre_dec):
  23568. (JSC::Machine::cti_op_jless):
  23569. (JSC::Machine::cti_op_not):
  23570. (JSC::Machine::cti_op_jtrue):
  23571. (JSC::Machine::cti_op_post_inc):
  23572. (JSC::Machine::cti_op_eq):
  23573. (JSC::Machine::cti_op_lshift):
  23574. (JSC::Machine::cti_op_bitand):
  23575. (JSC::Machine::cti_op_rshift):
  23576. (JSC::Machine::cti_op_bitnot):
  23577. (JSC::Machine::cti_op_resolve_with_base):
  23578. (JSC::Machine::cti_op_new_func_exp):
  23579. (JSC::Machine::cti_op_mod):
  23580. (JSC::Machine::cti_op_less):
  23581. (JSC::Machine::cti_op_neq):
  23582. (JSC::Machine::cti_op_post_dec):
  23583. (JSC::Machine::cti_op_urshift):
  23584. (JSC::Machine::cti_op_bitxor):
  23585. (JSC::Machine::cti_op_new_regexp):
  23586. (JSC::Machine::cti_op_bitor):
  23587. (JSC::Machine::cti_op_call_eval):
  23588. (JSC::Machine::cti_op_throw):
  23589. (JSC::Machine::cti_op_get_pnames):
  23590. (JSC::Machine::cti_op_next_pname):
  23591. (JSC::Machine::cti_op_push_scope):
  23592. (JSC::Machine::cti_op_pop_scope):
  23593. (JSC::Machine::cti_op_typeof):
  23594. (JSC::Machine::cti_op_is_undefined):
  23595. (JSC::Machine::cti_op_is_boolean):
  23596. (JSC::Machine::cti_op_is_number):
  23597. (JSC::Machine::cti_op_is_string):
  23598. (JSC::Machine::cti_op_is_object):
  23599. (JSC::Machine::cti_op_is_function):
  23600. (JSC::Machine::cti_op_stricteq):
  23601. (JSC::Machine::cti_op_nstricteq):
  23602. (JSC::Machine::cti_op_to_jsnumber):
  23603. (JSC::Machine::cti_op_in):
  23604. (JSC::Machine::cti_op_push_new_scope):
  23605. (JSC::Machine::cti_op_jmp_scopes):
  23606. (JSC::Machine::cti_op_put_by_index):
  23607. (JSC::Machine::cti_op_switch_imm):
  23608. (JSC::Machine::cti_op_switch_char):
  23609. (JSC::Machine::cti_op_switch_string):
  23610. (JSC::Machine::cti_op_del_by_val):
  23611. (JSC::Machine::cti_op_put_getter):
  23612. (JSC::Machine::cti_op_put_setter):
  23613. (JSC::Machine::cti_op_new_error):
  23614. (JSC::Machine::cti_op_debug):
  23615. (JSC::Machine::cti_vm_throw):
  23616. * VM/Machine.h:
  23617. * masm/X86Assembler.h:
  23618. (JSC::X86Assembler::emitRestoreArgumentReference):
  23619. (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
  23620. * wtf/Platform.h:
  23621. 2008-10-13 Maciej Stachowiak <mjs@apple.com>
  23622. Reviewed by Cameron Zwarich.
  23623. - make Machine::getArgumentsData an Arguments method and inline it
  23624. ~2% on v8 raytrace
  23625. * VM/Machine.cpp:
  23626. * kjs/Arguments.h:
  23627. (JSC::Machine::getArgumentsData):
  23628. 2008-10-13 Alp Toker <alp@nuanti.com>
  23629. Fix autotools dist build target by listing recently added header
  23630. files only. Not reviewed.
  23631. * GNUmakefile.am:
  23632. 2008-10-13 Maciej Stachowiak <mjs@apple.com>
  23633. Rubber stamped by Mark Rowe.
  23634. - fixed <rdar://problem/5806316> JavaScriptCore should not force building with gcc 4.0
  23635. - use gcc 4.2 when building with Xcode 3.1 or newer on Leopard, even though this is not the default
  23636. * Configurations/DebugRelease.xcconfig:
  23637. * JavaScriptCore.xcodeproj/project.pbxproj:
  23638. 2008-10-13 Cameron Zwarich <zwarich@apple.com>
  23639. Reviewed by Geoff Garen.
  23640. Bug 21541: Move RegisterFile growth check to callee
  23641. <https://bugs.webkit.org/show_bug.cgi?id=21541>
  23642. Move the RegisterFile growth check to the callee in the common case,
  23643. where some of the information is known statically at JIT time. There is
  23644. still a check in the caller in the case where the caller provides too
  23645. few arguments.
  23646. This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
  23647. the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
  23648. 1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
  23649. SunSpider.
  23650. * VM/CTI.cpp:
  23651. (JSC::CTI::privateCompile):
  23652. * VM/Machine.cpp:
  23653. (JSC::Machine::cti_register_file_check):
  23654. (JSC::Machine::cti_op_call_JSFunction):
  23655. (JSC::Machine::cti_op_construct_JSConstruct):
  23656. * VM/Machine.h:
  23657. * VM/RegisterFile.h:
  23658. * masm/X86Assembler.h:
  23659. (JSC::X86Assembler::):
  23660. (JSC::X86Assembler::cmpl_mr):
  23661. (JSC::X86Assembler::emitUnlinkedJg):
  23662. 2008-10-13 Sam Weinig <sam@webkit.org>
  23663. Reviewed by Dan Bernstein.
  23664. Fix for https://bugs.webkit.org/show_bug.cgi?id=21577
  23665. 5 false positive StructureID leaks
  23666. - Add leak ignore set to StructureID to selectively ignore leaking some StructureIDs.
  23667. - Add create method to JSGlolalData to be used when the data will be intentionally
  23668. leaked and ignore all leaks caused the StructureIDs stored in it.
  23669. * JavaScriptCore.exp:
  23670. * kjs/JSGlobalData.cpp:
  23671. (JSC::JSGlobalData::createLeaked):
  23672. * kjs/JSGlobalData.h:
  23673. * kjs/StructureID.cpp:
  23674. (JSC::StructureID::StructureID):
  23675. (JSC::StructureID::~StructureID):
  23676. (JSC::StructureID::startIgnoringLeaks):
  23677. (JSC::StructureID::stopIgnoringLeaks):
  23678. * kjs/StructureID.h:
  23679. 2008-10-13 Marco Barisione <marco.barisione@collabora.co.uk>
  23680. Reviewed by Darin Adler. Landed by Jan Alonzo.
  23681. WebKit GTK Port needs a smartpointer to handle g_free (GFreePtr?)
  23682. http://bugs.webkit.org/show_bug.cgi?id=20483
  23683. Add a GOwnPtr smart pointer (similar to OwnPtr) to handle memory
  23684. allocated by GLib and start the conversion to use it.
  23685. * GNUmakefile.am:
  23686. * wtf/GOwnPtr.cpp: Added.
  23687. (WTF::GError):
  23688. (WTF::GList):
  23689. (WTF::GCond):
  23690. (WTF::GMutex):
  23691. (WTF::GPatternSpec):
  23692. (WTF::GDir):
  23693. * wtf/GOwnPtr.h: Added.
  23694. (WTF::freeOwnedPtr):
  23695. (WTF::GOwnPtr::GOwnPtr):
  23696. (WTF::GOwnPtr::~GOwnPtr):
  23697. (WTF::GOwnPtr::get):
  23698. (WTF::GOwnPtr::release):
  23699. (WTF::GOwnPtr::rawPtr):
  23700. (WTF::GOwnPtr::set):
  23701. (WTF::GOwnPtr::clear):
  23702. (WTF::GOwnPtr::operator*):
  23703. (WTF::GOwnPtr::operator->):
  23704. (WTF::GOwnPtr::operator!):
  23705. (WTF::GOwnPtr::operator UnspecifiedBoolType):
  23706. (WTF::GOwnPtr::swap):
  23707. (WTF::swap):
  23708. (WTF::operator==):
  23709. (WTF::operator!=):
  23710. (WTF::getPtr):
  23711. * wtf/Threading.h:
  23712. * wtf/ThreadingGtk.cpp:
  23713. (WTF::Mutex::~Mutex):
  23714. (WTF::Mutex::lock):
  23715. (WTF::Mutex::tryLock):
  23716. (WTF::Mutex::unlock):
  23717. (WTF::ThreadCondition::~ThreadCondition):
  23718. (WTF::ThreadCondition::wait):
  23719. (WTF::ThreadCondition::timedWait):
  23720. (WTF::ThreadCondition::signal):
  23721. (WTF::ThreadCondition::broadcast):
  23722. 2008-10-12 Gabriella Toth <gtoth@inf.u-szeged.hu>
  23723. Reviewed by Darin Adler.
  23724. - part of https://bugs.webkit.org/show_bug.cgi?id=21055
  23725. Bug 21055: not invoked functions
  23726. * kjs/nodes.cpp: Deleted a function that is not invoked:
  23727. statementListInitializeVariableAccessStack.
  23728. 2008-10-12 Darin Adler <darin@apple.com>
  23729. Reviewed by Sam Weinig.
  23730. * wtf/unicode/icu/UnicodeIcu.h: Fixed indentation to match WebKit coding style.
  23731. * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  23732. 2008-10-12 Darin Adler <darin@apple.com>
  23733. Reviewed by Sam Weinig.
  23734. - https://bugs.webkit.org/show_bug.cgi?id=21556
  23735. Bug 21556: non-ASCII digits are allowed in places where only ASCII should be
  23736. * wtf/unicode/icu/UnicodeIcu.h: Removed isDigit, digitValue, and isFormatChar.
  23737. * wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  23738. 2008-10-12 Anders Carlsson <andersca@apple.com>
  23739. Reviewed by Darin Adler.
  23740. Make the append method that takes a Vector more strict - it now requires the elements
  23741. of the vector to be appended same type as the elements of the Vector they're being appended to.
  23742. This would cause problems when dealing with Vectors containing other Vectors.
  23743. * wtf/Vector.h:
  23744. (WTF::::append):
  23745. 2008-10-11 Cameron Zwarich <zwarich@apple.com>
  23746. Reviewed by Sam Weinig.
  23747. Clean up RegExpMatchesArray.h to match our coding style.
  23748. * kjs/RegExpMatchesArray.h:
  23749. (JSC::RegExpMatchesArray::getOwnPropertySlot):
  23750. (JSC::RegExpMatchesArray::put):
  23751. (JSC::RegExpMatchesArray::deleteProperty):
  23752. (JSC::RegExpMatchesArray::getPropertyNames):
  23753. 2008-10-11 Cameron Zwarich <zwarich@apple.com>
  23754. Reviewed by Sam Weinig.
  23755. Bug 21525: 55 StructureID leaks on Wikitravel's main page
  23756. <https://bugs.webkit.org/show_bug.cgi?id=21525>
  23757. Bug 21533: Simple JavaScript code leaks StructureIDs
  23758. <https://bugs.webkit.org/show_bug.cgi?id=21533>
  23759. StructureID::getEnumerablePropertyNames() ends up calling back to itself
  23760. via JSObject::getPropertyNames(), which causes the PropertyNameArray to
  23761. be cached twice. This leads to a memory leak in almost every use of
  23762. JSObject::getPropertyNames() on an object. The fix here is based on a
  23763. suggestion of Sam Weinig.
  23764. This patch also fixes every StructureID leaks that occurs while running
  23765. the Mozilla MemBuster test.
  23766. * kjs/PropertyNameArray.h:
  23767. (JSC::PropertyNameArray::PropertyNameArray):
  23768. (JSC::PropertyNameArray::setCacheable):
  23769. (JSC::PropertyNameArray::cacheable):
  23770. * kjs/StructureID.cpp:
  23771. (JSC::StructureID::getEnumerablePropertyNames):
  23772. 2008-10-10 Oliver Hunt <oliver@apple.com>
  23773. Reviewed by Cameron Zwarich.
  23774. Use fastcall calling convention on GCC > 4.0
  23775. Results in a 2-3% improvement in GCC 4.2 performance, so
  23776. that it is no longer a regression vs. GCC 4.0
  23777. * VM/CTI.cpp:
  23778. * VM/Machine.h:
  23779. * wtf/Platform.h:
  23780. 2008-10-10 Sam Weinig <sam@webkit.org>
  23781. Reviewed by Darin Adler.
  23782. - Add a workaround for a bug in ceil in Darwin libc.
  23783. - Remove old workarounds for JS math functions that are not needed
  23784. anymore.
  23785. The math functions are heavily tested by fast/js/math.html.
  23786. * kjs/MathObject.cpp:
  23787. (JSC::mathProtoFuncAbs): Remove workaround.
  23788. (JSC::mathProtoFuncCeil): Ditto.
  23789. (JSC::mathProtoFuncFloor): Ditto.
  23790. * wtf/MathExtras.h:
  23791. (wtf_ceil): Add ceil workaround for darwin.
  23792. 2008-10-10 Sam Weinig <sam@webkit.org>
  23793. Reviewed by Darin Adler
  23794. Add Assertions to JSObject constructor.
  23795. * kjs/JSObject.h:
  23796. (JSC::JSObject::JSObject):
  23797. 2008-10-10 Sam Weinig <sam@webkit.org>
  23798. Reviewed by Cameron Zwarich.
  23799. Remove now unused m_getterSetterFlag variable from PropertyMap.
  23800. * kjs/PropertyMap.cpp:
  23801. (JSC::PropertyMap::operator=):
  23802. * kjs/PropertyMap.h:
  23803. (JSC::PropertyMap::PropertyMap):
  23804. 2008-10-09 Sam Weinig <sam@webkit.org>
  23805. Reviewed by Maciej Stachowiak.
  23806. Add leaks checking to StructureID.
  23807. * kjs/StructureID.cpp:
  23808. (JSC::StructureID::StructureID):
  23809. (JSC::StructureID::~StructureID):
  23810. 2008-10-09 Alp Toker <alp@nuanti.com>
  23811. Reviewed by Mark Rowe.
  23812. https://bugs.webkit.org/show_bug.cgi?id=20760
  23813. Implement support for x86 Linux in CTI
  23814. Prepare to enable CTI/WREC on supported architectures.
  23815. Make it possible to use the CTI_ARGUMENT workaround with GCC as well
  23816. as MSVC by fixing some preprocessor conditionals.
  23817. Note that CTI/WREC no longer requires CTI_ARGUMENT on Linux so we
  23818. don't actually enable it except when building with MSVC. GCC on Win32
  23819. remains untested.
  23820. Adapt inline ASM code to use the global symbol underscore prefix only
  23821. on Darwin and to call the properly mangled Machine::cti_vm_throw
  23822. symbol name depending on CTI_ARGUMENT.
  23823. Also avoid global inclusion of the JIT infrastructure headers
  23824. throughout WebCore and WebKit causing recompilation of about ~1500
  23825. source files after modification to X86Assembler.h, CTI.h, WREC.h,
  23826. which are only used deep inside JavaScriptCore.
  23827. * GNUmakefile.am:
  23828. * VM/CTI.cpp:
  23829. * VM/CTI.h:
  23830. * VM/Machine.cpp:
  23831. * VM/Machine.h:
  23832. * kjs/regexp.cpp:
  23833. (JSC::RegExp::RegExp):
  23834. (JSC::RegExp::~RegExp):
  23835. (JSC::RegExp::match):
  23836. * kjs/regexp.h:
  23837. * masm/X86Assembler.h:
  23838. (JSC::X86Assembler::emitConvertToFastCall):
  23839. (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
  23840. (JSC::X86Assembler::emitRestoreArgumentReference):
  23841. 2008-10-09 Gavin Barraclough <barraclough@apple.com>
  23842. Reviewed by Cameron Zwarich.
  23843. Fix for bug #21160, x=0;1/(x*-1) == -Infinity
  23844. * ChangeLog:
  23845. * VM/CTI.cpp:
  23846. (JSC::CTI::emitFastArithDeTagImmediate):
  23847. (JSC::CTI::emitFastArithDeTagImmediateJumpIfZero):
  23848. (JSC::CTI::compileBinaryArithOp):
  23849. (JSC::CTI::compileBinaryArithOpSlowCase):
  23850. (JSC::CTI::privateCompileMainPass):
  23851. (JSC::CTI::privateCompileSlowCases):
  23852. * VM/CTI.h:
  23853. * masm/X86Assembler.h:
  23854. (JSC::X86Assembler::):
  23855. (JSC::X86Assembler::emitUnlinkedJs):
  23856. 2008-10-09 Cameron Zwarich <zwarich@apple.com>
  23857. Reviewed by Oliver Hunt.
  23858. Bug 21459: REGRESSION (r37324): Safari crashes inside JavaScriptCore while browsing hulu.com
  23859. <https://bugs.webkit.org/show_bug.cgi?id=21459>
  23860. After r37324, an Arguments object does not mark an associated activation
  23861. object. This change was made because Arguments no longer directly used
  23862. the activation object in any way. However, if an activation is torn off,
  23863. then the backing store of Arguments becomes the register array of the
  23864. activation object. Arguments directly marks all of the arguments, but
  23865. the activation object is being collected, which causes its register
  23866. array to be freed and new memory to be allocated in its place.
  23867. Unfortunately, it does not seem possible to reproduce this issue in a
  23868. layout test.
  23869. * kjs/Arguments.cpp:
  23870. (JSC::Arguments::mark):
  23871. * kjs/Arguments.h:
  23872. (JSC::Arguments::setActivation):
  23873. (JSC::Arguments::Arguments):
  23874. (JSC::JSActivation::copyRegisters):
  23875. 2008-10-09 Ariya Hidayat <ariya.hidayat@trolltech.com>
  23876. Reviewed by Simon.
  23877. Build fix for MinGW.
  23878. * wtf/AlwaysInline.h:
  23879. 2008-10-08 Cameron Zwarich <zwarich@apple.com>
  23880. Reviewed by Maciej Stachowiak.
  23881. Bug 21497: REGRESSION (r37433): Bytecode JSC tests are severely broken
  23882. <https://bugs.webkit.org/show_bug.cgi?id=21497>
  23883. Fix a typo in r37433 that causes the failure of a large number of JSC
  23884. tests with the bytecode interpreter enabled.
  23885. * VM/Machine.cpp:
  23886. (JSC::Machine::privateExecute):
  23887. 2008-10-08 Mark Rowe <mrowe@apple.com>
  23888. Windows build fix.
  23889. * VM/CTI.cpp:
  23890. (JSC::): Update type of argument to ctiTrampoline.
  23891. 2008-10-08 Darin Adler <darin@apple.com>
  23892. Reviewed by Cameron Zwarich.
  23893. - https://bugs.webkit.org/show_bug.cgi?id=21403
  23894. Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
  23895. Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
  23896. client over to the new name.
  23897. Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
  23898. as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
  23899. accessor functions to get at things in the frame.
  23900. Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
  23901. JSGlobalData* and in other cases eliminating them entirely.
  23902. * API/JSObjectRef.cpp:
  23903. (JSObjectMakeFunctionWithCallback):
  23904. (JSObjectMakeFunction):
  23905. (JSObjectHasProperty):
  23906. (JSObjectGetProperty):
  23907. (JSObjectSetProperty):
  23908. (JSObjectDeleteProperty):
  23909. * API/OpaqueJSString.cpp:
  23910. * API/OpaqueJSString.h:
  23911. * VM/CTI.cpp:
  23912. (JSC::CTI::getConstant):
  23913. (JSC::CTI::emitGetArg):
  23914. (JSC::CTI::emitGetPutArg):
  23915. (JSC::CTI::getConstantImmediateNumericArg):
  23916. (JSC::CTI::printOpcodeOperandTypes):
  23917. (JSC::CTI::CTI):
  23918. (JSC::CTI::compileOpCall):
  23919. (JSC::CTI::compileBinaryArithOp):
  23920. (JSC::CTI::privateCompileMainPass):
  23921. (JSC::CTI::privateCompile):
  23922. (JSC::CTI::privateCompileGetByIdProto):
  23923. (JSC::CTI::privateCompileGetByIdChain):
  23924. (JSC::CTI::compileRegExp):
  23925. * VM/CTI.h:
  23926. * VM/CodeBlock.h:
  23927. * VM/CodeGenerator.cpp:
  23928. (JSC::CodeGenerator::emitEqualityOp):
  23929. (JSC::CodeGenerator::emitLoad):
  23930. (JSC::CodeGenerator::emitUnexpectedLoad):
  23931. (JSC::CodeGenerator::emitConstruct):
  23932. * VM/CodeGenerator.h:
  23933. * VM/Machine.cpp:
  23934. (JSC::jsLess):
  23935. (JSC::jsLessEq):
  23936. (JSC::jsAddSlowCase):
  23937. (JSC::jsAdd):
  23938. (JSC::jsTypeStringForValue):
  23939. (JSC::Machine::resolve):
  23940. (JSC::Machine::resolveSkip):
  23941. (JSC::Machine::resolveGlobal):
  23942. (JSC::inlineResolveBase):
  23943. (JSC::Machine::resolveBase):
  23944. (JSC::Machine::resolveBaseAndProperty):
  23945. (JSC::Machine::resolveBaseAndFunc):
  23946. (JSC::Machine::slideRegisterWindowForCall):
  23947. (JSC::isNotObject):
  23948. (JSC::Machine::callEval):
  23949. (JSC::Machine::dumpCallFrame):
  23950. (JSC::Machine::dumpRegisters):
  23951. (JSC::Machine::unwindCallFrame):
  23952. (JSC::Machine::throwException):
  23953. (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
  23954. (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
  23955. (JSC::Machine::execute):
  23956. (JSC::Machine::debug):
  23957. (JSC::Machine::createExceptionScope):
  23958. (JSC::cachePrototypeChain):
  23959. (JSC::Machine::tryCachePutByID):
  23960. (JSC::Machine::tryCacheGetByID):
  23961. (JSC::Machine::privateExecute):
  23962. (JSC::Machine::retrieveArguments):
  23963. (JSC::Machine::retrieveCaller):
  23964. (JSC::Machine::retrieveLastCaller):
  23965. (JSC::Machine::findFunctionCallFrame):
  23966. (JSC::Machine::getArgumentsData):
  23967. (JSC::Machine::tryCTICachePutByID):
  23968. (JSC::Machine::getCTIArrayLengthTrampoline):
  23969. (JSC::Machine::getCTIStringLengthTrampoline):
  23970. (JSC::Machine::tryCTICacheGetByID):
  23971. (JSC::Machine::cti_op_convert_this):
  23972. (JSC::Machine::cti_op_end):
  23973. (JSC::Machine::cti_op_add):
  23974. (JSC::Machine::cti_op_pre_inc):
  23975. (JSC::Machine::cti_timeout_check):
  23976. (JSC::Machine::cti_op_loop_if_less):
  23977. (JSC::Machine::cti_op_loop_if_lesseq):
  23978. (JSC::Machine::cti_op_new_object):
  23979. (JSC::Machine::cti_op_put_by_id):
  23980. (JSC::Machine::cti_op_put_by_id_second):
  23981. (JSC::Machine::cti_op_put_by_id_generic):
  23982. (JSC::Machine::cti_op_put_by_id_fail):
  23983. (JSC::Machine::cti_op_get_by_id):
  23984. (JSC::Machine::cti_op_get_by_id_second):
  23985. (JSC::Machine::cti_op_get_by_id_generic):
  23986. (JSC::Machine::cti_op_get_by_id_fail):
  23987. (JSC::Machine::cti_op_instanceof):
  23988. (JSC::Machine::cti_op_del_by_id):
  23989. (JSC::Machine::cti_op_mul):
  23990. (JSC::Machine::cti_op_new_func):
  23991. (JSC::Machine::cti_op_call_JSFunction):
  23992. (JSC::Machine::cti_vm_compile):
  23993. (JSC::Machine::cti_op_push_activation):
  23994. (JSC::Machine::cti_op_call_NotJSFunction):
  23995. (JSC::Machine::cti_op_create_arguments):
  23996. (JSC::Machine::cti_op_tear_off_activation):
  23997. (JSC::Machine::cti_op_tear_off_arguments):
  23998. (JSC::Machine::cti_op_ret_profiler):
  23999. (JSC::Machine::cti_op_ret_scopeChain):
  24000. (JSC::Machine::cti_op_new_array):
  24001. (JSC::Machine::cti_op_resolve):
  24002. (JSC::Machine::cti_op_construct_JSConstruct):
  24003. (JSC::Machine::cti_op_construct_NotJSConstruct):
  24004. (JSC::Machine::cti_op_get_by_val):
  24005. (JSC::Machine::cti_op_resolve_func):
  24006. (JSC::Machine::cti_op_sub):
  24007. (JSC::Machine::cti_op_put_by_val):
  24008. (JSC::Machine::cti_op_put_by_val_array):
  24009. (JSC::Machine::cti_op_lesseq):
  24010. (JSC::Machine::cti_op_loop_if_true):
  24011. (JSC::Machine::cti_op_negate):
  24012. (JSC::Machine::cti_op_resolve_base):
  24013. (JSC::Machine::cti_op_resolve_skip):
  24014. (JSC::Machine::cti_op_resolve_global):
  24015. (JSC::Machine::cti_op_div):
  24016. (JSC::Machine::cti_op_pre_dec):
  24017. (JSC::Machine::cti_op_jless):
  24018. (JSC::Machine::cti_op_not):
  24019. (JSC::Machine::cti_op_jtrue):
  24020. (JSC::Machine::cti_op_post_inc):
  24021. (JSC::Machine::cti_op_eq):
  24022. (JSC::Machine::cti_op_lshift):
  24023. (JSC::Machine::cti_op_bitand):
  24024. (JSC::Machine::cti_op_rshift):
  24025. (JSC::Machine::cti_op_bitnot):
  24026. (JSC::Machine::cti_op_resolve_with_base):
  24027. (JSC::Machine::cti_op_new_func_exp):
  24028. (JSC::Machine::cti_op_mod):
  24029. (JSC::Machine::cti_op_less):
  24030. (JSC::Machine::cti_op_neq):
  24031. (JSC::Machine::cti_op_post_dec):
  24032. (JSC::Machine::cti_op_urshift):
  24033. (JSC::Machine::cti_op_bitxor):
  24034. (JSC::Machine::cti_op_new_regexp):
  24035. (JSC::Machine::cti_op_bitor):
  24036. (JSC::Machine::cti_op_call_eval):
  24037. (JSC::Machine::cti_op_throw):
  24038. (JSC::Machine::cti_op_get_pnames):
  24039. (JSC::Machine::cti_op_next_pname):
  24040. (JSC::Machine::cti_op_push_scope):
  24041. (JSC::Machine::cti_op_pop_scope):
  24042. (JSC::Machine::cti_op_typeof):
  24043. (JSC::Machine::cti_op_to_jsnumber):
  24044. (JSC::Machine::cti_op_in):
  24045. (JSC::Machine::cti_op_push_new_scope):
  24046. (JSC::Machine::cti_op_jmp_scopes):
  24047. (JSC::Machine::cti_op_put_by_index):
  24048. (JSC::Machine::cti_op_switch_imm):
  24049. (JSC::Machine::cti_op_switch_char):
  24050. (JSC::Machine::cti_op_switch_string):
  24051. (JSC::Machine::cti_op_del_by_val):
  24052. (JSC::Machine::cti_op_put_getter):
  24053. (JSC::Machine::cti_op_put_setter):
  24054. (JSC::Machine::cti_op_new_error):
  24055. (JSC::Machine::cti_op_debug):
  24056. (JSC::Machine::cti_vm_throw):
  24057. * VM/Machine.h:
  24058. * VM/Register.h:
  24059. * VM/RegisterFile.h:
  24060. * kjs/Arguments.h:
  24061. * kjs/DebuggerCallFrame.cpp:
  24062. (JSC::DebuggerCallFrame::functionName):
  24063. (JSC::DebuggerCallFrame::type):
  24064. (JSC::DebuggerCallFrame::thisObject):
  24065. (JSC::DebuggerCallFrame::evaluate):
  24066. * kjs/DebuggerCallFrame.h:
  24067. * kjs/ExecState.cpp:
  24068. (JSC::CallFrame::thisValue):
  24069. * kjs/ExecState.h:
  24070. * kjs/FunctionConstructor.cpp:
  24071. (JSC::constructFunction):
  24072. * kjs/JSActivation.cpp:
  24073. (JSC::JSActivation::JSActivation):
  24074. (JSC::JSActivation::argumentsGetter):
  24075. * kjs/JSActivation.h:
  24076. * kjs/JSGlobalObject.cpp:
  24077. (JSC::JSGlobalObject::init):
  24078. * kjs/JSGlobalObjectFunctions.cpp:
  24079. (JSC::globalFuncEval):
  24080. * kjs/JSVariableObject.h:
  24081. * kjs/Parser.cpp:
  24082. (JSC::Parser::parse):
  24083. * kjs/RegExpConstructor.cpp:
  24084. (JSC::constructRegExp):
  24085. * kjs/RegExpPrototype.cpp:
  24086. (JSC::regExpProtoFuncCompile):
  24087. * kjs/Shell.cpp:
  24088. (prettyPrintScript):
  24089. * kjs/StringPrototype.cpp:
  24090. (JSC::stringProtoFuncMatch):
  24091. (JSC::stringProtoFuncSearch):
  24092. * kjs/identifier.cpp:
  24093. (JSC::Identifier::checkSameIdentifierTable):
  24094. * kjs/interpreter.cpp:
  24095. (JSC::Interpreter::checkSyntax):
  24096. (JSC::Interpreter::evaluate):
  24097. * kjs/nodes.cpp:
  24098. (JSC::ThrowableExpressionData::emitThrowError):
  24099. (JSC::RegExpNode::emitCode):
  24100. (JSC::ArrayNode::emitCode):
  24101. (JSC::InstanceOfNode::emitCode):
  24102. * kjs/nodes.h:
  24103. * kjs/regexp.cpp:
  24104. (JSC::RegExp::RegExp):
  24105. (JSC::RegExp::create):
  24106. * kjs/regexp.h:
  24107. * profiler/HeavyProfile.h:
  24108. * profiler/Profile.h:
  24109. * wrec/WREC.cpp:
  24110. * wrec/WREC.h:
  24111. 2008-10-08 Mark Rowe <mrowe@apple.com>
  24112. Typed by Maciej Stachowiak, reviewed by Mark Rowe.
  24113. Fix crash in fast/js/constant-folding.html with CTI disabled.
  24114. * VM/Machine.cpp:
  24115. (JSC::Machine::privateExecute):
  24116. 2008-10-08 Timothy Hatcher <timothy@apple.com>
  24117. Roll out r37427 because it causes an infinite recursion loading about:blank.
  24118. https://bugs.webkit.org/show_bug.cgi?id=21476
  24119. 2008-10-08 Darin Adler <darin@apple.com>
  24120. Reviewed by Cameron Zwarich.
  24121. - https://bugs.webkit.org/show_bug.cgi?id=21403
  24122. Bug 21403: use new CallFrame class rather than Register* for call frame manipulation
  24123. Add CallFrame as a synonym for ExecState. Arguably, some day we should switch every
  24124. client over to the new name.
  24125. Use CallFrame* consistently rather than Register* or ExecState* in low-level code such
  24126. as Machine.cpp and CTI.cpp. Similarly, use callFrame rather than r as its name and use
  24127. accessor functions to get at things in the frame.
  24128. Eliminate other uses of ExecState* that aren't needed, replacing in some cases with
  24129. JSGlobalData* and in other cases eliminating them entirely.
  24130. * API/JSObjectRef.cpp:
  24131. (JSObjectMakeFunctionWithCallback):
  24132. (JSObjectMakeFunction):
  24133. (JSObjectHasProperty):
  24134. (JSObjectGetProperty):
  24135. (JSObjectSetProperty):
  24136. (JSObjectDeleteProperty):
  24137. * API/OpaqueJSString.cpp:
  24138. * API/OpaqueJSString.h:
  24139. * VM/CTI.cpp:
  24140. (JSC::CTI::getConstant):
  24141. (JSC::CTI::emitGetArg):
  24142. (JSC::CTI::emitGetPutArg):
  24143. (JSC::CTI::getConstantImmediateNumericArg):
  24144. (JSC::CTI::printOpcodeOperandTypes):
  24145. (JSC::CTI::CTI):
  24146. (JSC::CTI::compileOpCall):
  24147. (JSC::CTI::compileBinaryArithOp):
  24148. (JSC::CTI::privateCompileMainPass):
  24149. (JSC::CTI::privateCompile):
  24150. (JSC::CTI::privateCompileGetByIdProto):
  24151. (JSC::CTI::privateCompileGetByIdChain):
  24152. (JSC::CTI::compileRegExp):
  24153. * VM/CTI.h:
  24154. * VM/CodeBlock.h:
  24155. * VM/CodeGenerator.cpp:
  24156. (JSC::CodeGenerator::emitEqualityOp):
  24157. (JSC::CodeGenerator::emitLoad):
  24158. (JSC::CodeGenerator::emitUnexpectedLoad):
  24159. (JSC::CodeGenerator::emitConstruct):
  24160. * VM/CodeGenerator.h:
  24161. * VM/Machine.cpp:
  24162. (JSC::jsLess):
  24163. (JSC::jsLessEq):
  24164. (JSC::jsAddSlowCase):
  24165. (JSC::jsAdd):
  24166. (JSC::jsTypeStringForValue):
  24167. (JSC::Machine::resolve):
  24168. (JSC::Machine::resolveSkip):
  24169. (JSC::Machine::resolveGlobal):
  24170. (JSC::inlineResolveBase):
  24171. (JSC::Machine::resolveBase):
  24172. (JSC::Machine::resolveBaseAndProperty):
  24173. (JSC::Machine::resolveBaseAndFunc):
  24174. (JSC::Machine::slideRegisterWindowForCall):
  24175. (JSC::isNotObject):
  24176. (JSC::Machine::callEval):
  24177. (JSC::Machine::dumpCallFrame):
  24178. (JSC::Machine::dumpRegisters):
  24179. (JSC::Machine::unwindCallFrame):
  24180. (JSC::Machine::throwException):
  24181. (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope):
  24182. (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
  24183. (JSC::Machine::execute):
  24184. (JSC::Machine::debug):
  24185. (JSC::Machine::createExceptionScope):
  24186. (JSC::cachePrototypeChain):
  24187. (JSC::Machine::tryCachePutByID):
  24188. (JSC::Machine::tryCacheGetByID):
  24189. (JSC::Machine::privateExecute):
  24190. (JSC::Machine::retrieveArguments):
  24191. (JSC::Machine::retrieveCaller):
  24192. (JSC::Machine::retrieveLastCaller):
  24193. (JSC::Machine::findFunctionCallFrame):
  24194. (JSC::Machine::getArgumentsData):
  24195. (JSC::Machine::tryCTICachePutByID):
  24196. (JSC::Machine::getCTIArrayLengthTrampoline):
  24197. (JSC::Machine::getCTIStringLengthTrampoline):
  24198. (JSC::Machine::tryCTICacheGetByID):
  24199. (JSC::Machine::cti_op_convert_this):
  24200. (JSC::Machine::cti_op_end):
  24201. (JSC::Machine::cti_op_add):
  24202. (JSC::Machine::cti_op_pre_inc):
  24203. (JSC::Machine::cti_timeout_check):
  24204. (JSC::Machine::cti_op_loop_if_less):
  24205. (JSC::Machine::cti_op_loop_if_lesseq):
  24206. (JSC::Machine::cti_op_new_object):
  24207. (JSC::Machine::cti_op_put_by_id):
  24208. (JSC::Machine::cti_op_put_by_id_second):
  24209. (JSC::Machine::cti_op_put_by_id_generic):
  24210. (JSC::Machine::cti_op_put_by_id_fail):
  24211. (JSC::Machine::cti_op_get_by_id):
  24212. (JSC::Machine::cti_op_get_by_id_second):
  24213. (JSC::Machine::cti_op_get_by_id_generic):
  24214. (JSC::Machine::cti_op_get_by_id_fail):
  24215. (JSC::Machine::cti_op_instanceof):
  24216. (JSC::Machine::cti_op_del_by_id):
  24217. (JSC::Machine::cti_op_mul):
  24218. (JSC::Machine::cti_op_new_func):
  24219. (JSC::Machine::cti_op_call_JSFunction):
  24220. (JSC::Machine::cti_vm_compile):
  24221. (JSC::Machine::cti_op_push_activation):
  24222. (JSC::Machine::cti_op_call_NotJSFunction):
  24223. (JSC::Machine::cti_op_create_arguments):
  24224. (JSC::Machine::cti_op_tear_off_activation):
  24225. (JSC::Machine::cti_op_tear_off_arguments):
  24226. (JSC::Machine::cti_op_ret_profiler):
  24227. (JSC::Machine::cti_op_ret_scopeChain):
  24228. (JSC::Machine::cti_op_new_array):
  24229. (JSC::Machine::cti_op_resolve):
  24230. (JSC::Machine::cti_op_construct_JSConstruct):
  24231. (JSC::Machine::cti_op_construct_NotJSConstruct):
  24232. (JSC::Machine::cti_op_get_by_val):
  24233. (JSC::Machine::cti_op_resolve_func):
  24234. (JSC::Machine::cti_op_sub):
  24235. (JSC::Machine::cti_op_put_by_val):
  24236. (JSC::Machine::cti_op_put_by_val_array):
  24237. (JSC::Machine::cti_op_lesseq):
  24238. (JSC::Machine::cti_op_loop_if_true):
  24239. (JSC::Machine::cti_op_negate):
  24240. (JSC::Machine::cti_op_resolve_base):
  24241. (JSC::Machine::cti_op_resolve_skip):
  24242. (JSC::Machine::cti_op_resolve_global):
  24243. (JSC::Machine::cti_op_div):
  24244. (JSC::Machine::cti_op_pre_dec):
  24245. (JSC::Machine::cti_op_jless):
  24246. (JSC::Machine::cti_op_not):
  24247. (JSC::Machine::cti_op_jtrue):
  24248. (JSC::Machine::cti_op_post_inc):
  24249. (JSC::Machine::cti_op_eq):
  24250. (JSC::Machine::cti_op_lshift):
  24251. (JSC::Machine::cti_op_bitand):
  24252. (JSC::Machine::cti_op_rshift):
  24253. (JSC::Machine::cti_op_bitnot):
  24254. (JSC::Machine::cti_op_resolve_with_base):
  24255. (JSC::Machine::cti_op_new_func_exp):
  24256. (JSC::Machine::cti_op_mod):
  24257. (JSC::Machine::cti_op_less):
  24258. (JSC::Machine::cti_op_neq):
  24259. (JSC::Machine::cti_op_post_dec):
  24260. (JSC::Machine::cti_op_urshift):
  24261. (JSC::Machine::cti_op_bitxor):
  24262. (JSC::Machine::cti_op_new_regexp):
  24263. (JSC::Machine::cti_op_bitor):
  24264. (JSC::Machine::cti_op_call_eval):
  24265. (JSC::Machine::cti_op_throw):
  24266. (JSC::Machine::cti_op_get_pnames):
  24267. (JSC::Machine::cti_op_next_pname):
  24268. (JSC::Machine::cti_op_push_scope):
  24269. (JSC::Machine::cti_op_pop_scope):
  24270. (JSC::Machine::cti_op_typeof):
  24271. (JSC::Machine::cti_op_to_jsnumber):
  24272. (JSC::Machine::cti_op_in):
  24273. (JSC::Machine::cti_op_push_new_scope):
  24274. (JSC::Machine::cti_op_jmp_scopes):
  24275. (JSC::Machine::cti_op_put_by_index):
  24276. (JSC::Machine::cti_op_switch_imm):
  24277. (JSC::Machine::cti_op_switch_char):
  24278. (JSC::Machine::cti_op_switch_string):
  24279. (JSC::Machine::cti_op_del_by_val):
  24280. (JSC::Machine::cti_op_put_getter):
  24281. (JSC::Machine::cti_op_put_setter):
  24282. (JSC::Machine::cti_op_new_error):
  24283. (JSC::Machine::cti_op_debug):
  24284. (JSC::Machine::cti_vm_throw):
  24285. * VM/Machine.h:
  24286. * VM/Register.h:
  24287. * VM/RegisterFile.h:
  24288. * kjs/Arguments.h:
  24289. * kjs/DebuggerCallFrame.cpp:
  24290. (JSC::DebuggerCallFrame::functionName):
  24291. (JSC::DebuggerCallFrame::type):
  24292. (JSC::DebuggerCallFrame::thisObject):
  24293. (JSC::DebuggerCallFrame::evaluate):
  24294. * kjs/DebuggerCallFrame.h:
  24295. * kjs/ExecState.cpp:
  24296. (JSC::CallFrame::thisValue):
  24297. * kjs/ExecState.h:
  24298. * kjs/FunctionConstructor.cpp:
  24299. (JSC::constructFunction):
  24300. * kjs/JSActivation.cpp:
  24301. (JSC::JSActivation::JSActivation):
  24302. (JSC::JSActivation::argumentsGetter):
  24303. * kjs/JSActivation.h:
  24304. * kjs/JSGlobalObject.cpp:
  24305. (JSC::JSGlobalObject::init):
  24306. * kjs/JSGlobalObjectFunctions.cpp:
  24307. (JSC::globalFuncEval):
  24308. * kjs/JSVariableObject.h:
  24309. * kjs/Parser.cpp:
  24310. (JSC::Parser::parse):
  24311. * kjs/RegExpConstructor.cpp:
  24312. (JSC::constructRegExp):
  24313. * kjs/RegExpPrototype.cpp:
  24314. (JSC::regExpProtoFuncCompile):
  24315. * kjs/Shell.cpp:
  24316. (prettyPrintScript):
  24317. * kjs/StringPrototype.cpp:
  24318. (JSC::stringProtoFuncMatch):
  24319. (JSC::stringProtoFuncSearch):
  24320. * kjs/identifier.cpp:
  24321. (JSC::Identifier::checkSameIdentifierTable):
  24322. * kjs/interpreter.cpp:
  24323. (JSC::Interpreter::checkSyntax):
  24324. (JSC::Interpreter::evaluate):
  24325. * kjs/nodes.cpp:
  24326. (JSC::ThrowableExpressionData::emitThrowError):
  24327. (JSC::RegExpNode::emitCode):
  24328. (JSC::ArrayNode::emitCode):
  24329. (JSC::InstanceOfNode::emitCode):
  24330. * kjs/nodes.h:
  24331. * kjs/regexp.cpp:
  24332. (JSC::RegExp::RegExp):
  24333. (JSC::RegExp::create):
  24334. * kjs/regexp.h:
  24335. * profiler/HeavyProfile.h:
  24336. * profiler/Profile.h:
  24337. * wrec/WREC.cpp:
  24338. * wrec/WREC.h:
  24339. 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
  24340. Reviewed by Oliver Hunt.
  24341. Avoid endless loops when compiling without the computed goto
  24342. optimization.
  24343. NEXT_OPCODE expands to "continue", which will not work inside
  24344. loops.
  24345. * VM/Machine.cpp:
  24346. (JSC::Machine::privateExecute):
  24347. 2008-10-08 Maciej Stachowiak <mjs@apple.com>
  24348. Reviewed by Oliver Hunt.
  24349. Re-landing the following fix with the crashing bug in it fixed (r37405):
  24350. - optimize away multiplication by constant 1.0
  24351. 2.3% speedup on v8 RayTrace benchmark
  24352. Apparently it's not uncommon for JavaScript code to multiply by
  24353. constant 1.0 in the mistaken belief that this converts integer to
  24354. floating point and that there is any operational difference.
  24355. * VM/CTI.cpp:
  24356. (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
  24357. case where parameter is already number.
  24358. (JSC::CTI::privateCompileSlowCases): ditto
  24359. * VM/Machine.cpp:
  24360. (JSC::Machine::privateExecute): ditto
  24361. * kjs/grammar.y:
  24362. (makeMultNode): Transform as follows:
  24363. +FOO * BAR ==> FOO * BAR
  24364. FOO * +BAR ==> FOO * BAR
  24365. FOO * 1 ==> +FOO
  24366. 1 * FOO ==> +FOO
  24367. (makeDivNode): Transform as follows:
  24368. +FOO / BAR ==> FOO / BAR
  24369. FOO / +BAR ==> FOO / BAR
  24370. (makeSubNode): Transform as follows:
  24371. +FOO - BAR ==> FOO - BAR
  24372. FOO - +BAR ==> FOO - BAR
  24373. * kjs/nodes.h:
  24374. (JSC::ExpressionNode::stripUnaryPlus): Helper for above
  24375. grammar.y changes
  24376. (JSC::UnaryPlusNode::stripUnaryPlus): ditto
  24377. 2008-10-08 Maciej Stachowiak <mjs@apple.com>
  24378. Reviewed by Oliver Hunt.
  24379. - correctly handle appending -0 to a string, it should stringify as just 0
  24380. * kjs/ustring.cpp:
  24381. (JSC::concatenate):
  24382. 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
  24383. Reviewed by Simon.
  24384. Fix WebKit compilation with VC2008SP1
  24385. Apply the TR1 workaround for JavaScriptCore, too.
  24386. * JavaScriptCore.pro:
  24387. 2008-10-08 Prasanth Ullattil <pullatti@trolltech.com>
  24388. Reviewed by Simon.
  24389. Fix compilation errors on VS2008 64Bit
  24390. * kjs/collector.cpp:
  24391. (JSC::currentThreadStackBase):
  24392. 2008-10-08 André Pönitz <apoenitz@trolltech.com>
  24393. Reviewed by Simon.
  24394. Fix compilation with Qt namespaces.
  24395. * wtf/Threading.h:
  24396. 2008-10-07 Sam Weinig <sam@webkit.org>
  24397. Roll out r37405.
  24398. 2008-10-07 Oliver Hunt <oliver@apple.com>
  24399. Reviewed by Cameron Zwarich.
  24400. Switch CTI runtime calls to the fastcall calling convention
  24401. Basically this means that we get to store the argument for CTI
  24402. calls in the ECX register, which saves a register->memory write
  24403. and subsequent memory->register read.
  24404. This is a 1.7% progression in SunSpider and 2.4% on commandline
  24405. v8 tests on Windows
  24406. * VM/CTI.cpp:
  24407. (JSC::):
  24408. (JSC::CTI::privateCompilePutByIdTransition):
  24409. (JSC::CTI::privateCompilePatchGetArrayLength):
  24410. * VM/CTI.h:
  24411. * VM/Machine.h:
  24412. * masm/X86Assembler.h:
  24413. (JSC::X86Assembler::emitRestoreArgumentReference):
  24414. (JSC::X86Assembler::emitRestoreArgumentReferenceForTrampoline):
  24415. We need this to correctly reload ecx from inside certain property access
  24416. trampolines.
  24417. * wtf/Platform.h:
  24418. 2008-10-07 Maciej Stachowiak <mjs@apple.com>
  24419. Reviewed by Mark Rowe.
  24420. - optimize away multiplication by constant 1.0
  24421. 2.3% speedup on v8 RayTrace benchmark
  24422. Apparently it's not uncommon for JavaScript code to multiply by
  24423. constant 1.0 in the mistaken belief that this converts integer to
  24424. floating point and that there is any operational difference.
  24425. * VM/CTI.cpp:
  24426. (JSC::CTI::privateCompileMainPass): Optimize to_jsnumber for
  24427. case where parameter is already number.
  24428. (JSC::CTI::privateCompileSlowCases): ditto
  24429. * VM/Machine.cpp:
  24430. (JSC::Machine::privateExecute): ditto
  24431. * kjs/grammar.y:
  24432. (makeMultNode): Transform as follows:
  24433. +FOO * BAR ==> FOO * BAR
  24434. FOO * +BAR ==> FOO * BAR
  24435. FOO * 1 ==> +FOO
  24436. 1 * FOO ==> +FOO
  24437. (makeDivNode): Transform as follows:
  24438. +FOO / BAR ==> FOO / BAR
  24439. FOO / +BAR ==> FOO / BAR
  24440. (makeSubNode): Transform as follows:
  24441. +FOO - BAR ==> FOO - BAR
  24442. FOO - +BAR ==> FOO - BAR
  24443. * kjs/nodes.h:
  24444. (JSC::ExpressionNode::stripUnaryPlus): Helper for above
  24445. grammar.y changes
  24446. (JSC::UnaryPlusNode::stripUnaryPlus): ditto
  24447. 2008-10-07 Maciej Stachowiak <mjs@apple.com>
  24448. Reviewed by Oliver Hunt.
  24449. - make constant folding code more consistent
  24450. Added a makeSubNode to match add, mult and div; use the makeFooNode functions always,
  24451. instead of allocating nodes directly in other places in the grammar.
  24452. * kjs/grammar.y:
  24453. 2008-10-07 Sam Weinig <sam@webkit.org>
  24454. Reviewed by Cameron Zwarich.
  24455. Move hasGetterSetterProperties flag from PropertyMap to StructureID.
  24456. * kjs/JSObject.cpp:
  24457. (JSC::JSObject::put):
  24458. (JSC::JSObject::defineGetter):
  24459. (JSC::JSObject::defineSetter):
  24460. * kjs/JSObject.h:
  24461. (JSC::JSObject::hasGetterSetterProperties):
  24462. (JSC::JSObject::getOwnPropertySlotForWrite):
  24463. (JSC::JSObject::getOwnPropertySlot):
  24464. * kjs/PropertyMap.h:
  24465. * kjs/StructureID.cpp:
  24466. (JSC::StructureID::StructureID):
  24467. (JSC::StructureID::addPropertyTransition):
  24468. (JSC::StructureID::toDictionaryTransition):
  24469. (JSC::StructureID::changePrototypeTransition):
  24470. (JSC::StructureID::getterSetterTransition):
  24471. * kjs/StructureID.h:
  24472. (JSC::StructureID::hasGetterSetterProperties):
  24473. (JSC::StructureID::setHasGetterSetterProperties):
  24474. 2008-10-07 Sam Weinig <sam@webkit.org>
  24475. Reviewed by Cameron Zwarich.
  24476. Roll r37370 back in with bug fixes.
  24477. - PropertyMap::storageSize() should reflect the number of keys + deletedOffsets
  24478. and has nothing to do with the internal deletedSentinel count anymore.
  24479. 2008-10-07 Gavin Barraclough <barraclough@apple.com>
  24480. Reviewed by Oliver Hunt.
  24481. Move callframe initialization into JIT code, again.
  24482. As a part of the restructuring the second result from functions is now
  24483. returned in edx, allowing the new value of 'r' to be returned via a
  24484. register, and stored to the stack from JIT code, too.
  24485. 4.5% progression on v8-tests. (3% in their harness)
  24486. * VM/CTI.cpp:
  24487. (JSC::):
  24488. (JSC::CTI::emitCall):
  24489. (JSC::CTI::compileOpCall):
  24490. (JSC::CTI::privateCompileMainPass):
  24491. (JSC::CTI::privateCompileSlowCases):
  24492. (JSC::CTI::privateCompile):
  24493. * VM/CTI.h:
  24494. (JSC::CallRecord::CallRecord):
  24495. * VM/Machine.cpp:
  24496. (JSC::Machine::cti_op_call_JSFunction):
  24497. (JSC::Machine::cti_op_construct_JSConstruct):
  24498. (JSC::Machine::cti_op_resolve_func):
  24499. (JSC::Machine::cti_op_post_inc):
  24500. (JSC::Machine::cti_op_resolve_with_base):
  24501. (JSC::Machine::cti_op_post_dec):
  24502. * VM/Machine.h:
  24503. * kjs/JSFunction.h:
  24504. * kjs/ScopeChain.h:
  24505. 2008-10-07 Mark Rowe <mrowe@apple.com>
  24506. Fix typo in method name.
  24507. * wrec/WREC.cpp:
  24508. * wrec/WREC.h:
  24509. 2008-10-07 Cameron Zwarich <zwarich@apple.com>
  24510. Rubber-stamped by Mark Rowe.
  24511. Roll out r37370.
  24512. 2008-10-06 Sam Weinig <sam@webkit.org>
  24513. Reviewed by Cameron Zwarich.
  24514. Fix for https://bugs.webkit.org/show_bug.cgi?id=21415
  24515. Improve the division between PropertyStorageArray and PropertyMap
  24516. - Rework ProperyMap to store offsets in the value so that they don't
  24517. change when rehashing. This allows us not to have to keep the
  24518. PropertyStorageArray in sync and thus not have to pass it in.
  24519. - Rename PropertyMap::getOffset -> PropertyMap::get since put/remove
  24520. now also return offsets.
  24521. - A Vector of deleted offsets is now needed since the storage is out of
  24522. band.
  24523. 1% win on SunSpider. Wash on V8 suite.
  24524. * JavaScriptCore.exp:
  24525. * VM/CTI.cpp:
  24526. (JSC::transitionWillNeedStorageRealloc):
  24527. * VM/Machine.cpp:
  24528. (JSC::Machine::privateExecute):
  24529. Transition logic can be greatly simplified by the fact that
  24530. the storage capacity is always known, and is correct for the
  24531. inline case.
  24532. * kjs/JSObject.cpp:
  24533. (JSC::JSObject::put): Rename getOffset -> get.
  24534. (JSC::JSObject::deleteProperty): Ditto.
  24535. (JSC::JSObject::getPropertyAttributes): Ditto.
  24536. (JSC::JSObject::removeDirect): Use returned offset to
  24537. clear the value in the PropertyNameArray.
  24538. (JSC::JSObject::allocatePropertyStorage): Add assert.
  24539. * kjs/JSObject.h:
  24540. (JSC::JSObject::getDirect): Rename getOffset -> get
  24541. (JSC::JSObject::getDirectLocation): Rename getOffset -> get
  24542. (JSC::JSObject::putDirect): Use propertyStorageCapacity to determine whether
  24543. or not to resize. Also, since put now returns an offset (and thus
  24544. addPropertyTransition does also) setting of the PropertyStorageArray is
  24545. now done here.
  24546. (JSC::JSObject::transitionTo):
  24547. * kjs/PropertyMap.cpp:
  24548. (JSC::PropertyMap::checkConsistency): PropertyStorageArray is no longer
  24549. passed in.
  24550. (JSC::PropertyMap::operator=): Copy the delete offsets vector.
  24551. (JSC::PropertyMap::put): Instead of setting the PropertyNameArray
  24552. explicitly, return the offset where the value should go.
  24553. (JSC::PropertyMap::remove): Instead of removing from the PropertyNameArray
  24554. explicitly, return the offset where the value should be removed.
  24555. (JSC::PropertyMap::get): Switch to using the stored offset, instead
  24556. of the implicit one.
  24557. (JSC::PropertyMap::insert):
  24558. (JSC::PropertyMap::expand): This is never called when m_table is null,
  24559. so remove that branch and add it as an assertion.
  24560. (JSC::PropertyMap::createTable): Consistency checks no longer take
  24561. a PropertyNameArray.
  24562. (JSC::PropertyMap::rehash): No need to rehash the PropertyNameArray
  24563. now that it is completely out of band.
  24564. * kjs/PropertyMap.h:
  24565. (JSC::PropertyMapEntry::PropertyMapEntry): Store offset into PropertyNameArray.
  24566. (JSC::PropertyMap::get): Switch to using the stored offset, instead
  24567. of the implicit one.
  24568. * kjs/StructureID.cpp:
  24569. (JSC::StructureID::StructureID): Initialize the propertyStorageCapacity to
  24570. JSObject::inlineStorageCapacity.
  24571. (JSC::StructureID::growPropertyStorageCapacity): Grow the storage capacity as
  24572. described below.
  24573. (JSC::StructureID::addPropertyTransition): Copy the storage capacity.
  24574. (JSC::StructureID::toDictionaryTransition): Ditto.
  24575. (JSC::StructureID::changePrototypeTransition): Ditto.
  24576. (JSC::StructureID::getterSetterTransition): Ditto.
  24577. * kjs/StructureID.h:
  24578. (JSC::StructureID::propertyStorageCapacity): Add propertyStorageCapacity
  24579. which is the current capacity for the JSObjects PropertyStorageArray.
  24580. It starts at the JSObject::inlineStorageCapacity (currently 2), then
  24581. when it first needs to be resized moves to the JSObject::nonInlineBaseStorageCapacity
  24582. (currently 16), and after that doubles each time.
  24583. 2008-10-06 Cameron Zwarich <zwarich@apple.com>
  24584. Reviewed by Oliver Hunt.
  24585. Bug 21396: Remove the OptionalCalleeActivation call frame slot
  24586. <https://bugs.webkit.org/show_bug.cgi?id=21396>
  24587. Remove the OptionalCalleeActivation call frame slot. We have to be
  24588. careful to store the activation object in a register, because objects
  24589. in the scope chain do not get marked.
  24590. This is a 0.3% speedup on both SunSpider and the V8 benchmark.
  24591. * VM/CTI.cpp:
  24592. (JSC::CTI::privateCompileMainPass):
  24593. * VM/CodeBlock.cpp:
  24594. (JSC::CodeBlock::dump):
  24595. * VM/CodeGenerator.cpp:
  24596. (JSC::CodeGenerator::CodeGenerator):
  24597. (JSC::CodeGenerator::emitReturn):
  24598. * VM/CodeGenerator.h:
  24599. * VM/Machine.cpp:
  24600. (JSC::Machine::dumpRegisters):
  24601. (JSC::Machine::unwindCallFrame):
  24602. (JSC::Machine::privateExecute):
  24603. (JSC::Machine::cti_op_call_JSFunction):
  24604. (JSC::Machine::cti_op_push_activation):
  24605. (JSC::Machine::cti_op_tear_off_activation):
  24606. (JSC::Machine::cti_op_construct_JSConstruct):
  24607. * VM/Machine.h:
  24608. (JSC::Machine::initializeCallFrame):
  24609. * VM/RegisterFile.h:
  24610. (JSC::RegisterFile::):
  24611. 2008-10-06 Tony Chang <tony@chromium.org>
  24612. Reviewed by Alexey Proskuryakov.
  24613. Chromium doesn't use pthreads on windows, so make its use conditional.
  24614. Also convert a WORD to a DWORD to avoid a compiler warning. This
  24615. matches the other methods around it.
  24616. * wtf/ThreadingWin.cpp:
  24617. (WTF::wtfThreadEntryPoint):
  24618. (WTF::ThreadCondition::broadcast):
  24619. 2008-10-06 Mark Mentovai <mark@moxienet.com>
  24620. Reviewed by Tim Hatcher.
  24621. Allow ENABLE_DASHBOARD_SUPPORT and ENABLE_MAC_JAVA_BRIDGE to be
  24622. disabled on the Mac.
  24623. https://bugs.webkit.org/show_bug.cgi?id=21333
  24624. * wtf/Platform.h:
  24625. 2008-10-06 Steve Falkenburg <sfalken@apple.com>
  24626. https://bugs.webkit.org/show_bug.cgi?id=21416
  24627. Pass 0 for size to VirtualAlloc, as documented by MSDN.
  24628. Identified by Application Verifier.
  24629. Reviewed by Darin Adler.
  24630. * kjs/collector.cpp:
  24631. (KJS::freeBlock):
  24632. 2008-10-06 Kevin McCullough <kmccullough@apple.com>
  24633. Reviewed by Tim Hatcheri and Oliver Hunt.
  24634. https://bugs.webkit.org/show_bug.cgi?id=21412
  24635. Bug 21412: Refactor user initiated profile count to be more stable
  24636. - Export UString::from for use with creating the profile title.
  24637. * JavaScriptCore.exp:
  24638. 2008-10-06 Maciej Stachowiak <mjs@apple.com>
  24639. Not reviewed. Build fix.
  24640. - revert toBoolean changes (r37333 and r37335); need to make WebCore work with these
  24641. * API/JSValueRef.cpp:
  24642. (JSValueToBoolean):
  24643. * ChangeLog:
  24644. * JavaScriptCore.exp:
  24645. * VM/CodeBlock.cpp:
  24646. (JSC::CodeBlock::dump):
  24647. * VM/Machine.cpp:
  24648. (JSC::Machine::privateExecute):
  24649. (JSC::Machine::cti_op_loop_if_true):
  24650. (JSC::Machine::cti_op_not):
  24651. (JSC::Machine::cti_op_jtrue):
  24652. * kjs/ArrayPrototype.cpp:
  24653. (JSC::arrayProtoFuncFilter):
  24654. (JSC::arrayProtoFuncEvery):
  24655. (JSC::arrayProtoFuncSome):
  24656. * kjs/BooleanConstructor.cpp:
  24657. (JSC::constructBoolean):
  24658. (JSC::callBooleanConstructor):
  24659. * kjs/GetterSetter.h:
  24660. * kjs/JSCell.h:
  24661. (JSC::JSValue::toBoolean):
  24662. * kjs/JSNumberCell.cpp:
  24663. (JSC::JSNumberCell::toBoolean):
  24664. * kjs/JSNumberCell.h:
  24665. * kjs/JSObject.cpp:
  24666. (JSC::JSObject::toBoolean):
  24667. * kjs/JSObject.h:
  24668. * kjs/JSString.cpp:
  24669. (JSC::JSString::toBoolean):
  24670. * kjs/JSString.h:
  24671. * kjs/JSValue.h:
  24672. * kjs/RegExpConstructor.cpp:
  24673. (JSC::setRegExpConstructorMultiline):
  24674. * kjs/RegExpObject.cpp:
  24675. (JSC::RegExpObject::match):
  24676. * kjs/RegExpPrototype.cpp:
  24677. (JSC::regExpProtoFuncToString):
  24678. 2008-10-06 Maciej Stachowiak <mjs@apple.com>
  24679. Reviewed by Sam Weinig.
  24680. - optimize op_jtrue, op_loop_if_true and op_not in various ways
  24681. https://bugs.webkit.org/show_bug.cgi?id=21404
  24682. 1) Make JSValue::toBoolean nonvirtual and completely inline by
  24683. making use of the StructureID type field.
  24684. 2) Make JSValue::toBoolean not take an ExecState; doesn't need it.
  24685. 3) Make op_not, op_loop_if_true and op_jtrue not read the
  24686. ExecState (toBoolean doesn't need it any more) and not check
  24687. exceptions (toBoolean can't throw).
  24688. * API/JSValueRef.cpp:
  24689. (JSValueToBoolean):
  24690. * JavaScriptCore.exp:
  24691. * VM/CodeBlock.cpp:
  24692. (JSC::CodeBlock::dump):
  24693. * VM/Machine.cpp:
  24694. (JSC::Machine::privateExecute):
  24695. (JSC::Machine::cti_op_loop_if_true):
  24696. (JSC::Machine::cti_op_not):
  24697. (JSC::Machine::cti_op_jtrue):
  24698. * kjs/ArrayPrototype.cpp:
  24699. (JSC::arrayProtoFuncFilter):
  24700. (JSC::arrayProtoFuncEvery):
  24701. (JSC::arrayProtoFuncSome):
  24702. * kjs/BooleanConstructor.cpp:
  24703. (JSC::constructBoolean):
  24704. (JSC::callBooleanConstructor):
  24705. * kjs/GetterSetter.h:
  24706. * kjs/JSCell.h:
  24707. (JSC::JSValue::toBoolean):
  24708. * kjs/JSNumberCell.cpp:
  24709. * kjs/JSNumberCell.h:
  24710. (JSC::JSNumberCell::toBoolean):
  24711. * kjs/JSObject.cpp:
  24712. * kjs/JSObject.h:
  24713. (JSC::JSObject::toBoolean):
  24714. (JSC::JSCell::toBoolean):
  24715. * kjs/JSString.cpp:
  24716. * kjs/JSString.h:
  24717. (JSC::JSString::toBoolean):
  24718. * kjs/JSValue.h:
  24719. * kjs/RegExpConstructor.cpp:
  24720. (JSC::setRegExpConstructorMultiline):
  24721. * kjs/RegExpObject.cpp:
  24722. (JSC::RegExpObject::match):
  24723. * kjs/RegExpPrototype.cpp:
  24724. (JSC::regExpProtoFuncToString):
  24725. 2008-10-06 Ariya Hidayat <ariya.hidayat@trolltech.com>
  24726. Reviewed by Simon.
  24727. Build fix for MinGW.
  24728. * JavaScriptCore.pri:
  24729. * kjs/DateMath.cpp:
  24730. (JSC::highResUpTime):
  24731. 2008-10-05 Cameron Zwarich <zwarich@apple.com>
  24732. Reviewed by Oliver Hunt.
  24733. Remove ScopeNode::containsClosures() now that it is unused.
  24734. * kjs/nodes.h:
  24735. (JSC::ScopeNode::containsClosures):
  24736. 2008-10-05 Maciej Stachowiak <mjs@apple.com>
  24737. Reviewed by Cameron Zwarich.
  24738. - fix releas-only test failures caused by the fix to bug 21375
  24739. * VM/Machine.cpp:
  24740. (JSC::Machine::unwindCallFrame): Update ExecState while unwinding call frames;
  24741. it now matters more to have a still-valid ExecState, since dynamicGlobalObject
  24742. will make use of the ExecState's scope chain.
  24743. * VM/Machine.h:
  24744. 2008-10-05 Cameron Zwarich <zwarich@apple.com>
  24745. Reviewed by Oliver Hunt.
  24746. Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
  24747. <https://bugs.webkit.org/show_bug.cgi?id=21364>
  24748. Use information from the parser to detect whether an activation is
  24749. needed or 'arguments' is used, and emit explicit instructions to tear
  24750. them off before op_ret. This allows a branch to be removed from op_ret
  24751. and simplifies some other code. This does cause a small change in the
  24752. behaviour of 'f.arguments'; it is no longer live when 'arguments' is not
  24753. mentioned in the lexical scope of the function.
  24754. It should now be easy to remove the OptionaCalleeActivation slot in the
  24755. call frame, but this will be done in a later patch.
  24756. * VM/CTI.cpp:
  24757. (JSC::CTI::privateCompileMainPass):
  24758. * VM/CodeBlock.cpp:
  24759. (JSC::CodeBlock::dump):
  24760. * VM/CodeGenerator.cpp:
  24761. (JSC::CodeGenerator::emitReturn):
  24762. * VM/CodeGenerator.h:
  24763. * VM/Machine.cpp:
  24764. (JSC::Machine::unwindCallFrame):
  24765. (JSC::Machine::privateExecute):
  24766. (JSC::Machine::retrieveArguments):
  24767. (JSC::Machine::cti_op_create_arguments):
  24768. (JSC::Machine::cti_op_tear_off_activation):
  24769. (JSC::Machine::cti_op_tear_off_arguments):
  24770. * VM/Machine.h:
  24771. * VM/Opcode.h:
  24772. * kjs/Arguments.cpp:
  24773. (JSC::Arguments::mark):
  24774. * kjs/Arguments.h:
  24775. (JSC::Arguments::isTornOff):
  24776. (JSC::Arguments::Arguments):
  24777. (JSC::Arguments::copyRegisters):
  24778. (JSC::JSActivation::copyRegisters):
  24779. * kjs/JSActivation.cpp:
  24780. (JSC::JSActivation::argumentsGetter):
  24781. * kjs/JSActivation.h:
  24782. 2008-10-05 Maciej Stachowiak <mjs@apple.com>
  24783. Reviewed by Oliver Hunt.
  24784. - fixed "REGRESSION (r37297): fast/js/deep-recursion-test takes too long and times out"
  24785. https://bugs.webkit.org/show_bug.cgi?id=21375
  24786. The problem is that dynamicGlobalObject had become O(N) in number
  24787. of call frames, but unwinding the stack for an exception called it
  24788. for every call frame, resulting in O(N^2) behavior for an
  24789. exception thrown from inside deep recursion.
  24790. Instead of doing it that way, stash the dynamic global object in JSGlobalData.
  24791. * JavaScriptCore.exp:
  24792. * VM/Machine.cpp:
  24793. (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Helper class to temporarily
  24794. store and later restore a dynamicGlobalObject in JSGlobalData.
  24795. (JSC::DynamicGlobalObjectScope::~DynamicGlobalObjectScope):
  24796. (JSC::Machine::execute): In each version, establish a DynamicGlobalObjectScope.
  24797. For ProgramNode, always establish set new dynamicGlobalObject, for FunctionBody and Eval,
  24798. only if none is currently set.
  24799. * VM/Machine.h:
  24800. * kjs/ExecState.h:
  24801. * kjs/JSGlobalData.cpp:
  24802. (JSC::JSGlobalData::JSGlobalData): Ininitalize new dynamicGlobalObject field to 0.
  24803. * kjs/JSGlobalData.h:
  24804. * kjs/JSGlobalObject.h:
  24805. (JSC::ExecState::dynamicGlobalObject): Moved here from ExecState for benefit of inlining.
  24806. Return lexical global object if this is a globalExec(), otherwise look in JSGlobalData
  24807. for the one stashed there.
  24808. 2008-10-05 Sam Weinig <sam@webkit.org>
  24809. Reviewed by Maciej Stachowiak.
  24810. Avoid an extra lookup when transitioning to an existing StructureID
  24811. by caching the offset of property that caused the transition.
  24812. 1% win on V8 suite. Wash on SunSpider.
  24813. * kjs/PropertyMap.cpp:
  24814. (JSC::PropertyMap::put):
  24815. * kjs/PropertyMap.h:
  24816. * kjs/StructureID.cpp:
  24817. (JSC::StructureID::StructureID):
  24818. (JSC::StructureID::addPropertyTransition):
  24819. * kjs/StructureID.h:
  24820. (JSC::StructureID::setCachedTransistionOffset):
  24821. (JSC::StructureID::cachedTransistionOffset):
  24822. 2008-10-05 Cameron Zwarich <zwarich@apple.com>
  24823. Reviewed by Maciej Stachowiak.
  24824. Bug 21364: Remove the branch in op_ret for OptionalCalleeActivation and OptionalCalleeArguments
  24825. <https://bugs.webkit.org/show_bug.cgi?id=21364>
  24826. This patch does not yet remove the branch, but it does a bit of refactoring
  24827. so that a CodeGenerator now knows whether the associated CodeBlock will need
  24828. a full scope before doing any code generation. This makes it possible to emit
  24829. explicit tear-off instructions before every op_ret.
  24830. * VM/CodeBlock.h:
  24831. (JSC::CodeBlock::CodeBlock):
  24832. * VM/CodeGenerator.cpp:
  24833. (JSC::CodeGenerator::generate):
  24834. (JSC::CodeGenerator::CodeGenerator):
  24835. (JSC::CodeGenerator::emitPushScope):
  24836. (JSC::CodeGenerator::emitPushNewScope):
  24837. * kjs/nodes.h:
  24838. (JSC::ScopeNode::needsActivation):
  24839. 2008-10-05 Gavin Barraclough <barraclough@apple.com>
  24840. Reviewed by Cameron Zwarich.
  24841. Fix for bug #21387 - using SamplingTool with CTI.
  24842. (1) A repatch offset offset changes due to an additional instruction to update SamplingTool state.
  24843. (2) Fix an incusion order problem due to ExecState changes.
  24844. (3) Change to a MACHINE_SAMPLING macro, use of exec should now be accessing global data.
  24845. * VM/CTI.h:
  24846. (JSC::CTI::execute):
  24847. * VM/SamplingTool.h:
  24848. (JSC::SamplingTool::privateExecuteReturned):
  24849. * kjs/Shell.cpp:
  24850. 2008-10-04 Mark Rowe <mrowe@apple.com>
  24851. Reviewed by Tim Hatcher.
  24852. Add a 'Check For Weak VTables' build phase to catch weak vtables as early as possible.
  24853. * JavaScriptCore.xcodeproj/project.pbxproj:
  24854. 2008-10-04 Sam Weinig <sam@webkit.org>
  24855. Reviewed by Oliver Hunt.
  24856. Fix https://bugs.webkit.org/show_bug.cgi?id=21320
  24857. leaks of PropertyNameArrayData seen on buildbot
  24858. - Fix RefPtr cycle by making PropertyNameArrayData's pointer back
  24859. to the StructureID a weak pointer.
  24860. * kjs/PropertyNameArray.h:
  24861. (JSC::PropertyNameArrayData::setCachedStructureID):
  24862. (JSC::PropertyNameArrayData::cachedStructureID):
  24863. * kjs/StructureID.cpp:
  24864. (JSC::StructureID::getEnumerablePropertyNames):
  24865. (JSC::StructureID::clearEnumerationCache):
  24866. (JSC::StructureID::~StructureID):
  24867. 2008-10-04 Darin Adler <darin@apple.com>
  24868. Reviewed by Cameron Zwarich.
  24869. - https://bugs.webkit.org/show_bug.cgi?id=21295
  24870. Bug 21295: Replace ExecState with a call frame Register pointer
  24871. 10% faster on Richards; other v8 benchmarks faster too.
  24872. A wash on SunSpider.
  24873. This does the minimum necessary to get the speedup. Next step in
  24874. cleaning this up is to replace ExecState with a CallFrame class,
  24875. and be more judicious about when to pass a call frame and when
  24876. to pass a global data pointer, global object pointer, or perhaps
  24877. something else entirely.
  24878. * VM/CTI.cpp: Remove the debug-only check of the exception in
  24879. ctiVMThrowTrampoline -- already checked in the code the trampoline
  24880. jumps to, so not all that useful. Removed the exec argument from
  24881. ctiTrampoline. Removed emitDebugExceptionCheck -- no longer needed.
  24882. (JSC::CTI::emitCall): Removed code to set ExecState::m_callFrame.
  24883. (JSC::CTI::privateCompileMainPass): Removed code in catch to extract
  24884. the exception from ExecState::m_exception; instead, the code that
  24885. jumps into catch will make sure the exception is already in eax.
  24886. * VM/CTI.h: Removed exec from the ctiTrampoline. Also removed the
  24887. non-helpful "volatile". Temporarily left ARG_exec in as a synonym
  24888. for ARG_r; I'll change that on a future cleanup pass when introducing
  24889. more use of the CallFrame type.
  24890. (JSC::CTI::execute): Removed the ExecState* argument.
  24891. * VM/ExceptionHelpers.cpp:
  24892. (JSC::InterruptedExecutionError::InterruptedExecutionError): Take
  24893. JSGlobalData* instead of ExecState*.
  24894. (JSC::createInterruptedExecutionException): Ditto.
  24895. * VM/ExceptionHelpers.h: Ditto. Also removed an unneeded include.
  24896. * VM/Machine.cpp:
  24897. (JSC::slideRegisterWindowForCall): Removed the exec and
  24898. exceptionValue arguments. Changed to return 0 when there's a stack
  24899. overflow rather than using a separate exception argument to cut
  24900. down on memory accesses in the calling convention.
  24901. (JSC::Machine::unwindCallFrame): Removed the exec argument when
  24902. constructing a DebuggerCallFrame. Also removed code to set
  24903. ExecState::m_callFrame.
  24904. (JSC::Machine::throwException): Removed the exec argument when
  24905. construction a DebuggerCallFrame.
  24906. (JSC::Machine::execute): Updated to use the register instead of
  24907. ExecState and also removed various uses of ExecState.
  24908. (JSC::Machine::debug):
  24909. (JSC::Machine::privateExecute): Put globalData into a local
  24910. variable so it can be used throughout the interpreter. Changed
  24911. the VM_CHECK_EXCEPTION to get the exception in globalData instead
  24912. of through ExecState.
  24913. (JSC::Machine::retrieveLastCaller): Turn exec into a registers
  24914. pointer by calling registers() instead of by getting m_callFrame.
  24915. (JSC::Machine::callFrame): Ditto.
  24916. Tweaked exception macros. Made new versions for when you know
  24917. you have an exception. Get at global exception with ARG_globalData.
  24918. Got rid of the need to pass in the return value type.
  24919. (JSC::Machine::cti_op_add): Update to use new version of exception
  24920. macros.
  24921. (JSC::Machine::cti_op_pre_inc): Ditto.
  24922. (JSC::Machine::cti_timeout_check): Ditto.
  24923. (JSC::Machine::cti_op_instanceof): Ditto.
  24924. (JSC::Machine::cti_op_new_func): Ditto.
  24925. (JSC::Machine::cti_op_call_JSFunction): Optimized by using the
  24926. ARG values directly instead of through local variables -- this gets
  24927. rid of code that just shuffles things around in the stack frame.
  24928. Also get rid of ExecState and update for the new way exceptions are
  24929. handled in slideRegisterWindowForCall.
  24930. (JSC::Machine::cti_vm_compile): Update to make exec out of r since
  24931. they are both the same thing now.
  24932. (JSC::Machine::cti_op_call_NotJSFunction): Ditto.
  24933. (JSC::Machine::cti_op_init_arguments): Ditto.
  24934. (JSC::Machine::cti_op_resolve): Ditto.
  24935. (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
  24936. (JSC::Machine::cti_op_construct_NotJSConstruct): Ditto.
  24937. (JSC::Machine::cti_op_resolve_func): Ditto.
  24938. (JSC::Machine::cti_op_put_by_val): Ditto.
  24939. (JSC::Machine::cti_op_put_by_val_array): Ditto.
  24940. (JSC::Machine::cti_op_resolve_skip): Ditto.
  24941. (JSC::Machine::cti_op_resolve_global): Ditto.
  24942. (JSC::Machine::cti_op_post_inc): Ditto.
  24943. (JSC::Machine::cti_op_resolve_with_base): Ditto.
  24944. (JSC::Machine::cti_op_post_dec): Ditto.
  24945. (JSC::Machine::cti_op_call_eval): Ditto.
  24946. (JSC::Machine::cti_op_throw): Ditto. Also rearranged to return
  24947. the exception value as the return value so it can be used by
  24948. op_catch.
  24949. (JSC::Machine::cti_op_push_scope): Ditto.
  24950. (JSC::Machine::cti_op_in): Ditto.
  24951. (JSC::Machine::cti_op_del_by_val): Ditto.
  24952. (JSC::Machine::cti_vm_throw): Ditto. Also rearranged to return
  24953. the exception value as the return value so it can be used by
  24954. op_catch.
  24955. * kjs/DebuggerCallFrame.cpp:
  24956. (JSC::DebuggerCallFrame::functionName): Pass globalData.
  24957. (JSC::DebuggerCallFrame::evaluate): Eliminated code to make a
  24958. new ExecState.
  24959. * kjs/DebuggerCallFrame.h: Removed ExecState argument from
  24960. constructor.
  24961. * kjs/ExecState.h: Eliminated all data members and made ExecState
  24962. inherit privately from Register instead. Also added a typedef to
  24963. the future name for this class, which is CallFrame. It's just a
  24964. Register* that knows it's a pointer at a call frame. The new class
  24965. can't be constructed or copied. Changed all functions to use
  24966. the this pointer instead of m_callFrame. Changed exception-related
  24967. functions to access an exception in JSGlobalData. Removed functions
  24968. used by CTI to pass the return address to the throw machinery --
  24969. this is now done directly with a global in the global data.
  24970. * kjs/FunctionPrototype.cpp:
  24971. (JSC::functionProtoFuncToString): Pass globalData instead of exec.
  24972. * kjs/InternalFunction.cpp:
  24973. (JSC::InternalFunction::name): Take globalData instead of exec.
  24974. * kjs/InternalFunction.h: Ditto.
  24975. * kjs/JSGlobalData.cpp: Initialize the new exception global to 0.
  24976. * kjs/JSGlobalData.h: Declare two new globals. One for the current
  24977. exception and another for the return address used by CTI to
  24978. implement the throw operation.
  24979. * kjs/JSGlobalObject.cpp:
  24980. (JSC::JSGlobalObject::init): Removed code to set up globalExec,
  24981. which is now the same thing as globalCallFrame.
  24982. (JSC::JSGlobalObject::reset): Get globalExec from our globalExec
  24983. function so we don't have to repeat the logic twice.
  24984. (JSC::JSGlobalObject::mark): Removed code to mark the exception;
  24985. the exception is now stored in JSGlobalData and marked there.
  24986. (JSC::JSGlobalObject::globalExec): Return a pointer to the end
  24987. of the global call frame.
  24988. * kjs/JSGlobalObject.h: Removed the globalExec data member.
  24989. * kjs/JSObject.cpp:
  24990. (JSC::JSObject::putDirectFunction): Pass globalData instead of exec.
  24991. * kjs/collector.cpp:
  24992. (JSC::Heap::collect): Mark the global exception.
  24993. * profiler/ProfileGenerator.cpp:
  24994. (JSC::ProfileGenerator::addParentForConsoleStart): Pass globalData
  24995. instead of exec to createCallIdentifier.
  24996. * profiler/Profiler.cpp:
  24997. (JSC::Profiler::willExecute): Pass globalData instead of exec to
  24998. createCallIdentifier.
  24999. (JSC::Profiler::didExecute): Ditto.
  25000. (JSC::Profiler::createCallIdentifier): Take globalData instead of
  25001. exec.
  25002. (JSC::createCallIdentifierFromFunctionImp): Ditto.
  25003. * profiler/Profiler.h: Change interface to take a JSGlobalData
  25004. instead of an ExecState.
  25005. 2008-10-04 Cameron Zwarich <zwarich@apple.com>
  25006. Reviewed by Darin Adler.
  25007. Bug 21369: Add opcode documentation for all undocumented opcodes
  25008. <https://bugs.webkit.org/show_bug.cgi?id=21369>
  25009. This patch adds opcode documentation for all undocumented opcodes, and
  25010. it also renames op_init_arguments to op_create_arguments.
  25011. * VM/CTI.cpp:
  25012. (JSC::CTI::privateCompileMainPass):
  25013. * VM/CodeBlock.cpp:
  25014. (JSC::CodeBlock::dump):
  25015. * VM/CodeGenerator.cpp:
  25016. (JSC::CodeGenerator::CodeGenerator):
  25017. * VM/Machine.cpp:
  25018. (JSC::Machine::privateExecute):
  25019. (JSC::Machine::cti_op_create_arguments):
  25020. * VM/Machine.h:
  25021. * VM/Opcode.h:
  25022. 2008-10-03 Maciej Stachowiak <mjs@apple.com>
  25023. Reviewed by Cameron Zwarich.
  25024. - "this" object in methods called on primitives should be wrapper object
  25025. https://bugs.webkit.org/show_bug.cgi?id=21362
  25026. I changed things so that functions which use "this" do a fast
  25027. version of toThisObject conversion if needed. Currently we miss
  25028. the conversion entirely, at least for primitive types. Using
  25029. TypeInfo and the primitive check, I made the fast case bail out
  25030. pretty fast.
  25031. This is inexplicably an 1.007x SunSpider speedup (and a wash on V8 benchmarks).
  25032. Also renamed some opcodes for clarity:
  25033. init ==> enter
  25034. init_activation ==> enter_with_activation
  25035. * VM/CTI.cpp:
  25036. (JSC::CTI::privateCompileMainPass):
  25037. (JSC::CTI::privateCompileSlowCases):
  25038. * VM/CodeBlock.cpp:
  25039. (JSC::CodeBlock::dump):
  25040. * VM/CodeGenerator.cpp:
  25041. (JSC::CodeGenerator::generate):
  25042. (JSC::CodeGenerator::CodeGenerator):
  25043. * VM/Machine.cpp:
  25044. (JSC::Machine::privateExecute):
  25045. (JSC::Machine::cti_op_convert_this):
  25046. * VM/Machine.h:
  25047. * VM/Opcode.h:
  25048. * kjs/JSActivation.cpp:
  25049. (JSC::JSActivation::JSActivation):
  25050. * kjs/JSActivation.h:
  25051. (JSC::JSActivation::createStructureID):
  25052. * kjs/JSCell.h:
  25053. (JSC::JSValue::needsThisConversion):
  25054. * kjs/JSGlobalData.cpp:
  25055. (JSC::JSGlobalData::JSGlobalData):
  25056. * kjs/JSGlobalData.h:
  25057. * kjs/JSNumberCell.h:
  25058. (JSC::JSNumberCell::createStructureID):
  25059. * kjs/JSStaticScopeObject.h:
  25060. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  25061. (JSC::JSStaticScopeObject::createStructureID):
  25062. * kjs/JSString.h:
  25063. (JSC::JSString::createStructureID):
  25064. * kjs/JSValue.h:
  25065. * kjs/TypeInfo.h:
  25066. (JSC::TypeInfo::needsThisConversion):
  25067. * kjs/nodes.h:
  25068. (JSC::ScopeNode::usesThis):
  25069. 2008-10-03 Cameron Zwarich <zwarich@apple.com>
  25070. Reviewed by Maciej Stachowiak.
  25071. Bug 21356: The size of the RegisterFile differs depending on 32-bit / 64-bit and Debug / Release
  25072. <https://bugs.webkit.org/show_bug.cgi?id=21356>
  25073. The RegisterFile decreases in size (measured in terms of numbers of
  25074. Registers) as the size of a Register increases. This causes
  25075. js1_5/Regress/regress-159334.js
  25076. to fail in 64-bit debug builds. This fix makes the RegisterFile on all
  25077. platforms the same size that it is in 32-bit Release builds.
  25078. * VM/RegisterFile.h:
  25079. (JSC::RegisterFile::RegisterFile):
  25080. 2008-10-03 Maciej Stachowiak <mjs@apple.com>
  25081. Reviewed by Cameron Zwarich.
  25082. - Some code cleanup to how we handle code features.
  25083. 1) Rename FeatureInfo typedef to CodeFeatures.
  25084. 2) Rename NodeFeatureInfo template to NodeInfo.
  25085. 3) Keep CodeFeature bitmask in ScopeNode instead of trying to break it out into individual bools.
  25086. 4) Rename misleadingly named "needsClosure" method to "containsClosures", which better describes the meaning
  25087. of ClosureFeature.
  25088. 5) Make setUsersArguments() not take an argument since it only goes one way.
  25089. * JavaScriptCore.exp:
  25090. * VM/CodeBlock.h:
  25091. (JSC::CodeBlock::CodeBlock):
  25092. * kjs/NodeInfo.h:
  25093. * kjs/Parser.cpp:
  25094. (JSC::Parser::didFinishParsing):
  25095. * kjs/Parser.h:
  25096. (JSC::Parser::parse):
  25097. * kjs/grammar.y:
  25098. * kjs/nodes.cpp:
  25099. (JSC::ScopeNode::ScopeNode):
  25100. (JSC::ProgramNode::ProgramNode):
  25101. (JSC::ProgramNode::create):
  25102. (JSC::EvalNode::EvalNode):
  25103. (JSC::EvalNode::create):
  25104. (JSC::FunctionBodyNode::FunctionBodyNode):
  25105. (JSC::FunctionBodyNode::create):
  25106. * kjs/nodes.h:
  25107. (JSC::ScopeNode::usesEval):
  25108. (JSC::ScopeNode::containsClosures):
  25109. (JSC::ScopeNode::usesArguments):
  25110. (JSC::ScopeNode::setUsesArguments):
  25111. 2008-10-03 Cameron Zwarich <zwarich@apple.com>
  25112. Reviewed by Maciej Stachowiak.
  25113. Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
  25114. <https://bugs.webkit.org/show_bug.cgi?id=21343>
  25115. A fix was landed for this issue in r37253, and the ChangeLog assumes
  25116. that it is a compiler bug, but it turns out that it is a subtle issue
  25117. with mixing signed and unsigned 32-bit values in a 64-bit environment.
  25118. In order to properly fix this bug, we should convert our signed offsets
  25119. into the register file to use ptrdiff_t.
  25120. This may not be the only instance of this issue, but I will land this
  25121. fix first and look for more later.
  25122. * VM/Machine.cpp:
  25123. (JSC::Machine::getArgumentsData):
  25124. * VM/Machine.h:
  25125. * kjs/Arguments.cpp:
  25126. (JSC::Arguments::getOwnPropertySlot):
  25127. * kjs/Arguments.h:
  25128. (JSC::Arguments::init):
  25129. 2008-10-03 Darin Adler <darin@apple.com>
  25130. * VM/CTI.cpp: Another Windows build fix. Change the args of ctiTrampoline.
  25131. * kjs/JSNumberCell.h: A build fix for newer versions of gcc. Added
  25132. declarations of JSGlobalData overloads of jsNumberCell.
  25133. 2008-10-03 Darin Adler <darin@apple.com>
  25134. - try to fix Windows build
  25135. * kjs/ScopeChain.h: Add forward declaration of JSGlobalData.
  25136. 2008-10-03 Darin Adler <darin@apple.com>
  25137. Reviewed by Geoff Garen.
  25138. - next step of https://bugs.webkit.org/show_bug.cgi?id=21295
  25139. Turn ExecState into a call frame pointer.
  25140. Remove m_globalObject and m_globalData from ExecState.
  25141. SunSpider says this is a wash (slightly faster but not statistically
  25142. significant); which is good enough since it's a preparation step and
  25143. not supposed to be a spedup.
  25144. * API/JSCallbackFunction.cpp:
  25145. (JSC::JSCallbackFunction::JSCallbackFunction):
  25146. * kjs/ArrayConstructor.cpp:
  25147. (JSC::ArrayConstructor::ArrayConstructor):
  25148. * kjs/BooleanConstructor.cpp:
  25149. (JSC::BooleanConstructor::BooleanConstructor):
  25150. * kjs/DateConstructor.cpp:
  25151. (JSC::DateConstructor::DateConstructor):
  25152. * kjs/ErrorConstructor.cpp:
  25153. (JSC::ErrorConstructor::ErrorConstructor):
  25154. * kjs/FunctionPrototype.cpp:
  25155. (JSC::FunctionPrototype::FunctionPrototype):
  25156. * kjs/JSFunction.cpp:
  25157. (JSC::JSFunction::JSFunction):
  25158. * kjs/NativeErrorConstructor.cpp:
  25159. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  25160. * kjs/NumberConstructor.cpp:
  25161. (JSC::NumberConstructor::NumberConstructor):
  25162. * kjs/ObjectConstructor.cpp:
  25163. (JSC::ObjectConstructor::ObjectConstructor):
  25164. * kjs/PrototypeFunction.cpp:
  25165. (JSC::PrototypeFunction::PrototypeFunction):
  25166. * kjs/RegExpConstructor.cpp:
  25167. (JSC::RegExpConstructor::RegExpConstructor):
  25168. * kjs/StringConstructor.cpp:
  25169. (JSC::StringConstructor::StringConstructor):
  25170. Pass JSGlobalData* instead of ExecState* to the InternalFunction
  25171. constructor.
  25172. * API/OpaqueJSString.cpp: Added now-needed include.
  25173. * JavaScriptCore.exp: Updated.
  25174. * VM/CTI.cpp:
  25175. (JSC::CTI::emitSlowScriptCheck): Changed to use ARGS_globalData
  25176. instead of ARGS_exec.
  25177. * VM/CTI.h: Added a new argument to the CTI, the global data pointer.
  25178. While it's possible to get to the global data pointer using the
  25179. ExecState pointer, it's slow enough that it's better to just keep
  25180. it around in the CTI arguments.
  25181. * VM/CodeBlock.h: Moved the CodeType enum here from ExecState.h.
  25182. * VM/Machine.cpp:
  25183. (JSC::Machine::execute): Pass fewer arguments when constructing
  25184. ExecState, and pass the global data pointer when invoking CTI.
  25185. (JSC::Machine::firstCallFrame): Added. Used to get the dynamic global
  25186. object, which is in the scope chain of the first call frame.
  25187. (JSC::Machine::cti_op_add): Use globalData instead of exec when
  25188. possible, to keep fast cases fast, since it's now more expensive to
  25189. get to it through the exec pointer.
  25190. (JSC::Machine::cti_timeout_check): Ditto.
  25191. (JSC::Machine::cti_op_put_by_id_second): Ditto.
  25192. (JSC::Machine::cti_op_get_by_id_second): Ditto.
  25193. (JSC::Machine::cti_op_mul): Ditto.
  25194. (JSC::Machine::cti_vm_compile): Ditto.
  25195. (JSC::Machine::cti_op_get_by_val): Ditto.
  25196. (JSC::Machine::cti_op_sub): Ditto.
  25197. (JSC::Machine::cti_op_put_by_val): Ditto.
  25198. (JSC::Machine::cti_op_put_by_val_array): Ditto.
  25199. (JSC::Machine::cti_op_negate): Ditto.
  25200. (JSC::Machine::cti_op_div): Ditto.
  25201. (JSC::Machine::cti_op_pre_dec): Ditto.
  25202. (JSC::Machine::cti_op_post_inc): Ditto.
  25203. (JSC::Machine::cti_op_lshift): Ditto.
  25204. (JSC::Machine::cti_op_bitand): Ditto.
  25205. (JSC::Machine::cti_op_rshift): Ditto.
  25206. (JSC::Machine::cti_op_bitnot): Ditto.
  25207. (JSC::Machine::cti_op_mod): Ditto.
  25208. (JSC::Machine::cti_op_post_dec): Ditto.
  25209. (JSC::Machine::cti_op_urshift): Ditto.
  25210. (JSC::Machine::cti_op_bitxor): Ditto.
  25211. (JSC::Machine::cti_op_bitor): Ditto.
  25212. (JSC::Machine::cti_op_call_eval): Ditto.
  25213. (JSC::Machine::cti_op_throw): Ditto.
  25214. (JSC::Machine::cti_op_is_string): Ditto.
  25215. (JSC::Machine::cti_op_debug): Ditto.
  25216. (JSC::Machine::cti_vm_throw): Ditto.
  25217. * VM/Machine.h: Added firstCallFrame.
  25218. * kjs/DebuggerCallFrame.cpp:
  25219. (JSC::DebuggerCallFrame::evaluate): Pass fewer arguments when
  25220. constructing ExecState.
  25221. * kjs/ExecState.cpp: Deleted contents. Later we'll remove the
  25222. file altogether.
  25223. * kjs/ExecState.h: Removed m_globalObject and m_globalData.
  25224. Moved CodeType into another header.
  25225. (JSC::ExecState::ExecState): Take only a single argument, a
  25226. call frame pointer.
  25227. (JSC::ExecState::dynamicGlobalObject): Get the object from
  25228. the first call frame since it's no longer stored.
  25229. (JSC::ExecState::globalData): Get the global data from the
  25230. scope chain, since we no longer store a pointer to it here.
  25231. (JSC::ExecState::identifierTable): Ditto.
  25232. (JSC::ExecState::propertyNames): Ditto.
  25233. (JSC::ExecState::emptyList): Ditto.
  25234. (JSC::ExecState::lexer): Ditto.
  25235. (JSC::ExecState::parser): Ditto.
  25236. (JSC::ExecState::machine): Ditto.
  25237. (JSC::ExecState::arrayTable): Ditto.
  25238. (JSC::ExecState::dateTable): Ditto.
  25239. (JSC::ExecState::mathTable): Ditto.
  25240. (JSC::ExecState::numberTable): Ditto.
  25241. (JSC::ExecState::regExpTable): Ditto.
  25242. (JSC::ExecState::regExpConstructorTable): Ditto.
  25243. (JSC::ExecState::stringTable): Ditto.
  25244. (JSC::ExecState::heap): Ditto.
  25245. * kjs/FunctionConstructor.cpp:
  25246. (JSC::FunctionConstructor::FunctionConstructor): Pass
  25247. JSGlobalData* instead of ExecState* to the InternalFunction
  25248. constructor.
  25249. (JSC::constructFunction): Pass the global data pointer when
  25250. constructing a new scope chain.
  25251. * kjs/InternalFunction.cpp:
  25252. (JSC::InternalFunction::InternalFunction): Take a JSGlobalData*
  25253. instead of an ExecState*. Later we can change more places to
  25254. work this way -- it's more efficient to take the type you need
  25255. since the caller might already have it.
  25256. * kjs/InternalFunction.h: Ditto.
  25257. * kjs/JSCell.h:
  25258. (JSC::JSCell::operator new): Added an overload that takes a
  25259. JSGlobalData* so you can construct without an ExecState*.
  25260. * kjs/JSGlobalObject.cpp:
  25261. (JSC::JSGlobalObject::init): Moved creation of the global scope
  25262. chain in here, since it now requires a pointer to the global data.
  25263. Moved the initialization of the call frame in here since it requires
  25264. the global scope chain node. Removed the extra argument to ExecState
  25265. when creating the global ExecState*.
  25266. * kjs/JSGlobalObject.h: Removed initialization of globalScopeChain
  25267. and the call frame from the JSGlobalObjectData constructor. Added
  25268. a thisValue argument to the init function.
  25269. * kjs/JSNumberCell.cpp: Added versions of jsNumberCell that take
  25270. JSGlobalData* rather than ExecState*.
  25271. * kjs/JSNumberCell.h:
  25272. (JSC::JSNumberCell::operator new): Added a version that takes
  25273. JSGlobalData*.
  25274. (JSC::JSNumberCell::JSNumberCell): Ditto.
  25275. (JSC::jsNumber): Ditto.
  25276. * kjs/JSString.cpp:
  25277. (JSC::jsString): Ditto.
  25278. (JSC::jsSubstring): Ditto.
  25279. (JSC::jsOwnedString): Ditto.
  25280. * kjs/JSString.h:
  25281. (JSC::JSString::JSString): Changed to take JSGlobalData*.
  25282. (JSC::jsEmptyString): Added a version that takes JSGlobalData*.
  25283. (JSC::jsSingleCharacterString): Ditto.
  25284. (JSC::jsSingleCharacterSubstring): Ditto.
  25285. (JSC::jsNontrivialString): Ditto.
  25286. (JSC::JSString::getIndex): Ditto.
  25287. (JSC::jsString): Ditto.
  25288. (JSC::jsSubstring): Ditto.
  25289. (JSC::jsOwnedString): Ditto.
  25290. * kjs/ScopeChain.h: Added a globalData pointer to each node.
  25291. (JSC::ScopeChainNode::ScopeChainNode): Initialize the globalData
  25292. pointer.
  25293. (JSC::ScopeChainNode::push): Set the global data pointer in the
  25294. new node.
  25295. (JSC::ScopeChain::ScopeChain): Take a globalData argument.
  25296. * kjs/SmallStrings.cpp:
  25297. (JSC::SmallStrings::createEmptyString): Take JSGlobalData* instead of
  25298. ExecState*.
  25299. (JSC::SmallStrings::createSingleCharacterString): Ditto.
  25300. * kjs/SmallStrings.h:
  25301. (JSC::SmallStrings::emptyString): Ditto.
  25302. (JSC::SmallStrings::singleCharacterString): Ditto.
  25303. 2008-10-03 Cameron Zwarich <zwarich@apple.com>
  25304. Reviewed by Geoff Garen.
  25305. Bug 21343: REGRESSSION (r37160): ecma_3/ExecutionContexts/10.1.3-1.js and js1_4/Functions/function-001.js fail on 64-bit
  25306. <https://bugs.webkit.org/show_bug.cgi?id=21343>
  25307. Add a workaround for a bug in GCC, which affects GCC 4.0, GCC 4.2, and
  25308. llvm-gcc 4.2. I put it in an #ifdef because it was a slight regression
  25309. on SunSpider in 32-bit, although that might be entirely random.
  25310. * kjs/Arguments.cpp:
  25311. (JSC::Arguments::getOwnPropertySlot):
  25312. 2008-10-03 Darin Adler <darin@apple.com>
  25313. Rubber stamped by Alexey Proskuryakov.
  25314. * kjs/Shell.cpp: (main): Don't delete JSGlobalData. Later, we need to change
  25315. this tool to use public JavaScriptCore API instead.
  25316. 2008-10-03 Darin Adler <darin@apple.com>
  25317. Suggested by Alexey Proskuryakov.
  25318. * kjs/JSGlobalData.cpp:
  25319. (JSC::JSGlobalData::~JSGlobalData): Remove call to heap.destroy() because
  25320. it's too late to ref the JSGlobalData object once it's already being
  25321. destroyed. In practice this is not a problem because WebCore's JSGlobalData
  25322. is never destroyed and JSGlobalContextRelease takes care of calling
  25323. heap.destroy() in advance.
  25324. 2008-10-02 Oliver Hunt <oliver@apple.com>
  25325. Reviewed by Maciej Stachowiak.
  25326. Replace SSE3 check with an SSE2 check, and implement SSE2 check on windows.
  25327. 5.6% win on SunSpider on windows.
  25328. * VM/CTI.cpp:
  25329. (JSC::isSSE2Present):
  25330. (JSC::CTI::compileBinaryArithOp):
  25331. (JSC::CTI::compileBinaryArithOpSlowCase):
  25332. 2008-10-03 Maciej Stachowiak <mjs@apple.com>
  25333. Rubber stamped by Cameron Zwarich.
  25334. - fix mistaken change of | to || which caused a big perf regression on EarleyBoyer
  25335. * kjs/grammar.y:
  25336. 2008-10-02 Darin Adler <darin@apple.com>
  25337. Reviewed by Geoff Garen.
  25338. - https://bugs.webkit.org/show_bug.cgi?id=21321
  25339. Bug 21321: speed up JavaScriptCore by inlining Heap in JSGlobalData
  25340. 1.019x as fast on SunSpider.
  25341. * API/JSBase.cpp:
  25342. (JSEvaluateScript): Use heap. instead of heap-> to work with the heap.
  25343. (JSCheckScriptSyntax): Ditto.
  25344. (JSGarbageCollect): Ditto.
  25345. (JSReportExtraMemoryCost): Ditto.
  25346. * API/JSContextRef.cpp:
  25347. (JSGlobalContextRetain): Ditto.
  25348. (JSGlobalContextRelease): Destroy the heap with the destroy function instead
  25349. of the delete operator.
  25350. (JSContextGetGlobalObject): Use heap. instead of heap-> to work with the heap.
  25351. * API/JSObjectRef.cpp:
  25352. (JSObjectMake): Use heap. instead of heap-> to work with the heap.
  25353. (JSObjectMakeFunctionWithCallback): Ditto.
  25354. (JSObjectMakeConstructor): Ditto.
  25355. (JSObjectMakeFunction): Ditto.
  25356. (JSObjectMakeArray): Ditto.
  25357. (JSObjectMakeDate): Ditto.
  25358. (JSObjectMakeError): Ditto.
  25359. (JSObjectMakeRegExp): Ditto.
  25360. (JSObjectHasProperty): Ditto.
  25361. (JSObjectGetProperty): Ditto.
  25362. (JSObjectSetProperty): Ditto.
  25363. (JSObjectGetPropertyAtIndex): Ditto.
  25364. (JSObjectSetPropertyAtIndex): Ditto.
  25365. (JSObjectDeleteProperty): Ditto.
  25366. (JSObjectCallAsFunction): Ditto.
  25367. (JSObjectCallAsConstructor): Ditto.
  25368. (JSObjectCopyPropertyNames): Ditto.
  25369. (JSPropertyNameAccumulatorAddName): Ditto.
  25370. * API/JSValueRef.cpp:
  25371. (JSValueIsEqual): Ditto.
  25372. (JSValueIsInstanceOfConstructor): Ditto.
  25373. (JSValueMakeNumber): Ditto.
  25374. (JSValueMakeString): Ditto.
  25375. (JSValueToNumber): Ditto.
  25376. (JSValueToStringCopy): Ditto.
  25377. (JSValueToObject): Ditto.
  25378. (JSValueProtect): Ditto.
  25379. (JSValueUnprotect): Ditto.
  25380. * kjs/ExecState.h:
  25381. (JSC::ExecState::heap): Update to use the & operator.
  25382. * kjs/JSGlobalData.cpp:
  25383. (JSC::JSGlobalData::JSGlobalData): Update to initialize a heap member
  25384. instead of calling new to make a heap.
  25385. (JSC::JSGlobalData::~JSGlobalData): Destroy the heap with the destroy
  25386. function instead of the delete operator.
  25387. * kjs/JSGlobalData.h: Change from Heap* to a Heap.
  25388. * kjs/JSGlobalObject.cpp:
  25389. (JSC::JSGlobalObject::mark): Use the & operator here.
  25390. (JSC::JSGlobalObject::operator new): Use heap. instead of heap-> to work
  25391. with the heap.
  25392. 2008-10-02 Cameron Zwarich <zwarich@apple.com>
  25393. Reviewed by Geoff Garen.
  25394. Bug 21317: Replace RegisterFile size and capacity information with Register pointers
  25395. <https://bugs.webkit.org/show_bug.cgi?id=21317>
  25396. This is a 2.3% speedup on the V8 DeltaBlue benchmark, a 3.3% speedup on
  25397. the V8 Raytrace benchmark, and a 1.0% speedup on SunSpider.
  25398. * VM/Machine.cpp:
  25399. (JSC::slideRegisterWindowForCall):
  25400. (JSC::Machine::callEval):
  25401. (JSC::Machine::execute):
  25402. (JSC::Machine::privateExecute):
  25403. (JSC::Machine::cti_op_call_JSFunction):
  25404. (JSC::Machine::cti_op_construct_JSConstruct):
  25405. * VM/RegisterFile.cpp:
  25406. (JSC::RegisterFile::~RegisterFile):
  25407. * VM/RegisterFile.h:
  25408. (JSC::RegisterFile::RegisterFile):
  25409. (JSC::RegisterFile::start):
  25410. (JSC::RegisterFile::end):
  25411. (JSC::RegisterFile::size):
  25412. (JSC::RegisterFile::shrink):
  25413. (JSC::RegisterFile::grow):
  25414. (JSC::RegisterFile::lastGlobal):
  25415. (JSC::RegisterFile::markGlobals):
  25416. (JSC::RegisterFile::markCallFrames):
  25417. * kjs/JSGlobalObject.cpp:
  25418. (JSC::JSGlobalObject::copyGlobalsTo):
  25419. 2008-10-02 Cameron Zwarich <zwarich@apple.com>
  25420. Rubber-stamped by Darin Adler.
  25421. Change bitwise operations introduced in r37166 to boolean operations. We
  25422. only use bitwise operations over boolean operations for increasing
  25423. performance in extremely hot code, but that does not apply to anything
  25424. in the parser.
  25425. * kjs/grammar.y:
  25426. 2008-10-02 Gavin Barraclough <barraclough@apple.com>
  25427. Reviewed by Darin Adler.
  25428. Fix for bug #21232 - should reset m_isPendingDash on flush,
  25429. and should allow '\-' as beginning or end of a range (though
  25430. not to specifiy a range itself).
  25431. * ChangeLog:
  25432. * wrec/CharacterClassConstructor.cpp:
  25433. (JSC::CharacterClassConstructor::put):
  25434. (JSC::CharacterClassConstructor::flush):
  25435. * wrec/CharacterClassConstructor.h:
  25436. (JSC::CharacterClassConstructor::flushBeforeEscapedHyphen):
  25437. * wrec/WREC.cpp:
  25438. (JSC::WRECGenerator::generateDisjunction):
  25439. (JSC::WRECParser::parseCharacterClass):
  25440. (JSC::WRECParser::parseDisjunction):
  25441. * wrec/WREC.h:
  25442. 2008-10-02 Darin Adler <darin@apple.com>
  25443. Reviewed by Sam Weinig.
  25444. - remove the "static" from declarations in a header file, since we
  25445. don't want them to have internal linkage
  25446. * VM/Machine.h: Remove the static keyword from the constant and the
  25447. three inline functions that Geoff just moved here.
  25448. 2008-10-02 Geoffrey Garen <ggaren@apple.com>
  25449. Reviewed by Sam Weinig.
  25450. Fixed https://bugs.webkit.org/show_bug.cgi?id=21283.
  25451. Profiler Crashes When Started
  25452. * VM/Machine.cpp:
  25453. * VM/Machine.h:
  25454. (JSC::makeHostCallFramePointer):
  25455. (JSC::isHostCallFrame):
  25456. (JSC::stripHostCallFrameBit): Moved some things to the header so
  25457. JSGlobalObject could use them.
  25458. * kjs/JSGlobalObject.h:
  25459. (JSC::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData): Call the
  25460. new makeHostCallFramePointer API, since 0 no longer indicates a host
  25461. call frame.
  25462. 2008-10-02 Alexey Proskuryakov <ap@webkit.org>
  25463. Reviewed by Darin Adler.
  25464. https://bugs.webkit.org/show_bug.cgi?id=21304
  25465. Stop using a static wrapper map for WebCore JS bindings
  25466. * kjs/JSGlobalData.cpp:
  25467. (JSC::JSGlobalData::JSGlobalData):
  25468. (JSC::JSGlobalData::~JSGlobalData):
  25469. (JSC::JSGlobalData::ClientData::~ClientData):
  25470. * kjs/JSGlobalData.h:
  25471. Added a client data member to JSGlobalData. WebCore will use it to store bindings-related
  25472. global data.
  25473. * JavaScriptCore.exp: Export virtual ClientData destructor.
  25474. 2008-10-02 Geoffrey Garen <ggaren@apple.com>
  25475. Not reviewed.
  25476. Try to fix Qt build.
  25477. * kjs/Error.h:
  25478. 2008-10-01 Geoffrey Garen <ggaren@apple.com>
  25479. Reviewed by Darin Adler and Cameron Zwarich.
  25480. Preliminary step toward dynamic recompilation: Standardized and
  25481. simplified the parsing interface.
  25482. The main goal in this patch is to make it easy to ask for a duplicate
  25483. compilation, and get back a duplicate result -- same source URL, same
  25484. debugger / profiler ID, same toString behavior, etc.
  25485. The basic unit of compilation and evaluation is now SourceCode, which
  25486. encompasses a SourceProvider, a range in that provider, and a starting
  25487. line number.
  25488. A SourceProvider now encompasses a source URL, and *is* a source ID,
  25489. since a pointer is a unique identifier.
  25490. * API/JSBase.cpp:
  25491. (JSEvaluateScript):
  25492. (JSCheckScriptSyntax): Provide a SourceCode to the Interpreter, since
  25493. other APIs are no longer supported.
  25494. * VM/CodeBlock.h:
  25495. (JSC::EvalCodeCache::get): Provide a SourceCode to the Interpreter, since
  25496. other APIs are no longer supported.
  25497. (JSC::CodeBlock::CodeBlock): ASSERT something that used to be ASSERTed
  25498. by our caller -- this is a better bottleneck.
  25499. * VM/CodeGenerator.cpp:
  25500. (JSC::CodeGenerator::CodeGenerator): Updated for the fact that
  25501. FunctionBodyNode's parameters are no longer a WTF::Vector.
  25502. * kjs/Arguments.cpp:
  25503. (JSC::Arguments::Arguments): ditto
  25504. * kjs/DebuggerCallFrame.cpp:
  25505. (JSC::DebuggerCallFrame::evaluate): Provide a SourceCode to the Parser,
  25506. since other APIs are no longer supported.
  25507. * kjs/FunctionConstructor.cpp:
  25508. (JSC::constructFunction): Provide a SourceCode to the Parser, since
  25509. other APIs are no longer supported. Adopt FunctionBodyNode's new
  25510. "finishParsing" API.
  25511. * kjs/JSFunction.cpp:
  25512. (JSC::JSFunction::lengthGetter):
  25513. (JSC::JSFunction::getParameterName): Updated for the fact that
  25514. FunctionBodyNode's parameters are no longer a wtf::Vector.
  25515. * kjs/JSFunction.h: Nixed some cruft.
  25516. * kjs/JSGlobalObjectFunctions.cpp:
  25517. (JSC::globalFuncEval): Provide a SourceCode to the Parser, since
  25518. other APIs are no longer supported.
  25519. * kjs/Parser.cpp:
  25520. (JSC::Parser::parse): Require a SourceCode argument, instead of a bunch
  25521. of broken out parameters. Stop tracking sourceId as an integer, since we
  25522. use the SourceProvider pointer for this now. Don't clamp the
  25523. startingLineNumber, since SourceCode does that now.
  25524. * kjs/Parser.h:
  25525. (JSC::Parser::parse): Standardized the parsing interface to require a
  25526. SourceCode.
  25527. * kjs/Shell.cpp:
  25528. (functionRun):
  25529. (functionLoad):
  25530. (prettyPrintScript):
  25531. (runWithScripts):
  25532. (runInteractive): Provide a SourceCode to the Interpreter, since
  25533. other APIs are no longer supported.
  25534. * kjs/SourceProvider.h:
  25535. (JSC::SourceProvider::SourceProvider):
  25536. (JSC::SourceProvider::url):
  25537. (JSC::SourceProvider::asId):
  25538. (JSC::UStringSourceProvider::create):
  25539. (JSC::UStringSourceProvider::UStringSourceProvider): Added new
  25540. responsibilities described above.
  25541. * kjs/SourceRange.h:
  25542. (JSC::SourceCode::SourceCode):
  25543. (JSC::SourceCode::toString):
  25544. (JSC::SourceCode::provider):
  25545. (JSC::SourceCode::firstLine):
  25546. (JSC::SourceCode::data):
  25547. (JSC::SourceCode::length): Added new responsibilities described above.
  25548. Renamed SourceRange to SourceCode, based on review feedback. Added
  25549. a makeSource function for convenience.
  25550. * kjs/debugger.h: Provide a SourceCode to the client, since other APIs
  25551. are no longer supported.
  25552. * kjs/grammar.y: Provide startingLineNumber when creating a SourceCode.
  25553. * kjs/debugger.h: Treat sourceId as intptr_t to avoid loss of precision
  25554. on 64bit platforms.
  25555. * kjs/interpreter.cpp:
  25556. (JSC::Interpreter::checkSyntax):
  25557. (JSC::Interpreter::evaluate):
  25558. * kjs/interpreter.h: Require a SourceCode instead of broken out arguments.
  25559. * kjs/lexer.cpp:
  25560. (JSC::Lexer::setCode):
  25561. * kjs/lexer.h:
  25562. (JSC::Lexer::sourceRange): Fold together the SourceProvider and line number
  25563. into a SourceCode. Fixed a bug where the Lexer would accidentally keep
  25564. alive the last SourceProvider forever.
  25565. * kjs/nodes.cpp:
  25566. (JSC::ScopeNode::ScopeNode):
  25567. (JSC::ProgramNode::ProgramNode):
  25568. (JSC::ProgramNode::create):
  25569. (JSC::EvalNode::EvalNode):
  25570. (JSC::EvalNode::generateCode):
  25571. (JSC::EvalNode::create):
  25572. (JSC::FunctionBodyNode::FunctionBodyNode):
  25573. (JSC::FunctionBodyNode::finishParsing):
  25574. (JSC::FunctionBodyNode::create):
  25575. (JSC::FunctionBodyNode::generateCode):
  25576. (JSC::ProgramNode::generateCode):
  25577. (JSC::FunctionBodyNode::paramString):
  25578. * kjs/nodes.h:
  25579. (JSC::ScopeNode::):
  25580. (JSC::ScopeNode::sourceId):
  25581. (JSC::FunctionBodyNode::):
  25582. (JSC::FunctionBodyNode::parameterCount):
  25583. (JSC::FuncExprNode::):
  25584. (JSC::FuncDeclNode::): Store a SourceCode in all ScopeNodes, since
  25585. SourceCode is now responsible for tracking URL, ID, etc. Streamlined
  25586. some ad hoc FunctionBodyNode fixups into a "finishParsing" function, to
  25587. help make clear what you need to do in order to finish parsing a
  25588. FunctionBodyNode.
  25589. * wtf/Vector.h:
  25590. (WTF::::releaseBuffer): Don't ASSERT that releaseBuffer() is only called
  25591. when buffer is not 0, since FunctionBodyNode is more than happy
  25592. to get back a 0 buffer, and other functions like RefPtr::release() allow
  25593. for 0, too.
  25594. 2008-10-01 Cameron Zwarich <zwarich@apple.com>
  25595. Reviewed by Maciej Stachowiak.
  25596. Bug 21289: REGRESSION (r37160): Inspector crashes on load
  25597. <https://bugs.webkit.org/show_bug.cgi?id=21289>
  25598. The code in Arguments::mark() in r37160 was wrong. It marks indices in
  25599. d->registers, but that makes no sense (they are local variables, not
  25600. arguments). It should mark those indices in d->registerArray instead.
  25601. This patch also changes Arguments::copyRegisters() to use d->numParameters
  25602. instead of recomputing it.
  25603. * kjs/Arguments.cpp:
  25604. (JSC::Arguments::mark):
  25605. * kjs/Arguments.h:
  25606. (JSC::Arguments::copyRegisters):
  25607. 2008-09-30 Darin Adler <darin@apple.com>
  25608. Reviewed by Eric Seidel.
  25609. - https://bugs.webkit.org/show_bug.cgi?id=21214
  25610. work on getting rid of ExecState
  25611. Eliminate some unneeded uses of dynamicGlobalObject.
  25612. * API/JSClassRef.cpp:
  25613. (OpaqueJSClass::contextData): Changed to use a map in the global data instead
  25614. of on the global object. Also fixed to use only a single hash table lookup.
  25615. * API/JSObjectRef.cpp:
  25616. (JSObjectMakeConstructor): Use lexicalGlobalObject rather than dynamicGlobalObject
  25617. to get the object prototype.
  25618. * kjs/ArrayPrototype.cpp:
  25619. (JSC::arrayProtoFuncToString): Use arrayVisitedElements set in global data rather
  25620. than in the global object.
  25621. (JSC::arrayProtoFuncToLocaleString): Ditto.
  25622. (JSC::arrayProtoFuncJoin): Ditto.
  25623. * kjs/JSGlobalData.cpp:
  25624. (JSC::JSGlobalData::JSGlobalData): Don't initialize opaqueJSClassData, since
  25625. it's no longer a pointer.
  25626. (JSC::JSGlobalData::~JSGlobalData): We still need to delete all the values, but
  25627. we don't need to delete the map since it's no longer a pointer.
  25628. * kjs/JSGlobalData.h: Made opaqueJSClassData a map instead of a pointer to a map.
  25629. Also added arrayVisitedElements.
  25630. * kjs/JSGlobalObject.h: Removed arrayVisitedElements.
  25631. * kjs/Shell.cpp:
  25632. (functionRun): Use lexicalGlobalObject instead of dynamicGlobalObject.
  25633. (functionLoad): Ditto.
  25634. 2008-10-01 Cameron Zwarich <zwarich@apple.com>
  25635. Not reviewed.
  25636. Speculative Windows build fix.
  25637. * kjs/grammar.y:
  25638. 2008-10-01 Cameron Zwarich <zwarich@apple.com>
  25639. Reviewed by Darin Adler.
  25640. Bug 21123: using "arguments" in a function should not force creation of an activation object
  25641. <https://bugs.webkit.org/show_bug.cgi?id=21123>
  25642. Make the 'arguments' object not require a JSActivation. We store the
  25643. 'arguments' object in the OptionalCalleeArguments call frame slot. We
  25644. need to be able to get the original 'arguments' object to tear it off
  25645. when returning from a function, but 'arguments' may be assigned to in a
  25646. number of ways.
  25647. Therefore, we use the OptionalCalleeArguments slot when we want to get
  25648. the original activation or we know that 'arguments' was not assigned a
  25649. different value. When 'arguments' may have been assigned a new value,
  25650. we use a new local variable that is initialized with 'arguments'. Since
  25651. a function parameter named 'arguments' may overwrite the value of
  25652. 'arguments', we also need to be careful to look up 'arguments' in the
  25653. symbol table, so we get the parameter named 'arguments' instead of the
  25654. local variable that we have added for holding the 'arguments' object.
  25655. This is a 19.1% win on the V8 Raytrace benchmark using the SunSpider
  25656. harness, and a 20.7% win using the V8 harness. This amounts to a 6.5%
  25657. total speedup on the V8 benchmark suite using the V8 harness.
  25658. * VM/CTI.cpp:
  25659. (JSC::CTI::privateCompileMainPass):
  25660. * VM/CodeBlock.h:
  25661. * VM/CodeGenerator.cpp:
  25662. (JSC::CodeGenerator::CodeGenerator):
  25663. * VM/Machine.cpp:
  25664. (JSC::Machine::unwindCallFrame):
  25665. (JSC::Machine::privateExecute):
  25666. (JSC::Machine::retrieveArguments):
  25667. (JSC::Machine::cti_op_init_arguments):
  25668. (JSC::Machine::cti_op_ret_activation_arguments):
  25669. * VM/Machine.h:
  25670. * VM/RegisterFile.h:
  25671. (JSC::RegisterFile::):
  25672. * kjs/Arguments.cpp:
  25673. (JSC::Arguments::mark):
  25674. (JSC::Arguments::fillArgList):
  25675. (JSC::Arguments::getOwnPropertySlot):
  25676. (JSC::Arguments::put):
  25677. * kjs/Arguments.h:
  25678. (JSC::Arguments::setRegisters):
  25679. (JSC::Arguments::init):
  25680. (JSC::Arguments::Arguments):
  25681. (JSC::Arguments::copyRegisters):
  25682. (JSC::JSActivation::copyRegisters):
  25683. * kjs/JSActivation.cpp:
  25684. (JSC::JSActivation::argumentsGetter):
  25685. * kjs/JSActivation.h:
  25686. (JSC::JSActivation::JSActivationData::JSActivationData):
  25687. * kjs/grammar.y:
  25688. * kjs/nodes.h:
  25689. (JSC::ScopeNode::setUsesArguments):
  25690. * masm/X86Assembler.h:
  25691. (JSC::X86Assembler::):
  25692. (JSC::X86Assembler::orl_mr):
  25693. 2008-10-01 Kevin McCullough <kmccullough@apple.com>
  25694. Rubberstamped by Geoff Garen.
  25695. Remove BreakpointCheckStatement because it's not used anymore.
  25696. No effect on sunspider or the jsc tests.
  25697. * kjs/nodes.cpp:
  25698. * kjs/nodes.h:
  25699. 2008-09-30 Oliver Hunt <oliver@apple.com>
  25700. Reviewed by Geoff Garen.
  25701. Improve performance of CTI on windows.
  25702. Currently on platforms where the compiler doesn't allow us to safely
  25703. index relative to the address of a parameter we need to actually
  25704. provide a pointer to CTI runtime call arguments. This patch improves
  25705. performance in this case by making the CTI logic for restoring this
  25706. parameter much less conservative by only resetting it before we actually
  25707. make a call, rather than between each and every SF bytecode we generate
  25708. code for.
  25709. This results in a 3.6% progression on the v8 benchmark when compiled with MSVC.
  25710. * VM/CTI.cpp:
  25711. (JSC::CTI::emitCall):
  25712. (JSC::CTI::compileOpCall):
  25713. (JSC::CTI::privateCompileMainPass):
  25714. (JSC::CTI::privateCompileSlowCases):
  25715. (JSC::CTI::privateCompilePutByIdTransition):
  25716. * VM/CTI.h:
  25717. * masm/X86Assembler.h:
  25718. * wtf/Platform.h:
  25719. 2008-09-30 Maciej Stachowiak <mjs@apple.com>
  25720. Reviewed by Oliver Hunt.
  25721. - track uses of "this", "with" and "catch" in the parser
  25722. Knowing this up front will be useful for future optimizations.
  25723. Perf and correctness remain the same.
  25724. * kjs/NodeInfo.h:
  25725. * kjs/grammar.y:
  25726. 2008-09-30 Sam Weinig <sam@webkit.org>
  25727. Reviewed by Mark Rowe.
  25728. Add WebKitAvailability macros for JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError,
  25729. and JSObjectMakeRegExp
  25730. * API/JSObjectRef.h:
  25731. 2008-09-30 Darin Adler <darin@apple.com>
  25732. Reviewed by Geoff Garen.
  25733. - https://bugs.webkit.org/show_bug.cgi?id=21214
  25734. work on getting rid of ExecState
  25735. Replaced the m_prev field of ExecState with a bit in the
  25736. call frame pointer to indicate "host" call frames.
  25737. * VM/Machine.cpp:
  25738. (JSC::makeHostCallFramePointer): Added. Sets low bit.
  25739. (JSC::isHostCallFrame): Added. Checks low bit.
  25740. (JSC::stripHostCallFrameBit): Added. Clears low bit.
  25741. (JSC::Machine::unwindCallFrame): Replaced null check that was
  25742. formerly used to detect host call frames with an isHostCallFrame check.
  25743. (JSC::Machine::execute): Pass in a host call frame pointer rather than
  25744. always passing 0 when starting execution from the host. This allows us
  25745. to follow the entire call frame pointer chain when desired, or to stop
  25746. at the host calls when that's desired.
  25747. (JSC::Machine::privateExecute): Replaced null check that was
  25748. formerly used to detect host call frames with an isHostCallFrame check.
  25749. (JSC::Machine::retrieveCaller): Ditto.
  25750. (JSC::Machine::retrieveLastCaller): Ditto.
  25751. (JSC::Machine::callFrame): Removed the code to walk up m_prev pointers
  25752. and replaced it with code that uses the caller pointer and uses the
  25753. stripHostCallFrameBit function.
  25754. * kjs/ExecState.cpp: Removed m_prev.
  25755. * kjs/ExecState.h: Ditto.
  25756. 2008-09-30 Cameron Zwarich <zwarich@apple.com>
  25757. Reviewed by Geoff Garen.
  25758. Move all detection of 'arguments' in a lexical scope to the parser, in
  25759. preparation for fixing
  25760. Bug 21123: using "arguments" in a function should not force creation of an activation object
  25761. <https://bugs.webkit.org/show_bug.cgi?id=21123>
  25762. * VM/CodeGenerator.cpp:
  25763. (JSC::CodeGenerator::CodeGenerator):
  25764. * kjs/NodeInfo.h:
  25765. * kjs/grammar.y:
  25766. 2008-09-30 Geoffrey Garen <ggaren@apple.com>
  25767. Not reviewed.
  25768. * kjs/Shell.cpp:
  25769. (runWithScripts): Fixed indentation.
  25770. 2008-09-30 Mark Rowe <mrowe@apple.com>
  25771. Rubber-stamped by Sam Weinig.
  25772. Build fix. Move InternalFunction::classInfo implementation into the .cpp
  25773. file to prevent the vtable for InternalFunction being generated as a weak symbol.
  25774. Has no effect on SunSpider.
  25775. * kjs/InternalFunction.cpp:
  25776. (JSC::InternalFunction::classInfo):
  25777. * kjs/InternalFunction.h:
  25778. 2008-09-29 Maciej Stachowiak <mjs@apple.com>
  25779. Reviewed by Darin Adler.
  25780. - optimize appending a number to a string
  25781. https://bugs.webkit.org/show_bug.cgi?id=21203
  25782. It's pretty common in real-world code (and on some of the v8
  25783. benchmarks) to append a number to a string, so I made this one of
  25784. the fast cases, and also added support to UString to do it
  25785. directly without allocating a temporary UString.
  25786. ~1% speedup on v8 benchmark.
  25787. * VM/Machine.cpp:
  25788. (JSC::jsAddSlowCase): Make this NEVER_INLINE because somehow otherwise
  25789. the change is a regression.
  25790. (JSC::jsAdd): Handle number + string special case.
  25791. (JSC::Machine::cti_op_add): Integrate much of the logic of jsAdd to
  25792. avoid exception check in the str + str, num + num and str + num cases.
  25793. * kjs/ustring.cpp:
  25794. (JSC::expandedSize): Make this a non-member function, since it needs to be
  25795. called in non-member functions but not outside this file.
  25796. (JSC::expandCapacity): Ditto.
  25797. (JSC::UString::expandCapacity): Call the non-member version.
  25798. (JSC::createRep): Helper to make a rep from a char*.
  25799. (JSC::UString::UString): Use above helper.
  25800. (JSC::concatenate): Guts of concatenating constructor for cases where first
  25801. item is a UString::Rep, and second is a UChar* and length, or a char*.
  25802. (JSC::UString::append): Implement for cases where first item is a UString::Rep,
  25803. and second is an int or double. Sadly duplicates logic of UString::from(int)
  25804. and UString::from(double).
  25805. * kjs/ustring.h:
  25806. 2008-09-29 Darin Adler <darin@apple.com>
  25807. Reviewed by Sam Weinig.
  25808. - https://bugs.webkit.org/show_bug.cgi?id=21214
  25809. work on getting rid of ExecState
  25810. * JavaScriptCore.exp: Updated since JSGlobalObject::init
  25811. no longer takes a parameter.
  25812. * VM/Machine.cpp:
  25813. (JSC::Machine::execute): Removed m_registerFile argument
  25814. for ExecState constructors.
  25815. * kjs/DebuggerCallFrame.cpp:
  25816. (JSC::DebuggerCallFrame::evaluate): Removed globalThisValue
  25817. argument for ExecState constructor.
  25818. * kjs/ExecState.cpp:
  25819. (JSC::ExecState::ExecState): Removed globalThisValue and
  25820. registerFile arguments to constructors.
  25821. * kjs/ExecState.h: Removed m_globalThisValue and
  25822. m_registerFile data members.
  25823. * kjs/JSGlobalObject.cpp:
  25824. (JSC::JSGlobalObject::init): Removed globalThisValue
  25825. argument for ExecState constructor.
  25826. * kjs/JSGlobalObject.h:
  25827. (JSC::JSGlobalObject::JSGlobalObject): Got rid of parameter
  25828. for the init function.
  25829. 2008-09-29 Geoffrey Garen <ggaren@apple.com>
  25830. Rubber-stamped by Cameron Zwarich.
  25831. Fixed https://bugs.webkit.org/show_bug.cgi?id=21225
  25832. Machine::retrieveLastCaller should check for a NULL codeBlock
  25833. In order to crash, you would need to call retrieveCaller in a situation
  25834. where you had two host call frames in a row in the register file. I
  25835. don't know how to make that happen, or if it's even possible, so I don't
  25836. have a test case -- but better safe than sorry!
  25837. * VM/Machine.cpp:
  25838. (JSC::Machine::retrieveLastCaller):
  25839. 2008-09-29 Geoffrey Garen <ggaren@apple.com>
  25840. Reviewed by Cameron Zwarich.
  25841. Store the callee ScopeChain, not the caller ScopeChain, in the call frame
  25842. header. Nix the "scopeChain" local variable and ExecState::m_scopeChain, and
  25843. access the callee ScopeChain through the call frame header instead.
  25844. Profit: call + return are simpler, because they don't have to update the
  25845. "scopeChain" local variable, or ExecState::m_scopeChain.
  25846. Because CTI keeps "r" in a register, reading the callee ScopeChain relative
  25847. to "r" can be very fast, in any cases we care to optimize.
  25848. 0% speedup on empty function call benchmark. (5.5% speedup in bytecode.)
  25849. 0% speedup on SunSpider. (7.5% speedup on controlflow-recursive.)
  25850. 2% speedup on SunSpider --v8.
  25851. 2% speedup on v8 benchmark.
  25852. * VM/CTI.cpp: Changed scope chain access to read the scope chain from
  25853. the call frame header. Sped up op_ret by changing it not to fuss with
  25854. the "scopeChain" local variable or ExecState::m_scopeChain.
  25855. * VM/CTI.h: Updated CTI trampolines not to take a ScopeChainNode*
  25856. argument, since that's stored in the call frame header now.
  25857. * VM/Machine.cpp: Access "scopeChain" and "codeBlock" through new helper
  25858. functions that read from the call frame header. Updated functions operating
  25859. on ExecState::m_callFrame to account for / take advantage of the fact that
  25860. Exec:m_callFrame is now never NULL.
  25861. Fixed a bug in op_construct, where it would use the caller's default
  25862. object prototype, rather than the callee's, when constructing a new object.
  25863. * VM/Machine.h: Made some helper functions available. Removed
  25864. ScopeChainNode* arguments to a lot of functions, since the ScopeChainNode*
  25865. is now stored in the call frame header.
  25866. * VM/RegisterFile.h: Renamed "CallerScopeChain" to "ScopeChain", since
  25867. that's what it is now.
  25868. * kjs/DebuggerCallFrame.cpp: Updated for change to ExecState signature.
  25869. * kjs/ExecState.cpp:
  25870. * kjs/ExecState.h: Nixed ExecState::m_callFrame, along with the unused
  25871. isGlobalObject function.
  25872. * kjs/JSGlobalObject.cpp:
  25873. * kjs/JSGlobalObject.h: Gave the global object a fake call frame in
  25874. which to store the global scope chain, since our code now assumes that
  25875. it can always read the scope chain out of the ExecState's call frame.
  25876. 2008-09-29 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  25877. Reviewed by Sam Weinig.
  25878. Remove the isActivationObject() virtual method on JSObject and use
  25879. StructureID information instead. This should be slightly faster, but
  25880. isActivationObject() is only used in assertions and unwinding the stack
  25881. for exceptions.
  25882. * VM/Machine.cpp:
  25883. (JSC::depth):
  25884. (JSC::Machine::unwindCallFrame):
  25885. (JSC::Machine::privateExecute):
  25886. (JSC::Machine::cti_op_ret_activation):
  25887. * kjs/JSActivation.cpp:
  25888. * kjs/JSActivation.h:
  25889. * kjs/JSObject.h:
  25890. 2008-09-29 Peter Gal <galpeter@inf.u-szeged.hu>
  25891. Reviewed and tweaked by Darin Adler.
  25892. Fix build for non-all-in-one platforms.
  25893. * kjs/StringPrototype.cpp: Added missing ASCIICType.h include.
  25894. 2008-09-29 Bradley T. Hughes <bradley.hughes@nokia.com>
  25895. Reviewed by Simon Hausmann.
  25896. Fix compilation with icpc
  25897. * wtf/HashSet.h:
  25898. (WTF::::find):
  25899. (WTF::::contains):
  25900. 2008-09-29 Thiago Macieira <thiago.macieira@nokia.com>
  25901. Reviewed by Simon Hausmann.
  25902. Changed copyright from Trolltech ASA to Nokia.
  25903. Nokia acquired Trolltech ASA, assets were transferred on September 26th 2008.
  25904. * wtf/qt/MainThreadQt.cpp:
  25905. 2008-09-29 Simon Hausmann <hausmann@webkit.org>
  25906. Reviewed by Lars Knoll.
  25907. Don't accidentially install libJavaScriptCore.a for the build inside
  25908. Qt.
  25909. * JavaScriptCore.pro:
  25910. 2008-09-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  25911. Reviewed by Maciej Stachowiak.
  25912. Bug 21200: Allow direct access to 'arguments' without using op_resolve
  25913. <https://bugs.webkit.org/show_bug.cgi?id=21200>
  25914. Allow fast access to the 'arguments' object by adding an extra slot to
  25915. the callframe to store it.
  25916. This is a 3.0% speedup on the V8 Raytrace benchmark.
  25917. * JavaScriptCore.exp:
  25918. * VM/CTI.cpp:
  25919. (JSC::CTI::privateCompileMainPass):
  25920. * VM/CodeBlock.cpp:
  25921. (JSC::CodeBlock::dump):
  25922. * VM/CodeGenerator.cpp:
  25923. (JSC::CodeGenerator::CodeGenerator):
  25924. (JSC::CodeGenerator::registerFor):
  25925. * VM/CodeGenerator.h:
  25926. (JSC::CodeGenerator::registerFor):
  25927. * VM/Machine.cpp:
  25928. (JSC::Machine::initializeCallFrame):
  25929. (JSC::Machine::dumpRegisters):
  25930. (JSC::Machine::privateExecute):
  25931. (JSC::Machine::retrieveArguments):
  25932. (JSC::Machine::cti_op_call_JSFunction):
  25933. (JSC::Machine::cti_op_create_arguments):
  25934. (JSC::Machine::cti_op_construct_JSConstruct):
  25935. * VM/Machine.h:
  25936. * VM/Opcode.h:
  25937. * VM/RegisterFile.h:
  25938. (JSC::RegisterFile::):
  25939. * kjs/JSActivation.cpp:
  25940. (JSC::JSActivation::mark):
  25941. (JSC::JSActivation::argumentsGetter):
  25942. * kjs/JSActivation.h:
  25943. (JSC::JSActivation::JSActivationData::JSActivationData):
  25944. * kjs/NodeInfo.h:
  25945. * kjs/Parser.cpp:
  25946. (JSC::Parser::didFinishParsing):
  25947. * kjs/Parser.h:
  25948. (JSC::Parser::parse):
  25949. * kjs/grammar.y:
  25950. * kjs/nodes.cpp:
  25951. (JSC::ScopeNode::ScopeNode):
  25952. (JSC::ProgramNode::ProgramNode):
  25953. (JSC::ProgramNode::create):
  25954. (JSC::EvalNode::EvalNode):
  25955. (JSC::EvalNode::create):
  25956. (JSC::FunctionBodyNode::FunctionBodyNode):
  25957. (JSC::FunctionBodyNode::create):
  25958. * kjs/nodes.h:
  25959. (JSC::ScopeNode::usesArguments):
  25960. 2008-09-28 Mark Rowe <mrowe@apple.com>
  25961. Reviewed by Sam Weinig.
  25962. Add an ASCII fast-path to toLowerCase and toUpperCase.
  25963. The fast path speeds up the common case of an ASCII-only string by up to 60% while adding a less than 5% penalty
  25964. to the less common non-ASCII case.
  25965. This also removes stringProtoFuncToLocaleLowerCase and stringProtoFuncToLocaleUpperCase, which were identical
  25966. to the non-locale variants of the functions. toLocaleLowerCase and toLocaleUpperCase now use the non-locale
  25967. variants of the functions directly.
  25968. * kjs/StringPrototype.cpp:
  25969. (JSC::stringProtoFuncToLowerCase):
  25970. (JSC::stringProtoFuncToUpperCase):
  25971. 2008-09-28 Mark Rowe <mrowe@apple.com>
  25972. Reviewed by Cameron Zwarich.
  25973. Speed up parseInt and parseFloat.
  25974. Repeatedly indexing into a UString is slow, so retrieve a pointer into the underlying buffer once up front
  25975. and use that instead. This is a 7% win on a parseInt/parseFloat micro-benchmark.
  25976. * kjs/JSGlobalObjectFunctions.cpp:
  25977. (JSC::parseInt):
  25978. (JSC::parseFloat):
  25979. 2008-09-28 Simon Hausmann <hausmann@webkit.org>
  25980. Reviewed by David Hyatt.
  25981. In Qt's initializeThreading re-use an existing thread identifier for the main
  25982. thread if it exists.
  25983. currentThread() implicitly creates new identifiers and it could be that
  25984. it is called before initializeThreading().
  25985. * wtf/ThreadingQt.cpp:
  25986. (WTF::initializeThreading):
  25987. 2008-09-27 Keishi Hattori <casey.hattori@gmail.com>
  25988. Added Machine::retrieveCaller to the export list.
  25989. Reviewed by Kevin McCullough and Tim Hatcher.
  25990. * JavaScriptCore.exp: Added Machine::retrieveCaller.
  25991. 2008-09-27 Anders Carlsson <andersca@apple.com>
  25992. Fix build.
  25993. * VM/CTI.cpp:
  25994. (JSC::):
  25995. 2008-09-27 Geoffrey Garen <ggaren@apple.com>
  25996. Reviewed by Cameron Zwarich.
  25997. https://bugs.webkit.org/show_bug.cgi?id=21175
  25998. Store the callee CodeBlock, not the caller CodeBlock, in the call frame
  25999. header. Nix the "codeBlock" local variable, and access the callee
  26000. CodeBlock through the call frame header instead.
  26001. Profit: call + return are simpler, because they don't have to update the
  26002. "codeBlock" local variable.
  26003. Because CTI keeps "r" in a register, reading the callee CodeBlock relative
  26004. to "r" can be very fast, in any cases we care to optimize. Presently,
  26005. no such cases seem important.
  26006. Also, stop writing "dst" to the call frame header. CTI doesn't use it.
  26007. 21.6% speedup on empty function call benchmark.
  26008. 3.8% speedup on SunSpider --v8.
  26009. 2.1% speedup on v8 benchmark.
  26010. 0.7% speedup on SunSpider (6% speedup on controlflow-recursive).
  26011. Small regression in bytecode, because currently every op_ret reads the
  26012. callee CodeBlock to check needsFullScopeChain, and bytecode does not
  26013. keep "r" in a register. On-balance, this is probably OK, since CTI is
  26014. our high-performance execution model. Also, this should go away once
  26015. we make needsFullScopeChain statically determinable at parse time.
  26016. * VM/CTI.cpp:
  26017. (JSC::CTI::compileOpCall): The speedup!
  26018. (JSC::CTI::privateCompileSlowCases): ditto
  26019. * VM/CTI.h:
  26020. (JSC::): Fixed up magic trampoline constants to account for the nixed
  26021. "codeBlock" argument.
  26022. (JSC::CTI::execute): Changed trampoline function not to take a "codeBlock"
  26023. argument, since codeBlock is now stored in the call frame header.
  26024. * VM/Machine.cpp: Read the callee CodeBlock from the register file. Use
  26025. a NULL CallerRegisters in the call frame header to signal a built-in
  26026. caller, since CodeBlock is now never NULL.
  26027. * VM/Machine.h: Made some stand-alone functions Machine member functions
  26028. so they could call the private codeBlock() accessor in the Register
  26029. class, of which Machine is a friend. Renamed "CallerCodeBlock" to
  26030. "CodeBlock", since it's no longer the caller's CodeBlock.
  26031. * VM/RegisterFile.h: Marked some methods const to accommodate a
  26032. const RegisterFile* being passed around in Machine.cpp.
  26033. 2008-09-26 Jan Michael Alonzo <jmalonzo@webkit.org>
  26034. Gtk build fix. Not reviewed.
  26035. Narrow-down the target of the JavaScriptCore .lut.h generator so
  26036. it won't try to create the WebCore .lut.hs.
  26037. * GNUmakefile.am:
  26038. 2008-09-26 Matt Lilek <webkit@mattlilek.com>
  26039. Reviewed by Tim Hatcher.
  26040. Update FEATURE_DEFINES after ENABLE_CROSS_DOCUMENT_MESSAGING was removed.
  26041. * Configurations/JavaScriptCore.xcconfig:
  26042. 2008-09-26 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  26043. Rubber-stamped by Anders Carlson.
  26044. Change the name 'sc' to 'scopeChainNode' in a few places.
  26045. * kjs/nodes.cpp:
  26046. (JSC::EvalNode::generateCode):
  26047. (JSC::FunctionBodyNode::generateCode):
  26048. (JSC::ProgramNode::generateCode):
  26049. 2008-09-26 Sam Weinig <sam@webkit.org>
  26050. Reviewed by Darin Adler.
  26051. Patch for https://bugs.webkit.org/show_bug.cgi?id=21152
  26052. Speedup static property get/put
  26053. Convert getting/setting static property values to use static functions
  26054. instead of storing an integer and switching in getValueProperty/putValueProperty.
  26055. * kjs/JSObject.cpp:
  26056. (JSC::JSObject::deleteProperty):
  26057. (JSC::JSObject::getPropertyAttributes):
  26058. * kjs/MathObject.cpp:
  26059. (JSC::MathObject::getOwnPropertySlot):
  26060. * kjs/NumberConstructor.cpp:
  26061. (JSC::numberConstructorNaNValue):
  26062. (JSC::numberConstructorNegInfinity):
  26063. (JSC::numberConstructorPosInfinity):
  26064. (JSC::numberConstructorMaxValue):
  26065. (JSC::numberConstructorMinValue):
  26066. * kjs/PropertySlot.h:
  26067. (JSC::PropertySlot::):
  26068. * kjs/RegExpConstructor.cpp:
  26069. (JSC::regExpConstructorDollar1):
  26070. (JSC::regExpConstructorDollar2):
  26071. (JSC::regExpConstructorDollar3):
  26072. (JSC::regExpConstructorDollar4):
  26073. (JSC::regExpConstructorDollar5):
  26074. (JSC::regExpConstructorDollar6):
  26075. (JSC::regExpConstructorDollar7):
  26076. (JSC::regExpConstructorDollar8):
  26077. (JSC::regExpConstructorDollar9):
  26078. (JSC::regExpConstructorInput):
  26079. (JSC::regExpConstructorMultiline):
  26080. (JSC::regExpConstructorLastMatch):
  26081. (JSC::regExpConstructorLastParen):
  26082. (JSC::regExpConstructorLeftContext):
  26083. (JSC::regExpConstructorRightContext):
  26084. (JSC::setRegExpConstructorInput):
  26085. (JSC::setRegExpConstructorMultiline):
  26086. (JSC::RegExpConstructor::setInput):
  26087. (JSC::RegExpConstructor::setMultiline):
  26088. (JSC::RegExpConstructor::multiline):
  26089. * kjs/RegExpConstructor.h:
  26090. * kjs/RegExpObject.cpp:
  26091. (JSC::regExpObjectGlobal):
  26092. (JSC::regExpObjectIgnoreCase):
  26093. (JSC::regExpObjectMultiline):
  26094. (JSC::regExpObjectSource):
  26095. (JSC::regExpObjectLastIndex):
  26096. (JSC::setRegExpObjectLastIndex):
  26097. * kjs/RegExpObject.h:
  26098. (JSC::RegExpObject::setLastIndex):
  26099. (JSC::RegExpObject::lastIndex):
  26100. (JSC::RegExpObject::RegExpObjectData::RegExpObjectData):
  26101. * kjs/StructureID.cpp:
  26102. (JSC::StructureID::getEnumerablePropertyNames):
  26103. * kjs/create_hash_table:
  26104. * kjs/lexer.cpp:
  26105. (JSC::Lexer::lex):
  26106. * kjs/lookup.cpp:
  26107. (JSC::HashTable::createTable):
  26108. (JSC::HashTable::deleteTable):
  26109. (JSC::setUpStaticFunctionSlot):
  26110. * kjs/lookup.h:
  26111. (JSC::HashEntry::initialize):
  26112. (JSC::HashEntry::setKey):
  26113. (JSC::HashEntry::key):
  26114. (JSC::HashEntry::attributes):
  26115. (JSC::HashEntry::function):
  26116. (JSC::HashEntry::functionLength):
  26117. (JSC::HashEntry::propertyGetter):
  26118. (JSC::HashEntry::propertyPutter):
  26119. (JSC::HashEntry::lexerValue):
  26120. (JSC::HashEntry::):
  26121. (JSC::HashTable::entry):
  26122. (JSC::getStaticPropertySlot):
  26123. (JSC::getStaticValueSlot):
  26124. (JSC::lookupPut):
  26125. 2008-09-26 Gavin Barraclough <barraclough@apple.com>
  26126. Reviewed by Maciej Stachowiak & Oliver Hunt.
  26127. Add support for reusing temporary JSNumberCells. This change is based on the observation
  26128. that if the result of certain operations is a JSNumberCell and is consumed by a subsequent
  26129. operation that would produce a JSNumberCell, we can reuse the object rather than allocating
  26130. a fresh one. E.g. given the expression ((a * b) * c), we can statically determine that
  26131. (a * b) will have a numeric result (or else it will have thrown an exception), so the result
  26132. will either be a JSNumberCell or a JSImmediate.
  26133. This patch changes three areas of JSC:
  26134. * The AST now tracks type information about the result of each node.
  26135. * This information is consumed in bytecode compilation, and certain bytecode operations
  26136. now carry the statically determined type information about their operands.
  26137. * CTI uses the information in a number of fashions:
  26138. * Where an operand to certain arithmetic operations is reusable, it will plant code
  26139. to try to perform the operation in JIT code & reuse the cell, where appropriate.
  26140. * Where it can be statically determined that an operand can only be numeric (typically
  26141. the result of another arithmetic operation) the code will not redundantly check that
  26142. the JSCell is a JSNumberCell.
  26143. * Where either of the operands to an add are non-numeric do not plant an optimized
  26144. arithmetic code path, just call straight out to the C function.
  26145. +6% Sunspider (10% progression on 3D, 16% progression on math, 60% progression on access-nbody),
  26146. +1% v8-tests (improvements in raytrace & crypto)
  26147. * VM/CTI.cpp: Add optimized code generation with reuse of temporary JSNumberCells.
  26148. * VM/CTI.h:
  26149. * kjs/JSNumberCell.h:
  26150. * masm/X86Assembler.h:
  26151. * VM/CodeBlock.cpp: Add type information to specific bytecodes.
  26152. * VM/CodeGenerator.cpp:
  26153. * VM/CodeGenerator.h:
  26154. * VM/Machine.cpp:
  26155. * kjs/nodes.cpp: Track static type information for nodes.
  26156. * kjs/nodes.h:
  26157. * kjs/ResultDescriptor.h: (Added)
  26158. * JavaScriptCore.xcodeproj/project.pbxproj:
  26159. 2008-09-26 Yichao Yin <yichao.yin@torchmobile.com.cn>
  26160. Reviewed by George Staikos, Maciej Stachowiak.
  26161. Add utility functions needed for upcoming WML code.
  26162. * wtf/ASCIICType.h:
  26163. (WTF::isASCIIPrintable):
  26164. 2008-09-26 Geoffrey Garen <ggaren@apple.com>
  26165. Reviewed by Darin Adler.
  26166. Reverted the part of r36614 that used static data because static data
  26167. is not thread-safe.
  26168. 2008-09-26 Geoffrey Garen <ggaren@apple.com>
  26169. Reviewed by Maciej Stachowiak.
  26170. Removed dynamic check for whether the callee needs an activation object.
  26171. Replaced with callee code to create the activation object.
  26172. 0.5% speedup on SunSpider.
  26173. No change on v8 benchmark. (Might be a speedup, but it's in range of the
  26174. variance.)
  26175. 0.7% speedup on v8 benchmark in bytecode.
  26176. 1.3% speedup on empty call benchmark in bytecode.
  26177. * VM/CTI.cpp:
  26178. (JSC::CTI::privateCompileMainPass): Added support for op_init_activation,
  26179. the new opcode that specifies that the callee's initialization should
  26180. create an activation object.
  26181. (JSC::CTI::privateCompile): Removed previous code that did a similar
  26182. thing in an ad-hoc way.
  26183. * VM/CodeBlock.cpp:
  26184. (JSC::CodeBlock::dump): Added a case for dumping op_init_activation.
  26185. * VM/CodeGenerator.cpp:
  26186. (JSC::CodeGenerator::generate): Added fixup code to change op_init to
  26187. op_init_activation if necessary. (With a better parser, we would know
  26188. which to use from the beginning.)
  26189. * VM/Instruction.h:
  26190. (JSC::Instruction::Instruction):
  26191. (WTF::): Faster traits for the instruction vector. An earlier version
  26192. of this patch relied on inserting at the beginning of the vector, and
  26193. depended on this change for speed.
  26194. * VM/Machine.cpp:
  26195. (JSC::Machine::execute): Removed clients of setScopeChain, the old
  26196. abstraction for dynamically checking for whether an activation object
  26197. needed to be created.
  26198. (JSC::Machine::privateExecute): ditto
  26199. (JSC::Machine::cti_op_push_activation): Renamed this function from
  26200. cti_vm_updateScopeChain, and made it faster by removing the call to
  26201. setScopeChain.
  26202. * VM/Machine.h:
  26203. * VM/Opcode.h: Declared op_init_activation.
  26204. 2008-09-24 Geoffrey Garen <ggaren@apple.com>
  26205. Reviewed by Maciej Stachowiak.
  26206. Move most of the return code back into the callee, now that the callee
  26207. doesn't have to calculate anything dynamically.
  26208. 11.5% speedup on empty function call benchmark.
  26209. SunSpider says 0.3% faster. SunSpider --v8 says no change.
  26210. * VM/CTI.cpp:
  26211. (JSC::CTI::compileOpCall):
  26212. (JSC::CTI::privateCompileMainPass):
  26213. (JSC::CTI::privateCompileSlowCases):
  26214. 2008-09-24 Sam Weinig <sam@webkit.org>
  26215. Reviewed by Maciej Stachowiak.
  26216. Remove staticFunctionGetter. There is only one remaining user of
  26217. staticFunctionGetter and it can be converted to use setUpStaticFunctionSlot.
  26218. * JavaScriptCore.exp:
  26219. * kjs/lookup.cpp:
  26220. * kjs/lookup.h:
  26221. 2008-09-24 Maciej Stachowiak <mjs@apple.com>
  26222. Reviewed by Oliver Hunt.
  26223. - inline JIT fast case of op_neq
  26224. - remove extra level of function call indirection from slow cases of eq and neq
  26225. 1% speedup on Richards
  26226. * VM/CTI.cpp:
  26227. (JSC::CTI::privateCompileMainPass):
  26228. (JSC::CTI::privateCompileSlowCases):
  26229. * VM/Machine.cpp:
  26230. (JSC::Machine::privateExecute):
  26231. (JSC::Machine::cti_op_eq):
  26232. (JSC::Machine::cti_op_neq):
  26233. * kjs/operations.cpp:
  26234. (JSC::equal):
  26235. (JSC::equalSlowCase):
  26236. * kjs/operations.h:
  26237. (JSC::equalSlowCaseInline):
  26238. 2008-09-24 Sam Weinig <sam@webkit.org>
  26239. Reviewed by Darin Adler.
  26240. Fix for https://bugs.webkit.org/show_bug.cgi?id=21080
  26241. <rdar://problem/6243534>
  26242. Crash below Function.apply when using a runtime array as the argument list
  26243. Test: plugins/bindings-array-apply-crash.html
  26244. * kjs/FunctionPrototype.cpp:
  26245. (JSC::functionProtoFuncApply): Revert to the slow case if the object inherits from
  26246. JSArray (via ClassInfo) but is not a JSArray.
  26247. 2008-09-24 Kevin McCullough <kmccullough@apple.com>
  26248. Style change.
  26249. * kjs/nodes.cpp:
  26250. (JSC::statementListEmitCode):
  26251. 2008-09-24 Kevin McCullough <kmccullough@apple.com>
  26252. Reviewed by Geoff.
  26253. Bug 21031: Breakpoints in the condition of loops only breaks the first
  26254. time
  26255. - Now when setting breakpoints in the condition of a loop (for, while,
  26256. for in, and do while) will successfully break each time throught the
  26257. loop.
  26258. - For 'for' loops we need a little more complicated behavior that cannot
  26259. be accomplished without some more significant changes:
  26260. https://bugs.webkit.org/show_bug.cgi?id=21073
  26261. * kjs/nodes.cpp:
  26262. (JSC::statementListEmitCode): We don't want to blindly emit a debug hook
  26263. at the first line of loops, instead let the loop emit the debug hooks.
  26264. (JSC::DoWhileNode::emitCode):
  26265. (JSC::WhileNode::emitCode):
  26266. (JSC::ForNode::emitCode):
  26267. (JSC::ForInNode::emitCode):
  26268. * kjs/nodes.h:
  26269. (JSC::StatementNode::):
  26270. (JSC::DoWhileNode::):
  26271. (JSC::WhileNode::):
  26272. (JSC::ForInNode::):
  26273. 2008-09-24 Geoffrey Garen <ggaren@apple.com>
  26274. Reviewed by Darin Adler.
  26275. Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
  26276. the objects it retains
  26277. * API/tests/testapi.c: Test the new SPI a little.
  26278. * API/JSSPI.cpp: Add the new SPI.
  26279. * API/JSSPI.h: Add the new SPI.
  26280. * JavaScriptCore.exp: Add the new SPI.
  26281. * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
  26282. 2008-09-24 Geoffrey Garen <ggaren@apple.com>
  26283. Reviewed by Darin Adler.
  26284. * API/JSBase.h: Filled in some missing function names.
  26285. 2008-09-24 Geoffrey Garen <ggaren@apple.com>
  26286. Reviewed by Cameron Zwarich.
  26287. Fixed https://bugs.webkit.org/show_bug.cgi?id=21057
  26288. Crash in RegisterID::deref() running fast/canvas/canvas-putImageData.html
  26289. * VM/CodeGenerator.h: Changed declaration order to ensure the
  26290. m_lastConstant, which is a RefPtr that points into m_calleeRegisters,
  26291. has its destructor called before the destructor for m_calleeRegisters.
  26292. 2008-09-24 Darin Adler <darin@apple.com>
  26293. Reviewed by Sam Weinig.
  26294. - https://bugs.webkit.org/show_bug.cgi?id=21047
  26295. speed up ret_activation with inlining
  26296. About 1% on v8-raytrace.
  26297. * JavaScriptCore.exp: Removed JSVariableObject::setRegisters.
  26298. * kjs/JSActivation.cpp: Moved copyRegisters to the header to make it inline.
  26299. * kjs/JSActivation.h:
  26300. (JSC::JSActivation::copyRegisters): Moved here. Also removed the registerArraySize
  26301. argument to setRegisters, since the object doesn't need to store the number of
  26302. registers.
  26303. * kjs/JSGlobalObject.cpp:
  26304. (JSC::JSGlobalObject::reset): Removed unnecessary clearing left over from when we
  26305. used this on objects that weren't brand new. These days, this function is really
  26306. just part of the constructor.
  26307. * kjs/JSGlobalObject.h: Added registerArraySize to JSGlobalObjectData, since
  26308. JSVariableObjectData no longer needs it. Added a setRegisters override here
  26309. that handles storing the size.
  26310. * kjs/JSStaticScopeObject.h: Removed code to set registerArraySize, since it
  26311. no longer exists.
  26312. * kjs/JSVariableObject.cpp: Moved copyRegisterArray and setRegisters to the
  26313. header to make them inline.
  26314. * kjs/JSVariableObject.h: Removed registerArraySize from JSVariableObjectData,
  26315. since it was only used for the global object.
  26316. (JSC::JSVariableObject::copyRegisterArray): Moved here ot make it inline.
  26317. (JSC::JSVariableObject::setRegisters): Moved here to make it inline. Also
  26318. removed the code to set registerArraySize and changed an if statement into
  26319. an assert to save an unnnecessary branch.
  26320. 2008-09-24 Maciej Stachowiak <mjs@apple.com>
  26321. Reviewed by Oliver Hunt.
  26322. - inline PropertyMap::getOffset to speed up polymorphic lookups
  26323. ~1.5% speedup on v8 benchmark
  26324. no effect on SunSpider
  26325. * JavaScriptCore.exp:
  26326. * kjs/PropertyMap.cpp:
  26327. * kjs/PropertyMap.h:
  26328. (JSC::PropertyMap::getOffset):
  26329. 2008-09-24 Jan Michael Alonzo <jmalonzo@webkit.org>
  26330. Reviewed by Alp Toker.
  26331. https://bugs.webkit.org/show_bug.cgi?id=20992
  26332. Build fails on GTK+ Mac OS
  26333. * wtf/ThreadingGtk.cpp: Remove platform ifdef as suggested by
  26334. Richard Hult.
  26335. (WTF::initializeThreading):
  26336. 2008-09-23 Oliver Hunt <oliver@apple.com>
  26337. Reviewed by Maciej Stachowiak.
  26338. Bug 19968: Slow Script at www.huffingtonpost.com
  26339. <https://bugs.webkit.org/show_bug.cgi?id=19968>
  26340. Finally found the cause of this accursed issue. It is triggered
  26341. by synchronous creation of a new global object from JS. The new
  26342. global object resets the timer state in this execution group's
  26343. Machine, taking timerCheckCount to 0. Then when JS returns the
  26344. timerCheckCount is decremented making it non-zero. The next time
  26345. we execute JS we will start the timeout counter, however the non-zero
  26346. timeoutCheckCount means we don't reset the timer information. This
  26347. means that the timeout check is now checking the cumulative time
  26348. since the creation of the global object rather than the time since
  26349. JS was last entered. At this point the slow script dialog is guaranteed
  26350. to eventually be displayed incorrectly unless a page is loaded
  26351. asynchronously (which will reset everything into a sane state).
  26352. The fix for this is rather trivial -- the JSGlobalObject constructor
  26353. should not be resetting the machine timer state.
  26354. * VM/Machine.cpp:
  26355. (JSC::Machine::Machine):
  26356. Now that we can't rely on the GlobalObject initialising the timeout
  26357. state, we do it in the Machine constructor.
  26358. * VM/Machine.h:
  26359. (JSC::Machine::stopTimeoutCheck):
  26360. Add assertions to guard against this happening.
  26361. * kjs/JSGlobalObject.cpp:
  26362. (JSC::JSGlobalObject::init):
  26363. Don't reset the timeout state.
  26364. 2008-09-23 Geoffrey Garen <ggaren@apple.com>
  26365. Reviewed by Oliver Hunt.
  26366. Fixed https://bugs.webkit.org/show_bug.cgi?id=21038 | <rdar://problem/6240812>
  26367. Uncaught exceptions in regex replace callbacks crash webkit
  26368. This was a combination of two problems:
  26369. (1) the replace function would continue execution after an exception
  26370. had been thrown.
  26371. (2) In some cases, the Machine would return 0 in the case of an exception,
  26372. despite the fact that a few clients dereference the Machine's return
  26373. value without first checking for an exception.
  26374. * VM/Machine.cpp:
  26375. (JSC::Machine::execute):
  26376. ^ Return jsNull() instead of 0 in the case of an exception, since some
  26377. clients depend on using our return value.
  26378. ^ ASSERT that execution does not continue after an exception has been
  26379. thrown, to help catch problems like this in the future.
  26380. * kjs/StringPrototype.cpp:
  26381. (JSC::stringProtoFuncReplace):
  26382. ^ Stop execution if an exception has been thrown.
  26383. 2008-09-23 Geoffrey Garen <ggaren@apple.com>
  26384. Try to fix the windows build.
  26385. * VM/CTI.cpp:
  26386. (JSC::CTI::compileOpCall):
  26387. (JSC::CTI::privateCompileMainPass):
  26388. 2008-09-23 Alp Toker <alp@nuanti.com>
  26389. Build fix.
  26390. * VM/CTI.h:
  26391. 2008-09-23 Geoffrey Garen <ggaren@apple.com>
  26392. Reviewed by Darin Adler.
  26393. * wtf/Platform.h: Removed duplicate #if.
  26394. 2008-09-23 Geoffrey Garen <ggaren@apple.com>
  26395. Reviewed by Darin Adler.
  26396. Changed the layout of the call frame from
  26397. { header, parameters, locals | constants, temporaries }
  26398. to
  26399. { parameters, header | locals, constants, temporaries }
  26400. This simplifies function entry+exit, and enables a number of future
  26401. optimizations.
  26402. 13.5% speedup on empty call benchmark for bytecode; 23.6% speedup on
  26403. empty call benchmark for CTI.
  26404. SunSpider says no change. SunSpider --v8 says 1% faster.
  26405. * VM/CTI.cpp:
  26406. Added a bit of abstraction for calculating whether a register is a
  26407. constant, since this patch changes that calculation:
  26408. (JSC::CTI::isConstant):
  26409. (JSC::CTI::getConstant):
  26410. (JSC::CTI::emitGetArg):
  26411. (JSC::CTI::emitGetPutArg):
  26412. (JSC::CTI::getConstantImmediateNumericArg):
  26413. Updated for changes to callframe header location:
  26414. (JSC::CTI::emitPutToCallFrameHeader):
  26415. (JSC::CTI::emitGetFromCallFrameHeader):
  26416. (JSC::CTI::printOpcodeOperandTypes):
  26417. Renamed to spite Oliver:
  26418. (JSC::CTI::emitInitRegister):
  26419. Added an abstraction for emitting a call through a register, so that
  26420. calls through registers generate exception info, too:
  26421. (JSC::CTI::emitCall):
  26422. Updated to match the new callframe header layout, and to support calls
  26423. through registers, which have no destination address:
  26424. (JSC::CTI::compileOpCall):
  26425. (JSC::CTI::privateCompileMainPass):
  26426. (JSC::CTI::privateCompileSlowCases):
  26427. (JSC::CTI::privateCompile):
  26428. * VM/CTI.h:
  26429. More of the above:
  26430. (JSC::CallRecord::CallRecord):
  26431. * VM/CodeBlock.cpp:
  26432. Updated for new register layout:
  26433. (JSC::registerName):
  26434. (JSC::CodeBlock::dump):
  26435. * VM/CodeBlock.h:
  26436. Updated CodeBlock to track slightly different information about the
  26437. register frame, and tweaked the style of an ASSERT_NOT_REACHED.
  26438. (JSC::CodeBlock::CodeBlock):
  26439. (JSC::CodeBlock::getStubInfo):
  26440. * VM/CodeGenerator.cpp:
  26441. Added some abstraction around constant register allocation, since this
  26442. patch changes it, changed codegen to account for the new callframe
  26443. layout, and added abstraction around register fetching code
  26444. that used to assume that all local registers lived at negative indices,
  26445. since vars now live at positive indices:
  26446. (JSC::CodeGenerator::generate):
  26447. (JSC::CodeGenerator::addVar):
  26448. (JSC::CodeGenerator::addGlobalVar):
  26449. (JSC::CodeGenerator::allocateConstants):
  26450. (JSC::CodeGenerator::CodeGenerator):
  26451. (JSC::CodeGenerator::addParameter):
  26452. (JSC::CodeGenerator::registerFor):
  26453. (JSC::CodeGenerator::constRegisterFor):
  26454. (JSC::CodeGenerator::newRegister):
  26455. (JSC::CodeGenerator::newTemporary):
  26456. (JSC::CodeGenerator::highestUsedRegister):
  26457. (JSC::CodeGenerator::addConstant):
  26458. ASSERT that our caller referenced the registers it passed to us.
  26459. Otherwise, we might overwrite them with parameters:
  26460. (JSC::CodeGenerator::emitCall):
  26461. (JSC::CodeGenerator::emitConstruct):
  26462. * VM/CodeGenerator.h:
  26463. Added some abstraction for getting a RegisterID for a given index,
  26464. since the rules are a little weird:
  26465. (JSC::CodeGenerator::registerFor):
  26466. * VM/Machine.cpp:
  26467. Utility function to transform a machine return PC to a virtual machine
  26468. return VPC, for the sake of stack unwinding, since both PCs are stored
  26469. in the same location now:
  26470. (JSC::vPCForPC):
  26471. Tweaked to account for new call frame:
  26472. (JSC::Machine::initializeCallFrame):
  26473. Tweaked to account for registerOffset supplied by caller:
  26474. (JSC::slideRegisterWindowForCall):
  26475. Tweaked to account for new register layout:
  26476. (JSC::scopeChainForCall):
  26477. (JSC::Machine::callEval):
  26478. (JSC::Machine::dumpRegisters):
  26479. (JSC::Machine::unwindCallFrame):
  26480. (JSC::Machine::execute):
  26481. Changed op_call and op_construct to implement the new calling convention:
  26482. (JSC::Machine::privateExecute):
  26483. Tweaked to account for the new register layout:
  26484. (JSC::Machine::retrieveArguments):
  26485. (JSC::Machine::retrieveCaller):
  26486. (JSC::Machine::retrieveLastCaller):
  26487. (JSC::Machine::callFrame):
  26488. (JSC::Machine::getArgumentsData):
  26489. Changed CTI call helpers to implement the new calling convention:
  26490. (JSC::Machine::cti_op_call_JSFunction):
  26491. (JSC::Machine::cti_op_call_NotJSFunction):
  26492. (JSC::Machine::cti_op_ret_activation):
  26493. (JSC::Machine::cti_op_ret_profiler):
  26494. (JSC::Machine::cti_op_construct_JSConstruct):
  26495. (JSC::Machine::cti_op_construct_NotJSConstruct):
  26496. (JSC::Machine::cti_op_call_eval):
  26497. * VM/Machine.h:
  26498. * VM/Opcode.h:
  26499. Renamed op_initialise_locals to op_init, because this opcode
  26500. doesn't initialize all locals, and it doesn't initialize only locals.
  26501. Also, to spite Oliver.
  26502. * VM/RegisterFile.h:
  26503. New call frame enumeration values:
  26504. (JSC::RegisterFile::):
  26505. Simplified the calculation of whether a RegisterID is a temporary,
  26506. since we can no longer assume that all positive non-constant registers
  26507. are temporaries:
  26508. * VM/RegisterID.h:
  26509. (JSC::RegisterID::RegisterID):
  26510. (JSC::RegisterID::setTemporary):
  26511. (JSC::RegisterID::isTemporary):
  26512. Renamed firstArgumentIndex to firstParameterIndex because the assumption
  26513. that this variable pertained to the actual arguments supplied by the
  26514. caller caused me to write some buggy code:
  26515. * kjs/Arguments.cpp:
  26516. (JSC::ArgumentsData::ArgumentsData):
  26517. (JSC::Arguments::Arguments):
  26518. (JSC::Arguments::fillArgList):
  26519. (JSC::Arguments::getOwnPropertySlot):
  26520. (JSC::Arguments::put):
  26521. Updated for new call frame layout:
  26522. * kjs/DebuggerCallFrame.cpp:
  26523. (JSC::DebuggerCallFrame::functionName):
  26524. (JSC::DebuggerCallFrame::type):
  26525. * kjs/DebuggerCallFrame.h:
  26526. Changed the activation object to account for the fact that a call frame
  26527. header now sits between parameters and local variables. This change
  26528. requires all variable objects to do their own marking, since they
  26529. now use their register storage differently:
  26530. * kjs/JSActivation.cpp:
  26531. (JSC::JSActivation::mark):
  26532. (JSC::JSActivation::copyRegisters):
  26533. (JSC::JSActivation::createArgumentsObject):
  26534. * kjs/JSActivation.h:
  26535. Updated global object to use the new interfaces required by the change
  26536. to JSActivation above:
  26537. * kjs/JSGlobalObject.cpp:
  26538. (JSC::JSGlobalObject::reset):
  26539. (JSC::JSGlobalObject::mark):
  26540. (JSC::JSGlobalObject::copyGlobalsFrom):
  26541. (JSC::JSGlobalObject::copyGlobalsTo):
  26542. * kjs/JSGlobalObject.h:
  26543. (JSC::JSGlobalObject::addStaticGlobals):
  26544. Updated static scope object to use the new interfaces required by the
  26545. change to JSActivation above:
  26546. * kjs/JSStaticScopeObject.cpp:
  26547. (JSC::JSStaticScopeObject::mark):
  26548. (JSC::JSStaticScopeObject::~JSStaticScopeObject):
  26549. * kjs/JSStaticScopeObject.h:
  26550. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  26551. (JSC::JSStaticScopeObject::d):
  26552. Updated variable object to use the new interfaces required by the
  26553. change to JSActivation above:
  26554. * kjs/JSVariableObject.cpp:
  26555. (JSC::JSVariableObject::copyRegisterArray):
  26556. (JSC::JSVariableObject::setRegisters):
  26557. * kjs/JSVariableObject.h:
  26558. Changed the bit twiddling in symbol table not to assume that all indices
  26559. are negative, since they can be positive now:
  26560. * kjs/SymbolTable.h:
  26561. (JSC::SymbolTableEntry::SymbolTableEntry):
  26562. (JSC::SymbolTableEntry::isNull):
  26563. (JSC::SymbolTableEntry::getIndex):
  26564. (JSC::SymbolTableEntry::getAttributes):
  26565. (JSC::SymbolTableEntry::setAttributes):
  26566. (JSC::SymbolTableEntry::isReadOnly):
  26567. (JSC::SymbolTableEntry::pack):
  26568. (JSC::SymbolTableEntry::isValidIndex):
  26569. Changed call and construct nodes to ref their functions and/or bases,
  26570. so that emitCall/emitConstruct doesn't overwrite them with parameters.
  26571. Also, updated for rename to registerFor:
  26572. * kjs/nodes.cpp:
  26573. (JSC::ResolveNode::emitCode):
  26574. (JSC::NewExprNode::emitCode):
  26575. (JSC::EvalFunctionCallNode::emitCode):
  26576. (JSC::FunctionCallValueNode::emitCode):
  26577. (JSC::FunctionCallResolveNode::emitCode):
  26578. (JSC::FunctionCallBracketNode::emitCode):
  26579. (JSC::FunctionCallDotNode::emitCode):
  26580. (JSC::PostfixResolveNode::emitCode):
  26581. (JSC::DeleteResolveNode::emitCode):
  26582. (JSC::TypeOfResolveNode::emitCode):
  26583. (JSC::PrefixResolveNode::emitCode):
  26584. (JSC::ReadModifyResolveNode::emitCode):
  26585. (JSC::AssignResolveNode::emitCode):
  26586. (JSC::ConstDeclNode::emitCodeSingle):
  26587. (JSC::ForInNode::emitCode):
  26588. Added abstraction for getting exception info out of a call through a
  26589. register:
  26590. * masm/X86Assembler.h:
  26591. (JSC::X86Assembler::emitCall):
  26592. Removed duplicate #if:
  26593. * wtf/Platform.h:
  26594. 2008-09-23 Kevin McCullough <kmccullough@apple.com>
  26595. Reviewed by Darin.
  26596. Bug 21030: The JS debugger breaks on the do of a do-while not the while
  26597. (where the conditional statement is)
  26598. https://bugs.webkit.org/show_bug.cgi?id=21030
  26599. Now the statementListEmitCode detects if a do-while node is being
  26600. emited and emits the debug hook on the last line instead of the first.
  26601. This change had no effect on sunspider.
  26602. * kjs/nodes.cpp:
  26603. (JSC::statementListEmitCode):
  26604. * kjs/nodes.h:
  26605. (JSC::StatementNode::isDoWhile):
  26606. (JSC::DoWhileNode::isDoWhile):
  26607. 2008-09-23 Maciej Stachowiak <mjs@apple.com>
  26608. Reviewed by Cameron Zwarich.
  26609. - inline the fast case of instanceof
  26610. https://bugs.webkit.org/show_bug.cgi?id=20818
  26611. ~2% speedup on EarleyBoyer test.
  26612. * VM/CTI.cpp:
  26613. (JSC::CTI::privateCompileMainPass):
  26614. (JSC::CTI::privateCompileSlowCases):
  26615. * VM/Machine.cpp:
  26616. (JSC::Machine::cti_op_instanceof):
  26617. 2008-09-23 Maciej Stachowiak <mjs@apple.com>
  26618. Reviewed by Cameron Zwarich.
  26619. - add forgotten slow case logic for !==
  26620. * VM/CTI.cpp:
  26621. (JSC::CTI::privateCompileSlowCases):
  26622. 2008-09-23 Maciej Stachowiak <mjs@apple.com>
  26623. Reviewed by Cameron Zwarich.
  26624. - inline the fast cases of !==, same as for ===
  26625. 2.9% speedup on EarleyBoyer benchmark
  26626. * VM/CTI.cpp:
  26627. (JSC::CTI::compileOpStrictEq): Factored stricteq codegen into this function,
  26628. and parameterized so it can do the reverse version as well.
  26629. (JSC::CTI::privateCompileMainPass): Use the above for stricteq and nstricteq.
  26630. * VM/CTI.h:
  26631. (JSC::CTI::): Declare above stuff.
  26632. * VM/Machine.cpp:
  26633. (JSC::Machine::cti_op_nstricteq): Removed fast cases, now handled inline.
  26634. 2008-09-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  26635. Reviewed by Oliver Hunt.
  26636. Bug 20989: Aguments constructor should put 'callee' and 'length' properties in a more efficient way
  26637. <https://bugs.webkit.org/show_bug.cgi?id=20989>
  26638. Make special cases for the 'callee' and 'length' properties in the
  26639. Arguments object.
  26640. This is somewhere between a 7.8% speedup and a 10% speedup on the V8
  26641. Raytrace benchmark, depending on whether it is run alone or with the
  26642. other V8 benchmarks.
  26643. * kjs/Arguments.cpp:
  26644. (JSC::ArgumentsData::ArgumentsData):
  26645. (JSC::Arguments::Arguments):
  26646. (JSC::Arguments::mark):
  26647. (JSC::Arguments::getOwnPropertySlot):
  26648. (JSC::Arguments::put):
  26649. (JSC::Arguments::deleteProperty):
  26650. 2008-09-23 Maciej Stachowiak <mjs@apple.com>
  26651. Reviewed by Darin.
  26652. - speed up instanceof some more
  26653. https://bugs.webkit.org/show_bug.cgi?id=20818
  26654. ~2% speedup on EarleyBoyer
  26655. The idea here is to record in the StructureID whether the class
  26656. needs a special hasInstance or if it can use the normal logic from
  26657. JSObject.
  26658. Based on this I inlined the real work directly into
  26659. cti_op_instanceof and put the fastest checks up front and the
  26660. error handling at the end (so it should be fairly straightforward
  26661. to split off the beginning to be inlined if desired).
  26662. I only did this for CTI, not the bytecode interpreter.
  26663. * API/JSCallbackObject.h:
  26664. (JSC::JSCallbackObject::createStructureID):
  26665. * ChangeLog:
  26666. * VM/Machine.cpp:
  26667. (JSC::Machine::cti_op_instanceof):
  26668. * kjs/JSImmediate.h:
  26669. (JSC::JSImmediate::isAnyImmediate):
  26670. * kjs/TypeInfo.h:
  26671. (JSC::TypeInfo::overridesHasInstance):
  26672. (JSC::TypeInfo::flags):
  26673. 2008-09-22 Darin Adler <darin@apple.com>
  26674. Reviewed by Sam Weinig.
  26675. - https://bugs.webkit.org/show_bug.cgi?id=21019
  26676. make FunctionBodyNode::ref/deref fast
  26677. Speeds up v8-raytrace by 7.2%.
  26678. * kjs/nodes.cpp:
  26679. (JSC::FunctionBodyNode::FunctionBodyNode): Initialize m_refCount to 0.
  26680. * kjs/nodes.h:
  26681. (JSC::FunctionBodyNode::ref): Call base class ref once, and thereafter use
  26682. m_refCount.
  26683. (JSC::FunctionBodyNode::deref): Ditto, but the deref side.
  26684. 2008-09-22 Darin Adler <darin@apple.com>
  26685. Pointed out by Sam Weinig.
  26686. * kjs/Arguments.cpp:
  26687. (JSC::Arguments::fillArgList): Fix bad copy and paste. Oops!
  26688. 2008-09-22 Darin Adler <darin@apple.com>
  26689. Reviewed by Cameron Zwarich.
  26690. - https://bugs.webkit.org/show_bug.cgi?id=20983
  26691. ArgumentsData should have some room to allocate some extra arguments inline
  26692. Speeds up v8-raytrace by 5%.
  26693. * kjs/Arguments.cpp:
  26694. (JSC::ArgumentsData::ArgumentsData): Use a fixed buffer if there are 4 or fewer
  26695. extra arguments.
  26696. (JSC::Arguments::Arguments): Use a fixed buffer if there are 4 or fewer
  26697. extra arguments.
  26698. (JSC::Arguments::~Arguments): Delete the buffer if necessary.
  26699. (JSC::Arguments::mark): Update since extraArguments are now Register.
  26700. (JSC::Arguments::fillArgList): Added special case for the only case that's
  26701. actually used in the practice, when there are no parameters. There are some
  26702. other special cases in there too, but that's the only one that matters.
  26703. (JSC::Arguments::getOwnPropertySlot): Updated to use setValueSlot since there's
  26704. no operation to get you at the JSValue* inside a Register as a "slot".
  26705. 2008-09-22 Sam Weinig <sam@webkit.org>
  26706. Reviewed by Maciej Stachowiak.
  26707. Patch for https://bugs.webkit.org/show_bug.cgi?id=21014
  26708. Speed up for..in by using StructureID to avoid calls to hasProperty
  26709. Speeds up fasta by 8%.
  26710. * VM/JSPropertyNameIterator.cpp:
  26711. (JSC::JSPropertyNameIterator::invalidate):
  26712. * VM/JSPropertyNameIterator.h:
  26713. (JSC::JSPropertyNameIterator::next):
  26714. * kjs/PropertyNameArray.h:
  26715. (JSC::PropertyNameArrayData::begin):
  26716. (JSC::PropertyNameArrayData::end):
  26717. (JSC::PropertyNameArrayData::setCachedStructureID):
  26718. (JSC::PropertyNameArrayData::cachedStructureID):
  26719. * kjs/StructureID.cpp:
  26720. (JSC::StructureID::getEnumerablePropertyNames):
  26721. (JSC::structureIDChainsAreEqual):
  26722. * kjs/StructureID.h:
  26723. 2008-09-22 Kelvin Sherlock <ksherlock@gmail.com>
  26724. Updated and tweaked by Sam Weinig.
  26725. Reviewed by Geoffrey Garen.
  26726. Bug 20020: Proposed enhancement to JavaScriptCore API
  26727. <https://bugs.webkit.org/show_bug.cgi?id=20020>
  26728. Add JSObjectMakeArray, JSObjectMakeDate, JSObjectMakeError, and JSObjectMakeRegExp
  26729. functions to create JavaScript Array, Date, Error, and RegExp objects, respectively.
  26730. * API/JSObjectRef.cpp: The functions
  26731. * API/JSObjectRef.h: Function prototype and documentation
  26732. * JavaScriptCore.exp: Added functions to exported function list
  26733. * API/tests/testapi.c: Added basic functionality tests.
  26734. * kjs/DateConstructor.cpp:
  26735. Replaced static JSObject* constructDate(ExecState* exec, JSObject*, const ArgList& args)
  26736. with JSObject* constructDate(ExecState* exec, const ArgList& args).
  26737. Added static JSObject* constructWithDateConstructor(ExecState* exec, JSObject*, const ArgList& args) function
  26738. * kjs/DateConstructor.h:
  26739. added prototype for JSObject* constructDate(ExecState* exec, const ArgList& args)
  26740. * kjs/ErrorConstructor.cpp:
  26741. removed static qualifier from ErrorInstance* constructError(ExecState* exec, const ArgList& args)
  26742. * kjs/ErrorConstructor.h:
  26743. added prototype for ErrorInstance* constructError(ExecState* exec, const ArgList& args)
  26744. * kjs/RegExpConstructor.cpp:
  26745. removed static qualifier from JSObject* constructRegExp(ExecState* exec, const ArgList& args)
  26746. * kjs/RegExpConstructor.h:
  26747. added prototype for JSObject* constructRegExp(ExecState* exec, const ArgList& args)
  26748. 2008-09-22 Matt Lilek <webkit@mattlilek.com>
  26749. Not reviewed, Windows build fix.
  26750. * kjs/Arguments.cpp:
  26751. * kjs/FunctionPrototype.cpp:
  26752. 2008-09-22 Sam Weinig <sam@webkit.org>
  26753. Reviewed by Darin Adler.
  26754. Patch for https://bugs.webkit.org/show_bug.cgi?id=20982
  26755. Speed up the apply method of functions by special-casing array and 'arguments' objects
  26756. 1% speedup on v8-raytrace.
  26757. Test: fast/js/function-apply.html
  26758. * kjs/Arguments.cpp:
  26759. (JSC::Arguments::fillArgList):
  26760. * kjs/Arguments.h:
  26761. * kjs/FunctionPrototype.cpp:
  26762. (JSC::functionProtoFuncApply):
  26763. * kjs/JSArray.cpp:
  26764. (JSC::JSArray::fillArgList):
  26765. * kjs/JSArray.h:
  26766. 2008-09-22 Darin Adler <darin@apple.com>
  26767. Reviewed by Sam Weinig.
  26768. - https://bugs.webkit.org/show_bug.cgi?id=20993
  26769. Array.push/pop need optimized cases for JSArray
  26770. 3% or so speedup on DeltaBlue benchmark.
  26771. * kjs/ArrayPrototype.cpp:
  26772. (JSC::arrayProtoFuncPop): Call JSArray::pop when appropriate.
  26773. (JSC::arrayProtoFuncPush): Call JSArray::push when appropriate.
  26774. * kjs/JSArray.cpp:
  26775. (JSC::JSArray::putSlowCase): Set m_fastAccessCutoff when appropriate, getting
  26776. us into the fast code path.
  26777. (JSC::JSArray::pop): Added.
  26778. (JSC::JSArray::push): Added.
  26779. * kjs/JSArray.h: Added push and pop.
  26780. * kjs/operations.cpp:
  26781. (JSC::throwOutOfMemoryError): Don't inline this. Helps us avoid PIC branches.
  26782. 2008-09-22 Maciej Stachowiak <mjs@apple.com>
  26783. Reviewed by Cameron Zwarich.
  26784. - speed up instanceof operator by replacing implementsHasInstance method with a TypeInfo flag
  26785. Partial work towards <https://bugs.webkit.org/show_bug.cgi?id=20818>
  26786. 2.2% speedup on EarleyBoyer benchmark.
  26787. * API/JSCallbackConstructor.cpp:
  26788. * API/JSCallbackConstructor.h:
  26789. (JSC::JSCallbackConstructor::createStructureID):
  26790. * API/JSCallbackFunction.cpp:
  26791. * API/JSCallbackFunction.h:
  26792. (JSC::JSCallbackFunction::createStructureID):
  26793. * API/JSCallbackObject.h:
  26794. (JSC::JSCallbackObject::createStructureID):
  26795. * API/JSCallbackObjectFunctions.h:
  26796. (JSC::::hasInstance):
  26797. * API/JSValueRef.cpp:
  26798. (JSValueIsInstanceOfConstructor):
  26799. * JavaScriptCore.exp:
  26800. * VM/Machine.cpp:
  26801. (JSC::Machine::privateExecute):
  26802. (JSC::Machine::cti_op_instanceof):
  26803. * kjs/InternalFunction.cpp:
  26804. * kjs/InternalFunction.h:
  26805. (JSC::InternalFunction::createStructureID):
  26806. * kjs/JSObject.cpp:
  26807. * kjs/JSObject.h:
  26808. * kjs/TypeInfo.h:
  26809. (JSC::TypeInfo::implementsHasInstance):
  26810. 2008-09-22 Maciej Stachowiak <mjs@apple.com>
  26811. Reviewed by Dave Hyatt.
  26812. Based on initial work by Darin Adler.
  26813. - replace masqueradesAsUndefined virtual method with a flag in TypeInfo
  26814. - use this to JIT inline code for eq_null and neq_null
  26815. https://bugs.webkit.org/show_bug.cgi?id=20823
  26816. 0.5% speedup on SunSpider
  26817. ~4% speedup on Richards benchmark
  26818. * VM/CTI.cpp:
  26819. (JSC::CTI::privateCompileMainPass):
  26820. * VM/Machine.cpp:
  26821. (JSC::jsTypeStringForValue):
  26822. (JSC::jsIsObjectType):
  26823. (JSC::Machine::privateExecute):
  26824. (JSC::Machine::cti_op_is_undefined):
  26825. * VM/Machine.h:
  26826. * kjs/JSCell.h:
  26827. * kjs/JSValue.h:
  26828. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  26829. (JSC::StringObjectThatMasqueradesAsUndefined::create):
  26830. (JSC::StringObjectThatMasqueradesAsUndefined::createStructureID):
  26831. * kjs/StructureID.h:
  26832. (JSC::StructureID::mutableTypeInfo):
  26833. * kjs/TypeInfo.h:
  26834. (JSC::TypeInfo::TypeInfo):
  26835. (JSC::TypeInfo::masqueradesAsUndefined):
  26836. * kjs/operations.cpp:
  26837. (JSC::equal):
  26838. * masm/X86Assembler.h:
  26839. (JSC::X86Assembler::):
  26840. (JSC::X86Assembler::setne_r):
  26841. (JSC::X86Assembler::setnz_r):
  26842. (JSC::X86Assembler::testl_i32m):
  26843. 2008-09-22 Tor Arne Vestbø <tavestbo@trolltech.com>
  26844. Reviewed by Simon.
  26845. Initialize QCoreApplication in kjs binary/Shell.cpp
  26846. This allows us to use QCoreApplication::instance() to
  26847. get the main thread in ThreadingQt.cpp
  26848. * kjs/Shell.cpp:
  26849. (main):
  26850. * wtf/ThreadingQt.cpp:
  26851. (WTF::initializeThreading):
  26852. 2008-09-21 Darin Adler <darin@apple.com>
  26853. - blind attempt to fix non-all-in-one builds
  26854. * kjs/JSGlobalObject.cpp: Added includes of Arguments.h and RegExpObject.h.
  26855. 2008-09-21 Darin Adler <darin@apple.com>
  26856. - fix debug build
  26857. * kjs/StructureID.cpp:
  26858. (JSC::StructureID::addPropertyTransition): Use typeInfo().type() instead of m_type.
  26859. (JSC::StructureID::createCachedPrototypeChain): Ditto.
  26860. 2008-09-21 Maciej Stachowiak <mjs@apple.com>
  26861. Reviewed by Darin Adler.
  26862. - introduce a TypeInfo class, for holding per-type (in the C++ class sense) date in StructureID
  26863. https://bugs.webkit.org/show_bug.cgi?id=20981
  26864. * JavaScriptCore.exp:
  26865. * JavaScriptCore.xcodeproj/project.pbxproj:
  26866. * VM/CTI.cpp:
  26867. (JSC::CTI::privateCompileMainPass):
  26868. (JSC::CTI::privateCompilePutByIdTransition):
  26869. * VM/Machine.cpp:
  26870. (JSC::jsIsObjectType):
  26871. (JSC::Machine::Machine):
  26872. * kjs/AllInOneFile.cpp:
  26873. * kjs/JSCell.h:
  26874. (JSC::JSCell::isObject):
  26875. (JSC::JSCell::isString):
  26876. * kjs/JSGlobalData.cpp:
  26877. (JSC::JSGlobalData::JSGlobalData):
  26878. * kjs/JSGlobalObject.cpp:
  26879. (JSC::JSGlobalObject::reset):
  26880. * kjs/JSGlobalObject.h:
  26881. (JSC::StructureID::prototypeForLookup):
  26882. * kjs/JSNumberCell.h:
  26883. (JSC::JSNumberCell::createStructureID):
  26884. * kjs/JSObject.cpp:
  26885. (JSC::JSObject::createInheritorID):
  26886. * kjs/JSObject.h:
  26887. (JSC::JSObject::createStructureID):
  26888. * kjs/JSString.h:
  26889. (JSC::JSString::createStructureID):
  26890. * kjs/NativeErrorConstructor.cpp:
  26891. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  26892. * kjs/RegExpConstructor.cpp:
  26893. * kjs/RegExpMatchesArray.h: Added.
  26894. (JSC::RegExpMatchesArray::getOwnPropertySlot):
  26895. (JSC::RegExpMatchesArray::put):
  26896. (JSC::RegExpMatchesArray::deleteProperty):
  26897. (JSC::RegExpMatchesArray::getPropertyNames):
  26898. * kjs/StructureID.cpp:
  26899. (JSC::StructureID::StructureID):
  26900. (JSC::StructureID::addPropertyTransition):
  26901. (JSC::StructureID::toDictionaryTransition):
  26902. (JSC::StructureID::changePrototypeTransition):
  26903. (JSC::StructureID::getterSetterTransition):
  26904. * kjs/StructureID.h:
  26905. (JSC::StructureID::create):
  26906. (JSC::StructureID::typeInfo):
  26907. * kjs/TypeInfo.h: Added.
  26908. (JSC::TypeInfo::TypeInfo):
  26909. (JSC::TypeInfo::type):
  26910. 2008-09-21 Darin Adler <darin@apple.com>
  26911. Reviewed by Cameron Zwarich.
  26912. - fix crash logging into Gmail due to recent Arguments change
  26913. * kjs/Arguments.cpp:
  26914. (JSC::Arguments::Arguments): Fix window where mark() function could
  26915. see d->extraArguments with uninitialized contents.
  26916. (JSC::Arguments::mark): Check d->extraArguments for 0 to handle two
  26917. cases: 1) Inside the constructor before it's initialized.
  26918. 2) numArguments <= numParameters.
  26919. 2008-09-21 Darin Adler <darin@apple.com>
  26920. - fix loose end from the "duplicate constant values" patch
  26921. * VM/CodeGenerator.cpp:
  26922. (JSC::CodeGenerator::emitLoad): Add a special case for values the
  26923. hash table can't handle.
  26924. 2008-09-21 Mark Rowe <mrowe@apple.com>
  26925. Fix the non-AllInOneFile build.
  26926. * kjs/Arguments.cpp: Add missing #include.
  26927. 2008-09-21 Darin Adler <darin@apple.com>
  26928. Reviewed by Cameron Zwarich and Mark Rowe.
  26929. - fix test failure caused by my recent IndexToNameMap patch
  26930. * kjs/Arguments.cpp:
  26931. (JSC::Arguments::deleteProperty): Added the accidentally-omitted
  26932. check of the boolean result from toArrayIndex.
  26933. 2008-09-21 Darin Adler <darin@apple.com>
  26934. Reviewed by Maciej Stachowiak.
  26935. - https://bugs.webkit.org/show_bug.cgi?id=20975
  26936. inline immediate-number case of ==
  26937. * VM/CTI.h: Renamed emitJumpSlowCaseIfNotImm to
  26938. emitJumpSlowCaseIfNotImmNum, since the old name was incorrect.
  26939. * VM/CTI.cpp: Updated for new name.
  26940. (JSC::CTI::privateCompileMainPass): Added op_eq.
  26941. (JSC::CTI::privateCompileSlowCases): Added op_eq.
  26942. * VM/Machine.cpp:
  26943. (JSC::Machine::cti_op_eq): Removed fast case, since it's now
  26944. compiled.
  26945. 2008-09-21 Peter Gal <galpter@inf.u-szeged.hu>
  26946. Reviewed by Tim Hatcher and Eric Seidel.
  26947. Fix the QT/Linux JavaScriptCore segmentation fault.
  26948. https://bugs.webkit.org/show_bug.cgi?id=20914
  26949. * wtf/ThreadingQt.cpp:
  26950. (WTF::initializeThreading): Use currentThread() if
  26951. platform is not a MAC (like in pre 36541 revisions)
  26952. 2008-09-21 Darin Adler <darin@apple.com>
  26953. Reviewed by Sam Weinig.
  26954. * kjs/debugger.h: Removed some unneeded includes and declarations.
  26955. 2008-09-21 Darin Adler <darin@apple.com>
  26956. Reviewed by Sam Weinig.
  26957. - https://bugs.webkit.org/show_bug.cgi?id=20972
  26958. speed up Arguments further by eliminating the IndexToNameMap
  26959. No change on SunSpider. 1.29x as fast on V8 Raytrace.
  26960. * kjs/Arguments.cpp: Moved ArgumentsData in here. Eliminated the
  26961. indexToNameMap and hadDeletes data members. Changed extraArguments into
  26962. an OwnArrayPtr and added deletedArguments, another OwnArrayPtr.
  26963. Replaced numExtraArguments with numParameters, since that's what's
  26964. used more directly in hot code paths.
  26965. (JSC::Arguments::Arguments): Pass in argument count instead of ArgList.
  26966. Initialize ArgumentsData the new way.
  26967. (JSC::Arguments::mark): Updated.
  26968. (JSC::Arguments::getOwnPropertySlot): Overload for the integer form so
  26969. we don't have to convert integers to identifiers just to get an argument.
  26970. Integrated the deleted case with the fast case.
  26971. (JSC::Arguments::put): Ditto.
  26972. (JSC::Arguments::deleteProperty): Ditto.
  26973. * kjs/Arguments.h: Minimized includes. Made everything private. Added
  26974. overloads for the integral property name case. Eliminated mappedIndexSetter.
  26975. Moved ArgumentsData into the .cpp file.
  26976. * kjs/IndexToNameMap.cpp: Emptied out and prepared for deletion.
  26977. * kjs/IndexToNameMap.h: Ditto.
  26978. * kjs/JSActivation.cpp:
  26979. (JSC::JSActivation::createArgumentsObject): Elminated ArgList.
  26980. * GNUmakefile.am:
  26981. * JavaScriptCore.pri:
  26982. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  26983. * JavaScriptCore.xcodeproj/project.pbxproj:
  26984. * JavaScriptCoreSources.bkl:
  26985. * kjs/AllInOneFile.cpp:
  26986. Removed IndexToNameMap.
  26987. 2008-09-21 Darin Adler <darin@apple.com>
  26988. * VM/CodeGenerator.cpp:
  26989. (JSC::CodeGenerator::emitLoad): One more tweak: Wrote this in a slightly
  26990. clearer style.
  26991. 2008-09-21 Judit Jasz <jasy@inf.u-szeged.hu>
  26992. Reviewed and tweaked by Darin Adler.
  26993. - https://bugs.webkit.org/show_bug.cgi?id=20645
  26994. Elminate duplicate constant values in CodeBlocks.
  26995. Seems to be a wash on SunSpider.
  26996. * VM/CodeGenerator.cpp:
  26997. (JSC::CodeGenerator::emitLoad): Use m_numberMap and m_stringMap to guarantee
  26998. we emit the same JSValue* for identical numbers and strings.
  26999. * VM/CodeGenerator.h: Added overload of emitLoad for const Identifier&.
  27000. Add NumberMap and IdentifierStringMap types and m_numberMap and m_stringMap.
  27001. * kjs/nodes.cpp:
  27002. (JSC::StringNode::emitCode): Call the new emitLoad and let it do the
  27003. JSString creation.
  27004. 2008-09-21 Paul Pedriana <webkit@pedriana.com>
  27005. Reviewed and tweaked by Darin Adler.
  27006. - https://bugs.webkit.org/show_bug.cgi?id=16925
  27007. Fixed lack of Vector buffer alignment for both GCC and MSVC.
  27008. Since there's no portable way to do this, for now we don't support
  27009. other compilers.
  27010. * wtf/Vector.h: Added WTF_ALIGH_ON, WTF_ALIGNED, AlignedBufferChar, and AlignedBuffer.
  27011. Use AlignedBuffer insteadof an array of char in VectorBuffer.
  27012. 2008-09-21 Gabor Loki <loki@inf.u-szeged.hu>
  27013. Reviewed by Darin Adler.
  27014. - https://bugs.webkit.org/show_bug.cgi?id=19408
  27015. Add lightweight constant folding to the parser for *, /, + (only for numbers), <<, >>, ~ operators.
  27016. 1.008x as fast on SunSpider.
  27017. * kjs/grammar.y:
  27018. (makeNegateNode): Fold if expression is a number > 0.
  27019. (makeBitwiseNotNode): Fold if expression is a number.
  27020. (makeMultNode): Fold if expressions are both numbers.
  27021. (makeDivNode): Fold if expressions are both numbers.
  27022. (makeAddNode): Fold if expressions are both numbers.
  27023. (makeLeftShiftNode): Fold if expressions are both numbers.
  27024. (makeRightShiftNode): Fold if expressions are both numbers.
  27025. 2008-09-21 Maciej Stachowiak <mjs@apple.com>
  27026. Reviewed by Oliver.
  27027. - speed up === operator by generating inline machine code for the fast paths
  27028. https://bugs.webkit.org/show_bug.cgi?id=20820
  27029. * VM/CTI.cpp:
  27030. (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumber):
  27031. (JSC::CTI::emitJumpSlowCaseIfNotImmediateNumbers):
  27032. (JSC::CTI::emitJumpSlowCaseIfNotImmediates):
  27033. (JSC::CTI::emitTagAsBoolImmediate):
  27034. (JSC::CTI::privateCompileMainPass):
  27035. (JSC::CTI::privateCompileSlowCases):
  27036. * VM/CTI.h:
  27037. * VM/Machine.cpp:
  27038. (JSC::Machine::cti_op_stricteq):
  27039. * masm/X86Assembler.h:
  27040. (JSC::X86Assembler::):
  27041. (JSC::X86Assembler::sete_r):
  27042. (JSC::X86Assembler::setz_r):
  27043. (JSC::X86Assembler::movzbl_rr):
  27044. (JSC::X86Assembler::emitUnlinkedJnz):
  27045. 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27046. Reviewed by Maciej Stachowiak.
  27047. Free memory allocated for extra arguments in the destructor of the
  27048. Arguments object.
  27049. * kjs/Arguments.cpp:
  27050. (JSC::Arguments::~Arguments):
  27051. * kjs/Arguments.h:
  27052. 2008-09-21 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27053. Reviewed by Maciej Stachowiak.
  27054. Bug 20815: 'arguments' object creation is non-optimal
  27055. <https://bugs.webkit.org/show_bug.cgi?id=20815>
  27056. Fix our inefficient way of creating the arguments object by only
  27057. creating named properties for each of the arguments after a use of the
  27058. 'delete' statement. This patch also speeds up access to the 'arguments'
  27059. object slightly, but it still does not use the array fast path for
  27060. indexed access that exists for many opcodes.
  27061. This is about a 20% improvement on the V8 Raytrace benchmark, and a 1.5%
  27062. improvement on the Earley-Boyer benchmark, which gives a 4% improvement
  27063. overall.
  27064. * kjs/Arguments.cpp:
  27065. (JSC::Arguments::Arguments):
  27066. (JSC::Arguments::mark):
  27067. (JSC::Arguments::getOwnPropertySlot):
  27068. (JSC::Arguments::put):
  27069. (JSC::Arguments::deleteProperty):
  27070. * kjs/Arguments.h:
  27071. (JSC::Arguments::ArgumentsData::ArgumentsData):
  27072. * kjs/IndexToNameMap.h:
  27073. (JSC::IndexToNameMap::size):
  27074. * kjs/JSActivation.cpp:
  27075. (JSC::JSActivation::createArgumentsObject):
  27076. * kjs/JSActivation.h:
  27077. (JSC::JSActivation::uncheckedSymbolTableGet):
  27078. (JSC::JSActivation::uncheckedSymbolTableGetValue):
  27079. (JSC::JSActivation::uncheckedSymbolTablePut):
  27080. * kjs/JSFunction.h:
  27081. (JSC::JSFunction::numParameters):
  27082. 2008-09-20 Darin Adler <darin@apple.com>
  27083. Reviewed by Mark Rowe.
  27084. - fix crash seen on buildbot
  27085. * kjs/JSGlobalObject.cpp:
  27086. (JSC::JSGlobalObject::mark): Add back mark of arrayPrototype,
  27087. deleted by accident in my recent check-in.
  27088. 2008-09-20 Maciej Stachowiak <mjs@apple.com>
  27089. Not reviewed, build fix.
  27090. - speculative fix for non-AllInOne builds
  27091. * kjs/operations.h:
  27092. 2008-09-20 Maciej Stachowiak <mjs@apple.com>
  27093. Reviewed by Darin Adler.
  27094. - assorted optimizations to === and !== operators
  27095. (work towards <https://bugs.webkit.org/show_bug.cgi?id=20820>)
  27096. 2.5% speedup on earley-boyer test
  27097. * VM/Machine.cpp:
  27098. (JSC::Machine::cti_op_stricteq): Use inline version of
  27099. strictEqualSlowCase; remove unneeded exception check.
  27100. (JSC::Machine::cti_op_nstricteq): ditto
  27101. * kjs/operations.cpp:
  27102. (JSC::strictEqual): Use strictEqualSlowCaseInline
  27103. (JSC::strictEqualSlowCase): ditto
  27104. * kjs/operations.h:
  27105. (JSC::strictEqualSlowCaseInline): Version of strictEqualSlowCase that can be inlined,
  27106. since the extra function call indirection is a lose for CTI.
  27107. 2008-09-20 Darin Adler <darin@apple.com>
  27108. Reviewed by Maciej Stachowiak.
  27109. - finish https://bugs.webkit.org/show_bug.cgi?id=20858
  27110. make each distinct C++ class get a distinct JSC::Structure
  27111. This also includes some optimizations that make the change an overall
  27112. small speedup. Without those it was a bit of a slowdown.
  27113. * API/JSCallbackConstructor.cpp:
  27114. (JSC::JSCallbackConstructor::JSCallbackConstructor): Take a structure.
  27115. * API/JSCallbackConstructor.h: Ditto.
  27116. * API/JSCallbackFunction.cpp:
  27117. (JSC::JSCallbackFunction::JSCallbackFunction): Pass a structure.
  27118. * API/JSCallbackObject.h: Take a structure.
  27119. * API/JSCallbackObjectFunctions.h:
  27120. (JSC::JSCallbackObject::JSCallbackObject): Ditto.
  27121. * API/JSClassRef.cpp:
  27122. (OpaqueJSClass::prototype): Pass in a structure. Call setPrototype
  27123. if there's a custom prototype involved.
  27124. * API/JSObjectRef.cpp:
  27125. (JSObjectMake): Ditto.
  27126. (JSObjectMakeConstructor): Pass in a structure.
  27127. * JavaScriptCore.exp: Updated.
  27128. * VM/Machine.cpp:
  27129. (JSC::jsLess): Added a special case for when both arguments are strings.
  27130. This avoids converting both strings to with UString::toDouble.
  27131. (JSC::jsLessEq): Ditto.
  27132. (JSC::Machine::privateExecute): Pass in a structure.
  27133. (JSC::Machine::cti_op_construct_JSConstruct): Ditto.
  27134. (JSC::Machine::cti_op_new_regexp): Ditto.
  27135. (JSC::Machine::cti_op_is_string): Ditto.
  27136. * VM/Machine.h: Made isJSString public so it can be used in the CTI.
  27137. * kjs/Arguments.cpp:
  27138. (JSC::Arguments::Arguments): Pass in a structure.
  27139. * kjs/JSCell.h: Mark constructor explicit.
  27140. * kjs/JSGlobalObject.cpp:
  27141. (JSC::markIfNeeded): Added an overload for marking structures.
  27142. (JSC::JSGlobalObject::reset): Eliminate code to set data members to
  27143. zero. We now do that in the constructor, and we no longer use this
  27144. anywhere except in the constructor. Added code to create structures.
  27145. Pass structures rather than prototypes when creating objects.
  27146. (JSC::JSGlobalObject::mark): Mark the structures.
  27147. * kjs/JSGlobalObject.h: Removed unneeded class declarations.
  27148. Added initializers for raw pointers in JSGlobalObjectData so
  27149. everything starts with a 0. Added structure data and accessor
  27150. functions.
  27151. * kjs/JSImmediate.cpp:
  27152. (JSC::JSImmediate::nonInlineNaN): Added.
  27153. * kjs/JSImmediate.h:
  27154. (JSC::JSImmediate::toDouble): Rewrote to avoid PIC branches.
  27155. * kjs/JSNumberCell.cpp:
  27156. (JSC::jsNumberCell): Made non-inline to avoid PIC branches
  27157. in functions that call this one.
  27158. (JSC::jsNaN): Ditto.
  27159. * kjs/JSNumberCell.h: Ditto.
  27160. * kjs/JSObject.h: Removed constructor that takes a prototype.
  27161. All callers now pass structures.
  27162. * kjs/ArrayConstructor.cpp:
  27163. (JSC::ArrayConstructor::ArrayConstructor):
  27164. (JSC::constructArrayWithSizeQuirk):
  27165. * kjs/ArrayConstructor.h:
  27166. * kjs/ArrayPrototype.cpp:
  27167. (JSC::ArrayPrototype::ArrayPrototype):
  27168. * kjs/ArrayPrototype.h:
  27169. * kjs/BooleanConstructor.cpp:
  27170. (JSC::BooleanConstructor::BooleanConstructor):
  27171. (JSC::constructBoolean):
  27172. (JSC::constructBooleanFromImmediateBoolean):
  27173. * kjs/BooleanConstructor.h:
  27174. * kjs/BooleanObject.cpp:
  27175. (JSC::BooleanObject::BooleanObject):
  27176. * kjs/BooleanObject.h:
  27177. * kjs/BooleanPrototype.cpp:
  27178. (JSC::BooleanPrototype::BooleanPrototype):
  27179. * kjs/BooleanPrototype.h:
  27180. * kjs/DateConstructor.cpp:
  27181. (JSC::DateConstructor::DateConstructor):
  27182. (JSC::constructDate):
  27183. * kjs/DateConstructor.h:
  27184. * kjs/DateInstance.cpp:
  27185. (JSC::DateInstance::DateInstance):
  27186. * kjs/DateInstance.h:
  27187. * kjs/DatePrototype.cpp:
  27188. (JSC::DatePrototype::DatePrototype):
  27189. * kjs/DatePrototype.h:
  27190. * kjs/ErrorConstructor.cpp:
  27191. (JSC::ErrorConstructor::ErrorConstructor):
  27192. (JSC::constructError):
  27193. * kjs/ErrorConstructor.h:
  27194. * kjs/ErrorInstance.cpp:
  27195. (JSC::ErrorInstance::ErrorInstance):
  27196. * kjs/ErrorInstance.h:
  27197. * kjs/ErrorPrototype.cpp:
  27198. (JSC::ErrorPrototype::ErrorPrototype):
  27199. * kjs/ErrorPrototype.h:
  27200. * kjs/FunctionConstructor.cpp:
  27201. (JSC::FunctionConstructor::FunctionConstructor):
  27202. * kjs/FunctionConstructor.h:
  27203. * kjs/FunctionPrototype.cpp:
  27204. (JSC::FunctionPrototype::FunctionPrototype):
  27205. (JSC::FunctionPrototype::addFunctionProperties):
  27206. * kjs/FunctionPrototype.h:
  27207. * kjs/GlobalEvalFunction.cpp:
  27208. (JSC::GlobalEvalFunction::GlobalEvalFunction):
  27209. * kjs/GlobalEvalFunction.h:
  27210. * kjs/InternalFunction.cpp:
  27211. (JSC::InternalFunction::InternalFunction):
  27212. * kjs/InternalFunction.h:
  27213. (JSC::InternalFunction::InternalFunction):
  27214. * kjs/JSArray.cpp:
  27215. (JSC::JSArray::JSArray):
  27216. (JSC::constructEmptyArray):
  27217. (JSC::constructArray):
  27218. * kjs/JSArray.h:
  27219. * kjs/JSFunction.cpp:
  27220. (JSC::JSFunction::JSFunction):
  27221. (JSC::JSFunction::construct):
  27222. * kjs/JSObject.cpp:
  27223. (JSC::constructEmptyObject):
  27224. * kjs/JSString.cpp:
  27225. (JSC::StringObject::create):
  27226. * kjs/JSWrapperObject.h:
  27227. * kjs/MathObject.cpp:
  27228. (JSC::MathObject::MathObject):
  27229. * kjs/MathObject.h:
  27230. * kjs/NativeErrorConstructor.cpp:
  27231. (JSC::NativeErrorConstructor::NativeErrorConstructor):
  27232. (JSC::NativeErrorConstructor::construct):
  27233. * kjs/NativeErrorConstructor.h:
  27234. * kjs/NativeErrorPrototype.cpp:
  27235. (JSC::NativeErrorPrototype::NativeErrorPrototype):
  27236. * kjs/NativeErrorPrototype.h:
  27237. * kjs/NumberConstructor.cpp:
  27238. (JSC::NumberConstructor::NumberConstructor):
  27239. (JSC::constructWithNumberConstructor):
  27240. * kjs/NumberConstructor.h:
  27241. * kjs/NumberObject.cpp:
  27242. (JSC::NumberObject::NumberObject):
  27243. (JSC::constructNumber):
  27244. (JSC::constructNumberFromImmediateNumber):
  27245. * kjs/NumberObject.h:
  27246. * kjs/NumberPrototype.cpp:
  27247. (JSC::NumberPrototype::NumberPrototype):
  27248. * kjs/NumberPrototype.h:
  27249. * kjs/ObjectConstructor.cpp:
  27250. (JSC::ObjectConstructor::ObjectConstructor):
  27251. (JSC::constructObject):
  27252. * kjs/ObjectConstructor.h:
  27253. * kjs/ObjectPrototype.cpp:
  27254. (JSC::ObjectPrototype::ObjectPrototype):
  27255. * kjs/ObjectPrototype.h:
  27256. * kjs/PrototypeFunction.cpp:
  27257. (JSC::PrototypeFunction::PrototypeFunction):
  27258. * kjs/PrototypeFunction.h:
  27259. * kjs/RegExpConstructor.cpp:
  27260. (JSC::RegExpConstructor::RegExpConstructor):
  27261. (JSC::RegExpMatchesArray::RegExpMatchesArray):
  27262. (JSC::constructRegExp):
  27263. * kjs/RegExpConstructor.h:
  27264. * kjs/RegExpObject.cpp:
  27265. (JSC::RegExpObject::RegExpObject):
  27266. * kjs/RegExpObject.h:
  27267. * kjs/RegExpPrototype.cpp:
  27268. (JSC::RegExpPrototype::RegExpPrototype):
  27269. * kjs/RegExpPrototype.h:
  27270. * kjs/Shell.cpp:
  27271. (GlobalObject::GlobalObject):
  27272. * kjs/StringConstructor.cpp:
  27273. (JSC::StringConstructor::StringConstructor):
  27274. (JSC::constructWithStringConstructor):
  27275. * kjs/StringConstructor.h:
  27276. * kjs/StringObject.cpp:
  27277. (JSC::StringObject::StringObject):
  27278. * kjs/StringObject.h:
  27279. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  27280. (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
  27281. * kjs/StringPrototype.cpp:
  27282. (JSC::StringPrototype::StringPrototype):
  27283. * kjs/StringPrototype.h:
  27284. Take and pass structures.
  27285. 2008-09-19 Alp Toker <alp@nuanti.com>
  27286. Build fix for the 'gold' linker and recent binutils. New behaviour
  27287. requires that we link to used libraries explicitly.
  27288. * GNUmakefile.am:
  27289. 2008-09-19 Sam Weinig <sam@webkit.org>
  27290. Roll r36694 back in. It did not cause the crash.
  27291. * JavaScriptCore.exp:
  27292. * VM/JSPropertyNameIterator.cpp:
  27293. (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
  27294. (JSC::JSPropertyNameIterator::invalidate):
  27295. * VM/JSPropertyNameIterator.h:
  27296. (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
  27297. (JSC::JSPropertyNameIterator::create):
  27298. * kjs/JSObject.cpp:
  27299. (JSC::JSObject::getPropertyNames):
  27300. * kjs/PropertyMap.cpp:
  27301. (JSC::PropertyMap::getEnumerablePropertyNames):
  27302. * kjs/PropertyMap.h:
  27303. * kjs/PropertyNameArray.cpp:
  27304. (JSC::PropertyNameArray::add):
  27305. * kjs/PropertyNameArray.h:
  27306. (JSC::PropertyNameArrayData::create):
  27307. (JSC::PropertyNameArrayData::propertyNameVector):
  27308. (JSC::PropertyNameArrayData::setCachedPrototypeChain):
  27309. (JSC::PropertyNameArrayData::cachedPrototypeChain):
  27310. (JSC::PropertyNameArrayData::begin):
  27311. (JSC::PropertyNameArrayData::end):
  27312. (JSC::PropertyNameArrayData::PropertyNameArrayData):
  27313. (JSC::PropertyNameArray::PropertyNameArray):
  27314. (JSC::PropertyNameArray::addKnownUnique):
  27315. (JSC::PropertyNameArray::size):
  27316. (JSC::PropertyNameArray::operator[]):
  27317. (JSC::PropertyNameArray::begin):
  27318. (JSC::PropertyNameArray::end):
  27319. (JSC::PropertyNameArray::setData):
  27320. (JSC::PropertyNameArray::data):
  27321. (JSC::PropertyNameArray::releaseData):
  27322. * kjs/StructureID.cpp:
  27323. (JSC::structureIDChainsAreEqual):
  27324. (JSC::StructureID::getEnumerablePropertyNames):
  27325. (JSC::StructureID::clearEnumerationCache):
  27326. (JSC::StructureID::createCachedPrototypeChain):
  27327. * kjs/StructureID.h:
  27328. 2008-09-19 Sam Weinig <sam@webkit.org>
  27329. Roll out r36694.
  27330. * JavaScriptCore.exp:
  27331. * VM/JSPropertyNameIterator.cpp:
  27332. (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
  27333. (JSC::JSPropertyNameIterator::invalidate):
  27334. * VM/JSPropertyNameIterator.h:
  27335. (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
  27336. (JSC::JSPropertyNameIterator::create):
  27337. * kjs/JSObject.cpp:
  27338. (JSC::JSObject::getPropertyNames):
  27339. * kjs/PropertyMap.cpp:
  27340. (JSC::PropertyMap::getEnumerablePropertyNames):
  27341. * kjs/PropertyMap.h:
  27342. * kjs/PropertyNameArray.cpp:
  27343. (JSC::PropertyNameArray::add):
  27344. * kjs/PropertyNameArray.h:
  27345. (JSC::PropertyNameArray::PropertyNameArray):
  27346. (JSC::PropertyNameArray::addKnownUnique):
  27347. (JSC::PropertyNameArray::begin):
  27348. (JSC::PropertyNameArray::end):
  27349. (JSC::PropertyNameArray::size):
  27350. (JSC::PropertyNameArray::operator[]):
  27351. (JSC::PropertyNameArray::releaseIdentifiers):
  27352. * kjs/StructureID.cpp:
  27353. (JSC::StructureID::getEnumerablePropertyNames):
  27354. * kjs/StructureID.h:
  27355. (JSC::StructureID::clearEnumerationCache):
  27356. 2008-09-19 Oliver Hunt <oliver@apple.com>
  27357. Reviewed by Maciej Stachowiak.
  27358. Improve peformance of local variable initialisation.
  27359. Pull local and constant initialisation out of slideRegisterWindowForCall
  27360. and into its own opcode. This allows the JIT to generate the initialisation
  27361. code for a function directly into the instruction stream and so avoids a few
  27362. branches on function entry.
  27363. Results a 1% progression in SunSpider, particularly in a number of the bitop
  27364. tests where the called functions are very fast.
  27365. * VM/CTI.cpp:
  27366. (JSC::CTI::emitInitialiseRegister):
  27367. (JSC::CTI::privateCompileMainPass):
  27368. * VM/CTI.h:
  27369. * VM/CodeBlock.cpp:
  27370. (JSC::CodeBlock::dump):
  27371. * VM/CodeGenerator.cpp:
  27372. (JSC::CodeGenerator::CodeGenerator):
  27373. * VM/Machine.cpp:
  27374. (JSC::slideRegisterWindowForCall):
  27375. (JSC::Machine::privateExecute):
  27376. * VM/Opcode.h:
  27377. 2008-09-19 Sam Weinig <sam@webkit.org>
  27378. Reviewed by Darin Adler.
  27379. Patch for https://bugs.webkit.org/show_bug.cgi?id=20928
  27380. Speed up JS property enumeration by caching entire PropertyNameArray
  27381. 1.3% speedup on Sunspider, 30% on string-fasta.
  27382. * JavaScriptCore.exp:
  27383. * VM/JSPropertyNameIterator.cpp:
  27384. (JSC::JSPropertyNameIterator::~JSPropertyNameIterator):
  27385. (JSC::JSPropertyNameIterator::invalidate):
  27386. * VM/JSPropertyNameIterator.h:
  27387. (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
  27388. (JSC::JSPropertyNameIterator::create):
  27389. * kjs/JSObject.cpp:
  27390. (JSC::JSObject::getPropertyNames):
  27391. * kjs/PropertyMap.cpp:
  27392. (JSC::PropertyMap::getEnumerablePropertyNames):
  27393. * kjs/PropertyMap.h:
  27394. * kjs/PropertyNameArray.cpp:
  27395. (JSC::PropertyNameArray::add):
  27396. * kjs/PropertyNameArray.h:
  27397. (JSC::PropertyNameArrayData::create):
  27398. (JSC::PropertyNameArrayData::propertyNameVector):
  27399. (JSC::PropertyNameArrayData::setCachedPrototypeChain):
  27400. (JSC::PropertyNameArrayData::cachedPrototypeChain):
  27401. (JSC::PropertyNameArrayData::begin):
  27402. (JSC::PropertyNameArrayData::end):
  27403. (JSC::PropertyNameArrayData::PropertyNameArrayData):
  27404. (JSC::PropertyNameArray::PropertyNameArray):
  27405. (JSC::PropertyNameArray::addKnownUnique):
  27406. (JSC::PropertyNameArray::size):
  27407. (JSC::PropertyNameArray::operator[]):
  27408. (JSC::PropertyNameArray::begin):
  27409. (JSC::PropertyNameArray::end):
  27410. (JSC::PropertyNameArray::setData):
  27411. (JSC::PropertyNameArray::data):
  27412. (JSC::PropertyNameArray::releaseData):
  27413. * kjs/ScopeChain.cpp:
  27414. (JSC::ScopeChainNode::print):
  27415. * kjs/StructureID.cpp:
  27416. (JSC::structureIDChainsAreEqual):
  27417. (JSC::StructureID::getEnumerablePropertyNames):
  27418. (JSC::StructureID::clearEnumerationCache):
  27419. (JSC::StructureID::createCachedPrototypeChain):
  27420. * kjs/StructureID.h:
  27421. 2008-09-19 Holger Hans Peter Freyther <zecke@selfish.org>
  27422. Reviewed by Maciej Stachowiak.
  27423. Fix a mismatched new[]/delete in JSObject::allocatePropertyStorage
  27424. * kjs/JSObject.cpp:
  27425. (JSC::JSObject::allocatePropertyStorage): Spotted by valgrind.
  27426. 2008-09-19 Darin Adler <darin@apple.com>
  27427. Reviewed by Sam Weinig.
  27428. - part 2 of https://bugs.webkit.org/show_bug.cgi?id=20858
  27429. make each distinct C++ class get a distinct JSC::Structure
  27430. * JavaScriptCore.exp: Exported constructEmptyObject for use in WebCore.
  27431. * kjs/JSGlobalObject.h: Changed the protected constructor to take a
  27432. structure instead of a prototype.
  27433. * kjs/JSVariableObject.h: Removed constructor that takes a prototype.
  27434. 2008-09-19 Julien Chaffraix <jchaffraix@pleyo.com>
  27435. Reviewed by Alexey Proskuryakov.
  27436. Use the template hoisting technique on the RefCounted class. This reduces the code bloat due to
  27437. non-template methods' code been copied for each instance of the template.
  27438. The patch splits RefCounted between a base class that holds non-template methods and attributes
  27439. and the template RefCounted class that keeps the same functionnality.
  27440. On my Linux with gcc 4.3 for the Gtk port, this is:
  27441. - a ~600KB save on libwebkit.so in release.
  27442. - a ~1.6MB save on libwebkit.so in debug.
  27443. It is a wash on Sunspider and a small win on Dromaeo (not sure it is relevant).
  27444. On the whole, it should be a small win as we reduce the compiled code size and the only
  27445. new function call should be inlined by the compiler.
  27446. * wtf/RefCounted.h:
  27447. (WTF::RefCountedBase::ref): Copied from RefCounted.
  27448. (WTF::RefCountedBase::hasOneRef): Ditto.
  27449. (WTF::RefCountedBase::refCount): Ditto.
  27450. (WTF::RefCountedBase::RefCountedBase): Ditto.
  27451. (WTF::RefCountedBase::~RefCountedBase): Ditto.
  27452. (WTF::RefCountedBase::derefBase): Tweaked from the RefCounted version to remove
  27453. template section.
  27454. (WTF::RefCounted::RefCounted):
  27455. (WTF::RefCounted::deref): Small wrapper around RefCountedBase::derefBase().
  27456. (WTF::RefCounted::~RefCounted): Keep private destructor.
  27457. 2008-09-18 Darin Adler <darin@apple.com>
  27458. Reviewed by Maciej Stachowiak.
  27459. - part 1 of https://bugs.webkit.org/show_bug.cgi?id=20858
  27460. make each distinct C++ class get a distinct JSC::Structure
  27461. * kjs/lookup.h: Removed things here that were used only in WebCore:
  27462. cacheGlobalObject, JSC_DEFINE_PROTOTYPE, JSC_DEFINE_PROTOTYPE_WITH_PROTOTYPE,
  27463. and JSC_IMPLEMENT_PROTOTYPE.
  27464. 2008-09-18 Darin Adler <darin@apple.com>
  27465. Reviewed by Maciej Stachowiak.
  27466. - https://bugs.webkit.org/show_bug.cgi?id=20927
  27467. simplify/streamline the code to turn strings into identifiers while parsing
  27468. * kjs/grammar.y: Get rid of string from the union, and use ident for STRING as
  27469. well as for IDENT.
  27470. * kjs/lexer.cpp:
  27471. (JSC::Lexer::lex): Use makeIdentifier instead of makeUString for String.
  27472. * kjs/lexer.h: Remove makeUString.
  27473. * kjs/nodes.h: Changed StringNode to hold an Identifier instead of UString.
  27474. * VM/CodeGenerator.cpp:
  27475. (JSC::keyForCharacterSwitch): Updated since StringNode now holds an Identifier.
  27476. (JSC::prepareJumpTableForStringSwitch): Ditto.
  27477. * kjs/nodes.cpp:
  27478. (JSC::StringNode::emitCode): Ditto. The comment from here is now in the lexer.
  27479. (JSC::processClauseList): Ditto.
  27480. * kjs/nodes2string.cpp:
  27481. (JSC::StringNode::streamTo): Ditto.
  27482. 2008-09-18 Sam Weinig <sam@webkit.org>
  27483. Fix style.
  27484. * VM/Instruction.h:
  27485. (JSC::Instruction::Instruction):
  27486. 2008-09-18 Oliver Hunt <oliver@apple.com>
  27487. Reviewed by Maciej Stachowiak.
  27488. Bug 20911: REGRESSION(r36480?): Reproducible assertion failure below derefStructureIDs 64-bit JavaScriptCore
  27489. <https://bugs.webkit.org/show_bug.cgi?id=20911>
  27490. The problem was simply caused by the int constructor for Instruction
  27491. failing to initialise the full struct in 64bit builds.
  27492. * VM/Instruction.h:
  27493. (JSC::Instruction::Instruction):
  27494. 2008-09-18 Darin Adler <darin@apple.com>
  27495. - fix release build
  27496. * wtf/RefCountedLeakCounter.cpp: Removed stray "static".
  27497. 2008-09-18 Darin Adler <darin@apple.com>
  27498. Reviewed by Sam Weinig.
  27499. * kjs/JSGlobalObject.h: Tiny style guideline tweak.
  27500. 2008-09-18 Darin Adler <darin@apple.com>
  27501. Reviewed by Sam Weinig.
  27502. - fix https://bugs.webkit.org/show_bug.cgi?id=20925
  27503. LEAK messages appear every time I quit
  27504. * JavaScriptCore.exp: Updated, and also added an export
  27505. needed for future WebCore use of JSC::StructureID.
  27506. * wtf/RefCountedLeakCounter.cpp:
  27507. (WTF::RefCountedLeakCounter::suppressMessages): Added.
  27508. (WTF::RefCountedLeakCounter::cancelMessageSuppression): Added.
  27509. (WTF::RefCountedLeakCounter::RefCountedLeakCounter): Tweaked a bit.
  27510. (WTF::RefCountedLeakCounter::~RefCountedLeakCounter): Added code to
  27511. log the reason there was no leak checking done.
  27512. (WTF::RefCountedLeakCounter::increment): Tweaked a bit.
  27513. (WTF::RefCountedLeakCounter::decrement): Ditto.
  27514. * wtf/RefCountedLeakCounter.h: Replaced setLogLeakMessages with two
  27515. new functions, suppressMessages and cancelMessageSuppression. Also
  27516. added m_ prefixes to the data member names.
  27517. 2008-09-18 Holger Hans Peter Freyther <zecke@selfish.org>
  27518. Reviewed by Mark Rowe.
  27519. https://bugs.webkit.org/show_bug.cgi?id=20437
  27520. Add a proper #define to define which XML Parser implementation to use. Client
  27521. code can use #if USE(QXMLSTREAM) to decide if the Qt XML StreamReader
  27522. implementation is going to be used.
  27523. * wtf/Platform.h:
  27524. 2008-09-18 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27525. Reviewed by Maciej Stachowiak.
  27526. Make a Unicode non-breaking space count as a whitespace character in
  27527. PCRE. This change was already made in WREC, and it fixes one of the
  27528. Mozilla JS tests. Since it is now fixed in PCRE as well, we can check
  27529. in a new set of expected test results.
  27530. * pcre/pcre_internal.h:
  27531. (isSpaceChar):
  27532. * tests/mozilla/expected.html:
  27533. 2008-09-18 Stephanie Lewis <slewis@apple.com>
  27534. Reviewed by Mark Rowe and Maciej Stachowiak.
  27535. add an option use arch to specify which architecture to run.
  27536. * tests/mozilla/jsDriver.pl:
  27537. 2008-09-17 Oliver Hunt <oliver@apple.com>
  27538. Correctly restore argument reference prior to SFX runtime calls.
  27539. Reviewed by Steve Falkenburg.
  27540. * VM/CTI.cpp:
  27541. (JSC::CTI::privateCompileSlowCases):
  27542. (JSC::CTI::privateCompile):
  27543. 2008-09-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27544. Reviewed by Maciej Stachowiak.
  27545. Bug 20876: REGRESSION (r36417, r36427): fast/js/exception-expression-offset.html fails
  27546. <https://bugs.webkit.org/show_bug.cgi?id=20876>
  27547. r36417 and r36427 caused an get_by_id opcode to be emitted before the
  27548. instanceof and construct opcodes, in order to enable inline caching of
  27549. the prototype property. Unfortunately, this regressed some tests dealing
  27550. with exceptions thrown by 'instanceof' and the 'new' operator. We fix
  27551. these problems by detecting whether an "is not an object" exception is
  27552. thrown before op_instanceof or op_construct, and emit the proper
  27553. exception in those cases.
  27554. * VM/CodeGenerator.cpp:
  27555. (JSC::CodeGenerator::emitConstruct):
  27556. * VM/CodeGenerator.h:
  27557. * VM/ExceptionHelpers.cpp:
  27558. (JSC::createInvalidParamError):
  27559. (JSC::createNotAConstructorError):
  27560. (JSC::createNotAnObjectError):
  27561. * VM/ExceptionHelpers.h:
  27562. * VM/Machine.cpp:
  27563. (JSC::Machine::getOpcode):
  27564. (JSC::Machine::privateExecute):
  27565. * VM/Machine.h:
  27566. * kjs/nodes.cpp:
  27567. (JSC::NewExprNode::emitCode):
  27568. (JSC::InstanceOfNode::emitCode):
  27569. 2008-09-17 Gavin Barraclough <barraclough@apple.com>
  27570. Reviewed by Oliver Hunt.
  27571. JIT generation cti_op_construct_verify.
  27572. Quarter to half percent progression on v8-tests.
  27573. Roughly not change on SunSpider (possible minor progression).
  27574. * VM/CTI.cpp:
  27575. (JSC::CTI::privateCompileMainPass):
  27576. * VM/Machine.cpp:
  27577. * VM/Machine.h:
  27578. 2008-09-15 Steve Falkenburg <sfalken@apple.com>
  27579. Improve timer accuracy for JavaScript Date object on Windows.
  27580. Use a combination of ftime and QueryPerformanceCounter.
  27581. ftime returns the information we want, but doesn't have sufficient resolution.
  27582. QueryPerformanceCounter has high resolution, but is only usable to measure time intervals.
  27583. To combine them, we call ftime and QueryPerformanceCounter initially. Later calls will use
  27584. QueryPerformanceCounter by itself, adding the delta to the saved ftime. We re-sync to
  27585. correct for drift if the low-res and high-res elapsed time between calls differs by more
  27586. than twice the low-resolution timer resolution.
  27587. QueryPerformanceCounter may be inaccurate due to a problems with:
  27588. - some PCI bridge chipsets (http://support.microsoft.com/kb/274323)
  27589. - BIOS bugs (http://support.microsoft.com/kb/895980/)
  27590. - BIOS/HAL bugs on multiprocessor/multicore systems (http://msdn.microsoft.com/en-us/library/ms644904.aspx)
  27591. Reviewed by Darin Adler.
  27592. * kjs/DateMath.cpp:
  27593. (JSC::highResUpTime):
  27594. (JSC::lowResUTCTime):
  27595. (JSC::qpcAvailable):
  27596. (JSC::getCurrentUTCTimeWithMicroseconds):
  27597. 2008-09-17 Gavin Barraclough <barraclough@apple.com>
  27598. Reviewed by Geoff Garen.
  27599. Implement JIT generation of CallFrame initialization, for op_call.
  27600. 1% sunspider 2.5% v8-tests.
  27601. * VM/CTI.cpp:
  27602. (JSC::CTI::compileOpCall):
  27603. * VM/Machine.cpp:
  27604. (JSC::Machine::cti_op_call_JSFunction):
  27605. (JSC::Machine::cti_op_call_NotJSFunction):
  27606. 2008-09-17 Gavin Barraclough <barraclough@apple.com>
  27607. Reviewed by Geoff Garen.
  27608. Optimizations for op_call in CTI. Move check for (ctiCode == 0) into JIT code,
  27609. move copying of scopeChain for CodeBlocks that needFullScopeChain into head of
  27610. functions, instead of checking prior to making the call.
  27611. 3% on v8-tests (4% on richards, 6% in delta-blue)
  27612. * VM/CTI.cpp:
  27613. (JSC::CTI::compileOpCall):
  27614. (JSC::CTI::privateCompileSlowCases):
  27615. (JSC::CTI::privateCompile):
  27616. * VM/Machine.cpp:
  27617. (JSC::Machine::execute):
  27618. (JSC::Machine::cti_op_call_JSFunction):
  27619. (JSC::Machine::cti_vm_compile):
  27620. (JSC::Machine::cti_vm_updateScopeChain):
  27621. (JSC::Machine::cti_op_construct_JSConstruct):
  27622. * VM/Machine.h:
  27623. 2008-09-17 Tor Arne Vestbø <tavestbo@trolltech.com>
  27624. Fix the QtWebKit/Mac build
  27625. * wtf/ThreadingQt.cpp:
  27626. (WTF::initializeThreading): use QCoreApplication to get the main thread
  27627. 2008-09-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27628. Reviewed by Maciej Stachowiak.
  27629. Bug 20857: REGRESSION (r36427): ASSERTION FAILED: m_refCount >= 0 in RegisterID::deref()
  27630. <https://bugs.webkit.org/show_bug.cgi?id=20857>
  27631. Fix a problem stemming from the slightly unsafe behaviour of the
  27632. CodeGenerator::finalDestination() method by putting the "func" argument
  27633. of the emitConstruct() method in a RefPtr in its caller. Also, add an
  27634. assertion guaranteeing that this is always the case.
  27635. CodeGenerator::finalDestination() is still incorrect and can cause
  27636. problems with a different allocator; see bug 20340 for more details.
  27637. * VM/CodeGenerator.cpp:
  27638. (JSC::CodeGenerator::emitConstruct):
  27639. * kjs/nodes.cpp:
  27640. (JSC::NewExprNode::emitCode):
  27641. 2008-09-16 Alice Liu <alice.liu@apple.com>
  27642. build fix.
  27643. * VM/CTI.cpp:
  27644. (JSC::CTI::privateCompileMainPass):
  27645. 2008-09-16 Gavin Barraclough <barraclough@apple.com>
  27646. Reviewed by Geoff Garen.
  27647. CTI code generation for op_ret. The majority of the work
  27648. (updating variables on the stack & on exec) can be performed
  27649. directly in generated code.
  27650. We still need to check, & to call out to C-code to handle
  27651. activation records, profiling, and full scope chains.
  27652. +1.5% Sunspider, +5/6% v8 tests.
  27653. * VM/CTI.cpp:
  27654. (JSC::CTI::emitPutCTIParam):
  27655. (JSC::CTI::compileOpCall):
  27656. (JSC::CTI::privateCompileMainPass):
  27657. * VM/CTI.h:
  27658. * VM/Machine.cpp:
  27659. (JSC::Machine::cti_op_ret_activation):
  27660. (JSC::Machine::cti_op_ret_profiler):
  27661. (JSC::Machine::cti_op_ret_scopeChain):
  27662. * VM/Machine.h:
  27663. 2008-09-16 Dimitri Glazkov <dglazkov@chromium.org>
  27664. Fix the Windows build.
  27665. Add some extra parentheses to stop MSVC from complaining so much.
  27666. * VM/Machine.cpp:
  27667. (JSC::Machine::privateExecute):
  27668. (JSC::Machine::cti_op_stricteq):
  27669. (JSC::Machine::cti_op_nstricteq):
  27670. * kjs/operations.cpp:
  27671. (JSC::strictEqual):
  27672. 2008-09-15 Maciej Stachowiak <mjs@apple.com>
  27673. Reviewed by Cameron Zwarich.
  27674. - speed up the === and !== operators by choosing the fast cases better
  27675. No effect on SunSpider but speeds up the V8 EarlyBoyer benchmark about 4%.
  27676. * VM/Machine.cpp:
  27677. (JSC::Machine::privateExecute):
  27678. (JSC::Machine::cti_op_stricteq):
  27679. (JSC::Machine::cti_op_nstricteq):
  27680. * kjs/JSImmediate.h:
  27681. (JSC::JSImmediate::areBothImmediate):
  27682. * kjs/operations.cpp:
  27683. (JSC::strictEqual):
  27684. (JSC::strictEqualSlowCase):
  27685. * kjs/operations.h:
  27686. 2008-09-15 Oliver Hunt <oliver@apple.com>
  27687. RS=Sam Weinig.
  27688. Coding style cleanup.
  27689. * VM/Machine.cpp:
  27690. (JSC::Machine::privateExecute):
  27691. 2008-09-15 Oliver Hunt <oliver@apple.com>
  27692. Reviewed by Cameron Zwarich.
  27693. Bug 20874: op_resolve does not do any form of caching
  27694. <https://bugs.webkit.org/show_bug.cgi?id=20874>
  27695. This patch adds an op_resolve_global opcode to handle (and cache)
  27696. property lookup we can statically determine must occur on the global
  27697. object (if at all).
  27698. 3% progression on sunspider, 3.2x improvement to bitops-bitwise-and, and
  27699. 10% in math-partial-sums
  27700. * VM/CTI.cpp:
  27701. (JSC::CTI::privateCompileMainPass):
  27702. * VM/CTI.h:
  27703. * VM/CodeBlock.cpp:
  27704. (JSC::CodeBlock::dump):
  27705. * VM/CodeGenerator.cpp:
  27706. (JSC::CodeGenerator::findScopedProperty):
  27707. (JSC::CodeGenerator::emitResolve):
  27708. * VM/Machine.cpp:
  27709. (JSC::resolveGlobal):
  27710. (JSC::Machine::privateExecute):
  27711. (JSC::Machine::cti_op_resolve_global):
  27712. * VM/Machine.h:
  27713. * VM/Opcode.h:
  27714. 2008-09-15 Sam Weinig <sam@webkit.org>
  27715. Roll out r36462. It broke document.all.
  27716. * VM/CTI.cpp:
  27717. (JSC::CTI::privateCompileMainPass):
  27718. (JSC::CTI::privateCompileSlowCases):
  27719. * VM/CTI.h:
  27720. * VM/Machine.cpp:
  27721. (JSC::Machine::Machine):
  27722. (JSC::Machine::cti_op_eq_null):
  27723. (JSC::Machine::cti_op_neq_null):
  27724. * VM/Machine.h:
  27725. (JSC::Machine::isJSString):
  27726. * kjs/JSCell.h:
  27727. * kjs/JSWrapperObject.h:
  27728. * kjs/StringObject.h:
  27729. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  27730. 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27731. Reviewed by Maciej Stachowiak.
  27732. Bug 20863: ASSERTION FAILED: addressOffset < instructions.size() in CodeBlock::getHandlerForVPC
  27733. <https://bugs.webkit.org/show_bug.cgi?id=20863>
  27734. r36427 changed the number of arguments to op_construct without changing
  27735. the argument index for the vPC in the call to initializeCallFrame() in
  27736. the CTI case. This caused a JSC test failure. Correcting the argument
  27737. index fixes the test failure.
  27738. * VM/Machine.cpp:
  27739. (JSC::Machine::cti_op_construct_JSConstruct):
  27740. 2008-09-15 Mark Rowe <mrowe@apple.com>
  27741. Fix GCC 4.2 build.
  27742. * VM/CTI.h:
  27743. 2008-09-15 Geoffrey Garen <ggaren@apple.com>
  27744. Reviewed by Maciej Stachowiak.
  27745. Fixed a typo in op_get_by_id_chain that caused it to miss every time
  27746. in the interpreter.
  27747. Also, a little cleanup.
  27748. * VM/Machine.cpp:
  27749. (JSC::Machine::privateExecute): Set up baseObject before entering the
  27750. loop, so we compare against the right values.
  27751. 2008-09-15 Geoffrey Garen <ggaren@apple.com>
  27752. Reviewed by Sam Weinig.
  27753. Removed the CalledAsConstructor flag from the call frame header. Now,
  27754. we use an explicit opcode at the call site to fix up constructor results.
  27755. SunSpider says 0.4% faster.
  27756. cti_op_construct_verify is an out-of-line function call for now, but we
  27757. can fix that once StructureID holds type information like isObject.
  27758. * VM/CTI.cpp:
  27759. (JSC::CTI::privateCompileMainPass): Codegen for the new opcode.
  27760. * VM/CodeBlock.cpp:
  27761. (JSC::CodeBlock::dump):
  27762. * VM/CodeGenerator.cpp: Codegen for the new opcode. Also...
  27763. (JSC::CodeGenerator::emitCall): ... don't test for known non-zero value.
  27764. (JSC::CodeGenerator::emitConstruct): ... ditto.
  27765. * VM/Machine.cpp: No more CalledAsConstructor
  27766. (JSC::Machine::privateExecute): Implementation for the new opcode.
  27767. (JSC::Machine::cti_op_ret): The speedup: no need to check whether we were
  27768. called as a constructor.
  27769. (JSC::Machine::cti_op_construct_verify): Implementation for the new opcode.
  27770. * VM/Machine.h:
  27771. * VM/Opcode.h: Declare new opcode.
  27772. * VM/RegisterFile.h:
  27773. (JSC::RegisterFile::): No more CalledAsConstructor
  27774. 2008-09-15 Gavin Barraclough <barraclough@apple.com>
  27775. Reviewed by Geoff Garen.
  27776. Inline code generation of eq_null/neq_null for CTI. Uses vptr checking for
  27777. StringObjectsThatAreMasqueradingAsBeingUndefined. In the long run, the
  27778. masquerading may be handled differently (through the StructureIDs - see bug
  27779. #20823).
  27780. >1% on v8-tests.
  27781. * VM/CTI.cpp:
  27782. (JSC::CTI::emitJumpSlowCaseIfIsJSCell):
  27783. (JSC::CTI::privateCompileMainPass):
  27784. (JSC::CTI::privateCompileSlowCases):
  27785. * VM/CTI.h:
  27786. * VM/Machine.cpp:
  27787. (JSC::Machine::Machine):
  27788. (JSC::Machine::cti_op_eq_null):
  27789. (JSC::Machine::cti_op_neq_null):
  27790. * VM/Machine.h:
  27791. (JSC::Machine::doesMasqueradesAsUndefined):
  27792. * kjs/JSWrapperObject.h:
  27793. (JSC::JSWrapperObject::):
  27794. (JSC::JSWrapperObject::JSWrapperObject):
  27795. * kjs/StringObject.h:
  27796. (JSC::StringObject::StringObject):
  27797. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  27798. (JSC::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
  27799. 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27800. Rubber-stamped by Oliver Hunt.
  27801. r36427 broke CodeBlock::dump() by changing the number of arguments to
  27802. op_construct without changing the code that prints it. This patch fixes
  27803. it by printing the additional argument.
  27804. * JavaScriptCore.xcodeproj/project.pbxproj:
  27805. * VM/CodeBlock.cpp:
  27806. (JSC::CodeBlock::dump):
  27807. 2008-09-15 Adam Roben <aroben@apple.com>
  27808. Build fix
  27809. * kjs/StructureID.cpp: Removed a stray semicolon.
  27810. 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27811. Reviewed by Maciej Stachowiak.
  27812. Fix a crash in fast/js/exception-expression-offset.html caused by not
  27813. updating all mentions of the length of op_construct in r36427.
  27814. * VM/Machine.cpp:
  27815. (JSC::Machine::cti_op_construct_NotJSConstruct):
  27816. 2008-09-15 Maciej Stachowiak <mjs@apple.com>
  27817. Reviewed by Cameron Zwarich.
  27818. - fix layout test failure introduced by fix for 20849
  27819. (The failing test was fast/js/delete-then-put.html)
  27820. * kjs/JSObject.cpp:
  27821. (JSC::JSObject::removeDirect): Clear enumeration cache
  27822. in the dictionary case.
  27823. * kjs/JSObject.h:
  27824. (JSC::JSObject::putDirect): Ditto.
  27825. * kjs/StructureID.h:
  27826. (JSC::StructureID::clearEnumerationCache): Inline to handle the
  27827. clear.
  27828. 2008-09-15 Maciej Stachowiak <mjs@apple.com>
  27829. Reviewed by Cameron Zwarich.
  27830. - fix JSC test failures introduced by fix for 20849
  27831. * kjs/PropertyMap.cpp:
  27832. (JSC::PropertyMap::getEnumerablePropertyNames): Use the correct count.
  27833. 2008-09-15 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27834. Reviewed by Maciej Stachowiak.
  27835. Bug 20851: REGRESSION (r36410): fast/js/kde/GlobalObject.html fails
  27836. <https://bugs.webkit.org/show_bug.cgi?id=20851>
  27837. r36410 introduced an optimization for parseInt() that is incorrect when
  27838. its argument is larger than the range of a 32-bit integer. If the
  27839. argument is a number that is not an immediate integer, then the correct
  27840. behaviour is to return the floor of its value, unless it is an infinite
  27841. value, in which case the correct behaviour is to return 0.
  27842. * kjs/JSGlobalObjectFunctions.cpp:
  27843. (JSC::globalFuncParseInt):
  27844. 2008-09-15 Sam Weinig <sam@webkit.org>
  27845. Reviewed by Maciej Stachowiak.
  27846. Patch for https://bugs.webkit.org/show_bug.cgi?id=20849
  27847. Cache property names for getEnumerablePropertyNames in the StructureID.
  27848. ~0.5% speedup on Sunspider overall (9.7% speedup on string-fasta). ~1% speedup
  27849. on the v8 test suite.
  27850. * kjs/JSObject.cpp:
  27851. (JSC::JSObject::getPropertyNames):
  27852. * kjs/PropertyMap.cpp:
  27853. (JSC::PropertyMap::getEnumerablePropertyNames):
  27854. * kjs/PropertyMap.h:
  27855. * kjs/StructureID.cpp:
  27856. (JSC::StructureID::StructureID):
  27857. (JSC::StructureID::getEnumerablePropertyNames):
  27858. * kjs/StructureID.h:
  27859. 2008-09-14 Maciej Stachowiak <mjs@apple.com>
  27860. Reviewed by Cameron Zwarich.
  27861. - speed up JS construction by extracting "prototype" lookup so PIC applies.
  27862. ~0.5% speedup on SunSpider
  27863. Speeds up some of the V8 tests as well, most notably earley-boyer.
  27864. * VM/CTI.cpp:
  27865. (JSC::CTI::compileOpCall): Account for extra arg for prototype.
  27866. (JSC::CTI::privateCompileMainPass): Account for increased size of op_construct.
  27867. * VM/CodeGenerator.cpp:
  27868. (JSC::CodeGenerator::emitConstruct): Emit separate lookup to get prototype property.
  27869. * VM/Machine.cpp:
  27870. (JSC::Machine::privateExecute): Expect prototype arg in op_construct.
  27871. (JSC::Machine::cti_op_construct_JSConstruct): ditto
  27872. (JSC::Machine::cti_op_construct_NotJSConstruct): ditto
  27873. 2008-09-10 Alexey Proskuryakov <ap@webkit.org>
  27874. Reviewed by Eric Seidel.
  27875. Add a protected destructor for RefCounted.
  27876. It is wrong to call its destructor directly, because (1) this should be taken care of by
  27877. deref(), and (2) many classes that use RefCounted have non-virtual destructors.
  27878. No change in behavior.
  27879. * wtf/RefCounted.h: (WTF::RefCounted::~RefCounted):
  27880. 2008-09-14 Gavin Barraclough <barraclough@apple.com>
  27881. Reviewed by Sam Weinig.
  27882. Accelerated property accesses.
  27883. Inline more of the array access code into the JIT code for get/put_by_val.
  27884. Accelerate get/put_by_id by speculatively inlining a disable direct access
  27885. into the hot path of the code, and repatch this with the correct StructureID
  27886. and property map offset once these are known. In the case of accesses to the
  27887. prototype and reading the array-length a trampoline is genertaed, and the
  27888. branch to the slow-case is relinked to jump to this.
  27889. By repatching, we mean rewriting the x86 instruction stream. Instructions are
  27890. only modified in a simple fasion - altering immediate operands, memory access
  27891. deisplacements, and branch offsets.
  27892. For regular get_by_id/put_by_id accesses to an object, a StructureID in an
  27893. instruction's immediate operant is updateded, and a memory access operation's
  27894. displacement is updated to access the correct field on the object. In the case
  27895. of more complex accesses (array length and get_by_id_prototype) the offset on
  27896. the branch to slow-case is updated, to now jump to a trampoline.
  27897. +2.8% sunspider, +13% v8-tests
  27898. * VM/CTI.cpp:
  27899. (JSC::CTI::emitCall):
  27900. (JSC::CTI::emitJumpSlowCaseIfNotJSCell):
  27901. (JSC::CTI::CTI):
  27902. (JSC::CTI::privateCompileMainPass):
  27903. (JSC::CTI::privateCompileSlowCases):
  27904. (JSC::CTI::privateCompile):
  27905. (JSC::CTI::privateCompileGetByIdSelf):
  27906. (JSC::CTI::privateCompileGetByIdProto):
  27907. (JSC::CTI::privateCompileGetByIdChain):
  27908. (JSC::CTI::privateCompilePutByIdReplace):
  27909. (JSC::CTI::privateCompilePutByIdTransition):
  27910. (JSC::CTI::privateCompileArrayLengthTrampoline):
  27911. (JSC::CTI::privateCompileStringLengthTrampoline):
  27912. (JSC::CTI::patchGetByIdSelf):
  27913. (JSC::CTI::patchPutByIdReplace):
  27914. (JSC::CTI::privateCompilePatchGetArrayLength):
  27915. (JSC::CTI::privateCompilePatchGetStringLength):
  27916. * VM/CTI.h:
  27917. (JSC::CTI::compileGetByIdSelf):
  27918. (JSC::CTI::compileGetByIdProto):
  27919. (JSC::CTI::compileGetByIdChain):
  27920. (JSC::CTI::compilePutByIdReplace):
  27921. (JSC::CTI::compilePutByIdTransition):
  27922. (JSC::CTI::compileArrayLengthTrampoline):
  27923. (JSC::CTI::compileStringLengthTrampoline):
  27924. (JSC::CTI::compilePatchGetArrayLength):
  27925. (JSC::CTI::compilePatchGetStringLength):
  27926. * VM/CodeBlock.cpp:
  27927. (JSC::CodeBlock::dump):
  27928. (JSC::CodeBlock::~CodeBlock):
  27929. * VM/CodeBlock.h:
  27930. (JSC::StructureStubInfo::StructureStubInfo):
  27931. (JSC::CodeBlock::getStubInfo):
  27932. * VM/Machine.cpp:
  27933. (JSC::Machine::tryCTICachePutByID):
  27934. (JSC::Machine::tryCTICacheGetByID):
  27935. (JSC::Machine::cti_op_put_by_val_array):
  27936. * VM/Machine.h:
  27937. * masm/X86Assembler.h:
  27938. (JSC::X86Assembler::):
  27939. (JSC::X86Assembler::cmpl_i8m):
  27940. (JSC::X86Assembler::emitUnlinkedJa):
  27941. (JSC::X86Assembler::getRelocatedAddress):
  27942. (JSC::X86Assembler::getDifferenceBetweenLabels):
  27943. (JSC::X86Assembler::emitModRm_opmsib):
  27944. 2008-09-14 Maciej Stachowiak <mjs@apple.com>
  27945. Reviewed by Cameron Zwarich.
  27946. - split the "prototype" lookup for hasInstance into opcode stream so it can be cached
  27947. ~5% speedup on v8 earley-boyer test
  27948. * API/JSCallbackObject.h: Add a parameter for the pre-looked-up prototype.
  27949. * API/JSCallbackObjectFunctions.h:
  27950. (JSC::::hasInstance): Ditto.
  27951. * API/JSValueRef.cpp:
  27952. (JSValueIsInstanceOfConstructor): Look up and pass in prototype.
  27953. * JavaScriptCore.exp:
  27954. * VM/CTI.cpp:
  27955. (JSC::CTI::privateCompileMainPass): Pass along prototype.
  27956. * VM/CodeBlock.cpp:
  27957. (JSC::CodeBlock::dump): Print third arg.
  27958. * VM/CodeGenerator.cpp:
  27959. (JSC::CodeGenerator::emitInstanceOf): Implement this, now that there
  27960. is a third argument.
  27961. * VM/CodeGenerator.h:
  27962. * VM/Machine.cpp:
  27963. (JSC::Machine::privateExecute): Pass along the prototype.
  27964. (JSC::Machine::cti_op_instanceof): ditto
  27965. * kjs/JSObject.cpp:
  27966. (JSC::JSObject::hasInstance): Expect to get a pre-looked-up prototype.
  27967. * kjs/JSObject.h:
  27968. * kjs/nodes.cpp:
  27969. (JSC::InstanceOfNode::emitCode): Emit a get_by_id of the prototype
  27970. property and pass that register to instanceof.
  27971. * kjs/nodes.h:
  27972. 2008-09-14 Gavin Barraclough <barraclough@apple.com>
  27973. Reviewed by Sam Weinig.
  27974. Remove unnecessary virtual function call from cti_op_call_JSFunction -
  27975. ~5% on richards, ~2.5% on v8-tests, ~0.5% on sunspider.
  27976. * VM/Machine.cpp:
  27977. (JSC::Machine::cti_op_call_JSFunction):
  27978. 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  27979. Reviewed by Maciej Stachowiak.
  27980. Bug 20827: the 'typeof' operator is slow
  27981. <https://bugs.webkit.org/show_bug.cgi?id=20827>
  27982. Optimize the 'typeof' operator when its result is compared to a constant
  27983. string.
  27984. This is a 5.5% speedup on the V8 Earley-Boyer test.
  27985. * VM/CTI.cpp:
  27986. (JSC::CTI::privateCompileMainPass):
  27987. * VM/CodeBlock.cpp:
  27988. (JSC::CodeBlock::dump):
  27989. * VM/CodeGenerator.cpp:
  27990. (JSC::CodeGenerator::emitEqualityOp):
  27991. * VM/CodeGenerator.h:
  27992. * VM/Machine.cpp:
  27993. (JSC::jsIsObjectType):
  27994. (JSC::jsIsFunctionType):
  27995. (JSC::Machine::privateExecute):
  27996. (JSC::Machine::cti_op_is_undefined):
  27997. (JSC::Machine::cti_op_is_boolean):
  27998. (JSC::Machine::cti_op_is_number):
  27999. (JSC::Machine::cti_op_is_string):
  28000. (JSC::Machine::cti_op_is_object):
  28001. (JSC::Machine::cti_op_is_function):
  28002. * VM/Machine.h:
  28003. * VM/Opcode.h:
  28004. * kjs/nodes.cpp:
  28005. (JSC::BinaryOpNode::emitCode):
  28006. (JSC::EqualNode::emitCode):
  28007. (JSC::StrictEqualNode::emitCode):
  28008. * kjs/nodes.h:
  28009. 2008-09-14 Sam Weinig <sam@webkit.org>
  28010. Reviewed by Cameron Zwarich.
  28011. Patch for https://bugs.webkit.org/show_bug.cgi?id=20844
  28012. Speed up parseInt for numbers
  28013. Sunspider reports this as 1.029x as fast overall and 1.37x as fast on string-unpack-code.
  28014. No change on the v8 suite.
  28015. * kjs/JSGlobalObjectFunctions.cpp:
  28016. (JSC::globalFuncParseInt): Don't convert numbers to strings just to
  28017. convert them back to numbers.
  28018. 2008-09-14 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28019. Reviewed by Oliver Hunt.
  28020. Bug 20816: op_lesseq should be optimized
  28021. <https://bugs.webkit.org/show_bug.cgi?id=20816>
  28022. Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.
  28023. This is a 9.4% speedup on the V8 Crypto benchmark.
  28024. * VM/CTI.cpp:
  28025. (JSC::CTI::privateCompileMainPass):
  28026. (JSC::CTI::privateCompileSlowCases):
  28027. * VM/CodeBlock.cpp:
  28028. (JSC::CodeBlock::dump):
  28029. * VM/CodeGenerator.cpp:
  28030. (JSC::CodeGenerator::emitJumpIfTrue):
  28031. * VM/Machine.cpp:
  28032. (JSC::Machine::privateExecute):
  28033. (JSC::Machine::cti_op_loop_if_lesseq):
  28034. * VM/Machine.h:
  28035. * VM/Opcode.h:
  28036. 2008-09-14 Sam Weinig <sam@webkit.org>
  28037. Reviewed by Cameron Zwarich.
  28038. Cleanup Sampling code.
  28039. * VM/CTI.cpp:
  28040. (JSC::CTI::emitCall):
  28041. (JSC::CTI::privateCompileMainPass):
  28042. * VM/CTI.h:
  28043. (JSC::CTI::execute):
  28044. * VM/SamplingTool.cpp:
  28045. (JSC::):
  28046. (JSC::SamplingTool::run):
  28047. (JSC::SamplingTool::dump):
  28048. * VM/SamplingTool.h:
  28049. (JSC::SamplingTool::callingHostFunction):
  28050. 2008-09-13 Oliver Hunt <oliver@apple.com>
  28051. Reviewed by Cameron Zwarich.
  28052. Bug 20821: Cache property transitions to speed up object initialization
  28053. https://bugs.webkit.org/show_bug.cgi?id=20821
  28054. Implement a transition cache to improve the performance of new properties
  28055. being added to objects. This is extremely beneficial in constructors and
  28056. shows up as a 34% improvement on access-binary-trees in SunSpider (0.8%
  28057. overall)
  28058. * VM/CTI.cpp:
  28059. (JSC::CTI::privateCompileMainPass):
  28060. (JSC::):
  28061. (JSC::transitionWillNeedStorageRealloc):
  28062. (JSC::CTI::privateCompilePutByIdTransition):
  28063. * VM/CTI.h:
  28064. (JSC::CTI::compilePutByIdTransition):
  28065. * VM/CodeBlock.cpp:
  28066. (JSC::printPutByIdOp):
  28067. (JSC::CodeBlock::printStructureIDs):
  28068. (JSC::CodeBlock::dump):
  28069. (JSC::CodeBlock::derefStructureIDs):
  28070. (JSC::CodeBlock::refStructureIDs):
  28071. * VM/CodeGenerator.cpp:
  28072. (JSC::CodeGenerator::emitPutById):
  28073. * VM/Machine.cpp:
  28074. (JSC::cachePrototypeChain):
  28075. (JSC::Machine::tryCachePutByID):
  28076. (JSC::Machine::tryCacheGetByID):
  28077. (JSC::Machine::privateExecute):
  28078. (JSC::Machine::tryCTICachePutByID):
  28079. (JSC::Machine::tryCTICacheGetByID):
  28080. * VM/Machine.h:
  28081. * VM/Opcode.h:
  28082. * kjs/JSObject.h:
  28083. (JSC::JSObject::putDirect):
  28084. (JSC::JSObject::transitionTo):
  28085. * kjs/PutPropertySlot.h:
  28086. (JSC::PutPropertySlot::PutPropertySlot):
  28087. (JSC::PutPropertySlot::wasTransition):
  28088. (JSC::PutPropertySlot::setWasTransition):
  28089. * kjs/StructureID.cpp:
  28090. (JSC::StructureID::transitionTo):
  28091. (JSC::StructureIDChain::StructureIDChain):
  28092. * kjs/StructureID.h:
  28093. (JSC::StructureID::previousID):
  28094. (JSC::StructureID::setCachedPrototypeChain):
  28095. (JSC::StructureID::cachedPrototypeChain):
  28096. (JSC::StructureID::propertyMap):
  28097. * masm/X86Assembler.h:
  28098. (JSC::X86Assembler::addl_i8m):
  28099. (JSC::X86Assembler::subl_i8m):
  28100. 2008-09-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28101. Reviewed by Maciej Stachowiak.
  28102. Bug 20819: JSValue::isObject() is slow
  28103. <https://bugs.webkit.org/show_bug.cgi?id=20819>
  28104. Optimize JSCell::isObject() and JSCell::isString() by making them
  28105. non-virtual calls that rely on the StructureID type information.
  28106. This is a 0.7% speedup on SunSpider and a 1.0% speedup on the V8
  28107. benchmark suite.
  28108. * JavaScriptCore.exp:
  28109. * kjs/JSCell.cpp:
  28110. * kjs/JSCell.h:
  28111. (JSC::JSCell::isObject):
  28112. (JSC::JSCell::isString):
  28113. * kjs/JSObject.cpp:
  28114. * kjs/JSObject.h:
  28115. * kjs/JSString.cpp:
  28116. * kjs/JSString.h:
  28117. (JSC::JSString::JSString):
  28118. * kjs/StructureID.h:
  28119. (JSC::StructureID::type):
  28120. 2008-09-11 Stephanie Lewis <slewis@apple.com>
  28121. Reviewed by Oliver Hunt.
  28122. Turn off PGO Optimization on CTI.cpp -> <rdar://problem/6207709>. Fixes
  28123. crash on CNN and on Dromaeo.
  28124. Fix Missing close tag in vcproj.
  28125. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  28126. 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28127. Not reviewed.
  28128. Correct an SVN problem with the last commit and actually add the new
  28129. files.
  28130. * wrec/CharacterClassConstructor.cpp: Added.
  28131. (JSC::):
  28132. (JSC::getCharacterClassNewline):
  28133. (JSC::getCharacterClassDigits):
  28134. (JSC::getCharacterClassSpaces):
  28135. (JSC::getCharacterClassWordchar):
  28136. (JSC::getCharacterClassNondigits):
  28137. (JSC::getCharacterClassNonspaces):
  28138. (JSC::getCharacterClassNonwordchar):
  28139. (JSC::CharacterClassConstructor::addSorted):
  28140. (JSC::CharacterClassConstructor::addSortedRange):
  28141. (JSC::CharacterClassConstructor::put):
  28142. (JSC::CharacterClassConstructor::flush):
  28143. (JSC::CharacterClassConstructor::append):
  28144. * wrec/CharacterClassConstructor.h: Added.
  28145. (JSC::CharacterClassConstructor::CharacterClassConstructor):
  28146. (JSC::CharacterClassConstructor::isUpsideDown):
  28147. (JSC::CharacterClassConstructor::charClass):
  28148. 2008-09-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28149. Reviewed by Maciej Stachowiak.
  28150. Bug 20788: Split CharacterClassConstructor into its own file
  28151. <https://bugs.webkit.org/show_bug.cgi?id=20788>
  28152. Split CharacterClassConstructor into its own file and clean up some
  28153. style issues.
  28154. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  28155. * JavaScriptCore.xcodeproj/project.pbxproj:
  28156. * wrec/CharacterClassConstructor.cpp: Added.
  28157. (JSC::):
  28158. (JSC::getCharacterClassNewline):
  28159. (JSC::getCharacterClassDigits):
  28160. (JSC::getCharacterClassSpaces):
  28161. (JSC::getCharacterClassWordchar):
  28162. (JSC::getCharacterClassNondigits):
  28163. (JSC::getCharacterClassNonspaces):
  28164. (JSC::getCharacterClassNonwordchar):
  28165. (JSC::CharacterClassConstructor::addSorted):
  28166. (JSC::CharacterClassConstructor::addSortedRange):
  28167. (JSC::CharacterClassConstructor::put):
  28168. (JSC::CharacterClassConstructor::flush):
  28169. (JSC::CharacterClassConstructor::append):
  28170. * wrec/CharacterClassConstructor.h: Added.
  28171. (JSC::CharacterClassConstructor::CharacterClassConstructor):
  28172. (JSC::CharacterClassConstructor::isUpsideDown):
  28173. (JSC::CharacterClassConstructor::charClass):
  28174. * wrec/WREC.cpp:
  28175. (JSC::WRECParser::parseCharacterClass):
  28176. 2008-09-10 Simon Hausmann <hausmann@webkit.org>
  28177. Not reviewed but trivial one-liner for yet unused macro.
  28178. Changed PLATFORM(WINCE) to PLATFORM(WIN_CE) as requested by Mark.
  28179. (part of https://bugs.webkit.org/show_bug.cgi?id=20746)
  28180. * wtf/Platform.h:
  28181. 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28182. Rubber-stamped by Oliver Hunt.
  28183. Fix a typo by renaming the overloaded orl_rr that takes an immediate to
  28184. orl_i32r.
  28185. * VM/CTI.cpp:
  28186. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  28187. * masm/X86Assembler.h:
  28188. (JSC::X86Assembler::orl_i32r):
  28189. * wrec/WREC.cpp:
  28190. (JSC::WRECGenerator::generatePatternCharacter):
  28191. (JSC::WRECGenerator::generateCharacterClassInverted):
  28192. 2008-09-10 Sam Weinig <sam@webkit.org>
  28193. Reviewed by Geoff Garen.
  28194. Add inline property storage for JSObject.
  28195. 1.2% progression on Sunspider. .5% progression on the v8 test suite.
  28196. * JavaScriptCore.exp:
  28197. * VM/CTI.cpp:
  28198. (JSC::CTI::privateCompileGetByIdProto):
  28199. (JSC::CTI::privateCompileGetByIdChain):
  28200. * kjs/JSObject.cpp:
  28201. (JSC::JSObject::mark): There is no reason to check storageSize now that
  28202. we start from 0.
  28203. (JSC::JSObject::allocatePropertyStorage): Allocates/reallocates heap storage.
  28204. * kjs/JSObject.h:
  28205. (JSC::JSObject::offsetForLocation): m_propertyStorage is not an OwnArrayPtr
  28206. now so there is no reason to .get()
  28207. (JSC::JSObject::usingInlineStorage):
  28208. (JSC::JSObject::JSObject): Start with m_propertyStorage pointing to the
  28209. inline storage.
  28210. (JSC::JSObject::~JSObject): Free the heap storage if not using the inline
  28211. storage.
  28212. (JSC::JSObject::putDirect): Switch to the heap storage only when we know
  28213. we know that we are about to add a property that will overflow the inline
  28214. storage.
  28215. * kjs/PropertyMap.cpp:
  28216. (JSC::PropertyMap::createTable): Don't allocate the propertyStorage, that is
  28217. now handled by JSObject.
  28218. (JSC::PropertyMap::rehash): PropertyStorage is not a OwnArrayPtr anymore.
  28219. * kjs/PropertyMap.h:
  28220. (JSC::PropertyMap::storageSize): Rename from markingCount.
  28221. * kjs/StructureID.cpp:
  28222. (JSC::StructureID::addPropertyTransition): Don't resize the property storage
  28223. if we are using inline storage.
  28224. * kjs/StructureID.h:
  28225. 2008-09-10 Oliver Hunt <oliver@apple.com>
  28226. Reviewed by Geoff Garen.
  28227. Inline immediate number version of op_mul.
  28228. Renamed mull_rr to imull_rr as that's what it's
  28229. actually doing, and added imull_i32r for the constant
  28230. case immediate multiply.
  28231. 1.1% improvement to SunSpider.
  28232. * VM/CTI.cpp:
  28233. (JSC::CTI::privateCompileMainPass):
  28234. (JSC::CTI::privateCompileSlowCases):
  28235. * masm/X86Assembler.h:
  28236. (JSC::X86Assembler::):
  28237. (JSC::X86Assembler::imull_rr):
  28238. (JSC::X86Assembler::imull_i32r):
  28239. 2008-09-10 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28240. Not reviewed.
  28241. Mac build fix.
  28242. * JavaScriptCore.xcodeproj/project.pbxproj:
  28243. 2008-09-09 Oliver Hunt <oliver@apple.com>
  28244. Reviewed by Maciej Stachowiak.
  28245. Add optimised access to known properties on the global object.
  28246. Improve cross scope access to the global object by emitting
  28247. code to access it directly rather than by walking the scope chain.
  28248. This is a 0.8% win in SunSpider and a 1.7% win in the v8 benchmarks.
  28249. * VM/CTI.cpp:
  28250. (JSC::CTI::privateCompileMainPass):
  28251. (JSC::CTI::emitGetVariableObjectRegister):
  28252. (JSC::CTI::emitPutVariableObjectRegister):
  28253. * VM/CTI.h:
  28254. * VM/CodeBlock.cpp:
  28255. (JSC::CodeBlock::dump):
  28256. * VM/CodeGenerator.cpp:
  28257. (JSC::CodeGenerator::findScopedProperty):
  28258. (JSC::CodeGenerator::emitResolve):
  28259. (JSC::CodeGenerator::emitGetScopedVar):
  28260. (JSC::CodeGenerator::emitPutScopedVar):
  28261. * VM/CodeGenerator.h:
  28262. * VM/Machine.cpp:
  28263. (JSC::Machine::privateExecute):
  28264. * VM/Opcode.h:
  28265. * kjs/nodes.cpp:
  28266. (JSC::FunctionCallResolveNode::emitCode):
  28267. (JSC::PostfixResolveNode::emitCode):
  28268. (JSC::PrefixResolveNode::emitCode):
  28269. (JSC::ReadModifyResolveNode::emitCode):
  28270. (JSC::AssignResolveNode::emitCode):
  28271. 2008-09-10 Maciej Stachowiak <mjs@apple.com>
  28272. Reviewed by Oliver.
  28273. - enable polymorphic inline caching of properties of primitives
  28274. 1.012x speedup on SunSpider.
  28275. We create special structure IDs for JSString and
  28276. JSNumberCell. Unlike normal structure IDs, these cannot hold the
  28277. true prototype. Due to JS autoboxing semantics, the prototype used
  28278. when looking up string or number properties depends on the lexical
  28279. global object of the call site, not the creation site. Thus we
  28280. enable StructureIDs to handle this quirk for primitives.
  28281. Everything else should be straightforward.
  28282. * VM/CTI.cpp:
  28283. (JSC::CTI::privateCompileGetByIdProto):
  28284. (JSC::CTI::privateCompileGetByIdChain):
  28285. * VM/CTI.h:
  28286. (JSC::CTI::compileGetByIdProto):
  28287. (JSC::CTI::compileGetByIdChain):
  28288. * VM/JSPropertyNameIterator.h:
  28289. (JSC::JSPropertyNameIterator::JSPropertyNameIterator):
  28290. * VM/Machine.cpp:
  28291. (JSC::Machine::Machine):
  28292. (JSC::cachePrototypeChain):
  28293. (JSC::Machine::tryCachePutByID):
  28294. (JSC::Machine::tryCacheGetByID):
  28295. (JSC::Machine::privateExecute):
  28296. (JSC::Machine::tryCTICachePutByID):
  28297. (JSC::Machine::tryCTICacheGetByID):
  28298. * kjs/GetterSetter.h:
  28299. (JSC::GetterSetter::GetterSetter):
  28300. * kjs/JSCell.h:
  28301. * kjs/JSGlobalData.cpp:
  28302. (JSC::JSGlobalData::JSGlobalData):
  28303. * kjs/JSGlobalData.h:
  28304. * kjs/JSGlobalObject.h:
  28305. (JSC::StructureID::prototypeForLookup):
  28306. * kjs/JSNumberCell.h:
  28307. (JSC::JSNumberCell::JSNumberCell):
  28308. (JSC::jsNumberCell):
  28309. * kjs/JSObject.h:
  28310. (JSC::JSObject::prototype):
  28311. * kjs/JSString.cpp:
  28312. (JSC::jsString):
  28313. (JSC::jsSubstring):
  28314. (JSC::jsOwnedString):
  28315. * kjs/JSString.h:
  28316. (JSC::JSString::JSString):
  28317. (JSC::JSString::):
  28318. (JSC::jsSingleCharacterString):
  28319. (JSC::jsSingleCharacterSubstring):
  28320. (JSC::jsNontrivialString):
  28321. * kjs/SmallStrings.cpp:
  28322. (JSC::SmallStrings::createEmptyString):
  28323. (JSC::SmallStrings::createSingleCharacterString):
  28324. * kjs/StructureID.cpp:
  28325. (JSC::StructureID::StructureID):
  28326. (JSC::StructureID::addPropertyTransition):
  28327. (JSC::StructureID::getterSetterTransition):
  28328. (JSC::StructureIDChain::StructureIDChain):
  28329. * kjs/StructureID.h:
  28330. (JSC::StructureID::create):
  28331. (JSC::StructureID::storedPrototype):
  28332. 2008-09-09 Joerg Bornemann <joerg.bornemann@trolltech.com>
  28333. Reviewed by Sam Weinig.
  28334. https://bugs.webkit.org/show_bug.cgi?id=20746
  28335. Added WINCE platform macro.
  28336. * wtf/Platform.h:
  28337. 2008-09-09 Sam Weinig <sam@webkit.org>
  28338. Reviewed by Mark Rowe.
  28339. Remove unnecessary override of getOffset.
  28340. Sunspider reports this as a .6% progression.
  28341. * JavaScriptCore.exp:
  28342. * kjs/JSObject.h:
  28343. (JSC::JSObject::getDirectLocation):
  28344. (JSC::JSObject::getOwnPropertySlotForWrite):
  28345. (JSC::JSObject::putDirect):
  28346. * kjs/PropertyMap.cpp:
  28347. * kjs/PropertyMap.h:
  28348. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28349. Reviewed by Maciej Stachowiak.
  28350. Bug 20759: Remove MacroAssembler
  28351. <https://bugs.webkit.org/show_bug.cgi?id=20759>
  28352. Remove MacroAssembler and move its functionality to X86Assembler.
  28353. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  28354. * JavaScriptCore.xcodeproj/project.pbxproj:
  28355. * VM/CTI.cpp:
  28356. (JSC::CTI::emitGetArg):
  28357. (JSC::CTI::emitGetPutArg):
  28358. (JSC::CTI::emitPutArg):
  28359. (JSC::CTI::emitPutCTIParam):
  28360. (JSC::CTI::emitGetCTIParam):
  28361. (JSC::CTI::emitPutToCallFrameHeader):
  28362. (JSC::CTI::emitGetFromCallFrameHeader):
  28363. (JSC::CTI::emitPutResult):
  28364. (JSC::CTI::emitDebugExceptionCheck):
  28365. (JSC::CTI::emitJumpSlowCaseIfNotImm):
  28366. (JSC::CTI::emitJumpSlowCaseIfNotImms):
  28367. (JSC::CTI::emitFastArithDeTagImmediate):
  28368. (JSC::CTI::emitFastArithReTagImmediate):
  28369. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  28370. (JSC::CTI::emitFastArithImmToInt):
  28371. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  28372. (JSC::CTI::emitFastArithIntToImmNoCheck):
  28373. (JSC::CTI::compileOpCall):
  28374. (JSC::CTI::emitSlowScriptCheck):
  28375. (JSC::CTI::privateCompileMainPass):
  28376. (JSC::CTI::privateCompileSlowCases):
  28377. (JSC::CTI::privateCompile):
  28378. (JSC::CTI::privateCompileGetByIdSelf):
  28379. (JSC::CTI::privateCompileGetByIdProto):
  28380. (JSC::CTI::privateCompileGetByIdChain):
  28381. (JSC::CTI::privateCompilePutByIdReplace):
  28382. (JSC::CTI::privateArrayLengthTrampoline):
  28383. (JSC::CTI::privateStringLengthTrampoline):
  28384. (JSC::CTI::compileRegExp):
  28385. * VM/CTI.h:
  28386. (JSC::CallRecord::CallRecord):
  28387. (JSC::JmpTable::JmpTable):
  28388. (JSC::SlowCaseEntry::SlowCaseEntry):
  28389. (JSC::CTI::JSRInfo::JSRInfo):
  28390. * masm/MacroAssembler.h: Removed.
  28391. * masm/MacroAssemblerWin.cpp: Removed.
  28392. * masm/X86Assembler.h:
  28393. (JSC::X86Assembler::emitConvertToFastCall):
  28394. (JSC::X86Assembler::emitRestoreArgumentReference):
  28395. * wrec/WREC.h:
  28396. (JSC::WRECGenerator::WRECGenerator):
  28397. (JSC::WRECParser::WRECParser):
  28398. 2008-09-09 Sam Weinig <sam@webkit.org>
  28399. Reviewed by Cameron Zwarich.
  28400. Don't waste the first item in the PropertyStorage.
  28401. - Fix typo (makingCount -> markingCount)
  28402. - Remove undefined method declaration.
  28403. No change on Sunspider.
  28404. * kjs/JSObject.cpp:
  28405. (JSC::JSObject::mark):
  28406. * kjs/PropertyMap.cpp:
  28407. (JSC::PropertyMap::put):
  28408. (JSC::PropertyMap::remove):
  28409. (JSC::PropertyMap::getOffset):
  28410. (JSC::PropertyMap::insert):
  28411. (JSC::PropertyMap::rehash):
  28412. (JSC::PropertyMap::resizePropertyStorage):
  28413. (JSC::PropertyMap::checkConsistency):
  28414. * kjs/PropertyMap.h:
  28415. (JSC::PropertyMap::markingCount): Fix typo.
  28416. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28417. Not reviewed.
  28418. Speculative Windows build fix.
  28419. * masm/MacroAssemblerWin.cpp:
  28420. (JSC::MacroAssembler::emitConvertToFastCall):
  28421. (JSC::MacroAssembler::emitRestoreArgumentReference):
  28422. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28423. Reviewed by Maciej Stachowiak.
  28424. Bug 20755: Create an X86 namespace for register names and other things
  28425. <https://bugs.webkit.org/show_bug.cgi?id=20755>
  28426. Create an X86 namespace to put X86 register names. Perhaps I will move
  28427. opcode names here later as well.
  28428. * VM/CTI.cpp:
  28429. (JSC::CTI::emitGetArg):
  28430. (JSC::CTI::emitGetPutArg):
  28431. (JSC::CTI::emitPutArg):
  28432. (JSC::CTI::emitPutArgConstant):
  28433. (JSC::CTI::emitPutCTIParam):
  28434. (JSC::CTI::emitGetCTIParam):
  28435. (JSC::CTI::emitPutToCallFrameHeader):
  28436. (JSC::CTI::emitGetFromCallFrameHeader):
  28437. (JSC::CTI::emitPutResult):
  28438. (JSC::CTI::emitDebugExceptionCheck):
  28439. (JSC::CTI::emitJumpSlowCaseIfNotImms):
  28440. (JSC::CTI::compileOpCall):
  28441. (JSC::CTI::emitSlowScriptCheck):
  28442. (JSC::CTI::privateCompileMainPass):
  28443. (JSC::CTI::privateCompileSlowCases):
  28444. (JSC::CTI::privateCompile):
  28445. (JSC::CTI::privateCompileGetByIdSelf):
  28446. (JSC::CTI::privateCompileGetByIdProto):
  28447. (JSC::CTI::privateCompileGetByIdChain):
  28448. (JSC::CTI::privateCompilePutByIdReplace):
  28449. (JSC::CTI::privateArrayLengthTrampoline):
  28450. (JSC::CTI::privateStringLengthTrampoline):
  28451. (JSC::CTI::compileRegExp):
  28452. * VM/CTI.h:
  28453. * masm/X86Assembler.h:
  28454. (JSC::X86::):
  28455. (JSC::X86Assembler::emitModRm_rm):
  28456. (JSC::X86Assembler::emitModRm_rm_Unchecked):
  28457. (JSC::X86Assembler::emitModRm_rmsib):
  28458. * wrec/WREC.cpp:
  28459. (JSC::WRECGenerator::generateNonGreedyQuantifier):
  28460. (JSC::WRECGenerator::generateGreedyQuantifier):
  28461. (JSC::WRECGenerator::generateParentheses):
  28462. (JSC::WRECGenerator::generateBackreference):
  28463. (JSC::WRECGenerator::gernerateDisjunction):
  28464. * wrec/WREC.h:
  28465. 2008-09-09 Sam Weinig <sam@webkit.org>
  28466. Reviewed by Geoffrey Garen.
  28467. Remove unnecessary friend declaration.
  28468. * kjs/PropertyMap.h:
  28469. 2008-09-09 Sam Weinig <sam@webkit.org>
  28470. Reviewed by Geoffrey Garen.
  28471. Replace uses of PropertyMap::get and PropertyMap::getLocation with
  28472. PropertyMap::getOffset.
  28473. Sunspider reports this as a .6% improvement.
  28474. * JavaScriptCore.exp:
  28475. * kjs/JSObject.cpp:
  28476. (JSC::JSObject::put):
  28477. (JSC::JSObject::deleteProperty):
  28478. (JSC::JSObject::getPropertyAttributes):
  28479. * kjs/JSObject.h:
  28480. (JSC::JSObject::getDirect):
  28481. (JSC::JSObject::getDirectLocation):
  28482. (JSC::JSObject::locationForOffset):
  28483. * kjs/PropertyMap.cpp:
  28484. (JSC::PropertyMap::remove):
  28485. (JSC::PropertyMap::getOffset):
  28486. * kjs/PropertyMap.h:
  28487. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28488. Reviewed by Sam Weinig.
  28489. Bug 20754: Remove emit prefix from assembler opcode methods
  28490. <https://bugs.webkit.org/show_bug.cgi?id=20754>
  28491. * VM/CTI.cpp:
  28492. (JSC::CTI::emitGetArg):
  28493. (JSC::CTI::emitGetPutArg):
  28494. (JSC::CTI::emitPutArg):
  28495. (JSC::CTI::emitPutArgConstant):
  28496. (JSC::CTI::emitPutCTIParam):
  28497. (JSC::CTI::emitGetCTIParam):
  28498. (JSC::CTI::emitPutToCallFrameHeader):
  28499. (JSC::CTI::emitGetFromCallFrameHeader):
  28500. (JSC::CTI::emitPutResult):
  28501. (JSC::CTI::emitDebugExceptionCheck):
  28502. (JSC::CTI::emitCall):
  28503. (JSC::CTI::emitJumpSlowCaseIfNotImm):
  28504. (JSC::CTI::emitJumpSlowCaseIfNotImms):
  28505. (JSC::CTI::emitFastArithDeTagImmediate):
  28506. (JSC::CTI::emitFastArithReTagImmediate):
  28507. (JSC::CTI::emitFastArithPotentiallyReTagImmediate):
  28508. (JSC::CTI::emitFastArithImmToInt):
  28509. (JSC::CTI::emitFastArithIntToImmOrSlowCase):
  28510. (JSC::CTI::emitFastArithIntToImmNoCheck):
  28511. (JSC::CTI::compileOpCall):
  28512. (JSC::CTI::emitSlowScriptCheck):
  28513. (JSC::CTI::privateCompileMainPass):
  28514. (JSC::CTI::privateCompileSlowCases):
  28515. (JSC::CTI::privateCompile):
  28516. (JSC::CTI::privateCompileGetByIdSelf):
  28517. (JSC::CTI::privateCompileGetByIdProto):
  28518. (JSC::CTI::privateCompileGetByIdChain):
  28519. (JSC::CTI::privateCompilePutByIdReplace):
  28520. (JSC::CTI::privateArrayLengthTrampoline):
  28521. (JSC::CTI::privateStringLengthTrampoline):
  28522. (JSC::CTI::compileRegExp):
  28523. * masm/MacroAssemblerWin.cpp:
  28524. (JSC::MacroAssembler::emitConvertToFastCall):
  28525. (JSC::MacroAssembler::emitRestoreArgumentReference):
  28526. * masm/X86Assembler.h:
  28527. (JSC::X86Assembler::pushl_r):
  28528. (JSC::X86Assembler::pushl_m):
  28529. (JSC::X86Assembler::popl_r):
  28530. (JSC::X86Assembler::popl_m):
  28531. (JSC::X86Assembler::movl_rr):
  28532. (JSC::X86Assembler::addl_rr):
  28533. (JSC::X86Assembler::addl_i8r):
  28534. (JSC::X86Assembler::addl_i32r):
  28535. (JSC::X86Assembler::addl_mr):
  28536. (JSC::X86Assembler::andl_rr):
  28537. (JSC::X86Assembler::andl_i32r):
  28538. (JSC::X86Assembler::cmpl_i8r):
  28539. (JSC::X86Assembler::cmpl_rr):
  28540. (JSC::X86Assembler::cmpl_rm):
  28541. (JSC::X86Assembler::cmpl_i32r):
  28542. (JSC::X86Assembler::cmpl_i32m):
  28543. (JSC::X86Assembler::cmpw_rm):
  28544. (JSC::X86Assembler::orl_rr):
  28545. (JSC::X86Assembler::subl_rr):
  28546. (JSC::X86Assembler::subl_i8r):
  28547. (JSC::X86Assembler::subl_i32r):
  28548. (JSC::X86Assembler::subl_mr):
  28549. (JSC::X86Assembler::testl_i32r):
  28550. (JSC::X86Assembler::testl_rr):
  28551. (JSC::X86Assembler::xorl_i8r):
  28552. (JSC::X86Assembler::xorl_rr):
  28553. (JSC::X86Assembler::sarl_i8r):
  28554. (JSC::X86Assembler::sarl_CLr):
  28555. (JSC::X86Assembler::shl_i8r):
  28556. (JSC::X86Assembler::shll_CLr):
  28557. (JSC::X86Assembler::mull_rr):
  28558. (JSC::X86Assembler::idivl_r):
  28559. (JSC::X86Assembler::cdq):
  28560. (JSC::X86Assembler::movl_mr):
  28561. (JSC::X86Assembler::movzwl_mr):
  28562. (JSC::X86Assembler::movl_rm):
  28563. (JSC::X86Assembler::movl_i32r):
  28564. (JSC::X86Assembler::movl_i32m):
  28565. (JSC::X86Assembler::leal_mr):
  28566. (JSC::X86Assembler::ret):
  28567. (JSC::X86Assembler::jmp_r):
  28568. (JSC::X86Assembler::jmp_m):
  28569. (JSC::X86Assembler::call_r):
  28570. * wrec/WREC.cpp:
  28571. (JSC::WRECGenerator::generateBacktrack1):
  28572. (JSC::WRECGenerator::generateBacktrackBackreference):
  28573. (JSC::WRECGenerator::generateBackreferenceQuantifier):
  28574. (JSC::WRECGenerator::generateNonGreedyQuantifier):
  28575. (JSC::WRECGenerator::generateGreedyQuantifier):
  28576. (JSC::WRECGenerator::generatePatternCharacter):
  28577. (JSC::WRECGenerator::generateCharacterClassInvertedRange):
  28578. (JSC::WRECGenerator::generateCharacterClassInverted):
  28579. (JSC::WRECGenerator::generateCharacterClass):
  28580. (JSC::WRECGenerator::generateParentheses):
  28581. (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
  28582. (JSC::WRECGenerator::generateAssertionBOL):
  28583. (JSC::WRECGenerator::generateAssertionEOL):
  28584. (JSC::WRECGenerator::generateAssertionWordBoundary):
  28585. (JSC::WRECGenerator::generateBackreference):
  28586. (JSC::WRECGenerator::gernerateDisjunction):
  28587. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28588. Reviewed by Maciej Stachowiak.
  28589. Clean up the WREC code some more.
  28590. * VM/CTI.cpp:
  28591. (JSC::CTI::compileRegExp):
  28592. * wrec/WREC.cpp:
  28593. (JSC::getCharacterClassNewline):
  28594. (JSC::getCharacterClassDigits):
  28595. (JSC::getCharacterClassSpaces):
  28596. (JSC::getCharacterClassWordchar):
  28597. (JSC::getCharacterClassNondigits):
  28598. (JSC::getCharacterClassNonspaces):
  28599. (JSC::getCharacterClassNonwordchar):
  28600. (JSC::WRECGenerator::generateBacktrack1):
  28601. (JSC::WRECGenerator::generateBacktrackBackreference):
  28602. (JSC::WRECGenerator::generateBackreferenceQuantifier):
  28603. (JSC::WRECGenerator::generateNonGreedyQuantifier):
  28604. (JSC::WRECGenerator::generateGreedyQuantifier):
  28605. (JSC::WRECGenerator::generatePatternCharacter):
  28606. (JSC::WRECGenerator::generateCharacterClassInvertedRange):
  28607. (JSC::WRECGenerator::generateCharacterClassInverted):
  28608. (JSC::WRECGenerator::generateCharacterClass):
  28609. (JSC::WRECGenerator::generateParentheses):
  28610. (JSC::WRECGenerator::gererateParenthesesResetTrampoline):
  28611. (JSC::WRECGenerator::generateAssertionBOL):
  28612. (JSC::WRECGenerator::generateAssertionEOL):
  28613. (JSC::WRECGenerator::generateAssertionWordBoundary):
  28614. (JSC::WRECGenerator::generateBackreference):
  28615. (JSC::WRECGenerator::gernerateDisjunction):
  28616. (JSC::WRECParser::parseCharacterClass):
  28617. (JSC::WRECParser::parseEscape):
  28618. (JSC::WRECParser::parseTerm):
  28619. * wrec/WREC.h:
  28620. 2008-09-09 Mark Rowe <mrowe@apple.com>
  28621. Build fix, rubber-stamped by Anders Carlsson.
  28622. Silence spurious build warnings about missing format attributes on functions in Assertions.cpp.
  28623. * JavaScriptCore.xcodeproj/project.pbxproj:
  28624. 2008-09-09 Mark Rowe <mrowe@apple.com>
  28625. Rubber-stamped by Oliver Hunt.
  28626. Fix builds using the "debug" variant.
  28627. This reverts r36130 and tweaks Identifier to export the same symbols for Debug
  28628. and Release configurations.
  28629. * Configurations/JavaScriptCore.xcconfig:
  28630. * DerivedSources.make:
  28631. * JavaScriptCore.Debug.exp: Removed.
  28632. * JavaScriptCore.base.exp: Removed.
  28633. * JavaScriptCore.exp: Added.
  28634. * JavaScriptCore.xcodeproj/project.pbxproj:
  28635. * kjs/identifier.cpp:
  28636. (JSC::Identifier::addSlowCase): #ifdef the call to checkSameIdentifierTable so that
  28637. there is no overhead in Release builds.
  28638. (JSC::Identifier::checkSameIdentifierTable): Add empty functions for Release builds.
  28639. * kjs/identifier.h:
  28640. (JSC::Identifier::add): #ifdef the calls to checkSameIdentifierTable so that there is
  28641. no overhead in Release builds, and remove the inline definitions of checkSameIdentifierTable.
  28642. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28643. Reviewed by Maciej Stachowiak.
  28644. Clean up WREC a bit to bring it closer to our coding style guidelines.
  28645. * wrec/WREC.cpp:
  28646. (JSC::):
  28647. (JSC::getCharacterClass_newline):
  28648. (JSC::getCharacterClass_d):
  28649. (JSC::getCharacterClass_s):
  28650. (JSC::getCharacterClass_w):
  28651. (JSC::getCharacterClass_D):
  28652. (JSC::getCharacterClass_S):
  28653. (JSC::getCharacterClass_W):
  28654. (JSC::CharacterClassConstructor::append):
  28655. (JSC::WRECGenerator::generateNonGreedyQuantifier):
  28656. (JSC::WRECGenerator::generateGreedyQuantifier):
  28657. (JSC::WRECGenerator::generateCharacterClassInverted):
  28658. (JSC::WRECParser::parseQuantifier):
  28659. (JSC::WRECParser::parsePatternCharacterQualifier):
  28660. (JSC::WRECParser::parseCharacterClassQuantifier):
  28661. (JSC::WRECParser::parseBackreferenceQuantifier):
  28662. * wrec/WREC.h:
  28663. (JSC::Quantifier::):
  28664. (JSC::Quantifier::Quantifier):
  28665. 2008-09-09 Jungshik Shin <jungshik.shin@gmail.com>
  28666. Reviewed by Alexey Proskuryakov.
  28667. Try MIME charset names before trying IANA names
  28668. ( https://bugs.webkit.org/show_bug.cgi?id=17537 )
  28669. * wtf/StringExtras.h: (strcasecmp): Added.
  28670. 2008-09-09 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28671. Reviewed by Mark Rowe.
  28672. Bug 20719: REGRESSION (r36135-36244): Hangs, then crashes after several seconds
  28673. <https://bugs.webkit.org/show_bug.cgi?id=20719>
  28674. <rdar://problem/6205787>
  28675. Fix a typo in the case-insensitive matching of character patterns.
  28676. * wrec/WREC.cpp:
  28677. (JSC::WRECGenerator::generatePatternCharacter):
  28678. 2008-09-09 Maciej Stachowiak <mjs@apple.com>
  28679. Reviewed by Sam Weinig.
  28680. - allow polymorphic inline cache to handle Math object functions and possibly other similar things
  28681. 1.012x speedup on SunSpider.
  28682. * kjs/MathObject.cpp:
  28683. (JSC::MathObject::getOwnPropertySlot):
  28684. * kjs/lookup.cpp:
  28685. (JSC::setUpStaticFunctionSlot):
  28686. * kjs/lookup.h:
  28687. (JSC::getStaticPropertySlot):
  28688. 2008-09-08 Sam Weinig <sam@webkit.org>
  28689. Reviewed by Maciej Stachowiak and Oliver Hunt.
  28690. Split storage of properties out of the PropertyMap and into the JSObject
  28691. to allow sharing PropertyMap on the StructureID. In order to get this
  28692. function correctly, the StructureID's transition mappings were changed to
  28693. transition based on property name and attribute pairs, instead of just
  28694. property name.
  28695. - Removes the single property optimization now that the PropertyMap is shared.
  28696. This will be replaced by in-lining some values on the JSObject.
  28697. This is a wash on Sunspider and a 6.7% win on the v8 test suite.
  28698. * JavaScriptCore.base.exp:
  28699. * VM/CTI.cpp:
  28700. (JSC::CTI::privateCompileGetByIdSelf): Get the storage directly off the JSObject.
  28701. (JSC::CTI::privateCompileGetByIdProto): Ditto.
  28702. (JSC::CTI::privateCompileGetByIdChain): Ditto.
  28703. (JSC::CTI::privateCompilePutByIdReplace): Ditto.
  28704. * kjs/JSObject.cpp:
  28705. (JSC::JSObject::mark): Mark the PropertyStorage.
  28706. (JSC::JSObject::put): Update to get the propertyMap of the StructureID.
  28707. (JSC::JSObject::deleteProperty): Ditto.
  28708. (JSC::JSObject::defineGetter): Return early if the property is already a getter/setter.
  28709. (JSC::JSObject::defineSetter): Ditto.
  28710. (JSC::JSObject::getPropertyAttributes): Update to get the propertyMap of the StructureID
  28711. (JSC::JSObject::getPropertyNames): Ditto.
  28712. (JSC::JSObject::removeDirect): Ditto.
  28713. * kjs/JSObject.h: Remove PropertyMap and add PropertyStorage.
  28714. (JSC::JSObject::propertyStorage): return the PropertyStorage.
  28715. (JSC::JSObject::getDirect): Update to get the propertyMap of the StructureID.
  28716. (JSC::JSObject::getDirectLocation): Ditto.
  28717. (JSC::JSObject::offsetForLocation): Compute location directly.
  28718. (JSC::JSObject::hasCustomProperties): Update to get the propertyMap of the StructureID.
  28719. (JSC::JSObject::hasGetterSetterProperties): Ditto.
  28720. (JSC::JSObject::getDirectOffset): Get by indexing into PropertyStorage.
  28721. (JSC::JSObject::putDirectOffset): Put by indexing into PropertyStorage.
  28722. (JSC::JSObject::getOwnPropertySlotForWrite): Update to get the propertyMap of the StructureID.
  28723. (JSC::JSObject::getOwnPropertySlot): Ditto.
  28724. (JSC::JSObject::putDirect): Move putting into the StructureID unless the property already exists.
  28725. * kjs/PropertyMap.cpp: Use the propertyStorage as the storage for the JSValues.
  28726. (JSC::PropertyMap::checkConsistency):
  28727. (JSC::PropertyMap::operator=):
  28728. (JSC::PropertyMap::~PropertyMap):
  28729. (JSC::PropertyMap::get):
  28730. (JSC::PropertyMap::getLocation):
  28731. (JSC::PropertyMap::put):
  28732. (JSC::PropertyMap::getOffset):
  28733. (JSC::PropertyMap::insert):
  28734. (JSC::PropertyMap::expand):
  28735. (JSC::PropertyMap::rehash):
  28736. (JSC::PropertyMap::createTable):
  28737. (JSC::PropertyMap::resizePropertyStorage): Resize the storage to match the size of the map
  28738. (JSC::PropertyMap::remove):
  28739. (JSC::PropertyMap::getEnumerablePropertyNames):
  28740. * kjs/PropertyMap.h:
  28741. (JSC::PropertyMapEntry::PropertyMapEntry):
  28742. (JSC::PropertyMap::isEmpty):
  28743. (JSC::PropertyMap::size):
  28744. (JSC::PropertyMap::makingCount):
  28745. (JSC::PropertyMap::PropertyMap):
  28746. * kjs/StructureID.cpp:
  28747. (JSC::StructureID::addPropertyTransition): Transitions now are based off the property name
  28748. and attributes.
  28749. (JSC::StructureID::toDictionaryTransition): Copy the map.
  28750. (JSC::StructureID::changePrototypeTransition): Copy the map.
  28751. (JSC::StructureID::getterSetterTransition): Copy the map.
  28752. (JSC::StructureID::~StructureID):
  28753. * kjs/StructureID.h:
  28754. (JSC::TransitionTableHash::hash): Custom hash for transition map.
  28755. (JSC::TransitionTableHash::equal): Ditto.
  28756. (JSC::TransitionTableHashTraits::emptyValue): Custom traits for transition map
  28757. (JSC::TransitionTableHashTraits::constructDeletedValue): Ditto.
  28758. (JSC::TransitionTableHashTraits::isDeletedValue): Ditto.
  28759. (JSC::StructureID::propertyMap): Added.
  28760. 2008-09-08 Oliver Hunt <oliver@apple.com>
  28761. Reviewed by Mark Rowe.
  28762. Bug 20694: Slow Script error pops up when running Dromaeo tests
  28763. Correct error in timeout logic where execution tick count would
  28764. be reset to incorrect value due to incorrect offset and indirection.
  28765. Codegen for the slow script dialog was factored out into a separate
  28766. method (emitSlowScriptCheck) rather than having multiple copies of
  28767. the same code. Also added calls to generate slow script checks
  28768. for loop_if_less and loop_if_true opcodes.
  28769. * VM/CTI.cpp:
  28770. (JSC::CTI::emitSlowScriptCheck):
  28771. (JSC::CTI::privateCompileMainPass):
  28772. (JSC::CTI::privateCompileSlowCases):
  28773. * VM/CTI.h:
  28774. 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28775. Reviewed by Maciej Stachowiak.
  28776. Remove references to the removed WRECompiler class.
  28777. * VM/Machine.h:
  28778. * wrec/WREC.h:
  28779. 2008-09-08 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28780. Rubber-stamped by Mark Rowe.
  28781. Fix the build with CTI enabled but WREC disabled.
  28782. * VM/CTI.cpp:
  28783. * VM/CTI.h:
  28784. 2008-09-08 Dan Bernstein <mitz@apple.com>
  28785. - build fix
  28786. * kjs/nodes.h:
  28787. (JSC::StatementNode::):
  28788. (JSC::BlockNode::):
  28789. 2008-09-08 Kevin McCullough <kmccullough@apple.com>
  28790. Reviewed by Geoff.
  28791. <rdar://problem/6134407> Breakpoints in for loops, while loops or
  28792. conditions without curly braces don't break. (19306)
  28793. -Statement Lists already emit debug hooks but conditionals without
  28794. brackets are not lists.
  28795. * kjs/nodes.cpp:
  28796. (KJS::IfNode::emitCode):
  28797. (KJS::IfElseNode::emitCode):
  28798. (KJS::DoWhileNode::emitCode):
  28799. (KJS::WhileNode::emitCode):
  28800. (KJS::ForNode::emitCode):
  28801. (KJS::ForInNode::emitCode):
  28802. * kjs/nodes.h:
  28803. (KJS::StatementNode::):
  28804. (KJS::BlockNode::):
  28805. 2008-09-08 Maciej Stachowiak <mjs@apple.com>
  28806. Reviewed by Anders Carlsson.
  28807. - Cache the code generated for eval to speed up SunSpider and web sites
  28808. https://bugs.webkit.org/show_bug.cgi?id=20718
  28809. 1.052x on SunSpider
  28810. 2.29x on date-format-tofte
  28811. Lots of real sites seem to get many hits on this cache as well,
  28812. including GMail, Google Spreadsheets, Slate and Digg (the last of
  28813. these gets over 100 hits on initial page load).
  28814. * VM/CodeBlock.h:
  28815. (JSC::EvalCodeCache::get):
  28816. * VM/Machine.cpp:
  28817. (JSC::Machine::callEval):
  28818. (JSC::Machine::privateExecute):
  28819. (JSC::Machine::cti_op_call_eval):
  28820. * VM/Machine.h:
  28821. 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28822. Reviewed by Oliver Hunt.
  28823. Bug 20711: Change KJS prefix on preprocessor macros to JSC
  28824. <https://bugs.webkit.org/show_bug.cgi?id=20711>
  28825. * kjs/CommonIdentifiers.cpp:
  28826. (JSC::CommonIdentifiers::CommonIdentifiers):
  28827. * kjs/CommonIdentifiers.h:
  28828. * kjs/PropertySlot.h:
  28829. (JSC::PropertySlot::getValue):
  28830. (JSC::PropertySlot::putValue):
  28831. (JSC::PropertySlot::setValueSlot):
  28832. (JSC::PropertySlot::setValue):
  28833. (JSC::PropertySlot::setRegisterSlot):
  28834. * kjs/lookup.h:
  28835. * kjs/nodes.cpp:
  28836. * kjs/nodes.h:
  28837. (JSC::Node::):
  28838. (JSC::ExpressionNode::):
  28839. (JSC::StatementNode::):
  28840. (JSC::NullNode::):
  28841. (JSC::BooleanNode::):
  28842. (JSC::NumberNode::):
  28843. (JSC::ImmediateNumberNode::):
  28844. (JSC::StringNode::):
  28845. (JSC::RegExpNode::):
  28846. (JSC::ThisNode::):
  28847. (JSC::ResolveNode::):
  28848. (JSC::ElementNode::):
  28849. (JSC::ArrayNode::):
  28850. (JSC::PropertyNode::):
  28851. (JSC::PropertyListNode::):
  28852. (JSC::ObjectLiteralNode::):
  28853. (JSC::BracketAccessorNode::):
  28854. (JSC::DotAccessorNode::):
  28855. (JSC::ArgumentListNode::):
  28856. (JSC::ArgumentsNode::):
  28857. (JSC::NewExprNode::):
  28858. (JSC::EvalFunctionCallNode::):
  28859. (JSC::FunctionCallValueNode::):
  28860. (JSC::FunctionCallResolveNode::):
  28861. (JSC::FunctionCallBracketNode::):
  28862. (JSC::FunctionCallDotNode::):
  28863. (JSC::PrePostResolveNode::):
  28864. (JSC::PostfixResolveNode::):
  28865. (JSC::PostfixBracketNode::):
  28866. (JSC::PostfixDotNode::):
  28867. (JSC::PostfixErrorNode::):
  28868. (JSC::DeleteResolveNode::):
  28869. (JSC::DeleteBracketNode::):
  28870. (JSC::DeleteDotNode::):
  28871. (JSC::DeleteValueNode::):
  28872. (JSC::VoidNode::):
  28873. (JSC::TypeOfResolveNode::):
  28874. (JSC::TypeOfValueNode::):
  28875. (JSC::PrefixResolveNode::):
  28876. (JSC::PrefixBracketNode::):
  28877. (JSC::PrefixDotNode::):
  28878. (JSC::PrefixErrorNode::):
  28879. (JSC::UnaryPlusNode::):
  28880. (JSC::NegateNode::):
  28881. (JSC::BitwiseNotNode::):
  28882. (JSC::LogicalNotNode::):
  28883. (JSC::MultNode::):
  28884. (JSC::DivNode::):
  28885. (JSC::ModNode::):
  28886. (JSC::AddNode::):
  28887. (JSC::SubNode::):
  28888. (JSC::LeftShiftNode::):
  28889. (JSC::RightShiftNode::):
  28890. (JSC::UnsignedRightShiftNode::):
  28891. (JSC::LessNode::):
  28892. (JSC::GreaterNode::):
  28893. (JSC::LessEqNode::):
  28894. (JSC::GreaterEqNode::):
  28895. (JSC::ThrowableBinaryOpNode::):
  28896. (JSC::InstanceOfNode::):
  28897. (JSC::InNode::):
  28898. (JSC::EqualNode::):
  28899. (JSC::NotEqualNode::):
  28900. (JSC::StrictEqualNode::):
  28901. (JSC::NotStrictEqualNode::):
  28902. (JSC::BitAndNode::):
  28903. (JSC::BitOrNode::):
  28904. (JSC::BitXOrNode::):
  28905. (JSC::LogicalOpNode::):
  28906. (JSC::ConditionalNode::):
  28907. (JSC::ReadModifyResolveNode::):
  28908. (JSC::AssignResolveNode::):
  28909. (JSC::ReadModifyBracketNode::):
  28910. (JSC::AssignBracketNode::):
  28911. (JSC::AssignDotNode::):
  28912. (JSC::ReadModifyDotNode::):
  28913. (JSC::AssignErrorNode::):
  28914. (JSC::CommaNode::):
  28915. (JSC::VarDeclCommaNode::):
  28916. (JSC::ConstDeclNode::):
  28917. (JSC::ConstStatementNode::):
  28918. (JSC::EmptyStatementNode::):
  28919. (JSC::DebuggerStatementNode::):
  28920. (JSC::ExprStatementNode::):
  28921. (JSC::VarStatementNode::):
  28922. (JSC::IfNode::):
  28923. (JSC::IfElseNode::):
  28924. (JSC::DoWhileNode::):
  28925. (JSC::WhileNode::):
  28926. (JSC::ForNode::):
  28927. (JSC::ContinueNode::):
  28928. (JSC::BreakNode::):
  28929. (JSC::ReturnNode::):
  28930. (JSC::WithNode::):
  28931. (JSC::LabelNode::):
  28932. (JSC::ThrowNode::):
  28933. (JSC::TryNode::):
  28934. (JSC::ParameterNode::):
  28935. (JSC::ScopeNode::):
  28936. (JSC::ProgramNode::):
  28937. (JSC::EvalNode::):
  28938. (JSC::FunctionBodyNode::):
  28939. (JSC::FuncExprNode::):
  28940. (JSC::FuncDeclNode::):
  28941. (JSC::CaseClauseNode::):
  28942. (JSC::ClauseListNode::):
  28943. (JSC::CaseBlockNode::):
  28944. (JSC::SwitchNode::):
  28945. 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  28946. Reviewed by Maciej Stachowiak.
  28947. Bug 20704: Replace the KJS namespace
  28948. <https://bugs.webkit.org/show_bug.cgi?id=20704>
  28949. Rename the KJS namespace to JSC. There are still some uses of KJS in
  28950. preprocessor macros and comments, but these will also be changed some
  28951. time in the near future.
  28952. * API/APICast.h:
  28953. (toJS):
  28954. (toRef):
  28955. (toGlobalRef):
  28956. * API/JSBase.cpp:
  28957. * API/JSCallbackConstructor.cpp:
  28958. * API/JSCallbackConstructor.h:
  28959. * API/JSCallbackFunction.cpp:
  28960. * API/JSCallbackFunction.h:
  28961. * API/JSCallbackObject.cpp:
  28962. * API/JSCallbackObject.h:
  28963. * API/JSCallbackObjectFunctions.h:
  28964. * API/JSClassRef.cpp:
  28965. (OpaqueJSClass::staticValues):
  28966. (OpaqueJSClass::staticFunctions):
  28967. * API/JSClassRef.h:
  28968. * API/JSContextRef.cpp:
  28969. * API/JSObjectRef.cpp:
  28970. * API/JSProfilerPrivate.cpp:
  28971. * API/JSStringRef.cpp:
  28972. * API/JSValueRef.cpp:
  28973. (JSValueGetType):
  28974. * API/OpaqueJSString.cpp:
  28975. * API/OpaqueJSString.h:
  28976. * JavaScriptCore.Debug.exp:
  28977. * JavaScriptCore.base.exp:
  28978. * VM/CTI.cpp:
  28979. (JSC::):
  28980. * VM/CTI.h:
  28981. * VM/CodeBlock.cpp:
  28982. * VM/CodeBlock.h:
  28983. * VM/CodeGenerator.cpp:
  28984. * VM/CodeGenerator.h:
  28985. * VM/ExceptionHelpers.cpp:
  28986. * VM/ExceptionHelpers.h:
  28987. * VM/Instruction.h:
  28988. * VM/JSPropertyNameIterator.cpp:
  28989. * VM/JSPropertyNameIterator.h:
  28990. * VM/LabelID.h:
  28991. * VM/Machine.cpp:
  28992. * VM/Machine.h:
  28993. * VM/Opcode.cpp:
  28994. * VM/Opcode.h:
  28995. * VM/Register.h:
  28996. (WTF::):
  28997. * VM/RegisterFile.cpp:
  28998. * VM/RegisterFile.h:
  28999. * VM/RegisterID.h:
  29000. (WTF::):
  29001. * VM/SamplingTool.cpp:
  29002. * VM/SamplingTool.h:
  29003. * VM/SegmentedVector.h:
  29004. * kjs/ArgList.cpp:
  29005. * kjs/ArgList.h:
  29006. * kjs/Arguments.cpp:
  29007. * kjs/Arguments.h:
  29008. * kjs/ArrayConstructor.cpp:
  29009. * kjs/ArrayConstructor.h:
  29010. * kjs/ArrayPrototype.cpp:
  29011. * kjs/ArrayPrototype.h:
  29012. * kjs/BatchedTransitionOptimizer.h:
  29013. * kjs/BooleanConstructor.cpp:
  29014. * kjs/BooleanConstructor.h:
  29015. * kjs/BooleanObject.cpp:
  29016. * kjs/BooleanObject.h:
  29017. * kjs/BooleanPrototype.cpp:
  29018. * kjs/BooleanPrototype.h:
  29019. * kjs/CallData.cpp:
  29020. * kjs/CallData.h:
  29021. * kjs/ClassInfo.h:
  29022. * kjs/CommonIdentifiers.cpp:
  29023. * kjs/CommonIdentifiers.h:
  29024. * kjs/ConstructData.cpp:
  29025. * kjs/ConstructData.h:
  29026. * kjs/DateConstructor.cpp:
  29027. * kjs/DateConstructor.h:
  29028. * kjs/DateInstance.cpp:
  29029. (JSC::DateInstance::msToGregorianDateTime):
  29030. * kjs/DateInstance.h:
  29031. * kjs/DateMath.cpp:
  29032. * kjs/DateMath.h:
  29033. * kjs/DatePrototype.cpp:
  29034. * kjs/DatePrototype.h:
  29035. * kjs/DebuggerCallFrame.cpp:
  29036. * kjs/DebuggerCallFrame.h:
  29037. * kjs/Error.cpp:
  29038. * kjs/Error.h:
  29039. * kjs/ErrorConstructor.cpp:
  29040. * kjs/ErrorConstructor.h:
  29041. * kjs/ErrorInstance.cpp:
  29042. * kjs/ErrorInstance.h:
  29043. * kjs/ErrorPrototype.cpp:
  29044. * kjs/ErrorPrototype.h:
  29045. * kjs/ExecState.cpp:
  29046. * kjs/ExecState.h:
  29047. * kjs/FunctionConstructor.cpp:
  29048. * kjs/FunctionConstructor.h:
  29049. * kjs/FunctionPrototype.cpp:
  29050. * kjs/FunctionPrototype.h:
  29051. * kjs/GetterSetter.cpp:
  29052. * kjs/GetterSetter.h:
  29053. * kjs/GlobalEvalFunction.cpp:
  29054. * kjs/GlobalEvalFunction.h:
  29055. * kjs/IndexToNameMap.cpp:
  29056. * kjs/IndexToNameMap.h:
  29057. * kjs/InitializeThreading.cpp:
  29058. * kjs/InitializeThreading.h:
  29059. * kjs/InternalFunction.cpp:
  29060. * kjs/InternalFunction.h:
  29061. (JSC::InternalFunction::InternalFunction):
  29062. * kjs/JSActivation.cpp:
  29063. * kjs/JSActivation.h:
  29064. * kjs/JSArray.cpp:
  29065. * kjs/JSArray.h:
  29066. * kjs/JSCell.cpp:
  29067. * kjs/JSCell.h:
  29068. * kjs/JSFunction.cpp:
  29069. * kjs/JSFunction.h:
  29070. (JSC::JSFunction::JSFunction):
  29071. * kjs/JSGlobalData.cpp:
  29072. (JSC::JSGlobalData::JSGlobalData):
  29073. * kjs/JSGlobalData.h:
  29074. * kjs/JSGlobalObject.cpp:
  29075. * kjs/JSGlobalObject.h:
  29076. * kjs/JSGlobalObjectFunctions.cpp:
  29077. * kjs/JSGlobalObjectFunctions.h:
  29078. * kjs/JSImmediate.cpp:
  29079. * kjs/JSImmediate.h:
  29080. * kjs/JSLock.cpp:
  29081. * kjs/JSLock.h:
  29082. * kjs/JSNotAnObject.cpp:
  29083. * kjs/JSNotAnObject.h:
  29084. * kjs/JSNumberCell.cpp:
  29085. * kjs/JSNumberCell.h:
  29086. * kjs/JSObject.cpp:
  29087. * kjs/JSObject.h:
  29088. * kjs/JSStaticScopeObject.cpp:
  29089. * kjs/JSStaticScopeObject.h:
  29090. * kjs/JSString.cpp:
  29091. * kjs/JSString.h:
  29092. * kjs/JSType.h:
  29093. * kjs/JSValue.cpp:
  29094. * kjs/JSValue.h:
  29095. * kjs/JSVariableObject.cpp:
  29096. * kjs/JSVariableObject.h:
  29097. * kjs/JSWrapperObject.cpp:
  29098. * kjs/JSWrapperObject.h:
  29099. * kjs/LabelStack.cpp:
  29100. * kjs/LabelStack.h:
  29101. * kjs/MathObject.cpp:
  29102. * kjs/MathObject.h:
  29103. * kjs/NativeErrorConstructor.cpp:
  29104. * kjs/NativeErrorConstructor.h:
  29105. * kjs/NativeErrorPrototype.cpp:
  29106. * kjs/NativeErrorPrototype.h:
  29107. * kjs/NodeInfo.h:
  29108. * kjs/NumberConstructor.cpp:
  29109. * kjs/NumberConstructor.h:
  29110. * kjs/NumberObject.cpp:
  29111. * kjs/NumberObject.h:
  29112. * kjs/NumberPrototype.cpp:
  29113. * kjs/NumberPrototype.h:
  29114. * kjs/ObjectConstructor.cpp:
  29115. * kjs/ObjectConstructor.h:
  29116. * kjs/ObjectPrototype.cpp:
  29117. * kjs/ObjectPrototype.h:
  29118. * kjs/Parser.cpp:
  29119. * kjs/Parser.h:
  29120. * kjs/PropertyMap.cpp:
  29121. (JSC::PropertyMapStatisticsExitLogger::~PropertyMapStatisticsExitLogger):
  29122. * kjs/PropertyMap.h:
  29123. * kjs/PropertyNameArray.cpp:
  29124. * kjs/PropertyNameArray.h:
  29125. * kjs/PropertySlot.cpp:
  29126. * kjs/PropertySlot.h:
  29127. * kjs/PrototypeFunction.cpp:
  29128. * kjs/PrototypeFunction.h:
  29129. * kjs/PutPropertySlot.h:
  29130. * kjs/RegExpConstructor.cpp:
  29131. * kjs/RegExpConstructor.h:
  29132. * kjs/RegExpObject.cpp:
  29133. * kjs/RegExpObject.h:
  29134. * kjs/RegExpPrototype.cpp:
  29135. * kjs/RegExpPrototype.h:
  29136. * kjs/ScopeChain.cpp:
  29137. * kjs/ScopeChain.h:
  29138. * kjs/ScopeChainMark.h:
  29139. * kjs/Shell.cpp:
  29140. (jscmain):
  29141. * kjs/SmallStrings.cpp:
  29142. * kjs/SmallStrings.h:
  29143. * kjs/SourceProvider.h:
  29144. * kjs/SourceRange.h:
  29145. * kjs/StringConstructor.cpp:
  29146. * kjs/StringConstructor.h:
  29147. * kjs/StringObject.cpp:
  29148. * kjs/StringObject.h:
  29149. * kjs/StringObjectThatMasqueradesAsUndefined.h:
  29150. * kjs/StringPrototype.cpp:
  29151. * kjs/StringPrototype.h:
  29152. * kjs/StructureID.cpp:
  29153. * kjs/StructureID.h:
  29154. * kjs/SymbolTable.h:
  29155. * kjs/collector.cpp:
  29156. * kjs/collector.h:
  29157. * kjs/completion.h:
  29158. * kjs/create_hash_table:
  29159. * kjs/debugger.cpp:
  29160. * kjs/debugger.h:
  29161. * kjs/dtoa.cpp:
  29162. * kjs/dtoa.h:
  29163. * kjs/grammar.y:
  29164. * kjs/identifier.cpp:
  29165. * kjs/identifier.h:
  29166. (JSC::Identifier::equal):
  29167. * kjs/interpreter.cpp:
  29168. * kjs/interpreter.h:
  29169. * kjs/lexer.cpp:
  29170. (JSC::Lexer::Lexer):
  29171. (JSC::Lexer::clear):
  29172. (JSC::Lexer::makeIdentifier):
  29173. * kjs/lexer.h:
  29174. * kjs/lookup.cpp:
  29175. * kjs/lookup.h:
  29176. * kjs/nodes.cpp:
  29177. * kjs/nodes.h:
  29178. * kjs/nodes2string.cpp:
  29179. * kjs/operations.cpp:
  29180. * kjs/operations.h:
  29181. * kjs/protect.h:
  29182. * kjs/regexp.cpp:
  29183. * kjs/regexp.h:
  29184. * kjs/ustring.cpp:
  29185. * kjs/ustring.h:
  29186. (JSC::operator!=):
  29187. (JSC::IdentifierRepHash::hash):
  29188. (WTF::):
  29189. * masm/MacroAssembler.h:
  29190. * masm/MacroAssemblerWin.cpp:
  29191. * masm/X86Assembler.h:
  29192. * pcre/pcre_exec.cpp:
  29193. * profiler/CallIdentifier.h:
  29194. (WTF::):
  29195. * profiler/HeavyProfile.cpp:
  29196. * profiler/HeavyProfile.h:
  29197. * profiler/Profile.cpp:
  29198. * profiler/Profile.h:
  29199. * profiler/ProfileGenerator.cpp:
  29200. * profiler/ProfileGenerator.h:
  29201. * profiler/ProfileNode.cpp:
  29202. * profiler/ProfileNode.h:
  29203. * profiler/Profiler.cpp:
  29204. * profiler/Profiler.h:
  29205. * profiler/TreeProfile.cpp:
  29206. * profiler/TreeProfile.h:
  29207. * wrec/WREC.cpp:
  29208. * wrec/WREC.h:
  29209. * wtf/AVLTree.h:
  29210. 2008-09-07 Maciej Stachowiak <mjs@apple.com>
  29211. Reviewed by Dan Bernstein.
  29212. - rename IA32MacroAssembler class to X86Assembler
  29213. We otherwise call the platform X86, and also, I don't see any macros.
  29214. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  29215. * JavaScriptCore.xcodeproj/project.pbxproj:
  29216. * masm/IA32MacroAsm.h: Removed.
  29217. * masm/MacroAssembler.h:
  29218. (KJS::MacroAssembler::MacroAssembler):
  29219. * masm/MacroAssemblerWin.cpp:
  29220. (KJS::MacroAssembler::emitRestoreArgumentReference):
  29221. * masm/X86Assembler.h: Copied from masm/IA32MacroAsm.h.
  29222. (KJS::X86Assembler::X86Assembler):
  29223. * wrec/WREC.cpp:
  29224. (KJS::WRECGenerator::generateNonGreedyQuantifier):
  29225. (KJS::WRECGenerator::generateGreedyQuantifier):
  29226. (KJS::WRECGenerator::generateParentheses):
  29227. (KJS::WRECGenerator::generateBackreference):
  29228. (KJS::WRECGenerator::gernerateDisjunction):
  29229. * wrec/WREC.h:
  29230. 2008-09-07 Cameron Zwarich <cwzwarich@webkit.org>
  29231. Not reviewed.
  29232. Visual C++ seems to have some odd casting rules, so just convert the
  29233. offending cast back to a C-style cast for now.
  29234. * kjs/collector.cpp:
  29235. (KJS::otherThreadStackPointer):
  29236. 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  29237. Reviewed by Mark Rowe.
  29238. Attempt to fix the Windows build by using a const_cast to cast regs.Esp
  29239. to a uintptr_t instead of a reinterpret_cast.
  29240. * kjs/collector.cpp:
  29241. (KJS::otherThreadStackPointer):
  29242. 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  29243. Reviewed by Sam Weinig.
  29244. Remove C-style casts from kjs/collector.cpp.
  29245. * kjs/collector.cpp:
  29246. (KJS::Heap::heapAllocate):
  29247. (KJS::currentThreadStackBase):
  29248. (KJS::Heap::markConservatively):
  29249. (KJS::otherThreadStackPointer):
  29250. (KJS::Heap::markOtherThreadConservatively):
  29251. (KJS::Heap::sweep):
  29252. 2008-09-07 Mark Rowe <mrowe@apple.com>
  29253. Build fix for the debug variant.
  29254. * DerivedSources.make: Also use the .Debug.exp exports file when building the debug variant.
  29255. 2008-09-07 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  29256. Reviewed by Timothy Hatcher.
  29257. Remove C-style casts from the CTI code.
  29258. * VM/CTI.cpp:
  29259. (KJS::CTI::emitGetArg):
  29260. (KJS::CTI::emitGetPutArg):
  29261. (KJS::ctiRepatchCallByReturnAddress):
  29262. (KJS::CTI::compileOpCall):
  29263. (KJS::CTI::privateCompileMainPass):
  29264. (KJS::CTI::privateCompileGetByIdSelf):
  29265. (KJS::CTI::privateCompileGetByIdProto):
  29266. (KJS::CTI::privateCompileGetByIdChain):
  29267. (KJS::CTI::privateCompilePutByIdReplace):
  29268. (KJS::CTI::privateArrayLengthTrampoline):
  29269. (KJS::CTI::privateStringLengthTrampoline):
  29270. === End merge of squirrelfish-extreme ===
  29271. 2008-09-06 Gavin Barraclough <barraclough@apple.com>
  29272. Reviewed by Sam Weinig. Adapted somewhat by Maciej Stachowiak.
  29273. - refactor WREC to share more of the JIT infrastructure with CTI
  29274. * VM/CTI.cpp:
  29275. (KJS::CTI::emitGetArg):
  29276. (KJS::CTI::emitGetPutArg):
  29277. (KJS::CTI::emitPutArg):
  29278. (KJS::CTI::emitPutArgConstant):
  29279. (KJS::CTI::emitPutCTIParam):
  29280. (KJS::CTI::emitGetCTIParam):
  29281. (KJS::CTI::emitPutToCallFrameHeader):
  29282. (KJS::CTI::emitGetFromCallFrameHeader):
  29283. (KJS::CTI::emitPutResult):
  29284. (KJS::CTI::emitDebugExceptionCheck):
  29285. (KJS::CTI::emitJumpSlowCaseIfNotImm):
  29286. (KJS::CTI::emitJumpSlowCaseIfNotImms):
  29287. (KJS::CTI::emitFastArithDeTagImmediate):
  29288. (KJS::CTI::emitFastArithReTagImmediate):
  29289. (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
  29290. (KJS::CTI::emitFastArithImmToInt):
  29291. (KJS::CTI::emitFastArithIntToImmOrSlowCase):
  29292. (KJS::CTI::emitFastArithIntToImmNoCheck):
  29293. (KJS::CTI::CTI):
  29294. (KJS::CTI::compileOpCall):
  29295. (KJS::CTI::privateCompileMainPass):
  29296. (KJS::CTI::privateCompileSlowCases):
  29297. (KJS::CTI::privateCompile):
  29298. (KJS::CTI::privateCompileGetByIdSelf):
  29299. (KJS::CTI::privateCompileGetByIdProto):
  29300. (KJS::CTI::privateCompileGetByIdChain):
  29301. (KJS::CTI::privateCompilePutByIdReplace):
  29302. (KJS::CTI::privateArrayLengthTrampoline):
  29303. (KJS::CTI::privateStringLengthTrampoline):
  29304. (KJS::CTI::compileRegExp):
  29305. * VM/CTI.h:
  29306. (KJS::CallRecord::CallRecord):
  29307. (KJS::JmpTable::JmpTable):
  29308. (KJS::SlowCaseEntry::SlowCaseEntry):
  29309. (KJS::CTI::JSRInfo::JSRInfo):
  29310. * kjs/regexp.cpp:
  29311. (KJS::RegExp::RegExp):
  29312. * wrec/WREC.cpp:
  29313. (KJS::GenerateParenthesesNonGreedyFunctor::GenerateParenthesesNonGreedyFunctor):
  29314. (KJS::GeneratePatternCharacterFunctor::generateAtom):
  29315. (KJS::GeneratePatternCharacterFunctor::backtrack):
  29316. (KJS::GenerateCharacterClassFunctor::generateAtom):
  29317. (KJS::GenerateCharacterClassFunctor::backtrack):
  29318. (KJS::GenerateBackreferenceFunctor::generateAtom):
  29319. (KJS::GenerateBackreferenceFunctor::backtrack):
  29320. (KJS::GenerateParenthesesNonGreedyFunctor::generateAtom):
  29321. (KJS::GenerateParenthesesNonGreedyFunctor::backtrack):
  29322. (KJS::WRECGenerate::generateBacktrack1):
  29323. (KJS::WRECGenerate::generateBacktrackBackreference):
  29324. (KJS::WRECGenerate::generateBackreferenceQuantifier):
  29325. (KJS::WRECGenerate::generateNonGreedyQuantifier):
  29326. (KJS::WRECGenerate::generateGreedyQuantifier):
  29327. (KJS::WRECGenerate::generatePatternCharacter):
  29328. (KJS::WRECGenerate::generateCharacterClassInvertedRange):
  29329. (KJS::WRECGenerate::generateCharacterClassInverted):
  29330. (KJS::WRECGenerate::generateCharacterClass):
  29331. (KJS::WRECGenerate::generateParentheses):
  29332. (KJS::WRECGenerate::generateParenthesesNonGreedy):
  29333. (KJS::WRECGenerate::gererateParenthesesResetTrampoline):
  29334. (KJS::WRECGenerate::generateAssertionBOL):
  29335. (KJS::WRECGenerate::generateAssertionEOL):
  29336. (KJS::WRECGenerate::generateAssertionWordBoundary):
  29337. (KJS::WRECGenerate::generateBackreference):
  29338. (KJS::WRECGenerate::gernerateDisjunction):
  29339. (KJS::WRECGenerate::terminateDisjunction):
  29340. (KJS::WRECParser::parseGreedyQuantifier):
  29341. (KJS::WRECParser::parseQuantifier):
  29342. (KJS::WRECParser::parsePatternCharacterQualifier):
  29343. (KJS::WRECParser::parseCharacterClassQuantifier):
  29344. (KJS::WRECParser::parseBackreferenceQuantifier):
  29345. (KJS::WRECParser::parseParentheses):
  29346. (KJS::WRECParser::parseCharacterClass):
  29347. (KJS::WRECParser::parseOctalEscape):
  29348. (KJS::WRECParser::parseEscape):
  29349. (KJS::WRECParser::parseTerm):
  29350. (KJS::WRECParser::parseDisjunction):
  29351. * wrec/WREC.h:
  29352. (KJS::WRECGenerate::WRECGenerate):
  29353. (KJS::WRECParser::):
  29354. (KJS::WRECParser::WRECParser):
  29355. (KJS::WRECParser::parseAlternative):
  29356. (KJS::WRECParser::isEndOfPattern):
  29357. 2008-09-06 Oliver Hunt <oliver@apple.com>
  29358. Reviewed by NOBODY (Build fix).
  29359. Fix the sampler build.
  29360. * VM/SamplingTool.h:
  29361. 2008-09-06 Oliver Hunt <oliver@apple.com>
  29362. Reviewed by Maciej Stachowiak.
  29363. Jump through the necessary hoops required to make MSVC cooperate with SFX
  29364. We now explicitly declare the calling convention on all cti_op_* cfunctions,
  29365. and return int instead of bool where appropriate (despite the cdecl calling
  29366. convention seems to state MSVC generates code that returns the result value
  29367. through ecx). SFX behaves slightly differently under MSVC, specifically it
  29368. stores the base argument address for the cti_op_* functions in the first
  29369. argument, and then does the required stack manipulation through that pointer.
  29370. This is necessary as MSVC's optimisations assume they have complete control
  29371. of the stack, and periodically elide our stack manipulations, or move
  29372. values in unexpected ways. MSVC also frequently produces tail calls which may
  29373. clobber the first argument, so the MSVC path is slightly less efficient due
  29374. to the need to restore it.
  29375. * JavaScriptCore.xcodeproj/project.pbxproj:
  29376. * VM/CTI.cpp:
  29377. (KJS::):
  29378. (KJS::CTI::compileOpCall):
  29379. (KJS::CTI::privateCompileMainPass):
  29380. (KJS::CTI::privateCompileSlowCases):
  29381. * VM/CTI.h:
  29382. * VM/Machine.cpp:
  29383. * VM/Machine.h:
  29384. * masm/MacroAssembler.h:
  29385. (KJS::MacroAssembler::emitConvertToFastCall):
  29386. * masm/MacroAssemblerIA32GCC.cpp: Removed.
  29387. For performance reasons we need these no-op functions to be inlined.
  29388. * masm/MacroAssemblerWin.cpp:
  29389. (KJS::MacroAssembler::emitRestoreArgumentReference):
  29390. * wtf/Platform.h:
  29391. 2008-09-05 Geoffrey Garen <ggaren@apple.com>
  29392. Reviewed by Maciej Stachowiak, or maybe the other way around.
  29393. Added the ability to coalesce JITCode buffer grow operations by first
  29394. growing the buffer and then executing unchecked puts to it.
  29395. About a 2% speedup on date-format-tofte.
  29396. * VM/CTI.cpp:
  29397. (KJS::CTI::compileOpCall):
  29398. * masm/IA32MacroAsm.h:
  29399. (KJS::JITCodeBuffer::ensureSpace):
  29400. (KJS::JITCodeBuffer::putByteUnchecked):
  29401. (KJS::JITCodeBuffer::putByte):
  29402. (KJS::JITCodeBuffer::putShortUnchecked):
  29403. (KJS::JITCodeBuffer::putShort):
  29404. (KJS::JITCodeBuffer::putIntUnchecked):
  29405. (KJS::JITCodeBuffer::putInt):
  29406. (KJS::IA32MacroAssembler::emitTestl_i32r):
  29407. (KJS::IA32MacroAssembler::emitMovl_mr):
  29408. (KJS::IA32MacroAssembler::emitMovl_rm):
  29409. (KJS::IA32MacroAssembler::emitMovl_i32m):
  29410. (KJS::IA32MacroAssembler::emitUnlinkedJe):
  29411. (KJS::IA32MacroAssembler::emitModRm_rr):
  29412. (KJS::IA32MacroAssembler::emitModRm_rr_Unchecked):
  29413. (KJS::IA32MacroAssembler::emitModRm_rm_Unchecked):
  29414. (KJS::IA32MacroAssembler::emitModRm_rm):
  29415. (KJS::IA32MacroAssembler::emitModRm_opr):
  29416. (KJS::IA32MacroAssembler::emitModRm_opr_Unchecked):
  29417. (KJS::IA32MacroAssembler::emitModRm_opm_Unchecked):
  29418. 2008-09-05 Mark Rowe <mrowe@apple.com>
  29419. Reviewed by Sam Weinig.
  29420. Disable WREC and CTI on platforms that we have not yet had a chance to test with.
  29421. * wtf/Platform.h:
  29422. 2008-09-05 Geoffrey Garen <ggaren@apple.com>
  29423. Reviewed by Sam Weinig.
  29424. Use jo instead of a mask compare when fetching array.length and
  29425. string.length. 4% speedup on array.length / string.length torture
  29426. test.
  29427. * VM/CTI.cpp:
  29428. (KJS::CTI::privateArrayLengthTrampoline):
  29429. (KJS::CTI::privateStringLengthTrampoline):
  29430. 2008-09-05 Geoffrey Garen <ggaren@apple.com>
  29431. Reviewed by Sam Weinig.
  29432. Removed a CTI compilation pass by recording labels during bytecode
  29433. generation. This is more to reduce complexity than it is to improve
  29434. performance.
  29435. SunSpider reports no change.
  29436. CodeBlock now keeps a "labels" set, which holds the offsets of all the
  29437. instructions that can be jumped to.
  29438. * VM/CTI.cpp: Nixed a pass.
  29439. * VM/CodeBlock.h: Added a "labels" set.
  29440. * VM/LabelID.h: No need for a special LableID for holding jump
  29441. destinations, since the CodeBlock now knows all jump destinations.
  29442. * wtf/HashTraits.h: New hash traits to accomodate putting offset 0 in
  29443. the set.
  29444. * kjs/nodes.cpp:
  29445. (KJS::TryNode::emitCode): Emit a dummy label to record sret targets.
  29446. 2008-09-05 Mark Rowe <mrowe@apple.com>
  29447. Reviewed by Oliver Hunt and Gavin Barraclough.
  29448. Move the JITCodeBuffer onto Machine and remove the static variables.
  29449. * VM/CTI.cpp: Initialize m_jit with the Machine's code buffer.
  29450. * VM/Machine.cpp:
  29451. (KJS::Machine::Machine): Allocate a JITCodeBuffer.
  29452. * VM/Machine.h:
  29453. * kjs/RegExpConstructor.cpp:
  29454. (KJS::constructRegExp): Pass the ExecState through.
  29455. * kjs/RegExpPrototype.cpp:
  29456. (KJS::regExpProtoFuncCompile): Ditto.
  29457. * kjs/StringPrototype.cpp:
  29458. (KJS::stringProtoFuncMatch): Ditto.
  29459. (KJS::stringProtoFuncSearch): Ditto.
  29460. * kjs/nodes.cpp:
  29461. (KJS::RegExpNode::emitCode): Compile the pattern at code generation time
  29462. so that we have access to an ExecState.
  29463. * kjs/nodes.h:
  29464. (KJS::RegExpNode::):
  29465. * kjs/nodes2string.cpp:
  29466. * kjs/regexp.cpp:
  29467. (KJS::RegExp::RegExp): Pass the ExecState through.
  29468. (KJS::RegExp::create): Ditto.
  29469. * kjs/regexp.h:
  29470. * masm/IA32MacroAsm.h:
  29471. (KJS::IA32MacroAssembler::IA32MacroAssembler): Reset the JITCodeBuffer when we are
  29472. constructed.
  29473. * wrec/WREC.cpp:
  29474. (KJS::WRECompiler::compile): Retrieve the JITCodeBuffer from the Machine.
  29475. * wrec/WREC.h:
  29476. 2008-09-05 Mark Rowe <mrowe@apple.com>
  29477. Reviewed by Oliver Hunt and Gavin Barraclough.
  29478. Fix the build when CTI is disabled.
  29479. * VM/CodeBlock.cpp:
  29480. (KJS::CodeBlock::~CodeBlock):
  29481. * VM/CodeGenerator.cpp:
  29482. (KJS::prepareJumpTableForStringSwitch):
  29483. * VM/Machine.cpp:
  29484. (KJS::Machine::Machine):
  29485. (KJS::Machine::~Machine):
  29486. 2008-09-05 Gavin Barraclough <barraclough@apple.com>
  29487. Reviewed by Mark Rowe.
  29488. Fix some windows abi issues.
  29489. * VM/CTI.cpp:
  29490. (KJS::CTI::privateCompileMainPass):
  29491. (KJS::CTI::privateCompileSlowCases):
  29492. * VM/CTI.h:
  29493. (KJS::CallRecord::CallRecord):
  29494. (KJS::):
  29495. * VM/Machine.cpp:
  29496. (KJS::Machine::cti_op_resolve_func):
  29497. (KJS::Machine::cti_op_post_inc):
  29498. (KJS::Machine::cti_op_resolve_with_base):
  29499. (KJS::Machine::cti_op_post_dec):
  29500. * VM/Machine.h:
  29501. 2008-09-05 Mark Rowe <mrowe@apple.com>
  29502. Reviewed by Sam Weinig.
  29503. Fix ecma/FunctionObjects/15.3.5.3.js after I broke it in r93.
  29504. * VM/Machine.cpp:
  29505. (KJS::Machine::cti_op_call_NotJSFunction): Restore m_callFrame to the correct value after making the native call.
  29506. (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
  29507. 2008-09-04 Mark Rowe <mrowe@apple.com>
  29508. Reviewed by Sam Weinig.
  29509. Fix fast/dom/Window/console-functions.html.
  29510. The call frame on the ExecState was not being updated on calls into native functions. This meant that functions
  29511. such as console.log would use the line number of the last JS function on the call stack.
  29512. * VM/Machine.cpp:
  29513. (KJS::Machine::cti_op_call_NotJSFunction): Update the ExecState's call frame before making a native function call,
  29514. and restore it when the function is done.
  29515. (KJS::Machine::cti_op_construct_NotJSConstruct): Ditto.
  29516. 2008-09-05 Oliver Hunt <oliver@apple.com>
  29517. Start bringing up SFX on windows.
  29518. Reviewed by Mark Rowe and Sam Weinig
  29519. Start doing the work to bring up SFX on windows. Initially
  29520. just working on WREC, as it does not make any calls so reduces
  29521. the amount of code that needs to be corrected.
  29522. Start abstracting the CTI JIT codegen engine.
  29523. * ChangeLog:
  29524. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  29525. * JavaScriptCore.xcodeproj/project.pbxproj:
  29526. * VM/CTI.cpp:
  29527. * masm/IA32MacroAsm.h:
  29528. * masm/MacroAssembler.h: Added.
  29529. (KJS::MacroAssembler::MacroAssembler):
  29530. * masm/MacroAssemblerIA32GCC.cpp: Added.
  29531. (KJS::MacroAssembler::emitConvertToFastCall):
  29532. * masm/MacroAssemblerWin.cpp: Added.
  29533. (KJS::MacroAssembler::emitConvertToFastCall):
  29534. * wrec/WREC.cpp:
  29535. (KJS::WRECompiler::parseGreedyQuantifier):
  29536. (KJS::WRECompiler::parseCharacterClass):
  29537. (KJS::WRECompiler::parseEscape):
  29538. (KJS::WRECompiler::compilePattern):
  29539. * wrec/WREC.h:
  29540. 2008-09-04 Gavin Barraclough <barraclough@apple.com>
  29541. Reviewed by Sam Weinig.
  29542. Support for slow scripts (timeout checking).
  29543. * VM/CTI.cpp:
  29544. (KJS::CTI::privateCompileMainPass):
  29545. (KJS::CTI::privateCompile):
  29546. * VM/Machine.cpp:
  29547. (KJS::slideRegisterWindowForCall):
  29548. (KJS::Machine::cti_timeout_check):
  29549. (KJS::Machine::cti_vm_throw):
  29550. 2008-09-04 Sam Weinig <sam@webkit.org>
  29551. Reviewed by Mark Rowe.
  29552. Third round of style cleanup.
  29553. * VM/CTI.cpp:
  29554. * VM/CTI.h:
  29555. * VM/CodeBlock.h:
  29556. * VM/Machine.cpp:
  29557. * VM/Machine.h:
  29558. * kjs/ExecState.h:
  29559. 2008-09-04 Sam Weinig <sam@webkit.org>
  29560. Reviewed by Jon Honeycutt.
  29561. Second round of style cleanup.
  29562. * VM/CTI.cpp:
  29563. * VM/CTI.h:
  29564. * wrec/WREC.h:
  29565. 2008-09-04 Sam Weinig <sam@webkit.org>
  29566. Reviewed by Mark Rowe.
  29567. First round of style cleanup.
  29568. * VM/CTI.cpp:
  29569. * VM/CTI.h:
  29570. * masm/IA32MacroAsm.h:
  29571. * wrec/WREC.cpp:
  29572. * wrec/WREC.h:
  29573. 2008-09-04 Geoffrey Garen <ggaren@apple.com>
  29574. Reviewed by Mark Rowe.
  29575. Merged http://trac.webkit.org/changeset/36081 to work with CTI.
  29576. * VM/Machine.cpp:
  29577. (KJS::Machine::tryCtiCacheGetByID):
  29578. 2008-09-04 Gavin Barraclough <barraclough@apple.com>
  29579. Reviewed by Sam Weinig.
  29580. Enable profiling in CTI.
  29581. * VM/CTI.h:
  29582. (KJS::):
  29583. (KJS::CTI::execute):
  29584. * VM/Machine.cpp:
  29585. (KJS::Machine::cti_op_call_JSFunction):
  29586. (KJS::Machine::cti_op_call_NotJSFunction):
  29587. (KJS::Machine::cti_op_ret):
  29588. (KJS::Machine::cti_op_construct_JSConstruct):
  29589. (KJS::Machine::cti_op_construct_NotJSConstruct):
  29590. 2008-09-04 Victor Hernandez <vhernandez@apple.com>
  29591. Reviewed by Geoffrey Garen.
  29592. Fixed an #if to support using WREC without CTI.
  29593. * kjs/regexp.cpp:
  29594. (KJS::RegExp::match):
  29595. 2008-09-04 Gavin Barraclough <barraclough@apple.com>
  29596. Reviewed by Oliver Hunt.
  29597. The array/string length trampolines are owned by the Machine, not the codeblock that compiled them.
  29598. * VM/CTI.cpp:
  29599. (KJS::CTI::privateArrayLengthTrampoline):
  29600. (KJS::CTI::privateStringLengthTrampoline):
  29601. * VM/Machine.cpp:
  29602. (KJS::Machine::~Machine):
  29603. * VM/Machine.h:
  29604. 2008-09-04 Mark Rowe <mrowe@apple.com>
  29605. Reviewed by Gavin Barraclough and Sam Weinig.
  29606. Fix a crash on launch of jsc when GuardMalloc is enabled.
  29607. * kjs/ScopeChain.h:
  29608. (KJS::ScopeChain::ScopeChain): Initialize m_node to 0 when we have no valid scope chain.
  29609. (KJS::ScopeChain::~ScopeChain): Null-check m_node before calling deref.
  29610. 2008-09-03 Oliver Hunt <oliver@apple.com>
  29611. Reviewed by Gavin Barraclough and Geoff Garen.
  29612. Fix inspector and fast array access so that it bounds
  29613. checks correctly.
  29614. * VM/CTI.cpp:
  29615. (KJS::CTI::privateCompile_pass2_Main):
  29616. * masm/IA32MacroAsm.h:
  29617. (KJS::IA32MacroAssembler::):
  29618. (KJS::IA32MacroAssembler::emitUnlinkedJb):
  29619. (KJS::IA32MacroAssembler::emitUnlinkedJbe):
  29620. 2008-09-03 Mark Rowe <mrowe@apple.com>
  29621. Move the assertion after the InitializeAndReturn block, as
  29622. that is used even when CTI is enabled.
  29623. * VM/Machine.cpp:
  29624. (KJS::Machine::privateExecute):
  29625. 2008-09-03 Mark Rowe <mrowe@apple.com>
  29626. Reviewed by Sam Weinig.
  29627. Replace calls to exit with ASSERT_WITH_MESSAGE or ASSERT_NOT_REACHED.
  29628. * VM/CTI.cpp:
  29629. (KJS::CTI::privateCompile_pass1_Scan):
  29630. (KJS::CTI::privateCompile_pass2_Main):
  29631. (KJS::CTI::privateCompile_pass4_SlowCases):
  29632. * VM/Machine.cpp:
  29633. (KJS::Machine::privateExecute):
  29634. (KJS::Machine::cti_vm_throw):
  29635. 2008-09-03 Mark Rowe <mrowe@apple.com>
  29636. Reviewed by Sam Weinig.
  29637. Tweak JavaScriptCore to compile on non-x86 platforms. This is achieved
  29638. by wrapping more code with ENABLE(CTI), ENABLE(WREC), and PLATFORM(X86)
  29639. #if's.
  29640. * VM/CTI.cpp:
  29641. * VM/CTI.h:
  29642. * VM/CodeBlock.cpp:
  29643. (KJS::CodeBlock::printStructureIDs): Use %td as the format specifier for
  29644. printing a ptrdiff_t.
  29645. * VM/Machine.cpp:
  29646. * VM/Machine.h:
  29647. * kjs/regexp.cpp:
  29648. (KJS::RegExp::RegExp):
  29649. (KJS::RegExp::~RegExp):
  29650. (KJS::RegExp::match):
  29651. * kjs/regexp.h:
  29652. * masm/IA32MacroAsm.h:
  29653. * wrec/WREC.cpp:
  29654. * wrec/WREC.h:
  29655. * wtf/Platform.h: Only enable CTI and WREC on x86. Add an extra define to
  29656. track whether any MASM-using features are enabled.
  29657. 2008-09-03 Gavin Barraclough <barraclough@apple.com>
  29658. Reviewed by Oliver Hunt.
  29659. Copy Geoff's array/string length optimization for CTI.
  29660. * VM/CTI.cpp:
  29661. (KJS::CTI::privateArrayLengthTrampoline):
  29662. (KJS::CTI::privateStringLengthTrampoline):
  29663. * VM/CTI.h:
  29664. (KJS::CTI::compileArrayLengthTrampoline):
  29665. (KJS::CTI::compileStringLengthTrampoline):
  29666. * VM/Machine.cpp:
  29667. (KJS::Machine::Machine):
  29668. (KJS::Machine::getCtiArrayLengthTrampoline):
  29669. (KJS::Machine::getCtiStringLengthTrampoline):
  29670. (KJS::Machine::tryCtiCacheGetByID):
  29671. (KJS::Machine::cti_op_get_by_id_second):
  29672. * VM/Machine.h:
  29673. * kjs/JSString.h:
  29674. * kjs/ustring.h:
  29675. 2008-09-03 Gavin Barraclough <barraclough@apple.com>
  29676. Reviewed by Oliver Hunt.
  29677. Implement fast array accesses in CTI - 2-3% progression on sunspider.
  29678. * VM/CTI.cpp:
  29679. (KJS::CTI::emitFastArithIntToImmNoCheck):
  29680. (KJS::CTI::compileOpCall):
  29681. (KJS::CTI::privateCompile_pass2_Main):
  29682. (KJS::CTI::privateCompile_pass4_SlowCases):
  29683. * VM/CTI.h:
  29684. * kjs/JSArray.h:
  29685. 2008-09-02 Gavin Barraclough <barraclough@apple.com>
  29686. Reviewed by Oliver Hunt.
  29687. Enable fast property access support in CTI.
  29688. * VM/CTI.cpp:
  29689. (KJS::ctiSetReturnAddress):
  29690. (KJS::ctiRepatchCallByReturnAddress):
  29691. (KJS::CTI::privateCompile_pass2_Main):
  29692. (KJS::CTI::privateCompile):
  29693. (KJS::CTI::privateCompileGetByIdSelf):
  29694. (KJS::CTI::privateCompileGetByIdProto):
  29695. (KJS::CTI::privateCompileGetByIdChain):
  29696. (KJS::CTI::privateCompilePutByIdReplace):
  29697. * VM/CTI.h:
  29698. (KJS::CTI::compileGetByIdSelf):
  29699. (KJS::CTI::compileGetByIdProto):
  29700. (KJS::CTI::compileGetByIdChain):
  29701. (KJS::CTI::compilePutByIdReplace):
  29702. * VM/CodeBlock.cpp:
  29703. (KJS::CodeBlock::~CodeBlock):
  29704. * VM/CodeBlock.h:
  29705. * VM/Machine.cpp:
  29706. (KJS::doSetReturnAddressVmThrowTrampoline):
  29707. (KJS::Machine::tryCtiCachePutByID):
  29708. (KJS::Machine::tryCtiCacheGetByID):
  29709. (KJS::Machine::cti_op_put_by_id):
  29710. (KJS::Machine::cti_op_put_by_id_second):
  29711. (KJS::Machine::cti_op_put_by_id_generic):
  29712. (KJS::Machine::cti_op_put_by_id_fail):
  29713. (KJS::Machine::cti_op_get_by_id):
  29714. (KJS::Machine::cti_op_get_by_id_second):
  29715. (KJS::Machine::cti_op_get_by_id_generic):
  29716. (KJS::Machine::cti_op_get_by_id_fail):
  29717. (KJS::Machine::cti_op_throw):
  29718. (KJS::Machine::cti_vm_throw):
  29719. * VM/Machine.h:
  29720. * kjs/JSCell.h:
  29721. * kjs/JSObject.h:
  29722. * kjs/PropertyMap.h:
  29723. * kjs/StructureID.cpp:
  29724. (KJS::StructureIDChain::StructureIDChain):
  29725. * masm/IA32MacroAsm.h:
  29726. (KJS::IA32MacroAssembler::emitCmpl_i32m):
  29727. (KJS::IA32MacroAssembler::emitMovl_mr):
  29728. (KJS::IA32MacroAssembler::emitMovl_rm):
  29729. 2008-09-02 Sam Weinig <sam@webkit.org>
  29730. Reviewed by Gavin Barraclough and Mark Rowe.
  29731. A backslash (\) at the of a RegEx should produce an error.
  29732. Fixes fast/regex/test1.html.
  29733. * wrec/WREC.cpp:
  29734. (KJS::WRECompiler::parseEscape):
  29735. 2008-09-02 Sam Weinig <sam@webkit.org>
  29736. Reviewed by Geoff Garen.
  29737. Link jumps for the slow case of op_loop_if_less. Fixes acid3.
  29738. * VM/CTI.cpp:
  29739. (KJS::CTI::privateCompile_pass4_SlowCases):
  29740. 2008-09-01 Sam Weinig <sam@webkit.org>
  29741. Rubber-stamped by Maciej Stachowiak.
  29742. Switch WREC on by default.
  29743. * wtf/Platform.h:
  29744. 2008-09-01 Sam Weinig <sam@webkit.org>
  29745. Reviewed by Mark Rowe.
  29746. Fix two failures in fast/regex/test1.html
  29747. - \- in a character class should be treated as a literal -
  29748. - A missing max quantifier needs to be treated differently than
  29749. a null max quantifier.
  29750. * wrec/WREC.cpp:
  29751. (KJS::WRECompiler::generateNonGreedyQuantifier):
  29752. (KJS::WRECompiler::generateGreedyQuantifier):
  29753. (KJS::WRECompiler::parseCharacterClass):
  29754. * wrec/WREC.h:
  29755. (KJS::Quantifier::Quantifier):
  29756. 2008-09-01 Sam Weinig <sam@webkit.org>
  29757. Reviewed by Mark Rowe.
  29758. Fix crash in fast/js/kde/evil-n.html
  29759. * kjs/regexp.cpp: Always pass a non-null offset vector to the wrec function.
  29760. 2008-09-01 Sam Weinig <sam@webkit.org>
  29761. Reviewed by Gavin Barraclough and Mark Rowe.
  29762. Add pattern length limit fixing one test in fast/js.
  29763. * wrec/WREC.cpp:
  29764. (KJS::WRECompiler::compile):
  29765. * wrec/WREC.h:
  29766. (KJS::WRECompiler::):
  29767. 2008-09-01 Sam Weinig <sam@webkit.org>
  29768. Reviewed by Gavin Barraclough and Mark Rowe.
  29769. Make octal escape parsing/back-reference parsing more closely match
  29770. prior behavior fixing one test in fast/js.
  29771. * wrec/WREC.cpp:
  29772. (KJS::WRECompiler::parseCharacterClass): 8 and 9 should be IdentityEscaped
  29773. (KJS::WRECompiler::parseEscape):
  29774. * wrec/WREC.h:
  29775. (KJS::WRECompiler::peekDigit):
  29776. 2008-09-01 Sam Weinig <sam@webkit.org>
  29777. Reviewed by Gavin Barraclough and Mark Rowe.
  29778. Fix one mozilla test.
  29779. * wrec/WREC.cpp:
  29780. (KJS::WRECompiler::generateCharacterClassInverted): Fix incorrect not
  29781. ascii upper check.
  29782. 2008-09-01 Sam Weinig <sam@webkit.org>
  29783. Reviewed by Gavin Barraclough and Mark Rowe.
  29784. Parse octal escapes in character classes fixing one mozilla test.
  29785. * wrec/WREC.cpp:
  29786. (KJS::WRECompiler::parseCharacterClass):
  29787. (KJS::WRECompiler::parseOctalEscape):
  29788. * wrec/WREC.h:
  29789. (KJS::WRECompiler::consumeOctal):
  29790. 2008-09-01 Sam Weinig <sam@webkit.org>
  29791. Reviewed by Oliver Hunt.
  29792. Fixes two mozilla tests with WREC enabled.
  29793. * wrec/WREC.cpp:
  29794. (KJS::CharacterClassConstructor::append): Keep the character class sorted
  29795. when appending another character class.
  29796. 2008-09-01 Sam Weinig <sam@webkit.org>
  29797. Reviewed by Gavin Barraclough and Mark Rowe.
  29798. Fixes two mozilla tests with WREC enabled.
  29799. * wrec/WREC.cpp:
  29800. (KJS::CharacterClassConstructor::addSortedRange): Insert the range at the correct position
  29801. instead of appending it to the end.
  29802. 2008-09-01 Gavin Barraclough <barraclough@apple.com>
  29803. Reviewed by Oliver Hunt.
  29804. Move cross-compilation unit call into NEVER_INLINE function.
  29805. * VM/Machine.cpp:
  29806. (KJS::doSetReturnAddressVmThrowTrampoline):
  29807. 2008-09-01 Sam Weinig <sam@webkit.org>
  29808. Reviewed by Gavin Barraclough and Geoff Garen.
  29809. Fix one test in fast/js.
  29810. * VM/Machine.cpp:
  29811. (KJS::Machine::cti_op_construct_NotJSConstruct): Throw a createNotAConstructorError,
  29812. instead of a createNotAFunctionError.
  29813. 2008-08-31 Gavin Barraclough <barraclough@apple.com>
  29814. Reviewed by Maciej Stachowiak.
  29815. Zero-cost exception handling. This patch takes the exception checking
  29816. back of the hot path. When an exception occurs in a Machine::cti*
  29817. method, the return address to JIT code is recorded, and is then
  29818. overwritten with a pointer to a trampoline routine. When the method
  29819. returns the trampoline will cause the cti_vm_throw method to be invoked.
  29820. cti_vm_throw uses the return address preserved above, to discover the
  29821. vPC of the bytecode that raised the exception (using a map build during
  29822. translation). From the VPC of the faulting bytecode the vPC of a catch
  29823. routine may be discovered (unwinding the stack where necesary), and then
  29824. a bytecode address for the catch routine is looked up. Final cti_vm_throw
  29825. overwrites its return address to JIT code again, to trampoline directly
  29826. to the catch routine.
  29827. cti_op_throw is handled in a similar fashion.
  29828. * VM/CTI.cpp:
  29829. (KJS::CTI::emitPutCTIParam):
  29830. (KJS::CTI::emitPutToCallFrameHeader):
  29831. (KJS::CTI::emitGetFromCallFrameHeader):
  29832. (KJS::ctiSetReturnAddressForArgs):
  29833. (KJS::CTI::emitDebugExceptionCheck):
  29834. (KJS::CTI::printOpcodeOperandTypes):
  29835. (KJS::CTI::emitCall):
  29836. (KJS::CTI::compileOpCall):
  29837. (KJS::CTI::privateCompile_pass2_Main):
  29838. (KJS::CTI::privateCompile):
  29839. * VM/CTI.h:
  29840. (KJS::CallRecord::CallRecord):
  29841. (KJS::):
  29842. (KJS::CTI::execute):
  29843. * VM/CodeBlock.h:
  29844. * VM/Machine.cpp:
  29845. (KJS::Machine::privateExecute):
  29846. (KJS::Machine::cti_op_instanceof):
  29847. (KJS::Machine::cti_op_call_NotJSFunction):
  29848. (KJS::Machine::cti_op_resolve):
  29849. (KJS::Machine::cti_op_resolve_func):
  29850. (KJS::Machine::cti_op_resolve_skip):
  29851. (KJS::Machine::cti_op_resolve_with_base):
  29852. (KJS::Machine::cti_op_throw):
  29853. (KJS::Machine::cti_op_in):
  29854. (KJS::Machine::cti_vm_throw):
  29855. * VM/RegisterFile.h:
  29856. (KJS::RegisterFile::):
  29857. * kjs/ExecState.h:
  29858. (KJS::ExecState::setCtiReturnAddress):
  29859. (KJS::ExecState::ctiReturnAddress):
  29860. * masm/IA32MacroAsm.h:
  29861. (KJS::IA32MacroAssembler::):
  29862. (KJS::IA32MacroAssembler::emitPushl_m):
  29863. (KJS::IA32MacroAssembler::emitPopl_m):
  29864. (KJS::IA32MacroAssembler::getRelocatedAddress):
  29865. 2008-08-31 Mark Rowe <mrowe@apple.com>
  29866. Reviewed by Oliver Hunt.
  29867. Fall back to PCRE for any regexp containing parentheses until we correctly backtrack within them.
  29868. * wrec/WREC.cpp:
  29869. (KJS::WRECompiler::parseParentheses):
  29870. * wrec/WREC.h:
  29871. (KJS::WRECompiler::):
  29872. 2008-08-31 Mark Rowe <mrowe@apple.com>
  29873. Reviewed by Oliver Hunt.
  29874. Fix several issues within ecma_3/RegExp/perlstress-001.js with WREC enabled.
  29875. * wrec/WREC.cpp:
  29876. (KJS::WRECompiler::generateNonGreedyQuantifier): Compare with the maximum quantifier count rather than the minimum.
  29877. (KJS::WRECompiler::generateAssertionEOL): Do a register-to-register comparison rather than immediate-to-register.
  29878. (KJS::WRECompiler::parseCharacterClass): Pass through the correct inversion flag.
  29879. 2008-08-30 Mark Rowe <mrowe@apple.com>
  29880. Reviewed by Oliver Hunt.
  29881. Re-fix the six remaining failures in the Mozilla JavaScript tests in a manner that does not kill performance.
  29882. This shows up as a 0.6% progression on SunSpider on my machine.
  29883. Grow the JITCodeBuffer's underlying buffer when we run out of space rather than just bailing out.
  29884. * VM/CodeBlock.h:
  29885. (KJS::CodeBlock::~CodeBlock): Switch to using fastFree now that JITCodeBuffer::copy uses fastMalloc.
  29886. * kjs/regexp.cpp: Ditto.
  29887. * masm/IA32MacroAsm.h:
  29888. (KJS::JITCodeBuffer::growBuffer):
  29889. (KJS::JITCodeBuffer::JITCodeBuffer):
  29890. (KJS::JITCodeBuffer::~JITCodeBuffer):
  29891. (KJS::JITCodeBuffer::putByte):
  29892. (KJS::JITCodeBuffer::putShort):
  29893. (KJS::JITCodeBuffer::putInt):
  29894. (KJS::JITCodeBuffer::reset):
  29895. (KJS::JITCodeBuffer::copy):
  29896. 2008-08-29 Oliver Hunt <oliver@apple.com>
  29897. RS=Maciej
  29898. Roll out previous patch as it causes a 5% performance regression
  29899. * JavaScriptCore.xcodeproj/project.pbxproj:
  29900. * VM/CTI.cpp:
  29901. (KJS::getJCB):
  29902. (KJS::CTI::privateCompile):
  29903. * VM/CodeBlock.h:
  29904. (KJS::CodeBlock::~CodeBlock):
  29905. * masm/IA32MacroAsm.h:
  29906. (KJS::JITCodeBuffer::JITCodeBuffer):
  29907. (KJS::JITCodeBuffer::putByte):
  29908. (KJS::JITCodeBuffer::putShort):
  29909. (KJS::JITCodeBuffer::putInt):
  29910. (KJS::JITCodeBuffer::getEIP):
  29911. (KJS::JITCodeBuffer::start):
  29912. (KJS::JITCodeBuffer::getOffset):
  29913. (KJS::JITCodeBuffer::reset):
  29914. (KJS::JITCodeBuffer::copy):
  29915. (KJS::IA32MacroAssembler::emitModRm_rr):
  29916. (KJS::IA32MacroAssembler::emitModRm_rm):
  29917. (KJS::IA32MacroAssembler::emitModRm_rmsib):
  29918. (KJS::IA32MacroAssembler::IA32MacroAssembler):
  29919. (KJS::IA32MacroAssembler::emitInt3):
  29920. (KJS::IA32MacroAssembler::emitPushl_r):
  29921. (KJS::IA32MacroAssembler::emitPopl_r):
  29922. (KJS::IA32MacroAssembler::emitMovl_rr):
  29923. (KJS::IA32MacroAssembler::emitAddl_rr):
  29924. (KJS::IA32MacroAssembler::emitAddl_i8r):
  29925. (KJS::IA32MacroAssembler::emitAddl_i32r):
  29926. (KJS::IA32MacroAssembler::emitAddl_mr):
  29927. (KJS::IA32MacroAssembler::emitAndl_rr):
  29928. (KJS::IA32MacroAssembler::emitAndl_i32r):
  29929. (KJS::IA32MacroAssembler::emitCmpl_i8r):
  29930. (KJS::IA32MacroAssembler::emitCmpl_rr):
  29931. (KJS::IA32MacroAssembler::emitCmpl_rm):
  29932. (KJS::IA32MacroAssembler::emitCmpl_i32r):
  29933. (KJS::IA32MacroAssembler::emitCmpl_i32m):
  29934. (KJS::IA32MacroAssembler::emitCmpw_rm):
  29935. (KJS::IA32MacroAssembler::emitOrl_rr):
  29936. (KJS::IA32MacroAssembler::emitOrl_i8r):
  29937. (KJS::IA32MacroAssembler::emitSubl_rr):
  29938. (KJS::IA32MacroAssembler::emitSubl_i8r):
  29939. (KJS::IA32MacroAssembler::emitSubl_i32r):
  29940. (KJS::IA32MacroAssembler::emitSubl_mr):
  29941. (KJS::IA32MacroAssembler::emitTestl_i32r):
  29942. (KJS::IA32MacroAssembler::emitTestl_rr):
  29943. (KJS::IA32MacroAssembler::emitXorl_i8r):
  29944. (KJS::IA32MacroAssembler::emitXorl_rr):
  29945. (KJS::IA32MacroAssembler::emitSarl_i8r):
  29946. (KJS::IA32MacroAssembler::emitSarl_CLr):
  29947. (KJS::IA32MacroAssembler::emitShl_i8r):
  29948. (KJS::IA32MacroAssembler::emitShll_CLr):
  29949. (KJS::IA32MacroAssembler::emitMull_rr):
  29950. (KJS::IA32MacroAssembler::emitIdivl_r):
  29951. (KJS::IA32MacroAssembler::emitCdq):
  29952. (KJS::IA32MacroAssembler::emitMovl_mr):
  29953. (KJS::IA32MacroAssembler::emitMovzwl_mr):
  29954. (KJS::IA32MacroAssembler::emitMovl_rm):
  29955. (KJS::IA32MacroAssembler::emitMovl_i32r):
  29956. (KJS::IA32MacroAssembler::emitMovl_i32m):
  29957. (KJS::IA32MacroAssembler::emitLeal_mr):
  29958. (KJS::IA32MacroAssembler::emitRet):
  29959. (KJS::IA32MacroAssembler::emitJmpN_r):
  29960. (KJS::IA32MacroAssembler::emitJmpN_m):
  29961. (KJS::IA32MacroAssembler::emitCall):
  29962. (KJS::IA32MacroAssembler::label):
  29963. (KJS::IA32MacroAssembler::emitUnlinkedJmp):
  29964. (KJS::IA32MacroAssembler::emitUnlinkedJne):
  29965. (KJS::IA32MacroAssembler::emitUnlinkedJe):
  29966. (KJS::IA32MacroAssembler::emitUnlinkedJl):
  29967. (KJS::IA32MacroAssembler::emitUnlinkedJle):
  29968. (KJS::IA32MacroAssembler::emitUnlinkedJge):
  29969. (KJS::IA32MacroAssembler::emitUnlinkedJae):
  29970. (KJS::IA32MacroAssembler::emitUnlinkedJo):
  29971. (KJS::IA32MacroAssembler::link):
  29972. * wrec/WREC.cpp:
  29973. (KJS::WRECompiler::compilePattern):
  29974. (KJS::WRECompiler::compile):
  29975. * wrec/WREC.h:
  29976. 2008-08-29 Mark Rowe <mrowe@apple.com>
  29977. Reviewed by Oliver Hunt.
  29978. Have JITCodeBuffer manage a Vector containing the generated code so that it can grow
  29979. as needed when generating code for a large function. This fixes all six remaining failures
  29980. in Mozilla tests in both debug and release builds.
  29981. * VM/CTI.cpp:
  29982. (KJS::CTI::privateCompile):
  29983. * VM/CodeBlock.h:
  29984. (KJS::CodeBlock::~CodeBlock):
  29985. * masm/IA32MacroAsm.h:
  29986. (KJS::JITCodeBuffer::putByte):
  29987. (KJS::JITCodeBuffer::putShort):
  29988. (KJS::JITCodeBuffer::putInt):
  29989. (KJS::JITCodeBuffer::getEIP):
  29990. (KJS::JITCodeBuffer::start):
  29991. (KJS::JITCodeBuffer::getOffset):
  29992. (KJS::JITCodeBuffer::getCode):
  29993. (KJS::IA32MacroAssembler::emitModRm_rr):
  29994. * wrec/WREC.cpp:
  29995. (KJS::WRECompiler::compilePattern):
  29996. * wrec/WREC.h:
  29997. 2008-08-29 Mark Rowe <mrowe@apple.com>
  29998. Reviewed by Oliver Hunt.
  29999. Implement parsing of octal escapes in regular expressions. This fixes three Mozilla tests.
  30000. * wrec/WREC.cpp:
  30001. (KJS::WRECompiler::parseOctalEscape):
  30002. (KJS::WRECompiler::parseEscape): Parse the escape sequence as an octal escape if it has a leading zero.
  30003. Add a FIXME about treating invalid backreferences as octal escapes in the future.
  30004. * wrec/WREC.h:
  30005. (KJS::WRECompiler::consumeNumber): Multiply by 10 rather than 0 so that we handle numbers with more than
  30006. one digit.
  30007. * wtf/ASCIICType.h:
  30008. (WTF::isASCIIOctalDigit):
  30009. 2008-08-29 Sam Weinig <sam@webkit.org>
  30010. Reviewed by Mark Rowe.
  30011. Pass vPC to instanceof method. Fixes 2 mozilla tests in debug.
  30012. * VM/CTI.cpp:
  30013. (KJS::CTI::privateCompile_pass2_Main):
  30014. * VM/Machine.cpp:
  30015. (KJS::Machine::cti_op_instanceof):
  30016. 2008-08-29 Sam Weinig <sam@webkit.org>
  30017. Reviewed by Mark Rowe.
  30018. Pass vPCs to resolve methods for correct exception creation. Fixes
  30019. 17 mozilla tests in debug.
  30020. * VM/CTI.cpp:
  30021. (KJS::CTI::privateCompile_pass2_Main):
  30022. * VM/CTI.h:
  30023. * VM/Machine.cpp:
  30024. (KJS::Machine::cti_op_resolve):
  30025. (KJS::Machine::cti_op_resolve_func):
  30026. (KJS::Machine::cti_op_resolve_skip):
  30027. (KJS::Machine::cti_op_resolve_with_base):
  30028. 2008-08-29 Gavin Barraclough <barraclough@apple.com>
  30029. Reviewed by Oliver Hunt.
  30030. Remembering to actually throw the exception passed to op throw helps.
  30031. Regressions 19 -> 6.
  30032. * VM/Machine.cpp:
  30033. (KJS::Machine::cti_op_throw):
  30034. (KJS::Machine::cti_vm_throw):
  30035. 2008-08-29 Gavin Barraclough <barraclough@apple.com>
  30036. Reviewed by Sam Weinig.
  30037. Support for exception unwinding the stack.
  30038. Once upon a time, Sam asked me for a bettr ChangeLog entry. The return address
  30039. is now preserved on entry to a JIT code function (if we preserve lazily we need
  30040. restore the native return address during exception stack unwind). This takes
  30041. the number of regressions down from ~150 to 19.
  30042. * VM/CTI.cpp:
  30043. (KJS::getJCB):
  30044. (KJS::CTI::emitExceptionCheck):
  30045. (KJS::CTI::compileOpCall):
  30046. (KJS::CTI::privateCompile_pass2_Main):
  30047. (KJS::CTI::privateCompile):
  30048. * VM/CTI.h:
  30049. (KJS::):
  30050. * VM/Machine.cpp:
  30051. (KJS::Machine::throwException):
  30052. (KJS::Machine::cti_op_call_JSFunction):
  30053. (KJS::Machine::cti_op_call_NotJSFunction):
  30054. (KJS::Machine::cti_op_construct_JSConstruct):
  30055. (KJS::Machine::cti_op_construct_NotJSConstruct):
  30056. (KJS::Machine::cti_op_throw):
  30057. (KJS::Machine::cti_vm_throw):
  30058. 2008-08-29 Mark Rowe <mrowe@apple.com>
  30059. Reviewed by Oliver Hunt.
  30060. Fix js1_2/regexp/word_boundary.js and four other Mozilla tests with WREC enabled.
  30061. * wrec/WREC.cpp:
  30062. (KJS::WRECompiler::generateCharacterClassInvertedRange): If none of the exact matches
  30063. succeeded, jump to failure.
  30064. (KJS::WRECompiler::compilePattern): Restore and increment the current position stored
  30065. on the stack to ensure that it will be reset to the correct position after a failed
  30066. match has consumed input.
  30067. 2008-08-29 Mark Rowe <mrowe@apple.com>
  30068. Reviewed by Oliver Hunt.
  30069. Fix a hang in ecma_3/RegExp/15.10.2-1.js with WREC enabled.
  30070. A backreference with a quantifier would get stuck in an infinite
  30071. loop if the captured range was empty.
  30072. * wrec/WREC.cpp:
  30073. (KJS::WRECompiler::generateBackreferenceQuantifier): If the captured range
  30074. was empty, do not attempt to match the backreference.
  30075. (KJS::WRECompiler::parseBackreferenceQuantifier):
  30076. * wrec/WREC.h:
  30077. (KJS::Quantifier::):
  30078. 2008-08-28 Sam Weinig <sam@webkit.org>
  30079. Reviewed by Oliver Hunt.
  30080. Implement op_debug.
  30081. * VM/CTI.cpp:
  30082. (KJS::CTI::privateCompile_pass1_Scan):
  30083. (KJS::CTI::privateCompile_pass2_Main):
  30084. * VM/Machine.cpp:
  30085. (KJS::Machine::debug):
  30086. (KJS::Machine::privateExecute):
  30087. (KJS::Machine::cti_op_debug):
  30088. * VM/Machine.h:
  30089. 2008-08-28 Sam Weinig <sam@webkit.org>
  30090. Reviewed by Gavin Barraclough and Geoff Garen.
  30091. Implement op_switch_string fixing 1 mozilla test and one test in fast/js.
  30092. * VM/CTI.cpp:
  30093. (KJS::CTI::privateCompile_pass1_Scan):
  30094. (KJS::CTI::privateCompile_pass2_Main):
  30095. (KJS::CTI::privateCompile):
  30096. * VM/CTI.h:
  30097. (KJS::SwitchRecord::):
  30098. (KJS::SwitchRecord::SwitchRecord):
  30099. * VM/CodeBlock.cpp:
  30100. (KJS::CodeBlock::dump):
  30101. * VM/CodeBlock.h:
  30102. (KJS::ExpressionRangeInfo::):
  30103. (KJS::StringJumpTable::offsetForValue):
  30104. (KJS::StringJumpTable::ctiForValue):
  30105. (KJS::SimpleJumpTable::add):
  30106. (KJS::SimpleJumpTable::ctiForValue):
  30107. * VM/CodeGenerator.cpp:
  30108. (KJS::prepareJumpTableForStringSwitch):
  30109. * VM/Machine.cpp:
  30110. (KJS::Machine::privateExecute):
  30111. (KJS::Machine::cti_op_switch_string):
  30112. * VM/Machine.h:
  30113. 2008-08-28 Gavin Barraclough <barraclough@apple.com>
  30114. Reviewed by Oliver Hunt.
  30115. Do not recurse on the machine stack when executing op_call.
  30116. * VM/CTI.cpp:
  30117. (KJS::CTI::emitGetPutArg):
  30118. (KJS::CTI::emitPutArg):
  30119. (KJS::CTI::emitPutArgConstant):
  30120. (KJS::CTI::compileOpCall):
  30121. (KJS::CTI::privateCompile_pass2_Main):
  30122. (KJS::CTI::privateCompile):
  30123. * VM/CTI.h:
  30124. (KJS::):
  30125. (KJS::CTI::compile):
  30126. (KJS::CTI::execute):
  30127. (KJS::CTI::):
  30128. * VM/Machine.cpp:
  30129. (KJS::Machine::Machine):
  30130. (KJS::Machine::execute):
  30131. (KJS::Machine::cti_op_call_JSFunction):
  30132. (KJS::Machine::cti_op_call_NotJSFunction):
  30133. (KJS::Machine::cti_op_ret):
  30134. (KJS::Machine::cti_op_construct_JSConstruct):
  30135. (KJS::Machine::cti_op_construct_NotJSConstruct):
  30136. (KJS::Machine::cti_op_call_eval):
  30137. * VM/Machine.h:
  30138. * VM/Register.h:
  30139. (KJS::Register::Register):
  30140. * VM/RegisterFile.h:
  30141. (KJS::RegisterFile::):
  30142. * kjs/InternalFunction.h:
  30143. (KJS::InternalFunction::InternalFunction):
  30144. * kjs/JSFunction.h:
  30145. (KJS::JSFunction::JSFunction):
  30146. * kjs/ScopeChain.h:
  30147. (KJS::ScopeChain::ScopeChain):
  30148. * masm/IA32MacroAsm.h:
  30149. (KJS::IA32MacroAssembler::):
  30150. (KJS::IA32MacroAssembler::emitModRm_opm):
  30151. (KJS::IA32MacroAssembler::emitCmpl_i32m):
  30152. (KJS::IA32MacroAssembler::emitCallN_r):
  30153. 2008-08-28 Sam Weinig <sam@webkit.org>
  30154. Reviewed by Mark Rowe.
  30155. Exit instead of crashing in ctiUnsupported and ctiTimedOut.
  30156. * VM/Machine.cpp:
  30157. (KJS::ctiUnsupported):
  30158. (KJS::ctiTimedOut):
  30159. 2008-08-28 Oliver Hunt <oliver@apple.com>
  30160. Reviewed by Maciej Stachowiak.
  30161. Implement codegen for op_jsr and op_sret.
  30162. * VM/CTI.cpp:
  30163. (KJS::CTI::privateCompile_pass1_Scan):
  30164. (KJS::CTI::privateCompile_pass2_Main):
  30165. (KJS::CTI::privateCompile):
  30166. * VM/CTI.h:
  30167. (KJS::CTI::JSRInfo::JSRInfo):
  30168. * masm/IA32MacroAsm.h:
  30169. (KJS::IA32MacroAssembler::emitJmpN_m):
  30170. (KJS::IA32MacroAssembler::linkAbsoluteAddress):
  30171. 2008-08-28 Gavin Barraclough <barraclough@apple.com>
  30172. Reviewed by Oliver Hunt.
  30173. Initial support for exceptions (throw / catch must occur in same CodeBlock).
  30174. * VM/CTI.cpp:
  30175. (KJS::CTI::emitExceptionCheck):
  30176. (KJS::CTI::emitCall):
  30177. (KJS::CTI::privateCompile_pass2_Main):
  30178. (KJS::CTI::privateCompile_pass4_SlowCases):
  30179. (KJS::CTI::privateCompile):
  30180. * VM/CTI.h:
  30181. * VM/CodeBlock.cpp:
  30182. (KJS::CodeBlock::nativeExceptionCodeForHandlerVPC):
  30183. * VM/CodeBlock.h:
  30184. * VM/CodeGenerator.cpp:
  30185. (KJS::CodeGenerator::emitCatch):
  30186. * VM/Machine.cpp:
  30187. (KJS::Machine::throwException):
  30188. (KJS::Machine::privateExecute):
  30189. (KJS::ctiUnsupported):
  30190. (KJS::ctiTimedOut):
  30191. (KJS::Machine::cti_op_add):
  30192. (KJS::Machine::cti_op_pre_inc):
  30193. (KJS::Machine::cti_timeout_check):
  30194. (KJS::Machine::cti_op_loop_if_less):
  30195. (KJS::Machine::cti_op_put_by_id):
  30196. (KJS::Machine::cti_op_get_by_id):
  30197. (KJS::Machine::cti_op_instanceof):
  30198. (KJS::Machine::cti_op_del_by_id):
  30199. (KJS::Machine::cti_op_mul):
  30200. (KJS::Machine::cti_op_call):
  30201. (KJS::Machine::cti_op_resolve):
  30202. (KJS::Machine::cti_op_construct):
  30203. (KJS::Machine::cti_op_get_by_val):
  30204. (KJS::Machine::cti_op_resolve_func):
  30205. (KJS::Machine::cti_op_sub):
  30206. (KJS::Machine::cti_op_put_by_val):
  30207. (KJS::Machine::cti_op_lesseq):
  30208. (KJS::Machine::cti_op_loop_if_true):
  30209. (KJS::Machine::cti_op_negate):
  30210. (KJS::Machine::cti_op_resolve_skip):
  30211. (KJS::Machine::cti_op_div):
  30212. (KJS::Machine::cti_op_pre_dec):
  30213. (KJS::Machine::cti_op_jless):
  30214. (KJS::Machine::cti_op_not):
  30215. (KJS::Machine::cti_op_jtrue):
  30216. (KJS::Machine::cti_op_post_inc):
  30217. (KJS::Machine::cti_op_eq):
  30218. (KJS::Machine::cti_op_lshift):
  30219. (KJS::Machine::cti_op_bitand):
  30220. (KJS::Machine::cti_op_rshift):
  30221. (KJS::Machine::cti_op_bitnot):
  30222. (KJS::Machine::cti_op_resolve_with_base):
  30223. (KJS::Machine::cti_op_mod):
  30224. (KJS::Machine::cti_op_less):
  30225. (KJS::Machine::cti_op_neq):
  30226. (KJS::Machine::cti_op_post_dec):
  30227. (KJS::Machine::cti_op_urshift):
  30228. (KJS::Machine::cti_op_bitxor):
  30229. (KJS::Machine::cti_op_bitor):
  30230. (KJS::Machine::cti_op_call_eval):
  30231. (KJS::Machine::cti_op_throw):
  30232. (KJS::Machine::cti_op_push_scope):
  30233. (KJS::Machine::cti_op_stricteq):
  30234. (KJS::Machine::cti_op_nstricteq):
  30235. (KJS::Machine::cti_op_to_jsnumber):
  30236. (KJS::Machine::cti_op_in):
  30237. (KJS::Machine::cti_op_del_by_val):
  30238. (KJS::Machine::cti_vm_throw):
  30239. * VM/Machine.h:
  30240. * kjs/ExecState.h:
  30241. * masm/IA32MacroAsm.h:
  30242. (KJS::IA32MacroAssembler::emitCmpl_i32m):
  30243. 2008-08-28 Mark Rowe <mrowe@apple.com>
  30244. Rubber-stamped by Oliver Hunt.
  30245. Print debugging info to stderr so that run-webkit-tests can capture it.
  30246. This makes it easy to check whether test failures are due to unimplemented
  30247. op codes, missing support for exceptions, etc.
  30248. * VM/CTI.cpp:
  30249. (KJS::CTI::privateCompile_pass1_Scan):
  30250. (KJS::CTI::printOpcodeOperandTypes):
  30251. (KJS::CTI::privateCompile_pass2_Main):
  30252. (KJS::CTI::privateCompile_pass4_SlowCases):
  30253. (KJS::CTI::privateCompile):
  30254. * VM/Machine.cpp:
  30255. (KJS::Machine::privateExecute):
  30256. (KJS::ctiException):
  30257. (KJS::ctiUnsupported):
  30258. (KJS::Machine::cti_op_call):
  30259. (KJS::Machine::cti_op_resolve):
  30260. (KJS::Machine::cti_op_construct):
  30261. (KJS::Machine::cti_op_get_by_val):
  30262. (KJS::Machine::cti_op_resolve_func):
  30263. (KJS::Machine::cti_op_resolve_skip):
  30264. (KJS::Machine::cti_op_resolve_with_base):
  30265. (KJS::Machine::cti_op_call_eval):
  30266. 2008-08-27 Mark Rowe <mrowe@apple.com>
  30267. Reviewed by Gavin Barraclough and Maciej Stachowiak.
  30268. Fix fast/js/bitwise-and-on-undefined.html.
  30269. A temporary value in the slow path of op_bitand was being stored in edx, but was
  30270. being clobbered by emitGetPutArg before we used it. To fix this, emitGetPutArg
  30271. now takes a third argument that specifies the scratch register to use when loading
  30272. from memory. This allows us to avoid clobbering the temporary in op_bitand.
  30273. * VM/CTI.cpp:
  30274. (KJS::CTI::emitGetPutArg):
  30275. (KJS::CTI::privateCompile_pass2_Main):
  30276. (KJS::CTI::privateCompile_pass4_SlowCases):
  30277. * VM/CTI.h:
  30278. 2008-08-27 Mark Rowe <mrowe@apple.com>
  30279. Rubber-stamped by Oliver Hunt.
  30280. Switch CTI on by default.
  30281. * wtf/Platform.h:
  30282. 2008-08-27 Mark Rowe <mrowe@apple.com>
  30283. Reviewed by Oliver Hunt.
  30284. Fix the build of the full WebKit stack.
  30285. * JavaScriptCore.xcodeproj/project.pbxproj: Mark two new headers as private so they can be pulled in from WebCore.
  30286. * VM/CTI.h: Fix build issues that show up when compiled with GCC 4.2 as part of WebCore.
  30287. * wrec/WREC.h: Ditto.
  30288. 2008-08-27 Mark Rowe <mrowe@apple.com>
  30289. Reviewed by Sam Weinig.
  30290. Implement op_new_error. Does not fix any tests as it is always followed by the unimplemented op_throw.
  30291. * VM/CTI.cpp:
  30292. (KJS::CTI::privateCompile_pass1_Scan):
  30293. (KJS::CTI::privateCompile_pass2_Main):
  30294. * VM/Machine.cpp:
  30295. (KJS::Machine::cti_op_new_error):
  30296. * VM/Machine.h:
  30297. 2008-08-27 Sam Weinig <sam@webkit.org>
  30298. Reviewed by Gavin Barraclough and Geoff Garen.
  30299. Implement op_put_getter and op_put_setter.
  30300. * VM/CTI.cpp:
  30301. (KJS::CTI::privateCompile_pass1_Scan):
  30302. (KJS::CTI::privateCompile_pass2_Main):
  30303. * VM/Machine.cpp:
  30304. (KJS::Machine::cti_op_put_getter):
  30305. (KJS::Machine::cti_op_put_setter):
  30306. * VM/Machine.h:
  30307. 2008-08-27 Sam Weinig <sam@webkit.org>
  30308. Reviewed by Gavin Barraclough and Geoff Garen.
  30309. Implement op_del_by_val fixing 3 mozilla tests.
  30310. * VM/CTI.cpp:
  30311. (KJS::CTI::privateCompile_pass1_Scan):
  30312. (KJS::CTI::privateCompile_pass2_Main):
  30313. * VM/Machine.cpp:
  30314. (KJS::Machine::cti_op_del_by_val):
  30315. * VM/Machine.h:
  30316. 2008-08-27 Gavin Barraclough <barraclough@apple.com>
  30317. Reviewed by Oliver Hunt.
  30318. Quick & dirty fix to get SamplingTool sampling op_call.
  30319. * VM/SamplingTool.h:
  30320. (KJS::SamplingTool::callingHostFunction):
  30321. 2008-08-27 Sam Weinig <sam@webkit.org>
  30322. Reviewed by Gavin Barraclough and Geoff Garen.
  30323. Fix op_put_by_index.
  30324. * VM/CTI.cpp:
  30325. (KJS::CTI::privateCompile_pass2_Main): Use emitPutArgConstant instead of emitGetPutArg
  30326. for the property value.
  30327. * VM/Machine.cpp:
  30328. (KJS::Machine::cti_op_put_by_index): Get the property value from the correct argument.
  30329. 2008-08-27 Sam Weinig <sam@webkit.org>
  30330. Reviewed by Gavin Barraclough and Geoff Garen.
  30331. Implement op_switch_imm in the CTI fixing 13 mozilla tests.
  30332. * VM/CTI.cpp:
  30333. (KJS::CTI::privateCompile_pass1_Scan):
  30334. (KJS::CTI::privateCompile_pass2_Main):
  30335. * VM/Machine.cpp:
  30336. (KJS::Machine::cti_op_switch_imm):
  30337. * VM/Machine.h:
  30338. 2008-08-27 Gavin Barraclough <barraclough@apple.com>
  30339. Reviewed by Oliver Hunt.
  30340. Implement op_switch_char in CTI.
  30341. * VM/CTI.cpp:
  30342. (KJS::CTI::emitCall):
  30343. (KJS::CTI::privateCompile_pass1_Scan):
  30344. (KJS::CTI::privateCompile_pass2_Main):
  30345. (KJS::CTI::privateCompile):
  30346. * VM/CTI.h:
  30347. (KJS::CallRecord::CallRecord):
  30348. (KJS::SwitchRecord::SwitchRecord):
  30349. * VM/CodeBlock.h:
  30350. (KJS::SimpleJumpTable::SimpleJumpTable::ctiForValue):
  30351. * VM/Machine.cpp:
  30352. (KJS::Machine::cti_op_switch_char):
  30353. * VM/Machine.h:
  30354. * masm/IA32MacroAsm.h:
  30355. (KJS::IA32MacroAssembler::):
  30356. (KJS::IA32MacroAssembler::emitJmpN_r):
  30357. (KJS::IA32MacroAssembler::getRelocatedAddress):
  30358. * wtf/Platform.h:
  30359. 2008-08-26 Sam Weinig <sam@webkit.org>
  30360. Reviewed by Mark Rowe.
  30361. Implement op_put_by_index to fix 1 mozilla test.
  30362. * VM/CTI.cpp:
  30363. (KJS::CTI::privateCompile_pass1_Scan):
  30364. (KJS::CTI::privateCompile_pass2_Main):
  30365. * VM/Machine.cpp:
  30366. (KJS::Machine::cti_op_put_by_index):
  30367. * VM/Machine.h:
  30368. 2008-08-26 Gavin Barraclough <barraclough@apple.com>
  30369. Reviewed by Geoff Garen.
  30370. More fixes from Geoff's review.
  30371. * VM/CTI.cpp:
  30372. (KJS::CTI::emitGetArg):
  30373. (KJS::CTI::emitGetPutArg):
  30374. (KJS::CTI::emitPutArg):
  30375. (KJS::CTI::emitPutArgConstant):
  30376. (KJS::CTI::getConstantImmediateNumericArg):
  30377. (KJS::CTI::emitGetCTIParam):
  30378. (KJS::CTI::emitPutResult):
  30379. (KJS::CTI::emitCall):
  30380. (KJS::CTI::emitJumpSlowCaseIfNotImm):
  30381. (KJS::CTI::emitJumpSlowCaseIfNotImms):
  30382. (KJS::CTI::getDeTaggedConstantImmediate):
  30383. (KJS::CTI::emitFastArithDeTagImmediate):
  30384. (KJS::CTI::emitFastArithReTagImmediate):
  30385. (KJS::CTI::emitFastArithPotentiallyReTagImmediate):
  30386. (KJS::CTI::emitFastArithImmToInt):
  30387. (KJS::CTI::emitFastArithIntToImmOrSlowCase):
  30388. (KJS::CTI::privateCompile_pass2_Main):
  30389. (KJS::CTI::privateCompile_pass4_SlowCases):
  30390. (KJS::CTI::privateCompile):
  30391. * VM/CTI.h:
  30392. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30393. Reviewed by Gavin Barraclough and Geoff Garen.
  30394. Implement op_jmp_scopes to fix 2 Mozilla tests.
  30395. * VM/CTI.cpp:
  30396. (KJS::CTI::privateCompile_pass1_Scan):
  30397. (KJS::CTI::privateCompile_pass2_Main):
  30398. * VM/Machine.cpp:
  30399. (KJS::Machine::cti_op_push_new_scope): Update ExecState::m_scopeChain after calling ARG_setScopeChain.
  30400. (KJS::Machine::cti_op_jmp_scopes):
  30401. * VM/Machine.h:
  30402. 2008-08-26 Gavin Barraclough <barraclough@apple.com>
  30403. Reviewed by Oliver Hunt.
  30404. WebKit Regular Expression Compiler. (set ENABLE_WREC = 1 in Platform.h).
  30405. * JavaScriptCore.xcodeproj/project.pbxproj:
  30406. * kjs/regexp.cpp:
  30407. * kjs/regexp.h:
  30408. * wrec: Added.
  30409. * wrec/WREC.cpp: Added.
  30410. * wrec/WREC.h: Added.
  30411. * wtf/Platform.h:
  30412. 2008-08-26 Sam Weinig <sam@webkit.org>
  30413. Rubber-stamped by Oliver Hunt.
  30414. Remove bogus assertion.
  30415. * VM/Machine.cpp:
  30416. (KJS::Machine::cti_op_del_by_id):
  30417. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30418. Reviewed by Sam Weinig.
  30419. Implement op_push_new_scope and stub out op_catch. This fixes 11 Mozilla tests.
  30420. * VM/CTI.cpp:
  30421. (KJS::CTI::privateCompile_pass1_Scan):
  30422. (KJS::CTI::privateCompile_pass2_Main):
  30423. * VM/Machine.cpp:
  30424. (KJS::Machine::cti_op_push_new_scope):
  30425. (KJS::Machine::cti_op_catch):
  30426. * VM/Machine.h:
  30427. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30428. Reviewed by Sam Weinig.
  30429. Clean up op_resolve_base so that it shares its implementation with the bytecode interpreter.
  30430. * VM/Machine.cpp:
  30431. (KJS::inlineResolveBase):
  30432. (KJS::resolveBase):
  30433. 2008-08-26 Oliver Hunt <oliver@apple.com>
  30434. Reviewed by Sam Weinig.
  30435. Add codegen support for op_instanceof, fixing 15 mozilla tests.
  30436. * VM/CTI.cpp:
  30437. (KJS::CTI::privateCompile_pass1_Scan):
  30438. (KJS::CTI::privateCompile_pass2_Main):
  30439. * VM/Machine.cpp:
  30440. (KJS::Machine::cti_op_instanceof):
  30441. (KJS::Machine::cti_op_del_by_id):
  30442. * VM/Machine.h:
  30443. * wtf/Platform.h:
  30444. 2008-08-26 Gavin Barraclough <barraclough@apple.com>
  30445. Reviewed by Geoff Garen.
  30446. Fixes for initial review comments.
  30447. * VM/CTI.cpp:
  30448. (KJS::CTI::ctiCompileGetArg):
  30449. (KJS::CTI::ctiCompileGetPutArg):
  30450. (KJS::CTI::ctiCompilePutResult):
  30451. (KJS::CTI::ctiCompileCall):
  30452. (KJS::CTI::CTI):
  30453. (KJS::CTI::privateCompile_pass1_Scan):
  30454. (KJS::CTI::printOpcodeOperandTypes):
  30455. (KJS::CTI::privateCompile_pass2_Main):
  30456. (KJS::CTI::privateCompile_pass4_SlowCases):
  30457. (KJS::CTI::privateCompile):
  30458. * VM/CTI.h:
  30459. * VM/Register.h:
  30460. * kjs/JSValue.h:
  30461. 2008-08-26 Sam Weinig <sam@webkit.org>
  30462. Reviewed by Gavin Barraclough and Geoff Garen.
  30463. Fix up exception checking code.
  30464. * VM/Machine.cpp:
  30465. (KJS::Machine::cti_op_call):
  30466. (KJS::Machine::cti_op_resolve):
  30467. (KJS::Machine::cti_op_construct):
  30468. (KJS::Machine::cti_op_resolve_func):
  30469. (KJS::Machine::cti_op_resolve_skip):
  30470. (KJS::Machine::cti_op_resolve_with_base):
  30471. (KJS::Machine::cti_op_call_eval):
  30472. 2008-08-26 Sam Weinig <sam@webkit.org>
  30473. Reviewed by Oliver Hunt.
  30474. Fix slowcase for op_post_inc and op_post_dec fixing 2 mozilla tests.
  30475. * VM/CTI.cpp:
  30476. (KJS::CTI::privateCompile_pass4_SlowCases):
  30477. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30478. Reviewed by Sam Weinig.
  30479. Implement op_in, fixing 8 mozilla tests.
  30480. * VM/CTI.cpp:
  30481. (KJS::CTI::privateCompile_pass1_Scan):
  30482. (KJS::CTI::privateCompile_pass2_Main):
  30483. * VM/Machine.cpp:
  30484. (KJS::Machine::cti_op_in):
  30485. * VM/Machine.h:
  30486. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30487. Rubber-stamped by Oliver Hunt.
  30488. Don't hardcode the size of a Register for op_new_array. Fixes a crash
  30489. seen during the Mozilla tests.
  30490. * VM/CTI.cpp:
  30491. (KJS::CTI::privateCompile_pass2_Main):
  30492. 2008-08-26 Sam Weinig <sam@webkit.org>
  30493. Reviewed by Gavin Barraclough and Geoff Garen.
  30494. Add support for op_push_scope and op_pop_scope, fixing 20 mozilla tests.
  30495. * VM/CTI.cpp:
  30496. (KJS::CTI::privateCompile_pass1_Scan):
  30497. (KJS::CTI::privateCompile_pass2_Main):
  30498. * VM/CTI.h:
  30499. * VM/Machine.cpp:
  30500. (KJS::Machine::cti_op_push_scope):
  30501. (KJS::Machine::cti_op_pop_scope):
  30502. * VM/Machine.h:
  30503. 2008-08-26 Oliver Hunt <oliver@apple.com>
  30504. Reviewed by Maciej Stachowiak.
  30505. Add codegen support for op_del_by_id, fixing 49 mozilla tests.
  30506. * VM/CTI.cpp:
  30507. (KJS::CTI::privateCompile_pass1_Scan):
  30508. (KJS::CTI::privateCompile_pass2_Main):
  30509. * VM/Machine.cpp:
  30510. (KJS::Machine::cti_op_del_by_id):
  30511. * VM/Machine.h:
  30512. 2008-08-26 Sam Weinig <sam@webkit.org>
  30513. Reviewed by Gavin Barraclough and Geoff Garen.
  30514. Don't hardcode the size of a Register for op_get_scoped_var and op_put_scoped_var
  30515. fixing 513 mozilla tests in debug build.
  30516. * VM/CTI.cpp:
  30517. (KJS::CTI::privateCompile_pass2_Main):
  30518. 2008-08-26 Oliver Hunt <oliver@apple.com>
  30519. Reviewed by Maciej Stachowiak.
  30520. Added code generator support for op_loop, fixing around 60 mozilla tests.
  30521. * VM/CTI.cpp:
  30522. (KJS::CTI::privateCompile_pass1_Scan):
  30523. (KJS::CTI::privateCompile_pass2_Main):
  30524. 2008-08-26 Mark Rowe <mrowe@apple.com>
  30525. Reviewed by Sam Weinig.
  30526. Set -fomit-frame-pointer in the correct location.
  30527. * Configurations/JavaScriptCore.xcconfig:
  30528. * JavaScriptCore.xcodeproj/project.pbxproj:
  30529. 2008-08-26 Gavin Barraclough <barraclough@apple.com>
  30530. Reviewed by Geoff Garen.
  30531. Inital cut of CTI, Geoff's review fixes to follow.
  30532. * JavaScriptCore.xcodeproj/project.pbxproj:
  30533. * VM/CTI.cpp: Added.
  30534. (KJS::getJCB):
  30535. (KJS::CTI::ctiCompileGetArg):
  30536. (KJS::CTI::ctiCompileGetPutArg):
  30537. (KJS::CTI::ctiCompilePutArg):
  30538. (KJS::CTI::ctiCompilePutArgImm):
  30539. (KJS::CTI::ctiImmediateNumericArg):
  30540. (KJS::CTI::ctiCompileGetCTIParam):
  30541. (KJS::CTI::ctiCompilePutResult):
  30542. (KJS::CTI::ctiCompileCall):
  30543. (KJS::CTI::slowCaseIfNotImm):
  30544. (KJS::CTI::slowCaseIfNotImms):
  30545. (KJS::CTI::ctiFastArithDeTagConstImmediate):
  30546. (KJS::CTI::ctiFastArithDeTagImmediate):
  30547. (KJS::CTI::ctiFastArithReTagImmediate):
  30548. (KJS::CTI::ctiFastArithPotentiallyReTagImmediate):
  30549. (KJS::CTI::ctiFastArithImmToInt):
  30550. (KJS::CTI::ctiFastArithIntToImmOrSlowCase):
  30551. (KJS::CTI::CTI):
  30552. (KJS::CTI::privateCompile_pass1_Scan):
  30553. (KJS::CTI::ctiCompileAdd):
  30554. (KJS::CTI::ctiCompileAddImm):
  30555. (KJS::CTI::ctiCompileAddImmNotInt):
  30556. (KJS::CTI::TEMP_HACK_PRINT_TYPES):
  30557. (KJS::CTI::privateCompile_pass2_Main):
  30558. (KJS::CTI::privateCompile_pass3_Link):
  30559. (KJS::CTI::privateCompile_pass4_SlowCases):
  30560. (KJS::CTI::privateCompile):
  30561. * VM/CTI.h: Added.
  30562. (KJS::CTI2Result::CTI2Result):
  30563. (KJS::CallRecord::CallRecord):
  30564. (KJS::JmpTable::JmpTable):
  30565. (KJS::SlowCaseEntry::SlowCaseEntry):
  30566. (KJS::CTI::compile):
  30567. (KJS::CTI::LabelInfo::LabelInfo):
  30568. * VM/CodeBlock.h:
  30569. (KJS::CodeBlock::CodeBlock):
  30570. (KJS::CodeBlock::~CodeBlock):
  30571. * VM/Machine.cpp:
  30572. (KJS::Machine::execute):
  30573. (KJS::Machine::privateExecute):
  30574. (KJS::ctiException):
  30575. (KJS::ctiUnsupported):
  30576. (KJS::ctiTimedOut):
  30577. (KJS::Machine::cti_op_end):
  30578. (KJS::Machine::cti_op_add):
  30579. (KJS::Machine::cti_op_pre_inc):
  30580. (KJS::Machine::cti_timeout_check):
  30581. (KJS::Machine::cti_op_loop_if_less):
  30582. (KJS::Machine::cti_op_new_object):
  30583. (KJS::Machine::cti_op_put_by_id):
  30584. (KJS::Machine::cti_op_get_by_id):
  30585. (KJS::Machine::cti_op_mul):
  30586. (KJS::Machine::cti_op_new_func):
  30587. (KJS::Machine::cti_op_call):
  30588. (KJS::Machine::cti_op_ret):
  30589. (KJS::Machine::cti_op_new_array):
  30590. (KJS::Machine::cti_op_resolve):
  30591. (KJS::Machine::cti_op_construct):
  30592. (KJS::Machine::cti_op_get_by_val):
  30593. (KJS::Machine::cti_op_resolve_func):
  30594. (KJS::Machine::cti_op_sub):
  30595. (KJS::Machine::cti_op_put_by_val):
  30596. (KJS::Machine::cti_op_lesseq):
  30597. (KJS::Machine::cti_op_loop_if_true):
  30598. (KJS::Machine::cti_op_negate):
  30599. (KJS::Machine::cti_op_resolve_base):
  30600. (KJS::Machine::cti_op_resolve_skip):
  30601. (KJS::Machine::cti_op_div):
  30602. (KJS::Machine::cti_op_pre_dec):
  30603. (KJS::Machine::cti_op_jless):
  30604. (KJS::Machine::cti_op_not):
  30605. (KJS::Machine::cti_op_jtrue):
  30606. (KJS::Machine::cti_op_post_inc):
  30607. (KJS::Machine::cti_op_eq):
  30608. (KJS::Machine::cti_op_lshift):
  30609. (KJS::Machine::cti_op_bitand):
  30610. (KJS::Machine::cti_op_rshift):
  30611. (KJS::Machine::cti_op_bitnot):
  30612. (KJS::Machine::cti_op_resolve_with_base):
  30613. (KJS::Machine::cti_op_new_func_exp):
  30614. (KJS::Machine::cti_op_mod):
  30615. (KJS::Machine::cti_op_less):
  30616. (KJS::Machine::cti_op_neq):
  30617. (KJS::Machine::cti_op_post_dec):
  30618. (KJS::Machine::cti_op_urshift):
  30619. (KJS::Machine::cti_op_bitxor):
  30620. (KJS::Machine::cti_op_new_regexp):
  30621. (KJS::Machine::cti_op_bitor):
  30622. (KJS::Machine::cti_op_call_eval):
  30623. (KJS::Machine::cti_op_throw):
  30624. (KJS::Machine::cti_op_get_pnames):
  30625. (KJS::Machine::cti_op_next_pname):
  30626. (KJS::Machine::cti_op_typeof):
  30627. (KJS::Machine::cti_op_stricteq):
  30628. (KJS::Machine::cti_op_nstricteq):
  30629. (KJS::Machine::cti_op_to_jsnumber):
  30630. * VM/Machine.h:
  30631. * VM/Register.h:
  30632. (KJS::Register::jsValue):
  30633. (KJS::Register::getJSValue):
  30634. (KJS::Register::codeBlock):
  30635. (KJS::Register::scopeChain):
  30636. (KJS::Register::i):
  30637. (KJS::Register::r):
  30638. (KJS::Register::vPC):
  30639. (KJS::Register::jsPropertyNameIterator):
  30640. * VM/SamplingTool.cpp:
  30641. (KJS::):
  30642. (KJS::SamplingTool::run):
  30643. (KJS::SamplingTool::dump):
  30644. * VM/SamplingTool.h:
  30645. * kjs/JSImmediate.h:
  30646. (KJS::JSImmediate::zeroImmediate):
  30647. (KJS::JSImmediate::oneImmediate):
  30648. * kjs/JSValue.h:
  30649. * kjs/JSVariableObject.h:
  30650. (KJS::JSVariableObject::JSVariableObjectData::offsetOf_registers):
  30651. (KJS::JSVariableObject::offsetOf_d):
  30652. (KJS::JSVariableObject::offsetOf_Data_registers):
  30653. * masm: Added.
  30654. * masm/IA32MacroAsm.h: Added.
  30655. (KJS::JITCodeBuffer::JITCodeBuffer):
  30656. (KJS::JITCodeBuffer::putByte):
  30657. (KJS::JITCodeBuffer::putShort):
  30658. (KJS::JITCodeBuffer::putInt):
  30659. (KJS::JITCodeBuffer::getEIP):
  30660. (KJS::JITCodeBuffer::start):
  30661. (KJS::JITCodeBuffer::getOffset):
  30662. (KJS::JITCodeBuffer::reset):
  30663. (KJS::JITCodeBuffer::copy):
  30664. (KJS::IA32MacroAssembler::):
  30665. (KJS::IA32MacroAssembler::emitModRm_rr):
  30666. (KJS::IA32MacroAssembler::emitModRm_rm):
  30667. (KJS::IA32MacroAssembler::emitModRm_rmsib):
  30668. (KJS::IA32MacroAssembler::emitModRm_opr):
  30669. (KJS::IA32MacroAssembler::emitModRm_opm):
  30670. (KJS::IA32MacroAssembler::IA32MacroAssembler):
  30671. (KJS::IA32MacroAssembler::emitInt3):
  30672. (KJS::IA32MacroAssembler::emitPushl_r):
  30673. (KJS::IA32MacroAssembler::emitPopl_r):
  30674. (KJS::IA32MacroAssembler::emitMovl_rr):
  30675. (KJS::IA32MacroAssembler::emitAddl_rr):
  30676. (KJS::IA32MacroAssembler::emitAddl_i8r):
  30677. (KJS::IA32MacroAssembler::emitAddl_i32r):
  30678. (KJS::IA32MacroAssembler::emitAddl_mr):
  30679. (KJS::IA32MacroAssembler::emitAndl_rr):
  30680. (KJS::IA32MacroAssembler::emitAndl_i32r):
  30681. (KJS::IA32MacroAssembler::emitCmpl_i8r):
  30682. (KJS::IA32MacroAssembler::emitCmpl_rr):
  30683. (KJS::IA32MacroAssembler::emitCmpl_rm):
  30684. (KJS::IA32MacroAssembler::emitCmpl_i32r):
  30685. (KJS::IA32MacroAssembler::emitCmpw_rm):
  30686. (KJS::IA32MacroAssembler::emitOrl_rr):
  30687. (KJS::IA32MacroAssembler::emitOrl_i8r):
  30688. (KJS::IA32MacroAssembler::emitSubl_rr):
  30689. (KJS::IA32MacroAssembler::emitSubl_i8r):
  30690. (KJS::IA32MacroAssembler::emitSubl_i32r):
  30691. (KJS::IA32MacroAssembler::emitSubl_mr):
  30692. (KJS::IA32MacroAssembler::emitTestl_i32r):
  30693. (KJS::IA32MacroAssembler::emitTestl_rr):
  30694. (KJS::IA32MacroAssembler::emitXorl_i8r):
  30695. (KJS::IA32MacroAssembler::emitXorl_rr):
  30696. (KJS::IA32MacroAssembler::emitSarl_i8r):
  30697. (KJS::IA32MacroAssembler::emitSarl_CLr):
  30698. (KJS::IA32MacroAssembler::emitShl_i8r):
  30699. (KJS::IA32MacroAssembler::emitShll_CLr):
  30700. (KJS::IA32MacroAssembler::emitMull_rr):
  30701. (KJS::IA32MacroAssembler::emitIdivl_r):
  30702. (KJS::IA32MacroAssembler::emitCdq):
  30703. (KJS::IA32MacroAssembler::emitMovl_mr):
  30704. (KJS::IA32MacroAssembler::emitMovzwl_mr):
  30705. (KJS::IA32MacroAssembler::emitMovl_rm):
  30706. (KJS::IA32MacroAssembler::emitMovl_i32r):
  30707. (KJS::IA32MacroAssembler::emitMovl_i32m):
  30708. (KJS::IA32MacroAssembler::emitLeal_mr):
  30709. (KJS::IA32MacroAssembler::emitRet):
  30710. (KJS::IA32MacroAssembler::JmpSrc::JmpSrc):
  30711. (KJS::IA32MacroAssembler::JmpDst::JmpDst):
  30712. (KJS::IA32MacroAssembler::emitCall):
  30713. (KJS::IA32MacroAssembler::label):
  30714. (KJS::IA32MacroAssembler::emitUnlinkedJmp):
  30715. (KJS::IA32MacroAssembler::emitUnlinkedJne):
  30716. (KJS::IA32MacroAssembler::emitUnlinkedJe):
  30717. (KJS::IA32MacroAssembler::emitUnlinkedJl):
  30718. (KJS::IA32MacroAssembler::emitUnlinkedJle):
  30719. (KJS::IA32MacroAssembler::emitUnlinkedJge):
  30720. (KJS::IA32MacroAssembler::emitUnlinkedJae):
  30721. (KJS::IA32MacroAssembler::emitUnlinkedJo):
  30722. (KJS::IA32MacroAssembler::emitPredictionNotTaken):
  30723. (KJS::IA32MacroAssembler::link):
  30724. (KJS::IA32MacroAssembler::copy):
  30725. * wtf/Platform.h:
  30726. 2008-08-26 Oliver Hunt <oliver@apple.com>
  30727. RS=Maciej.
  30728. Enabled -fomit-frame-pointer on Release and Production builds, add additional Profiling build config for shark, etc.
  30729. * JavaScriptCore.xcodeproj/project.pbxproj:
  30730. === Start merge of squirrelfish-extreme ===
  30731. 2008-09-06 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  30732. Reviewed by Maciej Stachowiak.
  30733. Fix the Mac Debug build by adding symbols that are exported only in a
  30734. Debug configuration.
  30735. * Configurations/JavaScriptCore.xcconfig:
  30736. * DerivedSources.make:
  30737. * JavaScriptCore.Debug.exp: Added.
  30738. * JavaScriptCore.base.exp: Copied from JavaScriptCore.exp.
  30739. * JavaScriptCore.exp: Removed.
  30740. * JavaScriptCore.xcodeproj/project.pbxproj:
  30741. 2008-09-05 Darin Adler <darin@apple.com>
  30742. Reviewed by Cameron Zwarich.
  30743. - https://bugs.webkit.org/show_bug.cgi?id=20681
  30744. JSPropertyNameIterator functions need to be inlined
  30745. 1.007x as fast on SunSpider overall
  30746. 1.081x as fast on SunSpider math-cordic
  30747. * VM/JSPropertyNameIterator.cpp: Moved functions out of here.
  30748. * VM/JSPropertyNameIterator.h:
  30749. (KJS::JSPropertyNameIterator::JSPropertyNameIterator): Moved
  30750. this into the header and marked it inline.
  30751. (KJS::JSPropertyNameIterator::create): Ditto.
  30752. (KJS::JSPropertyNameIterator::next): Ditto.
  30753. 2008-09-05 Darin Adler <darin@apple.com>
  30754. Reviewed by Geoffrey Garen.
  30755. - fix https://bugs.webkit.org/show_bug.cgi?id=20673
  30756. single-character strings are churning in the Identifier table
  30757. 1.007x as fast on SunSpider overall
  30758. 1.167x as fast on SunSpider string-fasta
  30759. * JavaScriptCore.exp: Updated.
  30760. * kjs/SmallStrings.cpp:
  30761. (KJS::SmallStrings::singleCharacterStringRep): Added.
  30762. * kjs/SmallStrings.h: Added singleCharacterStringRep for clients that
  30763. need just a UString, not a JSString.
  30764. * kjs/identifier.cpp:
  30765. (KJS::Identifier::add): Added special cases for single character strings
  30766. so that the UString::Rep that ends up in the identifier table is the one
  30767. from the single-character string optimization; otherwise we end up having
  30768. to look it up in the identifier table over and over again.
  30769. (KJS::Identifier::addSlowCase): Ditto.
  30770. (KJS::Identifier::checkSameIdentifierTable): Made this function an empty
  30771. inline in release builds so that callers don't have to put #ifndef NDEBUG
  30772. at each call site.
  30773. * kjs/identifier.h:
  30774. (KJS::Identifier::add): Removed #ifndef NDEBUG around the calls to
  30775. checkSameIdentifierTable.
  30776. (KJS::Identifier::checkSameIdentifierTable): Added. Empty inline version
  30777. for NDEBUG builds.
  30778. 2008-09-05 Mark Rowe <mrowe@apple.com>
  30779. Build fix.
  30780. * kjs/JSObject.h: Move the inline virtual destructor after a non-inline
  30781. virtual function so that the symbol for the vtable is not marked as a
  30782. weakly exported symbol.
  30783. 2008-09-05 Darin Adler <darin@apple.com>
  30784. Reviewed by Sam Weinig.
  30785. - fix https://bugs.webkit.org/show_bug.cgi?id=20671
  30786. JavaScriptCore string manipulation spends too much time in memcpy
  30787. 1.011x as fast on SunSpider overall
  30788. 1.028x as fast on SunSpider string tests
  30789. For small strings, use a loop rather than calling memcpy. The loop can
  30790. be faster because there's no function call overhead, and because it can
  30791. assume the pointers are aligned instead of checking that. Currently the
  30792. threshold is set at 20 characters, based on some testing on one particular
  30793. computer. Later we can tune this for various platforms by setting
  30794. USTRING_COPY_CHARS_INLINE_CUTOFF appropriately, but it does no great harm
  30795. if not perfectly tuned.
  30796. * kjs/ustring.cpp:
  30797. (KJS::overflowIndicator): Removed bogus const.
  30798. (KJS::maxUChars): Ditto.
  30799. (KJS::copyChars): Added.
  30800. (KJS::UString::Rep::createCopying): Call copyChars instead of memcpy.
  30801. Also eliminated need for const_cast.
  30802. (KJS::UString::expandPreCapacity): Ditto.
  30803. (KJS::concatenate): Ditto.
  30804. (KJS::UString::spliceSubstringsWithSeparators): Ditto.
  30805. (KJS::UString::append): Ditto.
  30806. 2008-09-05 Kevin McCullough <kmccullough@apple.com>
  30807. Reviewed by Sam and Alexey.
  30808. Make the profiler work with a null exec state. This will allow other
  30809. applications start the profiler to get DTrace probes going without
  30810. needing a WebView.
  30811. * ChangeLog:
  30812. * profiler/ProfileGenerator.cpp:
  30813. (KJS::ProfileGenerator::ProfileGenerator):
  30814. (KJS::ProfileGenerator::willExecute):
  30815. (KJS::ProfileGenerator::didExecute):
  30816. * profiler/Profiler.cpp:
  30817. (KJS::Profiler::startProfiling):
  30818. (KJS::Profiler::stopProfiling):
  30819. (KJS::dispatchFunctionToProfiles):
  30820. 2008-09-04 Gavin Barraclough <barraclough@apple.com>
  30821. Reviewed by Geoffrey Garen.
  30822. Fixed an off-by-one error that would cause the StructureIDChain to
  30823. be one object too short.
  30824. Can't construct a test case because other factors make this not crash
  30825. (yet!).
  30826. * kjs/StructureID.cpp:
  30827. (KJS::StructureIDChain::StructureIDChain):
  30828. 2008-09-04 Kevin Ollivier <kevino@theolliviers.com>
  30829. wx build fixes.
  30830. * JavaScriptCoreSources.bkl:
  30831. 2008-09-04 Mark Rowe <mrowe@apple.com>
  30832. Reviewed by Eric Seidel.
  30833. Fix https://bugs.webkit.org/show_bug.cgi?id=20639.
  30834. Bug 20639: ENABLE_DASHBOARD_SUPPORT does not need to be a FEATURE_DEFINE
  30835. * Configurations/JavaScriptCore.xcconfig: Remove ENABLE_DASHBOARD_SUPPORT from FEATURE_DEFINES.
  30836. * wtf/Platform.h: Set ENABLE_DASHBOARD_SUPPORT for PLATFORM(MAC).
  30837. 2008-09-04 Adele Peterson <adele@apple.com>
  30838. Build fix.
  30839. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  30840. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  30841. * JavaScriptCore.vcproj/jsc/jsc.vcproj:
  30842. 2008-09-04 Mark Rowe <mrowe@apple.com>
  30843. Mac build fix.
  30844. * kjs/config.h: Only check the value of HAVE_CONFIG_H if it is defined.
  30845. 2008-09-04 Marco Barisione <marco.barisione@collabora.co.uk>
  30846. Reviewed by Eric Seidel.
  30847. http://bugs.webkit.org/show_bug.cgi?id=20380
  30848. [GTK][AUTOTOOLS] Include autotoolsconfig.h from config.h
  30849. * kjs/config.h: Include the configuration header generated by
  30850. autotools if available.
  30851. 2008-09-04 Tor Arne Vestbø <tavestbo@trolltech.com>
  30852. Reviewed by Simon.
  30853. Fix the QtWebKit build to match changes in r36016
  30854. * JavaScriptCore.pri:
  30855. 2008-09-04 Mark Rowe <mrowe@apple.com>
  30856. Fix the 64-bit build.
  30857. * VM/CodeBlock.cpp:
  30858. (KJS::CodeBlock::printStructureID): Store the instruction offset into an unsigned local
  30859. to avoid a warning related to format specifiers.
  30860. (KJS::CodeBlock::printStructureIDs): Ditto.
  30861. 2008-09-04 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  30862. Rubber-stamped by Oliver Hunt.
  30863. Correct the spelling of 'entryIndices'.
  30864. * kjs/PropertyMap.cpp:
  30865. (KJS::PropertyMap::get):
  30866. (KJS::PropertyMap::getLocation):
  30867. (KJS::PropertyMap::put):
  30868. (KJS::PropertyMap::insert):
  30869. (KJS::PropertyMap::remove):
  30870. (KJS::PropertyMap::checkConsistency):
  30871. * kjs/PropertyMap.h:
  30872. (KJS::PropertyMapHashTable::entries):
  30873. (KJS::PropertyMap::getOffset):
  30874. (KJS::PropertyMap::putOffset):
  30875. (KJS::PropertyMap::offsetForTableLocation):
  30876. 2008-09-03 Geoffrey Garen <ggaren@apple.com>
  30877. Reviewed by Cameron Zwarich.
  30878. Fixed <rdar://problem/6193925> REGRESSION: Crash occurs at
  30879. KJS::Machine::privateExecute() when attempting to load my Mobile Gallery
  30880. (http://www.me.com/gallery/#home)
  30881. also
  30882. https://bugs.webkit.org/show_bug.cgi?id=20633 Crash in privateExecute
  30883. @ cs.byu.edu
  30884. The underlying problem was that we would cache prototype properties
  30885. even if the prototype was a dictionary.
  30886. The fix is to transition a prototype back from dictionary to normal
  30887. status when an opcode caches access to it. (This is better than just
  30888. refusing to cache, since a heavily accessed prototype is almost
  30889. certainly not a true dictionary.)
  30890. * VM/Machine.cpp:
  30891. (KJS::Machine::tryCacheGetByID):
  30892. * kjs/JSObject.h:
  30893. 2008-09-03 Eric Seidel <eric@webkit.org>
  30894. Reviewed by Sam.
  30895. Clean up Platform.h and add PLATFORM(CHROMIUM), PLATFORM(SKIA) and USE(V8_BINDINGS)
  30896. * Configurations/JavaScriptCore.xcconfig: add missing ENABLE_*
  30897. * wtf/ASCIICType.h: include <wtf/Assertions.h> since it depends on it.
  30898. * wtf/Platform.h:
  30899. 2008-09-03 Kevin McCullough <kmccullough@apple.com>
  30900. Reviewed by Tim.
  30901. Remove the rest of the "zombie" code from the profiler.
  30902. - There is no longer a need for the ProfilerClient callback mechanism.
  30903. * API/JSProfilerPrivate.cpp:
  30904. (JSStartProfiling):
  30905. * JavaScriptCore.exp:
  30906. * profiler/HeavyProfile.h:
  30907. * profiler/ProfileGenerator.cpp:
  30908. (KJS::ProfileGenerator::create):
  30909. (KJS::ProfileGenerator::ProfileGenerator):
  30910. * profiler/ProfileGenerator.h:
  30911. (KJS::ProfileGenerator::profileGroup):
  30912. * profiler/Profiler.cpp:
  30913. (KJS::Profiler::startProfiling):
  30914. (KJS::Profiler::stopProfiling): Immediately return the profile when
  30915. stopped instead of using a callback.
  30916. * profiler/Profiler.h:
  30917. * profiler/TreeProfile.h:
  30918. 2008-09-03 Adele Peterson <adele@apple.com>
  30919. Build fix.
  30920. * wtf/win/MainThreadWin.cpp:
  30921. 2008-09-02 Kevin McCullough <kmccullough@apple.com>
  30922. Reviewed by Darin and Tim.
  30923. Remove most of the "zombie" mode from the profiler. Next we will need
  30924. to remove the client callback mechanism in profiles.
  30925. - This simplifies the code, leverages the recent changes I've made in
  30926. getting line numbers from SquirrelFish, and is a slight speed
  30927. improvement on SunSpider.
  30928. - Also the "zombie" mode was a constant source of odd edge cases and
  30929. obscure bugs so it's good to remove since all of its issues may not have
  30930. been found.
  30931. * API/JSProfilerPrivate.cpp: No need to call didFinishAllExecution() any
  30932. more.
  30933. (JSEndProfiling):
  30934. * JavaScriptCore.exp: Export the new signature of retrieveLastCaller()
  30935. * VM/Machine.cpp:
  30936. (KJS::Machine::execute): No need to call didFinishAllExecution() any
  30937. more.
  30938. (KJS::Machine::retrieveCaller): Now operates on InternalFunctions now
  30939. since the RegisterFile is no longer guaranteeded to store only
  30940. JSFunctions
  30941. (KJS::Machine::retrieveLastCaller): Now also retrieve the function's
  30942. name
  30943. (KJS::Machine::callFrame): A result of changing retrieveCaller()
  30944. * VM/Machine.h:
  30945. * VM/Register.h:
  30946. * kjs/JSGlobalObject.cpp:
  30947. (KJS::JSGlobalObject::~JSGlobalObject):
  30948. * kjs/nodes.h:
  30949. * profiler/ProfileGenerator.cpp:
  30950. (KJS::ProfileGenerator::create): Now pass the original exec and get the
  30951. global exec and client when necessary. We need the original exec so we
  30952. can have the stack frame where profiling started.
  30953. (KJS::ProfileGenerator::ProfileGenerator): ditto.
  30954. (KJS::ProfileGenerator::addParentForConsoleStart): This is where the
  30955. parent to star of the profile is added, if there is one.
  30956. (KJS::ProfileGenerator::willExecute): Remove uglyness!
  30957. (KJS::ProfileGenerator::didExecute): Ditto!
  30958. (KJS::ProfileGenerator::stopProfiling):
  30959. (KJS::ProfileGenerator::removeProfileStart): Use a better way to find
  30960. and remove the function we are looking for.
  30961. (KJS::ProfileGenerator::removeProfileEnd): Ditto.
  30962. * profiler/ProfileGenerator.h:
  30963. (KJS::ProfileGenerator::client):
  30964. * profiler/ProfileNode.cpp:
  30965. (KJS::ProfileNode::removeChild): Add a better way to remove a child from
  30966. a ProfileNode.
  30967. (KJS::ProfileNode::stopProfiling):
  30968. (KJS::ProfileNode::debugPrintData): Modified a debug-only diagnostic
  30969. function to be sane.
  30970. * profiler/ProfileNode.h:
  30971. * profiler/Profiler.cpp: Change to pass the original exec state.
  30972. (KJS::Profiler::startProfiling):
  30973. (KJS::Profiler::stopProfiling):
  30974. (KJS::Profiler::willExecute):
  30975. (KJS::Profiler::didExecute):
  30976. (KJS::Profiler::createCallIdentifier):
  30977. * profiler/Profiler.h:
  30978. 2008-09-01 Alexey Proskuryakov <ap@webkit.org>
  30979. Reviewed by Darin Adler.
  30980. Implement callOnMainThreadAndWait().
  30981. This will be useful when a background thread needs to perform UI calls synchronously
  30982. (e.g. an openDatabase() call cannot return until the user answers to a confirmation dialog).
  30983. * wtf/MainThread.cpp:
  30984. (WTF::FunctionWithContext::FunctionWithContext): Added a ThreadCondition member. When
  30985. non-zero, the condition is signalled after the function is called.
  30986. (WTF::mainThreadFunctionQueueMutex): Renamed from functionQueueMutex, sinc this is no longer
  30987. static. Changed to be initialized from initializeThreading() to avoid lock contention.
  30988. (WTF::initializeMainThread): On non-Windows platforms, just call mainThreadFunctionQueueMutex.
  30989. (WTF::dispatchFunctionsFromMainThread): Signal synchronous calls when done.
  30990. (WTF::callOnMainThread): Updated for functionQueueMutex rename.
  30991. (WTF::callOnMainThreadAndWait): Added.
  30992. * wtf/MainThread.h: Added callOnMainThreadAndWait(); initializeMainThread() now exists on
  30993. all platforms.
  30994. * wtf/win/MainThreadWin.cpp: (WTF::initializeMainThread): Added a callOnMainThreadAndWait()
  30995. call to initialize function queue mutex.
  30996. * wtf/ThreadingGtk.cpp: (WTF::initializeThreading):
  30997. * wtf/ThreadingPthreads.cpp: (WTF::initializeThreading):
  30998. * wtf/ThreadingQt.cpp: (WTF::initializeThreading):
  30999. Only initialize mainThreadIdentifier on non-Darwin platforms. It was not guaranteed to be
  31000. accurate on Darwin.
  31001. 2008-09-03 Geoffrey Garen <ggaren@apple.com>
  31002. Reviewed by Darin Adler.
  31003. Use isUndefinedOrNull() instead of separate checks for each in op_eq_null
  31004. and op_neq_null.
  31005. * VM/Machine.cpp:
  31006. (KJS::Machine::privateExecute):
  31007. 2008-09-02 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
  31008. Reviewed by Darin Adler.
  31009. Bug 20296: OpcodeStats doesn't build on platforms which don't have mergesort().
  31010. <https://bugs.webkit.org/show_bug.cgi?id=20296>
  31011. * VM/Opcode.cpp:
  31012. (KJS::OpcodeStats::~OpcodeStats): mergesort() replaced with qsort()
  31013. 2008-09-02 Geoffrey Garen <ggaren@apple.com>
  31014. Reviewed by Oliver Hunt.
  31015. Fast path for array.length and string.length.
  31016. SunSpider says 0.5% faster.
  31017. 2008-09-02 Geoffrey Garen <ggaren@apple.com>
  31018. Reviewed by Anders Carlsson.
  31019. Added optimized paths for comparing to null.
  31020. SunSpider says 0.5% faster.
  31021. 2008-09-02 Geoffrey Garen <ggaren@apple.com>
  31022. Reviewed by Sam Weinig.
  31023. Changed jsDriver.pl to dump the exact text you would need in order to
  31024. reproduce a test result. This enables a fast workflow where you copy
  31025. and paste a test failure in the terminal.
  31026. * tests/mozilla/jsDriver.pl:
  31027. 2008-09-02 Geoffrey Garen <ggaren@apple.com>
  31028. Reviewed by Sam Weinig.
  31029. Implemented the rest of Darin's review comments for the 09-01 inline
  31030. caching patch.
  31031. SunSpider says 0.5% faster, but that seems like noise.
  31032. * JavaScriptCore.xcodeproj/project.pbxproj: Put PutPropertySlot into
  31033. its own file, and added BatchedTransitionOptimizer.
  31034. * VM/CodeBlock.cpp:
  31035. (KJS::CodeBlock::~CodeBlock): Use array indexing instead of a pointer
  31036. iterator.
  31037. * VM/CodeGenerator.cpp:
  31038. (KJS::CodeGenerator::CodeGenerator): Used BatchedTransitionOptimizer to
  31039. make batched put and remove for declared variables fast, without forever
  31040. pessimizing the global object. Removed the old getDirect/removeDirect hack
  31041. that tried to do the same in a more limited way.
  31042. * VM/CodeGenerator.h: Moved IdentifierRepHash to the KJS namespace since
  31043. it doesn't specialize anything in WTF.
  31044. * VM/Machine.cpp:
  31045. (KJS::Machine::Machine): Nixed the DummyConstruct tag because it was
  31046. confusingly named.
  31047. (KJS::Machine::execute): Used BatchedTransitionOptimizer, as above. Fixed
  31048. up some comments.
  31049. (KJS::cachePrototypeChain): Cast to JSObject*, since it's more specific.
  31050. (KJS::Machine::tryCachePutByID): Use isNull() instead of comparing to
  31051. jsNull(), since isNull() leaves more options open for the future.
  31052. (KJS::Machine::tryCacheGetByID): ditto
  31053. (KJS::Machine::privateExecute): ditto
  31054. * VM/SamplingTool.cpp:
  31055. (KJS::SamplingTool::dump): Use C++-style cast, to match our style
  31056. guidelines.
  31057. * kjs/BatchedTransitionOptimizer.h: Added. New class that allows host
  31058. code to add a batch of properties to an object in an efficient way.
  31059. * kjs/JSActivation.cpp: Use isNull(), as above.
  31060. * kjs/JSArray.cpp: Get rid of DummyConstruct tag, as above.
  31061. * kjs/JSArray.h:
  31062. * kjs/JSGlobalData.cpp: Nixed two unused StructureIDs.
  31063. * kjs/JSGlobalData.h:
  31064. * kjs/JSImmediate.cpp: Use isNull(), as above.
  31065. * kjs/JSObject.cpp:
  31066. (KJS::JSObject::mark): Moved mark tracing code elsewhere, to make this
  31067. function more readable.
  31068. (KJS::JSObject::put): Use isNull(), as above.
  31069. (KJS::JSObject::createInheritorID): Return a raw pointer, since the
  31070. object is owned by a data member, not necessarily the caller.
  31071. * kjs/JSObject.h:
  31072. * kjs/JSString.cpp: Use isNull(), as above.
  31073. * kjs/PropertyMap.h: Updated to use PropertySlot::invalidOffset.
  31074. * kjs/PropertySlot.h: Changed KJS_INVALID_OFFSET to WTF::notFound
  31075. because C macros are so 80's.
  31076. * kjs/PutPropertySlot.h: Added. Split out of PropertySlot.h. Also renamed
  31077. PutPropertySlot::SlotType to PutPropertySlot::Type, and slotBase to base,
  31078. since "slot" was redundant.
  31079. * kjs/StructureID.cpp: Added a new transition *away* from dictionary
  31080. status, to support BatchedTransitionOptimizer.
  31081. (KJS::StructureIDChain::StructureIDChain): No need to store m_size as
  31082. a data member, so keep it in a local, which might be faster.
  31083. * kjs/StructureID.h:
  31084. * kjs/SymbolTable.h: Moved IdentifierRepHash to KJS namespace, as above.
  31085. * kjs/ustring.h:
  31086. 2008-09-02 Adam Roben <aroben@apple.com>
  31087. Windows build fixes
  31088. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add
  31089. StructureID.{cpp,h} to the project. Also let VS reorder this file.
  31090. * VM/CodeBlock.cpp: Include StringExtras so that snprintf will be
  31091. defined on Windows.
  31092. 2008-09-01 Sam Weinig <sam@webkit.org>
  31093. Fix release build.
  31094. * JavaScriptCore.exp:
  31095. 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
  31096. Reviewed by Oliver Hunt.
  31097. Gtk buildfix
  31098. * GNUmakefile.am:
  31099. * kjs/PropertyMap.cpp: rename Identifier.h to identifier.h
  31100. * kjs/StructureID.cpp: include JSObject.h
  31101. 2008-09-01 Geoffrey Garen <ggaren@apple.com>
  31102. Reviewed by Darin Adler.
  31103. First cut at inline caching for access to vanilla JavaScript properties.
  31104. SunSpider says 4% faster. Tests heavy on dictionary-like access have
  31105. regressed a bit -- we have a lot of room to improve in this area,
  31106. but this patch is over-ripe as-is.
  31107. JSCells now have a StructureID that uniquely identifies their layout,
  31108. and holds their prototype.
  31109. JSValue::put takes a PropertySlot& argument, so it can fill in details
  31110. about where it put a value, for the sake of caching.
  31111. * VM/CodeGenerator.cpp:
  31112. (KJS::CodeGenerator::CodeGenerator): Avoid calling removeDirect if we
  31113. can, since it disables inline caching in the global object. This can
  31114. probably improve in the future.
  31115. * kjs/JSGlobalObject.cpp: Nixed reset(), since it complicates caching, and
  31116. wasn't really necessary.
  31117. * kjs/JSObject.cpp: Tweaked getter / setter behavior not to rely on the
  31118. IsGetterSetter flag, since the flag was buggy. This is necessary in order
  31119. to avoid accidentally accessing a getter / setter as a normal property.
  31120. Also changed getter / setter creation to honor ReadOnly, matching Mozilla.
  31121. * kjs/PropertyMap.cpp: Nixed clear(), since it complicates caching and
  31122. isn't necessary.
  31123. * kjs/Shell.cpp: Moved SamplingTool dumping outside the loop. This allows
  31124. you to aggregate sampling of multiple files (or the same file repeatedly),
  31125. which helped me track down regressions.
  31126. * kjs/ustring.h: Moved IdentifierRepHash here to share it.
  31127. 2008-09-01 Geoffrey Garen <ggaren@apple.com>
  31128. Reviewed by Sam Weinig.
  31129. Eagerly allocate the Math object's numeric constants. This avoids
  31130. constantly reallocating them in loops, and also ensures that the Math
  31131. object will not use the single property optimization, which makes
  31132. properties ineligible for caching.
  31133. SunSpider reports a small speedup, in combination with inline caching.
  31134. * kjs/MathObject.cpp:
  31135. (KJS::MathObject::MathObject):
  31136. (KJS::MathObject::getOwnPropertySlot):
  31137. * kjs/MathObject.h:
  31138. 2008-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
  31139. Gtk build fix, not reviewed.
  31140. * GNUmakefile.am: Add SmallStrings.cpp in both release and debug builds
  31141. 2008-08-31 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31142. Reviewed by Maciej Stachowiak.
  31143. Bug 20577: REGRESSION (r36006): Gmail is broken
  31144. <https://bugs.webkit.org/show_bug.cgi?id=20577>
  31145. r36006 changed stringProtoFuncSubstr() so that it is uses the more
  31146. efficient jsSubstring(), rather than using UString::substr() and then
  31147. calling jsString(). However, the change did not account for the case
  31148. where the start and the length of the substring extend beyond the length
  31149. of the original string. This patch corrects that.
  31150. * kjs/StringPrototype.cpp:
  31151. (KJS::stringProtoFuncSubstr):
  31152. 2008-08-31 Simon Hausmann <hausmann@wekit.org>
  31153. Unreviewed build fix (with gcc 4.3)
  31154. * kjs/ustring.h: Properly forward declare operator== for UString and
  31155. the the concatenate functions inside the KJS namespace.
  31156. 2008-08-30 Darin Adler <darin@apple.com>
  31157. Reviewed by Maciej.
  31158. - https://bugs.webkit.org/show_bug.cgi?id=20333
  31159. improve JavaScript speed when handling single-character strings
  31160. 1.035x as fast on SunSpider overall.
  31161. 1.127x as fast on SunSpider string tests.
  31162. 1.910x as fast on SunSpider string-base64 test.
  31163. * API/JSObjectRef.cpp:
  31164. (JSObjectMakeFunction): Removed unneeded explicit construction of UString.
  31165. * GNUmakefile.am: Added SmallStrings.h and SmallStrings.cpp.
  31166. * JavaScriptCore.pri: Ditto.
  31167. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  31168. Ditto.
  31169. * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
  31170. * JavaScriptCoreSources.bkl: Ditto.
  31171. * JavaScriptCore.exp: Updated.
  31172. * VM/Machine.cpp:
  31173. (KJS::jsAddSlowCase): Changed to use a code path that doesn't involve
  31174. a UString constructor. This avoids an extra jump caused by the "in charge"
  31175. vs. "not in charge" constructors.
  31176. (KJS::jsAdd): Ditto.
  31177. (KJS::jsTypeStringForValue): Adopted jsNontrivialString.
  31178. * kjs/ArrayPrototype.cpp:
  31179. (KJS::arrayProtoFuncToString): Adopted jsEmptyString.
  31180. (KJS::arrayProtoFuncToLocaleString): Ditto.
  31181. (KJS::arrayProtoFuncJoin): Ditto.
  31182. * kjs/BooleanPrototype.cpp:
  31183. (KJS::booleanProtoFuncToString): Adopted jsNontrivialString.
  31184. * kjs/DateConstructor.cpp:
  31185. (KJS::callDate): Ditto.
  31186. * kjs/DatePrototype.cpp:
  31187. (KJS::formatLocaleDate): Adopted jsEmptyString and jsNontrivialString.
  31188. (KJS::dateProtoFuncToString): Ditto.
  31189. (KJS::dateProtoFuncToUTCString): Ditto.
  31190. (KJS::dateProtoFuncToDateString): Ditto.
  31191. (KJS::dateProtoFuncToTimeString): Ditto.
  31192. (KJS::dateProtoFuncToLocaleString): Ditto.
  31193. (KJS::dateProtoFuncToLocaleDateString): Ditto.
  31194. (KJS::dateProtoFuncToLocaleTimeString): Ditto.
  31195. (KJS::dateProtoFuncToGMTString): Ditto.
  31196. * kjs/ErrorPrototype.cpp:
  31197. (KJS::ErrorPrototype::ErrorPrototype): Ditto.
  31198. (KJS::errorProtoFuncToString): Ditto.
  31199. * kjs/JSGlobalData.h: Added SmallStrings.
  31200. * kjs/JSString.cpp:
  31201. (KJS::jsString): Eliminated the overload that takes a const char*.
  31202. Added code to use SmallStrings to get strings of small sizes rather
  31203. than creating a new JSString every time.
  31204. (KJS::jsSubstring): Added. Used when creating a string from a substring
  31205. to avoid creating a JSString in cases where the substring will end up
  31206. empty or as one character.
  31207. (KJS::jsOwnedString): Added the same code as in jsString.
  31208. * kjs/JSString.h: Added new functions jsEmptyString, jsSingleCharacterString,
  31209. jsSingleCharacterSubstring, jsSubstring, and jsNontrivialString for various
  31210. cases where we want to create JSString, and want special handling for small
  31211. strings.
  31212. (KJS::JSString::JSString): Added an overload that takes a PassRefPtr of
  31213. a UString::Rep so you don't have to construct a UString; PassRefPtr can be
  31214. more efficient.
  31215. (KJS::jsEmptyString): Added.
  31216. (KJS::jsSingleCharacterString): Added.
  31217. (KJS::jsSingleCharacterSubstring): Added.
  31218. (KJS::jsNontrivialString): Added.
  31219. (KJS::JSString::getIndex): Adopted jsSingleCharacterSubstring.
  31220. (KJS::JSString::getStringPropertySlot): Ditto.
  31221. * kjs/NumberPrototype.cpp:
  31222. (KJS::numberProtoFuncToFixed): Adopted jsNontrivialString.
  31223. (KJS::numberProtoFuncToExponential): Ditto.
  31224. (KJS::numberProtoFuncToPrecision): Ditto.
  31225. * kjs/ObjectPrototype.cpp:
  31226. (KJS::objectProtoFuncToLocaleString): Adopted toThisJSString.
  31227. (KJS::objectProtoFuncToString): Adopted jsNontrivialString.
  31228. * kjs/RegExpConstructor.cpp: Separated the lastInput value that's used
  31229. with the lastOvector to return matches from the input value that can be
  31230. changed via JavaScript. They will be equal in many cases, but not all.
  31231. (KJS::RegExpConstructor::performMatch): Set input.
  31232. (KJS::RegExpMatchesArray::RegExpMatchesArray): Ditto.
  31233. (KJS::RegExpMatchesArray::fillArrayInstance): Adopted jsSubstring. Also,
  31234. use input rather than lastInput in the appropriate place.
  31235. (KJS::RegExpConstructor::getBackref): Adopted jsSubstring and jsEmptyString.
  31236. Added code to handle the case where there is no backref -- before this
  31237. depended on range checking in UString::substr which is not present in
  31238. jsSubstring.
  31239. (KJS::RegExpConstructor::getLastParen): Ditto.
  31240. (KJS::RegExpConstructor::getLeftContext): Ditto.
  31241. (KJS::RegExpConstructor::getRightContext): Ditto.
  31242. (KJS::RegExpConstructor::getValueProperty): Use input rather than lastInput.
  31243. Also adopt jsEmptyString.
  31244. (KJS::RegExpConstructor::putValueProperty): Ditto.
  31245. (KJS::RegExpConstructor::input): Ditto.
  31246. * kjs/RegExpPrototype.cpp:
  31247. (KJS::regExpProtoFuncToString): Adopt jsNonTrivialString. Also changed to
  31248. use UString::append to append single characters rather than using += and
  31249. a C-style string.
  31250. * kjs/SmallStrings.cpp: Added.
  31251. (KJS::SmallStringsStorage::SmallStringsStorage): Construct the
  31252. buffer and UString::Rep for all 256 single-character strings for
  31253. the U+0000 through U+00FF. This covers all the values used in
  31254. the base64 test as well as most values seen elsewhere on the web
  31255. as well. It's possible that later we might fix this to only work
  31256. for U+0000 through U+007F but the others are used quite a bit in
  31257. the current version of the base64 test.
  31258. (KJS::SmallStringsStorage::~SmallStringsStorage): Free memory.
  31259. (KJS::SmallStrings::SmallStrings): Create a set of small strings,
  31260. initially not created; created later when they are used.
  31261. (KJS::SmallStrings::~SmallStrings): Deallocate. Not left compiler
  31262. generated because the SmallStringsStorage class's destructor needs
  31263. to be visible.
  31264. (KJS::SmallStrings::mark): Mark all the strings.
  31265. (KJS::SmallStrings::createEmptyString): Create a cell for the
  31266. empty string. Called only the first time.
  31267. (KJS::SmallStrings::createSingleCharacterString): Create a cell
  31268. for one of the single-character strings. Called only the first time.
  31269. * kjs/SmallStrings.h: Added.
  31270. * kjs/StringConstructor.cpp:
  31271. (KJS::stringFromCharCodeSlowCase): Factored out of strinFromCharCode.
  31272. Only used for cases where the caller does not pass exactly one argument.
  31273. (KJS::stringFromCharCode): Adopted jsSingleCharacterString.
  31274. (KJS::callStringConstructor): Adopted jsEmptyString.
  31275. * kjs/StringObject.cpp:
  31276. (KJS::StringObject::StringObject): Adopted jsEmptyString.
  31277. * kjs/StringPrototype.cpp:
  31278. (KJS::stringProtoFuncReplace): Adopted jsSubstring.
  31279. (KJS::stringProtoFuncCharAt): Adopted jsEmptyString and
  31280. jsSingleCharacterSubstring and also added a special case when the
  31281. index is an immediate number to avoid conversion to and from floating
  31282. point, since that's the common case.
  31283. (KJS::stringProtoFuncCharCodeAt): Ditto.
  31284. (KJS::stringProtoFuncMatch): Adopted jsSubstring and jsEmptyString.
  31285. (KJS::stringProtoFuncSlice): Adopted jsSubstring and
  31286. jsSingleCharacterSubstring. Also got rid of some unneeded locals and
  31287. removed unneeded code to set the length property of the array, since it
  31288. is automatically updated as values are added to the array.
  31289. (KJS::stringProtoFuncSplit): Adopted jsEmptyString.
  31290. (KJS::stringProtoFuncSubstr): Adopted jsSubstring.
  31291. (KJS::stringProtoFuncSubstring): Ditto.
  31292. * kjs/collector.cpp:
  31293. (KJS::Heap::collect): Added a call to mark SmallStrings.
  31294. * kjs/ustring.cpp:
  31295. (KJS::UString::expandedSize): Made this a static member function since
  31296. it doesn't need to look at any data members.
  31297. (KJS::UString::expandCapacity): Use a non-inline function, makeNull, to
  31298. set the rep to null in failure cases. This avoids adding a PIC branch for
  31299. the normal case when there is no failure.
  31300. (KJS::UString::expandPreCapacity): Ditto.
  31301. (KJS::UString::UString): Ditto.
  31302. (KJS::concatenate): Refactored the concatenation constructor into this
  31303. separate function. Calling the concatenation constructor was leading to
  31304. an extra branch because of the in-charge vs. not-in-charge versions not
  31305. both being inlined, and this was showing up as nearly 1% on Shark. Also
  31306. added a special case for when the second string is a single character,
  31307. since it's a common idiom to build up a string that way and we can do
  31308. things much more quickly, without involving memcpy for example. Also
  31309. adopted the non-inline function, nullRep, for the same reason given for
  31310. makeNull above.
  31311. (KJS::UString::append): Adopted makeNull for failure cases.
  31312. (KJS::UString::operator=): Ditto.
  31313. (KJS::UString::toDouble): Added a special case for converting single
  31314. character strings to numbers. We're doing this a ton of times while
  31315. running the base64 test.
  31316. (KJS::operator==): Added special cases so we can compare single-character
  31317. strings without calling memcmp. Later we might want to special case other
  31318. short lengths similarly.
  31319. (KJS::UString::makeNull): Added.
  31320. (KJS::UString::nullRep): Added.
  31321. * kjs/ustring.h: Added declarations for the nullRep and makeNull. Changed
  31322. expandedSize to be a static member function. Added a declaration of the
  31323. concatenate function. Removed the concatenation constructor. Rewrote
  31324. operator+ to use the concatenate function.
  31325. 2008-08-29 Anders Carlsson <andersca@apple.com>
  31326. Build fix.
  31327. * VM/Machine.cpp:
  31328. (KJS::getCPUTime):
  31329. 2008-08-29 Anders Carlsson <andersca@apple.com>
  31330. Reviewed by Darin Adler.
  31331. <rdar://problem/6174667>
  31332. When a machine is under heavy load, the Slow Script dialog often comes up many times and just gets in the way
  31333. Instead of using clock time, use the CPU time spent executing the current thread when
  31334. determining if the script has been running for too long.
  31335. * VM/Machine.cpp:
  31336. (KJS::getCPUTime):
  31337. (KJS::Machine::checkTimeout):
  31338. 2008-08-28 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31339. Rubber-stamped by Sam Weinig.
  31340. Change 'term' to 'expr' in variable names to standardize terminology.
  31341. * kjs/nodes.cpp:
  31342. (KJS::BinaryOpNode::emitCode):
  31343. (KJS::ReverseBinaryOpNode::emitCode):
  31344. (KJS::ThrowableBinaryOpNode::emitCode):
  31345. * kjs/nodes.h:
  31346. (KJS::BinaryOpNode::BinaryOpNode):
  31347. (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
  31348. (KJS::MultNode::):
  31349. (KJS::DivNode::):
  31350. (KJS::ModNode::):
  31351. (KJS::AddNode::):
  31352. (KJS::SubNode::):
  31353. (KJS::LeftShiftNode::):
  31354. (KJS::RightShiftNode::):
  31355. (KJS::UnsignedRightShiftNode::):
  31356. (KJS::LessNode::):
  31357. (KJS::GreaterNode::):
  31358. (KJS::LessEqNode::):
  31359. (KJS::GreaterEqNode::):
  31360. (KJS::ThrowableBinaryOpNode::):
  31361. (KJS::InstanceOfNode::):
  31362. (KJS::InNode::):
  31363. (KJS::EqualNode::):
  31364. (KJS::NotEqualNode::):
  31365. (KJS::StrictEqualNode::):
  31366. (KJS::NotStrictEqualNode::):
  31367. (KJS::BitAndNode::):
  31368. (KJS::BitOrNode::):
  31369. (KJS::BitXOrNode::):
  31370. * kjs/nodes2string.cpp:
  31371. (KJS::MultNode::streamTo):
  31372. (KJS::DivNode::streamTo):
  31373. (KJS::ModNode::streamTo):
  31374. (KJS::AddNode::streamTo):
  31375. (KJS::SubNode::streamTo):
  31376. (KJS::LeftShiftNode::streamTo):
  31377. (KJS::RightShiftNode::streamTo):
  31378. (KJS::UnsignedRightShiftNode::streamTo):
  31379. (KJS::LessNode::streamTo):
  31380. (KJS::GreaterNode::streamTo):
  31381. (KJS::LessEqNode::streamTo):
  31382. (KJS::GreaterEqNode::streamTo):
  31383. (KJS::InstanceOfNode::streamTo):
  31384. (KJS::InNode::streamTo):
  31385. (KJS::EqualNode::streamTo):
  31386. (KJS::NotEqualNode::streamTo):
  31387. (KJS::StrictEqualNode::streamTo):
  31388. (KJS::NotStrictEqualNode::streamTo):
  31389. (KJS::BitAndNode::streamTo):
  31390. (KJS::BitXOrNode::streamTo):
  31391. (KJS::BitOrNode::streamTo):
  31392. 2008-08-28 Alp Toker <alp@nuanti.com>
  31393. GTK+ dist/build fix. List newly added header files.
  31394. * GNUmakefile.am:
  31395. 2008-08-28 Sam Weinig <sam@webkit.org>
  31396. Reviewed by Oliver Hunt.
  31397. Change to throw a ReferenceError at runtime instead of a ParseError
  31398. at parse time, when the left hand side expression of a for-in statement
  31399. is not an lvalue.
  31400. * kjs/grammar.y:
  31401. * kjs/nodes.cpp:
  31402. (KJS::ForInNode::emitCode):
  31403. 2008-08-28 Alexey Proskuryakov <ap@webkit.org>
  31404. Not reviewed, build fix (at least for OpenBSD, posssibly more).
  31405. https://bugs.webkit.org/show_bug.cgi?id=20545
  31406. missing #include <unistd.h> in JavaScriptCore/VM/SamplingTool.cpp
  31407. * VM/SamplingTool.cpp: add the missing include.
  31408. 2008-08-26 Kevin McCullough <kmccullough@apple.com>
  31409. Reviewed by Geoff and Cameron.
  31410. <rdar://problem/6174603> Hitting assertion in Register::codeBlock when
  31411. loading facebook (20516).
  31412. - This was a result of my line numbers change. After a host function is
  31413. called the stack does not get reset correctly.
  31414. - Oddly this also appears to be a slight speedup on SunSpider.
  31415. * VM/Machine.cpp:
  31416. (KJS::Machine::privateExecute):
  31417. 2008-08-26 Alexey Proskuryakov <ap@webkit.org>
  31418. Reviewed by Geoff and Tim.
  31419. Export new API methods.
  31420. * JavaScriptCore.exp:
  31421. 2008-08-25 Kevin McCullough <kmccullough@apple.com>
  31422. Reviewed by Geoff, Tim and Mark.
  31423. <rdar://problem/6150623> JSProfiler: It would be nice if the profiles
  31424. in the console said what file and line number they came from
  31425. - Lay the foundation for getting line numbers and other data from the
  31426. JavaScript engine. With the cleanup in kjs/ExecState this is actually
  31427. a slight performance improvement.
  31428. * JavaScriptCore.exp: Export retrieveLastCaller() for WebCore.
  31429. * JavaScriptCore.xcodeproj/project.pbxproj:
  31430. * VM/Machine.cpp: Now Host and JS functions set a call frame on the
  31431. exec state, so this and the profiler code were pulled out of the
  31432. branches.
  31433. (KJS::Machine::privateExecute):
  31434. (KJS::Machine::retrieveLastCaller): This get's the lineNumber, sourceID
  31435. and sourceURL for the previously called function.
  31436. * VM/Machine.h:
  31437. * kjs/ExecState.cpp: Remove references to JSFunction since it's not used
  31438. anywhere.
  31439. * kjs/ExecState.h:
  31440. 2008-08-25 Alexey Proskuryakov <ap@webkit.org>
  31441. Reviewed by Darin Adler.
  31442. Ensure that JSGlobalContextRelease() performs garbage collection, even if there are other
  31443. contexts in the current context's group.
  31444. This is only really necessary when the last reference is released, but there is no way to
  31445. determine that, and no harm in collecting slightly more often.
  31446. * API/JSContextRef.cpp: (JSGlobalContextRelease): Explicitly collect the heap if it is not
  31447. being destroyed.
  31448. 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31449. Reviewed by Oliver Hunt.
  31450. Bug 20093: JSC shell does not clear exceptions after it executes toString on an expression
  31451. <https://bugs.webkit.org/show_bug.cgi?id=20093>
  31452. Clear exceptions after evaluating any code in the JSC shell. We do not
  31453. report exceptions that are caused by calling toString on the final
  31454. valued, but at least we avoid incorrect behaviour.
  31455. Also, print any exceptions that occurred while evaluating code at the
  31456. interactive prompt, not just while evaluating code from a file.
  31457. * kjs/Shell.cpp:
  31458. (runWithScripts):
  31459. (runInteractive):
  31460. 2008-08-24 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31461. Reviewed by Oliver.
  31462. Remove an unnecessary RefPtr to a RegisterID.
  31463. * kjs/nodes.cpp:
  31464. (KJS::DeleteBracketNode::emitCode):
  31465. 2008-08-24 Mark Rowe <mrowe@apple.com>
  31466. Reviewed by Oliver Hunt.
  31467. Use the correct version number for when JSGlobalContextCreate was introduced.
  31468. * API/JSContextRef.h:
  31469. 2008-08-23 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31470. Rubber-stamped by Mark Rowe.
  31471. Remove modelines.
  31472. * API/APICast.h:
  31473. * API/JSBase.cpp:
  31474. * API/JSCallbackConstructor.cpp:
  31475. * API/JSCallbackConstructor.h:
  31476. * API/JSCallbackFunction.cpp:
  31477. * API/JSCallbackFunction.h:
  31478. * API/JSCallbackObject.cpp:
  31479. * API/JSCallbackObject.h:
  31480. * API/JSCallbackObjectFunctions.h:
  31481. * API/JSClassRef.cpp:
  31482. * API/JSContextRef.cpp:
  31483. * API/JSObjectRef.cpp:
  31484. * API/JSProfilerPrivate.cpp:
  31485. * API/JSStringRef.cpp:
  31486. * API/JSStringRefBSTR.cpp:
  31487. * API/JSStringRefCF.cpp:
  31488. * API/JSValueRef.cpp:
  31489. * API/tests/JSNode.c:
  31490. * API/tests/JSNode.h:
  31491. * API/tests/JSNodeList.c:
  31492. * API/tests/JSNodeList.h:
  31493. * API/tests/Node.c:
  31494. * API/tests/Node.h:
  31495. * API/tests/NodeList.c:
  31496. * API/tests/NodeList.h:
  31497. * API/tests/minidom.c:
  31498. * API/tests/minidom.js:
  31499. * API/tests/testapi.c:
  31500. * API/tests/testapi.js:
  31501. * JavaScriptCore.pro:
  31502. * kjs/FunctionConstructor.h:
  31503. * kjs/FunctionPrototype.h:
  31504. * kjs/JSArray.h:
  31505. * kjs/JSString.h:
  31506. * kjs/JSWrapperObject.cpp:
  31507. * kjs/NumberConstructor.h:
  31508. * kjs/NumberObject.h:
  31509. * kjs/NumberPrototype.h:
  31510. * kjs/lexer.h:
  31511. * kjs/lookup.h:
  31512. * wtf/Assertions.cpp:
  31513. * wtf/Assertions.h:
  31514. * wtf/HashCountedSet.h:
  31515. * wtf/HashFunctions.h:
  31516. * wtf/HashIterators.h:
  31517. * wtf/HashMap.h:
  31518. * wtf/HashSet.h:
  31519. * wtf/HashTable.h:
  31520. * wtf/HashTraits.h:
  31521. * wtf/ListHashSet.h:
  31522. * wtf/ListRefPtr.h:
  31523. * wtf/Noncopyable.h:
  31524. * wtf/OwnArrayPtr.h:
  31525. * wtf/OwnPtr.h:
  31526. * wtf/PassRefPtr.h:
  31527. * wtf/Platform.h:
  31528. * wtf/RefPtr.h:
  31529. * wtf/RefPtrHashMap.h:
  31530. * wtf/RetainPtr.h:
  31531. * wtf/UnusedParam.h:
  31532. * wtf/Vector.h:
  31533. * wtf/VectorTraits.h:
  31534. * wtf/unicode/Unicode.h:
  31535. * wtf/unicode/icu/UnicodeIcu.h:
  31536. 2008-08-22 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31537. Reviewed by Oliver.
  31538. Some cleanup to match our coding style.
  31539. * VM/CodeGenerator.h:
  31540. * VM/Machine.cpp:
  31541. (KJS::Machine::privateExecute):
  31542. * kjs/ExecState.cpp:
  31543. * kjs/ExecState.h:
  31544. * kjs/completion.h:
  31545. * kjs/identifier.cpp:
  31546. (KJS::Identifier::equal):
  31547. (KJS::CStringTranslator::hash):
  31548. (KJS::CStringTranslator::equal):
  31549. (KJS::CStringTranslator::translate):
  31550. (KJS::UCharBufferTranslator::equal):
  31551. (KJS::UCharBufferTranslator::translate):
  31552. (KJS::Identifier::remove):
  31553. * kjs/operations.h:
  31554. 2008-08-20 Alexey Proskuryakov <ap@webkit.org>
  31555. Windows build fix.
  31556. * API/WebKitAvailability.h: Define DEPRECATED_ATTRIBUTE.
  31557. 2008-08-19 Alexey Proskuryakov <ap@webkit.org>
  31558. Reviewed by Geoff Garen.
  31559. Bring back shared JSGlobalData and implicit locking, because too many clients rely on it.
  31560. * kjs/JSGlobalData.cpp:
  31561. (KJS::JSGlobalData::~JSGlobalData):
  31562. (KJS::JSGlobalData::JSGlobalData): Re-add shared instance.
  31563. (KJS::JSGlobalData::sharedInstanceExists): Ditto.
  31564. (KJS::JSGlobalData::sharedInstance): Ditto.
  31565. (KJS::JSGlobalData::sharedInstanceInternal): Ditto.
  31566. * API/JSContextRef.h: Deprecated JSGlobalContextCreate(). Added a very conservative
  31567. description of its threading model (nothing is allowed).
  31568. * API/JSContextRef.cpp:
  31569. (JSGlobalContextCreate): Use shared JSGlobalData.
  31570. (JSGlobalContextCreateInGroup): Support passing NULL group to request a unique one.
  31571. (JSGlobalContextRetain): Added back locking.
  31572. (JSGlobalContextRelease): Ditto.
  31573. (JSContextGetGlobalObject): Ditto.
  31574. * API/tests/minidom.c: (main):
  31575. * API/tests/testapi.c: (main):
  31576. Switched to JSGlobalContextCreateInGroup() to avoid deprecation warnings.
  31577. * JavaScriptCore.exp: Re-added JSLock methods. Added JSGlobalContextCreateInGroup (d'oh!).
  31578. * API/JSBase.cpp:
  31579. (JSEvaluateScript):
  31580. (JSCheckScriptSyntax):
  31581. (JSGarbageCollect):
  31582. * API/JSCallbackConstructor.cpp:
  31583. (KJS::constructJSCallback):
  31584. * API/JSCallbackFunction.cpp:
  31585. (KJS::JSCallbackFunction::call):
  31586. * API/JSCallbackObjectFunctions.h:
  31587. (KJS::::init):
  31588. (KJS::::getOwnPropertySlot):
  31589. (KJS::::put):
  31590. (KJS::::deleteProperty):
  31591. (KJS::::construct):
  31592. (KJS::::hasInstance):
  31593. (KJS::::call):
  31594. (KJS::::getPropertyNames):
  31595. (KJS::::toNumber):
  31596. (KJS::::toString):
  31597. (KJS::::staticValueGetter):
  31598. (KJS::::callbackGetter):
  31599. * API/JSObjectRef.cpp:
  31600. (JSObjectMake):
  31601. (JSObjectMakeFunctionWithCallback):
  31602. (JSObjectMakeConstructor):
  31603. (JSObjectMakeFunction):
  31604. (JSObjectHasProperty):
  31605. (JSObjectGetProperty):
  31606. (JSObjectSetProperty):
  31607. (JSObjectGetPropertyAtIndex):
  31608. (JSObjectSetPropertyAtIndex):
  31609. (JSObjectDeleteProperty):
  31610. (JSObjectCallAsFunction):
  31611. (JSObjectCallAsConstructor):
  31612. (JSObjectCopyPropertyNames):
  31613. (JSPropertyNameArrayRelease):
  31614. (JSPropertyNameAccumulatorAddName):
  31615. * API/JSValueRef.cpp:
  31616. (JSValueIsEqual):
  31617. (JSValueIsInstanceOfConstructor):
  31618. (JSValueMakeNumber):
  31619. (JSValueMakeString):
  31620. (JSValueToNumber):
  31621. (JSValueToStringCopy):
  31622. (JSValueToObject):
  31623. (JSValueProtect):
  31624. (JSValueUnprotect):
  31625. * ForwardingHeaders/JavaScriptCore/JSLock.h: Added.
  31626. * GNUmakefile.am:
  31627. * JavaScriptCore.pri:
  31628. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  31629. * JavaScriptCore.xcodeproj/project.pbxproj:
  31630. * JavaScriptCoreSources.bkl:
  31631. * kjs/AllInOneFile.cpp:
  31632. * kjs/JSGlobalData.h:
  31633. * kjs/JSGlobalObject.cpp:
  31634. (KJS::JSGlobalObject::~JSGlobalObject):
  31635. (KJS::JSGlobalObject::init):
  31636. * kjs/JSLock.cpp: Added.
  31637. (KJS::createJSLockCount):
  31638. (KJS::JSLock::lockCount):
  31639. (KJS::setLockCount):
  31640. (KJS::JSLock::JSLock):
  31641. (KJS::JSLock::lock):
  31642. (KJS::JSLock::unlock):
  31643. (KJS::JSLock::currentThreadIsHoldingLock):
  31644. (KJS::JSLock::DropAllLocks::DropAllLocks):
  31645. (KJS::JSLock::DropAllLocks::~DropAllLocks):
  31646. * kjs/JSLock.h: Added.
  31647. (KJS::JSLock::JSLock):
  31648. (KJS::JSLock::~JSLock):
  31649. * kjs/Shell.cpp:
  31650. (functionGC):
  31651. (jscmain):
  31652. * kjs/collector.cpp:
  31653. (KJS::Heap::~Heap):
  31654. (KJS::Heap::heapAllocate):
  31655. (KJS::Heap::setGCProtectNeedsLocking):
  31656. (KJS::Heap::protect):
  31657. (KJS::Heap::unprotect):
  31658. (KJS::Heap::collect):
  31659. * kjs/identifier.cpp:
  31660. * kjs/interpreter.cpp:
  31661. (KJS::Interpreter::checkSyntax):
  31662. (KJS::Interpreter::evaluate):
  31663. Re-added implicit locking.
  31664. 2008-08-19 Kevin McCullough <kmccullough@apple.com>
  31665. Reviewed by Tim and Mark.
  31666. Implement DTrace hooks for dashcode and instruments.
  31667. * API/JSProfilerPrivate.cpp: Added. Expose SPI so that profiling can be
  31668. turned on from a client. The DTrace probes were added within the
  31669. profiler mechanism for performance reasons so the profiler must be
  31670. started to enable tracing.
  31671. (JSStartProfiling):
  31672. (JSEndProfiling):
  31673. * API/JSProfilerPrivate.h: Added. Ditto.
  31674. * JavaScriptCore.exp: Exposing the start/stop methods to clients.
  31675. * JavaScriptCore.xcodeproj/project.pbxproj:
  31676. * kjs/Tracing.d: Define the DTrace probes.
  31677. * kjs/Tracing.h: Ditto.
  31678. * profiler/ProfileGenerator.cpp: Implement the DTrace probes in the
  31679. profiler.
  31680. (KJS::ProfileGenerator::willExecute):
  31681. (KJS::ProfileGenerator::didExecute):
  31682. 2008-08-19 Steve Falkenburg <sfalken@apple.com>
  31683. Build fix.
  31684. * kjs/operations.cpp:
  31685. (KJS::equal):
  31686. 2008-08-18 Timothy Hatcher <timothy@apple.com>
  31687. Fix an assertion when generating a heavy profile because the
  31688. empty value and deleted value of CallIdentifier where equal.
  31689. https://bugs.webkit.org/show_bug.cgi?id=20439
  31690. Reviewed by Dan Bernstein.
  31691. * profiler/CallIdentifier.h: Make the emptyValue for CallIdentifier
  31692. use empty strings for URL and function name.
  31693. 2008-08-12 Darin Adler <darin@apple.com>
  31694. Reviewed by Geoff.
  31695. - eliminate JSValue::type()
  31696. This will make it slightly easier to change the JSImmediate design without
  31697. having to touch so many call sites.
  31698. SunSpider says this change is a wash (looked like a slight speedup, but not
  31699. statistically significant).
  31700. * API/JSStringRef.cpp: Removed include of JSType.h.
  31701. * API/JSValueRef.cpp: Removed include of JSType.h.
  31702. (JSValueGetType): Replaced use of JSValue::type() with
  31703. JSValue::is functions.
  31704. * JavaScriptCore.exp: Updated.
  31705. * VM/JSPropertyNameIterator.cpp: Removed type() implementation.
  31706. (KJS::JSPropertyNameIterator::toPrimitive): Changed to take
  31707. PreferredPrimitiveType argument instead of JSType.
  31708. * VM/JSPropertyNameIterator.h: Ditto.
  31709. * VM/Machine.cpp:
  31710. (KJS::fastIsNumber): Updated for name change.
  31711. (KJS::fastToInt32): Ditto.
  31712. (KJS::fastToUInt32): Ditto.
  31713. (KJS::jsAddSlowCase): Updated toPrimitive caller for change from
  31714. JSType to PreferredPrimitiveType.
  31715. (KJS::jsAdd): Replaced calls to JSValue::type() with calls to
  31716. JSValue::isString().
  31717. (KJS::jsTypeStringForValue): Replaced calls to JSValue::type()
  31718. with multiple calls to JSValue::is -- we could make this a
  31719. virtual function instead if we want to have faster performance.
  31720. (KJS::Machine::privateExecute): Renamed JSImmediate::toTruncatedUInt32
  31721. to JSImmediate::getTruncatedUInt32 for consistency with other functions.
  31722. Changed two calls of JSValue::type() to JSValue::isString().
  31723. * kjs/GetterSetter.cpp:
  31724. (KJS::GetterSetter::toPrimitive): Changed to take
  31725. PreferredPrimitiveType argument instead of JSType.
  31726. (KJS::GetterSetter::isGetterSetter): Added.
  31727. * kjs/GetterSetter.h:
  31728. * kjs/JSCell.cpp:
  31729. (KJS::JSCell::isString): Added.
  31730. (KJS::JSCell::isGetterSetter): Added.
  31731. (KJS::JSCell::isObject): Added.
  31732. * kjs/JSCell.h: Eliminated type function. Added isGetterSetter.
  31733. Made isString and isObject virtual. Changed toPrimitive to take
  31734. PreferredPrimitiveType argument instead of JSType.
  31735. (KJS::JSCell::isNumber): Use Heap::isNumber for faster performance.
  31736. (KJS::JSValue::isGetterSetter): Added.
  31737. (KJS::JSValue::toPrimitive): Changed to take
  31738. PreferredPrimitiveType argument instead of JSType.
  31739. * kjs/JSImmediate.h: Removed JSValue::type() and replaced
  31740. JSValue::toTruncatedUInt32 with JSValue::getTruncatedUInt32.
  31741. (KJS::JSImmediate::isEitherImmediate): Added.
  31742. * kjs/JSNotAnObject.cpp:
  31743. (KJS::JSNotAnObject::toPrimitive): Changed to take
  31744. PreferredPrimitiveType argument instead of JSType.
  31745. * kjs/JSNotAnObject.h: Ditto.
  31746. * kjs/JSNumberCell.cpp:
  31747. (KJS::JSNumberCell::toPrimitive): Ditto.
  31748. * kjs/JSNumberCell.h:
  31749. (KJS::JSNumberCell::toInt32): Renamed from fastToInt32. There's no
  31750. other "slow" version of this once you have a JSNumberCell, so there's
  31751. no need for "fast" in the name. It's a feature that this hides the
  31752. base class toInt32, which does the same job less efficiently (and has
  31753. an additional ExecState argument).
  31754. (KJS::JSNumberCell::toUInt32): Ditto.
  31755. * kjs/JSObject.cpp:
  31756. (KJS::callDefaultValueFunction): Use isGetterSetter instead of type.
  31757. (KJS::JSObject::getPrimitiveNumber): Use PreferredPrimitiveType.
  31758. (KJS::JSObject::defaultValue): Ditto.
  31759. (KJS::JSObject::defineGetter): Use isGetterSetter.
  31760. (KJS::JSObject::defineSetter): Ditto.
  31761. (KJS::JSObject::lookupGetter): Ditto.
  31762. (KJS::JSObject::lookupSetter): Ditto.
  31763. (KJS::JSObject::toNumber): Use PreferredPrimitiveType.
  31764. (KJS::JSObject::toString): Ditto.
  31765. (KJS::JSObject::isObject): Added.
  31766. * kjs/JSObject.h:
  31767. (KJS::JSObject::inherits): Call the isObject from JSCell; it's now
  31768. hidden by our override of isObject.
  31769. (KJS::JSObject::getOwnPropertySlotForWrite): Use isGetterSetter
  31770. instead of type.
  31771. (KJS::JSObject::getOwnPropertySlot): Ditto.
  31772. (KJS::JSObject::toPrimitive): Use PreferredPrimitiveType.
  31773. * kjs/JSString.cpp:
  31774. (KJS::JSString::toPrimitive): Use PreferredPrimitiveType.
  31775. (KJS::JSString::isString): Added.
  31776. * kjs/JSString.h: Ditto.
  31777. * kjs/JSValue.h: Removed type(), added isGetterSetter(). Added
  31778. PreferredPrimitiveType enum and used it as the argument for the
  31779. toPrimitive function.
  31780. (KJS::JSValue::getBoolean): Simplified a bit an removed a branch.
  31781. * kjs/collector.cpp:
  31782. (KJS::typeName): Changed to use JSCell::is functions instead of
  31783. calling JSCell::type.
  31784. * kjs/collector.h:
  31785. (KJS::Heap::isNumber): Renamed from fastIsNumber.
  31786. * kjs/nodes.h: Added now-needed include of JSType, since the type
  31787. is used here to record types of values in the tree.
  31788. * kjs/operations.cpp:
  31789. (KJS::equal): Rewrote to no longer depend on type().
  31790. (KJS::strictEqual): Ditto.
  31791. 2008-08-18 Kevin McCullough <kmccullough@apple.com>
  31792. Reviewed by Tim.
  31793. If there are no nodes in a profile all the time should be attributed to
  31794. (idle)
  31795. * profiler/Profile.cpp: If ther are no nodes make sure we still process
  31796. the head.
  31797. (KJS::Profile::forEach):
  31798. * profiler/ProfileGenerator.cpp: Remove some useless code.
  31799. (KJS::ProfileGenerator::stopProfiling):
  31800. 2008-08-18 Alexey Proskuryakov <ap@webkit.org>
  31801. Reviewed by Maciej.
  31802. Make JSGlobalContextRetain/Release actually work.
  31803. * API/JSContextRef.cpp:
  31804. (JSGlobalContextRetain):
  31805. (JSGlobalContextRelease):
  31806. Ref/deref global data to give checking for globalData.refCount() some sense.
  31807. * API/tests/testapi.c: (main): Added a test for this bug.
  31808. * kjs/JSGlobalData.cpp:
  31809. (KJS::JSGlobalData::~JSGlobalData):
  31810. While checking for memory leaks, found that JSGlobalData::emptyList has changed to
  31811. a pointer, but it was not destructed, causing a huge leak in run-webkit-tests --threaded.
  31812. 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31813. Reviewed by Maciej.
  31814. Change the counting of constants so that preincrement and predecrement of
  31815. const local variables are considered unexpected loads.
  31816. * kjs/nodes.cpp:
  31817. (KJS::PrefixResolveNode::emitCode):
  31818. * kjs/nodes.h:
  31819. (KJS::ScopeNode::neededConstants):
  31820. 2008-08-17 Oliver Hunt <oliver@apple.com>
  31821. Reviewed by Cameron Zwarich.
  31822. <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed
  31823. <https://bugs.webkit.org/show_bug.cgi?id=20386>
  31824. This crash was caused by "depth()" incorrectly determining the scope depth
  31825. of a 0 depth function without a full scope chain. Because such a function
  31826. would not have an activation the depth function would return the scope depth
  31827. of the parent frame, thus triggering an incorrect unwind. Any subsequent
  31828. look up that walked the scope chain would result in incorrect behaviour,
  31829. leading to a crash or incorrect variable resolution. This can only actually
  31830. happen in try...finally statements as that's the only path that can result in
  31831. the need to unwind the scope chain, but not force the function to need a
  31832. full scope chain.
  31833. The fix is simply to check for this case before attempting to walk the scope chain.
  31834. * VM/Machine.cpp:
  31835. (KJS::depth):
  31836. (KJS::Machine::throwException):
  31837. 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31838. Reviewed by Maciej.
  31839. Bug 20419: Remove op_jless
  31840. <https://bugs.webkit.org/show_bug.cgi?id=20419>
  31841. Remove op_jless, which is rarely used now that we have op_loop_if_less.
  31842. * VM/CodeBlock.cpp:
  31843. (KJS::CodeBlock::dump):
  31844. * VM/CodeGenerator.cpp:
  31845. (KJS::CodeGenerator::emitJumpIfTrue):
  31846. * VM/Machine.cpp:
  31847. (KJS::Machine::privateExecute):
  31848. * VM/Opcode.h:
  31849. 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
  31850. Reviewed by Dan Bernstein.
  31851. Fix a typo in r35807 that is also causing build failures for
  31852. non-AllInOne builds.
  31853. * kjs/NumberConstructor.cpp:
  31854. 2008-08-17 Geoffrey Garen <ggaren@apple.com>
  31855. Reviewed by Cameron Zwarich.
  31856. Made room for a free word in JSCell.
  31857. SunSpider says no change.
  31858. I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
  31859. store auxiliary data in a secondary structure.
  31860. I changed InternalFunction to store the function's name in the property
  31861. map.
  31862. I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
  31863. JSDOMWindowBaseData could inherit from it safely. (It's a strange design
  31864. for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
  31865. but that's really our only option, given the size constraint.)
  31866. I also added a bunch of compile-time ASSERTs, and removed lots of comments
  31867. in JSObject.h because they were often out of date, and they got in the
  31868. way of reading what was actually going on.
  31869. Also renamed JSArray::getLength to JSArray::length, to match our style
  31870. guidelines.
  31871. 2008-08-16 Geoffrey Garen <ggaren@apple.com>
  31872. Reviewed by Oliver Hunt.
  31873. Sped up property access for array.length and string.length by adding a
  31874. mechanism for returning a temporary value directly instead of returning
  31875. a pointer to a function that retrieves the value.
  31876. Also removed some unused cruft from PropertySlot.
  31877. SunSpider says 0.5% - 1.2% faster.
  31878. NOTE: This optimization is not a good idea in general, because it's
  31879. actually a pessimization in the case of resolve for assignment,
  31880. and it may get in the way of other optimizations in the future.
  31881. 2008-08-16 Dan Bernstein <mitz@apple.com>
  31882. Reviewed by Geoffrey Garen.
  31883. Disable dead code stripping in debug builds.
  31884. * Configurations/Base.xcconfig:
  31885. * JavaScriptCore.xcodeproj/project.pbxproj:
  31886. 2008-08-15 Mark Rowe <mrowe@apple.com>
  31887. Reviewed by Oliver Hunt.
  31888. <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap
  31889. * wtf/FastMalloc.cpp:
  31890. (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with
  31891. a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that.
  31892. (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can
  31893. be used when calculating local addresses.
  31894. (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto.
  31895. 2008-08-15 Mark Rowe <mrowe@apple.com>
  31896. Rubber-stamped by Geoff Garen.
  31897. <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
  31898. * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
  31899. between the Debug configuration and debug Production variant.
  31900. * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant.
  31901. 2008-08-15 Mark Rowe <mrowe@apple.com>
  31902. Fix the 64-bit build.
  31903. Add extra cast to avoid warnings about loss of precision when casting from
  31904. JSValue* to an integer type.
  31905. * kjs/JSImmediate.h:
  31906. (KJS::JSImmediate::intValue):
  31907. (KJS::JSImmediate::uintValue):
  31908. 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
  31909. Still fixing Windows build.
  31910. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString
  31911. to yet another place.
  31912. 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
  31913. Trying to fix non-Apple builds.
  31914. * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added.
  31915. 2008-08-15 Gavin Barraclough <barraclough@apple.com>
  31916. Reviewed by Geoff Garen.
  31917. Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a
  31918. JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a
  31919. JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer,
  31920. but instead holds an immediate value encoded within the pointer. This patch changes the
  31921. encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing
  31922. a 31 bit value to be stored. All other immediates are tagged with the value 10, and
  31923. distinguished by a secondary tag.
  31924. Roughly +2% on SunSpider.
  31925. * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for
  31926. descption of new layout.
  31927. 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
  31928. More build fixes.
  31929. * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC.
  31930. * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly.
  31931. * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build.
  31932. 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
  31933. Build fix.
  31934. * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private
  31935. * kjs/identifier.cpp:
  31936. (KJS::Identifier::checkSameIdentifierTable):
  31937. * kjs/identifier.h:
  31938. (KJS::Identifier::add):
  31939. Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be
  31940. non-inline in release builds, too.
  31941. * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor.
  31942. 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
  31943. Reviewed by Geoff Garen.
  31944. JSStringRef is created context-free, but can get linked to one via an identifier table,
  31945. breaking an implicit API contract.
  31946. Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.
  31947. * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a
  31948. simple typecast.
  31949. * kjs/identifier.cpp:
  31950. (KJS::Identifier::checkSameIdentifierTable):
  31951. * kjs/identifier.h:
  31952. (KJS::Identifier::add):
  31953. (KJS::UString::checkSameIdentifierTable):
  31954. Added assertions to verify that an identifier is not being added to a different JSGlobalData.
  31955. * API/JSObjectRef.cpp:
  31956. (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to
  31957. hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance
  31958. in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast.
  31959. * API/OpaqueJSString.cpp: Added.
  31960. (OpaqueJSString::create):
  31961. (OpaqueJSString::ustring):
  31962. (OpaqueJSString::identifier):
  31963. * API/OpaqueJSString.h: Added.
  31964. (OpaqueJSString::create):
  31965. (OpaqueJSString::characters):
  31966. (OpaqueJSString::length):
  31967. (OpaqueJSString::OpaqueJSString):
  31968. (OpaqueJSString::~OpaqueJSString):
  31969. * API/JSBase.cpp:
  31970. (JSEvaluateScript):
  31971. (JSCheckScriptSyntax):
  31972. * API/JSCallbackObjectFunctions.h:
  31973. (KJS::::getOwnPropertySlot):
  31974. (KJS::::put):
  31975. (KJS::::deleteProperty):
  31976. (KJS::::staticValueGetter):
  31977. (KJS::::callbackGetter):
  31978. * API/JSStringRef.cpp:
  31979. (JSStringCreateWithCharacters):
  31980. (JSStringCreateWithUTF8CString):
  31981. (JSStringRetain):
  31982. (JSStringRelease):
  31983. (JSStringGetLength):
  31984. (JSStringGetCharactersPtr):
  31985. (JSStringGetMaximumUTF8CStringSize):
  31986. (JSStringGetUTF8CString):
  31987. (JSStringIsEqual):
  31988. * API/JSStringRefCF.cpp:
  31989. (JSStringCreateWithCFString):
  31990. (JSStringCopyCFString):
  31991. * API/JSValueRef.cpp:
  31992. (JSValueMakeString):
  31993. (JSValueToStringCopy):
  31994. Updated to use OpaqueJSString.
  31995. * GNUmakefile.am:
  31996. * JavaScriptCore.exp:
  31997. * JavaScriptCore.pri:
  31998. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  31999. * JavaScriptCore.xcodeproj/project.pbxproj:
  32000. * JavaScriptCoreSources.bkl:
  32001. Added OpaqueJSString.
  32002. 2008-08-14 Kevin McCullough <kmccullough@apple.com>
  32003. Reviewed by Tim.
  32004. <rdar://problem/6115819> Notify of profile in console
  32005. - Profiles now have a unique ID so that they can be linked to the
  32006. console message that announces that a profile completed.
  32007. * profiler/HeavyProfile.cpp:
  32008. (KJS::HeavyProfile::HeavyProfile):
  32009. * profiler/Profile.cpp:
  32010. (KJS::Profile::create):
  32011. (KJS::Profile::Profile):
  32012. * profiler/Profile.h:
  32013. (KJS::Profile::uid):
  32014. * profiler/ProfileGenerator.cpp:
  32015. (KJS::ProfileGenerator::create):
  32016. (KJS::ProfileGenerator::ProfileGenerator):
  32017. * profiler/ProfileGenerator.h:
  32018. * profiler/Profiler.cpp:
  32019. (KJS::Profiler::startProfiling):
  32020. * profiler/TreeProfile.cpp:
  32021. (KJS::TreeProfile::create):
  32022. (KJS::TreeProfile::TreeProfile):
  32023. * profiler/TreeProfile.h:
  32024. 2008-08-13 Geoffrey Garen <ggaren@apple.com>
  32025. Reviewed by Oliver Hunt.
  32026. Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing
  32027. fillGetterProperty, which references a global function pointer,
  32028. out-of-line.
  32029. .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a
  32030. custom property access benchmark for objects with one property.
  32031. * kjs/JSObject.cpp:
  32032. (KJS::JSObject::fillGetterPropertySlot):
  32033. 2008-08-13 Alp Toker <alp@nuanti.com>
  32034. Reviewed by Eric Seidel.
  32035. https://bugs.webkit.org/show_bug.cgi?id=20349
  32036. WTF::initializeThreading() fails if threading is already initialized
  32037. Fix threading initialization logic to support cases where
  32038. g_thread_init() has already been called elsewhere.
  32039. Resolves database-related crashers reported in several applications.
  32040. * wtf/ThreadingGtk.cpp:
  32041. (WTF::initializeThreading):
  32042. 2008-08-13 Brad Hughes <bhughes@trolltech.com>
  32043. Reviewed by Simon.
  32044. Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux
  32045. The latest upgrade of the intel compiler allows us to compile all of
  32046. Qt with optimizations enabled (yay!).
  32047. * JavaScriptCore.pro:
  32048. 2008-08-12 Oliver Hunt <oliver@apple.com>
  32049. Reviewed by Geoff Garen.
  32050. Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) )
  32051. This is a very slight win in sunspider, and a fairly substantial win
  32052. in hot code that does if(!...), etc.
  32053. * VM/CodeGenerator.cpp:
  32054. (KJS::CodeGenerator::retrieveLastUnaryOp):
  32055. (KJS::CodeGenerator::rewindBinaryOp):
  32056. (KJS::CodeGenerator::rewindUnaryOp):
  32057. (KJS::CodeGenerator::emitJumpIfFalse):
  32058. * VM/CodeGenerator.h:
  32059. 2008-08-12 Dan Bernstein <mitz@apple.com>
  32060. - JavaScriptCore part of <rdar://problem/6121636>
  32061. Make fast*alloc() abort() on failure and add "try" variants that
  32062. return NULL on failure.
  32063. Reviewed by Darin Adler.
  32064. * JavaScriptCore.exp: Exported tryFastCalloc().
  32065. * VM/RegisterFile.h:
  32066. (KJS::RegisterFile::RegisterFile): Removed an ASSERT().
  32067. * kjs/JSArray.cpp:
  32068. (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc().
  32069. (KJS::JSArray::increaseVectorLength): Ditto.
  32070. * kjs/ustring.cpp:
  32071. (KJS::allocChars): Changed to use tryFastMalloc().
  32072. (KJS::reallocChars): Changed to use tryFastRealloc().
  32073. * wtf/FastMalloc.cpp:
  32074. (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result
  32075. and removed extra call to InvokeNewHook().
  32076. (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc().
  32077. (WTF::tryFastMalloc): Renamed fastMalloc() to this.
  32078. (WTF::fastMalloc): Added. This version abort()s if allocation fails.
  32079. (WTF::tryFastCalloc): Renamed fastCalloc() to this.
  32080. (WTF::fastCalloc): Added. This version abort()s if allocation fails.
  32081. (WTF::tryFastRealloc): Renamed fastRealloc() to this.
  32082. (WTF::fastRealloc): Added. This version abort()s if allocation fails.
  32083. (WTF::do_malloc): Made this a function template. When the abortOnFailure
  32084. template parameter is set, the function abort()s on failure to allocate.
  32085. Otherwise, it sets errno to ENOMEM and returns zero.
  32086. (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure.
  32087. (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on
  32088. failure.
  32089. (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure.
  32090. (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on
  32091. failure.
  32092. (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure.
  32093. (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on
  32094. failure.
  32095. * wtf/FastMalloc.h: Declared the "try" variants.
  32096. 2008-08-11 Adam Roben <aroben@apple.com>
  32097. Move WTF::notFound into its own header so that it can be used
  32098. independently of Vector
  32099. Rubberstamped by Darin Adler.
  32100. * JavaScriptCore.vcproj/WTF/WTF.vcproj:
  32101. * JavaScriptCore.xcodeproj/project.pbxproj:
  32102. Added NotFound.h to the project.
  32103. * wtf/NotFound.h: Added. Moved the notFound constant here...
  32104. * wtf/Vector.h: ...from here.
  32105. 2008-08-11 Alexey Proskuryakov <ap@webkit.org>
  32106. Reviewed by Mark Rowe.
  32107. <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit
  32108. * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment.
  32109. * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while
  32110. sweeping the heap.
  32111. == Rolled over to ChangeLog-2008-08-10 ==