1 2008-01-23 Michael Goddard <michael.goddard@trolltech.com>
3 Reviewed by Lars Knoll <lars@trolltech.com>.
5 Reworked the JavaScriptCore Qt bindings:
7 * Add initial support for string and variant arrays, as well
8 as sub QObjects in the JS bindings.
10 * Don't expose fields marked as not scriptable by moc.
12 * Add support for dynamic properties and accessing named
13 QObject children of an object (like QtScript and older
15 * Add support for custom toString methods.
17 * Fine tune some bindings to be closer to QtScript.
18 Make void functions return undefined, and empty/
19 null QStrings return a zero length string.
21 * Create framework for allowing more direct method calls.
22 Since RuntimeMethod doesn't allow us to add additional
23 methods/properties to a function, add these classes.
24 Start prototyping object.signal.connect(...).
26 * Add signal support to the Qt bindings.
27 Allow connecting to signals (object.signal.connect(slot)),
28 disconnecting, and emitting signals. Currently chooses
29 the first signal that matches the name, so this will need
32 * Add property names, and resolve signals closer to use.
33 Enumerating properties now returns some of the Qt properties
34 and signals. Slots and methods aren't quite present. Also,
35 resolve signal connections etc. closer to the time of use, so
36 we can do more dynamic resolution based on argument type etc.
37 Still picks the first one with the same name, at the moment.
39 * Make signature comparison code consistent.
40 Use the same code for checking meta signatures in
41 the method and fallback getters, and avoid a
42 QByteArray construction when we can.
44 * Fix minor memory leak, and handle pointers better.
45 Delete the private object in the dtors, and use RefPtrs
46 for holding Instances etc.
48 * Handle method lookup better.
49 Allow invocation time method lookup based on the arguments,
50 which is closer to QtScript behaviour. Also, cache the
51 method lists and delete them in the QtClass dtor (stops
54 * Improve JS to Qt data type conversions.
55 Add some support for Date & RegExp JS objects,
56 and provide some metrics on the quality of the
59 * A couple of fixes for autotest failures.
60 Better support for converting lists, read/write only
61 QMetaProperty support, modified slot search order...)
64 * bindings/qt/qt_class.cpp:
65 (KJS::Bindings::QtClass::QtClass):
66 (KJS::Bindings::QtClass::~QtClass):
67 (KJS::Bindings::QtClass::name):
68 (KJS::Bindings::QtClass::fallbackObject):
69 (KJS::Bindings::QtClass::methodsNamed):
70 (KJS::Bindings::QtClass::fieldNamed):
71 * bindings/qt/qt_class.h:
72 * bindings/qt/qt_instance.cpp:
73 (KJS::Bindings::QtInstance::QtInstance):
74 (KJS::Bindings::QtInstance::~QtInstance):
75 (KJS::Bindings::QtInstance::getRuntimeObject):
76 (KJS::Bindings::QtInstance::getClass):
77 (KJS::Bindings::QtInstance::implementsCall):
78 (KJS::Bindings::QtInstance::getPropertyNames):
79 (KJS::Bindings::QtInstance::invokeMethod):
80 (KJS::Bindings::QtInstance::invokeDefaultMethod):
81 (KJS::Bindings::QtInstance::stringValue):
82 (KJS::Bindings::QtInstance::booleanValue):
83 (KJS::Bindings::QtInstance::valueOf):
84 (KJS::Bindings::QtField::name):
85 (KJS::Bindings::QtField::valueFromInstance):
86 (KJS::Bindings::QtField::setValueToInstance):
87 * bindings/qt/qt_instance.h:
88 (KJS::Bindings::QtInstance::getBindingLanguage):
89 (KJS::Bindings::QtInstance::getObject):
90 * bindings/qt/qt_runtime.cpp:
91 (KJS::Bindings::QWKNoDebug::QWKNoDebug):
92 (KJS::Bindings::QWKNoDebug::~QWKNoDebug):
93 (KJS::Bindings::QWKNoDebug::operator<<):
95 (KJS::Bindings::valueRealType):
96 (KJS::Bindings::convertValueToQVariant):
97 (KJS::Bindings::convertQVariantToValue):
98 (KJS::Bindings::QtRuntimeMethod::QtRuntimeMethod):
99 (KJS::Bindings::QtRuntimeMethod::~QtRuntimeMethod):
100 (KJS::Bindings::QtRuntimeMethod::codeType):
101 (KJS::Bindings::QtRuntimeMethod::execute):
102 (KJS::Bindings::QtRuntimeMethodData::~QtRuntimeMethodData):
103 (KJS::Bindings::QtRuntimeMetaMethodData::~QtRuntimeMetaMethodData):
104 (KJS::Bindings::QtRuntimeConnectionMethodData::~QtRuntimeConnectionMethodData):
105 (KJS::Bindings::QtMethodMatchType::):
106 (KJS::Bindings::QtMethodMatchType::QtMethodMatchType):
107 (KJS::Bindings::QtMethodMatchType::kind):
108 (KJS::Bindings::QtMethodMatchType::isValid):
109 (KJS::Bindings::QtMethodMatchType::isVariant):
110 (KJS::Bindings::QtMethodMatchType::isMetaType):
111 (KJS::Bindings::QtMethodMatchType::isUnresolved):
112 (KJS::Bindings::QtMethodMatchType::isMetaEnum):
113 (KJS::Bindings::QtMethodMatchType::enumeratorIndex):
114 (KJS::Bindings::QtMethodMatchType::variant):
115 (KJS::Bindings::QtMethodMatchType::metaType):
116 (KJS::Bindings::QtMethodMatchType::metaEnum):
117 (KJS::Bindings::QtMethodMatchType::unresolved):
118 (KJS::Bindings::QtMethodMatchType::typeId):
119 (KJS::Bindings::QtMethodMatchType::name):
120 (KJS::Bindings::QtMethodMatchData::QtMethodMatchData):
121 (KJS::Bindings::QtMethodMatchData::isValid):
122 (KJS::Bindings::QtMethodMatchData::firstUnresolvedIndex):
123 (KJS::Bindings::indexOfMetaEnum):
124 (KJS::Bindings::findMethodIndex):
125 (KJS::Bindings::findSignalIndex):
126 (KJS::Bindings::QtRuntimeMetaMethod::QtRuntimeMetaMethod):
127 (KJS::Bindings::QtRuntimeMetaMethod::mark):
128 (KJS::Bindings::QtRuntimeMetaMethod::callAsFunction):
129 (KJS::Bindings::QtRuntimeMetaMethod::getOwnPropertySlot):
130 (KJS::Bindings::QtRuntimeMetaMethod::lengthGetter):
131 (KJS::Bindings::QtRuntimeMetaMethod::connectGetter):
132 (KJS::Bindings::QtRuntimeMetaMethod::disconnectGetter):
133 (KJS::Bindings::QtRuntimeConnectionMethod::QtRuntimeConnectionMethod):
134 (KJS::Bindings::QtRuntimeConnectionMethod::callAsFunction):
135 (KJS::Bindings::QtRuntimeConnectionMethod::getOwnPropertySlot):
136 (KJS::Bindings::QtRuntimeConnectionMethod::lengthGetter):
137 (KJS::Bindings::QtConnectionObject::QtConnectionObject):
138 (KJS::Bindings::QtConnectionObject::~QtConnectionObject):
139 (KJS::Bindings::QtConnectionObject::metaObject):
140 (KJS::Bindings::QtConnectionObject::qt_metacast):
141 (KJS::Bindings::QtConnectionObject::qt_metacall):
142 (KJS::Bindings::QtConnectionObject::execute):
143 (KJS::Bindings::QtConnectionObject::match):
144 (KJS::Bindings::::QtArray):
145 (KJS::Bindings::::~QtArray):
146 (KJS::Bindings::::rootObject):
147 (KJS::Bindings::::setValueAt):
148 (KJS::Bindings::::valueAt):
149 * bindings/qt/qt_runtime.h:
150 (KJS::Bindings::QtField::):
151 (KJS::Bindings::QtField::QtField):
152 (KJS::Bindings::QtField::fieldType):
153 (KJS::Bindings::QtMethod::QtMethod):
154 (KJS::Bindings::QtMethod::name):
155 (KJS::Bindings::QtMethod::numParameters):
156 (KJS::Bindings::QtArray::getLength):
157 (KJS::Bindings::QtRuntimeMethod::d_func):
158 (KJS::Bindings::QtRuntimeMetaMethod::d_func):
159 (KJS::Bindings::QtRuntimeConnectionMethod::d_func):
161 * bindings/runtime.cpp:
162 (KJS::Bindings::Instance::createBindingForLanguageInstance):
163 (KJS::Bindings::Instance::createRuntimeObject):
164 (KJS::Bindings::Instance::reallyCreateRuntimeObject):
165 * bindings/runtime.h:
167 2008-01-22 Anders Carlsson <andersca@apple.com>
169 Reviewed by Darin and Adam.
171 <rdar://problem/5688975>
172 div element on microsoft site has wrong left offset.
174 Return true even if NPN_GetProperty returns null or undefined. This matches Firefox
175 (and is what the Silverlight plug-in expects).
177 * bindings/NP_jsobject.cpp:
180 2008-01-21 Geoffrey Garen <ggaren@apple.com>
182 Reviewed by Maciej Stachowiak.
184 Fixed http://bugs.webkit.org/show_bug.cgi?id=16909
185 REGRESSION: Amazon.com crash (ActivationImp)
187 (and a bunch of other crashes)
189 Plus, a .7% SunSpider speedup to boot.
191 Replaced the buggy currentExec and savedExec mechanisms with an
192 explicit ExecState stack.
195 (KJS::Collector::collect): Explicitly mark the ExecState stack.
197 (KJS::Collector::reportOutOfMemoryToAllExecStates): Slight change in
198 behavior: We no longer throw an exception in any global ExecStates,
199 since global ExecStates are more like pseudo-ExecStates, and aren't
200 used for script execution. (It's unclear what would happen if you left
201 an exception waiting around in a global ExecState, but it probably
204 2008-01-21 Jan Michael Alonzo <jmalonzo@unpluggable.com>
206 Reviewed by Alp Toker.
208 http://bugs.webkit.org/show_bug.cgi?id=16955
209 Get errors when cross-compile webkit-gtk
211 * GNUmakefile.am: removed ICU_CFLAGS
213 2008-01-18 Kevin McCullough <kmccullough@apple.com>
219 2008-01-18 Kevin McCullough <kmccullough@apple.com>
225 (KJS::UString::cost):
227 2008-01-18 Kevin McCullough <kmccullough@apple.com>
231 - Correctly report cost of appended strings to trigger GC.
235 (KJS::UString::Rep::create):
236 (KJS::UString::UString): Don't create unnecssary objects.
237 (KJS::UString::cost): Report cost if necessary but also keep track of
241 2008-01-18 Simon Hausmann <hausmann@webkit.org>
245 Fix return type conversions from Qt slots to JS values.
247 This also fixes fast/dom/open-and-close-by-DOM.html, which called
248 layoutTestController.windowCount().
250 When constructing the QVariant that holds the return type we cannot
251 use the QVarian(Type) constuctor as that will create a null variant.
252 We have to use the QVariant(Type, void *) constructor instead, just
253 like in QMetaObject::read() for example.
256 * bindings/qt/qt_instance.cpp:
257 (KJS::Bindings::QtInstance::getRuntimeObject):
259 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
261 Reviewed by Simon Hausmann <hausmann@webkit.org>.
263 Fix compilation on Win64(2): Implemented currentThreadStackBase on X86-64 on Windows
267 (KJS::Collector::heapAllocate):
269 2008-01-18 Prasanth Ullattil <prasanth.ullattil@trolltech.com>
271 Reviewed by Simon Hausmann <hausmann@webkit.org>.
273 Fix compilation on Win64(1): Define WTF_PLATFORM_X86_64 correctly on Win64.
278 2008-01-17 Antti Koivisto <antti@apple.com>
282 * kjs/regexp_object.cpp:
283 (KJS::regExpProtoFuncToString):
285 2008-01-16 Sam Weinig <sam@webkit.org>
289 Fix for http://bugs.webkit.org/show_bug.cgi?id=16901
290 Convert remaining JS function objects to use the new PrototypeFunction class
292 - Moves Boolean, Function, RegExp, Number, Object and Global functions to their
293 own static function implementations so that they can be used with the
294 PrototypeFunction class. SunSpider says this is 1.003x as fast.
296 * kjs/JSGlobalObject.cpp:
297 (KJS::JSGlobalObject::reset):
298 * kjs/array_object.h:
299 * kjs/bool_object.cpp:
300 (KJS::BooleanInstance::BooleanInstance):
301 (KJS::BooleanPrototype::BooleanPrototype):
302 (KJS::booleanProtoFuncToString):
303 (KJS::booleanProtoFuncValueOf):
304 (KJS::BooleanObjectImp::BooleanObjectImp):
305 (KJS::BooleanObjectImp::implementsConstruct):
306 (KJS::BooleanObjectImp::construct):
307 (KJS::BooleanObjectImp::callAsFunction):
309 (KJS::BooleanInstance::classInfo):
310 * kjs/error_object.cpp:
311 (KJS::ErrorPrototype::ErrorPrototype):
312 (KJS::errorProtoFuncToString):
313 * kjs/error_object.h:
315 (KJS::globalFuncEval):
316 (KJS::globalFuncParseInt):
317 (KJS::globalFuncParseFloat):
318 (KJS::globalFuncIsNaN):
319 (KJS::globalFuncIsFinite):
320 (KJS::globalFuncDecodeURI):
321 (KJS::globalFuncDecodeURIComponent):
322 (KJS::globalFuncEncodeURI):
323 (KJS::globalFuncEncodeURIComponent):
324 (KJS::globalFuncEscape):
325 (KJS::globalFuncUnEscape):
326 (KJS::globalFuncKJSPrint):
327 (KJS::PrototypeFunction::PrototypeFunction):
329 * kjs/function_object.cpp:
330 (KJS::FunctionPrototype::FunctionPrototype):
331 (KJS::functionProtoFuncToString):
332 (KJS::functionProtoFuncApply):
333 (KJS::functionProtoFuncCall):
334 * kjs/function_object.h:
335 * kjs/number_object.cpp:
336 (KJS::NumberPrototype::NumberPrototype):
337 (KJS::numberProtoFuncToString):
338 (KJS::numberProtoFuncToLocaleString):
339 (KJS::numberProtoFuncValueOf):
340 (KJS::numberProtoFuncToFixed):
341 (KJS::numberProtoFuncToExponential):
342 (KJS::numberProtoFuncToPrecision):
343 * kjs/number_object.h:
344 (KJS::NumberInstance::classInfo):
345 (KJS::NumberObjectImp::classInfo):
346 (KJS::NumberObjectImp::):
347 * kjs/object_object.cpp:
348 (KJS::ObjectPrototype::ObjectPrototype):
349 (KJS::objectProtoFuncValueOf):
350 (KJS::objectProtoFuncHasOwnProperty):
351 (KJS::objectProtoFuncIsPrototypeOf):
352 (KJS::objectProtoFuncDefineGetter):
353 (KJS::objectProtoFuncDefineSetter):
354 (KJS::objectProtoFuncLookupGetter):
355 (KJS::objectProtoFuncLookupSetter):
356 (KJS::objectProtoFuncPropertyIsEnumerable):
357 (KJS::objectProtoFuncToLocaleString):
358 (KJS::objectProtoFuncToString):
359 * kjs/object_object.h:
360 * kjs/regexp_object.cpp:
361 (KJS::RegExpPrototype::RegExpPrototype):
362 (KJS::regExpProtoFuncTest):
363 (KJS::regExpProtoFuncExec):
364 (KJS::regExpProtoFuncCompile):
365 (KJS::regExpProtoFuncToString):
366 * kjs/regexp_object.h:
368 2008-01-16 Cameron Zwarich <cwzwarich@uwaterloo.ca>
370 Reviewed by Maciej & Darin.
372 Fixes Bug 16868: Gmail crash
373 and Bug 16871: Crash when loading apple.com/startpage
375 <http://bugs.webkit.org/show_bug.cgi?id=16868>
376 <rdar://problem/5686108>
378 <http://bugs.webkit.org/show_bug.cgi?id=16871>
379 <rdar://problem/5686670>
381 Adds ActivationImp tear-off for cross-window eval() and fixes an
382 existing garbage collection issue exposed by the ActivationImp tear-off
383 patch (r29425) that can occur when an ExecState's m_callingExec is
384 different than its m_savedExec.
387 (KJS::ExecState::mark):
389 (KJS::GlobalFuncImp::callAsFunction):
391 2008-01-16 Sam Weinig <sam@webkit.org>
395 Clean up MathObjectImp, it needed a little scrubbing.
397 * kjs/math_object.cpp:
398 (KJS::MathObjectImp::MathObjectImp):
399 (KJS::MathObjectImp::getOwnPropertySlot):
400 (KJS::MathObjectImp::getValueProperty):
401 (KJS::mathProtoFuncACos):
402 (KJS::mathProtoFuncASin):
403 (KJS::mathProtoFuncATan):
404 (KJS::mathProtoFuncATan2):
405 (KJS::mathProtoFuncCos):
406 (KJS::mathProtoFuncExp):
407 (KJS::mathProtoFuncLog):
408 (KJS::mathProtoFuncSin):
409 (KJS::mathProtoFuncSqrt):
410 (KJS::mathProtoFuncTan):
412 (KJS::MathObjectImp::classInfo):
413 (KJS::MathObjectImp::):
415 2008-01-16 Sam Weinig <sam@webkit.org>
417 Reviewed by Geoffrey Garen.
419 Rename Lexer variable bol to atLineStart.
423 (KJS::Lexer::setCode):
424 (KJS::Lexer::nextLine):
428 2008-01-16 Sam Weinig <sam@webkit.org>
430 Reviewed by Geoffrey Garen and Anders Carlsson.
432 Remove uses of KJS_PURE_ECMA as we don't ever build with it defined,
433 and we have many features that are not included in the ECMA spec.
437 (KJS::Lexer::setCode):
438 (KJS::Lexer::nextLine):
441 * kjs/string_object.cpp:
442 * kjs/string_object.h:
444 2008-01-15 Sam Weinig <sam@webkit.org>
446 Reviewed by Geoffrey Garen.
448 Fix <rdar://problem/5595552> r27608 introduced a 20% increase in JS binary size, 4% increase in WebCore binary size
450 - This changes the way JS functions that use Lookup tables are handled. Instead of using
451 one class per function, which allowed specialization of the virtual callAsFunction
452 method, we now use one class, PrototypeFunction, which takes a pointer to a static
453 function to use as the implementation. This significantly decreases the binary size
454 of JavaScriptCore (about 145k on an Intel only build) while still keeping some of the
455 speedup r27608 garnered (SunSpider says this is 1.005x as slow, which should leave some
456 wiggle room from the original 1% speedup) and keeps the functions implementations in separate
457 functions to help with optimizations.
459 * JavaScriptCore.exp:
460 * JavaScriptCore.xcodeproj/project.pbxproj:
461 * kjs/array_object.cpp:
462 (KJS::arrayProtoFuncToString):
463 (KJS::arrayProtoFuncToLocaleString):
464 (KJS::arrayProtoFuncJoin):
465 (KJS::arrayProtoFuncConcat):
466 (KJS::arrayProtoFuncPop):
467 (KJS::arrayProtoFuncPush):
468 (KJS::arrayProtoFuncReverse):
469 (KJS::arrayProtoFuncShift):
470 (KJS::arrayProtoFuncSlice):
471 (KJS::arrayProtoFuncSort):
472 (KJS::arrayProtoFuncSplice):
473 (KJS::arrayProtoFuncUnShift):
474 (KJS::arrayProtoFuncFilter):
475 (KJS::arrayProtoFuncMap):
476 (KJS::arrayProtoFuncEvery):
477 (KJS::arrayProtoFuncForEach):
478 (KJS::arrayProtoFuncSome):
479 (KJS::arrayProtoFuncIndexOf):
480 (KJS::arrayProtoFuncLastIndexOf):
481 * kjs/array_object.h:
482 * kjs/date_object.cpp:
483 (KJS::DatePrototype::getOwnPropertySlot):
484 (KJS::dateProtoFuncToString):
485 (KJS::dateProtoFuncToUTCString):
486 (KJS::dateProtoFuncToDateString):
487 (KJS::dateProtoFuncToTimeString):
488 (KJS::dateProtoFuncToLocaleString):
489 (KJS::dateProtoFuncToLocaleDateString):
490 (KJS::dateProtoFuncToLocaleTimeString):
491 (KJS::dateProtoFuncValueOf):
492 (KJS::dateProtoFuncGetTime):
493 (KJS::dateProtoFuncGetFullYear):
494 (KJS::dateProtoFuncGetUTCFullYear):
495 (KJS::dateProtoFuncToGMTString):
496 (KJS::dateProtoFuncGetMonth):
497 (KJS::dateProtoFuncGetUTCMonth):
498 (KJS::dateProtoFuncGetDate):
499 (KJS::dateProtoFuncGetUTCDate):
500 (KJS::dateProtoFuncGetDay):
501 (KJS::dateProtoFuncGetUTCDay):
502 (KJS::dateProtoFuncGetHours):
503 (KJS::dateProtoFuncGetUTCHours):
504 (KJS::dateProtoFuncGetMinutes):
505 (KJS::dateProtoFuncGetUTCMinutes):
506 (KJS::dateProtoFuncGetSeconds):
507 (KJS::dateProtoFuncGetUTCSeconds):
508 (KJS::dateProtoFuncGetMilliSeconds):
509 (KJS::dateProtoFuncGetUTCMilliseconds):
510 (KJS::dateProtoFuncGetTimezoneOffset):
511 (KJS::dateProtoFuncSetTime):
512 (KJS::dateProtoFuncSetMilliSeconds):
513 (KJS::dateProtoFuncSetUTCMilliseconds):
514 (KJS::dateProtoFuncSetSeconds):
515 (KJS::dateProtoFuncSetUTCSeconds):
516 (KJS::dateProtoFuncSetMinutes):
517 (KJS::dateProtoFuncSetUTCMinutes):
518 (KJS::dateProtoFuncSetHours):
519 (KJS::dateProtoFuncSetUTCHours):
520 (KJS::dateProtoFuncSetDate):
521 (KJS::dateProtoFuncSetUTCDate):
522 (KJS::dateProtoFuncSetMonth):
523 (KJS::dateProtoFuncSetUTCMonth):
524 (KJS::dateProtoFuncSetFullYear):
525 (KJS::dateProtoFuncSetUTCFullYear):
526 (KJS::dateProtoFuncSetYear):
527 (KJS::dateProtoFuncGetYear):
530 (KJS::PrototypeFunction::PrototypeFunction):
531 (KJS::PrototypeFunction::callAsFunction):
535 (KJS::staticFunctionGetter):
536 * kjs/math_object.cpp:
537 (KJS::mathProtoFuncAbs):
538 (KJS::mathProtoFuncACos):
539 (KJS::mathProtoFuncASin):
540 (KJS::mathProtoFuncATan):
541 (KJS::mathProtoFuncATan2):
542 (KJS::mathProtoFuncCeil):
543 (KJS::mathProtoFuncCos):
544 (KJS::mathProtoFuncExp):
545 (KJS::mathProtoFuncFloor):
546 (KJS::mathProtoFuncLog):
547 (KJS::mathProtoFuncMax):
548 (KJS::mathProtoFuncMin):
549 (KJS::mathProtoFuncPow):
550 (KJS::mathProtoFuncRandom):
551 (KJS::mathProtoFuncRound):
552 (KJS::mathProtoFuncSin):
553 (KJS::mathProtoFuncSqrt):
554 (KJS::mathProtoFuncTan):
556 * kjs/string_object.cpp:
557 (KJS::stringProtoFuncToString):
558 (KJS::stringProtoFuncValueOf):
559 (KJS::stringProtoFuncCharAt):
560 (KJS::stringProtoFuncCharCodeAt):
561 (KJS::stringProtoFuncConcat):
562 (KJS::stringProtoFuncIndexOf):
563 (KJS::stringProtoFuncLastIndexOf):
564 (KJS::stringProtoFuncMatch):
565 (KJS::stringProtoFuncSearch):
566 (KJS::stringProtoFuncReplace):
567 (KJS::stringProtoFuncSlice):
568 (KJS::stringProtoFuncSplit):
569 (KJS::stringProtoFuncSubstr):
570 (KJS::stringProtoFuncSubstring):
571 (KJS::stringProtoFuncToLowerCase):
572 (KJS::stringProtoFuncToUpperCase):
573 (KJS::stringProtoFuncToLocaleLowerCase):
574 (KJS::stringProtoFuncToLocaleUpperCase):
575 (KJS::stringProtoFuncLocaleCompare):
576 (KJS::stringProtoFuncBig):
577 (KJS::stringProtoFuncSmall):
578 (KJS::stringProtoFuncBlink):
579 (KJS::stringProtoFuncBold):
580 (KJS::stringProtoFuncFixed):
581 (KJS::stringProtoFuncItalics):
582 (KJS::stringProtoFuncStrike):
583 (KJS::stringProtoFuncSub):
584 (KJS::stringProtoFuncSup):
585 (KJS::stringProtoFuncFontcolor):
586 (KJS::stringProtoFuncFontsize):
587 (KJS::stringProtoFuncAnchor):
588 (KJS::stringProtoFuncLink):
589 * kjs/string_object.h:
591 2008-01-15 Geoffrey Garen <ggaren@apple.com>
593 Reviewed by Adam Roben.
595 Some tweaks to our headerdoc, suggested by David Gatwood on the docs
603 2008-01-15 Alp Toker <alp@atoker.com>
605 Rubber-stamped by Anders.
607 Make the HTTP backend configurable in the GTK+ port. curl is currently
610 * wtf/Platform.h: Don't hard-code WTF_USE_CURL for GTK
612 2008-01-15 Sam Weinig <sam@webkit.org>
614 Reviewed by Beth Dakin.
616 Remove unneeded variable.
618 * kjs/string_object.cpp:
619 (KJS::StringProtoFuncSubstr::callAsFunction):
621 2008-01-14 Steve Falkenburg <sfalken@apple.com>
623 Use shared vsprops for most vcproj properties.
627 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Add missing Debug_Internal config.
628 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Add missing Debug_Internal config.
629 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
631 2008-01-14 Adam Roben <aroben@apple.com>
633 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
634 some headers that were missing from the vcproj so their contents will
635 be included in Find in Files.
637 2008-01-14 Adam Roben <aroben@apple.com>
639 Fix Bug 16871: Crash when loading apple.com/startpage
641 <http://bugs.webkit.org/show_bug.cgi?id=16871>
642 <rdar://problem/5686670>
644 Patch written by Darin, reviewed by me.
647 (KJS::ExecState::mark): Call ActivationImp::markChildren if our
648 m_activation is on the stack. This is what ScopeChain::mark also does,
649 but apparently in some cases it's possible for an ExecState's
650 ActivationImp to not be in any ScopeChain.
652 2008-01-14 Kevin McCullough <kmccullough@apple.com>
656 -<rdar://problem/5622667> REGRESSION (Leopard-ToT): Endless loading loop
657 trying to view techreport.com comments
658 - We need to set values in the map, because if they are already in the
659 map they will not be reset when we use add().
661 * kjs/array_instance.cpp:
662 (KJS::ArrayInstance::put):
664 2008-01-14 Darin Adler <darin@apple.com>
668 - re-speed-up the page load test (my StringImpl change slowed it down)
671 (WTF::RefCounted::RefCounted): Allow derived classes to start with a reference
672 count other than 0. Eventually everyone will want to start with a 1. This is a
673 staged change. For now, there's a default of 0, and you can specify 1. Later,
674 there will be no default and everyone will have to specify. And then later, there
675 will be a default of 1. Eventually, we can take away even the option of starting
679 (WTF::Vector::Vector): Sped up creation of non-empty vectors by removing the
680 overhead of first constructing something empty and then calling resize.
681 (WTF::Vector::clear): Sped up the common case of calling clear on an empty
682 vector by adding a check for that case.
683 (WTF::Vector::releaseBuffer): Marked this function inline and removed a branch
684 in the case of vectors with no inline capacity (normal vectors) by leaving out
685 the code to copy the inline buffer in that case.
687 2008-01-14 Alexey Proskuryakov <ap@webkit.org>
689 Reviewed by David Kilzer.
691 http://bugs.webkit.org/show_bug.cgi?id=16787
692 array.splice() with 1 element not working
694 Test: fast/js/array-splice.html
696 * kjs/array_object.cpp:
697 (KJS::ArrayProtoFuncSplice::callAsFunction): Implement this Mozilla extension, and fix
698 some other edge cases.
700 2008-01-13 Steve Falkenburg <sfalken@apple.com>
702 Share common files across projects.
705 Debug: common.vsprops, debug.vsprops
706 Debug_Internal: common.vsprops, debug.vsprops, debug_internal.vsprops
707 Release: common.vsprops, release.vsprops
709 Shared properties can go into common.vsprops, shared debug settings can go into debug.vsprops.
710 debug_internal.vsprops will be mostly empty except for file path prefix modifiers.
712 Reviewed by Adam Roben.
714 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
715 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
716 * JavaScriptCore.vcproj/debug.vsprops: Removed.
717 * JavaScriptCore.vcproj/debug_internal.vsprops: Removed.
718 * JavaScriptCore.vcproj/release.vsprops: Removed.
719 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
721 2008-01-13 Marius Bugge Monsen <mbm@trolltech.com>
723 Contributions and review by Adriaan de Groot,
724 Simon Hausmann, Eric Seidel, and Darin Adler.
726 - http://bugs.webkit.org/show_bug.cgi?id=16590
727 Compilation fixes for Solaris.
730 (KJS::GregorianDateTime::GregorianDateTime): Use the WIN_OS code path
731 for SOLARIS too, presumably because Solaris also lacks the tm_gtoff and tm_zone
733 (KJS::GregorianDateTime::operator tm): Ditto.
736 (KJS::currentThreadStackBase): Use thr_stksegment on Solaris.
739 (isfinite): Implement for Solaris.
741 (signbit): Ditto. But this one is wrong, so I added a FIXME.
743 * wtf/Platform.h: Define PLATFORM(SOLARIS) when "sun" or "__sun" is defined.
745 2008-01-13 Michael Goddard <michael.goddard@trolltech.com>
747 Reviewed by Anders Carlsson.
749 Add binding language type to Instance.
750 Allows runtime determination of the type of an
751 Instance, to allow safe casting. Doesn't actually
752 add any safe casting yet, though.
754 Add a helper function to get an Instance from a JSObject*.
755 Given an object and the expected binding language, see if
756 the JSObject actually wraps an Instance of the given type
757 and return it. Otherwise return 0.
759 Move RuntimeObjectImp creations into Instance.
760 Make the ctor protected, and Instance a friend class, so
761 that all creation of RuntimeObjectImps goes through
764 Remove copy ctor/assignment operator for QtInstance.
765 Instance itself is Noncopyable, so QtInstance doesn't
768 Add caching for QtInstance and associated RuntimeObjectImps.
769 Push any dealings with QtLanguage bindings into QtInstance,
770 and cache them there, rather than in the Instance layer. Add
771 a QtRuntimeObjectImp to help with caching.
773 * JavaScriptCore.exp:
774 * bindings/c/c_instance.h:
775 * bindings/jni/jni_instance.h:
776 * bindings/objc/objc_instance.h:
777 * bindings/qt/qt_instance.cpp:
778 (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
779 (KJS::Bindings::QtRuntimeObjectImp::~QtRuntimeObjectImp):
780 (KJS::Bindings::QtRuntimeObjectImp::invalidate):
781 (KJS::Bindings::QtRuntimeObjectImp::removeFromCache):
782 (KJS::Bindings::QtInstance::QtInstance):
783 (KJS::Bindings::QtInstance::~QtInstance):
784 (KJS::Bindings::QtInstance::getQtInstance):
785 (KJS::Bindings::QtInstance::getRuntimeObject):
786 * bindings/qt/qt_instance.h:
787 (KJS::Bindings::QtInstance::getBindingLanguage):
788 * bindings/runtime.cpp:
789 (KJS::Bindings::Instance::createBindingForLanguageInstance):
790 (KJS::Bindings::Instance::createRuntimeObject):
791 (KJS::Bindings::Instance::getInstance):
792 * bindings/runtime.h:
793 * bindings/runtime_object.h:
794 (KJS::RuntimeObjectImp::getInternalInstance):
796 2008-01-12 Alp Toker <alp@atoker.com>
798 Reviewed by Mark Rowe.
800 Hide non-public symbols in GTK+/autotools release builds.
804 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
806 Reviewed by Mark Rowe.
808 Fix http://bugs.webkit.org/show_bug.cgi?id=16852
809 Fixes leaking of ActivationStackNode objects.
811 * kjs/JSGlobalObject.cpp:
812 (KJS::JSGlobalObject::deleteActivationStack):
813 (KJS::JSGlobalObject::~JSGlobalObject):
814 (KJS::JSGlobalObject::init):
815 (KJS::JSGlobalObject::reset):
816 * kjs/JSGlobalObject.h:
818 2008-01-12 Darin Adler <darin@apple.com>
820 - try to fix Qt Windows build
822 * pcre/dftables: Remove reliance on the list form of Perl pipes.
824 2008-01-12 Darin Adler <darin@apple.com>
826 - try to fix Qt build
828 * kjs/function.cpp: Added include of scope_chain_mark.h.
829 * kjs/scope_chain_mark.h: Added multiple-include guards.
831 2008-01-12 Mark Rowe <mrowe@apple.com>
833 Another Windows build fix.
837 2008-01-12 Mark Rowe <mrowe@apple.com>
839 Attempted Windows build fix. Use struct consistently when forward-declaring
840 ActivationStackNode and StackActivation.
843 * kjs/JSGlobalObject.h:
845 2008-01-12 Cameron Zwarich <cwzwarich@uwaterloo.ca>
849 Fixes a problem with the ActivationImp tear-off patch (r29425) where
850 some of the calls to JSGlobalObject::tearOffActivation() were using
851 the wrong test to determine whether it should leave a relic behind.
854 (KJS::FunctionImp::argumentsGetter):
855 (KJS::ActivationImp::getOwnPropertySlot):
857 2008-01-11 Geoffrey Garen <ggaren@apple.com>
859 Reviewed by Oliver Hunt.
861 Fixed <rdar://problem/5665251> REGRESSION (r28880-r28886): Global
862 variable access (16644)
864 This bug was caused by var declarations shadowing built-in properties of
867 To match Firefox, we've decided that var declarations will never shadow
868 built-in properties of the global object or its prototypes. We used to
869 behave more like IE, which allows shadowing, but walking that line got
870 us into trouble with websites that sent us down the Firefox codepath.
872 * kjs/JSVariableObject.h:
873 (KJS::JSVariableObject::symbolTableGet): New code to support calling
874 hasProperty before the variable object is fully initialized (so you
875 can call it during initialization).
878 (KJS::ProgramNode::initializeSymbolTable): Always do a full hasProperty
879 check when looking for duplicates, not getDirect, since it only checks
880 the property map, and not hasOwnProperty, since it doesn't check
882 (KJS::EvalNode::processDeclarations): ditto
884 * kjs/property_slot.h:
885 (KJS::PropertySlot::ungettableGetter): Best function name evar.
887 2008-01-11 Cameron Zwarich <cwzwarich@uwaterloo.ca>
891 Optimized ActivationImp allocation, so that activation records are now
892 first allocated on an explicitly managed stack and only heap allocated
893 when necessary. Roughly a 5% improvement on SunSpider, and a larger
894 improvement on benchmarks that use more function calls.
896 * JavaScriptCore.xcodeproj/project.pbxproj:
897 * kjs/Activation.h: Added.
898 (KJS::ActivationImp::ActivationData::ActivationData):
899 (KJS::ActivationImp::ActivationImp):
900 (KJS::ActivationImp::classInfo):
901 (KJS::ActivationImp::isActivationObject):
902 (KJS::ActivationImp::isOnStack):
903 (KJS::ActivationImp::d):
904 (KJS::StackActivation::StackActivation):
906 (KJS::ExecState::ExecState):
907 (KJS::ExecState::~ExecState):
909 (KJS::ExecState::replaceScopeChainTop):
910 (KJS::ExecState::setActivationObject):
911 (KJS::ExecState::setLocalStorage):
912 * kjs/JSGlobalObject.cpp:
913 (KJS::JSGlobalObject::reset):
914 (KJS::JSGlobalObject::pushActivation):
915 (KJS::JSGlobalObject::checkActivationCount):
916 (KJS::JSGlobalObject::popActivationHelper):
917 (KJS::JSGlobalObject::popActivation):
918 (KJS::JSGlobalObject::tearOffActivation):
919 * kjs/JSGlobalObject.h:
920 * kjs/JSVariableObject.h:
921 (KJS::JSVariableObject::JSVariableObjectData::JSVariableObjectData):
922 (KJS::JSVariableObject::JSVariableObject):
924 (KJS::FunctionImp::argumentsGetter):
925 (KJS::ActivationImp::ActivationImp):
926 (KJS::ActivationImp::~ActivationImp):
927 (KJS::ActivationImp::init):
928 (KJS::ActivationImp::getOwnPropertySlot):
929 (KJS::ActivationImp::markHelper):
930 (KJS::ActivationImp::mark):
931 (KJS::ActivationImp::ActivationData::ActivationData):
932 (KJS::GlobalFuncImp::callAsFunction):
935 (KJS::PostIncResolveNode::evaluate):
936 (KJS::PostDecResolveNode::evaluate):
937 (KJS::PreIncResolveNode::evaluate):
938 (KJS::PreDecResolveNode::evaluate):
939 (KJS::ReadModifyResolveNode::evaluate):
940 (KJS::AssignResolveNode::evaluate):
941 (KJS::WithNode::execute):
942 (KJS::TryNode::execute):
943 (KJS::FunctionBodyNode::processDeclarations):
944 (KJS::FuncExprNode::evaluate):
947 (KJS::ScopeChain::replace):
948 * kjs/scope_chain_mark.h: Added.
949 (KJS::ScopeChain::mark):
951 2008-01-11 Simon Hausmann <hausmann@webkit.org>
953 Reviewed by Mark Rowe.
955 Fix the (clean) qmake build. For generating chartables.c we don't
956 depend on a separate input source file anymore, the dftables perl
957 script is enough. So use that instead as value for the .input
958 variable, to ensure that qmake also generates a rule to call dftables.
962 2008-01-10 Geoffrey Garen <ggaren@apple.com>
964 Reviewed by John Sullivan.
966 Fixed some world leak reports:
967 * <rdar://problem/5669436> PLT complains about world leak of 1 JavaScript
968 Interpreter after running cvs-base suite
970 * <rdar://problem/5669423> PLT complains about world leak if browser
971 window is open when PLT starts
973 * kjs/collector.h: Added the ability to distinguish between global
974 objects and GC-protected global objects, since we only consider the
975 latter to be world leaks.
978 2008-01-11 Mark Rowe <mrowe@apple.com>
980 Silence qmake warning about ctgen lacking input.
982 Rubber-stamped by Alp Toker.
986 2008-01-10 David Kilzer <ddkilzer@apple.com>
988 dftables should be rewritten as a script
990 <http://bugs.webkit.org/show_bug.cgi?id=16818>
991 <rdar://problem/5681463>
995 Rewrote the dftables utility in Perl. Attempted to switch all
996 build systems to call the script directly instead of building
997 a binary first. Only the Xcode build was able to be tested.
999 * DerivedSources.make: Added pcre directory to VPATH and changed
1000 to invoke dftables directly.
1001 * GNUmakefile.am: Removed build information and changed to invoke
1003 * JavaScriptCore.vcproj/JavaScriptCore.sln: Removed reference to
1005 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Ditto.
1006 * JavaScriptCore.vcproj/dftables: Removed.
1007 * JavaScriptCore.vcproj/dftables/dftables.vcproj: Removed.
1008 * JavaScriptCore.xcodeproj/project.pbxproj: Removed dftables target.
1009 * jscore.bkl: Removed dftables executable definition.
1010 * pcre/dftables: Copied from JavaScriptCore/pcre/dftables.cpp.
1011 * pcre/dftables.cpp: Removed.
1012 * pcre/dftables.pro: Removed.
1013 * pcre/pcre.pri: Removed references to dftables.cpp and changed to
1014 invoke dftables directly.
1016 2008-01-10 Dan Bernstein <mitz@apple.com>
1018 Reviewed by Darin Adler.
1020 - fix http://bugs.webkit.org/show_bug.cgi?id=16782
1021 <rdar://problem/5675331> REGRESSION(r29266): Reproducible crash in fast/replaced/image-map.html
1023 The crash resulted from a native object (DumpRenderTree's
1024 EventSender) causing its wrapper to be invalidated (by clicking a
1025 link that replaced the document in the window) and consequently
1026 deallocated. The fix is to use RefPtrs to protect the native object
1027 from deletion by self-invalidation.
1029 * bindings/runtime_method.cpp:
1030 (RuntimeMethod::callAsFunction):
1031 * bindings/runtime_object.cpp:
1032 (RuntimeObjectImp::fallbackObjectGetter):
1033 (RuntimeObjectImp::fieldGetter):
1034 (RuntimeObjectImp::methodGetter):
1035 (RuntimeObjectImp::put):
1036 (RuntimeObjectImp::defaultValue):
1037 (RuntimeObjectImp::callAsFunction):
1039 2008-01-07 Mark Rowe <mrowe@apple.com>
1041 Reviewed by Maciej Stachowiak.
1043 Turn testIsInteger assertions into compile-time asserts and move them into HashTraits.h
1049 2008-01-07 Nikolas Zimmermann <zimmermann@kde.org>
1053 Enable SVG_FONTS by default.
1055 * Configurations/JavaScriptCore.xcconfig:
1057 2008-01-07 Darin Adler <darin@apple.com>
1059 Rubber stamped by David Kilzer.
1061 - get rid of empty fpconst.cpp
1063 * GNUmakefile.am: Remove fpconst.cpp.
1064 * JavaScriptCore.pri: Ditto.
1065 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Ditto.
1066 * JavaScriptCore.xcodeproj/project.pbxproj: Ditto.
1067 * JavaScriptCoreSources.bkl: Ditto.
1069 * kjs/fpconst.cpp: Removed.
1071 2008-01-07 Darin Adler <darin@apple.com>
1073 Reviewed by David Kilzer.
1075 - fix alignment problem with NaN and Inf globals
1077 * kjs/fpconst.cpp: Move the contents of this file from here back to
1078 value.cpp. The reason this was in a separate file is that the DARWIN
1079 version of this used a declaration of the globals with a different
1080 type to avoid creating "init routines". That's no longer necessary for
1081 DARWIN and was never necessary for the non-DARWIN code path.
1082 To make this patch easy to merge, I didn't actually delete this file
1083 yet. We'll do that in a separate changeset.
1085 * kjs/value.cpp: If C99's NAN and INFINITY are present, then use them,
1086 othrewise use the union trick from fpconst.cpp. I think it would be
1087 better to eliminate KJS::NaN and KJS::Inf and just use NAN and INFINITY
1088 directly or std::numeric_limits<double>::quiet_nan() and
1089 std::numeric_limits<double>::infinity(). But when I tried that, it
1090 slowed down SunSpider. Someone else could do that cleanup if they
1091 could do it without slowing down the engine.
1093 2008-01-07 Adam Roben <aroben@apple.com>
1097 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Added
1098 JavaScript.h to the project.
1099 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
1100 Copy JavaScript.h to WEBKITOUTPUTDIR.
1102 2008-01-07 Timothy Hatcher <timothy@apple.com>
1113 * API/JavaScriptCore.h:
1115 * JavaScriptCore.xcodeproj/project.pbxproj:
1117 2008-01-07 Alp Toker <alp@atoker.com>
1121 http://bugs.webkit.org/show_bug.cgi?id=16029
1122 JavaScriptCore.h is not suitable for platforms other than Mac OS X
1124 Introduce a new JavaScriptCore/JavaScript.h public API header. This
1125 should be used by all new portable code using the JavaScriptCore API.
1127 JavaScriptCore/JavaScriptCore.h will remain for compatibility with
1128 existing applications that depend on it including JSStringRefCF.h
1129 which isn't portable.
1131 Also add minidom to the GTK+/autotools build since we can now support
1132 it on all platforms.
1136 * API/JavaScript.h: Added.
1137 * API/JavaScriptCore.h:
1138 * ForwardingHeaders/JavaScriptCore/JavaScript.h: Added.
1140 * JavaScriptCore.xcodeproj/project.pbxproj:
1142 2008-01-06 Eric Seidel <eric@webkit.org>
1146 Abstract all DateObject.set* functions in preparation for fixing:
1147 http://bugs.webkit.org/show_bug.cgi?id=16753
1149 SunSpider had random changes here and there but was overall a wash.
1151 * kjs/date_object.cpp:
1152 (KJS::fillStructuresUsingTimeArgs):
1153 (KJS::setNewValueFromTimeArgs):
1154 (KJS::setNewValueFromDateArgs):
1155 (KJS::DateProtoFuncSetMilliSeconds::callAsFunction):
1156 (KJS::DateProtoFuncSetUTCMilliseconds::callAsFunction):
1157 (KJS::DateProtoFuncSetSeconds::callAsFunction):
1158 (KJS::DateProtoFuncSetUTCSeconds::callAsFunction):
1159 (KJS::DateProtoFuncSetMinutes::callAsFunction):
1160 (KJS::DateProtoFuncSetUTCMinutes::callAsFunction):
1161 (KJS::DateProtoFuncSetHours::callAsFunction):
1162 (KJS::DateProtoFuncSetUTCHours::callAsFunction):
1163 (KJS::DateProtoFuncSetDate::callAsFunction):
1164 (KJS::DateProtoFuncSetUTCDate::callAsFunction):
1165 (KJS::DateProtoFuncSetMonth::callAsFunction):
1166 (KJS::DateProtoFuncSetUTCMonth::callAsFunction):
1167 (KJS::DateProtoFuncSetFullYear::callAsFunction):
1168 (KJS::DateProtoFuncSetUTCFullYear::callAsFunction):
1170 2008-01-06 Nikolas Zimmermann <zimmermann@kde.org>
1174 Add new helper function isArabicChar - SVG Fonts support needs it.
1176 * wtf/unicode/icu/UnicodeIcu.h:
1177 (WTF::Unicode::isArabicChar):
1178 * wtf/unicode/qt4/UnicodeQt4.h:
1179 (WTF::Unicode::isArabicChar):
1181 2008-01-06 Alp Toker <alp@atoker.com>
1183 Reviewed by Mark Rowe.
1185 Use $(EXEEXT) to account for the .exe extension in the GTK+ Windows
1186 build. (This is already done correctly in DerivedSources.make.) Issue
1187 noticed by Mikkel when building in Cygwin.
1189 Add a missing slash. This was a hack from the qmake build system that
1190 isn't necessary with autotools.
1194 2008-01-05 Darin Adler <darin@apple.com>
1196 * API/JSRetainPtr.h: One more file that needed the change below.
1198 2008-01-05 Darin Adler <darin@apple.com>
1200 * wtf/OwnPtr.h: OwnPtr needs the same fix as RefPtr below.
1202 2008-01-05 Adam Roben <aroben@apple.com>
1208 * wtf/RetainPtr.h: Use PtrType instead of T* because of the
1209 RemovePointer magic.
1211 2008-01-05 Darin Adler <darin@apple.com>
1213 Rubber stamped by Maciej Stachowiak.
1215 - cut down own PIC branches by using a pointer-to-member-data instead of a
1216 pointer-to-member-function in WTF smart pointers
1218 * wtf/OwnArrayPtr.h:
1223 Use a pointer to the m_ptr member instead of the get member.
1224 The GCC compiler generates better code for this idiom.
1226 2008-01-05 Henry Mason <hmason@mac.com>
1228 Reviewed by Maciej Stachowiak.
1230 http://bugs.webkit.org/show_bug.cgi?id=16738
1231 Bug 16738: Collector block offset could be stored as an cell offset instead of a byte offset
1233 Gives a 0.4% SunSpider boost and prettier code.
1235 * kjs/collector.cpp: Switched to cell offsets from byte offsets
1236 (KJS::Collector::heapAllocate):
1237 (KJS::Collector::sweep):
1239 2008-01-04 Mark Rowe <mrowe@apple.com>
1241 Reviewed by Maciej Stachowiak.
1243 Have the two malloc zones print useful diagnostics if their free method are unexpectedly invoked.
1244 Due to <rdar://problem/5671357> this can happen if an application attempts to free a pointer that
1245 was not allocated by any registered malloc zone on the system.
1247 * kjs/CollectorHeapIntrospector.h:
1248 * wtf/FastMalloc.cpp:
1250 2008-01-04 Alp Toker <alp@atoker.com>
1252 GTK+ autotools build fix. Terminate empty rules.
1256 2008-01-03 Simon Hausmann <hausmann@webkit.org>
1258 Reviewed by Mark Rowe.
1260 Fix compilation with gcc 4.3: limits.h is needed for INT_MAX.
1262 * pcre/pcre_exec.cpp:
1264 2008-01-03 Darin Adler <darin@apple.com>
1266 * tests/mozilla/expected.html: The fix for bug 16696 also fixed a test
1267 case, ecma_3/RegExp/perlstress-002.js, so updated results to expect
1268 that test to succeed.
1270 2008-01-02 Darin Adler <darin@apple.com>
1274 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
1275 JSCRE fails fails to match Acid3 regexp
1277 Test: fast/regex/early-acid3-86.html
1279 The problem was with the cutoff point between backreferences and octal
1280 escape sequences. We need to determine the cutoff point by counting the
1281 total number of capturing brackets, which requires an extra pass through
1282 the expression when compiling it.
1284 * pcre/pcre_compile.cpp:
1285 (CompileData::CompileData): Added numCapturingBrackets. Removed some
1287 (compileBranch): Use numCapturingBrackets when calling checkEscape.
1288 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
1289 checkEscape, and also store the bracket count at the end of the compile.
1290 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
1291 count the number of brackets and then a second time to calculate the length.
1293 2008-01-02 Darin Adler <darin@apple.com>
1297 - fix http://bugs.webkit.org/show_bug.cgi?id=16696
1298 JSCRE fails fails to match Acid3 regexp
1300 Test: fast/regex/early-acid3-86.html
1302 The problem was with the cutoff point between backreferences and octal
1303 escape sequences. We need to determine the cutoff point by counting the
1304 total number of capturing brackets, which requires an extra pass through
1305 the expression when compiling it.
1307 * pcre/pcre_compile.cpp:
1308 (CompileData::CompileData): Added numCapturingBrackets. Removed some
1310 (compileBranch): Use numCapturingBrackets when calling checkEscape.
1311 (calculateCompiledPatternLength): Use numCapturingBrackets when calling
1312 checkEscape, and also store the bracket count at the end of the compile.
1313 (jsRegExpCompile): Call calculateCompiledPatternLength twice -- once to
1314 count the number of brackets and then a second time to calculate the length.
1316 2008-01-02 David Kilzer <ddkilzer@webkit.org>
1318 Reviewed and landed by Darin.
1321 (KJS::DoWhileNode::execute): Added a missing return.
1323 2008-01-02 Darin Adler <darin@apple.com>
1325 - try to fix Qt build
1327 * wtf/unicode/qt4/UnicodeQt4.h:
1328 (WTF::Unicode::foldCase): Add some missing const.
1330 2008-01-02 Alice Liu <alice.liu@apple.com>
1332 Reviewed by Sam Weinig.
1334 need to export ASCIICType.h for use in DRT
1336 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
1338 (WTF::isASCIIUpper):
1340 2008-01-02 Sam Weinig <sam@webkit.org>
1342 Reviewed by Beth Dakin.
1344 Cleanup error_object.h/cpp.
1346 * kjs/JSGlobalObject.cpp:
1347 (KJS::JSGlobalObject::reset):
1348 * kjs/error_object.cpp:
1350 (KJS::ErrorInstance::ErrorInstance):
1351 (KJS::ErrorPrototype::ErrorPrototype):
1352 (KJS::ErrorProtoFuncToString::ErrorProtoFuncToString):
1353 (KJS::ErrorProtoFuncToString::callAsFunction):
1354 (KJS::ErrorObjectImp::ErrorObjectImp):
1355 (KJS::ErrorObjectImp::implementsConstruct):
1356 (KJS::ErrorObjectImp::construct):
1357 (KJS::ErrorObjectImp::callAsFunction):
1358 (KJS::NativeErrorPrototype::NativeErrorPrototype):
1359 (KJS::NativeErrorImp::NativeErrorImp):
1360 (KJS::NativeErrorImp::implementsConstruct):
1361 (KJS::NativeErrorImp::construct):
1362 (KJS::NativeErrorImp::callAsFunction):
1363 (KJS::NativeErrorImp::mark):
1364 * kjs/error_object.h:
1365 (KJS::ErrorInstance::classInfo):
1366 (KJS::NativeErrorImp::classInfo):
1368 2008-01-02 Mark Rowe <mrowe@apple.com>
1370 Rubber-stamped by Alp Toker.
1372 * GNUmakefile.am: Add missing dependency on grammar.y.
1374 2008-01-01 Darin Adler <darin@apple.com>
1378 - fix for http://bugs.webkit.org/show_bug.cgi?id=16695
1379 JSC allows non-identifier codepoints in identifiers (affects Acid3)
1381 Test: fast/js/kde/parse.html
1384 (KJS::Lexer::lex): Added additional states to distinguish Unicode escapes at the
1385 start of identifiers from ones inside identifiers. Rejected characters that don't pass
1386 the isIdentStart and isIdentPart tests.
1387 (KJS::Lexer::convertUnicode): Removed incorrect FIXME comment.
1389 * kjs/lexer.h: Added new states to distinguish \u escapes at the start of identifiers
1390 from \u escapes inside identifiers.
1392 2008-01-01 Darin Adler <darin@apple.com>
1394 - rolled scope chain optimization out; it was breaking the world
1396 2008-01-01 Darin Adler <darin@apple.com>
1400 - http://bugs.webkit.org/show_bug.cgi?id=16685
1401 eliminate List::empty() to cut down on PIC branches
1403 Also included one other speed-up -- remove the call to reserveCapacity from
1404 FunctionBodyNode::processDeclarations in all but the most unusual cases.
1406 Together these make SunSpider 1.016x as fast.
1408 * JavaScriptCore.exp: Updated.
1409 * kjs/ExecState.cpp:
1410 (KJS::globalEmptyList): Added. Called only when creating global ExecState
1412 (KJS::ExecState::ExecState): Broke constructor up into three separate functions,
1413 for the three separate node types. Also went through each of the three and
1414 streamlined as much as possible, removing dead code. This prevents us from having
1415 to access the global in the function body version of the constructor.
1417 * kjs/ExecState.h: Added emptyList(). Replaced the constructor with a set of
1418 three that are specific to the different node types that can create new execution
1421 * kjs/array_object.cpp:
1422 (KJS::ArrayProtoFuncToLocaleString::callAsFunction): Use exec->emptyList() instead
1424 (KJS::ArrayProtoFuncConcat::callAsFunction): Ditto.
1425 (KJS::ArrayProtoFuncSlice::callAsFunction): Ditto.
1426 (KJS::ArrayProtoFuncSplice::callAsFunction): Ditto.
1427 (KJS::ArrayProtoFuncFilter::callAsFunction): Ditto.
1429 (KJS::FunctionImp::callAsFunction): Updated to call new ExecState constructor.
1430 (KJS::GlobalFuncImp::callAsFunction): Ditto (for eval).
1431 * kjs/function_object.cpp:
1432 (FunctionObjectImp::construct): Use exec->emptyList() instead of List::empty().
1434 * kjs/list.cpp: Removed List::empty.
1435 * kjs/list.h: Ditto.
1438 (KJS::ElementNode::evaluate): Use exec->emptyList() instead of List::empty().
1439 (KJS::ArrayNode::evaluate): Ditto.
1440 (KJS::ObjectLiteralNode::evaluate): Ditto.
1441 (KJS::PropertyListNode::evaluate): Ditto.
1442 (KJS::FunctionBodyNode::processDeclarations): Another speed-up. Check the capacity
1443 before calling reserveCapacity, because it doesn't get inlined the local storage
1444 vector is almost always big enough -- saving the function call overhead is a big
1446 (KJS::FuncDeclNode::makeFunction): Use exec->emptyList() instead of List::empty().
1447 (KJS::FuncExprNode::evaluate): Ditto.
1449 (KJS::tryGetAndCallProperty): Ditto.
1450 * kjs/property_slot.cpp:
1451 (KJS::PropertySlot::functionGetter): Ditto.
1452 * kjs/string_object.cpp:
1453 (KJS::StringProtoFuncSplit::callAsFunction): Ditto.
1455 2008-01-01 Darin Adler <darin@apple.com>
1459 - fix http://bugs.webkit.org/show_bug.cgi?id=16648
1460 REGRESSION (r28165): Yuku.com navigation prints "jsRegExpExecute failed with result -2"
1461 <rdar://problem/5646486> REGRESSION (r28165): Layout test fast/regex/test1 fails intermittently
1463 Fixes 34 failing test cases in the fast/regex/test1.html test.
1465 Restored the stack which prevents infinite loops for brackets that match the empty
1466 string; it had been removed as an optimization.
1468 Unfortunately, restoring this stack causes the regular expression test in SunSpider
1469 to be 1.095x as slow and the overall test to be 1.004x as slow. Maybe we can find
1470 a correct optimization to restore the speed!
1472 It's possible the original change was on the right track but just off by one.
1474 * pcre/pcre_exec.cpp: Add back eptrblock, but name it BracketChainNode.
1475 (MatchStack::pushNewFrame): Add back the logic needed here.
1476 (startNewGroup): Ditto.
1479 2008-01-01 Darin Adler <darin@apple.com>
1483 - http://bugs.webkit.org/show_bug.cgi?id=16683
1484 speed up function calls by making ScopeChain::push cheaper
1486 This gives a 1.019x speedup on SunSpider.
1488 After doing this, I realized this probably will be obsolete when the optimization
1489 to avoid creating an activation object is done. When we do that one we should check
1490 if rolling this out will speed things up, since this does add overhead at the time
1491 you copy the scope chain.
1493 * kjs/object.h: Removed the ScopeChain::release function. It was
1494 marked inline, and called in exactly one place, so moved it there.
1495 No idea why it was in this header file!
1497 * kjs/scope_chain.cpp: Removed the overload of the ScopeChain::push
1498 function that takes another ScopeChain. It was unused. I think we used
1499 it over in WebCore at one point, but not any more.
1501 * kjs/scope_chain.h: Changed ScopeChainNode into a struct rather than
1502 a class, got rid of its constructor so we can have one that's uninitialized,
1503 and moved the refCount into a derived struct, ScopeChainHeapNode. Made _node
1504 mutable so it can be changed in the moveToHeap function. Changed the copy
1505 constructor and assignment operator to call moveToHeap, since the top node
1506 can't be shared when it's embedded in another ScopeChain object. Updated
1507 functions as needed to handle the case where the first object isn't on the
1508 heap or to add casts for cases where it's guaranteed to be. Changed the push
1509 function to always put the new node into the ScopeChain object; it will get
1510 put onto the heap when needed later.
1512 2008-01-01 Geoffrey Garen <ggaren@apple.com>
1514 Reviewed by Darin Adler.
1516 Fixed slight logic error in reserveCapacity, where we would reallocate
1517 the storage buffer unnecessarily.
1520 (WTF::::reserveCapacity): No need to grow the buffer if newCapacity is
1521 equal to capacity().
1523 2008-01-01 Darin Adler <darin@apple.com>
1527 - http://bugs.webkit.org/show_bug.cgi?id=16684
1528 eliminate debugger overhead from function body execution
1530 Speeds SunSpider up 1.003x. That's a small amount, but measurable.
1532 * JavaScriptCore.exp: Updated.
1534 (KJS::Parser::parse): Create the node with a static member function named create() instead
1535 of using new explicitly.
1537 * kjs/grammar.y: Changed calls to new FunctionBodyNode to use FunctionBodyNode::create().
1540 (KJS::ProgramNode::create): Added. Calls new.
1541 (KJS::EvalNode::create): Ditto.
1542 (KJS::FunctionBodyNode::create): Ditto, but creates FunctionBodyNodeWithDebuggerHooks
1543 when a debugger is present.
1544 (KJS::FunctionBodyNode::execute): Removed debugger hooks.
1545 (KJS::FunctionBodyNodeWithDebuggerHooks::FunctionBodyNodeWithDebuggerHooks): Added.
1546 (KJS::FunctionBodyNodeWithDebuggerHooks::execute): Calls the debugger, then the code,
1547 then the debugger again.
1549 * kjs/nodes.h: Added create functions, made the constructors private and protected.
1551 2007-12-30 Eric Seidel <eric@webkit.org>
1555 More small cleanup to array_object.cpp
1557 * kjs/array_object.cpp:
1558 (KJS::ArrayProtoFuncToString::callAsFunction):
1559 (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
1560 (KJS::ArrayProtoFuncJoin::callAsFunction):
1561 (KJS::ArrayProtoFuncConcat::callAsFunction):
1562 (KJS::ArrayProtoFuncReverse::callAsFunction):
1563 (KJS::ArrayProtoFuncShift::callAsFunction):
1564 (KJS::ArrayProtoFuncSlice::callAsFunction):
1565 (KJS::ArrayProtoFuncSort::callAsFunction):
1566 (KJS::ArrayProtoFuncSplice::callAsFunction):
1567 (KJS::ArrayProtoFuncUnShift::callAsFunction):
1568 (KJS::ArrayProtoFuncFilter::callAsFunction):
1569 (KJS::ArrayProtoFuncMap::callAsFunction):
1570 (KJS::ArrayProtoFuncEvery::callAsFunction):
1572 2007-12-30 Eric Seidel <eric@webkit.org>
1576 Apply wkstyle to array_object.cpp
1578 * kjs/array_object.cpp:
1579 (KJS::ArrayPrototype::ArrayPrototype):
1580 (KJS::ArrayPrototype::getOwnPropertySlot):
1581 (KJS::ArrayProtoFuncConcat::callAsFunction):
1582 (KJS::ArrayProtoFuncPop::callAsFunction):
1583 (KJS::ArrayProtoFuncReverse::callAsFunction):
1584 (KJS::ArrayProtoFuncShift::callAsFunction):
1585 (KJS::ArrayProtoFuncSlice::callAsFunction):
1586 (KJS::ArrayProtoFuncSort::callAsFunction):
1587 (KJS::ArrayProtoFuncSplice::callAsFunction):
1588 (KJS::ArrayProtoFuncUnShift::callAsFunction):
1589 (KJS::ArrayProtoFuncFilter::callAsFunction):
1590 (KJS::ArrayProtoFuncMap::callAsFunction):
1591 (KJS::ArrayProtoFuncEvery::callAsFunction):
1592 (KJS::ArrayProtoFuncLastIndexOf::callAsFunction):
1593 (KJS::ArrayObjectImp::ArrayObjectImp):
1594 (KJS::ArrayObjectImp::implementsConstruct):
1595 (KJS::ArrayObjectImp::construct):
1596 (KJS::ArrayObjectImp::callAsFunction):
1598 2007-12-30 Eric Seidel <eric@webkit.org>
1602 Remove maxInt/minInt, replacing with std:max/min<int>()
1604 * kjs/array_object.cpp:
1605 (KJS::ArrayProtoFuncSplice::callAsFunction):
1606 * kjs/operations.cpp:
1609 2007-12-30 Eric Seidel <eric@webkit.org>
1613 Update Number.toString to properly throw exceptions.
1614 Cleanup code in Number.toString implementation.
1616 * kjs/number_object.cpp:
1617 (KJS::numberToString):
1619 (KJS::Error::create): Remove bogus debug lines.
1621 2007-12-28 Eric Seidel <eric@webkit.org>
1625 ASSERT when debugging via Drosera due to missed var lookup optimization.
1626 http://bugs.webkit.org/show_bug.cgi?id=16634
1628 No test case possible.
1631 (KJS::BreakpointCheckStatement::optimizeVariableAccess):
1634 2007-12-28 Eric Seidel <eric@webkit.org>
1638 Fix (-0).toFixed() and re-factor a little
1639 Fix (-0).toExponential() and printing of trailing 0s in toExponential
1640 Fix toPrecision(nan) handling
1641 http://bugs.webkit.org/show_bug.cgi?id=16640
1643 * kjs/number_object.cpp:
1644 (KJS::numberToFixed):
1645 (KJS::fractionalPartToString):
1646 (KJS::numberToExponential):
1647 (KJS::numberToPrecision):
1649 2007-12-28 Eric Seidel <eric@webkit.org>
1653 More changes to make number code readable
1655 * kjs/number_object.cpp:
1656 (KJS::integer_part_noexp):
1657 (KJS::numberToFixed):
1658 (KJS::numberToExponential):
1660 2007-12-28 Eric Seidel <eric@webkit.org>
1664 More small cleanups to toPrecision
1666 * kjs/number_object.cpp:
1667 (KJS::numberToPrecision):
1669 2007-12-28 Eric Seidel <eric@webkit.org>
1673 More small attempts to make number code readable
1675 * kjs/number_object.cpp:
1676 (KJS::exponentialPartToString):
1677 (KJS::numberToExponential):
1678 (KJS::numberToPrecision):
1680 2007-12-28 Eric Seidel <eric@webkit.org>
1684 Break out callAsFunction implementations into static functions
1686 * kjs/number_object.cpp:
1687 (KJS::numberToString):
1688 (KJS::numberToFixed):
1689 (KJS::numberToExponential):
1690 (KJS::numberToPrecision):
1691 (KJS::NumberProtoFunc::callAsFunction):
1693 2007-12-28 Eric Seidel <eric@webkit.org>
1697 Apply wkstyle/astyle and fix placement of *
1699 * kjs/number_object.cpp:
1701 (KJS::NumberInstance::NumberInstance):
1702 (KJS::NumberPrototype::NumberPrototype):
1703 (KJS::NumberProtoFunc::NumberProtoFunc):
1704 (KJS::integer_part_noexp):
1706 (KJS::NumberProtoFunc::callAsFunction):
1707 (KJS::NumberObjectImp::NumberObjectImp):
1708 (KJS::NumberObjectImp::getOwnPropertySlot):
1709 (KJS::NumberObjectImp::getValueProperty):
1710 (KJS::NumberObjectImp::implementsConstruct):
1711 (KJS::NumberObjectImp::construct):
1712 (KJS::NumberObjectImp::callAsFunction):
1714 (KJS::JSObject::put):
1716 2007-12-27 Eric Seidel <eric@webkit.org>
1720 ASSERT in JavaScriptCore while viewing WICD test case
1721 http://bugs.webkit.org/show_bug.cgi?id=16626
1724 (KJS::ForInNode::execute): move KJS_CHECK_EXCEPTION to proper place
1726 2007-12-26 Jan Michael Alonzo <jmalonzo@unpluggable.com>
1728 Reviewed by Alp Toker.
1730 http://bugs.webkit.org/show_bug.cgi?id=16390
1731 Use autotools or GNU make as the build system for the GTK port
1733 * GNUmakefile.am: Added.
1735 2007-12-25 Maciej Stachowiak <mjs@apple.com>
1739 - Remove unnecessary redundant check from property setting
1740 http://bugs.webkit.org/show_bug.cgi?id=16602
1742 1.3% speedup on SunSpider.
1745 (KJS::JSObject::put): Don't do canPut check when not needed; let
1746 the PropertyMap handle it.
1747 (KJS::JSObject::canPut): Don't check the static property
1748 table. lookupPut does that already.
1750 2007-12-24 Alp Toker <alp@atoker.com>
1752 Fix builds that don't use AllInOneFile.cpp following breakage
1753 introduced in r28973.
1757 2007-12-24 Maciej Stachowiak <mjs@apple.com>
1761 - Optimize variable declarations
1762 http://bugs.webkit.org/show_bug.cgi?id=16585
1764 3.5% speedup on SunSpider.
1766 var statements now result in either assignments or empty statements.
1768 This allows a couple of optimization opportunities:
1769 - No need to branch at runtime to check if there is an initializer
1770 - EmptyStatementNodes can be removed entirely (also done in this patch)
1771 - Assignment expressions get properly optimized for local variables
1773 This patch also includes some code cleanup:
1774 - Most of the old VarStatement/VarDecl logic is now only used for const declarations,
1775 thus it is renamed appropriately
1776 - AssignExprNode is gone
1778 * JavaScriptCore.exp:
1782 (KJS::SourceElements::append):
1783 (KJS::ConstDeclNode::ConstDeclNode):
1784 (KJS::ConstDeclNode::optimizeVariableAccess):
1785 (KJS::ConstDeclNode::handleSlowCase):
1786 (KJS::ConstDeclNode::evaluateSingle):
1787 (KJS::ConstDeclNode::evaluate):
1788 (KJS::ConstStatementNode::optimizeVariableAccess):
1789 (KJS::ConstStatementNode::execute):
1790 (KJS::VarStatementNode::optimizeVariableAccess):
1791 (KJS::VarStatementNode::execute):
1792 (KJS::ForInNode::ForInNode):
1793 (KJS::ForInNode::optimizeVariableAccess):
1794 (KJS::ForInNode::execute):
1795 (KJS::FunctionBodyNode::initializeSymbolTable):
1796 (KJS::ProgramNode::initializeSymbolTable):
1797 (KJS::FunctionBodyNode::processDeclarations):
1798 (KJS::ProgramNode::processDeclarations):
1799 (KJS::EvalNode::processDeclarations):
1801 (KJS::DeclarationStacks::):
1802 (KJS::StatementNode::):
1803 (KJS::ConstDeclNode::):
1804 (KJS::ConstStatementNode::):
1805 (KJS::EmptyStatementNode::):
1806 (KJS::VarStatementNode::):
1808 * kjs/nodes2string.cpp:
1809 (KJS::ConstDeclNode::streamTo):
1810 (KJS::ConstStatementNode::streamTo):
1811 (KJS::ScopeNode::streamTo):
1812 (KJS::VarStatementNode::streamTo):
1813 (KJS::ForNode::streamTo):
1814 (KJS::ForInNode::streamTo):
1816 2007-12-21 Mark Rowe <mrowe@apple.com>
1818 Reviewed by Oliver Hunt.
1820 * JavaScriptCore.exp: Remove unused symbol to prevent a weak external symbol
1821 being generated in JavaScriptCore.framework.
1823 2007-12-21 Darin Adler <darin@apple.com>
1825 Requested by Maciej.
1827 * kjs/nodes.h: Use the new NEVER_INLINE here and eliminate the old
1828 KJS_NO_INLINE. We don't want to have two, and we figured it was better
1829 to keep the one that's in WTF.
1831 2007-12-21 Darin Adler <darin@apple.com>
1835 - http://bugs.webkit.org/show_bug.cgi?id=16561
1836 remove debugger overhead from non-debugged JavaScript execution
1838 1.022x as fast on SunSpider.
1840 * JavaScriptCore.exp: Updated.
1842 * kjs/NodeInfo.h: Renamed SourceElementsStub to SourceElements,
1843 since that more accurately describes the role of this object, which
1844 is a reference-counted wrapper for a Vector.
1847 (KJS::Parser::didFinishParsing): Changed parameter type to SourceElements,
1848 and use plain assignment instead of set.
1849 * kjs/Parser.h: Changed parameter type of didFinishParsing to a
1850 SourceElements. Also changed m_sourceElements; we now use a RefPtr instead
1851 of an OwnPtr as well.
1853 * kjs/grammar.y: Got rid of all the calls to release() on SourceElements.
1854 That's now handed inside the constructors for various node types, since we now
1855 use vector swapping instead.
1858 (KJS::Node::rethrowException): Added NEVER_INLINE, because this was getting inlined
1859 and we want exception handling out of the normal code flow.
1860 (KJS::SourceElements::append): Moved here from the header. This now handles
1861 creating a BreakpointCheckStatement for each statement in the debugger case.
1862 That way we can get breakpoint handling without having it in every execute function.
1863 (KJS::BreakpointCheckStatement::BreakpointCheckStatement): Added.
1864 (KJS::BreakpointCheckStatement::execute): Added. Contains the code that was formerly
1865 in the StatementNode::hitStatement function and the KJS_BREAKPOINT macro.
1866 (KJS::BreakpointCheckStatement::streamTo): Added.
1867 (KJS::ArgumentListNode::evaluateList): Use KJS_CHECKEXCEPTIONVOID since the return
1869 (KJS::VarStatementNode::execute): Removed KJS_BREAKPOINT.
1870 (KJS::BlockNode::BlockNode): Changed parameter type to SourceElements.
1871 Changed code to use release since the class now contains a vector rather than
1873 (KJS::BlockNode::optimizeVariableAccess): Updated since member is now a vector
1874 rather than a vector pointer.
1875 (KJS::BlockNode::execute): Ditto.
1876 (KJS::ExprStatementNode::execute): Removed KJS_BREAKPOINT.
1877 (KJS::IfNode::execute): Ditto.
1878 (KJS::IfElseNode::execute): Ditto.
1879 (KJS::DoWhileNode::execute): Ditto.
1880 (KJS::WhileNode::execute): Ditto.
1881 (KJS::ContinueNode::execute): Ditto.
1882 (KJS::BreakNode::execute): Ditto.
1883 (KJS::ReturnNode::execute): Ditto.
1884 (KJS::WithNode::execute): Ditto.
1885 (KJS::CaseClauseNode::optimizeVariableAccess): Updated since member is now a vector
1886 rather than a vector pointer.
1887 (KJS::CaseClauseNode::executeStatements): Ditto.
1888 (KJS::SwitchNode::execute): Removed KJS_BREAKPOINT.
1889 (KJS::ThrowNode::execute): Ditto.
1890 (KJS::TryNode::execute): Ditto.
1891 (KJS::ScopeNode::ScopeNode): Changed parameter type to SourceElements.
1892 (KJS::ProgramNode::ProgramNode): Ditto.
1893 (KJS::EvalNode::EvalNode): Ditto.
1894 (KJS::FunctionBodyNode::FunctionBodyNode): Ditto.
1895 (KJS::ScopeNode::optimizeVariableAccess): Updated since member is now a vector
1896 rather than a vector pointer.
1898 * kjs/nodes.h: Removed hitStatement. Renamed SourceElements to StatementVector.
1899 Renamed SourceElementsStub to SourceElements and made it derive from
1900 ParserRefCounted rather than from Node, hold a vector rather than a pointer to
1901 a vector, and changed the release function to swap with another vector rather
1902 than the pointer idiom. Updated BlockNode and CaseClauseNode to hold actual
1903 vectors instead of pointers to vectors. Added BreakpointCheckStatement.
1905 * kjs/nodes2string.cpp:
1906 (KJS::statementListStreamTo): Changed to work on a vector instead of a pointer
1908 (KJS::BlockNode::streamTo): Ditto.
1909 (KJS::CaseClauseNode::streamTo): Ditto.
1911 * wtf/AlwaysInline.h: Added NEVER_INLINE.
1912 * wtf/PassRefPtr.h: Tweaked formatting. Added clear() function that matches the
1913 ones in OwnPtr and auto_ptr.
1914 * wtf/RefPtr.h: Ditto.
1916 2007-12-21 Darin Adler <darin@apple.com>
1918 - fix broken regression tests
1920 The broken tests were fast/js/do-while-expression-value.html and
1921 fast/js/while-expression-value.html.
1923 * kjs/nodes.cpp: Check in the correct version of this file. I had accidentally landed
1924 an old version of my patch for bug 16471.
1925 (KJS::statementListExecute): The logic here was backwards. Have to set the value
1926 even for non-normal execution results.
1928 2007-12-20 Alexey Proskuryakov <ap@webkit.org>
1932 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Copy npruntime_internal.h
1935 2007-12-20 Eric Seidel <eric@webkit.org>
1939 Split IfNode into IfNode and IfElseNode for speedup.
1940 http://bugs.webkit.org/show_bug.cgi?id=16470
1942 SunSpider claims this is 1.003x as fast as before.
1943 (This required running with --runs 15 to get consistent enough results to tell!)
1947 (KJS::IfNode::optimizeVariableAccess):
1948 (KJS::IfNode::execute):
1949 (KJS::IfNode::getDeclarations):
1950 (KJS::IfElseNode::optimizeVariableAccess):
1951 (KJS::IfElseNode::execute):
1952 (KJS::IfElseNode::getDeclarations):
1955 (KJS::IfElseNode::):
1956 * kjs/nodes2string.cpp:
1957 (KJS::IfNode::streamTo):
1958 (KJS::IfElseNode::streamTo):
1960 2007-12-20 Darin Adler <darin@apple.com>
1965 (WTF::operator==): Added.
1966 (WTF::operator!=): Added.
1968 2007-12-20 Geoffrey Garen <ggaren@apple.com>
1970 Reviewed by Oliver Hunt.
1972 AST optimization: Avoid NULL-checking ForNode's child nodes.
1974 0.6% speedup on SunSpider.
1976 This is a proof of concept patch that demonstrates how to optimize
1977 grammar productions with optional components, like
1979 for (optional; optional; optional) {
1983 The parser emits NULL for an optional component that is not present.
1985 Instead of checking for a NULL child at execution time, a node that
1986 expects an optional component to be present more often than not checks
1987 for a NULL child at construction time, and substitutes a viable
1988 alternative node in its place.
1990 (We'd like the parser to start emitting NULL a lot more once we teach
1991 it to emit NULL for certain no-op productions like EmptyStatement and
1992 VariableStatement, so, as a foundation, it's important for nodes with
1993 NULL optional components to be fast.)
1996 (KJS::Parser::didFinishParsing): Check for NULL SourceElements. Also,
1997 moved didFinishParsing into the .cpp file because adding a branch while
1998 it was in the header file caused a substantial and inexplicable
1999 performance regression. (Did I mention that GCC is crazy?)
2004 (KJS::BlockNode::BlockNode): Check for NULL SourceElements.
2005 (KJS::ForNode::optimizeVariableAccess): No need to check for NULL here.
2006 (KJS::ForNode::execute): No need to check for NULL here.
2008 (KJS::ForNode::): Check for NULL SourceElements. Substitute a TrueNode
2009 because it's semantically harmless, and it evaluates to boolean in an
2012 2007-12-20 Oliver Hunt <oliver@apple.com>
2016 Slight logic reordering in JSImmediate::from(double)
2018 This gives a 0.6% improvement in SunSpider.
2020 * kjs/JSImmediate.h:
2021 (KJS::JSImmediate::from):
2023 2007-12-20 Eric Seidel <eric@webkit.org>
2027 Fix major Array regression introduced by 28899.
2029 SunSpider claims this is at least 1.37x as fast as pre-regression. :)
2031 * kjs/array_instance.cpp: make Arrays fast again!
2033 2007-12-20 Eric Seidel <eric@webkit.org>
2035 Reviewed by Geoff, then re-rubber-stamped by Geoff after final search/replace and testing.
2037 Small reworking of Date code for 4% speedup on Date tests (0.2% overall)
2038 http://bugs.webkit.org/show_bug.cgi?id=16537
2040 Make msToYear human-readable
2041 Make msToDayInMonth slightly more readable and avoid recalculating msToYear
2042 Remove use of isInLeapYear to avoid calling msToYear
2043 Remove dayInYear call by changing msToDayInMonth to dayInMonthFromDayInYear
2044 Remove more duplicate calls to dayInYear and getUTCOffset for further speedup
2047 (KJS::daysFrom1970ToYear):
2049 (KJS::monthFromDayInYear):
2051 (KJS::dayInMonthFromDayInYear):
2052 (KJS::dateToDayInYear):
2053 (KJS::getDSTOffsetSimple):
2054 (KJS::getDSTOffset):
2055 (KJS::gregorianDateTimeToMS):
2056 (KJS::msToGregorianDateTime):
2058 2007-12-20 Rodney Dawes <dobey@wayofthemonkey.com>
2060 Reviewed by Darin Adler.
2062 Proxy includes of npruntime.h or npapi.h through npruntime_internal.h
2063 Include stdio.h in npapi.h for the use of FILE with XP_UNIX defined
2064 This is for building with X11, as some type and enum names conflict
2065 with #define names in X11 headers.
2066 http://bugs.webkit.org/show_bug.cgi?id=15669
2068 * JavaScriptCore.xcodeproj/project.pbxproj:
2069 * bindings/NP_jsobject.h:
2071 * bindings/npruntime.cpp:
2072 * bindings/npruntime_impl.h:
2073 * bindings/npruntime_priv.h:
2074 * bindings/npruntime_internal.h:
2075 * bindings/testbindings.cpp:
2076 * bindings/c/c_class.h:
2077 * bindings/c/c_runtime.h:
2078 * bindings/c/c_utility.h:
2080 2007-12-20 Darin Adler <darin@apple.com>
2082 - re-fix http://bugs.webkit.org/show_bug.cgi?id=16471
2083 Completions need to be smaller (or not exist at all)
2085 Same patch as last time with the test failures problem fixed.
2088 (KJS::GlobalFuncImp::callAsFunction): Make sure to check the completion
2089 type from newExec to see if the execute raised an exception.
2091 2007-12-20 Darin Adler <darin@apple.com>
2093 - roll out that last change -- it was causing test failures;
2094 I'll check it back in after fixing them
2096 2007-12-20 Darin Adler <darin@apple.com>
2100 - http://bugs.webkit.org/show_bug.cgi?id=16471
2101 Completions need to be smaller (or not exist at all)
2103 SuSpider shows 2.4% speedup.
2105 Stop using completions in the execution engine.
2106 Instead, the completion type and label target are both
2107 stored in the ExecState.
2109 * API/JSContextRef.cpp: Removed unneeded include of "completion.h".
2110 * bindings/runtime_method.cpp: Removed unused execute function.
2111 * bindings/runtime_method.h: Ditto.
2113 * kjs/ExecState.h: Added completionType, breakOrContinueTarget,
2114 setCompletionType, setNormalCompletion, setBreakCompletion,
2115 setContinueCompletion, setReturnValueCompletion, setThrowCompletion,
2116 setInterruptedCompletion, m_completionType, and m_breakOrContinueTarget.
2118 * kjs/completion.h: Removed constructor and getter for target
2119 for break and continue from Completion. This class is now only
2120 used for the public API to Interpreter and such.
2122 * kjs/date_object.h: Removed unused execute function.
2125 (KJS::FunctionImp::callAsFunction): Removed some unneeded
2126 exception processing. Updated to call the new execute function
2127 and to get the completion type from the ExecState. Merged in
2128 the execute function, which repeated some of the same logic and
2129 was called only from here.
2130 (KJS::GlobalFuncImp::callAsFunction): More of the same for eval.
2131 * kjs/function.h: Removed execute.
2133 * kjs/interpreter.cpp:
2134 (KJS::Interpreter::evaluate): Added code to convert the result of
2135 execut into a Completion.
2138 (KJS::Node::setErrorCompletion): Renamed from createErrorCompletion.
2139 Now sets the completion type in the ExecState.
2140 (KJS::Node::rethrowException): Now sets the completion type in the
2142 (KJS::StatementNode::hitStatement): Now sets the completion type in
2144 (KJS::VarStatementNode::execute): Updated to put completion type in
2145 the ExecState instead of a Completion object.
2146 (KJS::statementListExecute): Ditto. Also changed the for loop to use
2147 indices instead of iterators.
2148 (KJS::BlockNode::execute): Updated return type.
2149 (KJS::EmptyStatementNode::execute): Updated to put completion type in
2150 the ExecState instead of a Completion object.
2151 (KJS::ExprStatementNode::execute): Ditto.
2152 (KJS::IfNode::execute): Ditto.
2153 (KJS::DoWhileNode::execute): Ditto. Also streamlined the logic a little
2154 to make the normal case a little faster and moved the end outside the
2155 loop so that "break" can do a break.
2156 (KJS::WhileNode::execute): Ditto.
2157 (KJS::ForNode::execute): Ditto.
2158 (KJS::ForInNode::execute): Ditto.
2159 (KJS::ContinueNode::execute): Updated to put completion type in
2160 the ExecState instead of a Completion object.
2161 (KJS::BreakNode::execute): Ditto.
2162 (KJS::ReturnNode::execute): Ditto.
2163 (KJS::WithNode::execute): Ditto.
2164 (KJS::CaseClauseNode::executeStatements): Ditto. Also renamed to have
2165 execute in its name to reflect the fact that it's a member of the same
2166 family of functions.
2167 (KJS::CaseBlockNode::executeBlock): Ditto.
2168 (KJS::SwitchNode::execute): Ditto.
2169 (KJS::LabelNode::execute): Ditto.
2170 (KJS::ThrowNode::execute): Ditto.
2171 (KJS::TryNode::execute): Ditto.
2172 (KJS::ProgramNode::execute): Ditto.
2173 (KJS::EvalNode::execute): Ditto.
2174 (KJS::FunctionBodyNode::execute): Ditto.
2175 (KJS::FuncDeclNode::execute): Ditto.
2177 * kjs/nodes.h: Renamed setErrorCompletion to createErrorCompletion, made
2178 hitStatement protected, changed return value of execute to a JSValue,
2179 renamed evalStatements to executeStatements, and evalBlock to executeBlock.
2181 * kjs/number_object.h: Removed unused execute function.
2183 2007-12-20 Geoffrey Garen <ggaren@apple.com>
2188 (KJS::ProgramNode::processDeclarations):
2190 2007-12-20 Geoffrey Garen <ggaren@apple.com>
2192 Linux build fix: config.h has to come first.
2194 * kjs/error_object.cpp:
2196 2007-12-19 Geoffrey Garen <ggaren@apple.com>
2198 Reviewed by Oliver Hunt.
2200 Optimized global access to global variables, using a symbol table.
2202 SunSpider reports a 1.5% overall speedup, a 6.2% speedup on 3d-morph,
2203 and a whopping 33.1% speedup on bitops-bitwise-and.
2205 * API/JSCallbackObjectFunctions.h: Replaced calls to JSObject:: with
2206 calls to Base::, since JSObject is not always our base class. This
2207 was always a bug, but the bug is even more apparent after some of my
2210 (KJS::::staticFunctionGetter): Replaced use of getDirect with call to
2211 getOwnPropertySlot. Global declarations are no longer stored in the
2212 property map, so a call to getDirect is insufficient for finding
2213 override properties.
2216 * API/testapi.js: Added test for the getDirect change mentioned above.
2218 * kjs/ExecState.cpp:
2219 * kjs/ExecState.h: Dialed back the optimization to store a direct
2220 pointer to the localStorage buffer. One ExecState can grow the global
2221 object's localStorage without another ExecState's knowledge, so
2222 ExecState can't store a direct pointer to the localStorage buffer
2223 unless/until we invent a way to update all the relevant ExecStates.
2225 * kjs/JSGlobalObject.cpp: Inserted the symbol table into get and put
2227 (KJS::JSGlobalObject::reset): Reset the symbol table and local storage,
2228 too. Also, clear the property map here, removing the need for a
2231 * kjs/JSVariableObject.cpp:
2232 * kjs/JSVariableObject.h: Added support for saving localStorage and the
2233 symbol table to the back/forward cache, and restoring them.
2236 (KJS::GlobalFuncImp::callAsFunction): Renamed progNode to evalNode
2237 because it's an EvalNode, not a ProgramNode.
2240 (KJS::cacheGlobalObject): Replaced put with faster putDirect, since
2241 that's how the rest of lookup.h works. putDirect is safe here because
2242 cacheGlobalObject is only used for objects whose names are not valid
2245 * kjs/nodes.cpp: The good stuff!
2247 (KJS::EvalNode::processDeclarations): Replaced hasProperty with
2248 the new hasOwnProperty, which is slightly faster.
2250 * kjs/object.h: Nixed clearProperties because clear() does this job now.
2252 * kjs/property_map.cpp:
2253 * kjs/property_map.h: More back/forward cache support.
2256 (WTF::::grow): Added fast non-branching grow function. I used it in
2257 an earlier version of this patch, even though it's not used anymore.
2259 2007-12-09 Mark Rowe <mrowe@apple.com>
2261 Reviewed by Oliver Hunt.
2263 Build fix for non-Mac platforms. Move NodeInfo into its own header so that the YYTYPE
2264 declaration in grammar.h is able to declare members of that type.
2266 * kjs/NodeInfo.h: Added.
2267 (KJS::createNodeInfo):
2268 (KJS::mergeDeclarationLists):
2269 (KJS::appendToVarDeclarationList):
2273 2007-12-19 Oliver Hunt <oliver@apple.com>
2275 Make appendToVarDeclarationList static
2281 2007-12-18 Oliver Hunt <oliver@apple.com>
2283 Remove dead code due to removal of post-parse declaration discovery.
2287 Due to the removal of the declaration discovery pass after parsing we
2288 no longer need any of the logic used for that discovery.
2292 (KJS::VarDeclNode::VarDeclNode):
2293 (KJS::BlockNode::BlockNode):
2294 (KJS::ForInNode::ForInNode):
2295 (KJS::CaseBlockNode::CaseBlockNode):
2297 (KJS::VarStatementNode::):
2299 (KJS::DoWhileNode::):
2304 (KJS::FuncDeclNode::):
2305 (KJS::CaseClauseNode::):
2306 (KJS::ClauseListNode::):
2307 (KJS::SwitchNode::):
2309 2007-12-18 Oliver Hunt <oliver@apple.com>
2311 Replace post-parse pass to find declarations with logic in the parser itself
2315 Instead of finding declarations in a pass following the initial parsing of
2316 a program, we incorporate the logic directly into the parser. This lays
2317 the groundwork for further optimisations (such as improving performance in
2318 declaration expressions -- var x = y; -- to match that of standard assignment)
2319 in addition to providing a 0.4% performance improvement in SunSpider.
2321 * JavaScriptCore.exp:
2323 (KJS::Parser::parse):
2325 (KJS::Parser::didFinishParsing):
2326 (KJS::Parser::parse):
2329 (KJS::ParserTracked::ParserTracked):
2330 (KJS::ParserTracked::~ParserTracked):
2331 (KJS::ParserTracked::ref):
2332 (KJS::ParserTracked::deref):
2333 (KJS::ParserTracked::refcount):
2334 (KJS::ParserTracked::clearNewTrackedObjects):
2336 (KJS::ScopeNode::ScopeNode):
2337 (KJS::ProgramNode::ProgramNode):
2338 (KJS::EvalNode::EvalNode):
2339 (KJS::FunctionBodyNode::FunctionBodyNode):
2340 (KJS::FunctionBodyNode::initializeSymbolTable):
2341 (KJS::FunctionBodyNode::processDeclarations):
2343 (KJS::ParserTracked::):
2347 2007-12-18 Xan Lopez <xan@gnome.org>
2351 Fix http://bugs.webkit.org/show_bug.cgi?id=14521
2352 Bug 14521: JavaScriptCore fails to build on Linux/PPC gcc 4.1.2
2355 (TCMalloc_SpinLock::Unlock):
2357 Use less strict memory operand constraint on inline asm generation.
2358 PLATFORM(DARWIN) left unpatched due to Apple's GCC bug.
2360 Patch by David Kilzer <ddkilzer@webkit.org>
2362 2007-12-18 Mark Rowe <mrowe@apple.com>
2364 Rubber-stamped by Maciej Stachowiak.
2366 Remove outdated and non-functioning project files for the Apollo port.
2368 * JavaScriptCore.apolloproj: Removed.
2370 2007-12-18 Darin Adler <darin@apple.com>
2374 * pcre/pcre_exec.cpp:
2375 (jsRegExpExecute): Change back from false/true to 0/1 -- I probably should not have
2376 deleted MATCH_MATCH and MATCH_NOMATCH, but I'm going to leave them out.
2378 2007-12-18 Darin Adler <darin@apple.com>
2382 - fix http://bugs.webkit.org/show_bug.cgi?id=16458
2383 REGRESSION (r28164): regular expressions can now hang due to lack of a match limit
2384 <rdar://problem/5636067>
2386 Test: fast/regex/slow.html
2388 Slows down SunSpider a bit (about 1.01x); filed a bug to follow up on that:
2389 http://bugs.webkit.org/show_bug.cgi?id=16503
2391 * pcre/pcre.h: Changed name of error code to not specifically mention "recursion".
2392 * pcre/pcre_exec.cpp:
2393 (match): Replaced the depth limit, MATCH_RECURSION_LIMIT, with a total match looping
2394 limit, matchLimit. Also eliminated the constants for MATCH_MATCH and MATCH_NOMATCH,
2395 since they are just true and false (1 and 0).
2396 (jsRegExpExecute): More of the MATCH_MATCH change.
2398 2007-12-17 Darin Adler <darin@apple.com>
2400 - speculative build fix for non-gcc platforms
2402 * pcre/pcre_exec.cpp: (match): Remove unused cases from return switch.
2404 2007-12-16 Mark Rowe <mrowe@apple.com>
2406 Speculative build fix for non-Mac platforms.
2408 * pcre/pcre_compile.cpp: Include string.h for memset, memmove, etc.
2410 2007-12-16 Darin Adler <darin@apple.com>
2414 - http://bugs.webkit.org/show_bug.cgi?id=16438
2415 - removed some more unused code
2416 - changed quite a few more names to WebKit-style
2417 - moved more things out of pcre_internal.h
2418 - changed some indentation to WebKit-style
2419 - improved design of the functions for reading and writing
2420 2-byte values from the opcode stream (in pcre_internal.h)
2422 * pcre/dftables.cpp:
2423 (main): Added the kjs prefix a normal way in lieu of using macros.
2425 * pcre/pcre_compile.cpp: Moved some definitions here from pcre_internal.h.
2426 (errorText): Name changes, fewer typedefs.
2427 (checkEscape): Ditto. Changed uppercase conversion to use toASCIIUpper.
2428 (isCountedRepeat): Name change.
2429 (readRepeatCounts): Name change.
2430 (firstSignificantOpcode): Got rid of the use of OP_lengths, which is
2431 very lightly used here. Hard-coded the length of OP_BRANUMBER.
2432 (firstSignificantOpcodeSkippingAssertions): Ditto. Also changed to
2433 use the advanceToEndOfBracket function.
2434 (getOthercaseRange): Name changes.
2435 (encodeUTF8): Ditto.
2436 (compileBranch): Name changes. Removed unused after_manual_callout and
2437 the code to handle it. Removed code to handle OP_ONCE since we never
2438 emit this opcode. Changed to use advanceToEndOfBracket in more places.
2439 (compileBracket): Name changes.
2440 (branchIsAnchored): Removed code to handle OP_ONCE since we never emit
2442 (bracketIsAnchored): Name changes.
2443 (branchNeedsLineStart): More fo the same.
2444 (bracketNeedsLineStart): Ditto.
2445 (branchFindFirstAssertedCharacter): Removed OP_ONCE code.
2446 (bracketFindFirstAssertedCharacter): More of the same.
2447 (calculateCompiledPatternLengthAndFlags): Ditto.
2448 (returnError): Name changes.
2449 (jsRegExpCompile): Ditto.
2451 * pcre/pcre_exec.cpp: Moved some definitions here from pcre_internal.h.
2452 (matchRef): Updated names.
2453 Improved macros to use the do { } while(0) idiom so they expand to single
2454 statements rather than to blocks or multiple statements. And refeactored
2455 the recursive match macros.
2456 (MatchStack::pushNewFrame): Name changes.
2457 (getUTF8CharAndIncrementLength): Name changes.
2458 (match): Name changes. Removed the ONCE opcode.
2459 (jsRegExpExecute): Name changes.
2461 * pcre/pcre_internal.h: Removed quite a few unneeded includes. Rewrote
2462 quite a few comments. Removed the macros that add kjs prefixes to the
2463 functions with external linkage; instead renamed the functions. Removed
2464 the unneeded typedefs pcre_uint16, pcre_uint32, and uschar. Removed the
2465 dead and not-all-working code for LINK_SIZE values other than 2, although
2466 we aim to keep the abstraction working. Removed the OP_LENGTHS macro.
2467 (put2ByteValue): Replaces put2ByteOpcodeValueAtOffset.
2468 (get2ByteValue): Replaces get2ByteOpcodeValueAtOffset.
2469 (put2ByteValueAndAdvance): Replaces put2ByteOpcodeValueAtOffsetAndAdvance.
2470 (putLinkValueAllowZero): Replaces putOpcodeValueAtOffset; doesn't do the
2471 addition, since a comma is really no better than a plus sign. Added an
2472 assertion to catch out of range values and changed the parameter type to
2473 int rather than unsigned.
2474 (getLinkValueAllowZero): Replaces getOpcodeValueAtOffset.
2475 (putLinkValue): New function that most former callers of the
2476 putOpcodeValueAtOffset function can use; asserts the value that is
2477 being stored is non-zero and then calls putLinkValueAllowZero.
2478 (getLinkValue): Ditto.
2479 (putLinkValueAndAdvance): Replaces putOpcodeValueAtOffsetAndAdvance. No
2480 caller was using an offset, which makes sense given the advancing behavior.
2481 (putLinkValueAllowZeroAndAdvance): Ditto.
2482 (isBracketOpcode): Added. For use in an assertion.
2483 (advanceToEndOfBracket): Renamed from moveOpcodePtrPastAnyAlternateBranches,
2484 and removed comments about how it's not well designed. This function takes
2485 a pointer to the beginning of a bracket and advances to the end of the
2488 * pcre/pcre_tables.cpp: Updated names.
2489 * pcre/pcre_ucp_searchfuncs.cpp:
2490 (kjs_pcre_ucp_othercase): Ditto.
2491 * pcre/pcre_xclass.cpp:
2492 (getUTF8CharAndAdvancePointer): Ditto.
2493 (kjs_pcre_xclass): Ditto.
2494 * pcre/ucpinternal.h: Ditto.
2497 (WTF::isASCIIAlpha): Added an int overload, like the one we already have for
2499 (WTF::isASCIIAlphanumeric): Ditto.
2500 (WTF::isASCIIHexDigit): Ditto.
2501 (WTF::isASCIILower): Ditto.
2502 (WTF::isASCIISpace): Ditto.
2503 (WTF::toASCIILower): Ditto.
2504 (WTF::toASCIIUpper): Ditto.
2506 2007-12-16 Darin Adler <darin@apple.com>
2510 - fix http://bugs.webkit.org/show_bug.cgi?id=16459
2511 REGRESSION: assertion failure with regexp with \B in a case-ignoring character range
2512 <rdar://problem/5646361>
2514 The problem was that \B was not handled properly in character classes.
2516 Test: fast/js/regexp-overflow.html
2518 * pcre/pcre_compile.cpp:
2519 (check_escape): Added handling of ESC_b and ESC_B in character classes here.
2520 Allows us to get rid of the handling of \b in character classes from all the
2521 call sites that handle it separately and to handle \B properly as well.
2522 (compileBranch): Remove the ESC_b handling, since it's not needed any more.
2523 (calculateCompiledPatternLengthAndFlags): Ditto.
2525 2007-12-16 Mark Rowe <mrowe@apple.com>
2527 Reviewed by Maciej Stachowiak.
2529 Fix http://bugs.webkit.org/show_bug.cgi?id=16448
2530 Bug 16448: [GTK] Celtic Kane JavaScript performance on Array test is slow relative to Mac
2532 * kjs/array_instance.cpp:
2533 (KJS::compareByStringPairForQSort):
2534 (KJS::ArrayInstance::sort): Convert JSValue's to strings once up front and then sort the
2535 results. This avoids calling toString twice per comparison, but requires a temporary buffer
2536 so we only use this approach in cases where the array being sorted is not too large.
2538 2007-12-16 Geoffrey Garen <ggaren@apple.com>
2540 Reviewed by Darin Adler and Maciej Stachowiak.
2542 More refactoring to support global variable optimization.
2544 Changed SymbolTable to use RefPtr<UString::Rep> as its key instead of
2545 UString::Rep*. With globals, the symbol table can outlast the
2546 declaration node for any given symbol, so the symbol table needs to ref
2549 In support, specialized HashMaps with RefPtr keys to allow lookup
2550 via raw pointer, avoiding refcount churn.
2552 SunSpider reports a .6% speedup (prolly just noise).
2554 * JavaScriptCore.vcproj/WTF/WTF.vcproj: Added new file: wtf/RefPtrHashMap.h
2555 * JavaScriptCore.xcodeproj/project.pbxproj: ditto
2557 * kjs/JSVariableObject.cpp:
2558 (KJS::JSVariableObject::getPropertyNames): Symbol table keys are RefPtrs now.
2560 * kjs/SymbolTable.h: Modified key traits to match RefPtr. Added a
2561 static Rep* for null, which helps compute the deletedValue() trait.
2563 * wtf/HashMap.h: #include the RefPtr specialization so everyone can use it.
2565 * wtf/RefPtrHashMap.h: Copied from wtf/HashMap.h. Added overloaded versions
2566 of find(), contains(), get(), set(), add(), remove(), and take() that take
2567 raw pointers as keys.
2569 2007-12-16 Alexey Proskuryakov <ap@webkit.org>
2573 http://bugs.webkit.org/show_bug.cgi?id=16162
2574 Problems with float parsing on Linux (locale-dependent parsing was used).
2576 * kjs/dtoa.cpp: Removed USE_LOCALE to reduce future confusion.
2577 * kjs/lexer.cpp: (KJS::Lexer::lex): Parse with kjs_strtod, not the system one.
2579 2007-12-14 Alp Toker <alp@atoker.com>
2581 Reviewed by Mark Rowe.
2583 Enable the AllInOneFile.cpp optimization for the GTK+ port.
2585 * JavaScriptCore.pri:
2587 2007-12-14 Mark Rowe <mrowe@apple.com>
2589 Unreviewed. Remove commented out fprintf's that were for debugging purposes only.
2591 * wtf/FastMalloc.cpp:
2592 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
2594 2007-12-14 Mark Rowe <mrowe@apple.com>
2596 Reviewed by Maciej Stachowiak.
2598 Don't use the MADV_DONTNEED code path for now as it has no effect on Mac OS X and is
2599 currently untested on other platforms.
2601 * wtf/TCSystemAlloc.cpp:
2602 (TCMalloc_SystemRelease): Return after releasing memory rather than potentially falling
2603 through into another mechanism if multiple are supported.
2605 2007-12-14 Alp Toker <alp@atoker.com>
2607 Build fix for GTK+/Qt and ports that don't use AllInOneFile.cpp.
2609 Include UnusedParam.h.
2611 * wtf/TCSystemAlloc.cpp:
2613 2007-12-14 Oliver Hunt <oliver@apple.com>
2615 Reviewed by Stephanie.
2617 Fix build on windows
2619 * wtf/FastMalloc.cpp:
2620 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
2622 2007-12-14 Dan Bernstein <mitz@apple.com>
2624 - try again to fix the Windows build
2626 * wtf/TCSystemAlloc.cpp:
2627 (TCMalloc_SystemRelease):
2629 2007-12-14 Dan Bernstein <mitz@apple.com>
2631 - try to fix the Windows build
2633 * wtf/TCSystemAlloc.cpp:
2634 (TCMalloc_SystemRelease):
2636 2007-12-14 Mark Rowe <mrowe@apple.com>
2638 Reviewed by Maciej and Oliver.
2640 Add final changes to make TCMalloc release memory to the system.
2641 This results in a 0.4% regression against ToT, but this is offset
2642 against the gains made by the original TCMalloc r38 merge - in fact
2643 we retain around 0.3-0.4% progression overall.
2645 * wtf/FastMalloc.cpp:
2646 (WTF::InitSizeClasses):
2647 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
2648 * wtf/TCSystemAlloc.cpp:
2649 (TCMalloc_SystemRelease):
2651 2007-12-14 Darin Adler <darin@apple.com>
2655 - removed unnecessary includes of "Vector.h"
2658 (WTF::copyKeysToVector): Make the type of the vector be a template parameter.
2659 This allows copying keys into a vector of a base class or one with an inline capacity.
2660 (WTF::copyValuesToVector): Ditto.
2662 (WTF::copyToVector): Ditto.
2664 2007-12-14 Anders Carlsson <andersca@apple.com>
2666 Reviewed by Darin and Geoff.
2668 <rdar://problem/5619295>
2669 REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
2671 Get rid of unnecessary and incorrect security checks for plug-ins accessing JavaScript objects.
2673 The way this used to work was that each NPObject that wrapped a JSObject would have a root object
2674 corresponding to the frame object (used for managing the lifecycle) and an origin root object (used for
2675 doing security checks).
2677 This would prevent a plug-in from accessing a frame's window object if it's security origin was different
2678 (some parts of the window, such as the location object, can be accessed from frames with different security
2679 origins, and those checks are being done in WebCore).
2681 Also, if a plug-in were to access a window object of a frame that later went away, it could lead to that
2682 Window JSObject being garbage collected and the NPObject pointing to freed memory.
2684 How this works now is that there is no origin root object anymore, and all NPObject wrappers that are created
2685 for a plug-in will have the root object of the containing frame of that plug-in.
2687 * bindings/NP_jsobject.cpp:
2689 Don't free the origin root object.
2691 (_NPN_CreateScriptObject):
2692 Remove the origin root object parameter.
2694 (_NPN_InvokeDefault):
2699 (_NPN_RemoveProperty):
2703 Get rid of all security checks.
2705 * bindings/NP_jsobject.h:
2706 Remove originRootObject from the JavaScriptObject struct.
2708 * bindings/c/c_utility.cpp:
2709 (KJS::Bindings::convertValueToNPVariant):
2710 Always use the root object from the ExecState.
2712 2007-12-13 Steve Falkenburg <sfalken@apple.com>
2714 Move source file generation into its own vcproj to fix build dependencies.
2718 * JavaScriptCore.vcproj/JavaScriptCore.sln:
2719 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2720 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added.
2721 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Added.
2722 * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln:
2724 2007-12-13 Alp Toker <alp@atoker.com>
2726 http://bugs.webkit.org/show_bug.cgi?id=16406
2727 [Gtk] JavaScriptCore needs -lpthread
2729 Build fix for Debian and any other platforms that don't implicitly
2732 Link to pthread on non-Windows platforms until this dependency is
2735 2007-12-11 Geoffrey Garen <ggaren@apple.com>
2737 Reviewed by Sam Weinig.
2739 Build fix: Note some variables that are used only for ASSERTs.
2743 (globalObject_initialize):
2744 (testInitializeFinalize):
2746 2007-12-11 Geoffrey Garen <ggaren@apple.com>
2748 Reviewed by Darin Adler.
2750 Fixed: All JS tests crash on Windows.
2752 NDEBUG wasn't defined when compiling testkjs in release builds, so the
2753 HashTable definition in HashTable.h included an extra data member.
2755 The solution was to add NDEBUG to the release testkjs configuration on
2758 For giggles, I also added other missing #defines to testkjs on Windows.
2760 * Configurations/Base.xcconfig:
2761 * Configurations/JavaScriptCore.xcconfig:
2762 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
2763 * JavaScriptCore.xcodeproj/project.pbxproj:
2767 2007-12-11 Geoffrey Garen <ggaren@apple.com>
2769 Reviewed by Darin Adler.
2771 Removed bogus ASSERT.
2773 ASSERT should only be used when we know that a code path will not be
2774 taken. This code path is taken often during the jsFunFuzz test.
2776 * pcre/pcre_exec.cpp:
2779 2007-12-11 Darin Adler <darin@apple.com>
2781 * wtf/unicode/qt4/UnicodeQt4.h: Try to fix Qt build by adding U16_IS_SINGLE.
2783 2007-12-10 Darin Adler <darin@apple.com>
2785 Reviewed by Sam Weinig.
2787 - fix http://bugs.webkit.org/show_bug.cgi?id=16379
2788 REGRESSION(r28525): Failures in http/tests/xmlhttprequest/response-encoding.html and
2789 fast/dom/xmlhttprequest-html-response-encoding.html
2790 and <rdar://problem/5640230> REGRESSION (306A4-ToT): Access violation in PCRE function
2791 find_firstassertedchar
2793 Test: fast/js/regexp-find-first-asserted.html
2795 * pcre/pcre_compile.cpp:
2796 (compileBracket): Take out unnecessary initialization of out parameters.
2797 (branchFindFirstAssertedCharacter): Added. Broke out the half of the function that handles
2799 (bracketFindFirstAssertedCharacter): Renamed from find_firstassertedchar. Also removed the
2800 options parameter -- the caller can handle the options.
2801 (jsRegExpCompile): Changed call site to call the appropriate bracket or branch version of
2802 the find_firstassertedchar function. Also put the REQ_IGNORE_CASE code here instead of
2803 passing in the options.
2805 2007-12-10 Geoffrey Garen <ggaren@apple.com>
2807 Reviewed by Sam Weinig.
2821 FunctionBodyNode ProgramNode EvalNode
2823 in preparation for specializing each class more while optimizing global
2826 Also removed some cruft from the FunctionBodyNode interface to simplify
2829 SunSpider says this patch is a .8% speedup, which seems reasonable,
2830 since it eliminates a few branches and adds KJS_FAST_CALL in a few
2833 Layout tests and JS tests pass. Also, this baby builds on Windows! (Qt
2834 mileage may vary...)
2836 2007-12-10 Geoffrey Garen <ggaren@apple.com>
2840 Mac build fix: added some exported symbols, now that Parser::parse is
2841 defined in the header.
2843 * JavaScriptCore.exp:
2845 2007-12-10 Sam Weinig <sam@webkit.org>
2849 Template methods need to be in the header.
2851 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2854 (KJS::Parser::parse):
2856 2007-12-10 Geoffrey Garen <ggaren@apple.com>
2858 Reviewed by Sam Weinig.
2860 Merged different implementations of Parser::parse into a single,
2861 templatized implementation, in preparation for adding yet another
2862 implementation for "eval" code.
2864 JS and layout tests pass.
2866 2007-12-10 Timothy Hatcher <timothy@apple.com>
2868 Reviewed by Mark Rowe
2870 <rdar://problem/5639463> Bundle versions on Tiger should be 4523.x not 523.x
2872 * Configurations/Version.xcconfig: Some Tiger versions of Xcode don't set MAC_OS_X_VERSION_MAJOR,
2873 so assume Tiger and use a 4 for the SYSTEM_VERSION_PREFIX.
2875 2007-12-10 Mark Rowe <mrowe@apple.com>
2879 * kjs/grammar.y: Use @1 and @0 in place of @$ where Tiger's bison chokes.
2881 2007-12-10 Darin Adler <darin@apple.com>
2883 Reviewed by Mark Rowe.
2885 - fix http://bugs.webkit.org/show_bug.cgi?id=16375
2886 REGRESSION: Safari crashes on quit
2888 Probably a debug-only issue.
2891 (KJS::parser): Create the parser and never destroy it by using a pointer instead
2894 2007-12-09 Darin Adler <darin@apple.com>
2896 Reviewed by Sam Weinig.
2898 - fix http://bugs.webkit.org/show_bug.cgi?id=16369
2899 REGRESSION (r28525): regular expression tests failing due to bad firstByte optimization
2901 * pcre/pcre_compile.cpp: Changed some names to use interCaps intead of under_scores.
2902 (branchIsAnchored): Broke is_anchored into two separate functions; this one works on a
2903 branch and the other on an anchor. The old function would only work on a bracket.
2904 Also removed unneeded parameters; the anchored check does not require the bracket
2905 map or the options any more because we have a reduced set of features.
2906 (bracketIsAnchored): Ditto.
2907 (branchNeedsLineStart): Broke canApplyFirstCharOptimization into two functions and gave
2908 both a better name. This is the function that was returning the wrong value. The failure
2909 was beacuse the old function would only work on a bracket.
2910 (bracketNeedsLineStart): Ditto.
2911 (jsRegExpCompile): Changed to call the appropriate branch or bracket flavor of the
2912 functions based on whether we compiled an outer bracket. Also removed inaccurate comments
2913 and unneeded parameters.
2915 - other small changes
2917 * pcre/pcre.h: Renumbered error codes, in a logical order. First, normal failure, then
2918 the recursion limit, then running out of memory, and finally an unexpected internal error.
2920 * pcre/pcre_exec.cpp: Fixed indentation.
2921 (jsRegExpExecute): Corrected an inaccurate comment.
2923 2007-12-09 Darin Adler <darin@apple.com>
2927 - fix http://bugs.webkit.org/show_bug.cgi?id=16370
2928 REGRESSION (r28540): source URL and line number no longer set for outer function/programs
2930 Test: fast/js/exception-linenums-in-html-1.html
2931 Test: fast/js/exception-linenums-in-html-2.html
2932 Test: fast/js/exception-linenums.html
2934 By the time the ProgramNode was constructed, the source URL was empty.
2937 (KJS::Parser::parseProgram): Added code to set and clear m_sourceURL, which is now
2938 handled here instead of in the lexer; it needs to still be set when we create the
2939 program node. Call setLoc to set the first and last line number.
2940 (KJS::Parser::parseFunctionBody): Ditto, but for the body.
2941 (KJS::Parser::parse): Removed the sourceURL argument.
2943 * kjs/Parser.h: Added sourceURL(), m_sourceURL, and m_lastLine. Added a lastLine
2944 parameter to didFinishParsing, since the bison grammar knows the last line number
2945 and we otherwise do not know it. Removed the sourceURL parameter from parse, since
2946 that's now handled at a higher level.
2948 * kjs/grammar.y: Pass the last line number to didFinishParsing.
2951 (KJS::Lexer::setCode): Removed the sourceURL argument and the code to set m_sourceURL.
2952 (KJS::Lexer::clear): Ditto.
2953 * kjs/lexer.h: More of the same.
2956 (KJS::FunctionBodyNode::FunctionBodyNode): Get the source URL from the parser rather
2957 than from the lexer. Removed unneeded call to setLoc, since the line numbers already
2960 2007-12-08 Oliver Hunt <oliver@apple.com>
2964 Split the ENABLE_SVG_EXPERIMENTAL_FEATURES flag into separate flags.
2966 Fixes <rdar://problem/5620249> Must disable SVG animation
2967 <rdar://problem/5612772> Disable SVG filters on Mac to match Windows behavior
2969 Minor config changes.
2971 * Configurations/JavaScriptCore.xcconfig:
2972 * JavaScriptCore.xcodeproj/project.pbxproj:
2974 2007-12-07 Sam Weinig <sam@webkit.org>
2978 - Rename isSafeScript to allowsAccessFrom.
2980 * bindings/NP_jsobject.cpp:
2982 * kjs/JSGlobalObject.h:
2983 (KJS::JSGlobalObject::allowsAccessFrom): Reverse caller/argument of allowsAccessFrom to match
2986 2007-12-07 Geoffrey Garen <ggaren@apple.com>
2988 Reviewed by Sam Weinig.
2990 Refactored variable access optimization: Removed the assumption that
2991 the FunctionBodyNode holds the symbol table.
2993 2007-12-07 Geoffrey Garen <ggaren@apple.com>
2995 Build fix: added #include.
2999 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3001 Build fix: added #include.
3003 * kjs/interpreter.cpp:
3005 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3007 Build fix: added #include.
3011 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3013 Build fix: added #include.
3015 * kjs/function_object.cpp:
3017 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3019 Reviewed by Sam Weinig.
3021 Fixed crash seen running layout tests.
3023 Reverted a change I made earlier today. Added a comment to try to
3024 discourage myself from making this mistake a third time.
3027 (KJS::ActivationImp::mark):
3029 (KJS::ActivationImp::ActivationImpData::ActivationImpData):
3031 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3033 Reviewed by Sam Weinig.
3035 Refactored parsing of global code: Removed the assumption that
3036 ProgramNode inherits from FunctionBodyNode from the parser.
3039 (KJS::Parser::parseProgram):
3040 (KJS::Parser::parseFunctionBody):
3041 (KJS::Parser::parse):
3043 (KJS::Parser::didFinishParsing):
3048 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3050 Build fix: added JSVariableObject.cpp to the .pri file.
3052 * JavaScriptCore.pri:
3054 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3056 Build fix: added #include.
3060 2007-12-07 Steve Falkenburg <sfalken@apple.com>
3062 Re-named our B&I flag from BUILDBOT to PRODUCTION.
3064 Reviewed by Sam Weinig.
3066 * JavaScriptCore.vcproj/JavaScriptCore.make:
3067 * JavaScriptCore.vcproj/testkjs/testkjs.vcproj:
3069 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3071 Build fix: removed stray name qualification.
3074 (KJS::ActivationImp::ActivationImp):
3076 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3078 Build fix: moved functions with qualified names outside of class
3081 * kjs/JSVariableObject.h:
3082 (KJS::JSVariableObject::symbolTableGet):
3083 (KJS::JSVariableObject::symbolTablePut):
3085 2007-12-07 Geoffrey Garen <ggaren@apple.com>
3087 Reviewed by Sam Weinig.
3089 Next step in refactoring JSGlobalObject: Added JSVariableObject class,
3090 and factored symbol-table-related code into it. (JSGlobalObject doesn't
3091 use the symbol table code yet, though.)
3093 Layout and JS tests, and testapi, pass. SunSpider reports no regression.
3095 2007-12-07 Darin Adler <darin@apple.com>
3099 - fix http://bugs.webkit.org/show_bug.cgi?id=16185
3100 jsRegExpCompile should not add implicit non-capturing bracket
3102 While this does not make SunSpider faster, it will make many regular
3103 expressions a bit faster.
3105 * pcre/pcre_compile.cpp: Moved CompileData struct in here from the
3106 header since it's private to this file.
3107 (compile_branch): Updated for function name change.
3108 (compile_bracket): Renamed from compile_regex, since, for one thing,
3109 this does not compile an entire regular expression.
3110 (calculateCompiledPatternLengthAndFlags): Removed unused item_count
3111 local variable. Renamed CompileData to cd instead of compile_block
3112 to be consistent with other functions. Added code to set the
3113 needOuterBracket flag if there's at least one "|" at the outer level.
3114 (jsRegExpCompile): Renamed CompileData to cd instead of compile_block
3115 to be consistent with other functions. Removed unneeded "size" field
3116 from the compiled regular expression. If no outer bracket is needed,
3117 then use compile_branch to compile the regular expression.
3119 * pcre/pcre_internal.h: Removed the CompileData struct, which is now
3120 private to pcre_compile.cpp. Removed the size member from JSRegExp.
3122 2007-12-06 Kevin Ollivier <kevino@theolliviers.com>
3124 MSVC7 build fix due to a compiler bug with placement new and/or
3125 templates and casting.
3127 Reviewed by Darin Adler.
3132 2007-12-06 Darin Adler <darin@apple.com>
3134 Reviewed by Eric Seidel.
3136 - fix http://bugs.webkit.org/show_bug.cgi?id=16321
3137 new RegExp("[\u0097]{4,6}", "gmy") crashes in DEBUG builds
3138 <rdar://problem/5632992>
3140 Test: fast/js/regexp-oveflow.html
3142 * pcre/pcre_compile.cpp:
3143 (calculateCompiledPatternLengthAndFlags): In the case where a single character
3144 character class is optimized to not use a character class at all, the preflight
3145 code was not setting the lastitemlength variable.
3147 2007-12-05 Mark Rowe <mrowe@apple.com>
3149 Qt Windows build fix. Include the time-related headers in the correct place.
3151 * kjs/JSGlobalObject.cpp:
3152 * kjs/interpreter.cpp:
3154 2007-12-05 Darin Adler <darin@apple.com>
3156 Not reviewed; just undoing a previous commit.
3158 - remove earlier incorrect fix for http://bugs.webkit.org/show_bug.cgi?id=16220
3159 <rdar://problem/5625221> Crash opening www.news.com (CNet)
3161 The real bug was the backwards ?: in the compile function, which Geoff just
3162 fixed. Rolling out the incorrect earlier fix.
3164 * pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): Take out
3165 the unneeded preflight change. The regression test proves this is still working
3166 fine, so the bug remains fixed.
3168 2007-12-01 Mark Rowe <mrowe@apple.com>
3170 Build fix. Include headers before trying to use the things that they declare.
3172 * kjs/JSImmediate.cpp:
3175 * kjs/object_object.cpp:
3176 * kjs/regexp_object.cpp:
3177 * kjs/string_object.cpp:
3179 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3181 Build fix: added some #includes.
3183 * kjs/JSImmediate.cpp:
3185 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3187 Build fix: added some #includes.
3189 * kjs/JSGlobalObject.cpp:
3190 * kjs/JSImmediate.cpp:
3192 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3194 Build fix: Fixed #include spelling.
3198 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3200 Build fix: added #include.
3204 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3206 Build fix: added a forward declaration.
3210 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3212 Build fix: added an #include.
3214 * kjs/error_object.cpp:
3216 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3218 Build fix: added an #include.
3220 * kjs/bool_object.cpp:
3222 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3224 Reviewed by Darin Adler.
3226 Third step in refactoring JSGlobalObject: Moved data members and
3227 functions accessing data members from Interpreter to JSGlobalObject.
3228 Changed Interpreter member functions to static functions.
3230 This resolves a bug in global object bootstrapping, where the global
3231 ExecState could be used when uninitialized.
3233 This is a big change, but it's mostly code motion and renaming.
3235 Layout and JS tests, and testjsglue and testapi, pass. SunSpider reports
3236 a .7% regression, but Shark sees no difference related to this patch,
3237 and SunSpider reported a .7% speedup from an earlier step in this
3238 refactoring, so I think it's fair to call that a wash.
3240 2007-12-05 Geoffrey Garen <ggaren@apple.com>
3242 Reviewed by Darin Adler. (Or vice versa.)
3244 Fixed ASSERT during run-javascriptcore-tests. (Darin just added the
3245 ASSERT, but the bug wasn't new.)
3247 * pcre/pcre_compile.cpp:
3248 (compile_branch): The ?: operator here was backwards, causing us to
3249 execute the loop too many times, adding stray KET opcodes to the
3250 compiled regular expression.
3252 2007-12-05 Kevin McCullough <kmccullough@apple.com>
3256 - Wait until local variable data is fully constructed before notifying the debugger of entering
3257 or leaving a call frame.
3260 (KJS::FunctionImp::callAsFunction):
3262 (KJS::FunctionBodyNode::execute):
3264 2007-12-05 Mark Rowe <mrowe@apple.com>
3268 Build fix for GCC 4.2. Cast via a union to avoid strict-aliasing issues.
3270 * wtf/FastMalloc.cpp:
3274 2007-12-05 Mark Rowe <mrowe@apple.com>
3278 Fix testkjs in 64-bit.
3280 When built for 64-bit the TCMalloc spin lock uses pthread mutexes rather than a custom spin lock
3281 implemented in assembly. If we fail to initialize the pthread mutex, attempts to lock or unlock
3282 it will fail and trigger a call to abort.
3284 * wtf/FastMalloc.cpp: Initialize the spin lock so that we can later lock and unlock it.
3285 * wtf/TCSpinLock.h: Add an Init method to the optimised spin lock.
3287 2007-12-04 Oliver Hunt <oliver@apple.com>
3289 Reviewed by NOBODY (Build fix).
3293 * wtf/TCSystemAlloc.cpp:
3295 2007-12-03 Oliver Hunt <oliver@apple.com>
3297 Reviewed by Mark Rowe and Geoff Garen.
3301 It also result in a performance progression between 0.5% and
3302 0.9% depending on the test, however most if not all of this
3303 gain will be consumed by the overhead involved in the later
3304 change to release memory to the system.
3306 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
3307 * JavaScriptCore.xcodeproj/project.pbxproj:
3308 * wtf/FastMalloc.cpp:
3309 (WTF::KernelSupportsTLS):
3310 (WTF::CheckIfKernelSupportsTLS):
3317 (WTF::SLL_PopRange):
3318 (WTF::SLL_PushRange):
3321 (WTF::ByteSizeForClass):
3323 (WTF::InitSizeClasses):
3324 (WTF::AllocationSize):
3325 (WTF::TCMalloc_PageHeap::GetSizeClassIfCached):
3326 (WTF::TCMalloc_PageHeap::CacheSizeClass):
3327 (WTF::TCMalloc_PageHeap::init):
3328 (WTF::TCMalloc_PageHeap::New):
3329 (WTF::TCMalloc_PageHeap::AllocLarge):
3330 (WTF::TCMalloc_PageHeap::Carve):
3331 (WTF::TCMalloc_PageHeap::Delete):
3332 (WTF::TCMalloc_PageHeap::IncrementalScavenge):
3334 (WTF::TCMalloc_PageHeap::Dump):
3335 (WTF::TCMalloc_PageHeap::GrowHeap):
3336 (WTF::TCMalloc_PageHeap::Check):
3337 (WTF::ReleaseFreeList):
3338 (WTF::TCMalloc_PageHeap::ReleaseFreePages):
3339 (WTF::TCMalloc_ThreadCache_FreeList::Push):
3340 (WTF::TCMalloc_ThreadCache_FreeList::PushRange):
3341 (WTF::TCMalloc_ThreadCache_FreeList::PopRange):
3342 (WTF::TCMalloc_ThreadCache_FreeList::Pop):
3343 (WTF::TCMalloc_Central_FreeList::length):
3344 (WTF::TCMalloc_Central_FreeList::tc_length):
3345 (WTF::TCMalloc_Central_FreeList::Init):
3346 (WTF::TCMalloc_Central_FreeList::ReleaseListToSpans):
3347 (WTF::TCMalloc_Central_FreeList::EvictRandomSizeClass):
3348 (WTF::TCMalloc_Central_FreeList::MakeCacheSpace):
3349 (WTF::TCMalloc_Central_FreeList::ShrinkCache):
3350 (WTF::TCMalloc_Central_FreeList::InsertRange):
3351 (WTF::TCMalloc_Central_FreeList::RemoveRange):
3352 (WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe):
3353 (WTF::TCMalloc_Central_FreeList::Populate):
3354 (WTF::TCMalloc_ThreadCache::Init):
3355 (WTF::TCMalloc_ThreadCache::Cleanup):
3356 (WTF::TCMalloc_ThreadCache::Allocate):
3357 (WTF::TCMalloc_ThreadCache::Deallocate):
3358 (WTF::TCMalloc_ThreadCache::FetchFromCentralCache):
3359 (WTF::TCMalloc_ThreadCache::ReleaseToCentralCache):
3360 (WTF::TCMalloc_ThreadCache::Scavenge):
3361 (WTF::TCMalloc_ThreadCache::PickNextSample):
3362 (WTF::TCMalloc_ThreadCache::NewHeap):
3363 (WTF::TCMalloc_ThreadCache::GetThreadHeap):
3364 (WTF::TCMalloc_ThreadCache::GetCache):
3365 (WTF::TCMalloc_ThreadCache::GetCacheIfPresent):
3366 (WTF::TCMalloc_ThreadCache::InitTSD):
3367 (WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
3368 (WTF::TCMallocStats::ExtractStats):
3369 (WTF::TCMallocStats::DumpStats):
3370 (WTF::TCMallocStats::DumpStackTraces):
3371 (WTF::TCMallocStats::TCMallocImplementation::MarkThreadIdle):
3372 (WTF::TCMallocStats::TCMallocImplementation::ReleaseFreeMemory):
3373 (WTF::TCMallocStats::TCMallocGuard::TCMallocGuard):
3374 (WTF::TCMallocStats::TCMallocGuard::~TCMallocGuard):
3375 (WTF::TCMallocStats::DoSampledAllocation):
3376 (WTF::TCMallocStats::CheckCachedSizeClass):
3377 (WTF::TCMallocStats::CheckedMallocResult):
3378 (WTF::TCMallocStats::SpanToMallocResult):
3379 (WTF::TCMallocStats::do_malloc):
3380 (WTF::TCMallocStats::do_free):
3381 (WTF::TCMallocStats::do_memalign):
3382 (WTF::TCMallocStats::do_malloc_stats):
3383 (WTF::TCMallocStats::do_mallopt):
3384 (WTF::TCMallocStats::do_mallinfo):
3385 (WTF::TCMallocStats::realloc):
3386 (WTF::TCMallocStats::cpp_alloc):
3387 (WTF::TCMallocStats::operator new):
3388 (WTF::TCMallocStats::):
3389 (WTF::TCMallocStats::operator new[]):
3390 (WTF::TCMallocStats::malloc_stats):
3391 (WTF::TCMallocStats::mallopt):
3392 (WTF::TCMallocStats::mallinfo):
3393 * wtf/TCPackedCache.h: Added.
3394 (PackedCache::PackedCache):
3397 (PackedCache::GetOrDefault):
3398 (PackedCache::Clear):
3399 (PackedCache::EntryToValue):
3400 (PackedCache::EntryToUpper):
3401 (PackedCache::KeyToUpper):
3402 (PackedCache::UpperToPartialKey):
3403 (PackedCache::Hash):
3404 (PackedCache::KeyMatch):
3406 (TCMalloc_PageMap2::PreallocateMoreMemory):
3407 * wtf/TCSystemAlloc.cpp:
3408 (TCMalloc_SystemRelease):
3409 * wtf/TCSystemAlloc.h:
3411 2007-12-04 Anders Carlsson <andersca@apple.com>
3415 Make isSafeScript const.
3417 * kjs/JSGlobalObject.h:
3418 (KJS::JSGlobalObject::isSafeScript):
3420 2007-12-04 Darin Adler <darin@apple.com>
3424 - fix first part of http://bugs.webkit.org/show_bug.cgi?id=16220
3425 <rdar://problem/5625221> Crash opening www.news.com (CNet)
3427 Test: fast/js/regexp-overflow.html
3429 * pcre/pcre_compile.cpp:
3430 (calculateCompiledPatternLengthAndFlags): Add room for the additional BRA/KET that
3431 was generated in the compile code but not taken into account here.
3433 2007-12-03 Darin Adler <darin@apple.com>
3437 - fix http://bugs.webkit.org/show_bug.cgi?id=15618
3438 <rdar://problem/5619353> REGRESSION: Stack overflow/crash in KJS::equal (15618)
3440 Test: fast/js/recursion-limit-equal.html
3442 * kjs/operations.cpp: (KJS::equal): Check the exception from toPrimitive.
3444 2007-12-03 Dan Bernstein <mitz@apple.com>
3446 - fix a copy-and-paste-o
3448 * bindings/npruntime.cpp:
3449 (_NPN_GetIntIdentifier):
3451 2007-12-03 Dan Bernstein <mitz@apple.com>
3453 Reviewed by Darin Adler.
3455 - fix an ASSERT when getIntIdentifier is called with 0 or -1
3457 * bindings/npruntime.cpp:
3458 (_NPN_GetIntIdentifier): We cannot use the hashmap for 0 and -1 since
3459 they are the empty value and the deleted value. Instead, keep the
3460 identifiers for those two integers in a static array.
3462 2007-12-02 Darin Adler <darin@apple.com>
3466 - fix http://bugs.webkit.org/show_bug.cgi?id=15848
3467 <rdar://problem/5619330> REGRESSION: Assertion failure viewing comments page on digg.com
3469 Test: fast/js/sparse-array.html
3471 * kjs/array_instance.cpp:
3472 (KJS::ArrayInstance::inlineGetOwnPropertySlot): Check sparse array cutoff before looking
3473 in hash map. Can't avoid the branch because we can't look for 0 in the hash.
3474 (KJS::ArrayInstance::deleteProperty): Ditto.
3476 2007-12-02 Geoffrey Garen <ggaren@apple.com>
3478 Build fix: added an #include.
3480 * kjs/collector.cpp:
3482 2007-12-02 Geoffrey Garen <ggaren@apple.com>
3484 Reviewed by Eric Seidel.
3486 Second step in refactoring JSGlobalObject: moved virtual functions from
3487 Interpreter to JSGlobalObject.
3489 Layout and JS tests pass. SunSpider reports a .7% speedup -- don't
3492 2007-12-01 Alp Toker <alp@atoker.com>
3494 Reviewed by Adam Roben.
3496 http://bugs.webkit.org/show_bug.cgi?id=16228
3497 kJSClassDefinitionEmpty is not exported with JS_EXPORT
3499 Add JS_EXPORT to kJSClassDefinitionEmpty.
3501 Make the gcc compiler check take precedence over the WIN32||_WIN32
3502 check to ensure that symbols are exported on Windows when using gcc.
3504 Add a TODO referencing the bug about JS_EXPORT in the Win build
3505 (http://bugs.webkit.org/show_bug.cgi?id=16227)
3507 Don't define JS_EXPORT as 'extern' when the compiler is unknown since
3508 it would result in the incorrect expansion:
3510 extern extern const JSClassDefinition kJSClassDefinitionEmpty;
3512 (This was something we inherited from CFBase.h that doesn't make sense
3516 * API/JSObjectRef.h:
3518 2007-11-30 Geoffrey Garen <ggaren@apple.com>
3520 Reviewed by Beth Dakin.
3522 Reversed the ownership relationship between Interpreter and JSGlobalObject.
3523 Now, the JSGlobalObject owns the Interpreter, and top-level objects
3524 that need the two to persist just protect the JSGlobalObject from GC.
3526 Global object bootstrapping looks a little odd right now, but it will
3527 make much more sense soon, after further rounds of refactoring.
3529 * bindings/runtime_root.h: Made this class inherit from RefCounted,
3530 to avoid code duplication.
3532 * kjs/collector.cpp:
3533 (KJS::Collector::collect): No need to give special GC treatment to
3534 Interpreters, since we mark their global objects, which mark them.
3536 * kjs/interpreter.cpp:
3537 (KJS::Interpreter::mark): No need to mark our global object, since it
3539 * kjs/interpreter.h: Don't inherit from RefCounted -- JSGlobalObject
3542 * kjs/testkjs.cpp: Modified to follow the new rules.
3543 (createGlobalObject):
3546 2007-11-30 Brent Fulgham <bfulgham@gmail.com>
3551 * pcre/pcre_compile.cpp:
3554 2007-11-30 Eric Seidel <eric@webkit.org>
3556 No review, build fix only.
3558 Fix uninitialized var warnings in release build.
3560 * JavaScriptCore.xcodeproj/project.pbxproj:
3561 * pcre/pcre_compile.cpp:
3564 2007-11-30 Darin Adler <darin@apple.com>
3566 Reviewed by Adam Roben.
3568 - fix http://bugs.webkit.org/show_bug.cgi?id=16207
3569 JavaScript regular expressions should match UTF-16 code units rather than characters
3571 SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.
3573 Test: fast/js/regexp-non-bmp.html
3575 Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.
3577 * pcre/pcre_compile.cpp:
3578 (compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
3579 them with simple pointer dereferences in some cases, and no code at all in others.
3580 (calculateCompiledPatternLengthAndFlags): Ditto.
3582 * pcre/pcre_exec.cpp:
3583 (match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
3584 Removed calls to the UTF-16 character accessor functions, replacing them with simple
3585 pointer dereferences in some cases, and no code at all in others. Also removed some
3586 explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
3587 in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
3588 end_subject in because it is already done outside the loop.
3591 * pcre/pcre_internal.h: Removed all the UTF-16 helper functions.
3593 2007-11-30 Eric Seidel <eric@webkit.org>
3597 PCRE crashes under GuardMalloc
3598 http://bugs.webkit.org/show_bug.cgi?id=16127
3599 check against patternEnd to make sure we don't walk off the end of the string
3601 * pcre/pcre_compile.cpp:
3603 (calculateCompiledPatternLengthAndFlags):
3605 2007-11-30 Eric Seidel <eric@webkit.org>
3609 Fix layout test regressions caused by r28186
3610 http://bugs.webkit.org/show_bug.cgi?id=16195
3611 change first_byte and req_byte back to shorts instead of chars
3612 (I think PCRE stuffs information in the high bits)
3614 * pcre/pcre_internal.h:
3616 2007-11-29 Oliver Hunt <oliver@apple.com>
3618 Reviewed by Maciej and Darin.
3620 Make the JS collector work with multiple threads
3622 Under heavy contention it was possible the GC to suspend other
3623 threads inside the pthread spinlock, which could lead to the GC
3624 thread blocking on the pthread spinlock itself.
3626 We now determine and store each thread's stack base when it is
3627 registered, thus removing the need for any calls to pthread_get_stackaddr_np
3628 that needed the pthread spinlock.
3630 * kjs/collector.cpp:
3631 (KJS::Collector::Thread::Thread):
3632 (KJS::Collector::registerThread):
3633 (KJS::Collector::markOtherThreadConservatively):
3635 2007-11-29 Adam Roben <aroben@apple.com>
3639 Removed some unreachable code (ironically, the code was some
3640 ASSERT_NOT_REACHED()s).
3642 * pcre/pcre_compile.cpp:
3644 * pcre/pcre_exec.cpp:
3647 2007-11-29 Eric Seidel <eric@webkit.org>
3649 Reviewed by Mark Rowe.
3651 Fix for --guard crash of fast/js/regexp-charclass-crash introduced by r28151.
3653 * pcre/pcre_compile.cpp:
3656 2007-11-28 Mark Rowe <mrowe@apple.com>
3658 Gtk build fix. Rubber-stamped by Eric.
3660 * pcre/pcre_exec.cpp:
3661 (match): Add braces around the body of the case statement to prevent
3662 wanings about jumps across the initialization of a variable.
3664 2007-11-29 Eric Seidel <eric@webkit.org>
3666 Reviewed by Mark Rowe.
3668 Attempt to fix non-mac builds after PCRE cleanup.
3670 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3671 * JavaScriptCoreSources.bkl:
3674 2007-11-28 Eric Seidel <eric@webkit.org>
3678 Centralize code for subjectPtr adjustments using inlines, only ever check for a single
3679 trailing surrogate (as UTF16 only allows one), possibly fix PCRE bugs involving char
3680 classes and garbled UTF16 strings.
3682 * pcre/pcre_exec.cpp:
3685 * pcre/pcre_internal.h:
3687 (movePtrToPreviousChar):
3688 (movePtrToNextChar):
3689 (movePtrToStartOfCurrentChar):
3691 2007-11-28 Eric Seidel <eric@webkit.org>
3695 change getChar* functions to return result and push 'c' into local scopes for clarity
3697 * pcre/pcre_compile.cpp:
3699 (calculateCompiledPatternLengthAndFlags):
3700 * pcre/pcre_exec.cpp:
3702 * pcre/pcre_internal.h:
3704 (getCharAndAdvance):
3706 (getCharAndAdvanceIfSurrogate):
3708 2007-11-28 Eric Seidel <eric@webkit.org>
3714 * pcre/pcre_exec.cpp:
3717 2007-11-26 Eric Seidel <eric@webkit.org>
3721 Further cleanups to calculateCompiledPatternLengthAndFlags
3723 * pcre/pcre_compile.cpp:
3724 (calculateCompiledPatternLengthAndFlags):
3725 * pcre/pcre_internal.h:
3727 2007-11-26 Eric Seidel <eric@webkit.org>
3731 Give consistent naming to the RegExp options/compile flags
3733 * pcre/pcre_compile.cpp:
3736 (find_firstassertedchar):
3737 (printCompiledRegExp):
3739 * pcre/pcre_exec.cpp:
3741 * pcre/pcre_internal.h:
3743 2007-11-26 Eric Seidel <eric@webkit.org>
3747 Pull first_byte and req_byte optimizations out into separate static funtions, SunSpider reported this as a win.
3749 * pcre/pcre_exec.cpp:
3750 (tryFirstByteOptimization):
3751 (tryRequiredByteOptimization):
3753 * pcre/pcre_internal.h:
3755 2007-11-26 Eric Seidel <eric@webkit.org>
3759 give PCRE_MULTILINE a better name: OptionMatchAcrossMultipleLines
3761 * pcre/pcre_compile.cpp:
3764 (printCompiledRegExp):
3766 * pcre/pcre_exec.cpp:
3768 * pcre/pcre_internal.h:
3770 2007-11-26 Eric Seidel <eric@webkit.org>
3774 Deprecate jsRegExpExecute's offset-vector fallback code
3776 * pcre/pcre_exec.cpp:
3779 2007-11-26 Eric Seidel <eric@webkit.org>
3783 Make cur_is_word and prev_is_word locals, and change OP_ANY to OP_ANY_CHAR for clarity
3785 * pcre/pcre_compile.cpp:
3788 (canApplyFirstCharOptimization):
3789 * pcre/pcre_exec.cpp:
3791 * pcre/pcre_internal.h:
3793 2007-11-26 Eric Seidel <eric@webkit.org>
3795 Reviewed by Mitz & Maciej.
3797 Change _NC operators to use _IGNORING_CASE for clarity
3799 * pcre/pcre_compile.cpp:
3802 (find_firstassertedchar):
3803 * pcre/pcre_exec.cpp:
3805 * pcre/pcre_internal.h:
3807 2007-11-26 Eric Seidel <eric@webkit.org>
3811 Remove branch from return
3813 * pcre/pcre_compile.cpp:
3815 * pcre/pcre_exec.cpp:
3818 2007-11-26 Eric Seidel <eric@webkit.org>
3822 Add repeatInformationFromInstructionOffset inline
3824 * pcre/pcre_exec.cpp:
3825 (repeatInformationFromInstructionOffset):
3828 2007-11-26 Eric Seidel <eric@webkit.org>
3832 Remove no longer used error code JSRegExpErrorMatchLimit
3835 (KJS::RegExp::match):
3837 * pcre/pcre_internal.h:
3839 2007-11-26 Eric Seidel <eric@webkit.org>
3843 Make i locally scoped for better code clarity
3845 * pcre/pcre_exec.cpp:
3848 2007-11-26 Eric Seidel <eric@webkit.org>
3852 Give subjectPtr and instructionPtr sane names, reduce size of MatchFrame for a 0.2% speedup.
3854 * pcre/pcre_compile.cpp:
3856 (calculateCompiledPatternLengthAndFlags):
3857 * pcre/pcre_exec.cpp:
3859 (MatchStack::pushNewFrame):
3860 (getUTF8CharAndIncrementLength):
3862 * pcre/pcre_internal.h:
3864 (getCharAndAdvance):
3866 (getCharAndAdvanceIfSurrogate):
3867 * pcre/pcre_xclass.cpp:
3868 (getUTF8CharAndAdvancePointer):
3870 2007-11-26 Eric Seidel <eric@webkit.org>
3874 Small speedup (0.7%) by simplifying canUseStackBufferForNextFrame() check
3876 * pcre/pcre_exec.cpp:
3877 (MatchStack::MatchStack):
3878 (MatchStack::popCurrentFrame):
3880 2007-11-25 Eric Seidel <eric@webkit.org>
3884 Lower MATCH_LIMIT_RECURSION to more sane levels to prevent hangs on run-javascriptcore-tests
3886 * pcre/pcre_internal.h:
3888 2007-11-25 Eric Seidel <eric@webkit.org>
3892 Remove match_is_group variable for another 5% speedup
3894 * pcre/pcre_compile.cpp:
3895 * pcre/pcre_exec.cpp:
3899 2007-11-28 Eric Seidel <eric@webkit.org>
3903 Abstract frame variables into locals and args
3905 * pcre/pcre_compile.cpp:
3907 * pcre/pcre_exec.cpp:
3909 * pcre/pcre_internal.h:
3911 2007-11-28 Eric Seidel <eric@webkit.org>
3915 Section off MatchData arguments into args struct
3917 * pcre/pcre_exec.cpp:
3918 (MatchStack::pushNewFrame):
3921 2007-11-24 Eric Seidel <eric@webkit.org>
3925 Remove redundant eptrblock struct
3927 * pcre/pcre_exec.cpp:
3928 (MatchStack::pushNewFrame):
3931 2007-11-24 Eric Seidel <eric@webkit.org>
3935 Remove redundant match_call_count and move recursion check out of super-hot code path
3936 SunSpider says this is at least an 8% speedup for regexp.
3938 * pcre/pcre_exec.cpp:
3939 (MatchStack::MatchStack):
3940 (MatchStack::pushNewFrame):
3941 (MatchStack::popCurrentFrame):
3942 (MatchStack::popAllFrames):
3945 * pcre/pcre_internal.h:
3947 2007-11-24 Eric Seidel <eric@webkit.org>
3951 Get rid of GETCHAR* macros, replacing them with better named inlines
3953 * pcre/pcre_compile.cpp:
3955 (calculateCompiledPatternLengthAndFlags):
3956 * pcre/pcre_exec.cpp:
3958 * pcre/pcre_internal.h:
3959 (getCharAndAdvance):
3961 (getCharAndAdvanceIfSurrogate):
3963 2007-11-24 Eric Seidel <eric@webkit.org>
3967 Further cleanup GET/PUT inlines
3969 * pcre/pcre_internal.h:
3970 (putOpcodeValueAtOffset):
3971 (getOpcodeValueAtOffset):
3972 (putOpcodeValueAtOffsetAndAdvance):
3973 (put2ByteOpcodeValueAtOffset):
3974 (get2ByteOpcodeValueAtOffset):
3975 (put2ByteOpcodeValueAtOffsetAndAdvance):
3977 2007-11-24 Eric Seidel <eric@webkit.org>
3981 Give GET, PUT better names, and add (poor) moveOpcodePtrPastAnyAlternateBranches
3983 * pcre/pcre_compile.cpp:
3984 (firstSignificantOpCodeSkippingAssertions):
3990 (canApplyFirstCharOptimization):
3991 (find_firstassertedchar):
3992 * pcre/pcre_exec.cpp:
3994 * pcre/pcre_internal.h:
3995 (putOpcodeValueAtOffset):
3996 (getOpcodeValueAtOffset):
3997 (putOpcodeValueAtOffsetAndAdvance):
3998 (put2ByteOpcodeValueAtOffset):
3999 (get2ByteOpcodeValueAtOffset):
4000 (moveOpcodePtrPastAnyAlternateBranches):
4001 * pcre/pcre_ucp_searchfuncs.cpp:
4002 (_pcre_ucp_othercase):
4004 2007-11-24 Eric Seidel <eric@webkit.org>
4008 Add inlines for toLowerCase, isWordChar, isSpaceChar for further regexp speedup
4010 * pcre/pcre_compile.cpp:
4013 * pcre/pcre_exec.cpp:
4016 * pcre/pcre_internal.h:
4019 (classBitmapForChar):
4023 (CompileData::CompileData):
4024 * pcre/pcre_xclass.cpp:
4027 2007-11-24 Eric Seidel <eric@webkit.org>
4031 cleanup _pcre_ucp_othercase
4033 * pcre/pcre_ucp_searchfuncs.cpp:
4034 (_pcre_ucp_othercase):
4036 2007-11-24 Eric Seidel <eric@webkit.org>
4040 Use better variable names for case ignoring options
4042 * pcre/pcre_compile.cpp:
4044 (find_firstassertedchar):
4045 (printCompiledRegExp):
4047 * pcre/pcre_exec.cpp:
4051 * pcre/pcre_internal.h:
4053 2007-11-24 Eric Seidel <eric@webkit.org>
4057 split first_significant_code into two simpler functions
4059 * pcre/pcre_compile.cpp:
4060 (firstSignificantOpCode):
4061 (firstSignificantOpCodeSkippingAssertions):
4063 (canApplyFirstCharOptimization):
4064 (find_firstassertedchar):
4066 2007-11-24 Eric Seidel <eric@webkit.org>
4070 clean up is_counted_repeat
4072 * pcre/pcre_compile.cpp:
4073 (is_counted_repeat):
4075 2007-11-24 Eric Seidel <eric@webkit.org>
4079 clean up check_escape
4081 * pcre/pcre_compile.cpp:
4084 2007-11-24 Eric Seidel <eric@webkit.org>
4088 Reformat find_fixedlength
4090 * pcre/pcre_compile.cpp:
4093 2007-11-24 Eric Seidel <eric@webkit.org>
4097 reformat is_anchored
4099 * pcre/pcre_compile.cpp:
4102 2007-11-24 Eric Seidel <eric@webkit.org>
4106 Remove unused function could_be_empty_branch
4108 * pcre/pcre_compile.cpp:
4109 (first_significant_code):
4112 (canApplyFirstCharOptimization):
4114 2007-11-24 Eric Seidel <eric@webkit.org>
4118 Pass around MatchData objects by reference
4120 * pcre/pcre_exec.cpp:
4126 2007-11-24 Eric Seidel <eric@webkit.org>
4130 give PCRE_STARTLINE a better name and rename match_data to MatchData
4132 * pcre/pcre_compile.cpp:
4134 (canApplyFirstCharOptimization):
4135 (find_firstassertedchar):
4136 (printCompiledRegExp):
4138 * pcre/pcre_exec.cpp:
4141 * pcre/pcre_internal.h:
4143 2007-11-24 Eric Seidel <eric@webkit.org>
4147 Clean up find_firstassertedchar
4149 * pcre/pcre_compile.cpp:
4150 (get_othercase_range):
4151 (find_firstassertedchar):
4152 (calculateCompiledPatternLengthAndFlags):
4154 2007-11-24 Eric Seidel <eric@webkit.org>
4156 Reviewed by Tim Hatcher.
4158 Pass around CompileData& instead of CompileData*
4160 * pcre/pcre_compile.cpp:
4164 2007-11-24 Eric Seidel <eric@webkit.org>
4168 Clean up compile_branch, move _pcre_ord2utf8, and rename CompileData
4170 * JavaScriptCore.xcodeproj/project.pbxproj:
4171 * pcre/pcre_compile.cpp:
4173 (calculateCompiledPatternLengthAndFlags):
4175 * pcre/pcre_internal.h:
4176 * pcre/pcre_ord2utf8.cpp: Removed.
4178 2007-11-24 Eric Seidel <eric@webkit.org>
4182 removing more macros
4184 * pcre/pcre_compile.cpp:
4185 (could_be_empty_branch):
4187 (calculateCompiledPatternLengthAndFlags):
4188 * pcre/pcre_exec.cpp:
4191 * pcre/pcre_internal.h:
4192 * pcre/pcre_xclass.cpp:
4194 2007-11-24 Eric Seidel <eric@webkit.org>
4198 clean up formating in compile_branch
4200 * pcre/pcre_compile.cpp: