1 2007-12-20 Oliver Hunt <oliver@apple.com>
5 Slight logic reordering in JSImmediate::from(double)
7 This gives a 0.1% improvement in SunSpider.
10 (KJS::JSImmediate::from):
12 2007-12-20 Eric Seidel <eric@webkit.org>
16 Fix major Array regression introduced by 28899.
18 SunSpider claims this is at least 1.37x as fast as pre-regression. :)
20 * kjs/array_instance.cpp: make Array's fast again!
22 2007-12-20 Eric Seidel <eric@webkit.org>
24 Reviewed by Geoff, then re-rubber-stamped by Geoff after final search/replace and testing.
26 Small reworking of Date code for 4% speedup on Date tests (0.2% overall)
27 http://bugs.webkit.org/show_bug.cgi?id=16537
29 Make msToYear human-readable
30 Make msToDayInMonth slightly more readable and avoid recalculating msToYear
31 Remove use of isInLeapYear to avoid calling msToYear
32 Remove dayInYear call by changing msToDayInMonth to dayInMonthFromDayInYear
33 Remove more duplicate calls to dayInYear and getUTCOffset for further speedup
36 (KJS::daysFrom1970ToYear):
38 (KJS::monthFromDayInYear):
40 (KJS::dayInMonthFromDayInYear):
41 (KJS::dateToDayInYear):
42 (KJS::getDSTOffsetSimple):
44 (KJS::gregorianDateTimeToMS):
45 (KJS::msToGregorianDateTime):
47 2007-12-20 Rodney Dawes <dobey@wayofthemonkey.com>
49 Reviewed by Darin Adler.
51 Proxy includes of npruntime.h or npapi.h through npruntime_internal.h
52 Include stdio.h in npapi.h for the use of FILE with XP_UNIX defined
53 This is for building with X11, as some type and enum names conflict
54 with #define names in X11 headers.
55 http://bugs.webkit.org/show_bug.cgi?id=15669
57 * JavaScriptCore.xcodeproj/project.pbxproj:
58 * bindings/NP_jsobject.h:
60 * bindings/npruntime.cpp:
61 * bindings/npruntime_impl.h:
62 * bindings/npruntime_priv.h:
63 * bindings/npruntime_internal.h:
64 * bindings/testbindings.cpp:
65 * bindings/c/c_class.h:
66 * bindings/c/c_runtime.h:
67 * bindings/c/c_utility.h:
69 2007-12-20 Darin Adler <darin@apple.com>
71 - re-fix http://bugs.webkit.org/show_bug.cgi?id=16471
72 Completions need to be smaller (or not exist at all)
74 Same patch as last time with the test failures problem fixed.
77 (KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion
78 type from newExec to see if the execute raised an exception.
80 2007-12-20 Darin Adler <darin@apple.com>
82 - roll out that last change -- it was causing test failures;
83 I'll check it back in after fixing them
85 2007-12-20 Darin Adler <darin@apple.com>
89 - http://bugs.webkit.org/show_bug.cgi?id=16471
90 Completions need to be smaller (or not exist at all)
92 SuSpider shows 2.4% speedup.
94 Stop using completions in the execution engine.
95 Instead, the completion type and label target are both
96 stored in the ExecState.
98 * API/JSContextRef.cpp: Removed unneeded include of "completion.h".
99 * bindings/runtime_method.cpp: Removed unused execute function.
100 * bindings/runtime_method.h: Ditto.
102 * kjs/ExecState.h: Added completionType, breakOrContinueTarget,
103 setCompletionType, setNormalCompletion, setBreakCompletion,
104 setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
105 setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
107 * kjs/completion.h: Removed constructor and getter for target
108 for break and continue from Completion. This class is now only
109 used for the public API to Interpreter and such.
111 * kjs/date_object.h: Removed unused execute function.
114 (KJS::FunctionImp::callAsFunction): Removed some unneeded
115 exception processing. Updated to call the new execute function
116 and to get the completion type from the ExecState. Merged in
117 the execute function, which repeated some of the same logic and
118 was called only from here.
119 (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
120 * kjs/function.h: Removed execute.
122 * kjs/interpreter.cpp:
123 (KJS::Interpreter::evaluate): Added code to convert the result of
124 execut into a Completion.
127 (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
128 Now sets the completion type in the ExecState.
129 (KJS::Node::rethrowException): Now sets the completion type in the
131 (KJS::StatementNode::hitStatement): Now sets the completion type in
133 (KJS::VarStatementNode::execute): Updated to put completion type in
134 the ExecState instead of a Completion object.
135 (KJS::statementListExecute): Ditto. Also changed the for loop to use
136 indices instead of iterators.
137 (KJS::BlockNode::execute): Updated return type.
138 (KJS::EmptyStatementNode::execute): Updated to put completion type in
139 the ExecState instead of a Completion object.
140 (KJS::ExprStatementNode::execute): Ditto.
141 (KJS::IfNode::execute): Ditto.
142 (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
143 to make the normal case a little faster and moved the end outside the
144 loop so that "break" can do a break.
145 (KJS::WhileNode::execute): Ditto.
146 (KJS::ForNode::execute): Ditto.
147 (KJS::ForInNode::execute): Ditto.
148 (KJS::ContinueNode::execute): Updated to put completion type in
149 the ExecState instead of a Completion object.
150 (KJS::BreakNode::execute): Ditto.
151 (KJS::ReturnNode::execute): Ditto.
152 (KJS::WithNode::execute): Ditto.
153 (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
154 execute in its name to reflect the fact that it's a member of the same
156 (KJS::CaseBlockNode::executeBlock): Ditto.
157 (KJS::SwitchNode::execute): Ditto.
158 (KJS::LabelNode::execute): Ditto.
159 (KJS::ThrowNode::execute): Ditto.
160 (KJS::TryNode::execute): Ditto.
161 (KJS::ProgramNode::execute): Ditto.
162 (KJS::EvalNode::execute): Ditto.
163 (KJS::FunctionBodyNode::execute): Ditto.
164 (KJS::FuncDeclNode::execute): Ditto.
166 * kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
167 hitStatement protected, changed return value of execute to a JSValue,
168 renamed evalStatements to executeStatements, and evalBlock to executeBlock.
170 * kjs/number_object.h: Removed unused execute function.
172 2007-12-20 Geoffrey Garen <ggaren@apple.com>
177 (KJS::ProgramNode::processDeclarations):
179 2007-12-20 Geoffrey Garen <ggaren@apple.com>
181 Linux build fix: config.h has to come first.
183 * kjs/error_object.cpp:
185 2007-12-19 Geoffrey Garen <ggaren@apple.com>
187 Reviewed by Oliver Hunt.
189 Optimized global access to global variables, using a symbol table.
191 SunSpider reports a 1.5% overall speedup, a 6.2% speedup on 3d-morph,
192 and a whopping 33.1% speedup on bitops-bitwise-and.
194 * API/JSCallbackObjectFunctions.h: Replaced calls to JSObject:: with
195 calls to Base::, since JSObject is not always our base class. This
196 was always a bug, but the bug is even more apparent after some of my
199 (KJS::::staticFunctionGetter): Replaced use of getDirect with call to
200 getOwnPropertySlot. Global declarations are no longer stored in the
201 property map, so a call to getDirect is insufficient for finding
205 * API/testapi.js: Added test for the getDirect change mentioned above.
208 * kjs/ExecState.h: Dialed back the optimization to store a direct
209 pointer to the localStorage buffer. One ExecState can grow the global
210 object's localStorage without another ExecState's knowledge, so
211 ExecState can't store a direct pointer to the localStorage buffer
212 unless/until we invent a way to update all the relevant ExecStates.
214 * kjs/JSGlobalObject.cpp: Inserted the symbol table into get and put
216 (KJS::JSGlobalObject::reset): Reset the symbol table and local storage,
217 too. Also, clear the property map here, removing the need for a
220 * kjs/JSVariableObject.cpp:
221 * kjs/JSVariableObject.h: Added support for saving localStorage and the
222 symbol table to the back/forward cache, and restoring them.
225 (KJS::GlobalFuncImp::callAsFunction): Renamed progNode to evalNode
226 because it's an EvalNode, not a ProgramNode.
229 (KJS::cacheGlobalObject): Replaced put with faster putDirect, since
230 that's how the rest of lookup.h works. putDirect is safe here because
231 cacheGlobalObject is only used for objects whose names are not valid
234 * kjs/nodes.cpp: The good stuff!
236 (KJS::EvalNode::processDeclarations): Replaced hasProperty with
237 the new hasOwnProperty, which is slightly faster.
239 * kjs/object.h: Nixed clearProperties because clear() does this job now.
241 * kjs/property_map.cpp:
242 * kjs/property_map.h: More back/forward cache support.
245 (WTF::::grow): Added fast non-branching grow function. I used it in
246 an earlier version of this patch, even though it's not used anymore.
248 2007-12-09 Mark Rowe <mrowe@apple.com>
250 Reviewed by Oliver Hunt.
252 Build fix for non-Mac platforms. Move NodeInfo into its own header so that the YYTYPE
253 declaration in grammar.h is able to declare members of that type.
255 * kjs/NodeInfo.h: Added.
256 (KJS::createNodeInfo):
257 (KJS::mergeDeclarationLists):
258 (KJS::appendToVarDeclarationList):
262 2007-12-19 Oliver Hunt <oliver@apple.com>
264 Make appendToVarDeclarationList static
270 2007-12-18 Oliver Hunt <oliver@apple.com>
272 Remove dead code due to removal of post-parse declaration discovery.
276 Due to the removal of the declaration discovery pass after parsing we
277 no longer need any of the logic used for that discovery.
281 (KJS::VarDeclNode::VarDeclNode):
282 (KJS::BlockNode::BlockNode):
283 (KJS::ForInNode::ForInNode):
284 (KJS::CaseBlockNode::CaseBlockNode):
286 (KJS::VarStatementNode::):
288 (KJS::DoWhileNode::):
293 (KJS::FuncDeclNode::):
294 (KJS::CaseClauseNode::):
295 (KJS::ClauseListNode::):
298 2007-12-18 Oliver Hunt <oliver@apple.com>
300 Replace post-parse pass to find declarations with logic in the parser itself
304 Instead of finding declarations in a pass following the initial parsing of
305 a program, we incorporate the logic directly into the parser. This lays
306 the groundwork for further optimisations (such as improving performance in
307 declaration expressions -- var x = y; -- to match that of standard assignment)
308 in addition to providing a 0.4% performance improvement in SunSpider.
310 * JavaScriptCore.exp:
312 (KJS::Parser::parse):
314 (KJS::Parser::didFinishParsing):
315 (KJS::Parser::parse):
318 (KJS::ParserTracked::ParserTracked):
319 (KJS::ParserTracked::~ParserTracked):
320 (KJS::ParserTracked::ref):
321 (KJS::ParserTracked::deref):
322 (KJS::ParserTracked::refcount):
323 (KJS::ParserTracked::clearNewTrackedObjects):
325 (KJS::ScopeNode::ScopeNode):
326 (KJS::ProgramNode::ProgramNode):
327 (KJS::EvalNode::EvalNode):
328 (KJS::FunctionBodyNode::FunctionBodyNode):
329 (KJS::FunctionBodyNode::initializeSymbolTable):
330 (KJS::FunctionBodyNode::processDeclarations):
332 (KJS::ParserTracked::):
336 2007-12-18 Xan Lopez <xan@gnome.org>
340 Fix http://bugs.webkit.org/show_bug.cgi?id=14521
341 Bug 14521: JavaScriptCore fails to build on Linux/PPC gcc 4.1.2
344 (TCMalloc_SpinLock::Unlock):
346 Use less strict memory operand constraint on inline asm generation.
347 PLATFORM(DARWIN) left unpatched due to Apple's GCC bug.
349 Patch by David Kilzer <ddkilzer@webkit.org>
351 2007-12-18 Mark Rowe <mrowe@apple.com>
353 Rubber-stamped by Maciej Stachowiak.
355 Remove outdated and non-functioning project files for the Apollo port.
357 * JavaScriptCore.apolloproj: Removed.
359 2007-12-18 Darin Adler <darin@apple.com>
363 * pcre/pcre_exec.cpp:
364 (jsRegExpExecute): Change back from false/true to 0/1 -- I probably should not have
365 deleted MATCH_MATCH and MATCH_NOMATCH, but I'm going to leave them out.
367 2007-12-18 Darin Adler <darin@apple.com>
371 - fix http://bugs.webkit.org/show_bug.cgi?id=16458
372 REGRESSION (r28164): regular expressions can now hang due to lack of a match limit
373 <rdar://problem/5636067>
375 Test: fast/regex/slow.html
377 Slows down SunSpider a bit (about 1.01x); filed a bug to follow up on that:
378 http://bugs.webkit.org/show_bug.cgi?id=16503
380 * pcre/pcre.h: Changed name of error code to not specifically mention "recursion".
381 * pcre/pcre_exec.cpp:
382 (match): Replaced the depth limit, MATCH_RECURSION_LIMIT, with a total match looping
383 limit, matchLimit. Also eliminated the constants for MATCH_MATCH and MATCH_NOMATCH,
384 since they are just true and false (1 and 0).
385 (jsRegExpExecute): More of the MATCH_MATCH change.
387 2007-12-17 Darin Adler <darin@apple.com>
389 - speculative build fix for non-gcc platforms
391 * pcre/pcre_exec.cpp: (match): Remove unused cases from return switch.
393 2007-12-16 Mark Rowe <mrowe@apple.com>
395 Speculative build fix for non-Mac platforms.
397 * pcre/pcre_compile.cpp: Include string.h for memset, memmove, etc.
399 2007-12-16 Darin Adler <darin@apple.com>
403 - http://bugs.webkit.org/show_bug.cgi?id=16438
404 - removed some more unused code
405 - changed quite a few more names to WebKit-style
406 - moved more things out of pcre_internal.h
407 - changed some indentation to WebKit-style
408 - improved design of the functions for reading and writing
409 2-byte values from the opcode stream (in pcre_internal.h)
412 (main): Added the kjs prefix a normal way in lieu of using macros.
414 * pcre/pcre_compile.cpp: Moved some definitions here from pcre_internal.h.
415 (errorText): Name changes, fewer typedefs.
416 (checkEscape): Ditto. Changed uppercase conversion to use toASCIIUpper.
417 (isCountedRepeat): Name change.
418 (readRepeatCounts): Name change.
419 (firstSignificantOpcode): Got rid of the use of OP_lengths, which is
420 very lightly used here. Hard-coded the length of OP_BRANUMBER.
421 (firstSignificantOpcodeSkippingAssertions): Ditto. Also changed to
422 use the advanceToEndOfBracket function.
423 (getOthercaseRange): Name changes.
425 (compileBranch): Name changes. Removed unused after_manual_callout and
426 the code to handle it. Removed code to handle OP_ONCE since we never
427 emit this opcode. Changed to use advanceToEndOfBracket in more places.
428 (compileBracket): Name changes.
429 (branchIsAnchored): Removed code to handle OP_ONCE since we never emit
431 (bracketIsAnchored): Name changes.
432 (branchNeedsLineStart): More fo the same.
433 (bracketNeedsLineStart): Ditto.
434 (branchFindFirstAssertedCharacter): Removed OP_ONCE code.
435 (bracketFindFirstAssertedCharacter): More of the same.
436 (calculateCompiledPatternLengthAndFlags): Ditto.
437 (returnError): Name changes.
438 (jsRegExpCompile): Ditto.
440 * pcre/pcre_exec.cpp: Moved some definitions here from pcre_internal.h.
441 (matchRef): Updated names.
442 Improved macros to use the do { } while(0) idiom so they expand to single
443 statements rather than to blocks or multiple statements. And refeactored
444 the recursive match macros.
445 (MatchStack::pushNewFrame): Name changes.
446 (getUTF8CharAndIncrementLength): Name changes.
447 (match): Name changes. Removed the ONCE opcode.
448 (jsRegExpExecute): Name changes.
450 * pcre/pcre_internal.h: Removed quite a few unneeded includes. Rewrote
451 quite a few comments. Removed the macros that add kjs prefixes to the
452 functions with external linkage; instead renamed the functions. Removed
453 the unneeded typedefs pcre_uint16, pcre_uint32, and uschar. Removed the
454 dead and not-all-working code for LINK_SIZE values other than 2, although
455 we aim to keep the abstraction working. Removed the OP_LENGTHS macro.
456 (put2ByteValue): Replaces put2ByteOpcodeValueAtOffset.
457 (get2ByteValue): Replaces get2ByteOpcodeValueAtOffset.
458 (put2ByteValueAndAdvance): Replaces put2ByteOpcodeValueAtOffsetAndAdvance.
459 (putLinkValueAllowZero): Replaces putOpcodeValueAtOffset; doesn't do the
460 addition, since a comma is really no better than a plus sign. Added an
461 assertion to catch out of range values and changed the parameter type to
462 int rather than unsigned.
463 (getLinkValueAllowZero): Replaces getOpcodeValueAtOffset.
464 (putLinkValue): New function that most former callers of the
465 putOpcodeValueAtOffset function can use; asserts the value that is
466 being stored is non-zero and then calls putLinkValueAllowZero.
467 (getLinkValue): Ditto.
468 (putLinkValueAndAdvance): Replaces putOpcodeValueAtOffsetAndAdvance. No
469 caller was using an offset, which makes sense given the advancing behavior.
470 (putLinkValueAllowZeroAndAdvance): Ditto.
471 (isBracketOpcode): Added. For use in an assertion.
472 (advanceToEndOfBracket): Renamed from moveOpcodePtrPastAnyAlternateBranches,
473 and removed comments about how it's not well designed. This function takes
474 a pointer to the beginning of a bracket and advances to the end of the
477 * pcre/pcre_tables.cpp: Updated names.
478 * pcre/pcre_ucp_searchfuncs.cpp:
479 (kjs_pcre_ucp_othercase): Ditto.
480 * pcre/pcre_xclass.cpp:
481 (getUTF8CharAndAdvancePointer): Ditto.
482 (kjs_pcre_xclass): Ditto.
483 * pcre/ucpinternal.h: Ditto.
486 (WTF::isASCIIAlpha): Added an int overload, like the one we already have for
488 (WTF::isASCIIAlphanumeric): Ditto.
489 (WTF::isASCIIHexDigit): Ditto.
490 (WTF::isASCIILower): Ditto.
491 (WTF::isASCIISpace): Ditto.
492 (WTF::toASCIILower): Ditto.
493 (WTF::toASCIIUpper): Ditto.
495 2007-12-16 Darin Adler <darin@apple.com>
499 - fix http://bugs.webkit.org/show_bug.cgi?id=16459
500 REGRESSION: assertion failure with regexp with \B in a case-ignoring character range
501 <rdar://problem/5646361>
503 The problem was that \B was not handled properly in character classes.
505 Test: fast/js/regexp-overflow.html
507 * pcre/pcre_compile.cpp:
508 (check_escape): Added handling of ESC_b and ESC_B in character classes here.
509 Allows us to get rid of the handling of \b in character classes from all the
510 call sites that handle it separately and to handle \B properly as well.
511 (compileBranch): Remove the ESC_b handling, since it's not needed any more.
512 (calculateCompiledPatternLengthAndFlags): Ditto.
514 2007-12-16 Mark Rowe <mrowe@apple.com>
516 Reviewed by Maciej Stachowiak.
518 Fix http://bugs.webkit.org/show_bug.cgi?id=16448
519 Bug 16448: [GTK] Celtic Kane JavaScript performance on Array test is slow relative to Mac
521 * kjs/array_instance.cpp:
522 (KJS::compareByStringPairForQSort):
523 (KJS::ArrayInstance::sort): Convert JSValue's to strings once up front and then sort the
524 results. This avoids calling toString twice per comparison, but requires a temporary buffer
525 so we only use this approach in cases where the array being sorted is not too large.
527 2007-12-16 Geoffrey Garen <ggaren@apple.com>
529 Reviewed by Darin Adler and Maciej Stachowiak.
531 More refactoring to support global variable optimization.
533 Changed SymbolTable to use RefPtr<UString::Rep> as its key instead of
534 UString::Rep*. With globals, the symbol table can outlast the
535 declaration node for any given symbol, so the symbol table needs to ref
538 In support, specialized HashMaps with RefPtr keys to allow lookup
539 via raw pointer, avoiding refcount churn.
541 SunSpider reports a .6% speedup (prolly just noise).
543 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added new file: wtf/RefPtrHashMap.h
544 * JavaScriptCore.xcodeproj/project.pbxproj: ditto
546 * kjs/JSVariableObject.cpp:
547 (KJS::JSVariableObject::getPropertyNames): Symbol table keys are RefPtrs now.
549 * kjs/SymbolTable.h: Modified key traits to match RefPtr. Added a
550 static Rep* for null, which helps compute the deletedValue() trait.
552 * wtf/HashMap.h: #include the RefPtr specialization so everyone can use it.
554 * wtf/RefPtrHashMap.h: Copied from wtf/HashMap.h. Added overloaded versions
555 of find(), contains(), get(), set(), add(), remove(), and take() that take
556 raw pointers as keys.
558 2007-12-16 Alexey Proskuryakov <ap@webkit.org>
562 http://bugs.webkit.org/show_bug.cgi?id=16162
563 Problems with float parsing on Linux (locale-dependent parsing was used).
565 * kjs/dtoa.cpp: Removed USE_LOCALE to reduce future confusion.
566 * kjs/lexer.cpp: (KJS::Lexer::lex): Parse with kjs_strtod, not the system one.
568 2007-12-14 Alp Toker <alp@atoker.com>
570 Reviewed by Mark Rowe.
572 Enable the AllInOneFile.cpp optimization for the GTK+ port.
574 * JavaScriptCore.pri:
576 2007-12-14 Mark Rowe <mrowe@apple.com>
578 Unreviewed. Remove commented out fprintf's that were for debugging purposes only.
580 * wtf/FastMalloc.cpp:
581 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
583 2007-12-14 Mark Rowe <mrowe@apple.com>
585 Reviewed by Maciej Stachowiak.
587 Don't use the MADV_DONTNEED code path for now as it has no effect on Mac OS X and is
588 currently untested on other platforms.
590 * wtf/TCSystemAlloc.cpp:
591 (TCMalloc_SystemRelease): Return after releasing memory rather than potentially falling
592 through into another mechanism if multiple are supported.
594 2007-12-14 Alp Toker <alp@atoker.com>
596 Build fix for GTK+/Qt and ports that don't use AllInOneFile.cpp.
598 Include UnusedParam.h.
600 * wtf/TCSystemAlloc.cpp:
602 2007-12-14 Oliver Hunt <oliver@apple.com>
604 Reviewed by Stephanie.
608 * wtf/FastMalloc.cpp:
609 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
611 2007-12-14 Dan Bernstein <mitz@apple.com>
613 - try again to fix the Windows build
615 * wtf/TCSystemAlloc.cpp:
616 (TCMalloc_SystemRelease):
618 2007-12-14 Dan Bernstein <mitz@apple.com>
620 - try to fix the Windows build
622 * wtf/TCSystemAlloc.cpp:
623 (TCMalloc_SystemRelease):
625 2007-12-14 Mark Rowe <mrowe@apple.com>
627 Reviewed by Maciej and Oliver.
629 Add final changes to make TCMalloc release memory to the system.
630 This results in a 0.4% regression against ToT, but this is offset
631 against the gains made by the original TCMalloc r38 merge - in fact
632 we retain around 0.3-0.4% progression overall.
634 * wtf/FastMalloc.cpp:
635 (WTF::InitSizeClasses):
636 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
637 * wtf/TCSystemAlloc.cpp:
638 (TCMalloc_SystemRelease):
640 2007-12-14 Darin Adler <darin@apple.com>
644 - removed unnecessary includes of "Vector.h"
647 (WTF::copyKeysToVector): Make the type of the vector be a template parameter.
648 This allows copying keys into a vector of a base class or one with an inline capacity.
649 (WTF::copyValuesToVector): Ditto.
651 (WTF::copyToVector): Ditto.
653 2007-12-14 Anders Carlsson <andersca@apple.com>
655 Reviewed by Darin and Geoff.
657 <rdar://problem/5619295>
658 REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
660 Get rid of unnecessary and incorrect security checks for plug-ins accessing JavaScript objects.
662 The way this used to work was that each NPObject that wrapped a JSObject would have a root object
663 corresponding to the frame object (used for managing the lifecycle) and an origin root object (used for
664 doing security checks).
666 This would prevent a plug-in from accessing a frame's window object if it's security origin was different
667 (some parts of the window, such as the location object, can be accessed from frames with different security
668 origins, and those checks are being done in WebCore).
670 Also, if a plug-in were to access a window object of a frame that later went away, it could lead to that
671 Window JSObject being garbage collected and the NPObject pointing to freed memory.
673 How this works now is that there is no origin root object anymore, and all NPObject wrappers that are created
674 for a plug-in will have the root object of the containing frame of that plug-in.
676 * bindings/NP_jsobject.cpp:
678 Don't free the origin root object.
680 (_NPN_CreateScriptObject):
681 Remove the origin root object parameter.
683 (_NPN_InvokeDefault):
688 (_NPN_RemoveProperty):
692 Get rid of all security checks.
694 * bindings/NP_jsobject.h:
695 Remove originRootObject from the JavaScriptObject struct.
697 * bindings/c/c_utility.cpp:
698 (KJS::Bindings::convertValueToNPVariant):
699 Always use the root object from the ExecState.
701 2007-12-13 Steve Falkenburg <sfalken@apple.com>
703 Move source file generation into its own vcproj to fix build dependencies.
707 * JavaScriptCore.vcproj/JavaScriptCore.sln:
708 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
709 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added.
710 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Added.
711 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
713 2007-12-13 Alp Toker <alp@atoker.com>
715 http://bugs.webkit.org/show_bug.cgi?id=16406
716 [Gtk] JavaScriptCore needs -lpthread
718 Build fix for Debian and any other platforms that don't implicitly
721 Link to pthread on non-Windows platforms until this dependency is
724 2007-12-11 Geoffrey Garen <ggaren@apple.com>
726 Reviewed by Sam Weinig.
728 Build fix: Note some variables that are used only for ASSERTs.
732 (globalObject_initialize):
733 (testInitializeFinalize):
735 2007-12-11 Geoffrey Garen <ggaren@apple.com>
737 Reviewed by Darin Adler.
739 Fixed: All JS tests crash on Windows.
741 NDEBUG wasn't defined when compiling testkjs in release builds, so the
742 HashTable definition in HashTable.h included an extra data member.
744 The solution was to add NDEBUG to the release testkjs configuration on
747 For giggles, I also added other missing #defines to testkjs on Windows.
749 * Configurations/Base.xcconfig:
750 * Configurations/JavaScriptCore.xcconfig:
751 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
752 * JavaScriptCore.xcodeproj/project.pbxproj:
756 2007-12-11 Geoffrey Garen <ggaren@apple.com>
758 Reviewed by Darin Adler.
760 Removed bogus ASSERT.
762 ASSERT should only be used when we know that a code path will not be
763 taken. This code path is taken often during the jsFunFuzz test.
765 * pcre/pcre_exec.cpp:
768 2007-12-11 Darin Adler <darin@apple.com>
770 * wtf/unicode/qt4/UnicodeQt4.h: Try to fix Qt build by adding U16_IS_SINGLE.
772 2007-12-10 Darin Adler <darin@apple.com>
774 Reviewed by Sam Weinig.
776 - fix http://bugs.webkit.org/show_bug.cgi?id=16379
777 REGRESSION(r28525): Failures in http/tests/xmlhttprequest/response-encoding.html and
778 fast/dom/xmlhttprequest-html-response-encoding.html
779 and <rdar://problem/5640230> REGRESSION (306A4-ToT): Access violation in PCRE function
780 find_firstassertedchar
782 Test: fast/js/regexp-find-first-asserted.html
784 * pcre/pcre_compile.cpp:
785 (compileBracket): Take out unnecessary initialization of out parameters.
786 (branchFindFirstAssertedCharacter): Added. Broke out the half of the function that handles
788 (bracketFindFirstAssertedCharacter): Renamed from find_firstassertedchar. Also removed the
789 options parameter -- the caller can handle the options.
790 (jsRegExpCompile): Changed call site to call the appropriate bracket or branch version of
791 the find_firstassertedchar function. Also put the REQ_IGNORE_CASE code here instead of
792 passing in the options.
794 2007-12-10 Geoffrey Garen <ggaren@apple.com>
796 Reviewed by Sam Weinig.
810 FunctionBodyNode ProgramNode EvalNode
812 in preparation for specializing each class more while optimizing global
815 Also removed some cruft from the FunctionBodyNode interface to simplify
818 SunSpider says this patch is a .8% speedup, which seems reasonable,
819 since it eliminates a few branches and adds KJS_FAST_CALL in a few
822 Layout tests and JS tests pass. Also, this baby builds on Windows! (Qt
825 2007-12-10 Geoffrey Garen <ggaren@apple.com>
829 Mac build fix: added some exported symbols, now that Parser::parse is
830 defined in the header.
832 * JavaScriptCore.exp:
834 2007-12-10 Sam Weinig <sam@webkit.org>
838 Template methods need to be in the header.
840 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
843 (KJS::Parser::parse):
845 2007-12-10 Geoffrey Garen <ggaren@apple.com>
847 Reviewed by Sam Weinig.
849 Merged different implementations of Parser::parse into a single,
850 templatized implementation, in preparation for adding yet another
851 implementation for "eval" code.
853 JS and layout tests pass.
855 2007-12-10 Timothy Hatcher <timothy@apple.com>
857 Reviewed by Mark Rowe
859 <rdar://problem/5639463> Bundle versions on Tiger should be 4523.x not 523.x
861 * Configurations/Version.xcconfig: Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR,
862 so assume Tiger and use a 4 for the SYSTEM_VERSION_PREFIX.
864 2007-12-10 Mark Rowe <mrowe@apple.com>
868 * kjs/grammar.y: Use @1 and @0 in place of @$ where Tiger's bison chokes.
870 2007-12-10 Darin Adler <darin@apple.com>
872 Reviewed by Mark Rowe.
874 - fix http://bugs.webkit.org/show_bug.cgi?id=16375
875 REGRESSION: Safari crashes on quit
877 Probably a debug-only issue.
880 (KJS::parser): Create the parser and never destroy it by using a pointer instead
883 2007-12-09 Darin Adler <darin@apple.com>
885 Reviewed by Sam Weinig.
887 - fix http://bugs.webkit.org/show_bug.cgi?id=16369
888 REGRESSION (r28525): regular expression tests failing due to bad firstByte optimization
890 * pcre/pcre_compile.cpp: Changed some names to use interCaps intead of under_scores.
891 (branchIsAnchored): Broke is_anchored into two separate functions; this one works on a
892 branch and the other on an anchor. The old function would only work on a bracket.
893 Also removed unneeded parameters; the anchored check does not require the bracket
894 map or the options any more because we have a reduced set of features.
895 (bracketIsAnchored): Ditto.
896 (branchNeedsLineStart): Broke canApplyFirstCharOptimization into two functions and gave
897 both a better name. This is the function that was returning the wrong value. The failure
898 was beacuse the old function would only work on a bracket.
899 (bracketNeedsLineStart): Ditto.
900 (jsRegExpCompile): Changed to call the appropriate branch or bracket flavor of the
901 functions based on whether we compiled an outer bracket. Also removed inaccurate comments
902 and unneeded parameters.
904 - other small changes
906 * pcre/pcre.h: Renumbered error codes, in a logical order. First, normal failure, then
907 the recursion limit, then running out of memory, and finally an unexpected internal error.
909 * pcre/pcre_exec.cpp: Fixed indentation.
910 (jsRegExpExecute): Corrected an inaccurate comment.
912 2007-12-09 Darin Adler <darin@apple.com>
916 - fix http://bugs.webkit.org/show_bug.cgi?id=16370
917 REGRESSION (r28540): source URL and line number no longer set for outer function/programs
919 Test: fast/js/exception-linenums-in-html-1.html
920 Test: fast/js/exception-linenums-in-html-2.html
921 Test: fast/js/exception-linenums.html
923 By the time the ProgramNode was constructed, the source URL was empty.
926 (KJS::Parser::parseProgram): Added code to set and clear m_sourceURL, which is now
927 handled here instead of in the lexer; it needs to still be set when we create the
928 program node. Call setLoc to set the first and last line number.
929 (KJS::Parser::parseFunctionBody): Ditto, but for the body.
930 (KJS::Parser::parse): Removed the sourceURL argument.
932 * kjs/Parser.h: Added sourceURL(), m_sourceURL, and m_lastLine. Added a lastLine
933 parameter to didFinishParsing, since the bison grammar knows the last line number
934 and we otherwise do not know it. Removed the sourceURL parameter from parse, since
935 that's now handled at a higher level.
937 * kjs/grammar.y: Pass the last line number to didFinishParsing.
940 (KJS::Lexer::setCode): Removed the sourceURL argument and the code to set m_sourceURL.
941 (KJS::Lexer::clear): Ditto.
942 * kjs/lexer.h: More of the same.
945 (KJS::FunctionBodyNode::FunctionBodyNode): Get the source URL from the parser rather
946 than from the lexer. Removed unneeded call to setLoc, since the line numbers already
949 2007-12-08 Oliver Hunt <oliver@apple.com>
953 Split the ENABLE_SVG_EXPERIMENTAL_FEATURES flag into separate flags.
955 Fixes <rdar://problem/5620249> Must disable SVG animation
956 <rdar://problem/5612772> Disable SVG filters on Mac to match Windows behavior
958 Minor config changes.
960 * Configurations/JavaScriptCore.xcconfig:
961 * JavaScriptCore.xcodeproj/project.pbxproj:
963 2007-12-07 Sam Weinig <sam@webkit.org>
967 - Rename isSafeScript to allowsAccessFrom.
969 * bindings/NP_jsobject.cpp:
971 * kjs/JSGlobalObject.h:
972 (KJS::JSGlobalObject::allowsAccessFrom): Reverse caller/argument of allowsAccessFrom to match
975 2007-12-07 Geoffrey Garen <ggaren@apple.com>
977 Reviewed by Sam Weinig.
979 Refactored variable access optimization: Removed the assumption that
980 the FunctionBodyNode holds the symbol table.
982 2007-12-07 Geoffrey Garen <ggaren@apple.com>
984 Build fix: added #include.
988 2007-12-07 Geoffrey Garen <ggaren@apple.com>
990 Build fix: added #include.
992 * kjs/interpreter.cpp:
994 2007-12-07 Geoffrey Garen <ggaren@apple.com>
996 Build fix: added #include.
1000 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1002 Build fix: added #include.
1004 * kjs/function_object.cpp:
1006 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1008 Reviewed by Sam Weinig.
1010 Fixed crash seen running layout tests.
1012 Reverted a change I made earlier today. Added a comment to try to
1013 discourage myself from making this mistake a third time.
1016 (KJS::ActivationImp::mark):
1018 (KJS::ActivationImp::ActivationImpData::ActivationImpData):
1020 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1022 Reviewed by Sam Weinig.
1024 Refactored parsing of global code: Removed the assumption that
1025 ProgramNode inherits from FunctionBodyNode from the parser.
1028 (KJS::Parser::parseProgram):
1029 (KJS::Parser::parseFunctionBody):
1030 (KJS::Parser::parse):
1032 (KJS::Parser::didFinishParsing):
1037 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1039 Build fix: added JSVariableObject.cpp to the .pri file.
1041 * JavaScriptCore.pri:
1043 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1045 Build fix: added #include.
1049 2007-12-07 Steve Falkenburg <sfalken@apple.com>
1051 Re-named our B&I flag from BUILDBOT to PRODUCTION.
1053 Reviewed by Sam Weinig.
1055 * JavaScriptCore.vcproj/JavaScriptCore.make:
1056 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
1058 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1060 Build fix: removed stray name qualification.
1063 (KJS::ActivationImp::ActivationImp):
1065 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1067 Build fix: moved functions with qualified names outside of class
1070 * kjs/JSVariableObject.h:
1071 (KJS::JSVariableObject::symbolTableGet):
1072 (KJS::JSVariableObject::symbolTablePut):
1074 2007-12-07 Geoffrey Garen <ggaren@apple.com>
1076 Reviewed by Sam Weinig.
1078 Next step in refactoring JSGlobalObject: Added JSVariableObject class,
1079 and factored symbol-table-related code into it. (JSGlobalObject doesn't
1080 use the symbol table code yet, though.)
1082 Layout and JS tests, and testapi, pass. SunSpider reports no regression.
1084 2007-12-07 Darin Adler <darin@apple.com>
1088 - fix http://bugs.webkit.org/show_bug.cgi?id=16185
1089 jsRegExpCompile should not add implicit non-capturing bracket
1091 While this does not make SunSpider faster, it will make many regular
1092 expressions a bit faster.
1094 * pcre/pcre_compile.cpp: Moved CompileData struct in here from the
1095 header since it's private to this file.
1096 (compile_branch): Updated for function name change.
1097 (compile_bracket): Renamed from compile_regex, since, for one thing,
1098 this does not compile an entire regular expression.
1099 (calculateCompiledPatternLengthAndFlags): Removed unused item_count
1100 local variable. Renamed CompileData to cd instead of compile_block
1101 to be consistent with other functions. Added code to set the
1102 needOuterBracket flag if there's at least one "|" at the outer level.
1103 (jsRegExpCompile): Renamed CompileData to cd instead of compile_block
1104 to be consistent with other functions. Removed unneeded "size" field
1105 from the compiled regular expression. If no outer bracket is needed,
1106 then use compile_branch to compile the regular expression.
1108 * pcre/pcre_internal.h: Removed the CompileData struct, which is now
1109 private to pcre_compile.cpp. Removed the size member from JSRegExp.
1111 2007-12-06 Kevin Ollivier <kevino@theolliviers.com>
1113 MSVC7 build fix due to a compiler bug with placement new and/or
1114 templates and casting.
1116 Reviewed by Darin Adler.
1121 2007-12-06 Darin Adler <darin@apple.com>
1123 Reviewed by Eric Seidel.
1125 - fix http://bugs.webkit.org/show_bug.cgi?id=16321
1126 new RegExp("[\u0097]{4,6}", "gmy") crashes in DEBUG builds
1127 <rdar://problem/5632992>
1129 Test: fast/js/regexp-oveflow.html
1131 * pcre/pcre_compile.cpp:
1132 (calculateCompiledPatternLengthAndFlags): In the case where a single character
1133 character class is optimized to not use a character class at all, the preflight
1134 code was not setting the lastitemlength variable.
1136 2007-12-05 Mark Rowe <mrowe@apple.com>
1138 Qt Windows build fix. Include the time-related headers in the correct place.
1140 * kjs/JSGlobalObject.cpp:
1141 * kjs/interpreter.cpp:
1143 2007-12-05 Darin Adler <darin@apple.com>
1145 Not reviewed; just undoing a previous commit.
1147 - remove earlier incorrect fix for http://bugs.webkit.org/show_bug.cgi?id=16220
1148 <rdar://problem/5625221> Crash opening www.news.com (CNet)
1150 The real bug was the backwards ?: in the compile function, which Geoff just
1151 fixed. Rolling out the incorrect earlier fix.
1153 * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): Take out
1154 the unneeded preflight change. The regression test proves this is still working
1155 fine, so the bug remains fixed.
1157 2007-12-01 Mark Rowe <mrowe@apple.com>
1159 Build fix. Include headers before trying to use the things that they declare.
1161 * kjs/JSImmediate.cpp:
1164 * kjs/object_object.cpp:
1165 * kjs/regexp_object.cpp:
1166 * kjs/string_object.cpp:
1168 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1170 Build fix: added some #includes.
1172 * kjs/JSImmediate.cpp:
1174 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1176 Build fix: added some #includes.
1178 * kjs/JSGlobalObject.cpp:
1179 * kjs/JSImmediate.cpp:
1181 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1183 Build fix: Fixed #include spelling.
1187 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1189 Build fix: added #include.
1193 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1195 Build fix: added a forward declaration.
1199 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1201 Build fix: added an #include.
1203 * kjs/error_object.cpp:
1205 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1207 Build fix: added an #include.
1209 * kjs/bool_object.cpp:
1211 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1213 Reviewed by Darin Adler.
1215 Third step in refactoring JSGlobalObject: Moved data members and
1216 functions accessing data members from Interpreter to JSGlobalObject.
1217 Changed Interpreter member functions to static functions.
1219 This resolves a bug in global object bootstrapping, where the global
1220 ExecState could be used when uninitialized.
1222 This is a big change, but it's mostly code motion and renaming.
1224 Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
1225 a .7% regression, but Shark sees no difference related to this patch,
1226 and SunSpider reported a .7% speedup from an earlier step in this
1227 refactoring, so I think it's fair to call that a wash.
1229 2007-12-05 Geoffrey Garen <ggaren@apple.com>
1231 Reviewed by Darin Adler. (Or vice versa.)
1233 Fixed ASSERT during run-javascriptcore-tests. (Darin just added the
1234 ASSERT, but the bug wasn't new.)
1236 * pcre/pcre_compile.cpp:
1237 (compile_branch): The ?: operator here was backwards, causing us to
1238 execute the loop too many times, adding stray KET opcodes to the
1239 compiled regular expression.
1241 2007-12-05 Kevin McCullough <kmccullough@apple.com>
1245 - Wait until local variable data is fully constructed before notifying the debugger of entering
1246 or leaving a call frame.
1249 (KJS::FunctionImp::callAsFunction):
1251 (KJS::FunctionBodyNode::execute):
1253 2007-12-05 Mark Rowe <mrowe@apple.com>
1257 Build fix for GCC 4.2. Cast via a union to avoid strict-aliasing issues.
1259 * wtf/FastMalloc.cpp:
1263 2007-12-05 Mark Rowe <mrowe@apple.com>
1267 Fix testkjs in 64-bit.
1269 When built for 64-bit the TCMalloc spin lock uses pthread mutexes rather than a custom spin lock
1270 implemented in assembly. If we fail to initialize the pthread mutex, attempts to lock or unlock
1271 it will fail and trigger a call to abort.
1273 * wtf/FastMalloc.cpp: Initialize the spin lock so that we can later lock and unlock it.
1274 * wtf/TCSpinLock.h: Add an Init method to the optimised spin lock.
1276 2007-12-04 Oliver Hunt <oliver@apple.com>
1278 Reviewed by NOBODY (Build fix).
1282 * wtf/TCSystemAlloc.cpp:
1284 2007-12-03 Oliver Hunt <oliver@apple.com>
1286 Reviewed by Mark Rowe and Geoff Garen.
1290 It also result in a performance progression between 0.5% and
1291 0.9% depending on the test, however most if not all of this
1292 gain will be consumed by the overhead involved in the later
1293 change to release memory to the system.
1295 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1296 * JavaScriptCore.xcodeproj/project.pbxproj:
1297 * wtf/FastMalloc.cpp:
1298 (WTF::KernelSupportsTLS):
1299 (WTF::CheckIfKernelSupportsTLS):
1306 (WTF::SLL_PopRange):
1307 (WTF::SLL_PushRange):
1310 (WTF::ByteSizeForClass):
1312 (WTF::InitSizeClasses):
1313 (WTF::AllocationSize):
1314 (WTF::TCMalloc_PageHeap::GetSizeClassIfCached):
1315 (WTF::TCMalloc_PageHeap::CacheSizeClass):
1316 (WTF::TCMalloc_PageHeap::init):
1317 (WTF::TCMalloc_PageHeap::New):
1318 (WTF::TCMalloc_PageHeap::AllocLarge):
1319 (WTF::TCMalloc_PageHeap::Carve):
1320 (WTF::TCMalloc_PageHeap::Delete):
1321 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
1323 (WTF::TCMalloc_PageHeap::Dump):
1324 (WTF::TCMalloc_PageHeap::GrowHeap):
1325 (WTF::TCMalloc_PageHeap::Check):
1326 (WTF::ReleaseFreeList):
1327 (WTF::TCMalloc_PageHeap::ReleaseFreePages):
1328 (WTF::TCMalloc_ThreadCache_FreeList::Push):
1329 (WTF::TCMalloc_ThreadCache_FreeList::PushRange):
1330 (WTF::TCMalloc_ThreadCache_FreeList::PopRange):
1331 (WTF::TCMalloc_ThreadCache_FreeList::Pop):
1332 (WTF::TCMalloc_Central_FreeList::length):
1333 (WTF::TCMalloc_Central_FreeList::tc_length):
1334 (WTF::TCMalloc_Central_FreeList::Init):
1335 (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans):
1336 (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass):
1337 (WTF::TCMalloc_Central_FreeList::MakeCacheSpace):
1338 (WTF::TCMalloc_Central_FreeList::ShrinkCache):
1339 (WTF::TCMalloc_Central_FreeList::InsertRange):
1340 (WTF::TCMalloc_Central_FreeList::RemoveRange):
1341 (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe):
1342 (WTF::TCMalloc_Central_FreeList::Populate):
1343 (WTF::TCMalloc_ThreadCache::Init):
1344 (WTF::TCMalloc_ThreadCache::Cleanup):
1345 (WTF::TCMalloc_ThreadCache::Allocate):
1346 (WTF::TCMalloc_ThreadCache::Deallocate):
1347 (WTF::TCMalloc_ThreadCache::FetchFromCentralCache):
1348 (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache):
1349 (WTF::TCMalloc_ThreadCache::Scavenge):
1350 (WTF::TCMalloc_ThreadCache::PickNextSample):
1351 (WTF::TCMalloc_ThreadCache::NewHeap):
1352 (WTF::TCMalloc_ThreadCache::GetThreadHeap):
1353 (WTF::TCMalloc_ThreadCache::GetCache):
1354 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
1355 (WTF::TCMalloc_ThreadCache::InitTSD):
1356 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
1357 (WTF::TCMallocStats::ExtractStats):
1358 (WTF::TCMallocStats::DumpStats):
1359 (WTF::TCMallocStats::DumpStackTraces):
1360 (WTF::TCMallocStats::TCMallocImplementation::MarkThreadIdle):
1361 (WTF::TCMallocStats::TCMallocImplementation::ReleaseFreeMemory):
1362 (WTF::TCMallocStats::TCMallocGuard::TCMallocGuard):
1363 (WTF::TCMallocStats::TCMallocGuard::~TCMallocGuard):
1364 (WTF::TCMallocStats::DoSampledAllocation):
1365 (WTF::TCMallocStats::CheckCachedSizeClass):
1366 (WTF::TCMallocStats::CheckedMallocResult):
1367 (WTF::TCMallocStats::SpanToMallocResult):
1368 (WTF::TCMallocStats::do_malloc):
1369 (WTF::TCMallocStats::do_free):
1370 (WTF::TCMallocStats::do_memalign):
1371 (WTF::TCMallocStats::do_malloc_stats):
1372 (WTF::TCMallocStats::do_mallopt):
1373 (WTF::TCMallocStats::do_mallinfo):
1374 (WTF::TCMallocStats::realloc):
1375 (WTF::TCMallocStats::cpp_alloc):
1376 (WTF::TCMallocStats::operator new):
1377 (WTF::TCMallocStats::):
1378 (WTF::TCMallocStats::operator new[]):
1379 (WTF::TCMallocStats::malloc_stats):
1380 (WTF::TCMallocStats::mallopt):
1381 (WTF::TCMallocStats::mallinfo):
1382 * wtf/TCPackedCache.h: Added.
1383 (PackedCache::PackedCache):
1386 (PackedCache::GetOrDefault):
1387 (PackedCache::Clear):
1388 (PackedCache::EntryToValue):
1389 (PackedCache::EntryToUpper):
1390 (PackedCache::KeyToUpper):
1391 (PackedCache::UpperToPartialKey):
1392 (PackedCache::Hash):
1393 (PackedCache::KeyMatch):
1395 (TCMalloc_PageMap2::PreallocateMoreMemory):
1396 * wtf/TCSystemAlloc.cpp:
1397 (TCMalloc_SystemRelease):
1398 * wtf/TCSystemAlloc.h:
1400 2007-12-04 Anders Carlsson <andersca@apple.com>
1404 Make isSafeScript const.
1406 * kjs/JSGlobalObject.h:
1407 (KJS::JSGlobalObject::isSafeScript):
1409 2007-12-04 Darin Adler <darin@apple.com>
1413 - fix first part of http://bugs.webkit.org/show_bug.cgi?id=16220
1414 <rdar://problem/5625221> Crash opening www.news.com (CNet)
1416 Test: fast/js/regexp-overflow.html
1418 * pcre/pcre_compile.cpp:
1419 (calculateCompiledPatternLengthAndFlags): Add room for the additional BRA/KET that
1420 was generated in the compile code but not taken into account here.
1422 2007-12-03 Darin Adler <darin@apple.com>
1426 - fix http://bugs.webkit.org/show_bug.cgi?id=15618
1427 <rdar://problem/5619353> REGRESSION: Stack overflow/crash in KJS::equal (15618)
1429 Test: fast/js/recursion-limit-equal.html
1431 * kjs/operations.cpp: (KJS::equal): Check the exception from toPrimitive.
1433 2007-12-03 Dan Bernstein <mitz@apple.com>
1435 - fix a copy-and-paste-o
1437 * bindings/npruntime.cpp:
1438 (_NPN_GetIntIdentifier):
1440 2007-12-03 Dan Bernstein <mitz@apple.com>
1442 Reviewed by Darin Adler.
1444 - fix an ASSERT when getIntIdentifier is called with 0 or -1
1446 * bindings/npruntime.cpp:
1447 (_NPN_GetIntIdentifier): We cannot use the hashmap for 0 and -1 since
1448 they are the empty value and the deleted value. Instead, keep the
1449 identifiers for those two integers in a static array.
1451 2007-12-02 Darin Adler <darin@apple.com>
1455 - fix http://bugs.webkit.org/show_bug.cgi?id=15848
1456 <rdar://problem/5619330> REGRESSION: Assertion failure viewing comments page on digg.com
1458 Test: fast/js/sparse-array.html
1460 * kjs/array_instance.cpp:
1461 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Check sparse array cutoff before looking
1462 in hash map. Can't avoid the branch because we can't look for 0 in the hash.
1463 (KJS::ArrayInstance::deleteProperty): Ditto.
1465 2007-12-02 Geoffrey Garen <ggaren@apple.com>
1467 Build fix: added an #include.
1469 * kjs/collector.cpp:
1471 2007-12-02 Geoffrey Garen <ggaren@apple.com>
1473 Reviewed by Eric Seidel.
1475 Second step in refactoring JSGlobalObject: moved virtual functions from
1476 Interpreter to JSGlobalObject.
1478 Layout and JS tests pass. SunSpider reports a .7% speedup -- don't
1481 2007-12-01 Alp Toker <alp@atoker.com>
1483 Reviewed by Adam Roben.
1485 http://bugs.webkit.org/show_bug.cgi?id=16228
1486 kJSClassDefinitionEmpty is not exported with JS_EXPORT
1488 Add JS_EXPORT to kJSClassDefinitionEmpty.
1490 Make the gcc compiler check take precedence over the WIN32||_WIN32
1491 check to ensure that symbols are exported on Windows when using gcc.
1493 Add a TODO referencing the bug about JS_EXPORT in the Win build
1494 (http://bugs.webkit.org/show_bug.cgi?id=16227)
1496 Don't define JS_EXPORT as 'extern' when the compiler is unknown since
1497 it would result in the incorrect expansion:
1499 extern extern const JSClassDefinition kJSClassDefinitionEmpty;
1501 (This was something we inherited from CFBase.h that doesn't make sense
1505 * API/JSObjectRef.h:
1507 2007-11-30 Geoffrey Garen <ggaren@apple.com>
1509 Reviewed by Beth Dakin.
1511 Reversed the ownership relationship between Interpreter and JSGlobalObject.
1512 Now, the JSGlobalObject owns the Interpreter, and top-level objects
1513 that need the two to persist just protect the JSGlobalObject from GC.
1515 Global object bootstrapping looks a little odd right now, but it will
1516 make much more sense soon, after further rounds of refactoring.
1518 * bindings/runtime_root.h: Made this class inherit from RefCounted,
1519 to avoid code duplication.
1521 * kjs/collector.cpp:
1522 (KJS::Collector::collect): No need to give special GC treatment to
1523 Interpreters, since we mark their global objects, which mark them.
1525 * kjs/interpreter.cpp:
1526 (KJS::Interpreter::mark): No need to mark our global object, since it
1528 * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject
1531 * kjs/testkjs.cpp: Modified to follow the new rules.
1532 (createGlobalObject):
1535 2007-11-30 Brent Fulgham <bfulgham@gmail.com>
1540 * pcre/pcre_compile.cpp:
1543 2007-11-30 Eric Seidel <eric@webkit.org>
1545 No review, build fix only.
1547 Fix uninitialized var warnings in release build.
1549 * JavaScriptCore.xcodeproj/project.pbxproj:
1550 * pcre/pcre_compile.cpp:
1553 2007-11-30 Darin Adler <darin@apple.com>
1555 Reviewed by Adam Roben.
1557 - fix http://bugs.webkit.org/show_bug.cgi?id=16207
1558 JavaScript regular expressions should match UTF-16 code units rather than characters
1560 SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.
1562 Test: fast/js/regexp-non-bmp.html
1564 Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.
1566 * pcre/pcre_compile.cpp:
1567 (compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
1568 them with simple pointer dereferences in some cases, and no code at all in others.
1569 (calculateCompiledPatternLengthAndFlags): Ditto.
1571 * pcre/pcre_exec.cpp:
1572 (match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
1573 Removed calls to the UTF-16 character accessor functions, replacing them with simple
1574 pointer dereferences in some cases, and no code at all in others. Also removed some
1575 explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
1576 in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
1577 end_subject in because it is already done outside the loop.
1580 * pcre/pcre_internal.h: Removed all the UTF-16 helper functions.
1582 2007-11-30 Eric Seidel <eric@webkit.org>
1586 PCRE crashes under GuardMalloc
1587 http://bugs.webkit.org/show_bug.cgi?id=16127
1588 check against patternEnd to make sure we don't walk off the end of the string
1590 * pcre/pcre_compile.cpp:
1592 (calculateCompiledPatternLengthAndFlags):
1594 2007-11-30 Eric Seidel <eric@webkit.org>
1598 Fix layout test regressions caused by r28186
1599 http://bugs.webkit.org/show_bug.cgi?id=16195
1600 change first_byte and req_byte back to shorts instead of chars
1601 (I think PCRE stuffs information in the high bits)
1603 * pcre/pcre_internal.h:
1605 2007-11-29 Oliver Hunt <oliver@apple.com>
1607 Reviewed by Maciej and Darin.
1609 Make the JS collector work with multiple threads
1611 Under heavy contention it was possible the GC to suspend other
1612 threads inside the pthread spinlock, which could lead to the GC
1613 thread blocking on the pthread spinlock itself.
1615 We now determine and store each thread's stack base when it is
1616 registered, thus removing the need for any calls to pthread_get_stackaddr_np
1617 that needed the pthread spinlock.
1619 * kjs/collector.cpp:
1620 (KJS::Collector::Thread::Thread):
1621 (KJS::Collector::registerThread):
1622 (KJS::Collector::markOtherThreadConservatively):
1624 2007-11-29 Adam Roben <aroben@apple.com>
1628 Removed some unreachable code (ironically, the code was some
1629 ASSERT_NOT_REACHED()s).
1631 * pcre/pcre_compile.cpp:
1633 * pcre/pcre_exec.cpp:
1636 2007-11-29 Eric Seidel <eric@webkit.org>
1638 Reviewed by Mark Rowe.
1640 Fix for --guard crash of fast/js/regexp-charclass-crash introduced by r28151.
1642 * pcre/pcre_compile.cpp:
1645 2007-11-28 Mark Rowe <mrowe@apple.com>
1647 Gtk build fix. Rubber-stamped by Eric.
1649 * pcre/pcre_exec.cpp:
1650 (match): Add braces around the body of the case statement to prevent
1651 wanings about jumps across the initialization of a variable.
1653 2007-11-29 Eric Seidel <eric@webkit.org>
1655 Reviewed by Mark Rowe.
1657 Attempt to fix non-mac builds after PCRE cleanup.
1659 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1660 * JavaScriptCoreSources.bkl:
1663 2007-11-28 Eric Seidel <eric@webkit.org>
1667 Centralize code for subjectPtr adjustments using inlines, only ever check for a single
1668 trailing surrogate (as UTF16 only allows one), possibly fix PCRE bugs involving char
1669 classes and garbled UTF16 strings.
1671 * pcre/pcre_exec.cpp:
1674 * pcre/pcre_internal.h:
1676 (movePtrToPreviousChar):
1677 (movePtrToNextChar):
1678 (movePtrToStartOfCurrentChar):
1680 2007-11-28 Eric Seidel <eric@webkit.org>
1684 change getChar* functions to return result and push 'c' into local scopes for clarity
1686 * pcre/pcre_compile.cpp:
1688 (calculateCompiledPatternLengthAndFlags):
1689 * pcre/pcre_exec.cpp:
1691 * pcre/pcre_internal.h:
1693 (getCharAndAdvance):
1695 (getCharAndAdvanceIfSurrogate):
1697 2007-11-28 Eric Seidel <eric@webkit.org>
1703 * pcre/pcre_exec.cpp:
1706 2007-11-26 Eric Seidel <eric@webkit.org>
1710 Further cleanups to calculateCompiledPatternLengthAndFlags
1712 * pcre/pcre_compile.cpp:
1713 (calculateCompiledPatternLengthAndFlags):
1714 * pcre/pcre_internal.h:
1716 2007-11-26 Eric Seidel <eric@webkit.org>
1720 Give consistent naming to the RegExp options/compile flags
1722 * pcre/pcre_compile.cpp:
1725 (find_firstassertedchar):
1726 (printCompiledRegExp):
1728 * pcre/pcre_exec.cpp:
1730 * pcre/pcre_internal.h:
1732 2007-11-26 Eric Seidel <eric@webkit.org>
1736 Pull first_byte and req_byte optimizations out into separate static funtions, SunSpider reported this as a win.
1738 * pcre/pcre_exec.cpp:
1739 (tryFirstByteOptimization):
1740 (tryRequiredByteOptimization):
1742 * pcre/pcre_internal.h:
1744 2007-11-26 Eric Seidel <eric@webkit.org>
1748 give PCRE_MULTILINE a better name: OptionMatchAcrossMultipleLines
1750 * pcre/pcre_compile.cpp:
1753 (printCompiledRegExp):
1755 * pcre/pcre_exec.cpp:
1757 * pcre/pcre_internal.h:
1759 2007-11-26 Eric Seidel <eric@webkit.org>
1763 Deprecate jsRegExpExecute's offset-vector fallback code
1765 * pcre/pcre_exec.cpp:
1768 2007-11-26 Eric Seidel <eric@webkit.org>
1772 Make cur_is_word and prev_is_word locals, and change OP_ANY to OP_ANY_CHAR for clarity
1774 * pcre/pcre_compile.cpp:
1777 (canApplyFirstCharOptimization):
1778 * pcre/pcre_exec.cpp:
1780 * pcre/pcre_internal.h:
1782 2007-11-26 Eric Seidel <eric@webkit.org>
1784 Reviewed by Mitz & Maciej.
1786 Change _NC operators to use _IGNORING_CASE for clarity
1788 * pcre/pcre_compile.cpp:
1791 (find_firstassertedchar):
1792 * pcre/pcre_exec.cpp:
1794 * pcre/pcre_internal.h:
1796 2007-11-26 Eric Seidel <eric@webkit.org>
1800 Remove branch from return
1802 * pcre/pcre_compile.cpp:
1804 * pcre/pcre_exec.cpp:
1807 2007-11-26 Eric Seidel <eric@webkit.org>
1811 Add repeatInformationFromInstructionOffset inline
1813 * pcre/pcre_exec.cpp:
1814 (repeatInformationFromInstructionOffset):
1817 2007-11-26 Eric Seidel <eric@webkit.org>
1821 Remove no longer used error code JSRegExpErrorMatchLimit
1824 (KJS::RegExp::match):
1826 * pcre/pcre_internal.h:
1828 2007-11-26 Eric Seidel <eric@webkit.org>
1832 Make i locally scoped for better code clarity
1834 * pcre/pcre_exec.cpp:
1837 2007-11-26 Eric Seidel <eric@webkit.org>
1841 Give subjectPtr and instructionPtr sane names, reduce size of MatchFrame for a 0.2% speedup.
1843 * pcre/pcre_compile.cpp:
1845 (calculateCompiledPatternLengthAndFlags):
1846 * pcre/pcre_exec.cpp:
1848 (MatchStack::pushNewFrame):
1849 (getUTF8CharAndIncrementLength):
1851 * pcre/pcre_internal.h:
1853 (getCharAndAdvance):
1855 (getCharAndAdvanceIfSurrogate):
1856 * pcre/pcre_xclass.cpp:
1857 (getUTF8CharAndAdvancePointer):
1859 2007-11-26 Eric Seidel <eric@webkit.org>
1863 Small speedup (0.7%) by simplifying canUseStackBufferForNextFrame() check
1865 * pcre/pcre_exec.cpp:
1866 (MatchStack::MatchStack):
1867 (MatchStack::popCurrentFrame):
1869 2007-11-25 Eric Seidel <eric@webkit.org>
1873 Lower MATCH_LIMIT_RECURSION to more sane levels to prevent hangs on run-javascriptcore-tests
1875 * pcre/pcre_internal.h:
1877 2007-11-25 Eric Seidel <eric@webkit.org>
1881 Remove match_is_group variable for another 5% speedup
1883 * pcre/pcre_compile.cpp:
1884 * pcre/pcre_exec.cpp:
1888 2007-11-28 Eric Seidel <eric@webkit.org>
1892 Abstract frame variables into locals and args
1894 * pcre/pcre_compile.cpp:
1896 * pcre/pcre_exec.cpp:
1898 * pcre/pcre_internal.h:
1900 2007-11-28 Eric Seidel <eric@webkit.org>
1904 Section off MatchData arguments into args struct
1906 * pcre/pcre_exec.cpp:
1907 (MatchStack::pushNewFrame):
1910 2007-11-24 Eric Seidel <eric@webkit.org>
1914 Remove redundant eptrblock struct
1916 * pcre/pcre_exec.cpp:
1917 (MatchStack::pushNewFrame):
1920 2007-11-24 Eric Seidel <eric@webkit.org>
1924 Remove redundant match_call_count and move recursion check out of super-hot code path
1925 SunSpider says this is at least an 8% speedup for regexp.
1927 * pcre/pcre_exec.cpp:
1928 (MatchStack::MatchStack):
1929 (MatchStack::pushNewFrame):
1930 (MatchStack::popCurrentFrame):
1931 (MatchStack::popAllFrames):
1934 * pcre/pcre_internal.h:
1936 2007-11-24 Eric Seidel <eric@webkit.org>
1940 Get rid of GETCHAR* macros, replacing them with better named inlines
1942 * pcre/pcre_compile.cpp:
1944 (calculateCompiledPatternLengthAndFlags):
1945 * pcre/pcre_exec.cpp:
1947 * pcre/pcre_internal.h:
1948 (getCharAndAdvance):
1950 (getCharAndAdvanceIfSurrogate):
1952 2007-11-24 Eric Seidel <eric@webkit.org>
1956 Further cleanup GET/PUT inlines
1958 * pcre/pcre_internal.h:
1959 (putOpcodeValueAtOffset):
1960 (getOpcodeValueAtOffset):
1961 (putOpcodeValueAtOffsetAndAdvance):
1962 (put2ByteOpcodeValueAtOffset):
1963 (get2ByteOpcodeValueAtOffset):
1964 (put2ByteOpcodeValueAtOffsetAndAdvance):
1966 2007-11-24 Eric Seidel <eric@webkit.org>
1970 Give GET, PUT better names, and add (poor) moveOpcodePtrPastAnyAlternateBranches
1972 * pcre/pcre_compile.cpp:
1973 (firstSignificantOpCodeSkippingAssertions):
1979 (canApplyFirstCharOptimization):
1980 (find_firstassertedchar):
1981 * pcre/pcre_exec.cpp:
1983 * pcre/pcre_internal.h:
1984 (putOpcodeValueAtOffset):
1985 (getOpcodeValueAtOffset):
1986 (putOpcodeValueAtOffsetAndAdvance):
1987 (put2ByteOpcodeValueAtOffset):
1988 (get2ByteOpcodeValueAtOffset):
1989 (moveOpcodePtrPastAnyAlternateBranches):
1990 * pcre/pcre_ucp_searchfuncs.cpp:
1991 (_pcre_ucp_othercase):
1993 2007-11-24 Eric Seidel <eric@webkit.org>
1997 Add inlines for toLowerCase, isWordChar, isSpaceChar for further regexp speedup
1999 * pcre/pcre_compile.cpp:
2002 * pcre/pcre_exec.cpp:
2005 * pcre/pcre_internal.h:
2008 (classBitmapForChar):
2012 (CompileData::CompileData):
2013 * pcre/pcre_xclass.cpp:
2016 2007-11-24 Eric Seidel <eric@webkit.org>
2020 cleanup _pcre_ucp_othercase
2022 * pcre/pcre_ucp_searchfuncs.cpp:
2023 (_pcre_ucp_othercase):
2025 2007-11-24 Eric Seidel <eric@webkit.org>
2029 Use better variable names for case ignoring options
2031 * pcre/pcre_compile.cpp:
2033 (find_firstassertedchar):
2034 (printCompiledRegExp):
2036 * pcre/pcre_exec.cpp:
2040 * pcre/pcre_internal.h:
2042 2007-11-24 Eric Seidel <eric@webkit.org>
2046 split first_significant_code into two simpler functions
2048 * pcre/pcre_compile.cpp:
2049 (firstSignificantOpCode):
2050 (firstSignificantOpCodeSkippingAssertions):
2052 (canApplyFirstCharOptimization):
2053 (find_firstassertedchar):
2055 2007-11-24 Eric Seidel <eric@webkit.org>
2059 clean up is_counted_repeat
2061 * pcre/pcre_compile.cpp:
2062 (is_counted_repeat):
2064 2007-11-24 Eric Seidel <eric@webkit.org>
2068 clean up check_escape
2070 * pcre/pcre_compile.cpp:
2073 2007-11-24 Eric Seidel <eric@webkit.org>
2077 Reformat find_fixedlength
2079 * pcre/pcre_compile.cpp:
2082 2007-11-24 Eric Seidel <eric@webkit.org>
2086 reformat is_anchored
2088 * pcre/pcre_compile.cpp:
2091 2007-11-24 Eric Seidel <eric@webkit.org>
2095 Remove unused function could_be_empty_branch
2097 * pcre/pcre_compile.cpp:
2098 (first_significant_code):
2101 (canApplyFirstCharOptimization):
2103 2007-11-24 Eric Seidel <eric@webkit.org>
2107 Pass around MatchData objects by reference
2109 * pcre/pcre_exec.cpp:
2115 2007-11-24 Eric Seidel <eric@webkit.org>
2119 give PCRE_STARTLINE a better name and rename match_data to MatchData
2121 * pcre/pcre_compile.cpp:
2123 (canApplyFirstCharOptimization):
2124 (find_firstassertedchar):
2125 (printCompiledRegExp):
2127 * pcre/pcre_exec.cpp:
2130 * pcre/pcre_internal.h:
2132 2007-11-24 Eric Seidel <eric@webkit.org>
2136 Clean up find_firstassertedchar
2138 * pcre/pcre_compile.cpp:
2139 (get_othercase_range):
2140 (find_firstassertedchar):
2141 (calculateCompiledPatternLengthAndFlags):
2143 2007-11-24 Eric Seidel <eric@webkit.org>
2145 Reviewed by Tim Hatcher.
2147 Pass around CompileData& instead of CompileData*
2149 * pcre/pcre_compile.cpp:
2153 2007-11-24 Eric Seidel <eric@webkit.org>
2157 Clean up compile_branch, move _pcre_ord2utf8, and rename CompileData
2159 * JavaScriptCore.xcodeproj/project.pbxproj:
2160 * pcre/pcre_compile.cpp:
2162 (calculateCompiledPatternLengthAndFlags):
2164 * pcre/pcre_internal.h:
2165 * pcre/pcre_ord2utf8.cpp: Removed.
2167 2007-11-24 Eric Seidel <eric@webkit.org>
2171 removing more macros
2173 * pcre/pcre_compile.cpp:
2174 (could_be_empty_branch):
2176 (calculateCompiledPatternLengthAndFlags):
2177 * pcre/pcre_exec.cpp:
2180 * pcre/pcre_internal.h:
2181 * pcre/pcre_xclass.cpp:
2183 2007-11-24 Eric Seidel <eric@webkit.org>
2187 clean up formating in compile_branch
2189 * pcre/pcre_compile.cpp:
2192 2007-11-24 Eric Seidel <eric@webkit.org>
2196 Fix spacing for read_repeat_counts
2198 * pcre/pcre_compile.cpp:
2199 (read_repeat_counts):
2201 2007-11-24 Eric Seidel <eric@webkit.org>
2205 Get rid of PCRE custom char types
2207 * pcre/pcre_compile.cpp:
2212 (calculateCompiledPatternLengthAndFlags):
2214 * pcre/pcre_exec.cpp:
2218 * pcre/pcre_internal.h:
2220 2007-11-24 Eric Seidel <eric@webkit.org>
2224 reformat get_othercase_range
2226 * pcre/pcre_compile.cpp:
2227 (get_othercase_range):
2229 2007-11-24 Eric Seidel <eric@webkit.org>
2233 Remove register keyword and more cleanup
2235 * pcre/pcre_compile.cpp:
2240 (find_firstassertedchar):
2241 (calculateCompiledPatternLengthAndFlags):
2243 * pcre/pcre_exec.cpp:
2244 (MatchStack::canUseStackBufferForNextFrame):
2245 (MatchStack::allocateNextFrame):
2246 (MatchStack::pushNewFrame):
2247 (MatchStack::frameIsStackAllocated):
2248 (MatchStack::popCurrentFrame):
2249 (MatchStack::unrollAnyHeapAllocatedFrames):
2250 (getUTF8CharAndIncrementLength):
2253 * pcre/pcre_internal.h:
2255 (isLeadingSurrogate):
2256 (isTrailingSurrogate):
2257 (decodeSurrogatePair):
2259 * pcre/pcre_ord2utf8.cpp:
2261 * pcre/pcre_xclass.cpp:
2262 (getUTF8CharAndAdvancePointer):
2265 2007-11-24 Eric Seidel <eric@webkit.org>
2269 Clean up jsRegExpExecute
2271 * pcre/pcre_compile.cpp:
2274 * pcre/pcre_exec.cpp:
2276 * pcre/pcre_internal.h:
2278 2007-11-29 Oliver Hunt <oliver@apple.com>
2282 Merging updated system alloc and spinlock code from r38 of TCMalloc.
2284 This is needed as a precursor to the merge of TCMalloc proper.
2286 * wtf/FastMalloc.cpp:
2287 (WTF::TCMalloc_PageHeap::GrowHeap):
2289 (TCMalloc_SpinLock::TCMalloc_SpinLock):
2290 (TCMalloc_SpinLock::):
2291 (TCMalloc_SpinLock::Lock):
2292 (TCMalloc_SpinLock::Unlock):
2293 (TCMalloc_SpinLock::IsHeld):
2294 * wtf/TCSystemAlloc.cpp:
2299 (TCMalloc_SystemAlloc):
2300 * wtf/TCSystemAlloc.h:
2302 2007-11-28 Brady Eidson <beidson@apple.com>
2306 Add copyKeysToVector utility, mirroring copyValuesToVector
2307 Also change the copyValuesToVector implementation to be a little more attractive
2310 (WTF::copyKeysToVector):
2311 (WTF::copyValuesToVector):
2313 2007-11-27 Alp Toker <alp@atoker.com>
2315 Reviewed by Mark Rowe.
2317 Add a list of public JavaScriptCore headers for installation.
2319 This follows the convention used for the Qt and GTK+ header lists.
2321 * headers.pri: Added.
2323 2007-11-27 Alp Toker <alp@atoker.com>
2325 Prospective MSVC build fix.
2327 Roll back dllexport/dllimport support for now.
2331 2007-11-27 Alp Toker <alp@atoker.com>
2335 http://bugs.webkit.org/show_bug.cgi?id=15569
2336 [gtk] GTK JavaScriptCore needs to export symbols for JSC API and WTF
2338 Introduce JS_EXPORT to mark symbols to be exported as public API.
2340 Export all public symbols in the JavaScriptCore C API.
2342 This matches conventions for exporting symbols set by the CF and CG
2346 * API/JSContextRef.h:
2347 * API/JSObjectRef.h:
2348 * API/JSStringRef.h:
2349 * API/JSStringRefBSTR.h:
2350 * API/JSStringRefCF.h:
2353 2007-11-27 Anders Carlsson <andersca@apple.com>
2357 Make PropertyNameArray and ScopeChain COMEnumVariant friendly.
2359 * kjs/PropertyNameArray.cpp:
2360 (KJS::PropertyNameArray::swap):
2361 Implement PropertyNameArray::swap.
2363 * kjs/PropertyNameArray.h:
2364 Add ValueType typedef. Replace PropertyNameArrayIterator with
2365 PropertyNameArray::const_iterator.
2368 (KJS::ForInNode::execute):
2369 * kjs/scope_chain.cpp:
2370 (KJS::ScopeChain::print):
2371 Update for changes to PropertyNameArray.
2373 * kjs/scope_chain.h:
2374 Add const_iterator and ValueType typedef.
2376 2007-11-27 Anders Carlsson <andersca@apple.com>
2380 Add a ValueType typedef.
2384 2007-11-26 Darin Adler <darin@apple.com>
2388 - fix http://bugs.webkit.org/show_bug.cgi?id=16096
2389 REGRESSION (r26653-r26699): Plaxo.com addressbook does not load in webkit nightlies
2391 Test: fast/js/regexp-overflow.html
2393 * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags):
2394 Removed a stray "ptr++" that I added by accident when merging the
2395 changes between PCRE 6.4 and 6.5.
2397 2007-11-26 Geoffrey Garen <ggaren@apple.com>
2399 Reviewed by Kevin McCullough.
2401 Fixed <rdar://problem/5597937> REGRESSION (r27126): Drosera does not
2402 show variables (can't enumerate ActivationImp properties)
2404 Implemented a custom ActivationImp::getPropertyNames, since
2405 ActivationImp now uses a custom property storage mechanism for local
2409 (KJS::ActivationImp::getPropertyNames):
2412 2007-11-26 Alp Toker <alp@atoker.com>
2414 GTK+/Qt/Wx build fix for breakage introduced in r28039.
2416 * ForwardingHeaders/JavaScriptCore/JSRetainPtr.h: Added.
2418 2007-11-24 Laszlo Gombos <laszlo.gombos@gmail.com>
2420 Reviewed by Maciej Stachowiak.
2422 Fix minor compiler warning (GCC 4.1.3)
2424 * pcre/pcre_internal.h:
2425 * pcre/pcre_ucp_searchfuncs.cpp:
2426 (_pcre_ucp_othercase):
2428 2007-11-25 Mark Rowe <mrowe@apple.com>
2430 Reviewed by Dan Bernstein.
2432 Fix http://bugs.webkit.org/show_bug.cgi?id=16129
2433 Bug 16129: REGRESSION (r27761-r27811): malloc error while visiting http://mysit.es (crashes release build)
2435 * pcre/pcre_compile.cpp: Change errorcode to be passed by reference so that any error code is propagated
2436 to our caller like they expect.
2438 2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
2440 MSVC7 build fix. (rand_s doesn't exist there)
2442 Reviewed by Adam Roben.
2447 2007-11-23 Kevin Ollivier <kevino@theolliviers.com>
2449 wx build fix. Move WX_PYTHON logic into project build settings,
2450 add WebKitLibraries dirs on Win, and explicitly include JSCore
2451 headers in testkjs rather than getting them from a template.
2452 (Include dir order of JSCore/WTF and ICU headers is important due
2453 to wtf/unicode/utf8.h.)
2457 2007-11-23 Simon Hausmann <hausmann@webkit.org>
2459 Reviewed by George Staikos <staikos@kde.org>.
2461 Fix make (dist)clean on Windows.
2463 OBJECTS_DIR_WTR does not exist anymore, use GENERATED_SOURCES_DIR.
2466 * JavaScriptCore.pri:
2469 2007-11-22 Simon Hausmann <hausmann@kde.org>
2473 Make the directory of where to put the generated sources configurable through the GENERATED_SOURCE_DIR variable
2475 * JavaScriptCore.pri:
2478 2007-11-22 Simon Hausmann <hausmann@kde.org>
2482 Centralize the setup for all the extra compilers in a addExtraCompiler function.
2484 This allows adding a "generated_files" target that builds all generated files using "make generated_files".
2485 For the build inside Qt we do not generate actual rules for the extra compilers but instead
2486 do the variable substitution of compiler.output manually and add the generated sources to SOURCES.
2488 * JavaScriptCore.pri:
2491 2007-11-20 Mark Rowe <mrowe@apple.com>
2493 Reviewed by Tim Hatcher.
2495 <rdar://problem/5602936> Need to resolve new GCC 4.2 warnings
2497 Fix all warnings emitted by GCC 4.2 when building JavaScriptCore. This allows builds with
2498 -Werror to succeed. At present they will crash when executed due to code that is not safe
2499 under strict aliasing (<rdar://problem/5536806>).
2501 * Configurations/Base.xcconfig: Remove the -Wno-long-double flag.
2502 * kjs/date_object.cpp:
2503 (KJS::formatTime): Test whether the stack-allocated string is empty rather than at a non-null address.
2505 (Bigint::): Tweak formatting to silence warnings.
2506 * pcre/pcre_exec.cpp:
2507 (match): Tweak formatting to silence warnings
2508 * wtf/Assertions.cpp: Add printf format attribute to functions that warrant it.
2509 * wtf/Assertions.h: Ditto.
2511 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
2513 wx port build fix (wx headers include ctype functions).
2517 2007-11-19 Kevin Ollivier <kevino@theolliviers.com>
2519 Remove outdated and unused Windows port files.
2521 Reviewed by Adam Roben.
2523 * Makefile.vc: Removed.
2524 * README-Win32.txt: Removed.
2526 2007-11-18 Eric Seidel <eric@webkit.org>
2530 * tests/mozilla/jsDriver.pl: exit non-0 when user aborts test run
2532 2007-11-17 Mark Rowe <mrowe@apple.com>
2534 Reviewed by Darin Adler.
2536 Fix: <rdar://problem/5607032> REGRESSION: testapi exits with assertion failure in debug build
2537 <rdar://problem/5440659> JSGlobalContextCreate throws away globalObjectClass's prototype
2538 http://bugs.webkit.org/show_bug.cgi?id=16033
2540 Split Interpreter's initialization into two distinct steps: the creation of the global prototypes
2541 and constructors, and storing them on the global object. This allows JSClassRef's passed to
2542 JSGlobalContextCreate to be instantiated with the correct prototype.
2544 * API/JSCallbackObject.cpp: Assert at compile-time that the custom global object will fit in a collector cell.
2545 * API/JSCallbackObject.h:
2546 * API/JSCallbackObjectFunctions.h:
2547 (KJS::::JSCallbackObject):
2549 * API/JSContextRef.cpp:
2550 (JSGlobalContextCreate): Construct and set the interpreter's global object separately. When globalObjectClass
2551 is passed we need to set the interpreter's global object before doing the JSCallbackObject's initialization to
2552 prevent any JSObjectInitializeCallback's being invoked before a global object is set.
2554 (globalObject_initialize): Test the object passed in is correct and that it has the expected global properties.
2558 * API/testapi.js: Test that any static properties exposed by the global object's custom class are found.
2559 * JavaScriptCore.exp:
2560 * bindings/testbindings.cpp:
2561 (main): Update for changes in Interpreter method signatures.
2562 * bindings/testbindings.mm:
2564 * kjs/ExecState.cpp:
2565 (KJS::ExecState::ExecState):
2566 (KJS::ExecState::mark):
2567 (KJS::ExecState::setGlobalObject):
2568 * kjs/ExecState.h: Rename scope to m_scopeChain.
2569 * kjs/interpreter.cpp:
2570 (KJS::Interpreter::Interpreter):
2571 (KJS::Interpreter::init):
2572 (KJS::Interpreter::globalObject):
2573 (KJS::Interpreter::setGlobalObject):
2574 (KJS::Interpreter::resetGlobalObjectProperties):
2575 (KJS::Interpreter::createObjectsForGlobalObjectProperties):
2576 (KJS::Interpreter::setGlobalObjectProperties): Switch to using putDirect to ensure that the global object's put method
2577 cannot interfere with setting of the global properties. This prevents a user-written JSClassRef from attempting to
2578 call back into JavaScript from the initialization of the global object's members.
2579 * kjs/interpreter.h:
2581 (setupInterpreter): Update for changes in Interpreter method signatures.
2583 2007-11-17 Mark Rowe <mrowe@apple.com>
2585 Reviewed by Sam Weinig.
2587 Prevent testapi from reporting false leaks. Clear out local variables pointing at
2588 JSObjectRefs to allow their values to be collected.
2593 2007-11-17 Mark Rowe <mrowe@apple.com>
2595 Reviewed by Sam Weinig.
2597 Prevent testapi from crashing if testapi.js can not be found by nil-checking the result of createStringWithContentsOfFile.
2602 2007-11-17 Alp Toker <alp@atoker.com>
2606 http://bugs.webkit.org/show_bug.cgi?id=16032
2607 JS minidom is not portable
2609 Use a plain UTF-8 string instead of a CFString.
2611 Print to stdout, not stderr like CFShow() would have done, since that
2612 behaviour seems unintentional.
2617 2007-11-17 Steve Falkenburg <sfalken@apple.com>
2621 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2623 2007-11-16 Mark Rowe <mrowe@apple.com>
2628 (KJS::Lexer::record8):
2630 2007-11-16 Mark Rowe <mrowe@apple.com>
2634 Replace strings, identifier, buffer8 and buffer16 members of Lexer with vectors.
2635 SunSpider claims this is a 0.7% speedup.
2638 (KJS::Lexer::Lexer):
2640 (KJS::Lexer::record8):
2641 (KJS::Lexer::record16):
2642 (KJS::Lexer::scanRegExp):
2643 (KJS::Lexer::clear):
2644 (KJS::Lexer::makeIdentifier):
2645 (KJS::Lexer::makeUString):
2648 (KJS::UString::UString): Add a convenience constructor that takes a const Vector<UChar>&.
2651 2007-11-16 Adam Roben <aroben@apple.com>
2655 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Add a new include path
2656 and ignore the int -> bool conversion warning.
2658 2007-11-16 Alexey Proskuryakov <ap@webkit.org>
2660 Fix Windows debug build.
2661 Rubber-stamped by Eric
2663 * pcre/pcre_exec.cpp: (match): Removed ASSERT_NOT_REACHED assertions that were making MSVC
2664 complain about unreachable code.
2666 2007-11-15 Mark Rowe <mrowe@apple.com>
2672 2007-11-15 Mark Rowe <mrowe@apple.com>
2674 Mac build and header search path sanity fix.
2676 Reviewed by Sam Weinig and Tim Hatcher.
2678 Move base setting for HEADER_SEARCH_PATHS into Base.xcconfig, and extend
2679 it in JavaScriptCore.xcconfig. This removes the need to override it on a
2680 per-target basis inside the .xcodeproj file.
2682 * Configurations/Base.xcconfig:
2683 * Configurations/JavaScriptCore.xcconfig:
2684 * JavaScriptCore.xcodeproj/project.pbxproj:
2686 2007-11-15 Mark Rowe <mrowe@apple.com>
2692 2007-11-15 Geoffrey Garen <ggaren@apple.com>
2694 Reviewed by Eric Seidel.
2696 Another round of grammar / parsing cleanup.
2698 1. Created distinct parser calls for parsing function bodies vs
2699 programs. This will help later with optimizing global variable access.
2701 2. Turned Parser into a singleton. Cleaned up Lexer's singleton
2704 3. Modified Lexer to free a little more memory when done lexing. (Added
2705 FIXMEs for similar issues that I didn't fix.)
2707 4. Changed Lexer::makeIdentifier and Lexer::makeUString to start
2708 respecting the arguments passed to them. (No behavior change, but this
2709 problem could have caused serious problems for an unsuspecting user of
2712 5. Removed KJS_DEBUG_MEM because it was bit-rotted.
2714 6. Removed Parser::prettyPrint because the same work was simpler to do
2719 "Parser::accept" => "Parser::didFinishParsing"
2720 "Parser::sid" => "Parser::m_sourceID"
2721 "Lexer::doneParsing" => "Lexer::clear"
2723 "lineno" => "lineNo"
2725 * JavaScriptCore.exp:
2727 (KJS::Parser::Parser):
2728 (KJS::Parser::parseProgram):
2729 (KJS::Parser::parseFunctionBody):
2730 (KJS::Parser::parse):
2731 (KJS::Parser::didFinishParsing):
2734 (KJS::Parser::sourceId):
2736 (KJS::GlobalFuncImp::callAsFunction):
2737 * kjs/function_object.cpp:
2738 (FunctionObjectImp::construct):
2740 * kjs/interpreter.cpp:
2741 (KJS::Interpreter::checkSyntax):
2742 (KJS::Interpreter::evaluate):
2743 * kjs/interpreter.h:
2747 (KJS::Lexer::Lexer):
2748 (KJS::Lexer::~Lexer):
2749 (KJS::Lexer::scanRegExp):
2750 (KJS::Lexer::doneParsing):
2751 (KJS::Lexer::makeIdentifier):
2752 (KJS::Lexer::makeUString):
2754 (KJS::Lexer::pattern):
2755 (KJS::Lexer::flags):
2756 (KJS::Lexer::sawError):
2759 (KJS::FunctionBodyNode::FunctionBodyNode):
2762 (prettyPrintScript):
2767 2007-11-15 Oliver Hunt <oliver@apple.com>
2771 <rdar://problem/5601548> REGRESSION: All SourceElements and their children leak after a syntax error
2773 Add a stub node to maintain the Vector of SourceElements until assignment.
2777 (KJS::SourceElementsStub::SourceElementsStub):
2778 (KJS::SourceElementsStub::append):
2779 (KJS::SourceElementsStub::release):
2780 (KJS::SourceElementsStub::):
2781 (KJS::SourceElementsStub::precedence):
2783 2007-11-15 Eric Seidel <eric@webkit.org>
2787 Abstract most of RMATCH into MatchStack functions.
2789 SunSpider claims this, combined with the last 2 patches was a 1% speedup, 10% for dna-regexp.
2791 * pcre/pcre_exec.cpp:
2792 (MatchStack::canUseStackBufferForNextFrame):
2793 (MatchStack::allocateNextFrame):
2794 (MatchStack::pushNewFrame):
2795 (MatchStack::frameIsStackAllocated):
2796 (MatchStack::popCurrentFrame):
2797 (MatchStack::unrollAnyHeapAllocatedFrames):
2800 2007-11-15 Eric Seidel <eric@webkit.org>
2804 Remove RETURN_ERROR, add MatchStack
2806 * pcre/pcre_exec.cpp:
2807 (MatchStack::MatchStack):
2808 (MatchStack::unrollAnyHeapAllocatedFrames):
2812 2007-11-15 Eric Seidel <eric@webkit.org>
2816 Clean up match function to match WebKit style
2818 * JavaScriptCore.xcodeproj/project.pbxproj:
2819 * pcre/pcre_exec.cpp:
2822 2007-11-15 Steve Falkenburg <sfalken@apple.com>
2826 * JavaScriptCore.vcproj/JavaScriptCore.make:
2828 2007-11-14 Alexey Proskuryakov <ap@webkit.org>
2832 http://bugs.webkit.org/show_bug.cgi?id=15982
2833 Improve JSString UTF-8 decoding
2835 * API/JSStringRef.cpp:
2836 (JSStringCreateWithUTF8CString): Use strict decoding, return 0 on error.
2838 * wtf/unicode/UTF8.cpp:
2839 (WTF::Unicode::convertUTF16ToUTF8):
2840 (WTF::Unicode::convertUTF8ToUTF16):
2841 * wtf/unicode/UTF8.h:
2842 Made these function names start with a lower case letter.
2844 * kjs/ustring.cpp: (KJS::UString::UTF8String): Updated for the above renaming.
2846 * bindings/c/c_utility.cpp:
2847 (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback): Renamed to highlight the difference
2848 from convertUTF8ToUTF16 in wtf/unicode.
2849 (KJS::Bindings::convertNPStringToUTF16): Updated for the above renaming.
2850 (KJS::Bindings::identifierFromNPIdentifier): Ditto.
2851 * bindings/c/c_utility.h: Made convertUTF8ToUTF16WithLatin1Fallback() a file static.
2853 2007-11-14 Sam Weinig <sam@webkit.org>
2855 Rubber-stamped by Anders.
2857 Fix the Xcode project file after it was messed up in r27402.
2859 * JavaScriptCore.xcodeproj/project.pbxproj:
2861 2007-11-14 Eric Seidel <eric@webkit.org>
2865 More PCRE style cleanup.
2867 * pcre/pcre_compile.cpp:
2870 2007-11-14 Adam Roben <aroben@apple.com>
2872 Clean up the bison conflict checking script
2876 * DerivedSources.make:
2878 2007-11-14 Eric Seidel <eric@webkit.org>
2882 Another round of PCRE cleanups: inlines
2884 SunSpider claims that this, combined with my previous PCRE cleanup were a 0.7% speedup, go figure.
2886 * pcre/pcre_compile.cpp:
2888 * pcre/pcre_exec.cpp:
2891 * pcre/pcre_internal.h:
2898 2007-11-14 Eric Seidel <eric@webkit.org>
2902 Give PCRE a (small) bath.
2903 Fix some formating and break things off into separate functions
2904 http://bugs.webkit.org/show_bug.cgi?id=15993
2906 * pcre/pcre_compile.cpp:
2907 (calculateCompiledPatternLengthAndFlags):
2908 (printCompiledRegExp):
2911 * pcre/pcre_internal.h:
2912 (compile_data::compile_data):
2914 2007-11-14 Geoffrey Garen <ggaren@apple.com>
2916 Reviewed by Eric Seidel.
2918 Cleaned up the JavaScript grammar a bit.
2920 1. Changed BlockNode to always hold a child vector (which may be empty),
2921 eliminating a few NULL-check branches in the common execution case.
2923 2. Changed the Block production to correctly report its starting and
2924 ending line numbers to the debugger. (It used to report its ending line
2925 as its starting line.) Also, removed duplicate line-reporting code
2926 inside the BlockNode constructor.
2928 3. Moved curly braces up from FunctionBody production into parent
2929 productions. (I had to move the line number reporting code, too, since
2930 it depends on the location of the curly braces.) This matches the ECMA
2931 spec more closely, and makes some future changes I plan easier.
2933 4. Fixed statementList* convenience functions to deal appropriately with
2936 SunSpider reports a small and statistically insignificant speedup.
2940 (KJS::statementListPushFIFO):
2941 (KJS::statementListGetDeclarations):
2942 (KJS::statementListInitializeDeclarationStack):
2943 (KJS::statementListInitializeVariableAccessStack):
2944 (KJS::BlockNode::BlockNode):
2945 (KJS::BlockNode::optimizeVariableAccess):
2946 (KJS::BlockNode::getDeclarations):
2947 (KJS::BlockNode::execute):
2948 (KJS::FunctionBodyNode::initializeDeclarationStacks):
2949 (KJS::FunctionBodyNode::optimizeVariableAccess):
2951 2007-11-13 Anders Carlsson <andersca@apple.com>
2953 Add RefCounted.h (And remove Shared.h)
2955 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
2957 2007-11-13 Geoffrey Garen <ggaren@apple.com>
2963 2007-11-13 Geoffrey Garen <ggaren@apple.com>
2965 Reviewed by Anders Carlsson.
2967 Renamed Shared to RefCounted.
2970 * JavaScriptCore.xcodeproj/project.pbxproj:
2971 * kjs/interpreter.h:
2973 * wtf/RefCounted.h: Copied from JavaScriptCore/wtf/Shared.h.
2974 (WTF::RefCounted::RefCounted):
2975 * wtf/Shared.h: Removed.
2977 2007-11-13 Adam Roben <aroben@apple.com>
2983 * kjs/regexp.h: Added a missing #include.
2985 2007-11-13 Geoffrey Garen <ggaren@apple.com>
2987 Reviewed by Sam Weinig.
2989 Moved Shared.h into wtf so it could be used in more places. Deployed
2990 Shared in places where JSCore previously had hand-rolled ref-counting
2993 * API/JSClassRef.cpp:
2994 (OpaqueJSClass::OpaqueJSClass):
2996 * API/JSObjectRef.cpp:
2999 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3000 * JavaScriptCore.xcodeproj/project.pbxproj:
3001 * kjs/interpreter.cpp:
3002 (KJS::Interpreter::init):
3003 * kjs/interpreter.h:
3005 (KJS::RegExp::RegExp):
3007 * wtf/Shared.h: Copied from WebCore/platform/Shared.h.
3009 2007-11-13 Eric Seidel <eric@webkit.org>
3013 Add an ASSERT to getTruncatedInt32 to enforce proper usage.
3014 Best part about this patch? It doesn't break the web!
3016 * kjs/JSImmediate.h:
3017 (KJS::JSImmediate::getTruncatedInt32):
3018 (KJS::JSImmediate::toDouble):
3019 (KJS::JSImmediate::getUInt32):
3021 2007-11-13 Alexey Proskuryakov <ap@webkit.org>
3025 * bindings/c/c_utility.cpp:
3026 (KJS::Bindings::convertUTF8ToUTF16):
3028 (KJS::UString::UTF8String):
3029 * wtf/unicode/UTF8.cpp:
3030 (WTF::Unicode::ConvertUTF8ToUTF16):
3032 2007-11-13 Darin Adler <darin@apple.com>
3036 - fix http://bugs.webkit.org/show_bug.cgi?id=11231
3037 RegExp bug when handling newline characters
3038 and a number of other differences between PCRE behvior
3039 and JavaScript regular expressions:
3041 + single-digit sequences like \4 should be treated as octal
3042 character constants, unless there is a sufficient number
3043 of brackets for them to be treated as backreferences
3045 + \8 turns into the character "8", not a binary zero character
3046 followed by "8" (same for 9)
3048 + only the first 3 digits should be considered part of an
3049 octal character constant (the old behavior was to decode
3050 an arbitrarily long sequence and then mask with 0xFF)
3052 + if \x is followed by anything other than two valid hex digits,
3053 then it should simply be treated a the letter "x"; that includes
3054 not supporting the \x{41} syntax
3056 + if \u is followed by anything less than four valid hex digits,
3057 then it should simply be treated a the letter "u"
3059 + an extra "+" should be a syntax error, rather than being treated
3060 as the "possessive quantifier"
3062 + if a "]" character appears immediately after a "[" character that
3063 starts a character class, then that's an empty character class,
3064 rather than being the start of a character class that includes a
3067 + a "$" should not match a terminating newline; we could have gotten
3068 PCRE to handle this the way we wanted by passing an appropriate option
3070 Test: fast/js/regexp-no-extensions.html
3072 * pcre/pcre_compile.cpp:
3073 (check_escape): Check backreferences against bracount to catch both
3074 overflows and things that should be treated as octal. Rewrite octal
3075 loop to not go on indefinitely. Rewrite both hex loops to match and
3076 remove \x{} support.
3077 (compile_branch): Restructure loops so that we don't special-case a "]"
3078 at the beginning of a character class. Remove code that treated "+" as
3079 the possessive quantifier.
3080 (jsRegExpCompile): Change the "]" handling here too.
3082 * pcre/pcre_exec.cpp: (match): Changed CIRC to match the DOLL implementation.
3083 Changed DOLL to remove handling of "terminating newline", a Perl concept
3084 which we don't need.
3086 * tests/mozilla/expected.html: Two tests are fixed now:
3087 ecma_3/RegExp/regress-100199.js and ecma_3/RegExp/regress-188206.js.
3088 One test fails now: ecma_3/RegExp/perlstress-002.js -- our success before
3089 was due to a bug (we treated all 1-character numeric escapes as backreferences).
3090 The date tests also now both expect success -- whatever was making them fail
3091 before was probably due to the time being close to a DST shift; maybe we need
3092 to get rid of those tests.
3094 2007-11-13 Darin Adler <darin@apple.com>
3096 * kjs/JSImmediate.h: (KJS::JSImmediate::getTruncatedInt32):
3097 Remove too-strong assert that was firing constantly and preventing even basic
3098 web browsing from working in a debug build. This function is used in many
3099 cases where the immediate value is not a number; the assertion could perhaps
3100 be added back later with a bit of reorganization.
3102 2007-11-13 Alp Toker <alp@atoker.com>
3104 Build fix for breakage to non-Mac builds introduced in r27746.
3108 2007-11-13 Eric Seidel <eric@webkit.org>
3112 Clean up evaluateToBoolean functions to use inlines instead of copy/paste code
3114 * kjs/JSImmediate.h:
3116 (KJS::GreaterNode::inlineEvaluateToBoolean):
3117 (KJS::GreaterNode::evaluate):
3118 (KJS::LessEqNode::inlineEvaluateToBoolean):
3119 (KJS::LessEqNode::evaluate):
3120 (KJS::GreaterEqNode::inlineEvaluateToBoolean):
3121 (KJS::GreaterEqNode::evaluate):
3122 (KJS::InNode::evaluateToBoolean):
3123 (KJS::EqualNode::inlineEvaluateToBoolean):
3124 (KJS::EqualNode::evaluate):
3125 (KJS::NotEqualNode::inlineEvaluateToBoolean):
3126 (KJS::NotEqualNode::evaluate):
3127 (KJS::StrictEqualNode::inlineEvaluateToBoolean):
3128 (KJS::StrictEqualNode::evaluate):
3129 (KJS::NotStrictEqualNode::inlineEvaluateToBoolean):
3130 (KJS::NotStrictEqualNode::evaluate):
3133 2007-11-12 Geoffrey Garen <ggaren@apple.com>
3135 Reviewed by Sam Weinig.
3137 Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
3138 base64 spends 1.1% of total time checking for special Infinity case
3140 Use a fast character test instead of calling strncmp.
3142 1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
3143 Sharks reports only .1%. Who are you going to believe? Huh?
3146 (KJS::UString::toDouble):
3148 2007-11-12 Eric Seidel <eric@webkit.org>
3152 Add evaluateToInt32 and evaluateUInt32 methods and deploy them.
3153 Fix a few missing evaluateToBoolean methods
3154 Deploy all evaluateTo* functions to more nodes to avoid slowdowns
3155 http://bugs.webkit.org/show_bug.cgi?id=15950
3157 SunSpider claims this is at least a 1.4% speedup.
3159 * kjs/JSImmediate.h:
3160 (KJS::JSImmediate::getTruncatedInt32):
3161 (KJS::JSImmediate::toDouble):
3162 (KJS::JSImmediate::getUInt32):
3164 (KJS::ExpressionNode::evaluateToNumber):
3165 (KJS::ExpressionNode::evaluateToInt32):
3166 (KJS::ExpressionNode::evaluateToUInt32):
3167 (KJS::NumberNode::evaluateToInt32):
3168 (KJS::NumberNode::evaluateToUInt32):
3169 (KJS::ImmediateNumberNode::evaluateToInt32):
3170 (KJS::ImmediateNumberNode::evaluateToUInt32):
3171 (KJS::ResolveNode::evaluate):
3172 (KJS::ResolveNode::evaluateToNumber):
3173 (KJS::ResolveNode::evaluateToBoolean):
3174 (KJS::ResolveNode::evaluateToInt32):
3175 (KJS::ResolveNode::evaluateToUInt32):
3176 (KJS::LocalVarAccessNode::evaluateToInt32):
3177 (KJS::LocalVarAccessNode::evaluateToUInt32):
3178 (KJS::BracketAccessorNode::evaluateToNumber):
3179 (KJS::BracketAccessorNode::evaluateToBoolean):
3180 (KJS::BracketAccessorNode::evaluateToInt32):
3181 (KJS::BracketAccessorNode::evaluateToUInt32):
3182 (KJS::DotAccessorNode::inlineEvaluate):
3183 (KJS::DotAccessorNode::evaluate):
3184 (KJS::DotAccessorNode::evaluateToNumber):
3185 (KJS::DotAccessorNode::evaluateToBoolean):
3186 (KJS::DotAccessorNode::evaluateToInt32):
3187 (KJS::DotAccessorNode::evaluateToUInt32):
3188 (KJS::NewExprNode::inlineEvaluate):
3189 (KJS::NewExprNode::evaluate):
3190 (KJS::NewExprNode::evaluateToNumber):
3191 (KJS::NewExprNode::evaluateToBoolean):
3192 (KJS::NewExprNode::evaluateToInt32):
3193 (KJS::NewExprNode::evaluateToUInt32):
3194 (KJS::FunctionCallResolveNode::inlineEvaluate):
3195 (KJS::FunctionCallResolveNode::evaluate):
3196 (KJS::FunctionCallResolveNode::evaluateToNumber):
3197 (KJS::FunctionCallResolveNode::evaluateToBoolean):
3198 (KJS::FunctionCallResolveNode::evaluateToInt32):
3199 (KJS::FunctionCallResolveNode::evaluateToUInt32):
3200 (KJS::LocalVarFunctionCallNode::evaluate):
3201 (KJS::LocalVarFunctionCallNode::evaluateToNumber):
3202 (KJS::LocalVarFunctionCallNode::evaluateToBoolean):
3203 (KJS::LocalVarFunctionCallNode::evaluateToInt32):
3204 (KJS::LocalVarFunctionCallNode::evaluateToUInt32):
3205 (KJS::FunctionCallDotNode::evaluate):
3206 (KJS::FunctionCallDotNode::evaluateToNumber):
3207 (KJS::FunctionCallDotNode::evaluateToBoolean):
3208 (KJS::FunctionCallDotNode::evaluateToInt32):
3209 (KJS::FunctionCallDotNode::evaluateToUInt32):
3210 (KJS::PostDecLocalVarNode::inlineEvaluateToNumber):
3211 (KJS::PostDecLocalVarNode::evaluateToNumber):
3212 (KJS::PostDecLocalVarNode::evaluateToBoolean):
3213 (KJS::PostDecLocalVarNode::evaluateToInt32):
3214 (KJS::PostDecLocalVarNode::evaluateToUInt32):
3215 (KJS::typeStringForValue):
3216 (KJS::UnaryPlusNode::evaluate):
3217 (KJS::UnaryPlusNode::evaluateToBoolean):
3218 (KJS::UnaryPlusNode::evaluateToNumber):
3219 (KJS::UnaryPlusNode::evaluateToInt32):
3220 (KJS::BitwiseNotNode::inlineEvaluateToInt32):
3221 (KJS::BitwiseNotNode::evaluate):
3222 (KJS::BitwiseNotNode::evaluateToNumber):
3223 (KJS::BitwiseNotNode::evaluateToBoolean):
3224 (KJS::BitwiseNotNode::evaluateToInt32):
3225 (KJS::MultNode::evaluateToBoolean):
3226 (KJS::MultNode::evaluateToInt32):
3227 (KJS::MultNode::evaluateToUInt32):
3228 (KJS::DivNode::evaluateToInt32):
3229 (KJS::DivNode::evaluateToUInt32):
3230 (KJS::ModNode::evaluateToBoolean):
3231 (KJS::ModNode::evaluateToInt32):
3232 (KJS::ModNode::evaluateToUInt32):
3233 (KJS::AddNode::evaluateToNumber):
3234 (KJS::AddNode::evaluateToInt32):
3235 (KJS::AddNode::evaluateToUInt32):
3236 (KJS::AddNumbersNode::evaluateToInt32):
3237 (KJS::AddNumbersNode::evaluateToUInt32):
3238 (KJS::SubNode::evaluateToInt32):
3239 (KJS::SubNode::evaluateToUInt32):
3240 (KJS::LeftShiftNode::inlineEvaluateToInt32):
3241 (KJS::LeftShiftNode::evaluate):
3242 (KJS::LeftShiftNode::evaluateToNumber):
3243 (KJS::LeftShiftNode::evaluateToInt32):
3244 (KJS::RightShiftNode::inlineEvaluateToInt32):
3245 (KJS::RightShiftNode::evaluate):
3246 (KJS::RightShiftNode::evaluateToNumber):
3247 (KJS::RightShiftNode::evaluateToInt32):
3248 (KJS::UnsignedRightShiftNode::inlineEvaluateToUInt32):
3249 (KJS::UnsignedRightShiftNode::evaluate):
3250 (KJS::UnsignedRightShiftNode::evaluateToNumber):
3251 (KJS::UnsignedRightShiftNode::evaluateToInt32):
3252 (KJS::LessNode::inlineEvaluateToBoolean):
3253 (KJS::LessNode::evaluate):
3254 (KJS::LessNode::evaluateToBoolean):
3255 (KJS::LessNumbersNode::inlineEvaluateToBoolean):
3256 (KJS::LessNumbersNode::evaluate):
3257 (KJS::LessNumbersNode::evaluateToBoolean):
3258 (KJS::LessStringsNode::inlineEvaluateToBoolean):
3259 (KJS::LessStringsNode::evaluate):
3260 (KJS::BitAndNode::evaluate):
3261 (KJS::BitAndNode::inlineEvaluateToInt32):
3262 (KJS::BitAndNode::evaluateToNumber):
3263 (KJS::BitAndNode::evaluateToBoolean):
3264 (KJS::BitAndNode::evaluateToInt32):
3265 (KJS::BitXOrNode::inlineEvaluateToInt32):
3266 (KJS::BitXOrNode::evaluate):
3267 (KJS::BitXOrNode::evaluateToNumber):
3268 (KJS::BitXOrNode::evaluateToBoolean):
3269 (KJS::BitXOrNode::evaluateToInt32):
3270 (KJS::BitOrNode::inlineEvaluateToInt32):
3271 (KJS::BitOrNode::evaluate):
3272 (KJS::BitOrNode::evaluateToNumber):
3273 (KJS::BitOrNode::evaluateToBoolean):
3274 (KJS::BitOrNode::evaluateToInt32):
3275 (KJS::ConditionalNode::evaluateToNumber):
3276 (KJS::ConditionalNode::evaluateToInt32):
3277 (KJS::ConditionalNode::evaluateToUInt32):
3278 (KJS::valueForReadModifyAssignment):
3279 (KJS::AssignExprNode::evaluate):
3280 (KJS::AssignExprNode::evaluateToBoolean):
3281 (KJS::AssignExprNode::evaluateToNumber):
3282 (KJS::AssignExprNode::evaluateToInt32):
3283 (KJS::VarDeclNode::handleSlowCase):
3285 (KJS::FunctionCallResolveNode::precedence):
3286 (KJS::AddNode::precedence):
3288 (KJS::LessNumbersNode::):
3289 (KJS::LessStringsNode::):
3291 (KJS::JSValue::toInt32SlowCase):
3292 (KJS::JSValue::toUInt32SlowCase):
3294 (KJS::JSValue::asCell):
3295 (KJS::JSValue::toInt32):
3296 (KJS::JSValue::toUInt32):
3298 2007-11-12 Alexey Proskuryakov <ap@webkit.org>
3302 http://bugs.webkit.org/show_bug.cgi?id=15953
3303 Add UTF-8 encoding/decoding to WTF
3305 * kjs/ustring.h: Moved UTF8SequenceLength() and decodeUTF8Sequence() to wtf/unicode.
3306 * kjs/ustring.cpp: (KJS::UString::UTF8String): Changed this function to take a strict/lenient
3307 parameter. Callers are not interested in getting decoding results in strict mode, so
3308 this allows for bailing out as soon as an error is seen.
3311 (KJS::encode): Updated for new UString::UTF8String() signature.
3313 * API/JSStringRef.cpp:
3314 (JSStringCreateWithCharacters): Disambiguate UChar.
3315 (JSStringCreateWithUTF8CString): Actually use UTF-8 when creating the string!
3316 * bindings/c/c_utility.cpp: (KJS::Bindings::convertUTF8ToUTF16): Use ConvertUTF8ToUTF16().
3318 * wtf/unicode/UTF8.cpp: Added.
3319 (WTF::Unicode::inlineUTF8SequenceLengthNonASCII):
3320 (WTF::Unicode::inlineUTF8SequenceLength):
3321 (WTF::Unicode::UTF8SequenceLength):
3322 (WTF::Unicode::decodeUTF8Sequence):
3324 (WTF::Unicode::ConvertUTF16ToUTF8):
3325 (WTF::Unicode::isLegalUTF8):
3326 (WTF::Unicode::ConvertUTF8ToUTF16):
3327 * wtf/unicode/UTF8.h: Added.
3329 Some code moved from ustring.h, some adapted from unicode.org sources.
3331 * JavaScriptCore.exp:
3332 * JavaScriptCore.pri:
3333 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3334 * JavaScriptCore.xcodeproj/project.pbxproj:
3335 * JavaScriptCoreSources.bkl:
3338 2007-11-12 Josh Aas <joshmoz@gmail.com>
3342 - http://bugs.webkit.org/show_bug.cgi?id=15946
3343 add NPPValue NPPVpluginDrawingModel (Mozilla bug 403418 compat)
3347 2007-11-12 Darin Adler <darin@apple.com>
3351 - http://bugs.webkit.org/show_bug.cgi?id=15951
3352 REGRESSION: assertion failure in regexp match() when running JS tests
3354 Test: fast/js/regexp-many-brackets.html
3356 * pcre/pcre_exec.cpp: (match): Added back accidentally-removed case for
3357 the BRANUMBER opcode.
3359 2007-11-12 Darin Adler <darin@apple.com>
3363 - fix use of prefix and config.h, got rid of a few unneeded things in
3364 the PCRE code; no behavior changes
3366 * API/JSBase.cpp: Added include of config.h.
3367 * API/JSCallbackConstructor.cpp: Ditto.
3368 * API/JSCallbackFunction.cpp: Ditto.
3369 * API/JSCallbackObject.cpp: Ditto.
3370 * API/JSClassRef.cpp: Ditto.
3371 * API/JSContextRef.cpp: Ditto.
3372 * API/JSObjectRef.cpp: Ditto.
3373 * API/JSStringRef.cpp: Ditto.
3374 * API/JSValueRef.cpp: Ditto.
3376 * JavaScriptCorePrefix.h: Removed obsolete <ctype.h> workaround.
3377 Moved new/delete macros after includes, as they are in WebCore's prefix.
3380 * pcre/dftables.cpp: (main): Changed back to not use a separate maketables
3381 function. This is needed for PCRE, but not helpful for our use. Also changed
3382 the tables to all be 128 entries long instead of 256, since only the first
3385 * pcre/pcre_compile.cpp: Added include of config.h. Eliminated digitab,
3386 which was only being used to check hex digits. Changed all uses of TRUE and
3387 FALSE to use the C++ true and false instead.
3388 (check_escape): Just the TRUE/FALSE thing.
3389 (is_counted_repeat): Ditto.
3390 (could_be_empty_branch): Ditto.
3391 (get_othercase_range): Ditto.
3392 (compile_branch): Ditto.
3393 (compile_regex): Ditto.
3394 (is_anchored): Ditto.
3395 (is_startline): Ditto.
3396 (find_firstassertedchar): Ditto.
3397 (jsRegExpCompile): Ditto.
3399 * pcre/pcre_exec.cpp: Added include of config.h. Changed all uses of TRUE and
3400 FALSE to use the C++ true and false instead.
3401 (match_ref): Just the TRUE/FALSE thing.
3402 (match): Ditto. Removed some unneeded braces.
3403 (jsRegExpExecute): Just the TRUE/FALSE thing.
3405 * pcre/pcre_internal.h: Moved the constants needed by dftables.cpp to the top
3406 of the file instead of the bottom, so they can be used. Also changed the table
3407 sizes to 128 instead of 256. Removed macro definitions of FALSE and TRUE.
3408 Set array sizes for all the const arrays. Changed _pcre_utf8_table1_size to
3409 be a macro instead of a extern int.
3411 * pcre/pcre_maketables.cpp: Removed. It's all in dftables.cpp now.
3413 * pcre/pcre_tables.cpp: Made table sizes explicit.
3415 * pcre/pcre_xclass.cpp: Just the TRUE/FALSE thing.
3417 2007-11-12 Adam Roben <aroben@apple.com>
3421 * wtf/FastMalloc.h: Add missing using statement.
3423 2007-11-11 Oliver Hunt <oliver@apple.com>
3427 Add special fastZeroedMalloc function to replace a
3428 number of fastCalloc calls where one argument was 1.
3430 This results in a 0.4% progression in SunSpider, more
3431 than making up for the earlier regression caused by
3432 additional overflow checks.
3434 * JavaScriptCore.exp:
3435 * kjs/array_instance.cpp:
3436 * kjs/property_map.cpp:
3437 * wtf/FastMalloc.cpp:
3441 2007-11-11 Adam Roben <aroben@apple.com>
3443 Fix <rdar://5578982> ASSERT in HashTable::checkTableConsistencyExceptSize beneath WebNotificationCenter
3445 The bug was due to a mismatch between HashMap::remove and
3446 HashTable::checkTableConsistency. HashMap::remove can delete the value
3447 stored in the HashTable (by derefing it), which is not normally
3448 allowed by HashTable. It's OK in this case because the value is about
3449 to be removed from the table, but HashTable wasn't aware of this.
3451 HashMap::remove now performs the consistency check itself before
3454 Darin noticed that the same bug would occur in HashSet, so I've fixed
3460 (WTF::HashMap::remove): Perform the HashTable consistency check
3461 manually before calling deref.
3463 (WTF::HashSet::remove): Ditto.
3464 * wtf/HashTable.h: Made checkTableConsistency public so that HashMap
3465 and HashSet can call it.
3466 (WTF::HashTable::removeAndInvalidateWithoutEntryConsistencyCheck):
3468 (WTF::HashTable::removeAndInvalidate): Added.
3469 (WTF::HashTable::remove):
3470 (WTF::HashTable::removeWithoutEntryConsistencyCheck): Added.
3472 2007-11-11 Mark Rowe <mrowe@apple.com>
3474 Build fix. Use the correct filename case.
3478 2007-11-11 Geoffrey Garen <ggaren@apple.com>
3480 Reviewed by Sam Weinig.
3482 Fixed http://bugs.webkit.org/show_bug.cgi?id=15902
3483 15% of string-validate-input.js is spent compiling the same regular expression
3485 Store a compiled representation of the regular expression in the AST.
3487 Only a .2% SunSpider speedup overall, but a 10.6% speedup on
3488 string-validate-input.js.
3491 (KJS::RegExpNode::evaluate):
3493 (KJS::RegExpNode::):
3494 * kjs/nodes2string.cpp:
3495 (KJS::RegExpNode::streamTo):
3497 (KJS::RegExp::flags):
3499 (KJS::RegExp::pattern):
3500 * kjs/regexp_object.cpp:
3501 (KJS::RegExpObjectImp::construct):
3502 (KJS::RegExpObjectImp::createRegExpImp):
3503 * kjs/regexp_object.h:
3505 2007-11-11 Oliver Hunt <oliver@apple.com>
3509 Partial fix for <rdar://problem/5585334> numfuzz: integer overflows opening malformed SVG file in WebCore::ImageBuffer::create
3511 Unfortunately this is a very slight regression, but is unavoidable.
3513 * wtf/FastMalloc.cpp:
3515 2007-11-10 Eric Seidel <eric@webkit.org>
3519 Add simple type inferencing to the parser, and create custom
3520 AddNode and LessNode subclasses based on inferred types.
3521 http://bugs.webkit.org/show_bug.cgi?id=15884
3523 SunSpider claims this is at least a 0.5% speedup.
3525 * JavaScriptCore.exp:
3528 (KJS::NumberImp::getPrimitiveNumber):
3529 (KJS::GetterSetterImp::getPrimitiveNumber):
3535 (KJS::StringNode::evaluate):
3536 (KJS::StringNode::evaluateToNumber):
3537 (KJS::StringNode::evaluateToBoolean):
3538 (KJS::RegExpNode::evaluate):
3539 (KJS::UnaryPlusNode::optimizeVariableAccess):
3540 (KJS::AddNode::evaluate):
3541 (KJS::AddNode::evaluateToNumber):
3542 (KJS::AddNumbersNode::inlineEvaluateToNumber):
3543 (KJS::AddNumbersNode::evaluate):
3544 (KJS::AddNumbersNode::evaluateToNumber):
3545 (KJS::AddStringsNode::evaluate):
3546 (KJS::AddStringLeftNode::evaluate):
3547 (KJS::AddStringRightNode::evaluate):
3550 (KJS::LessNumbersNode::evaluate):
3551 (KJS::LessStringsNode::evaluate):
3553 (KJS::ExpressionNode::):
3554 (KJS::RegExpNode::):
3555 (KJS::RegExpNode::precedence):
3556 (KJS::TypeOfResolveNode::):
3557 (KJS::LocalVarTypeOfNode::):
3558 (KJS::UnaryPlusNode::):
3559 (KJS::UnaryPlusNode::precedence):
3561 (KJS::AddNode::precedence):
3562 (KJS::AddNumbersNode::):
3563 (KJS::AddStringLeftNode::):
3564 (KJS::AddStringRightNode::):
3565 (KJS::AddStringsNode::):
3567 (KJS::LessNode::precedence):
3568 (KJS::LessNumbersNode::):
3569 (KJS::LessStringsNode::):
3570 * kjs/nodes2string.cpp:
3571 (KJS::StringNode::streamTo):
3575 (KJS::JSValue::getPrimitiveNumber):
3577 2007-11-11 Darin Adler <darin@apple.com>
3579 - try another way of fixing dftables builds -- refactor pcre_internal.h a bit
3581 * pcre/pcre_internal.h: Make most of this header do nothing when DFTABLES is set.
3582 Later we can break it into two files.
3584 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Take out now-unneeded include paths.
3585 * pcre/dftables.cpp: Set DFTABLES. Use delete instead of free.
3586 * pcre/dftables.pro: Take out now-unneeded include paths.
3587 * pcre/pcre_maketables.cpp: Use new instead of malloc.
3589 2007-11-11 Darin Adler <darin@apple.com>
3591 * pcre/dftables.pro: Try fixing Qt builds (I looked at qt-win) by adding
3592 another include path.
3594 2007-11-11 Darin Adler <darin@apple.com>
3596 * JavaScriptCore.xcodeproj/project.pbxproj: Try fixing Mac Tiger builds
3597 by adding another include path.
3599 2007-11-11 Darin Adler &nb