4755eda6c94b9ad1f320160ece84ab33055ec8a7
[WebKit-https.git] / JavaScriptCore / ChangeLog
1 2008-06-25  Alexey Proskuryakov  <ap@webkit.org>
2
3         Forgot to address a review comment about better names for tracked objects, doing it now.
4
5         * kjs/JSGlobalData.cpp:
6         (KJS::JSGlobalData::JSGlobalData):
7         * kjs/JSGlobalData.h:
8         * kjs/nodes.cpp:
9         (KJS::ParserRefCounted::ParserRefCounted):
10         (KJS::ParserRefCounted::ref):
11         (KJS::ParserRefCounted::deref):
12         (KJS::ParserRefCounted::hasOneRef):
13         (KJS::ParserRefCounted::deleteNewObjects):
14
15 2008-06-25  Alexey Proskuryakov  <ap@webkit.org>
16
17         Reviewed by Geoff.
18
19         Remove more threadInstance() calls.
20
21         * kjs/JSFunction.cpp:
22         (KJS::JSFunction::getParameterName):
23         (KJS::IndexToNameMap::unMap):
24         (KJS::Arguments::deleteProperty):
25         * kjs/JSFunction.h:
26         Access nullIdentifier without going to thread specific storage.
27
28         * JavaScriptCore.exp:
29         * kjs/JSGlobalData.cpp:
30         (KJS::JSGlobalData::JSGlobalData):
31         * kjs/JSGlobalData.h:
32         * kjs/Parser.cpp:
33         (KJS::Parser::parse):
34         * kjs/Parser.h:
35         (KJS::ParserRefCountedData::ParserRefCountedData):
36         (KJS::Parser::parse):
37         * kjs/grammar.y:
38         * kjs/nodes.cpp:
39         (KJS::ParserRefCounted::ParserRefCounted):
40         (KJS::ParserRefCounted::ref):
41         (KJS::ParserRefCounted::deref):
42         (KJS::ParserRefCounted::hasOneRef):
43         (KJS::ParserRefCounted::deleteNewObjects):
44         (KJS::Node::Node):
45         (KJS::StatementNode::StatementNode):
46         (KJS::BreakpointCheckStatement::BreakpointCheckStatement):
47         (KJS::ConstDeclNode::ConstDeclNode):
48         (KJS::BlockNode::BlockNode):
49         (KJS::ForInNode::ForInNode):
50         (KJS::ScopeNode::ScopeNode):
51         (KJS::ProgramNode::ProgramNode):
52         (KJS::ProgramNode::create):
53         (KJS::EvalNode::EvalNode):
54         (KJS::EvalNode::create):
55         (KJS::FunctionBodyNode::FunctionBodyNode):
56         (KJS::FunctionBodyNode::create):
57         * kjs/nodes.h:
58         (KJS::ExpressionNode::):
59         (KJS::NullNode::):
60         (KJS::BooleanNode::):
61         (KJS::NumberNode::):
62         (KJS::ImmediateNumberNode::):
63         (KJS::StringNode::):
64         (KJS::RegExpNode::):
65         (KJS::ThisNode::):
66         (KJS::ResolveNode::):
67         (KJS::ElementNode::):
68         (KJS::ArrayNode::):
69         (KJS::PropertyNode::):
70         (KJS::PropertyListNode::):
71         (KJS::ObjectLiteralNode::):
72         (KJS::BracketAccessorNode::):
73         (KJS::DotAccessorNode::):
74         (KJS::ArgumentListNode::):
75         (KJS::ArgumentsNode::):
76         (KJS::NewExprNode::):
77         (KJS::EvalFunctionCallNode::):
78         (KJS::FunctionCallValueNode::):
79         (KJS::FunctionCallResolveNode::):
80         (KJS::FunctionCallBracketNode::):
81         (KJS::FunctionCallDotNode::):
82         (KJS::PrePostResolveNode::):
83         (KJS::PostIncResolveNode::):
84         (KJS::PostDecResolveNode::):
85         (KJS::PostfixBracketNode::):
86         (KJS::PostIncBracketNode::):
87         (KJS::PostDecBracketNode::):
88         (KJS::PostfixDotNode::):
89         (KJS::PostIncDotNode::):
90         (KJS::PostDecDotNode::):
91         (KJS::PostfixErrorNode::):
92         (KJS::DeleteResolveNode::):
93         (KJS::DeleteBracketNode::):
94         (KJS::DeleteDotNode::):
95         (KJS::DeleteValueNode::):
96         (KJS::VoidNode::):
97         (KJS::TypeOfResolveNode::):
98         (KJS::TypeOfValueNode::):
99         (KJS::PreIncResolveNode::):
100         (KJS::PreDecResolveNode::):
101         (KJS::PrefixBracketNode::):
102         (KJS::PreIncBracketNode::):
103         (KJS::PreDecBracketNode::):
104         (KJS::PrefixDotNode::):
105         (KJS::PreIncDotNode::):
106         (KJS::PreDecDotNode::):
107         (KJS::PrefixErrorNode::):
108         (KJS::UnaryOpNode::UnaryOpNode):
109         (KJS::UnaryPlusNode::):
110         (KJS::NegateNode::):
111         (KJS::BitwiseNotNode::):
112         (KJS::LogicalNotNode::):
113         (KJS::BinaryOpNode::BinaryOpNode):
114         (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
115         (KJS::MultNode::):
116         (KJS::DivNode::):
117         (KJS::ModNode::):
118         (KJS::AddNode::):
119         (KJS::SubNode::):
120         (KJS::LeftShiftNode::):
121         (KJS::RightShiftNode::):
122         (KJS::UnsignedRightShiftNode::):
123         (KJS::LessNode::):
124         (KJS::GreaterNode::):
125         (KJS::LessEqNode::):
126         (KJS::GreaterEqNode::):
127         (KJS::InstanceOfNode::):
128         (KJS::InNode::):
129         (KJS::EqualNode::):
130         (KJS::NotEqualNode::):
131         (KJS::StrictEqualNode::):
132         (KJS::NotStrictEqualNode::):
133         (KJS::BitAndNode::):
134         (KJS::BitOrNode::):
135         (KJS::BitXOrNode::):
136         (KJS::LogicalAndNode::):
137         (KJS::LogicalOrNode::):
138         (KJS::ConditionalNode::):
139         (KJS::ReadModifyResolveNode::):
140         (KJS::AssignResolveNode::):
141         (KJS::ReadModifyBracketNode::):
142         (KJS::AssignBracketNode::):
143         (KJS::AssignDotNode::):
144         (KJS::ReadModifyDotNode::):
145         (KJS::AssignErrorNode::):
146         (KJS::CommaNode::):
147         (KJS::VarDeclCommaNode::):
148         (KJS::ConstStatementNode::):
149         (KJS::SourceElements::SourceElements):
150         (KJS::EmptyStatementNode::):
151         (KJS::DebuggerStatementNode::):
152         (KJS::ExprStatementNode::):
153         (KJS::VarStatementNode::):
154         (KJS::IfNode::):
155         (KJS::IfElseNode::):
156         (KJS::DoWhileNode::):
157         (KJS::WhileNode::):
158         (KJS::ForNode::):
159         (KJS::ContinueNode::):
160         (KJS::BreakNode::):
161         (KJS::ReturnNode::):
162         (KJS::WithNode::):
163         (KJS::LabelNode::):
164         (KJS::ThrowNode::):
165         (KJS::TryNode::):
166         (KJS::ParameterNode::):
167         (KJS::FuncExprNode::):
168         (KJS::FuncDeclNode::):
169         (KJS::CaseClauseNode::):
170         (KJS::ClauseListNode::):
171         (KJS::CaseBlockNode::):
172         (KJS::SwitchNode::):
173         Changed ParserRefCounted to hold a JSGlobalData pointer, and used it to replace
174         threadInstance calls.
175
176 2008-06-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
177
178         Reviewed by Alexey Proskuryakov.
179
180         Make the JavaScript shell collect the heap from main() instead of
181         jscmain() to suppress leak messages in debug builds.
182
183         * kjs/Shell.cpp:
184         (main):
185         (jscmain):
186
187 2008-06-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
188
189         Reviewed by Maciej.
190
191         Make the conversion of the pair (less, jtrue) to jless use register
192         reference counting information for safety instead of requiring callers
193         to decide whether it is safe.
194
195         No changes on SunSpider codegen.
196
197         * VM/CodeGenerator.cpp:
198         (KJS::CodeGenerator::emitJumpIfTrue):
199         * VM/CodeGenerator.h:
200         * kjs/nodes.cpp:
201         (KJS::DoWhileNode::emitCode):
202         (KJS::WhileNode::emitCode):
203         (KJS::ForNode::emitCode):
204         (KJS::CaseBlockNode::emitCodeForBlock):
205
206 2008-06-24  Kevin McCullough  <kmccullough@apple.com>
207
208         Reviewed by Tim.
209
210         <rdar://problem/6031594> JSProfiler: Profiler goes into an infinite
211         loop sometimes.
212         <rdar://problem/6031603> JSProfiler: Profiler asserts in debug and
213         give the wrong times in release
214
215         Fixed two issues found by Tim in the same test.
216
217         * profiler/Profile.cpp:
218         (KJS::Profile::removeProfileStart): No longer take profile's time from
219         all ancestors, but instead attribute it to its parent.  Also add an
220         Assert to ensure we only delete the child we mean to.
221         (KJS::Profile::removeProfileEnd): Ditto for profileEnd.
222         (KJS::Profile::didExecute): Cleaned up the execution order and correctly
223         attribute all of the parent's time to the new node.
224         * profiler/ProfileNode.cpp: If this node does not have a startTime it
225         should not get a giant total time, but instead be 0.
226         (KJS::ProfileNode::endAndRecordCall):
227         * profiler/ProfileNode.h:
228         (KJS::ProfileNode::removeChild): Should reset the sibling pointers since
229         one of them has been removed.
230
231 2008-06-24  Darin Adler  <darin@apple.com>
232
233         Reviewed by Cameron.
234
235         - fix https://bugs.webkit.org/show_bug.cgi?id=19739
236           REGRESSION: fast/js/property-getters-and-setters.html fails
237
238         * kjs/JSObject.cpp:
239         (KJS::JSObject::put): Remove an untested optimization I checked in by accident.
240         The two loops up the prototype chain both need to start from this; instead the
241         second loop was starting where the first loop left off.
242
243 2008-06-24  Steve Falkenburg  <sfalken@apple.com>
244
245         Build fix.
246
247         * kjs/nodes.cpp:
248
249 2008-06-24  Joerg Bornemann  <joerg.bornemann@trolltech.com>
250
251         Reviewed by Simon.
252
253         For the Qt build on Windows don't depend on the presence of GNU CPP
254         but use MSVC's preprocessor instead.
255         dftables accepts a --preprocessor option which is set in pcre.pri for MSVC platforms.
256
257         * pcre/dftables: Added support for specifying the preprocessor command
258         to use via --preprocessor, similar to
259         WebCore/bindings/scripts/generate-bindings.pl.
260         * pcre/pcre.pri: Pass --preprocessor='cl /e' to dftables, or more
261         generally speaking QMAKE_CC /E for the win32-msvc buildspecs.
262
263 2008-06-24  Simon Hausmann  <hausmann@webkit.org>
264
265         Fix the Qt build, added missing include.
266
267         * kjs/PropertySlot.cpp:
268
269 2008-06-24  Alexey Proskuryakov  <ap@webkit.org>
270
271         Reviewed by Cameron Zwarich.
272
273         Make ParserRefCountedCounter actually perform a leak check.
274
275         * kjs/nodes.cpp:
276         (KJS::ParserRefCountedCounter::~ParserRefCountedCounter): Check for leaks in destructor,
277         not in constructor.
278         (KJS::ParserRefCountedCounter::increment):
279         (KJS::ParserRefCountedCounter::decrement):
280         (KJS::ParserRefCounted::ParserRefCounted):
281         (KJS::ParserRefCounted::~ParserRefCounted):
282         While at it, also made counting thread-safe.
283
284 2008-06-24  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
285
286         Reviewed by Oliver.
287
288         Bug 19730: REGRESSION (r34497): Text in alerts in "Leisure suit Larry" is not wrapped
289         <https://bugs.webkit.org/show_bug.cgi?id=19730>
290
291         Do not convert the pair (less, jtrue) to jless when jtrue is a jump
292         target. An example of this is when the condition of a while loop is a
293         LogicalOrNode.
294
295         * VM/CodeGenerator.cpp:
296         (KJS::CodeGenerator::emitLabel):
297
298 2008-06-20  Ariya Hidayat  <ariya.hidayat@trolltech.com>
299
300         Reviewed by Adam Roben.
301
302         Fix compile with MinGW.
303
304         * kjs/Shell.cpp:
305         * wtf/Threading.h:
306         (WTF::atomicIncrement):
307         (WTF::atomicDecrement):
308
309 2008-06-23  Mark Rowe  <mrowe@apple.com>
310
311         Reviewed by Oliver Hunt.
312
313         Prepration for returning memory to the OS on Windows.  Track whether a portion of a span of memory was returned to the OS.
314         If it was, ask that it be recommitted before returning it to the application as an allocated region.
315
316         * wtf/FastMalloc.cpp:
317         (WTF::TCMalloc_PageHeap::New):  If the span was decommitted, ask that it be recommitted before returning it.
318         (WTF::TCMalloc_PageHeap::AllocLarge):  Ditto.
319         (WTF::TCMalloc_PageHeap::Carve):  When splitting a span, ensure that the decommitted state propogates to the two new spans.
320         (WTF::TCMalloc_PageHeap::Delete):  When merging a span, ensure that the resulting span is marked as decommitted if any of the
321         spans being merged were marked as decommitted.
322         (WTF::TCMalloc_PageHeap::IncrementalScavenge):  Mark as decommitted after releasing the span.
323         (WTF::TCMalloc_Central_FreeList::FetchFromSpans): Add an assertion to catch a decommitted span being returned to the application
324         without first being recommitted.
325         (WTF::TCMalloc_Central_FreeList::Populate): Ditto.
326         * wtf/TCSystemAlloc.cpp: Stub out TCMalloc_SystemCommit.
327         * wtf/TCSystemAlloc.h:
328
329 2008-06-23  Mark Rowe  <mrowe@apple.com>
330
331         Reviewed by Sam Weinig.
332
333         Remove the sample member of Span when NO_TCMALLOC_SAMPLES is defined.
334
335         * wtf/FastMalloc.cpp:
336         (WTF::TCMalloc_PageHeap::Delete): Only update Span::sample if NO_TCMALLOC_SAMPLES is not defined.
337         (WTF::TCMallocStats::do_free):  Ditto.
338
339 2008-06-23  Darin Adler  <darin@apple.com>
340
341         Reviewed by Geoff.
342
343         - work toward https://bugs.webkit.org/show_bug.cgi?id=19721
344
345         More preparation toward making functions work on primitive types without
346         creating wrapper objects. No speedup this time, but prepares for a future
347         speedup without slowing things down.
348
349         SunSpider reports no change.
350
351         - Eliminated the implementsCall, callAsFunction and construct virtual
352           functions from JSObject. Instead, the CallData and ConstructData for
353           a native function includes a function pointer that the caller can use
354           directly. Changed all call sites to use CallData and ConstructData.
355
356         - Changed the "this" argument to native functions to be a JSValue rather
357           than a JSObject. This prepares us for passing primitives into these
358           functions. The conversion to an object now must be done inside the
359           function. Critically, if it's a function that can be called on a DOM
360           window object, then we have to be sure to call toThisObject on the
361           argument before we use it for anything even if it's already an object.
362
363         - Eliminated the practice of using constructor objects in the global
364           object to make objects of the various basic types. Since these
365           constructors can't be replaced by script, there's no reason to involve
366           a constructor object at all. Added functions to do the construction
367           directly.
368
369         - Made some more class members private and protected, including virtual
370           function overrides. This can catch code using unnecessarily slow virtual
371           function code paths when the type of an object is known statically. If we
372           later find a new reason use the members outside the class it's easy to
373           make them public again.
374
375         - Moved the declarations of the native implementations for functions out
376           of header files. These can have internal linkage and be declared inside
377           the source file.
378
379         - Changed PrototypeFunction to take function pointers with the right
380           arguments to be put directly into CallData. This eliminates the
381           need to have a separate PrototypeReflexiveFunction, and reveals that the
382           real purpose of that class included something else specific to eval --
383           storage of a cached global object. So renamed PrototypeReflexiveFunction
384           to GlobalEvalFunction.
385
386         * API/JSCallbackConstructor.cpp:
387         (KJS::constructJSCallback):
388         (KJS::JSCallbackConstructor::getConstructData):
389         * API/JSCallbackConstructor.h:
390         * API/JSCallbackFunction.cpp:
391         (KJS::JSCallbackFunction::implementsHasInstance):
392         (KJS::JSCallbackFunction::call):
393         (KJS::JSCallbackFunction::getCallData):
394         * API/JSCallbackFunction.h:
395         (KJS::JSCallbackFunction::classInfo):
396         * API/JSCallbackObject.h:
397         (KJS::JSCallbackObject::classRef):
398         (KJS::JSCallbackObject::classInfo):
399         * API/JSCallbackObjectFunctions.h:
400         (KJS::::getConstructData):
401         (KJS::::construct):
402         (KJS::::getCallData):
403         (KJS::::call):
404         * API/JSObjectRef.cpp:
405         (JSObjectMakeFunction):
406         (JSObjectIsFunction):
407         (JSObjectCallAsFunction):
408         (JSObjectCallAsConstructor):
409         * JavaScriptCore.exp:
410         * VM/Machine.cpp:
411         (KJS::jsTypeStringForValue):
412         (KJS::Machine::privateExecute):
413         * kjs/ArrayPrototype.cpp:
414         (KJS::arrayProtoFuncToString):
415         (KJS::arrayProtoFuncToLocaleString):
416         (KJS::arrayProtoFuncJoin):
417         (KJS::arrayProtoFuncConcat):
418         (KJS::arrayProtoFuncPop):
419         (KJS::arrayProtoFuncPush):
420         (KJS::arrayProtoFuncReverse):
421         (KJS::arrayProtoFuncShift):
422         (KJS::arrayProtoFuncSlice):
423         (KJS::arrayProtoFuncSort):
424         (KJS::arrayProtoFuncSplice):
425         (KJS::arrayProtoFuncUnShift):
426         (KJS::arrayProtoFuncFilter):
427         (KJS::arrayProtoFuncMap):
428         (KJS::arrayProtoFuncEvery):
429         (KJS::arrayProtoFuncForEach):
430         (KJS::arrayProtoFuncSome):
431         (KJS::arrayProtoFuncIndexOf):
432         (KJS::arrayProtoFuncLastIndexOf):
433         (KJS::ArrayConstructor::ArrayConstructor):
434         (KJS::constructArrayWithSizeQuirk):
435         (KJS::constructWithArrayConstructor):
436         (KJS::ArrayConstructor::getConstructData):
437         (KJS::callArrayConstructor):
438         (KJS::ArrayConstructor::getCallData):
439         * kjs/ArrayPrototype.h:
440         * kjs/BooleanObject.cpp:
441         (KJS::booleanProtoFuncToString):
442         (KJS::booleanProtoFuncValueOf):
443         (KJS::constructBoolean):
444         (KJS::constructWithBooleanConstructor):
445         (KJS::BooleanConstructor::getConstructData):
446         (KJS::callBooleanConstructor):
447         (KJS::BooleanConstructor::getCallData):
448         (KJS::constructBooleanFromImmediateBoolean):
449         * kjs/BooleanObject.h:
450         * kjs/CallData.h:
451         (KJS::):
452         * kjs/ConstructData.h:
453         (KJS::):
454         * kjs/FunctionPrototype.cpp:
455         (KJS::callFunctionPrototype):
456         (KJS::FunctionPrototype::getCallData):
457         (KJS::functionProtoFuncToString):
458         (KJS::functionProtoFuncApply):
459         (KJS::functionProtoFuncCall):
460         (KJS::constructWithFunctionConstructor):
461         (KJS::FunctionConstructor::getConstructData):
462         (KJS::callFunctionConstructor):
463         (KJS::FunctionConstructor::getCallData):
464         (KJS::constructFunction):
465         * kjs/FunctionPrototype.h:
466         * kjs/JSArray.cpp:
467         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
468         (KJS::JSArray::sort):
469         (KJS::constructEmptyArray):
470         (KJS::constructArray):
471         * kjs/JSArray.h:
472         (KJS::JSArray::classInfo):
473         * kjs/JSFunction.cpp:
474         (KJS::JSFunction::call):
475         (KJS::globalFuncEval):
476         (KJS::globalFuncParseInt):
477         (KJS::globalFuncParseFloat):
478         (KJS::globalFuncIsNaN):
479         (KJS::globalFuncIsFinite):
480         (KJS::globalFuncDecodeURI):
481         (KJS::globalFuncDecodeURIComponent):
482         (KJS::globalFuncEncodeURI):
483         (KJS::globalFuncEncodeURIComponent):
484         (KJS::globalFuncEscape):
485         (KJS::globalFuncUnescape):
486         (KJS::globalFuncKJSPrint):
487         (KJS::PrototypeFunction::PrototypeFunction):
488         (KJS::PrototypeFunction::getCallData):
489         (KJS::GlobalEvalFunction::GlobalEvalFunction):
490         (KJS::GlobalEvalFunction::mark):
491         * kjs/JSFunction.h:
492         (KJS::InternalFunction::classInfo):
493         (KJS::InternalFunction::functionName):
494         (KJS::JSFunction::classInfo):
495         (KJS::GlobalEvalFunction::cachedGlobalObject):
496         * kjs/JSGlobalObject.cpp:
497         (KJS::JSGlobalObject::reset):
498         (KJS::JSGlobalObject::mark):
499         * kjs/JSGlobalObject.h:
500         (KJS::JSGlobalObject::JSGlobalObject):
501         (KJS::JSGlobalObject::evalFunction):
502         * kjs/JSImmediate.cpp:
503         (KJS::JSImmediate::toObject):
504         * kjs/JSNotAnObject.cpp:
505         * kjs/JSNotAnObject.h:
506         * kjs/JSObject.cpp:
507         (KJS::JSObject::put):
508         (KJS::callDefaultValueFunction):
509         (KJS::JSObject::defaultValue):
510         (KJS::JSObject::lookupGetter):
511         (KJS::JSObject::lookupSetter):
512         (KJS::JSObject::hasInstance):
513         (KJS::JSObject::fillGetterPropertySlot):
514         (KJS::Error::create):
515         (KJS::constructEmptyObject):
516         * kjs/JSObject.h:
517         (KJS::GetterSetter::GetterSetter):
518         (KJS::GetterSetter::getter):
519         (KJS::GetterSetter::setGetter):
520         (KJS::GetterSetter::setter):
521         (KJS::GetterSetter::setSetter):
522         * kjs/JSValue.cpp:
523         (KJS::JSCell::deleteProperty):
524         (KJS::call):
525         (KJS::construct):
526         * kjs/JSValue.h:
527         * kjs/MathObject.cpp:
528         (KJS::mathProtoFuncAbs):
529         (KJS::mathProtoFuncACos):
530         (KJS::mathProtoFuncASin):
531         (KJS::mathProtoFuncATan):
532         (KJS::mathProtoFuncATan2):
533         (KJS::mathProtoFuncCeil):
534         (KJS::mathProtoFuncCos):
535         (KJS::mathProtoFuncExp):
536         (KJS::mathProtoFuncFloor):
537         (KJS::mathProtoFuncLog):
538         (KJS::mathProtoFuncMax):
539         (KJS::mathProtoFuncMin):
540         (KJS::mathProtoFuncPow):
541         (KJS::mathProtoFuncRandom):
542         (KJS::mathProtoFuncRound):
543         (KJS::mathProtoFuncSin):
544         (KJS::mathProtoFuncSqrt):
545         (KJS::mathProtoFuncTan):
546         * kjs/MathObject.h:
547         * kjs/NumberObject.cpp:
548         (KJS::numberProtoFuncToString):
549         (KJS::numberProtoFuncToLocaleString):
550         (KJS::numberProtoFuncValueOf):
551         (KJS::numberProtoFuncToFixed):
552         (KJS::numberProtoFuncToExponential):
553         (KJS::numberProtoFuncToPrecision):
554         (KJS::NumberConstructor::NumberConstructor):
555         (KJS::constructWithNumberConstructor):
556         (KJS::NumberConstructor::getConstructData):
557         (KJS::callNumberConstructor):
558         (KJS::NumberConstructor::getCallData):
559         (KJS::constructNumber):
560         (KJS::constructNumberFromImmediateNumber):
561         * kjs/NumberObject.h:
562         (KJS::NumberObject::classInfo):
563         (KJS::NumberConstructor::classInfo):
564         * kjs/PropertySlot.cpp:
565         (KJS::PropertySlot::functionGetter):
566         * kjs/RegExpObject.cpp:
567         (KJS::regExpProtoFuncTest):
568         (KJS::regExpProtoFuncExec):
569         (KJS::regExpProtoFuncCompile):
570         (KJS::regExpProtoFuncToString):
571         (KJS::callRegExpObject):
572         (KJS::RegExpObject::getCallData):
573         (KJS::constructRegExp):
574         (KJS::constructWithRegExpConstructor):
575         (KJS::RegExpConstructor::getConstructData):
576         (KJS::callRegExpConstructor):
577         (KJS::RegExpConstructor::getCallData):
578         * kjs/RegExpObject.h:
579         (KJS::RegExpConstructor::classInfo):
580         * kjs/Shell.cpp:
581         (GlobalObject::GlobalObject):
582         (functionPrint):
583         (functionDebug):
584         (functionGC):
585         (functionVersion):
586         (functionRun):
587         (functionLoad):
588         (functionReadline):
589         (functionQuit):
590         * kjs/date_object.cpp:
591         (KJS::gmtoffset):
592         (KJS::formatLocaleDate):
593         (KJS::fillStructuresUsingDateArgs):
594         (KJS::DateInstance::getTime):
595         (KJS::DateInstance::getUTCTime):
596         (KJS::DateConstructor::DateConstructor):
597         (KJS::constructDate):
598         (KJS::DateConstructor::getConstructData):
599         (KJS::callDate):
600         (KJS::DateConstructor::getCallData):
601         (KJS::dateParse):
602         (KJS::dateNow):
603         (KJS::dateUTC):
604         (KJS::dateProtoFuncToString):
605         (KJS::dateProtoFuncToUTCString):
606         (KJS::dateProtoFuncToDateString):
607         (KJS::dateProtoFuncToTimeString):
608         (KJS::dateProtoFuncToLocaleString):
609         (KJS::dateProtoFuncToLocaleDateString):
610         (KJS::dateProtoFuncToLocaleTimeString):
611         (KJS::dateProtoFuncValueOf):
612         (KJS::dateProtoFuncGetTime):
613         (KJS::dateProtoFuncGetFullYear):
614         (KJS::dateProtoFuncGetUTCFullYear):
615         (KJS::dateProtoFuncToGMTString):
616         (KJS::dateProtoFuncGetMonth):
617         (KJS::dateProtoFuncGetUTCMonth):
618         (KJS::dateProtoFuncGetDate):
619         (KJS::dateProtoFuncGetUTCDate):
620         (KJS::dateProtoFuncGetDay):
621         (KJS::dateProtoFuncGetUTCDay):
622         (KJS::dateProtoFuncGetHours):
623         (KJS::dateProtoFuncGetUTCHours):
624         (KJS::dateProtoFuncGetMinutes):
625         (KJS::dateProtoFuncGetUTCMinutes):
626         (KJS::dateProtoFuncGetSeconds):
627         (KJS::dateProtoFuncGetUTCSeconds):
628         (KJS::dateProtoFuncGetMilliSeconds):
629         (KJS::dateProtoFuncGetUTCMilliseconds):
630         (KJS::dateProtoFuncGetTimezoneOffset):
631         (KJS::dateProtoFuncSetTime):
632         (KJS::setNewValueFromTimeArgs):
633         (KJS::setNewValueFromDateArgs):
634         (KJS::dateProtoFuncSetMilliSeconds):
635         (KJS::dateProtoFuncSetUTCMilliseconds):
636         (KJS::dateProtoFuncSetSeconds):
637         (KJS::dateProtoFuncSetUTCSeconds):
638         (KJS::dateProtoFuncSetMinutes):
639         (KJS::dateProtoFuncSetUTCMinutes):
640         (KJS::dateProtoFuncSetHours):
641         (KJS::dateProtoFuncSetUTCHours):
642         (KJS::dateProtoFuncSetDate):
643         (KJS::dateProtoFuncSetUTCDate):
644         (KJS::dateProtoFuncSetMonth):
645         (KJS::dateProtoFuncSetUTCMonth):
646         (KJS::dateProtoFuncSetFullYear):
647         (KJS::dateProtoFuncSetUTCFullYear):
648         (KJS::dateProtoFuncSetYear):
649         (KJS::dateProtoFuncGetYear):
650         * kjs/date_object.h:
651         (KJS::DateInstance::internalNumber):
652         (KJS::DateInstance::classInfo):
653         * kjs/error_object.cpp:
654         (KJS::errorProtoFuncToString):
655         (KJS::constructError):
656         (KJS::constructWithErrorConstructor):
657         (KJS::ErrorConstructor::getConstructData):
658         (KJS::callErrorConstructor):
659         (KJS::ErrorConstructor::getCallData):
660         (KJS::NativeErrorConstructor::construct):
661         (KJS::constructWithNativeErrorConstructor):
662         (KJS::NativeErrorConstructor::getConstructData):
663         (KJS::callNativeErrorConstructor):
664         (KJS::NativeErrorConstructor::getCallData):
665         * kjs/error_object.h:
666         (KJS::NativeErrorConstructor::classInfo):
667         * kjs/internal.cpp:
668         (KJS::JSNumberCell::toObject):
669         (KJS::JSNumberCell::toThisObject):
670         (KJS::GetterSetter::mark):
671         (KJS::GetterSetter::toPrimitive):
672         (KJS::GetterSetter::toBoolean):
673         (KJS::GetterSetter::toNumber):
674         (KJS::GetterSetter::toString):
675         (KJS::GetterSetter::toObject):
676         (KJS::InternalFunction::InternalFunction):
677         (KJS::InternalFunction::implementsHasInstance):
678         * kjs/lookup.h:
679         (KJS::HashEntry::):
680         * kjs/nodes.cpp:
681         (KJS::FuncDeclNode::makeFunction):
682         (KJS::FuncExprNode::makeFunction):
683         * kjs/object_object.cpp:
684         (KJS::objectProtoFuncValueOf):
685         (KJS::objectProtoFuncHasOwnProperty):
686         (KJS::objectProtoFuncIsPrototypeOf):
687         (KJS::objectProtoFuncDefineGetter):
688         (KJS::objectProtoFuncDefineSetter):
689         (KJS::objectProtoFuncLookupGetter):
690         (KJS::objectProtoFuncLookupSetter):
691         (KJS::objectProtoFuncPropertyIsEnumerable):
692         (KJS::objectProtoFuncToLocaleString):
693         (KJS::objectProtoFuncToString):
694         (KJS::ObjectConstructor::ObjectConstructor):
695         (KJS::constructObject):
696         (KJS::constructWithObjectConstructor):
697         (KJS::ObjectConstructor::getConstructData):
698         (KJS::callObjectConstructor):
699         (KJS::ObjectConstructor::getCallData):
700         * kjs/object_object.h:
701         * kjs/string_object.cpp:
702         (KJS::replace):
703         (KJS::stringProtoFuncToString):
704         (KJS::stringProtoFuncValueOf):
705         (KJS::stringProtoFuncCharAt):
706         (KJS::stringProtoFuncCharCodeAt):
707         (KJS::stringProtoFuncConcat):
708         (KJS::stringProtoFuncIndexOf):
709         (KJS::stringProtoFuncLastIndexOf):
710         (KJS::stringProtoFuncMatch):
711         (KJS::stringProtoFuncSearch):
712         (KJS::stringProtoFuncReplace):
713         (KJS::stringProtoFuncSlice):
714         (KJS::stringProtoFuncSplit):
715         (KJS::stringProtoFuncSubstr):
716         (KJS::stringProtoFuncSubstring):
717         (KJS::stringProtoFuncToLowerCase):
718         (KJS::stringProtoFuncToUpperCase):
719         (KJS::stringProtoFuncToLocaleLowerCase):
720         (KJS::stringProtoFuncToLocaleUpperCase):
721         (KJS::stringProtoFuncLocaleCompare):
722         (KJS::stringProtoFuncBig):
723         (KJS::stringProtoFuncSmall):
724         (KJS::stringProtoFuncBlink):
725         (KJS::stringProtoFuncBold):
726         (KJS::stringProtoFuncFixed):
727         (KJS::stringProtoFuncItalics):
728         (KJS::stringProtoFuncStrike):
729         (KJS::stringProtoFuncSub):
730         (KJS::stringProtoFuncSup):
731         (KJS::stringProtoFuncFontcolor):
732         (KJS::stringProtoFuncFontsize):
733         (KJS::stringProtoFuncAnchor):
734         (KJS::stringProtoFuncLink):
735         (KJS::stringFromCharCode):
736         (KJS::StringConstructor::StringConstructor):
737         (KJS::constructWithStringConstructor):
738         (KJS::StringConstructor::getConstructData):
739         (KJS::callStringConstructor):
740         (KJS::StringConstructor::getCallData):
741         * kjs/string_object.h:
742
743 2008-06-23  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
744
745         Reviewed by Oliver.
746
747         Bug 19716: REGRESSION (SquirrelFish): Reproducible crash after entering a username at mint.com
748         <https://bugs.webkit.org/show_bug.cgi?id=19716>
749
750         When unwinding callframes for exceptions, check whether the callframe
751         was created by a reentrant native call to JavaScript after tearing off
752         the local variables instead of before.
753
754         * VM/Machine.cpp:
755         (KJS::Machine::unwindCallFrame):
756
757 2008-06-23  Mark Rowe  <mrowe@apple.com>
758
759         Reviewed by Oliver Hunt.
760
761         Get testapi passing again in a debug build.
762
763         * API/testapi.c:
764         (main): Update the expected output of calling JSValueMakeString on a function object.
765
766 2008-06-21  Mark Rowe  <mrowe@apple.com>
767
768         Reviewed by Sam Weinig.
769
770         Print a blank line when exiting the jsc interactive mode to ensure that the shell
771         prompt will start on a new line.
772
773         * kjs/Shell.cpp:
774         (runInteractive):
775
776 2008-06-21  Mark Rowe  <mrowe@apple.com>
777
778         Rubber-stamped by Sam Weinig.
779
780         Tweak the paths of the items in the "tests" group to clean things up a little.
781
782         * JavaScriptCore.xcodeproj/project.pbxproj:
783
784 2008-06-21  Mark Rowe  <mrowe@apple.com>
785
786         Rubber-stamped by Sam Weinig.
787
788         Fix jsc to link against libedit.dylib rather than libedit.2.dylib.
789
790         * JavaScriptCore.xcodeproj/project.pbxproj:
791
792 2008-06-21  Mark Rowe  <mrowe@apple.com>
793
794         Reviewed by Sam Weinig.
795
796         Copy the JavaScriptCore shell (jsc) into JavaScriptCore.framework so that it will
797         be included in nightly builds.
798         https://bugs.webkit.org/show_bug.cgi?id=19691
799
800         * JavaScriptCore.xcodeproj/project.pbxproj:
801
802 2008-06-21  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
803
804         Reviewed by Mark Rowe.
805
806         Fix the build for non-Mac Darwin platforms by disabling their support
807         for readline in the JavaScript shell.
808
809         * kjs/config.h:
810
811 2008-06-20  Timothy Hatcher  <timothy@apple.com>
812
813         Use member function pointers for the Profile::forEach function.
814         Eliminating a few static functions and simplified things a little.
815
816         Reviewed by Alexey Proskuryakov.
817
818         * JavaScriptCore.exp: Change the symbol for forEach.
819         * profiler/Profile.cpp:
820         (KJS::Profile::forEach): Use a member function pointer.
821         * profiler/Profile.h:
822         (KJS::Profile::sortTotalTimeDescending): Pass a function pointer.
823         (KJS::Profile::sortTotalTimeAscending): Ditto.
824         (KJS::Profile::sortSelfTimeDescending): Ditto.
825         (KJS::Profile::sortSelfTimeAscending): Ditto.
826         (KJS::Profile::sortCallsDescending): Ditto.
827         * profiler/ProfileNode.h:
828         (KJS::ProfileNode::sortTotalTimeDescending): No longer static.
829         (KJS::ProfileNode::sortTotalTimeAscending): Ditto.
830         (KJS::ProfileNode::sortSelfTimeDescending): Ditto.
831         (KJS::ProfileNode::sortSelfTimeAscending): Ditto.
832         (KJS::ProfileNode::sortCallsDescending): Ditto.
833
834 2008-06-20  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
835
836         Reviewed by Oliver.
837
838         Remove unused destructors.
839
840         * kjs/nodes.cpp:
841         * kjs/nodes.h:
842
843 2008-06-20  Timothy Hatcher  <timothy@apple.com>
844
845         Fixed an ASSERT(m_actualSelfTime <= m_actualTotalTime) when starting
846         and stopping a profile from the Develop menu. Also prevents
847         inserting an incorrect parent node as the new head after profiling
848         is stopped from the Develop menu.
849
850         Reviewed by Dan Bernstein.
851
852         * profiler/Profile.cpp:
853         (KJS::Profile::stopProfiling): If the current node is already the head
854         then there is no more need to record future nodes in didExecute.
855         (KJS::Profile::didExecute): Move the code of setupCurrentNodeAsStopped
856         into here since this was the only caller. When setting the total time
857         keep any current total time while adding the self time of the head.
858         (KJS::Profile::setupCurrentNodeAsStopped): Removed.
859         * profiler/Profile.h: Removed setupCurrentNodeAsStopped.
860
861 2008-06-20  Kevin Ollivier  <kevino@theolliviers.com>
862
863         !USE(MULTIPLE_THREADS) on Darwin build fix
864
865         * kjs/InitializeThreading.cpp:
866         (KJS::initializeThreading):
867         * kjs/collector.h:
868
869 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
870
871         -Leopard Build Fix.
872
873         * profiler/Profile.cpp:
874         (KJS::Profile::removeProfileStart):
875         (KJS::Profile::removeProfileEnd):
876
877 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
878
879         Just giving credit.
880
881         * ChangeLog:
882
883 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
884
885         Reviewed by Tim and Dan.
886
887         <rdar://problem/6024846> JSProfiler: ASSERT hit in Profiler.
888         - Because InspectorController can call startProfiling() and
889         stopProfiling() we cannot assert that console.profile() and
890         console.profileEnd() will be in the profile tree.
891
892         * profiler/Profile.cpp:
893         (KJS::Profile::removeProfileStart):
894         (KJS::Profile::removeProfileEnd):
895
896 2008-06-20  Kevin McCullough  <kmccullough@apple.com>
897
898         Reviewed by Tim.
899
900         <rdar://problem/5958770> JSProfiler: Time incorrectly given to (idle)
901         if profiling is started and finished within the same function. (19230)
902         - Now we profile one more stack frame up from the last frame to allocate
903         the time spent in it, if it exists.
904
905         * JavaScriptCore.exp:
906         * VM/Machine.cpp: We need to let the profiler know when the JS program 
907         has finished since that is what will actually stop the profiler instead
908         of just calling stopProfiling().
909         (KJS::Machine::execute):
910         * profiler/Profile.cpp:
911         (KJS::Profile::create): Moved from Profile.h since it was getting pretty
912         long.
913         (KJS::Profile::Profile): We now have a client, which is a listener who
914         we will return this profile to, once it has actually finished.
915         (KJS::Profile::stopProfiling): Instead of fully stopping the profiler
916         here, we set the flag and keep it profiling in the background.
917         (KJS::Profile::didFinishAllExecution): This is where the profiler
918         actually finishes and creates the (idle) node if one should be made.
919         (KJS::Profile::removeProfileStart): Don't use m_currentNode since it is
920         needed by the profiler as it runs silently in the background.
921         (KJS::Profile::removeProfileEnd): Ditto.
922         (KJS::Profile::willExecute): Don't profile new functions if we have
923         stopped profiling.
924         (KJS::Profile::didExecute): Only record one more return as all the
925         remaining time will be attributed to that function.
926         (KJS::Profile::setupCurrentNodeAsStopped): Sets the current node's time.
927         * profiler/Profile.h: Added functions and variables for the above
928         changes.
929         (KJS::Profile::client):
930         * profiler/ProfileNode.h:
931         (KJS::CallIdentifier::toString): Debug method.
932         * profiler/Profiler.cpp: Added support for the ProfilerClient.
933         (KJS::Profiler::startProfiling):
934         (KJS::Profiler::stopProfiling): No longer return sthe profile.
935         (KJS::Profiler::didFinishAllExecution): Now returns the profile to the
936         client instead of stopProfiling.
937         * profiler/Profiler.h:
938         (KJS::ProfilerClient::~ProfilerClient): Clients will implement this
939         interface.
940
941 2008-06-19  Ariya Hidayat  <ariya.hidayat@trolltech.com>
942
943         Reviewed by Simon.
944
945         Surpress compiler warning (int vs unsigned comparison).
946
947         * wtf/unicode/qt4/UnicodeQt4.h:
948         (WTF::Unicode::toLower):
949
950 2008-06-19  Ariya Hidayat  <ariya.hidayat@trolltech.com>
951
952         Reviewed by Timothy Hatcher.
953
954         Introduce compiler define for MinGW, to have COMPILER(MINGW).
955
956         * wtf/Platform.h:
957
958 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
959
960         Reviewed by Geoff.
961
962         Make Machine per-JSGlobalData.
963
964         * VM/CodeBlock.cpp:
965         (KJS::CodeBlock::dump):
966         * VM/CodeGenerator.cpp:
967         (KJS::CodeGenerator::emitOpcode):
968         * VM/Machine.cpp:
969         (KJS::callEval):
970         (KJS::Machine::unwindCallFrame):
971         (KJS::Machine::throwException):
972         (KJS::Machine::execute):
973         (KJS::Machine::debug):
974         * VM/Machine.h:
975         * kjs/DebuggerCallFrame.cpp:
976         (KJS::DebuggerCallFrame::evaluate):
977         * kjs/DebuggerCallFrame.h:
978         (KJS::DebuggerCallFrame::DebuggerCallFrame):
979         * kjs/ExecState.cpp:
980         (KJS::ExecState::ExecState):
981         * kjs/ExecState.h:
982         (KJS::ExecState::machine):
983         * kjs/JSFunction.cpp:
984         (KJS::JSFunction::callAsFunction):
985         (KJS::JSFunction::argumentsGetter):
986         (KJS::JSFunction::callerGetter):
987         (KJS::JSFunction::construct):
988         (KJS::globalFuncEval):
989         * kjs/JSGlobalData.cpp:
990         (KJS::JSGlobalData::JSGlobalData):
991         * kjs/JSGlobalData.h:
992         * kjs/interpreter.cpp:
993         (KJS::Interpreter::evaluate):
994
995 2008-06-19  Alp Toker  <alp@nuanti.com>
996
997         GTK+/autotools build fix. JSGlobalObject.cpp in now in
998         AllInOneFile.cpp and shouldn't be built separately.
999
1000         * GNUmakefile.am:
1001
1002 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
1003
1004         Reviewed by Darin.
1005
1006         Get rid of some threadInstance calls.
1007
1008         * kjs/JSGlobalObject.cpp:
1009         (KJS::JSGlobalObject::init):
1010         * kjs/Parser.cpp:
1011         (KJS::Parser::parse):
1012         * kjs/Shell.cpp:
1013         (jscmain):
1014
1015 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
1016
1017         Reviewed by Sam.
1018
1019         Fix an assertion failure at startup.
1020
1021         * kjs/JSObject.h: (KJS::JSObject::JSObject): Allow jsNull prototype in an assertion (I had
1022         it fixed in a wrong copy of the file, so I wasn't getting the failure).
1023
1024 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
1025
1026         Build fix.
1027
1028         * kjs/collector.cpp:
1029         (KJS::Heap::Heap):
1030         (KJS::allocateBlock):
1031         * kjs/collector.h:
1032         No, #if PLATFORM(UNIX) was not right. I've just moved the unsafe initialization back for now,
1033         as the platforms that use that code path do not use multiple threads yet.
1034
1035 2008-06-19  Alexey Proskuryakov  <ap@webkit.org>
1036
1037         Windows and Qt build fixes.
1038
1039         * kjs/collector.h: 
1040         * kjs/collector.cpp:
1041         (KJS::Heap::Heap):
1042         Wrapped m_pagesize in #if PLATFORM(UNIX), which should better match the sequence of #elifs
1043         in allocateBlock(). Changed MIN_ARRAY_SIZE to be explicitly size_t, as this type is different
1044         on different platforms.
1045
1046 2008-06-17  Alexey Proskuryakov  <ap@webkit.org>
1047
1048         Reviewed by Darin.
1049
1050         Prepare JavaScript heap for being per-thread.
1051
1052         * kjs/ExecState.h: Shuffle includes, making it possible to include ExecState.h in JSValue.h.
1053         (KJS::ExecState::heap): Added an accessor.
1054
1055         * API/JSBase.cpp: (JSGarbageCollect): Collect both shared and per-thread heaps.
1056
1057         * API/JSContextRef.cpp: (JSGlobalContextCreate): When allocating JSGlobalObject, indicate
1058         that it belongs to a shared heap.
1059
1060         * JavaScriptCore.xcodeproj/project.pbxproj:
1061         * kjs/AllInOneFile.cpp:
1062         Moved JSGlobalObject.cpp to AllInOneFile, as a build fix for inlineAllocate magic.
1063
1064         * VM/CodeGenerator.h: (KJS::CodeGenerator::globalExec): Added an accessor (working via
1065         m_scopeChain).
1066
1067         * VM/RegisterFile.h:
1068         (KJS::RegisterFile::mark):
1069         * VM/RegisterFileStack.h:
1070         (KJS::RegisterFileStack::mark):
1071         Made these pseudo-mark functions take Heap*.
1072
1073         * kjs/InitializeThreading.cpp:
1074         (KJS::initializeThreading): Initialize heap introspector.
1075
1076         * kjs/JSGlobalData.h: Added Heap to the structure.
1077
1078         * kjs/JSGlobalData.cpp:
1079         (KJS::JSGlobalData::JSGlobalData): Initialize Heap.
1080         (KJS::JSGlobalData::sharedInstance): Added a method to access shared global data instance
1081         for legacy clients.
1082
1083         * kjs/JSGlobalObject.cpp:
1084         (KJS::JSGlobalObject::~JSGlobalObject): Changed to work with per-thread head; fixed list
1085         maintenance logic.
1086         (KJS::JSGlobalObject::init): Changed to work with per-thread head.
1087         (KJS::JSGlobalObject::put): Assert that a cross-heap operation is not being attempted.
1088         (KJS::JSGlobalObject::reset): Pass ExecState* where now required.
1089         (KJS::JSGlobalObject::mark): Pass the current heap to RegisterFileStack::mark.
1090         (KJS::JSGlobalObject::operator new): Overload operator new to use per-thread or shared heap.
1091         * kjs/JSGlobalObject.h: Removed static s_head member.
1092
1093         * kjs/PropertyMap.h: (KJS::PropertyMap::PropertyMap): Removed unused SavedProperty.
1094
1095         * kjs/collector.h: Turned Collector into an actual object with its own data, renamed to Heap.
1096         (KJS::Heap::initializeHeapIntrospector): Added.
1097         (KJS::Heap::heap): Added a method to determine which heap a JSValue is in, if any.
1098         (KJS::Heap::allocate): Made non-static.
1099         (KJS::Heap::inlineAllocateNumber): Ditto.
1100         (KJS::Heap::markListSet): Ditto.
1101         (KJS::Heap::cellBlock): Ditto.
1102         (KJS::Heap::cellOffset): Ditto.
1103         (KJS::Heap::isCellMarked): Ditto.
1104         (KJS::Heap::markCell): Ditto.
1105         (KJS::Heap::reportExtraMemoryCost): Ditto.
1106         (KJS::CollectorBlock): Added a back-reference to Heap for Heap::heap() method.
1107         (KJS::SmallCellCollectorBlock): Ditto.
1108
1109         * kjs/collector.cpp: Changed MIN_ARRAY_SIZE to a #define to avoid a PIC branch. Removed
1110         main thread related machinery.
1111         (KJS::Heap::Heap): Initialize the newly added data members.
1112         (KJS::allocateBlock): Marked NEVER_INLINE, as this is a rare case that uses a PIC branch.
1113         Moved static pagesize to the class to make it safely initialized.
1114         (KJS::Heap::heapAllocate): Initialize heap back reference after a new block is allocated.
1115         (KJS::Heap::registerThread): Removed introspector initialization, as it is now performed
1116         in InitializeThreading.cpp.
1117         (KJS::Heap::markOtherThreadConservatively): Assert that the "other thread" case only occurs
1118         for legacy clients using a shared heap.
1119         (KJS::Heap::markStackObjectsConservatively): Moved fastMallocForbid/Allow down here, since
1120         it doesn't need to be forbidden during other GC phases.
1121
1122         * kjs/JSImmediate.h:
1123         (KJS::jsUndefined):
1124         (KJS::jsNull):
1125         (KJS::jsBoolean):
1126         Moved from JSvalue.h, to make these usable in files that cannot include JSValue.h (such
1127         as list.h).
1128
1129         * API/JSCallbackObjectFunctions.h:
1130         (KJS::::staticFunctionGetter):
1131         * API/JSClassRef.cpp:
1132         (OpaqueJSClass::prototype):
1133         * API/JSObjectRef.cpp:
1134         (JSObjectMake):
1135         (JSObjectMakeFunctionWithCallback):
1136         (JSObjectMakeConstructor):
1137         (JSObjectMakeFunction):
1138         * API/JSValueRef.cpp:
1139         (JSValueMakeNumber):
1140         (JSValueMakeString):
1141         * JavaScriptCore.exp:
1142         * VM/CodeGenerator.cpp:
1143         (KJS::CodeGenerator::emitLoad):
1144         * VM/JSPropertyNameIterator.cpp:
1145         (KJS::JSPropertyNameIterator::create):
1146         (KJS::JSPropertyNameIterator::next):
1147         * VM/Machine.cpp:
1148         (KJS::jsAddSlowCase):
1149         (KJS::jsAdd):
1150         (KJS::jsTypeStringForValue):
1151         (KJS::scopeChainForCall):
1152         (KJS::Machine::throwException):
1153         (KJS::Machine::execute):
1154         (KJS::Machine::privateExecute):
1155         (KJS::Machine::retrieveArguments):
1156         * kjs/ArrayPrototype.cpp:
1157         (KJS::arrayProtoFuncToString):
1158         (KJS::arrayProtoFuncToLocaleString):
1159         (KJS::arrayProtoFuncJoin):
1160         (KJS::arrayProtoFuncConcat):
1161         (KJS::arrayProtoFuncPop):
1162         (KJS::arrayProtoFuncPush):
1163         (KJS::arrayProtoFuncShift):
1164         (KJS::arrayProtoFuncSlice):
1165         (KJS::arrayProtoFuncSplice):
1166         (KJS::arrayProtoFuncUnShift):
1167         (KJS::arrayProtoFuncFilter):
1168         (KJS::arrayProtoFuncMap):
1169         (KJS::arrayProtoFuncEvery):
1170         (KJS::arrayProtoFuncForEach):
1171         (KJS::arrayProtoFuncSome):
1172         (KJS::arrayProtoFuncIndexOf):
1173         (KJS::arrayProtoFuncLastIndexOf):
1174         (KJS::ArrayConstructor::ArrayConstructor):
1175         (KJS::ArrayConstructor::construct):
1176         (KJS::ArrayConstructor::callAsFunction):
1177         * kjs/BooleanObject.cpp:
1178         (KJS::BooleanPrototype::BooleanPrototype):
1179         (KJS::booleanProtoFuncToString):
1180         (KJS::BooleanConstructor::BooleanConstructor):
1181         (KJS::BooleanConstructor::construct):
1182         * kjs/FunctionPrototype.cpp:
1183         (KJS::FunctionPrototype::FunctionPrototype):
1184         (KJS::functionProtoFuncToString):
1185         (KJS::FunctionConstructor::FunctionConstructor):
1186         (KJS::FunctionConstructor::construct):
1187         * kjs/JSActivation.cpp:
1188         (KJS::JSActivation::createArgumentsObject):
1189         * kjs/JSArray.cpp:
1190         (KJS::JSArray::JSArray):
1191         (KJS::JSArray::lengthGetter):
1192         * kjs/JSFunction.cpp:
1193         (KJS::JSFunction::lengthGetter):
1194         (KJS::JSFunction::construct):
1195         (KJS::Arguments::Arguments):
1196         (KJS::encode):
1197         (KJS::decode):
1198         (KJS::globalFuncParseInt):
1199         (KJS::globalFuncParseFloat):
1200         (KJS::globalFuncEscape):
1201         (KJS::globalFuncUnescape):
1202         (KJS::PrototypeFunction::PrototypeFunction):
1203         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
1204         * kjs/JSImmediate.cpp:
1205         (KJS::JSImmediate::toObject):
1206         * kjs/JSLock.cpp:
1207         (KJS::JSLock::registerThread):
1208         * kjs/JSObject.cpp:
1209         (KJS::JSObject::put):
1210         (KJS::JSObject::defineGetter):
1211         (KJS::JSObject::defineSetter):
1212         (KJS::Error::create):
1213         * kjs/JSObject.h:
1214         (KJS::JSObject::putDirect):
1215         * kjs/JSString.h:
1216         (KJS::JSString::JSString):
1217         * kjs/JSValue.cpp:
1218         (KJS::JSCell::operator new):
1219         (KJS::jsString):
1220         (KJS::jsOwnedString):
1221         * kjs/JSValue.h:
1222         (KJS::JSNumberCell::operator new):
1223         (KJS::jsNumberCell):
1224         (KJS::jsNaN):
1225         (KJS::jsNumber):
1226         (KJS::JSCell::marked):
1227         (KJS::JSCell::mark):
1228         (KJS::JSValue::toJSNumber):
1229         * kjs/MathObject.cpp:
1230         (KJS::MathObject::getValueProperty):
1231         (KJS::mathProtoFuncAbs):
1232         (KJS::mathProtoFuncACos):
1233         (KJS::mathProtoFuncASin):
1234         (KJS::mathProtoFuncATan):
1235         (KJS::mathProtoFuncATan2):
1236         (KJS::mathProtoFuncCeil):
1237         (KJS::mathProtoFuncCos):
1238         (KJS::mathProtoFuncExp):
1239         (KJS::mathProtoFuncFloor):
1240         (KJS::mathProtoFuncLog):
1241         (KJS::mathProtoFuncMax):
1242         (KJS::mathProtoFuncMin):
1243         (KJS::mathProtoFuncPow):
1244         (KJS::mathProtoFuncRandom):
1245         (KJS::mathProtoFuncRound):
1246         (KJS::mathProtoFuncSin):
1247         (KJS::mathProtoFuncSqrt):
1248         (KJS::mathProtoFuncTan):
1249         * kjs/NumberObject.cpp:
1250         (KJS::NumberPrototype::NumberPrototype):
1251         (KJS::numberProtoFuncToString):
1252         (KJS::numberProtoFuncToLocaleString):
1253         (KJS::numberProtoFuncToFixed):
1254         (KJS::numberProtoFuncToExponential):
1255         (KJS::numberProtoFuncToPrecision):
1256         (KJS::NumberConstructor::NumberConstructor):
1257         (KJS::NumberConstructor::getValueProperty):
1258         (KJS::NumberConstructor::construct):
1259         (KJS::NumberConstructor::callAsFunction):
1260         * kjs/RegExpObject.cpp:
1261         (KJS::RegExpPrototype::RegExpPrototype):
1262         (KJS::regExpProtoFuncToString):
1263         (KJS::RegExpObject::getValueProperty):
1264         (KJS::RegExpConstructor::RegExpConstructor):
1265         (KJS::RegExpMatchesArray::fillArrayInstance):
1266         (KJS::RegExpConstructor::arrayOfMatches):
1267         (KJS::RegExpConstructor::getBackref):
1268         (KJS::RegExpConstructor::getLastParen):
1269         (KJS::RegExpConstructor::getLeftContext):
1270         (KJS::RegExpConstructor::getRightContext):
1271         (KJS::RegExpConstructor::getValueProperty):
1272         (KJS::RegExpConstructor::construct):
1273         * kjs/RegExpObject.h:
1274         * kjs/Shell.cpp:
1275         (GlobalObject::GlobalObject):
1276         (functionGC):
1277         (functionRun):
1278         (functionReadline):
1279         (jscmain):
1280         * kjs/date_object.cpp:
1281         (KJS::formatLocaleDate):
1282         (KJS::DatePrototype::DatePrototype):
1283         (KJS::DateConstructor::DateConstructor):
1284         (KJS::DateConstructor::construct):
1285         (KJS::DateConstructor::callAsFunction):
1286         (KJS::DateFunction::DateFunction):
1287         (KJS::DateFunction::callAsFunction):
1288         (KJS::dateProtoFuncToString):
1289         (KJS::dateProtoFuncToUTCString):
1290         (KJS::dateProtoFuncToDateString):
1291         (KJS::dateProtoFuncToTimeString):
1292         (KJS::dateProtoFuncToLocaleString):
1293         (KJS::dateProtoFuncToLocaleDateString):
1294         (KJS::dateProtoFuncToLocaleTimeString):
1295         (KJS::dateProtoFuncValueOf):
1296         (KJS::dateProtoFuncGetTime):
1297         (KJS::dateProtoFuncGetFullYear):
1298         (KJS::dateProtoFuncGetUTCFullYear):
1299         (KJS::dateProtoFuncToGMTString):
1300         (KJS::dateProtoFuncGetMonth):
1301         (KJS::dateProtoFuncGetUTCMonth):
1302         (KJS::dateProtoFuncGetDate):
1303         (KJS::dateProtoFuncGetUTCDate):
1304         (KJS::dateProtoFuncGetDay):
1305         (KJS::dateProtoFuncGetUTCDay):
1306         (KJS::dateProtoFuncGetHours):
1307         (KJS::dateProtoFuncGetUTCHours):
1308         (KJS::dateProtoFuncGetMinutes):
1309         (KJS::dateProtoFuncGetUTCMinutes):
1310         (KJS::dateProtoFuncGetSeconds):
1311         (KJS::dateProtoFuncGetUTCSeconds):
1312         (KJS::dateProtoFuncGetMilliSeconds):
1313         (KJS::dateProtoFuncGetUTCMilliseconds):
1314         (KJS::dateProtoFuncGetTimezoneOffset):
1315         (KJS::dateProtoFuncSetTime):
1316         (KJS::setNewValueFromTimeArgs):
1317         (KJS::setNewValueFromDateArgs):
1318         (KJS::dateProtoFuncSetYear):
1319         (KJS::dateProtoFuncGetYear):
1320         * kjs/error_object.cpp:
1321         (KJS::ErrorPrototype::ErrorPrototype):
1322         (KJS::errorProtoFuncToString):
1323         (KJS::ErrorConstructor::ErrorConstructor):
1324         (KJS::ErrorConstructor::construct):
1325         (KJS::NativeErrorPrototype::NativeErrorPrototype):
1326         (KJS::NativeErrorConstructor::NativeErrorConstructor):
1327         (KJS::NativeErrorConstructor::construct):
1328         * kjs/identifier.h:
1329         * kjs/internal.cpp:
1330         (KJS::StringObject::create):
1331         (KJS::JSString::lengthGetter):
1332         (KJS::JSString::indexGetter):
1333         (KJS::JSString::indexNumericPropertyGetter):
1334         * kjs/interpreter.cpp:
1335         * kjs/list.cpp:
1336         (KJS::ArgList::slowAppend):
1337         * kjs/list.h:
1338         * kjs/lookup.h:
1339         (KJS::staticFunctionGetter):
1340         (KJS::cacheGlobalObject):
1341         * kjs/nodes.cpp:
1342         (KJS::Node::emitThrowError):
1343         (KJS::StringNode::emitCode):
1344         (KJS::ArrayNode::emitCode):
1345         (KJS::FuncDeclNode::makeFunction):
1346         (KJS::FuncExprNode::makeFunction):
1347         * kjs/nodes.h:
1348         * kjs/object_object.cpp:
1349         (KJS::ObjectPrototype::ObjectPrototype):
1350         (KJS::objectProtoFuncToLocaleString):
1351         (KJS::objectProtoFuncToString):
1352         (KJS::ObjectConstructor::ObjectConstructor):
1353         (KJS::ObjectConstructor::construct):
1354         * kjs/protect.h:
1355         (KJS::gcProtect):
1356         (KJS::gcUnprotect):
1357         * kjs/string_object.cpp:
1358         (KJS::StringObject::StringObject):
1359         (KJS::StringPrototype::StringPrototype):
1360         (KJS::replace):
1361         (KJS::stringProtoFuncCharAt):
1362         (KJS::stringProtoFuncCharCodeAt):
1363         (KJS::stringProtoFuncConcat):
1364         (KJS::stringProtoFuncIndexOf):
1365         (KJS::stringProtoFuncLastIndexOf):
1366         (KJS::stringProtoFuncMatch):
1367         (KJS::stringProtoFuncSearch):
1368         (KJS::stringProtoFuncReplace):
1369         (KJS::stringProtoFuncSlice):
1370         (KJS::stringProtoFuncSplit):
1371         (KJS::stringProtoFuncSubstr):
1372         (KJS::stringProtoFuncSubstring):
1373         (KJS::stringProtoFuncToLowerCase):
1374         (KJS::stringProtoFuncToUpperCase):
1375         (KJS::stringProtoFuncToLocaleLowerCase):
1376         (KJS::stringProtoFuncToLocaleUpperCase):
1377         (KJS::stringProtoFuncLocaleCompare):
1378         (KJS::stringProtoFuncBig):
1379         (KJS::stringProtoFuncSmall):
1380         (KJS::stringProtoFuncBlink):
1381         (KJS::stringProtoFuncBold):
1382         (KJS::stringProtoFuncFixed):
1383         (KJS::stringProtoFuncItalics):
1384         (KJS::stringProtoFuncStrike):
1385         (KJS::stringProtoFuncSub):
1386         (KJS::stringProtoFuncSup):
1387         (KJS::stringProtoFuncFontcolor):
1388         (KJS::stringProtoFuncFontsize):
1389         (KJS::stringProtoFuncAnchor):
1390         (KJS::stringProtoFuncLink):
1391         (KJS::StringConstructor::StringConstructor):
1392         (KJS::StringConstructor::construct):
1393         (KJS::StringConstructor::callAsFunction):
1394         (KJS::StringConstructorFunction::StringConstructorFunction):
1395         (KJS::StringConstructorFunction::callAsFunction):
1396         * kjs/string_object.h:
1397         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
1398         * kjs/ustring.h:
1399         Updated for the above changes.
1400
1401 2008-06-17  Timothy Hatcher  <timothy@apple.com>
1402
1403         Added a type to DebuggerCallFrame so the under interface can
1404         distinguish anonymous functions and program call frames.
1405
1406         https://bugs.webkit.org/show_bug.cgi?id=19585
1407
1408         Reviewed by Geoff Garen.
1409
1410         * JavaScriptCore.exp: Export the DebuggerCallFrame::type symbol.
1411         * kjs/DebuggerCallFrame.cpp:
1412         (KJS::DebuggerCallFrame::type): Added.
1413         * kjs/DebuggerCallFrame.h:
1414
1415 2008-06-17  Eric Seidel  <eric@webkit.org>
1416
1417         Reviewed by Tim H.
1418         
1419         Remove bogus ASSERT which tripped every time for those who use PAC files.
1420
1421         * kjs/Parser.cpp:
1422         (KJS::Parser::parse):
1423
1424 2008-06-17  Kevin McCullough  <kmccullough@apple.com>
1425
1426         Reviewed by Geoff.
1427
1428         <rdar://problem/5951534> JSProfiler: Don't profile console.profile()
1429         or console.profileEnd()
1430
1431         * profiler/Profile.cpp:
1432         (KJS::Profile::stopProfiling): Moved the creation of the (idle) node to
1433         the Profile (not ProfileNode).  This makes sense since the Profile
1434         should be the one to modify the profile tree.  Also each stopProfiling()
1435         does not need to check if it's the head node anymore.  Also fixed an
1436         oddity where I was using willExecute to create the node.
1437         (KJS::Profile::removeProfileStart): Removes the call to console.profile
1438         that started this profile.
1439         (KJS::Profile::removeProfileEnd): Removes the call to console.profileEnd
1440         that ended this profile.
1441         * profiler/Profile.h:
1442         * profiler/ProfileNode.cpp: Moved the creation of the (idle) node to
1443         the Profile object.
1444         (KJS::ProfileNode::stopProfiling):
1445         * profiler/ProfileNode.h: Added some helper functions and whitespace to
1446         facilitate readability and the removal of profile() and profileEnd()
1447         from the Profile tree.
1448         (KJS::CallIdentifier::operator const char* ):
1449         (KJS::ProfileNode::firstChild):
1450         (KJS::ProfileNode::lastChild):
1451         (KJS::ProfileNode::removeChild):
1452         (KJS::ProfileNode::toString):
1453
1454 2008-06-17  Ariya Hidayat  <ariya.hidayat@trolltech.com>
1455
1456         Rubber stamped by Adam Roben.
1457
1458         Include JSGlobalObject.h to fix the build.
1459
1460         * kjs/ScopeChain.cpp:
1461
1462 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1463
1464         Reviewed by Oliver.
1465
1466         Reduce code duplication in emitReadModifyAssignment().
1467
1468         * kjs/nodes.cpp:
1469         (KJS::emitReadModifyAssignment):
1470
1471 2008-06-17  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1472
1473         Reviewed by Oliver.
1474
1475         Sort includes alphabetically.
1476
1477         * kjs/nodes.cpp:
1478
1479 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1480
1481         Reviewed by Maciej.
1482
1483         Bug 19596: LEAK: Gmail leaks SegmentedVector<RegisterID>
1484         <https://bugs.webkit.org/show_bug.cgi?id=19596>
1485
1486         When growing SegmentedVector, we start adding segments at the position
1487         of the last segment, overwriting it. The destructor frees allocated
1488         segments starting at the segment of index 1, because the segment of
1489         index 0 is assumed to be the initial inline segment. This causes a leak
1490         of the segment that is referenced by index 0. Modifying grow() so that
1491         it starts adding segments at the position after the last segment fixes
1492         the leak.
1493
1494         Since the initial segment is a special case in the lookup code, this
1495         bug never manifested itself via incorrect results.
1496
1497         * VM/SegmentedVector.h:
1498         (KJS::SegmentedVector::grow):
1499
1500 2008-06-16  Maciej Stachowiak  <mjs@apple.com>
1501
1502         Reviewed by Alexey.
1503         
1504         - removed nearly unused types.h and LocalStorageEntry.h headers
1505
1506         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
1507         * JavaScriptCore.xcodeproj/project.pbxproj:
1508         * kjs/ExecState.h:
1509         * kjs/LocalStorageEntry.h: Removed.
1510         * kjs/RegExpObject.cpp:
1511         * kjs/error_object.cpp:
1512         * kjs/grammar.y:
1513         * kjs/nodes.cpp:
1514         * kjs/types.h: Removed.
1515
1516 2008-06-16  Alp Toker  <alp@nuanti.com>
1517
1518         Rubber-stamped by Geoff.
1519
1520         Change c++ to c in minidom and testapi emacs mode line comments.
1521
1522         * API/Node.h:
1523         * API/NodeList.c:
1524         * API/NodeList.h:
1525         * API/testapi.c:
1526
1527 >>>>>>> .r34623
1528 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1529
1530         Trying to fix Windows build.
1531
1532         * kjs/PropertyNameArray.h:
1533         * kjs/identifier.cpp:
1534         Include ExecState.h
1535
1536 2008-06-16  Geoffrey Garen  <ggaren@apple.com>
1537
1538         Reviewed by Oliver Hunt.
1539         
1540         Slight cleanup to the SymbolTableEntry class.
1541         
1542         Renamed isEmpty to isNull, since we usually use "empty" to mean "holds
1543         the valid, empty value", and "null" to mean "holds no value".
1544         
1545         Changed an "== 0" to a "!", to match our style guidelines.
1546         
1547         Added some ASSERTs to verify the (possibly questionable) assumption that
1548         all register indexes will have their high two bits set. Also clarified a
1549         comment to make that assumption clear.
1550
1551 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1552
1553         Reviewed by Darin.
1554
1555         Initialize functionQueueMutex in a safe manner.
1556
1557         * wtf/MainThread.cpp:
1558         (WTF::functionQueueMutex): Made it an AtomicallyInitializedStatic.
1559
1560         (WTF::dispatchFunctionsFromMainThread):
1561         (WTF::setMainThreadCallbacksPaused):
1562         Assert that the current thread is main, meaning that the callbacksPaused static can be
1563         accessed.
1564
1565 2008-06-16  Alexey Proskuryakov  <ap@webkit.org>
1566
1567         Reviewed by Geoff Garen.
1568
1569         Make Identifier construction use an explicitly passed IdentifierTable.
1570
1571         No change on SunSpider total.
1572
1573         * API/JSCallbackObjectFunctions.h:
1574         (KJS::::getOwnPropertySlot):
1575         (KJS::::put):
1576         (KJS::::deleteProperty):
1577         (KJS::::getPropertyNames):
1578         * API/JSObjectRef.cpp:
1579         (JSObjectMakeFunctionWithCallback):
1580         (JSObjectMakeFunction):
1581         (JSObjectHasProperty):
1582         (JSObjectGetProperty):
1583         (JSObjectSetProperty):
1584         (JSObjectDeleteProperty):
1585         (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray):
1586         (JSObjectCopyPropertyNames):
1587         * JavaScriptCore.exp:
1588         * VM/CodeGenerator.cpp:
1589         (KJS::CodeGenerator::CodeGenerator):
1590         (KJS::CodeGenerator::registerForLocal):
1591         (KJS::CodeGenerator::isLocal):
1592         (KJS::CodeGenerator::addConstant):
1593         (KJS::CodeGenerator::findScopedProperty):
1594         * VM/CodeGenerator.h:
1595         (KJS::CodeGenerator::globalData):
1596         (KJS::CodeGenerator::propertyNames):
1597         * VM/JSPropertyNameIterator.cpp:
1598         (KJS::JSPropertyNameIterator::create):
1599         * VM/Machine.cpp:
1600         (KJS::Machine::throwException):
1601         (KJS::Machine::privateExecute):
1602         * kjs/ArrayPrototype.cpp:
1603         (KJS::ArrayConstructor::ArrayConstructor):
1604         * kjs/BooleanObject.cpp:
1605         (KJS::BooleanConstructor::BooleanConstructor):
1606         * kjs/FunctionPrototype.cpp:
1607         (KJS::FunctionConstructor::FunctionConstructor):
1608         (KJS::FunctionConstructor::construct):
1609         * kjs/JSArray.cpp:
1610         (KJS::JSArray::inlineGetOwnPropertySlot):
1611         (KJS::JSArray::put):
1612         (KJS::JSArray::deleteProperty):
1613         (KJS::JSArray::getPropertyNames):
1614         * kjs/JSFunction.cpp:
1615         (KJS::Arguments::Arguments):
1616         * kjs/JSGlobalData.cpp:
1617         (KJS::JSGlobalData::JSGlobalData):
1618         * kjs/JSGlobalObject.cpp:
1619         (KJS::JSGlobalObject::reset):
1620         * kjs/JSObject.cpp:
1621         (KJS::JSObject::getOwnPropertySlot):
1622         (KJS::JSObject::put):
1623         (KJS::JSObject::putWithAttributes):
1624         (KJS::JSObject::deleteProperty):
1625         (KJS::JSObject::findPropertyHashEntry):
1626         (KJS::JSObject::getPropertyNames):
1627         (KJS::Error::create):
1628         * kjs/JSVariableObject.cpp:
1629         (KJS::JSVariableObject::getPropertyNames):
1630         * kjs/NumberObject.cpp:
1631         (KJS::NumberConstructor::NumberConstructor):
1632         * kjs/PropertyNameArray.cpp:
1633         (KJS::PropertyNameArray::add):
1634         * kjs/PropertyNameArray.h:
1635         (KJS::PropertyNameArray::PropertyNameArray):
1636         (KJS::PropertyNameArray::addKnownUnique):
1637         * kjs/PropertySlot.h:
1638         (KJS::PropertySlot::getValue):
1639         * kjs/RegExpObject.cpp:
1640         (KJS::RegExpConstructor::RegExpConstructor):
1641         * kjs/ScopeChain.cpp:
1642         (KJS::ScopeChainNode::print):
1643         * kjs/Shell.cpp:
1644         (GlobalObject::GlobalObject):
1645         * kjs/date_object.cpp:
1646         (KJS::DateConstructor::DateConstructor):
1647         * kjs/error_object.cpp:
1648         (KJS::ErrorConstructor::ErrorConstructor):
1649         (KJS::NativeErrorConstructor::NativeErrorConstructor):
1650         * kjs/grammar.y:
1651         * kjs/identifier.cpp:
1652         (KJS::Identifier::add):
1653         (KJS::Identifier::addSlowCase):
1654         * kjs/identifier.h:
1655         (KJS::Identifier::Identifier):
1656         (KJS::Identifier::from):
1657         (KJS::Identifier::equal):
1658         (KJS::Identifier::add):
1659         (KJS::operator==):
1660         (KJS::operator!=):
1661         * kjs/internal.cpp:
1662         (KJS::JSString::getOwnPropertySlot):
1663         * kjs/lexer.cpp:
1664         (KJS::Lexer::Lexer):
1665         (KJS::Lexer::lex):
1666         (KJS::Lexer::makeIdentifier):
1667         * kjs/lexer.h:
1668         * kjs/lookup.cpp:
1669         (KJS::HashTable::createTable):
1670         * kjs/lookup.h:
1671         (KJS::HashTable::initializeIfNeeded):
1672         (KJS::HashTable::entry):
1673         (KJS::getStaticPropertySlot):
1674         (KJS::getStaticFunctionSlot):
1675         (KJS::getStaticValueSlot):
1676         (KJS::lookupPut):
1677         * kjs/object_object.cpp:
1678         (KJS::objectProtoFuncHasOwnProperty):
1679         (KJS::objectProtoFuncDefineGetter):
1680         (KJS::objectProtoFuncDefineSetter):
1681         (KJS::objectProtoFuncLookupGetter):
1682         (KJS::objectProtoFuncLookupSetter):
1683         (KJS::objectProtoFuncPropertyIsEnumerable):
1684         (KJS::ObjectConstructor::ObjectConstructor):
1685         * kjs/string_object.cpp:
1686         (KJS::StringObject::getOwnPropertySlot):
1687         (KJS::StringObject::getPropertyNames):
1688         (KJS::StringConstructor::StringConstructor):
1689         Just pass ExecState or JSGlobalData everywhere. Identifier construction is now always
1690         explicit.
1691
1692         * kjs/nodes.cpp: (KJS::RegExpNode::emitCode): Here, Identifier was created from a non-literal
1693         char*, which was incorrect, as that uses the pointer value as a key.
1694
1695 2008-06-16  Thiago Macieira  <tjmaciei@trolltech.com>
1696
1697         Reviewed by Darin.
1698
1699         https://bugs.webkit.org/show_bug.cgi?id=19577
1700
1701         Fix compilation in C++ environments where C99 headers are not present
1702
1703         The stdbool.h header is a C99 feature, defining the "_Bool" type as well as the
1704         "true" and "false" constants. But it's completely unnecessary in C++ as the
1705         language already defines the "bool" type and its two values.
1706
1707         * API/JSBase.h:
1708         * API/JSContextRef.h:
1709         * API/JSObjectRef.h:
1710         * API/JSStringRef.h:
1711         * API/JSValueRef.h:
1712
1713 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1714
1715         Reviewed by John.
1716
1717         <rdar://problem/6012509> JSProfiler: %s are incorrect if you exclude a
1718         top level node like (idle)
1719
1720         * profiler/Profile.cpp:
1721         (KJS::Profile::focus):
1722         (KJS::Profile::exclude): Subtract the selfTime from the totalTime of the
1723         head since its self time will only be non-zero when one of its children
1724         were excluded. Since the head's totalTime is used to calculate %s when
1725         its totalTime is the same as the sum of all its visible childrens' times
1726         their %s will sum to 100%.
1727
1728 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1729
1730         Reviewed by Sam Weinig.
1731
1732         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the profiler.
1733
1734         * profiler/Profile.cpp:
1735         (KJS::Profile::willExecute):
1736
1737 2008-06-16  Kevin McCullough  <kmccullough@apple.com>
1738
1739         Reviewed by Sam.
1740
1741         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
1742         profiler.
1743         - Remove the last of the uses of recursion in the profiler.
1744
1745         * JavaScriptCore.exp: Export the new function's signature.
1746         * profiler/Profile.cpp: 
1747         (KJS::calculateVisibleTotalTime): Added a new static method for
1748         recalculating the visibleTotalTime of methods after focus has changed
1749         which are visible.
1750         (KJS::stopProfiling): 
1751         (KJS::Profile::focus): Implemented focus without recursion.
1752         * profiler/Profile.h: Moved implementation into the definition file.
1753         * profiler/ProfileNode.cpp:
1754         (KJS::ProfileNode::traverseNextNodePreOrder): Added an argument for
1755         whether or not to process the children nodes, this allows focus to skip
1756         sub trees which have been set as not visible.
1757         (KJS::ProfileNode::calculateVisibleTotalTime): This function set's a
1758         node's total visible time to the sum of its self time and its children's
1759         total times.
1760         (KJS::ProfileNode::focus): Implemented focus without recursion.
1761         * profiler/ProfileNode.h:
1762         (KJS::CallIdentifier::operator!= ):
1763         (KJS::ProfileNode::setActualTotalTime): Expanded setting the total time
1764         so that focus could modify only the visible total time.
1765         (KJS::ProfileNode::setVisibleTotalTime):
1766
1767 2008-06-16  Christian Dywan  <christian@twotoasts.de>
1768
1769         Reviewed by Sam.
1770
1771         https://bugs.webkit.org/show_bug.cgi?id=19552
1772         JavaScriptCore headers use C++ style comments
1773
1774         Replace all C++ style comments with C style multiline
1775         comments and remove all "mode" lines.
1776
1777         * API/JSBase.h:
1778         * API/JSClassRef.h:
1779         * API/JSContextRef.h:
1780         * API/JSObjectRef.h:
1781         * API/JSStringRef.h:
1782         * API/JSStringRefBSTR.h:
1783         * API/JSStringRefCF.h:
1784         * API/JSValueRef.h:
1785         * API/JavaScript.h:
1786         * API/JavaScriptCore.h:
1787
1788 2008-06-16  Christian Dywan  <christian@twotoasts.de>
1789
1790         Reviewed by Sam.
1791
1792         https://bugs.webkit.org/show_bug.cgi?id=19557
1793         (JavaScriptCore) minidom uses C++ style comments
1794
1795         Use only C style comments in minidom sources
1796
1797         * API/JSNode.c:
1798         (JSNode_appendChild):
1799         (JSNode_removeChild):
1800         * API/JSNode.h:
1801         * API/JSNodeList.c:
1802         (JSNodeList_getProperty):
1803         * API/JSNodeList.h:
1804         * API/Node.c:
1805         * API/Node.h:
1806         * API/NodeList.c:
1807         (NodeList_new):
1808         (NodeList_item):
1809         * API/NodeList.h:
1810         * API/minidom.c:
1811         (createStringWithContentsOfFile):
1812         * wtf/Assertions.h:
1813         * wtf/UnusedParam.h:
1814
1815 2008-06-16  Adriaan de Groot  <groot@kde.org>
1816
1817         Reviewed by Simon.
1818
1819         Fix compilation on Solaris
1820
1821         On some systems, munmap takes a char* instead of a void* (contrary to POSIX and
1822         Single Unix Specification). Since you can always convert from char* to void*
1823         but not vice-versa, do the casting to char*.
1824
1825         * kjs/collector.cpp:
1826         (KJS::allocateBlock):
1827         (KJS::freeBlock):
1828
1829 2008-06-16  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
1830
1831         Reviewed by Maciej.
1832
1833         Make a UnaryOpNode class to reduce boilerplate code for UnaryPlusNode,
1834         NegateNode, BitwiseNotNode, and LogicalNotNode.
1835
1836         * VM/CodeGenerator.h:
1837         (KJS::CodeGenerator::emitToJSNumber):
1838         * kjs/nodes.cpp:
1839         (KJS::UnaryOpNode::emitCode):
1840         * kjs/nodes.h:
1841         (KJS::UnaryOpNode::UnaryOpNode):
1842         (KJS::UnaryPlusNode::):
1843         (KJS::NegateNode::):
1844         (KJS::NegateNode::precedence):
1845         (KJS::BitwiseNotNode::):
1846         (KJS::BitwiseNotNode::precedence):
1847         (KJS::LogicalNotNode::):
1848         (KJS::LogicalNotNode::precedence):
1849
1850 2008-06-16  Jan Michael Alonzo  <jmalonzo@webkit.org>
1851
1852         Gtk build fix
1853
1854         * GNUmakefile.am:
1855
1856 2008-06-15  Darin Adler  <darin@apple.com>
1857
1858         - rename KJS::List to KJS::ArgList
1859
1860         * API/JSCallbackConstructor.cpp:
1861         (KJS::JSCallbackConstructor::construct):
1862         * API/JSCallbackConstructor.h:
1863         * API/JSCallbackFunction.cpp:
1864         (KJS::JSCallbackFunction::callAsFunction):
1865         * API/JSCallbackFunction.h:
1866         * API/JSCallbackObject.h:
1867         * API/JSCallbackObjectFunctions.h:
1868         (KJS::::construct):
1869         (KJS::::callAsFunction):
1870         * API/JSObjectRef.cpp:
1871         (JSObjectMakeFunction):
1872         (JSObjectCallAsFunction):
1873         (JSObjectCallAsConstructor):
1874         * JavaScriptCore.exp:
1875         * VM/Machine.cpp:
1876         (KJS::Machine::execute):
1877         (KJS::Machine::privateExecute):
1878         * VM/Machine.h:
1879         * kjs/ArrayPrototype.cpp:
1880         (KJS::arrayProtoFuncToString):
1881         (KJS::arrayProtoFuncToLocaleString):
1882         (KJS::arrayProtoFuncJoin):
1883         (KJS::arrayProtoFuncConcat):
1884         (KJS::arrayProtoFuncPop):
1885         (KJS::arrayProtoFuncPush):
1886         (KJS::arrayProtoFuncReverse):
1887         (KJS::arrayProtoFuncShift):
1888         (KJS::arrayProtoFuncSlice):
1889         (KJS::arrayProtoFuncSort):
1890         (KJS::arrayProtoFuncSplice):
1891         (KJS::arrayProtoFuncUnShift):
1892         (KJS::arrayProtoFuncFilter):
1893         (KJS::arrayProtoFuncMap):
1894         (KJS::arrayProtoFuncEvery):
1895         (KJS::arrayProtoFuncForEach):
1896         (KJS::arrayProtoFuncSome):
1897         (KJS::arrayProtoFuncIndexOf):
1898         (KJS::arrayProtoFuncLastIndexOf):
1899         (KJS::ArrayConstructor::construct):
1900         (KJS::ArrayConstructor::callAsFunction):
1901         * kjs/ArrayPrototype.h:
1902         * kjs/BooleanObject.cpp:
1903         (KJS::booleanProtoFuncToString):
1904         (KJS::booleanProtoFuncValueOf):
1905         (KJS::BooleanConstructor::construct):
1906         (KJS::BooleanConstructor::callAsFunction):
1907         * kjs/BooleanObject.h:
1908         * kjs/CommonIdentifiers.h:
1909         * kjs/ExecState.h:
1910         (KJS::ExecState::emptyList):
1911         * kjs/FunctionPrototype.cpp:
1912         (KJS::FunctionPrototype::callAsFunction):
1913         (KJS::functionProtoFuncToString):
1914         (KJS::functionProtoFuncApply):
1915         (KJS::functionProtoFuncCall):
1916         (KJS::FunctionConstructor::construct):
1917         (KJS::FunctionConstructor::callAsFunction):
1918         * kjs/FunctionPrototype.h:
1919         * kjs/JSActivation.cpp:
1920         (KJS::JSActivation::createArgumentsObject):
1921         * kjs/JSArray.cpp:
1922         (KJS::JSArray::JSArray):
1923         (KJS::AVLTreeAbstractorForArrayCompare::compare_key_key):
1924         * kjs/JSArray.h:
1925         * kjs/JSFunction.cpp:
1926         (KJS::JSFunction::callAsFunction):
1927         (KJS::JSFunction::construct):
1928         (KJS::IndexToNameMap::IndexToNameMap):
1929         (KJS::Arguments::Arguments):
1930         (KJS::encode):
1931         (KJS::decode):
1932         (KJS::globalFuncEval):
1933         (KJS::globalFuncParseInt):
1934         (KJS::globalFuncParseFloat):
1935         (KJS::globalFuncIsNaN):
1936         (KJS::globalFuncIsFinite):
1937         (KJS::globalFuncDecodeURI):
1938         (KJS::globalFuncDecodeURIComponent):
1939         (KJS::globalFuncEncodeURI):
1940         (KJS::globalFuncEncodeURIComponent):
1941         (KJS::globalFuncEscape):
1942         (KJS::globalFuncUnescape):
1943         (KJS::globalFuncKJSPrint):
1944         (KJS::PrototypeFunction::callAsFunction):
1945         (KJS::PrototypeReflexiveFunction::callAsFunction):
1946         * kjs/JSFunction.h:
1947         * kjs/JSGlobalData.h:
1948         * kjs/JSImmediate.cpp:
1949         (KJS::JSImmediate::toObject):
1950         * kjs/JSNotAnObject.cpp:
1951         (KJS::JSNotAnObject::construct):
1952         (KJS::JSNotAnObject::callAsFunction):
1953         * kjs/JSNotAnObject.h:
1954         * kjs/JSObject.cpp:
1955         (KJS::JSObject::put):
1956         (KJS::JSObject::construct):
1957         (KJS::JSObject::callAsFunction):
1958         (KJS::Error::create):
1959         * kjs/JSObject.h:
1960         * kjs/MathObject.cpp:
1961         (KJS::mathProtoFuncAbs):
1962         (KJS::mathProtoFuncACos):
1963         (KJS::mathProtoFuncASin):
1964         (KJS::mathProtoFuncATan):
1965         (KJS::mathProtoFuncATan2):
1966         (KJS::mathProtoFuncCeil):
1967         (KJS::mathProtoFuncCos):
1968         (KJS::mathProtoFuncExp):
1969         (KJS::mathProtoFuncFloor):
1970         (KJS::mathProtoFuncLog):
1971         (KJS::mathProtoFuncMax):
1972         (KJS::mathProtoFuncMin):
1973         (KJS::mathProtoFuncPow):
1974         (KJS::mathProtoFuncRandom):
1975         (KJS::mathProtoFuncRound):
1976         (KJS::mathProtoFuncSin):
1977         (KJS::mathProtoFuncSqrt):
1978         (KJS::mathProtoFuncTan):
1979         * kjs/MathObject.h:
1980         * kjs/NumberObject.cpp:
1981         (KJS::numberProtoFuncToString):
1982         (KJS::numberProtoFuncToLocaleString):
1983         (KJS::numberProtoFuncValueOf):
1984         (KJS::numberProtoFuncToFixed):
1985         (KJS::numberProtoFuncToExponential):
1986         (KJS::numberProtoFuncToPrecision):
1987         (KJS::NumberConstructor::construct):
1988         (KJS::NumberConstructor::callAsFunction):
1989         * kjs/NumberObject.h:
1990         * kjs/RegExpObject.cpp:
1991         (KJS::regExpProtoFuncTest):
1992         (KJS::regExpProtoFuncExec):
1993         (KJS::regExpProtoFuncCompile):
1994         (KJS::regExpProtoFuncToString):
1995         (KJS::RegExpObject::match):
1996         (KJS::RegExpObject::test):
1997         (KJS::RegExpObject::exec):
1998         (KJS::RegExpObject::callAsFunction):
1999         (KJS::RegExpConstructor::construct):
2000         (KJS::RegExpConstructor::callAsFunction):
2001         * kjs/RegExpObject.h:
2002         * kjs/Shell.cpp:
2003         (functionPrint):
2004         (functionDebug):
2005         (functionGC):
2006         (functionVersion):
2007         (functionRun):
2008         (functionLoad):
2009         (functionReadline):
2010         (functionQuit):
2011         * kjs/collector.cpp:
2012         (KJS::Collector::collect):
2013         * kjs/collector.h:
2014         (KJS::Collector::markListSet):
2015         * kjs/date_object.cpp:
2016         (KJS::formatLocaleDate):
2017         (KJS::fillStructuresUsingTimeArgs):
2018         (KJS::fillStructuresUsingDateArgs):
2019         (KJS::DateConstructor::construct):
2020         (KJS::DateConstructor::callAsFunction):
2021         (KJS::DateFunction::callAsFunction):
2022         (KJS::dateProtoFuncToString):
2023         (KJS::dateProtoFuncToUTCString):
2024         (KJS::dateProtoFuncToDateString):
2025         (KJS::dateProtoFuncToTimeString):
2026         (KJS::dateProtoFuncToLocaleString):
2027         (KJS::dateProtoFuncToLocaleDateString):
2028         (KJS::dateProtoFuncToLocaleTimeString):
2029         (KJS::dateProtoFuncValueOf):
2030         (KJS::dateProtoFuncGetTime):
2031         (KJS::dateProtoFuncGetFullYear):
2032         (KJS::dateProtoFuncGetUTCFullYear):
2033         (KJS::dateProtoFuncToGMTString):
2034         (KJS::dateProtoFuncGetMonth):
2035         (KJS::dateProtoFuncGetUTCMonth):
2036         (KJS::dateProtoFuncGetDate):
2037         (KJS::dateProtoFuncGetUTCDate):
2038         (KJS::dateProtoFuncGetDay):
2039         (KJS::dateProtoFuncGetUTCDay):
2040         (KJS::dateProtoFuncGetHours):
2041         (KJS::dateProtoFuncGetUTCHours):
2042         (KJS::dateProtoFuncGetMinutes):
2043         (KJS::dateProtoFuncGetUTCMinutes):
2044         (KJS::dateProtoFuncGetSeconds):
2045         (KJS::dateProtoFuncGetUTCSeconds):
2046         (KJS::dateProtoFuncGetMilliSeconds):
2047         (KJS::dateProtoFuncGetUTCMilliseconds):
2048         (KJS::dateProtoFuncGetTimezoneOffset):
2049         (KJS::dateProtoFuncSetTime):
2050         (KJS::setNewValueFromTimeArgs):
2051         (KJS::setNewValueFromDateArgs):
2052         (KJS::dateProtoFuncSetMilliSeconds):
2053         (KJS::dateProtoFuncSetUTCMilliseconds):
2054         (KJS::dateProtoFuncSetSeconds):
2055         (KJS::dateProtoFuncSetUTCSeconds):
2056         (KJS::dateProtoFuncSetMinutes):
2057         (KJS::dateProtoFuncSetUTCMinutes):
2058         (KJS::dateProtoFuncSetHours):
2059         (KJS::dateProtoFuncSetUTCHours):
2060         (KJS::dateProtoFuncSetDate):
2061         (KJS::dateProtoFuncSetUTCDate):
2062         (KJS::dateProtoFuncSetMonth):
2063         (KJS::dateProtoFuncSetUTCMonth):
2064         (KJS::dateProtoFuncSetFullYear):
2065         (KJS::dateProtoFuncSetUTCFullYear):
2066         (KJS::dateProtoFuncSetYear):
2067         (KJS::dateProtoFuncGetYear):
2068         * kjs/date_object.h:
2069         * kjs/debugger.h:
2070         * kjs/error_object.cpp:
2071         (KJS::errorProtoFuncToString):
2072         (KJS::ErrorConstructor::construct):
2073         (KJS::ErrorConstructor::callAsFunction):
2074         (KJS::NativeErrorConstructor::construct):
2075         (KJS::NativeErrorConstructor::callAsFunction):
2076         * kjs/error_object.h:
2077         * kjs/internal.cpp:
2078         (KJS::JSNumberCell::toObject):
2079         (KJS::JSNumberCell::toThisObject):
2080         * kjs/list.cpp:
2081         (KJS::ArgList::getSlice):
2082         (KJS::ArgList::markLists):
2083         (KJS::ArgList::slowAppend):
2084         * kjs/list.h:
2085         (KJS::ArgList::ArgList):
2086         (KJS::ArgList::~ArgList):
2087         * kjs/object_object.cpp:
2088         (KJS::objectProtoFuncValueOf):
2089         (KJS::objectProtoFuncHasOwnProperty):
2090         (KJS::objectProtoFuncIsPrototypeOf):
2091         (KJS::objectProtoFuncDefineGetter):
2092         (KJS::objectProtoFuncDefineSetter):
2093         (KJS::objectProtoFuncLookupGetter):
2094         (KJS::objectProtoFuncLookupSetter):
2095         (KJS::objectProtoFuncPropertyIsEnumerable):
2096         (KJS::objectProtoFuncToLocaleString):
2097         (KJS::objectProtoFuncToString):
2098         (KJS::ObjectConstructor::construct):
2099         (KJS::ObjectConstructor::callAsFunction):
2100         * kjs/object_object.h:
2101         * kjs/string_object.cpp:
2102         (KJS::replace):
2103         (KJS::stringProtoFuncToString):
2104         (KJS::stringProtoFuncValueOf):
2105         (KJS::stringProtoFuncCharAt):
2106         (KJS::stringProtoFuncCharCodeAt):
2107         (KJS::stringProtoFuncConcat):
2108         (KJS::stringProtoFuncIndexOf):
2109         (KJS::stringProtoFuncLastIndexOf):
2110         (KJS::stringProtoFuncMatch):
2111         (KJS::stringProtoFuncSearch):
2112         (KJS::stringProtoFuncReplace):
2113         (KJS::stringProtoFuncSlice):
2114         (KJS::stringProtoFuncSplit):
2115         (KJS::stringProtoFuncSubstr):
2116         (KJS::stringProtoFuncSubstring):
2117         (KJS::stringProtoFuncToLowerCase):
2118         (KJS::stringProtoFuncToUpperCase):
2119         (KJS::stringProtoFuncToLocaleLowerCase):
2120         (KJS::stringProtoFuncToLocaleUpperCase):
2121         (KJS::stringProtoFuncLocaleCompare):
2122         (KJS::stringProtoFuncBig):
2123         (KJS::stringProtoFuncSmall):
2124         (KJS::stringProtoFuncBlink):
2125         (KJS::stringProtoFuncBold):
2126         (KJS::stringProtoFuncFixed):
2127         (KJS::stringProtoFuncItalics):
2128         (KJS::stringProtoFuncStrike):
2129         (KJS::stringProtoFuncSub):
2130         (KJS::stringProtoFuncSup):
2131         (KJS::stringProtoFuncFontcolor):
2132         (KJS::stringProtoFuncFontsize):
2133         (KJS::stringProtoFuncAnchor):
2134         (KJS::stringProtoFuncLink):
2135         (KJS::StringConstructor::construct):
2136         (KJS::StringConstructor::callAsFunction):
2137         (KJS::StringConstructorFunction::callAsFunction):
2138         * kjs/string_object.h:
2139
2140 2008-06-15  Darin Adler  <darin@apple.com>
2141
2142         - new names for more JavaScriptCore files
2143
2144         * API/JSCallbackFunction.cpp:
2145         * API/JSObjectRef.cpp:
2146         * DerivedSources.make:
2147         * GNUmakefile.am:
2148         * JavaScriptCore.exp:
2149         * JavaScriptCore.pri:
2150         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2151         * JavaScriptCore.xcodeproj/project.pbxproj:
2152         * JavaScriptCoreSources.bkl:
2153         * VM/Machine.cpp:
2154         * kjs/AllInOneFile.cpp:
2155         * kjs/ArrayPrototype.cpp: Copied from JavaScriptCore/kjs/array_object.cpp.
2156         * kjs/ArrayPrototype.h: Copied from JavaScriptCore/kjs/array_object.h.
2157         * kjs/BooleanObject.cpp: Copied from JavaScriptCore/kjs/bool_object.cpp.
2158         * kjs/BooleanObject.h: Copied from JavaScriptCore/kjs/bool_object.h.
2159         * kjs/ExecState.cpp:
2160         * kjs/ExecState.h:
2161         * kjs/FunctionPrototype.cpp: Copied from JavaScriptCore/kjs/function_object.cpp.
2162         * kjs/FunctionPrototype.h: Copied from JavaScriptCore/kjs/function_object.h.
2163         * kjs/JSArray.cpp: Copied from JavaScriptCore/kjs/array_instance.cpp.
2164         * kjs/JSArray.h: Copied from JavaScriptCore/kjs/array_instance.h.
2165         * kjs/JSFunction.cpp:
2166         * kjs/JSFunction.h:
2167         * kjs/JSGlobalObject.cpp:
2168         * kjs/JSImmediate.cpp:
2169         * kjs/JSObject.h:
2170         * kjs/JSString.h:
2171         * kjs/JSValue.h:
2172         * kjs/JSVariableObject.cpp:
2173         * kjs/MathObject.cpp: Copied from JavaScriptCore/kjs/math_object.cpp.
2174         * kjs/MathObject.h: Copied from JavaScriptCore/kjs/math_object.h.
2175         * kjs/NumberObject.cpp: Copied from JavaScriptCore/kjs/number_object.cpp.
2176         * kjs/NumberObject.h: Copied from JavaScriptCore/kjs/number_object.h.
2177         * kjs/PropertyMap.cpp: Copied from JavaScriptCore/kjs/property_map.cpp.
2178         * kjs/PropertyMap.h: Copied from JavaScriptCore/kjs/property_map.h.
2179         * kjs/PropertySlot.cpp: Copied from JavaScriptCore/kjs/property_slot.cpp.
2180         * kjs/PropertySlot.h: Copied from JavaScriptCore/kjs/property_slot.h.
2181         * kjs/RegExpObject.cpp: Copied from JavaScriptCore/kjs/regexp_object.cpp.
2182         * kjs/RegExpObject.h: Copied from JavaScriptCore/kjs/regexp_object.h.
2183         * kjs/ScopeChain.cpp: Copied from JavaScriptCore/kjs/scope_chain.cpp.
2184         * kjs/ScopeChain.h: Copied from JavaScriptCore/kjs/scope_chain.h.
2185         * kjs/ScopeChainMark.h: Copied from JavaScriptCore/kjs/scope_chain_mark.h.
2186         * kjs/Shell.cpp:
2187         * kjs/array_instance.cpp: Removed.
2188         * kjs/array_instance.h: Removed.
2189         * kjs/array_object.cpp: Removed.
2190         * kjs/array_object.h: Removed.
2191         * kjs/bool_object.cpp: Removed.
2192         * kjs/bool_object.h: Removed.
2193         * kjs/error_object.h:
2194         * kjs/function_object.cpp: Removed.
2195         * kjs/function_object.h: Removed.
2196         * kjs/internal.cpp:
2197         * kjs/math_object.cpp: Removed.
2198         * kjs/math_object.h: Removed.
2199         * kjs/nodes.cpp:
2200         * kjs/number_object.cpp: Removed.
2201         * kjs/number_object.h: Removed.
2202         * kjs/object_object.cpp:
2203         * kjs/property_map.cpp: Removed.
2204         * kjs/property_map.h: Removed.
2205         * kjs/property_slot.cpp: Removed.
2206         * kjs/property_slot.h: Removed.
2207         * kjs/regexp_object.cpp: Removed.
2208         * kjs/regexp_object.h: Removed.
2209         * kjs/scope_chain.cpp: Removed.
2210         * kjs/scope_chain.h: Removed.
2211         * kjs/scope_chain_mark.h: Removed.
2212         * kjs/string_object.cpp:
2213         * kjs/string_object.h:
2214
2215 2008-06-15  Darin Adler  <darin@apple.com>
2216
2217         - new names for a few key JavaScriptCore files
2218
2219         * API/JSBase.cpp:
2220         * API/JSCallbackConstructor.h:
2221         * API/JSCallbackFunction.cpp:
2222         * API/JSCallbackFunction.h:
2223         * API/JSCallbackObject.h:
2224         * API/JSCallbackObjectFunctions.h:
2225         * API/JSClassRef.h:
2226         * API/JSContextRef.cpp:
2227         * API/JSObjectRef.cpp:
2228         * API/JSStringRef.cpp:
2229         * API/JSStringRefCF.cpp:
2230         * API/JSValueRef.cpp:
2231         * GNUmakefile.am:
2232         * JavaScriptCore.pri:
2233         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
2234         * JavaScriptCore.xcodeproj/project.pbxproj:
2235         * JavaScriptCoreSources.bkl:
2236         * VM/CodeBlock.cpp:
2237         * VM/CodeGenerator.cpp:
2238         * VM/ExceptionHelpers.cpp:
2239         * VM/ExceptionHelpers.h:
2240         * VM/JSPropertyNameIterator.cpp:
2241         * VM/JSPropertyNameIterator.h:
2242         * VM/Machine.cpp:
2243         * kjs/AllInOneFile.cpp:
2244         * kjs/DateMath.cpp:
2245         * kjs/DebuggerCallFrame.cpp:
2246         * kjs/ExecState.cpp:
2247         * kjs/JSActivation.cpp:
2248         * kjs/JSFunction.cpp: Copied from JavaScriptCore/kjs/function.cpp.
2249         * kjs/JSFunction.h: Copied from JavaScriptCore/kjs/function.h.
2250         * kjs/JSImmediate.cpp:
2251         * kjs/JSNotAnObject.h:
2252         * kjs/JSObject.cpp: Copied from JavaScriptCore/kjs/object.cpp.
2253         * kjs/JSObject.h: Copied from JavaScriptCore/kjs/object.h.
2254         * kjs/JSString.h: Copied from JavaScriptCore/kjs/internal.h.
2255         * kjs/JSValue.cpp: Copied from JavaScriptCore/kjs/value.cpp.
2256         * kjs/JSValue.h: Copied from JavaScriptCore/kjs/value.h.
2257         * kjs/JSVariableObject.h:
2258         * kjs/JSWrapperObject.h:
2259         * kjs/Shell.cpp:
2260         * kjs/SymbolTable.h:
2261         * kjs/array_instance.h:
2262         * kjs/collector.cpp:
2263         * kjs/date_object.cpp:
2264         * kjs/date_object.h:
2265         * kjs/error_object.cpp:
2266         * kjs/function.cpp: Removed.
2267         * kjs/function.h: Removed.
2268         * kjs/function_object.cpp:
2269         * kjs/function_object.h:
2270         * kjs/grammar.y:
2271         * kjs/internal.cpp:
2272         * kjs/internal.h: Removed.
2273         * kjs/lexer.cpp:
2274         * kjs/list.h:
2275         * kjs/lookup.h:
2276         * kjs/nodes.h:
2277         * kjs/object.cpp: Removed.
2278         * kjs/object.h: Removed.
2279         * kjs/object_object.h:
2280         * kjs/operations.cpp:
2281         * kjs/property_map.cpp:
2282         * kjs/property_slot.cpp:
2283         * kjs/property_slot.h:
2284         * kjs/protect.h:
2285         * kjs/regexp_object.cpp:
2286         * kjs/scope_chain.cpp:
2287         * kjs/string_object.h:
2288         * kjs/ustring.cpp:
2289         * kjs/value.cpp: Removed.
2290         * kjs/value.h: Removed.
2291         * profiler/Profile.cpp:
2292         * profiler/Profiler.cpp:
2293
2294 2008-06-15  Darin Adler  <darin@apple.com>
2295
2296         Rubber stamped by Sam.
2297
2298         - cut down on confusing uses of "Object" and "Imp" in
2299           JavaScriptCore class names
2300
2301         * API/JSCallbackFunction.cpp:
2302         (KJS::JSCallbackFunction::JSCallbackFunction):
2303         * API/JSCallbackFunction.h:
2304         * VM/Machine.cpp:
2305         (KJS::Machine::privateExecute):
2306         * kjs/ExecState.h:
2307         (KJS::ExecState::regExpTable):
2308         (KJS::ExecState::regExpConstructorTable):
2309         * kjs/JSGlobalData.cpp:
2310         (KJS::JSGlobalData::JSGlobalData):
2311         (KJS::JSGlobalData::~JSGlobalData):
2312         * kjs/JSGlobalData.h:
2313         * kjs/JSGlobalObject.cpp:
2314         (KJS::JSGlobalObject::reset):
2315         * kjs/JSGlobalObject.h:
2316         (KJS::JSGlobalObject::objectConstructor):
2317         (KJS::JSGlobalObject::functionConstructor):
2318         (KJS::JSGlobalObject::arrayConstructor):
2319         (KJS::JSGlobalObject::booleanConstructor):
2320         (KJS::JSGlobalObject::stringConstructor):
2321         (KJS::JSGlobalObject::numberConstructor):
2322         (KJS::JSGlobalObject::dateConstructor):
2323         (KJS::JSGlobalObject::regExpConstructor):
2324         (KJS::JSGlobalObject::errorConstructor):
2325         (KJS::JSGlobalObject::evalErrorConstructor):
2326         (KJS::JSGlobalObject::rangeErrorConstructor):
2327         (KJS::JSGlobalObject::referenceErrorConstructor):
2328         (KJS::JSGlobalObject::syntaxErrorConstructor):
2329         (KJS::JSGlobalObject::typeErrorConstructor):
2330         (KJS::JSGlobalObject::URIErrorConstructor):
2331         * kjs/array_object.cpp:
2332         (KJS::ArrayConstructor::ArrayConstructor):
2333         (KJS::ArrayConstructor::getConstructData):
2334         (KJS::ArrayConstructor::construct):
2335         (KJS::ArrayConstructor::callAsFunction):
2336         * kjs/array_object.h:
2337         * kjs/bool_object.cpp:
2338         (KJS::BooleanObject::BooleanObject):
2339         (KJS::BooleanPrototype::BooleanPrototype):
2340         (KJS::booleanProtoFuncToString):
2341         (KJS::booleanProtoFuncValueOf):
2342         (KJS::BooleanConstructor::BooleanConstructor):
2343         (KJS::BooleanConstructor::getConstructData):
2344         (KJS::BooleanConstructor::construct):
2345         (KJS::BooleanConstructor::callAsFunction):
2346         * kjs/bool_object.h:
2347         * kjs/date_object.cpp:
2348         (KJS::DatePrototype::DatePrototype):
2349         (KJS::DateConstructor::DateConstructor):
2350         (KJS::DateConstructor::getConstructData):
2351         (KJS::DateConstructor::construct):
2352         (KJS::DateConstructor::callAsFunction):
2353         (KJS::DateFunction::DateFunction):
2354         (KJS::DateFunction::callAsFunction):
2355         * kjs/date_object.h:
2356         * kjs/error_object.cpp:
2357         (KJS::ErrorPrototype::ErrorPrototype):
2358         (KJS::ErrorConstructor::ErrorConstructor):
2359         (KJS::ErrorConstructor::getConstructData):
2360         (KJS::ErrorConstructor::construct):
2361         (KJS::ErrorConstructor::callAsFunction):
2362         (KJS::NativeErrorConstructor::NativeErrorConstructor):
2363         (KJS::NativeErrorConstructor::getConstructData):
2364         (KJS::NativeErrorConstructor::construct):
2365         (KJS::NativeErrorConstructor::callAsFunction):
2366         (KJS::NativeErrorConstructor::mark):
2367         * kjs/error_object.h:
2368         * kjs/function.cpp:
2369         (KJS::JSFunction::JSFunction):
2370         (KJS::JSFunction::mark):
2371         (KJS::JSFunction::getOwnPropertySlot):
2372         (KJS::JSFunction::put):
2373         (KJS::JSFunction::deleteProperty):
2374         (KJS::PrototypeFunction::PrototypeFunction):
2375         (KJS::PrototypeReflexiveFunction::PrototypeReflexiveFunction):
2376         (KJS::PrototypeReflexiveFunction::mark):
2377         * kjs/function.h:
2378         * kjs/function_object.cpp:
2379         (KJS::functionProtoFuncToString):
2380         (KJS::FunctionConstructor::FunctionConstructor):
2381         (KJS::FunctionConstructor::getConstructData):
2382         (KJS::FunctionConstructor::construct):
2383         (KJS::FunctionConstructor::callAsFunction):
2384         * kjs/function_object.h:
2385         * kjs/internal.cpp:
2386         (KJS::StringObject::create):
2387         (KJS::JSString::toObject):
2388         (KJS::JSString::toThisObject):
2389         (KJS::JSString::getOwnPropertySlot):
2390         (KJS::InternalFunction::InternalFunction):
2391         (KJS::InternalFunction::getCallData):
2392         (KJS::InternalFunction::implementsHasInstance):
2393         * kjs/math_object.cpp:
2394         (KJS::MathObject::MathObject):
2395         (KJS::MathObject::getOwnPropertySlot):
2396         (KJS::MathObject::getValueProperty):
2397         * kjs/math_object.h:
2398         * kjs/number_object.cpp:
2399         (KJS::NumberObject::NumberObject):
2400         (KJS::NumberPrototype::NumberPrototype):
2401         (KJS::numberProtoFuncToString):
2402         (KJS::numberProtoFuncToLocaleString):
2403         (KJS::numberProtoFuncValueOf):
2404         (KJS::numberProtoFuncToFixed):
2405         (KJS::numberProtoFuncToExponential):
2406         (KJS::numberProtoFuncToPrecision):
2407         (KJS::NumberConstructor::NumberConstructor):
2408         (KJS::NumberConstructor::getOwnPropertySlot):
2409         (KJS::NumberConstructor::getValueProperty):
2410         (KJS::NumberConstructor::getConstructData):
2411         (KJS::NumberConstructor::construct):
2412         (KJS::NumberConstructor::callAsFunction):
2413         * kjs/number_object.h:
2414         * kjs/object.cpp:
2415         (KJS::JSObject::putDirectFunction):
2416         * kjs/object.h:
2417         * kjs/object_object.cpp:
2418         (KJS::ObjectConstructor::ObjectConstructor):
2419         (KJS::ObjectConstructor::getConstructData):
2420         (KJS::ObjectConstructor::construct):
2421         (KJS::ObjectConstructor::callAsFunction):
2422         * kjs/object_object.h:
2423         * kjs/regexp.cpp:
2424         (KJS::RegExp::RegExp):
2425         * kjs/regexp_object.cpp:
2426         (KJS::regExpProtoFuncTest):
2427         (KJS::regExpProtoFuncExec):
2428         (KJS::regExpProtoFuncCompile):
2429         (KJS::regExpProtoFuncToString):
2430         (KJS::RegExpObject::RegExpObject):
2431         (KJS::RegExpObject::~RegExpObject):
2432         (KJS::RegExpObject::getOwnPropertySlot):
2433         (KJS::RegExpObject::getValueProperty):
2434         (KJS::RegExpObject::put):
2435         (KJS::RegExpObject::putValueProperty):
2436         (KJS::RegExpObject::match):
2437         (KJS::RegExpObject::test):
2438         (KJS::RegExpObject::exec):
2439         (KJS::RegExpObject::getCallData):
2440         (KJS::RegExpObject::callAsFunction):
2441         (KJS::RegExpConstructorPrivate::RegExpConstructorPrivate):
2442         (KJS::RegExpConstructor::RegExpConstructor):
2443         (KJS::RegExpConstructor::performMatch):
2444         (KJS::RegExpMatchesArray::RegExpMatchesArray):
2445         (KJS::RegExpMatchesArray::~RegExpMatchesArray):
2446         (KJS::RegExpMatchesArray::fillArrayInstance):
2447         (KJS::RegExpConstructor::arrayOfMatches):
2448         (KJS::RegExpConstructor::getBackref):
2449         (KJS::RegExpConstructor::getLastParen):
2450         (KJS::RegExpConstructor::getLeftContext):
2451         (KJS::RegExpConstructor::getRightContext):
2452         (KJS::RegExpConstructor::getOwnPropertySlot):
2453         (KJS::RegExpConstructor::getValueProperty):
2454         (KJS::RegExpConstructor::put):
2455         (KJS::RegExpConstructor::putValueProperty):
2456         (KJS::RegExpConstructor::getConstructData):
2457         (KJS::RegExpConstructor::construct):
2458         (KJS::RegExpConstructor::callAsFunction):
2459         (KJS::RegExpConstructor::input):
2460         * kjs/regexp_object.h:
2461         * kjs/string_object.cpp:
2462         (KJS::StringObject::StringObject):
2463         (KJS::StringObject::getOwnPropertySlot):
2464         (KJS::StringObject::put):
2465         (KJS::StringObject::deleteProperty):
2466         (KJS::StringObject::getPropertyNames):
2467         (KJS::StringPrototype::StringPrototype):
2468         (KJS::StringPrototype::getOwnPropertySlot):
2469         (KJS::replace):
2470         (KJS::stringProtoFuncToString):
2471         (KJS::stringProtoFuncValueOf):
2472         (KJS::stringProtoFuncCharAt):
2473         (KJS::stringProtoFuncCharCodeAt):
2474         (KJS::stringProtoFuncConcat):
2475         (KJS::stringProtoFuncIndexOf):
2476         (KJS::stringProtoFuncLastIndexOf):
2477         (KJS::stringProtoFuncMatch):
2478         (KJS::stringProtoFuncSearch):
2479         (KJS::stringProtoFuncReplace):
2480         (KJS::stringProtoFuncSlice):
2481         (KJS::stringProtoFuncSplit):
2482         (KJS::stringProtoFuncSubstr):
2483         (KJS::stringProtoFuncSubstring):
2484         (KJS::stringProtoFuncToLowerCase):
2485         (KJS::stringProtoFuncToUpperCase):
2486         (KJS::stringProtoFuncToLocaleLowerCase):
2487         (KJS::stringProtoFuncToLocaleUpperCase):
2488         (KJS::stringProtoFuncLocaleCompare):
2489         (KJS::stringProtoFuncBig):
2490         (KJS::stringProtoFuncSmall):
2491         (KJS::stringProtoFuncBlink):
2492         (KJS::stringProtoFuncBold):
2493         (KJS::stringProtoFuncFixed):
2494         (KJS::stringProtoFuncItalics):
2495         (KJS::stringProtoFuncStrike):
2496         (KJS::stringProtoFuncSub):
2497         (KJS::stringProtoFuncSup):
2498         (KJS::stringProtoFuncFontcolor):
2499         (KJS::stringProtoFuncFontsize):
2500         (KJS::stringProtoFuncAnchor):
2501         (KJS::stringProtoFuncLink):
2502         (KJS::StringConstructor::StringConstructor):
2503         (KJS::StringConstructor::getConstructData):
2504         (KJS::StringConstructor::construct):
2505         (KJS::StringConstructor::callAsFunction):
2506         (KJS::StringConstructorFunction::StringConstructorFunction):
2507         (KJS::StringConstructorFunction::callAsFunction):
2508         * kjs/string_object.h:
2509         (KJS::StringObjectThatMasqueradesAsUndefined::StringObjectThatMasqueradesAsUndefined):
2510         * profiler/Profiler.cpp:
2511         (KJS::createCallIdentifier):
2512
2513 2008-06-15  Darin Adler  <darin@apple.com>
2514
2515         Rubber stamped by Sam.
2516
2517         - use JS prefix and simpler names for basic JavaScriptCore types,
2518           to complement JSValue and JSObject
2519
2520         * JavaScriptCore.exp:
2521         * VM/Machine.cpp:
2522         (KJS::jsLess):
2523         (KJS::jsLessEq):
2524         (KJS::jsAdd):
2525         (KJS::callEval):
2526         (KJS::Machine::execute):
2527         (KJS::Machine::retrieveArguments):
2528         (KJS::Machine::retrieveCaller):
2529         (KJS::Machine::getCallFrame):
2530         (KJS::Machine::getFunctionAndArguments):
2531         * VM/Machine.h:
2532         * VM/Register.h:
2533         * kjs/DebuggerCallFrame.cpp:
2534         (KJS::DebuggerCallFrame::functionName):
2535         * kjs/ExecState.h:
2536         * kjs/JSActivation.cpp:
2537         (KJS::JSActivation::createArgumentsObject):
2538         * kjs/array_instance.cpp:
2539         (KJS::JSArray::checkConsistency):
2540         (KJS::JSArray::JSArray):
2541         (KJS::JSArray::~JSArray):
2542         (KJS::JSArray::getItem):
2543         (KJS::JSArray::lengthGetter):
2544         (KJS::JSArray::inlineGetOwnPropertySlot):
2545         (KJS::JSArray::getOwnPropertySlot):
2546         (KJS::JSArray::put):
2547         (KJS::JSArray::deleteProperty):
2548         (KJS::JSArray::getPropertyNames):
2549         (KJS::JSArray::increaseVectorLength):
2550         (KJS::JSArray::setLength):
2551         (KJS::JSArray::mark):
2552         (KJS::JSArray::sort):
2553         (KJS::JSArray::compactForSorting):
2554         (KJS::JSArray::lazyCreationData):
2555         (KJS::JSArray::setLazyCreationData):
2556         * kjs/array_instance.h:
2557         * kjs/array_object.cpp:
2558         (KJS::ArrayPrototype::ArrayPrototype):
2559         (KJS::ArrayPrototype::getOwnPropertySlot):
2560         (KJS::arrayProtoFuncToString):
2561         (KJS::arrayProtoFuncToLocaleString):
2562         (KJS::arrayProtoFuncConcat):
2563         (KJS::arrayProtoFuncSort):
2564         (KJS::ArrayObjectImp::construct):
2565         * kjs/array_object.h:
2566         * kjs/completion.h:
2567         * kjs/function.cpp:
2568         (KJS::JSFunction::JSFunction):
2569         (KJS::JSFunction::mark):
2570         (KJS::JSFunction::getCallData):
2571         (KJS::JSFunction::callAsFunction):
2572         (KJS::JSFunction::argumentsGetter):
2573         (KJS::JSFunction::callerGetter):
2574         (KJS::JSFunction::lengthGetter):
2575         (KJS::JSFunction::getOwnPropertySlot):
2576         (KJS::JSFunction::put):
2577         (KJS::JSFunction::deleteProperty):
2578         (KJS::JSFunction::getParameterName):
2579         (KJS::JSFunction::getConstructData):
2580         (KJS::JSFunction::construct):
2581         (KJS::IndexToNameMap::IndexToNameMap):
2582         (KJS::Arguments::Arguments):
2583         * kjs/function.h:
2584         * kjs/function_object.cpp:
2585         (KJS::functionProtoFuncToString):
2586         (KJS::functionProtoFuncApply):
2587         (KJS::FunctionObjectImp::construct):
2588         * kjs/internal.cpp:
2589         (KJS::JSString::toPrimitive):
2590         (KJS::JSString::getPrimitiveNumber):
2591         (KJS::JSString::toBoolean):
2592         (KJS::JSString::toNumber):
2593         (KJS::JSString::toString):
2594         (KJS::StringInstance::create):
2595         (KJS::JSString::toObject):
2596         (KJS::JSString::toThisObject):
2597         (KJS::JSString::lengthGetter):
2598         (KJS::JSString::indexGetter):
2599         (KJS::JSString::indexNumericPropertyGetter):
2600         (KJS::JSString::getOwnPropertySlot):
2601         (KJS::JSNumberCell::type):
2602         (KJS::JSNumberCell::toPrimitive):
2603         (KJS::JSNumberCell::getPrimitiveNumber):
2604         (KJS::JSNumberCell::toBoolean):
2605         (KJS::JSNumberCell::toNumber):
2606         (KJS::JSNumberCell::toString):
2607         (KJS::JSNumberCell::toObject):
2608         (KJS::JSNumberCell::toThisObject):
2609         (KJS::JSNumberCell::getUInt32):
2610         (KJS::JSNumberCell::getTruncatedInt32):
2611         (KJS::JSNumberCell::getTruncatedUInt32):
2612         (KJS::GetterSetter::mark):
2613         (KJS::GetterSetter::toPrimitive):
2614         (KJS::GetterSetter::getPrimitiveNumber):
2615         (KJS::GetterSetter::toBoolean):
2616         (KJS::GetterSetter::toNumber):
2617         (KJS::GetterSetter::toString):
2618         (KJS::GetterSetter::toObject):
2619         (KJS::GetterSetter::getOwnPropertySlot):
2620         (KJS::GetterSetter::put):
2621         (KJS::GetterSetter::toThisObject):
2622         * kjs/internal.h:
2623         (KJS::JSString::JSString):
2624         (KJS::JSString::getStringPropertySlot):
2625         * kjs/nodes.cpp:
2626         (KJS::FuncDeclNode::makeFunction):
2627         (KJS::FuncExprNode::makeFunction):
2628         * kjs/nodes.h:
2629         * kjs/object.cpp:
2630         (KJS::JSObject::put):
2631         (KJS::JSObject::deleteProperty):
2632         (KJS::JSObject::defineGetter):
2633         (KJS::JSObject::defineSetter):
2634         (KJS::JSObject::lookupGetter):
2635         (KJS::JSObject::lookupSetter):
2636         (KJS::JSObject::fillGetterPropertySlot):
2637         * kjs/object.h:
2638         (KJS::GetterSetter::GetterSetter):
2639         * kjs/operations.cpp:
2640         (KJS::equal):
2641         (KJS::strictEqual):
2642         * kjs/property_map.cpp:
2643         (KJS::PropertyMap::containsGettersOrSetters):
2644         * kjs/regexp_object.cpp:
2645         (KJS::RegExpMatchesArray::getOwnPropertySlot):
2646         (KJS::RegExpMatchesArray::put):
2647         (KJS::RegExpMatchesArray::deleteProperty):
2648         (KJS::RegExpMatchesArray::getPropertyNames):
2649         (KJS::RegExpMatchesArray::RegExpMatchesArray):
2650         (KJS::RegExpMatchesArray::fillArrayInstance):
2651         * kjs/string_object.cpp:
2652         (KJS::StringInstance::StringInstance):
2653         (KJS::replace):
2654         (KJS::stringProtoFuncReplace):
2655         (KJS::stringProtoFuncToLowerCase):
2656         (KJS::stringProtoFuncToUpperCase):
2657         (KJS::stringProtoFuncToLocaleLowerCase):
2658         (KJS::stringProtoFuncToLocaleUpperCase):
2659         * kjs/string_object.h:
2660         (KJS::StringInstance::internalValue):
2661         * kjs/value.cpp:
2662         (KJS::JSCell::getNumber):
2663         (KJS::JSCell::getString):
2664         (KJS::JSCell::getObject):
2665         (KJS::jsString):
2666         (KJS::jsOwnedString):
2667         * kjs/value.h:
2668         (KJS::JSNumberCell::JSNumberCell):
2669         (KJS::jsNumberCell):
2670         (KJS::JSValue::uncheckedGetNumber):
2671         * profiler/Profiler.cpp:
2672         (KJS::createCallIdentifier):
2673         (KJS::createCallIdentifierFromFunctionImp):
2674
2675 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
2676
2677         Reviewed by Alexey.
2678         
2679         - add emitUnaryOp, emitNullaryOp and emitUnaryOpNoDst; use them
2680         
2681         This removes some boilerplate code and also reduces the number of
2682         places that will need to be changed to do on-demand emit of
2683         loads (and thus support k operands).
2684
2685         * VM/CodeGenerator.cpp:
2686         (KJS::CodeGenerator::emitUnaryOp):
2687         (KJS::CodeGenerator::emitNullaryOp):
2688         (KJS::CodeGenerator::emitUnaryOpNoDst):
2689         (KJS::CodeGenerator::emitPushScope):
2690         * VM/CodeGenerator.h:
2691         (KJS::CodeGenerator::emitNewObject):
2692         (KJS::CodeGenerator::emitNewArray):
2693         (KJS::CodeGenerator::emitNot):
2694         (KJS::CodeGenerator::emitBitNot):
2695         (KJS::CodeGenerator::emitToJSNumber):
2696         (KJS::CodeGenerator::emitNegate):
2697         (KJS::CodeGenerator::emitInstanceOf):
2698         (KJS::CodeGenerator::emitTypeOf):
2699         (KJS::CodeGenerator::emitIn):
2700         (KJS::CodeGenerator::emitReturn):
2701         (KJS::CodeGenerator::emitEnd):
2702         (KJS::CodeGenerator::emitGetPropertyNames):
2703
2704 2008-06-15  Alp Toker  <alp@nuanti.com>
2705
2706         Rubber-stamped by Maciej.
2707
2708         Install 'jsc' application by default.
2709
2710         * GNUmakefile.am:
2711
2712 2008-06-15  Maciej Stachowiak  <mjs@apple.com>
2713
2714         Reviewed by Oliver.
2715         
2716         - rename testkjs to jsc
2717
2718         * GNUmakefile.am:
2719         * JavaScriptCore.vcproj/JavaScriptCore.sln:
2720         * JavaScriptCore.vcproj/jsc: Added.
2721         * JavaScriptCore.vcproj/jsc/jsc.vcproj: Copied from JavaScriptCore.vcproj/testkjs/testkjs.vcproj.
2722         * JavaScriptCore.vcproj/testkjs: Removed.
2723         * JavaScriptCore.vcproj/testkjs/testkjs.vcproj: Removed.
2724         * JavaScriptCore.xcodeproj/project.pbxproj:
2725         * jscore.bkl:
2726         * kjs/Shell.cpp: Copied from kjs/testkjs.cpp.
2727         (main):
2728         (printUsageStatement):
2729         (jscmain):
2730         * kjs/jsc.pro: Copied from kjs/testkjs.pro.
2731         * kjs/testkjs.cpp: Removed.
2732         * kjs/testkjs.pro: Removed.
2733         * tests/mozilla/expected.html:
2734         * tests/mozilla/js1_2/Array/tostring_1.js:
2735         * tests/mozilla/js1_2/Array/tostring_2.js:
2736         * tests/mozilla/jsDriver.pl:
2737
2738 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2739
2740         Reviewed by Maciej.
2741
2742         Mac build fix.
2743
2744         * JavaScriptCore.xcodeproj/project.pbxproj:
2745         * kjs/nodes.h:
2746
2747 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2748
2749         Reviewed by Maciej.
2750
2751         Change the spelling of PrecMultiplicitave to PrecMultiplicative.
2752
2753         * kjs/nodes.h:
2754         (KJS::MultNode::precedence):
2755         (KJS::DivNode::precedence):
2756         (KJS::ModNode::precedence):
2757
2758 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2759
2760         Reviewed by Maciej.
2761
2762         Remove unused preprocessor macros related to exceptions in the old
2763         interpreter.
2764
2765         * kjs/nodes.cpp:
2766
2767 2008-06-15  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2768
2769         Reviewed by Maciej.
2770
2771         Bug 19484: More instructions needs to use temporary registers
2772         <https://bugs.webkit.org/show_bug.cgi?id=19484>
2773
2774         Fix codegen for all binary operations so that temporaries are used if
2775         necessary. This was done by making BinaryOpNode and ReverseBinaryOpNode
2776         subclasses of ExpressionNode, and eliminating the custom emitCode()
2777         methods for the individual node classes.
2778
2779         This only adds 3 new instructions to SunSpider code, and there is no
2780         difference in SunSpider execution time.
2781
2782         * VM/CodeGenerator.cpp:
2783         (KJS::CodeGenerator::emitBitNot):
2784         (KJS::CodeGenerator::emitBinaryOp):
2785         * VM/CodeGenerator.h:
2786         * kjs/grammar.y:
2787         * kjs/nodes.cpp:
2788         (KJS::PreIncResolveNode::emitCode):
2789         (KJS::PreDecResolveNode::emitCode):
2790         (KJS::BinaryOpNode::emitCode):
2791         (KJS::ReverseBinaryOpNode::emitCode):
2792         (KJS::emitReadModifyAssignment):
2793         (KJS::CaseBlockNode::emitCodeForBlock):
2794         * kjs/nodes.h:
2795         (KJS::BinaryOpNode::BinaryOpNode):
2796         (KJS::ReverseBinaryOpNode::ReverseBinaryOpNode):
2797         (KJS::MultNode::):
2798         (KJS::DivNode::):
2799         (KJS::DivNode::precedence):
2800         (KJS::ModNode::):
2801         (KJS::ModNode::precedence):
2802         (KJS::AddNode::):
2803         (KJS::AddNode::precedence):
2804         (KJS::SubNode::):
2805         (KJS::SubNode::precedence):
2806         (KJS::LeftShiftNode::):
2807         (KJS::LeftShiftNode::precedence):
2808         (KJS::RightShiftNode::):
2809         (KJS::RightShiftNode::precedence):
2810         (KJS::UnsignedRightShiftNode::):
2811         (KJS::UnsignedRightShiftNode::precedence):
2812         (KJS::LessNode::):
2813         (KJS::LessNode::precedence):
2814         (KJS::GreaterNode::):
2815         (KJS::GreaterNode::precedence):
2816         (KJS::LessEqNode::):
2817         (KJS::LessEqNode::precedence):
2818         (KJS::GreaterEqNode::):
2819         (KJS::GreaterEqNode::precedence):
2820         (KJS::InstanceOfNode::):
2821         (KJS::InstanceOfNode::precedence):
2822         (KJS::InNode::):
2823         (KJS::InNode::precedence):
2824         (KJS::EqualNode::):
2825         (KJS::EqualNode::precedence):
2826         (KJS::NotEqualNode::):
2827         (KJS::NotEqualNode::precedence):
2828         (KJS::StrictEqualNode::):
2829         (KJS::StrictEqualNode::precedence):
2830         (KJS::NotStrictEqualNode::):
2831         (KJS::NotStrictEqualNode::precedence):
2832         (KJS::BitAndNode::):
2833         (KJS::BitAndNode::precedence):
2834         (KJS::BitOrNode::):
2835         (KJS::BitOrNode::precedence):
2836         (KJS::BitXOrNode::):
2837         (KJS::BitXOrNode::precedence):
2838         * kjs/nodes2string.cpp:
2839         (KJS::LessNode::streamTo):
2840         (KJS::GreaterNode::streamTo):
2841         (KJS::LessEqNode::streamTo):
2842         (KJS::GreaterEqNode::streamTo):
2843         (KJS::InstanceOfNode::streamTo):
2844         (KJS::InNode::streamTo):
2845         (KJS::EqualNode::streamTo):
2846         (KJS::NotEqualNode::streamTo):
2847         (KJS::StrictEqualNode::streamTo):
2848         (KJS::NotStrictEqualNode::streamTo):
2849         (KJS::BitAndNode::streamTo):
2850         (KJS::BitXOrNode::streamTo):
2851         (KJS::BitOrNode::streamTo):
2852
2853 2008-06-14  Darin Adler  <darin@apple.com>
2854
2855         Rubber stamped by Sam.
2856
2857         - rename a bunch of local symbols within the regular expression code to
2858           follow our usual coding style, and do a few other name tweaks
2859
2860         * pcre/pcre_compile.cpp:
2861         (CompileData::CompileData):
2862         (checkEscape):
2863         (readRepeatCounts):
2864         (compileBranch):
2865         (compileBracket):
2866         (calculateCompiledPatternLength):
2867         (returnError):
2868         (jsRegExpCompile):
2869         * pcre/pcre_exec.cpp:
2870         (MatchStack::MatchStack):
2871         (MatchStack::canUseStackBufferForNextFrame):
2872         (MatchStack::popCurrentFrame):
2873         (match):
2874         (tryFirstByteOptimization):
2875         (tryRequiredByteOptimization):
2876         (jsRegExpExecute):
2877         * pcre/pcre_internal.h:
2878
2879 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2880
2881         Reviewed by Darin.
2882
2883         Remove redundant uses of get().
2884
2885         * kjs/nodes.cpp:
2886         (KJS::BracketAccessorNode::emitCode):
2887         (KJS::AddNode::emitCode):
2888         (KJS::SubNode::emitCode):
2889         (KJS::ReadModifyResolveNode::emitCode):
2890         (KJS::AssignDotNode::emitCode):
2891         (KJS::ReadModifyDotNode::emitCode):
2892         (KJS::AssignBracketNode::emitCode):
2893         (KJS::ReadModifyBracketNode::emitCode):
2894
2895 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2896
2897         Reviewed by Maciej.
2898
2899         Make code generation not use a temporary for the left-hand side of an
2900         expression if the right-hand side is a local variable.
2901
2902         * VM/CodeGenerator.cpp:
2903         (KJS::CodeGenerator::isLocal):
2904         * VM/CodeGenerator.h:
2905         (KJS::CodeGenerator::leftHandSideNeedsCopy):
2906         (KJS::CodeGenerator::emitNodeForLeftHandSide):
2907         * kjs/nodes.cpp:
2908         (KJS::ResolveNode::isPure):
2909         (KJS::BracketAccessorNode::emitCode):
2910         (KJS::AddNode::emitCode):
2911         (KJS::SubNode::emitCode):
2912         (KJS::ReadModifyResolveNode::emitCode):
2913         (KJS::AssignDotNode::emitCode):
2914         (KJS::ReadModifyDotNode::emitCode):
2915         (KJS::AssignBracketNode::emitCode):
2916         (KJS::ReadModifyBracketNode::emitCode):
2917         * kjs/nodes.h:
2918         (KJS::ExpressionNode::):
2919         (KJS::BooleanNode::):
2920         (KJS::NumberNode::):
2921         (KJS::StringNode::):
2922
2923 2008-06-14  Darin Adler  <darin@apple.com>
2924
2925         Reviewed by Sam.
2926
2927         - more of https://bugs.webkit.org/show_bug.cgi?id=17257
2928           start ref counts at 1 instead of 0 for speed
2929
2930         * kjs/nodes.cpp:
2931         (KJS::ParserRefCounted::hasOneRef): Added. Replaces refcount.
2932         * kjs/nodes.h: Replaced refcount with hasOneRef.
2933
2934         * wtf/ListRefPtr.h:
2935         (WTF::ListRefPtr::~ListRefPtr): Changed to use hasOneRef instead of
2936         refcount, so this class can be used with the RefCounted template.
2937
2938         * wtf/RefCounted.h:
2939         (WTF::RefCounted::hasOneRef): Made const, since there's no reason for
2940         it to be non-const.
2941
2942 2008-06-14  Maciej Stachowiak  <mjs@apple.com>
2943
2944         Reviewed by Oliver.
2945         
2946         - initialize local vars as side effect of call instead of in bytecode
2947         1.004x speedup on SunSpider.
2948
2949         This removes just the dispatch overhead for these loads - in the
2950         future, dead store elimination might be able to eliminate them
2951         entirely.
2952         
2953         * VM/CodeGenerator.cpp:
2954         (KJS::CodeGenerator::CodeGenerator): For function blocks, don't
2955         emit loads of undefined for var initialization.
2956         * VM/Machine.cpp:
2957         (KJS::slideRegisterWindowForCall): Instead, initialize locals
2958         as part of the call.
2959
2960 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2961
2962         Reviewed by Oliver.
2963
2964         Remove helper functions in the parser that are no longer needed.
2965
2966         * kjs/grammar.y:
2967
2968 2008-06-14  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2969
2970         Reviewed by Oliver.
2971
2972         Bug 19484: More instructions needs to use temporary registers
2973         <https://bugs.webkit.org/show_bug.cgi?id=19484>
2974
2975         Make code generation for AddNode and SubNode use temporaries when
2976         necessary.
2977
2978         * kjs/grammar.y:
2979         * kjs/nodes.cpp:
2980         (KJS::AddNode::emitCode):
2981         (KJS::SubNode::emitCode):
2982         * kjs/nodes.h:
2983         (KJS::AddNode::):
2984         (KJS::SubNode::):
2985
2986 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
2987
2988         Reviewed by Maciej.
2989
2990         Combine TrueNode and FalseNode to make BooleanNode, and remove the
2991         unused class PlaceholderTrueNode.
2992
2993         * kjs/grammar.y:
2994         * kjs/nodes.cpp:
2995         (KJS::BooleanNode::emitCode):
2996         * kjs/nodes.h:
2997         (KJS::BooleanNode::):
2998         (KJS::BooleanNode::precedence):
2999         * kjs/nodes2string.cpp:
3000         (KJS::BooleanNode::streamTo):
3001
3002 2008-06-13  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3003
3004         Reviewed by Maciej.
3005
3006         Eliminate the use of temporaries to store the left hand side of an
3007         expression when the right hand side is a constant. This slightly
3008         improves the generated bytecode for a few SunSpider tests, but it is
3009         mostly in preparation for fixing
3010
3011         Bug 19484: More instructions needs to use temporary registers
3012         <https://bugs.webkit.org/show_bug.cgi?id=19484>
3013
3014         * VM/CodeGenerator.h:
3015         (KJS::CodeGenerator::leftHandSideNeedsCopy):
3016         (KJS::CodeGenerator::emitNodeForLeftHandSide):
3017         * kjs/nodes.cpp:
3018         (KJS::BracketAccessorNode::emitCode):
3019         (KJS::ReadModifyResolveNode::emitCode):
3020         (KJS::AssignDotNode::emitCode):
3021         (KJS::ReadModifyDotNode::emitCode):
3022         (KJS::AssignBracketNode::emitCode):
3023         (KJS::ReadModifyBracketNode::emitCode):
3024         * kjs/nodes.h:
3025         (KJS::ExpressionNode::):
3026         (KJS::FalseNode::):
3027         (KJS::TrueNode::):
3028         (KJS::NumberNode::):
3029         (KJS::StringNode::):
3030
3031 2008-06-13  Maciej Stachowiak  <mjs@apple.com>
3032
3033         Reviewed by Oliver.
3034         
3035         - prettify opcode stats output
3036         
3037         I changed things to be a bit more aligned, also there is a new
3038         section listing most common opcodes and most common sequences that
3039         include them.
3040
3041         * VM/Opcode.cpp:
3042         (KJS::OpcodeStats::~OpcodeStats):
3043         * VM/Opcode.h:
3044
3045 2008-06-13  Kevin McCullough  <kmccullough@apple.com>
3046
3047         Reviewed by Geoff.
3048
3049         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3050         profiler.
3051         - Remove recursion from exclude().  This leaves only focus() to fix.
3052
3053         * JavaScriptCore.exp: Change the signatures of the exported functions.
3054         * profiler/Profile.cpp:
3055         (KJS::Profile::forEach): I added a traverseNextNodePreOrder() function
3056         and so needed to distinguish the other function by labeling it
3057         traverseNextNodePostOrder().
3058         (KJS::Profile::exclude): All new exclude that iteratively walks the tree
3059         * profiler/Profile.h:
3060         (KJS::Profile::focus): Add a null check for m_head.
3061         * profiler/ProfileNode.cpp:
3062         (KJS::ProfileNode::traverseNextNodePostOrder): Renamed
3063         (KJS::ProfileNode::traverseNextNodePreOrder): Walks the tree in pre-
3064         order, where the parent is processed before the children.
3065         (KJS::ProfileNode::setTreeVisible): Iterate over the sub-tree and set
3066         all of the nodes visible value.  This changes another function that used
3067         recursion.
3068         (KJS::ProfileNode::exclude): Remove recursion from this function.
3069         Because we now check for m_visible and we are walking the tree in pre-
3070         order we do not need to check if an excluded node is in an excluded
3071         sub-tree.
3072         * profiler/ProfileNode.h: Added specific selfTime functions to
3073         facilitate exclude().
3074         (KJS::ProfileNode::setSelfTime):
3075         (KJS::ProfileNode::setActualSelfTime):
3076         (KJS::ProfileNode::setVisibleSelfTime):
3077
3078 2008-06-12  Darin Adler  <darin@apple.com>
3079
3080         Reviewed by Maciej.
3081
3082         - https://bugs.webkit.org/show_bug.cgi?id=19434
3083           speed up SunSpider by avoiding some string boxing
3084
3085         Speeds up SunSpider by 1.1%.
3086
3087         Optimized code path for getting built-in properties from strings -- avoid
3088         boxing with a string object in that case. We can make further changes to avoid
3089         even more boxing, but this change alone is a win.
3090
3091         * API/JSCallbackObjectFunctions.h:
3092         (KJS::JSCallbackObject::staticValueGetter): Use isObject instead of inherits
3093         in asssert, since the type of slotBase() is now JSValue, not JSObject.
3094         (KJS::JSCallbackObject::staticFunctionGetter): Ditto.
3095         (KJS::JSCallbackObject::callbackGetter): Ditto.
3096
3097         * kjs/internal.cpp:
3098         (KJS::StringImp::getPrimitiveNumber): Updated for change of data member name.
3099         (KJS::StringImp::toBoolean): Ditto.
3100         (KJS::StringImp::toNumber): Ditto.
3101         (KJS::StringImp::toString): Ditto.
3102         (KJS::StringInstance::create): Added; avoids a bit of cut and paste code.
3103         (KJS::StringImp::toObject): Use StringInstance::create.
3104         (KJS::StringImp::toThisObject): Ditto.
3105         (KJS::StringImp::lengthGetter): Added. Replaces the getter that used to live in
3106         the StringInstance class.
3107         (KJS::StringImp::indexGetter): Ditto.
3108         (KJS::StringImp::indexNumericPropertyGetter): Ditto.
3109         (KJS::StringImp::getOwnPropertySlot): Added. Deals with built in properties of
3110         the string class without creating a StringInstance.
3111
3112         * kjs/internal.h:
3113         (KJS::StringImp::getStringPropertySlot): Added. To be used by both the string
3114         and string object getOwnPropertySlot function.
3115
3116         * kjs/lookup.h:
3117         (KJS::staticFunctionGetter): Updated since slotBase() is now a JSValue rather
3118         than a JSObject.
3119
3120         * kjs/object.h: Removed PropertySlot::slotBase() function, which can now move
3121         back into property_slot.h where it belongs since it doesn't have to cast to
3122         JSObject*.
3123
3124         * kjs/property_slot.cpp:
3125         (KJS::PropertySlot::functionGetter): Updated since slot.slotBase() is now a JSValue*
3126         instead of JSObject*. setGetterSlot still guarantees the base is a JSObject*.
3127         * kjs/property_slot.h:
3128         (KJS::PropertySlot::PropertySlot): Changed base to JSValue* intead of JSCell*.
3129         (KJS::PropertySlot::setStaticEntry): Ditto.
3130         (KJS::PropertySlot::setCustom): Ditto.
3131         (KJS::PropertySlot::setCustomIndex): Ditto.
3132         (KJS::PropertySlot::setCustomNumeric): Ditto.
3133         (KJS::PropertySlot::slotBase): Moved inline here since it no longer involves a
3134         downcast to JSObject*.
3135         (KJS::PropertySlot::setBase): Changed to JSValue*.
3136
3137         * kjs/string_object.cpp:
3138         (KJS::StringInstance::getOwnPropertySlot): Changed to use getStringPropertySlot
3139         instead of coding the properties here. This allows sharing the code with StringImp.
3140
3141         * kjs/string_object.h: Removed inlineGetOwnPropertySlot, lengthGetter, and indexGetter.
3142         Made one of the constructors protected.
3143
3144         * kjs/value.h: Made getOwnPropertySlot private in the JSCell class -- this is better
3145         since it's not the real JSObject getOwnPropertySlot semantic and most callers shouldn't
3146         use it.
3147
3148 2008-06-12  Alexey Proskuryakov  <ap@webkit.org>
3149
3150         Reviewed by Maciej.
3151
3152         Preparation to making JavaScript heap per-thread.
3153
3154         * kjs/collector.cpp:
3155         (KJS::Collector::collect):
3156         * kjs/collector.h:
3157         (KJS::Collector::markListSet):
3158         The collector now holds the list of protected lists itself, to be made per-instance.
3159
3160         * kjs/list.h: Changed to hold a pointer to a mark set this list is in, if any.
3161         (KJS::List::List): Explicitly initialize m_size with zero, as m_vector.size() is
3162         guaranteed to be such anyway.
3163         (KJS::List::append): Changed the fast case to only be executed as long as inline buffer
3164         is used, because otherwise, we now do more expensive checks.
3165
3166         * kjs/list.cpp:
3167         (KJS::List::markLists): Renamed from markProtectedListsSlowCase, made it take the list set
3168         as a parameter.
3169         (KJS::List::slowAppend): If a non-immediate value is appended, the list needs to be added
3170         to an appropriate Heap's protected list. For now, a static Collector::markListSet() is
3171         used, but the code is layed out in preparation to making the switch to multiple heaps.
3172
3173         * JavaScriptCore.exp: Updated export list.
3174
3175 2008-06-12  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3176
3177         Reviewed by Maciej.
3178
3179         Bug 19510: CodeBlock::needsFullScopeChain not always set for global code
3180         <https://bugs.webkit.org/show_bug.cgi?id=19510>
3181
3182         This fixes the symptoms by using CodeGenerator::m_codeType to determine
3183         when to use temporaries instead of CodeBlock::needsFullScopeChain, but
3184         it does not fix the problem itself.
3185
3186         * VM/CodeGenerator.h:
3187         (KJS::CodeGenerator::leftHandSideNeedsCopy):
3188
3189 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3190
3191         Reviewed by Maciej.
3192
3193         Bug 19498: REGRESSION (r34497): crash while loading GMail
3194         <https://bugs.webkit.org/show_bug.cgi?id=19498>
3195
3196         * VM/CodeGenerator.cpp:
3197         (KJS::CodeGenerator::emitJumpIfTrueMayCombine):
3198         (KJS::CodeGenerator::emitJumpIfTrue):
3199         * VM/CodeGenerator.h:
3200         * kjs/nodes.cpp:
3201         (KJS::DoWhileNode::emitCode):
3202         (KJS::WhileNode::emitCode):
3203         (KJS::ForNode::emitCode):
3204         (KJS::CaseBlockNode::emitCodeForBlock):
3205
3206 2008-06-11  Darin Adler  <darin@apple.com>
3207
3208         Reviewed by Maciej.
3209
3210         - a little bit of cleanup and prep for some upcoming optimizations
3211
3212         * JavaScriptCore.exp: Re-sorted this file (with sort command line tool).
3213         * VM/CodeBlock.cpp:
3214         (KJS::CodeBlock::dump): Fixed printf to avoid warnings -- to use %lu we
3215         need to make sure the type is unsigned long.
3216         * kjs/object.cpp:
3217         (KJS::Error::create): Eliminated unused error names array, and also put
3218         the strings into the code since there was already a switch statment.
3219         This also avoids having to contemplate a hypothetical access past the
3220         end of the array.
3221         * kjs/object.h: Got rid of errorNames.
3222         * kjs/property_slot.cpp: Deleted unused ungettableGetter.
3223         * kjs/property_slot.h: Ditto.
3224         * wtf/AlwaysInline.h: Added LIKELY alongside UNLIKELY.
3225
3226 2008-06-11  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3227
3228         Reviewed by Darin.
3229
3230         Bug 19457: Create fused opcodes for tests and conditional jumps
3231         <https://bugs.webkit.org/show_bug.cgi?id=19457>
3232
3233         Add a new jless instruction, and modify the code generator to emit it
3234         instead of the pair (less, jtrue).
3235
3236         Gives a 3.6% improvement on SunSpider.
3237
3238         * VM/CodeBlock.cpp:
3239         (KJS::CodeBlock::dump):
3240         * VM/CodeGenerator.cpp:
3241         (KJS::CodeGenerator::CodeGenerator):
3242         (KJS::CodeGenerator::emitOpcode):
3243         (KJS::CodeGenerator::retrieveLastBinaryOp):
3244         (KJS::CodeGenerator::rewindBinaryOp):
3245         (KJS::CodeGenerator::emitJump):
3246         (KJS::CodeGenerator::emitJumpIfTrue):
3247         (KJS::CodeGenerator::emitJumpIfFalse):
3248         (KJS::CodeGenerator::emitMove):
3249         (KJS::CodeGenerator::emitNot):
3250         (KJS::CodeGenerator::emitEqual):
3251         (KJS::CodeGenerator::emitNotEqual):
3252         (KJS::CodeGenerator::emitStrictEqual):
3253         (KJS::CodeGenerator::emitNotStrictEqual):
3254         (KJS::CodeGenerator::emitLess):
3255         (KJS::CodeGenerator::emitLessEq):
3256         (KJS::CodeGenerator::emitPreInc):
3257         (KJS::CodeGenerator::emitPreDec):
3258         (KJS::CodeGenerator::emitPostInc):
3259         (KJS::CodeGenerator::emitPostDec):
3260         (KJS::CodeGenerator::emitToJSNumber):
3261         (KJS::CodeGenerator::emitNegate):
3262         (KJS::CodeGenerator::emitAdd):
3263         (KJS::CodeGenerator::emitMul):
3264         (KJS::CodeGenerator::emitDiv):
3265         (KJS::CodeGenerator::emitMod):
3266         (KJS::CodeGenerator::emitSub):
3267         (KJS::CodeGenerator::emitLeftShift):
3268         (KJS::CodeGenerator::emitRightShift):
3269         (KJS::CodeGenerator::emitUnsignedRightShift):
3270         (KJS::CodeGenerator::emitBitAnd):
3271         (KJS::CodeGenerator::emitBitXOr):
3272         (KJS::CodeGenerator::emitBitOr):
3273         (KJS::CodeGenerator::emitBitNot):
3274         (KJS::CodeGenerator::emitInstanceOf):
3275         (KJS::CodeGenerator::emitTypeOf):
3276         (KJS::CodeGenerator::emitIn):
3277         (KJS::CodeGenerator::emitLoad):
3278         (KJS::CodeGenerator::emitNewObject):
3279         (KJS::CodeGenerator::emitNewArray):
3280         (KJS::CodeGenerator::emitResolve):
3281         (KJS::CodeGenerator::emitGetScopedVar):
3282         (KJS::CodeGenerator::emitPutScopedVar):
3283         (KJS::CodeGenerator::emitResolveBase):
3284         (KJS::CodeGenerator::emitResolveWithBase):
3285         (KJS::CodeGenerator::emitResolveFunction):
3286         (KJS::CodeGenerator::emitGetById):
3287         (KJS::CodeGenerator::emitPutById):
3288         (KJS::CodeGenerator::emitPutGetter):
3289         (KJS::CodeGenerator::emitPutSetter):
3290         (KJS::CodeGenerator::emitDeleteById):
3291         (KJS::CodeGenerator::emitGetByVal):
3292         (KJS::CodeGenerator::emitPutByVal):
3293         (KJS::CodeGenerator::emitDeleteByVal):
3294         (KJS::CodeGenerator::emitPutByIndex):
3295         (KJS::CodeGenerator::emitNewFunction):
3296         (KJS::CodeGenerator::emitNewRegExp):
3297         (KJS::CodeGenerator::emitNewFunctionExpression):
3298         (KJS::CodeGenerator::emitCall):
3299         (KJS::CodeGenerator::emitReturn):
3300         (KJS::CodeGenerator::emitEnd):
3301         (KJS::CodeGenerator::emitConstruct):
3302         (KJS::CodeGenerator::emitPushScope):
3303         (KJS::CodeGenerator::emitPopScope):
3304         (KJS::CodeGenerator::emitDebugHook):
3305         (KJS::CodeGenerator::emitComplexJumpScopes):
3306         (KJS::CodeGenerator::emitJumpScopes):
3307         (KJS::CodeGenerator::emitNextPropertyName):
3308         (KJS::CodeGenerator::emitGetPropertyNames):
3309         (KJS::CodeGenerator::emitCatch):
3310         (KJS::CodeGenerator::emitThrow):
3311         (KJS::CodeGenerator::emitNewError):
3312         (KJS::CodeGenerator::emitJumpSubroutine):
3313         (KJS::CodeGenerator::emitSubroutineReturn):
3314         * VM/CodeGenerator.h:
3315         * VM/Machine.cpp:
3316         (KJS::Machine::privateExecute):
3317         * VM/Opcode.cpp:
3318         * VM/Opcode.h:
3319
3320 2008-06-11  Darin Adler  <darin@apple.com>
3321
3322         Reviewed by Alexey.
3323
3324         - fix https://bugs.webkit.org/show_bug.cgi?id=19442
3325           JavaScript array implementation doesn't maintain m_numValuesInVector when sorting
3326
3327         * kjs/array_instance.cpp:
3328         (KJS::ArrayInstance::checkConsistency): Added. Empty inline version for when
3329         consistency checks are turned off.
3330         (KJS::ArrayInstance::ArrayInstance): Check consistency after construction.
3331         (KJS::ArrayInstance::~ArrayInstance): Check consistency before destruction.
3332         (KJS::ArrayInstance::put): Check consistency before and after.
3333         (KJS::ArrayInstance::deleteProperty): Ditto.
3334         (KJS::ArrayInstance::setLength): Ditto.
3335         (KJS::compareByStringPairForQSort): Use typedef for clarity.
3336         (KJS::ArrayInstance::sort): Check consistency before and after. Also broke the loop
3337         to set up sorting into two separate passes. Added FIXMEs about various exception
3338         safety issues. Added code to set m_numValuesInVector after sorting.
3339         (KJS::ArrayInstance::compactForSorting): Ditto.
3340
3341         * kjs/array_instance.h: Added a definition of an enum for the types of consistency
3342         check and a declaration of the consistency checking function.
3343
3344 2008-06-10  Kevin Ollivier  <kevino@theolliviers.com>
3345
3346         wx build fix. Link against libedit on Mac since HAVE(READLINE) is defined there.
3347
3348         * jscore.bkl:
3349
3350 2008-06-10  Alexey Proskuryakov  <ap@webkit.org>
3351
3352         Reviewed by Darin.
3353
3354         https://bugs.webkit.org/show_bug.cgi?id=16503
3355         match limit takes at least 13% of the time on the SunSpider regexp-dna test
3356
3357         Make the limit test slightly more efficient. It is not clear how much of a win it is,
3358         as the improvement on regexp-dna varies from 2.3% to 0.6% depending on what revision I
3359         apply the patch to. Today, the win on regexp-dna was minimal, but the total win was whopping
3360         0.5%, due to random code generation changes.
3361
3362         * pcre/pcre_exec.cpp: (match): Avoid loading a constant on each iteration.
3363
3364 2008-06-09  Alp Toker  <alp@nuanti.com>
3365
3366         gcc3/autotools build fix. Add explicit -O2 -fno-strict-aliasing to
3367         each of the tools since these are no longer set globally.
3368
3369         * GNUmakefile.am:
3370
3371 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3372
3373         Reviewed by Sam.
3374
3375         Add an include for readline/history.h to fix the build for Darwin users
3376         with the GNU readline library installed. Also, clean up the style of
3377         the HAVE(READLINE) check.
3378
3379         * kjs/testkjs.cpp:
3380         (runInteractive):
3381
3382 2008-06-09  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3383
3384         Reviewed by Darin.
3385
3386         Bug 17531: Add interactive mode to testkjs
3387         <https://bugs.webkit.org/show_bug.cgi?id=17531>
3388
3389         This is a cleaned up version of Sam's earlier patch to add an
3390         interactive mode to testkjs.
3391
3392         Readline support is only enabled on Darwin platforms for now, but
3393         other ports can enable it by defining HAVE_READLINE in kjs/config.h.
3394
3395         * JavaScriptCore.xcodeproj/project.pbxproj:
3396         * kjs/config.h:
3397         * kjs/testkjs.cpp:
3398         (Options::Options):
3399         (runWithScripts):
3400         (runInteractive):
3401         (printUsageStatement):
3402         (parseArguments):
3403         (kjsmain):
3404
3405 2008-06-08  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3406
3407         Reviewed by Darin.
3408
3409         Bug 19346: REGRESSION: Mootools 1.2 Class inheritance broken in post-SquirrelFish merge
3410         <https://bugs.webkit.org/show_bug.cgi?id=19346>
3411
3412         A check for whether a function's caller is eval code accidentally included
3413         the case where the caller's caller is native code. Add a CodeType field to
3414         CodeBlock and use this for the eval caller test instead.
3415
3416         * VM/CodeBlock.h:
3417         (KJS::CodeBlock::CodeBlock):
3418         (KJS::ProgramCodeBlock::ProgramCodeBlock):
3419         (KJS::EvalCodeBlock::EvalCodeBlock):
3420         * VM/Machine.cpp:
3421         (KJS::getCallerFunctionOffset):
3422         * kjs/nodes.cpp:
3423         (KJS::FunctionBodyNode::generateCode):
3424         (KJS::ProgramNode::generateCode):
3425
3426 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3427
3428         Reviewed by Dan Bernstein.
3429
3430         Bug 17928: testkjs shouldn't require "-f"
3431         <https://bugs.webkit.org/show_bug.cgi?id=17928>
3432
3433         * kjs/testkjs.cpp:
3434         (printUsageStatement):
3435         (parseArguments):
3436
3437 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3438
3439         Reviewed by Eric.
3440
3441         Bug 17548: JavaScriptCore print(a, b) differs from Spidermonkey Behavior
3442         <https://bugs.webkit.org/show_bug.cgi?id=17548>
3443
3444         * kjs/testkjs.cpp:
3445         (functionPrint):
3446
3447 2008-06-07  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3448
3449         Reviewed by Sam.
3450
3451         Bug 17547: JavaScriptCore print() differs from Spidermonkey Behavior
3452         <https://bugs.webkit.org/show_bug.cgi?id=17547>
3453
3454         * kjs/testkjs.cpp:
3455         (functionPrint):
3456
3457 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3458
3459         More build fixes.
3460
3461         * kjs/JSGlobalData.cpp: Fixed an included file name for case-sensitive file systems, fixed
3462         JSGlobalData::threadInstance() for non-multithreaded builds.
3463
3464 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3465
3466         Build fix - actually adding JSGlobalData.cpp to non-Mac builds!
3467
3468         * GNUmakefile.am:
3469         * JavaScriptCore.pri:
3470         * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
3471         * JavaScriptCoreSources.bkl:
3472
3473 2008-06-07  Alexey Proskuryakov  <ap@webkit.org>
3474
3475         Try to fix Gtk/gcc 4.3 build.
3476
3477         * kjs/JSGlobalData.h: Include ustring.h instead of forward-declaring UString::Rep.
3478
3479 2008-06-06  Alexey Proskuryakov  <ap@webkit.org>
3480
3481         Reviewed by Darin.
3482
3483         Combine per-thread objects into one, to make it easier to support legacy clients (for
3484         which they shouldn't be really per-thread).
3485
3486         No change on SunSpider total.
3487
3488         * JavaScriptCore.xcodeproj/project.pbxproj: Added JSGlobalData.{h,cpp}
3489
3490         * kjs/JSGlobalData.cpp: Added.
3491         (KJS::JSGlobalData::JSGlobalData):
3492         (KJS::JSGlobalData::~JSGlobalData):
3493         (KJS::JSGlobalData::threadInstance):
3494         * kjs/JSGlobalData.h: Added.
3495         This class encapsulates all data that should be per-thread (or shared between legacy clients).
3496         It will also keep a Heap pointer, but right now, Heap (Collector) methods are all static.
3497
3498         * kjs/identifier.h:
3499         (KJS::Identifier::Identifier):
3500         Added a constructor explicitly taking JSGlobalData to access IdentifierTable. Actually,
3501         all of them should, but this will be a separate patch.
3502
3503         * kjs/identifier.cpp:
3504         (KJS::IdentifierTable::literalTable):
3505         (KJS::createIdentifierTable):
3506         (KJS::deleteIdentifierTable):
3507         (KJS::Identifier::add):
3508         (KJS::Identifier::addSlowCase):
3509         Combined IdentifierTable and LiteralIdentifierTable into a single class for simplicity.
3510
3511         * kjs/grammar.y: kjsyyparse now takes JSGlobalData, not just a Lexer.
3512
3513         * kjs/nodes.cpp:
3514         (KJS::Node::Node):
3515         (KJS::EvalFunctionCallNode::emitCode):
3516         (KJS::ScopeNode::ScopeNode):
3517         Changed to access Lexer and Parser via JSGlobalData::threadInstance(). This is also a
3518         temporary measure, they will need to use JSGlobalData explicitly.
3519
3520         * VM/CodeGenerator.cpp:
3521         (KJS::CodeGenerator::CodeGenerator):
3522         * VM/CodeGenerator.h:
3523         * VM/Machine.cpp:
3524         (KJS::callEval):
3525         * kjs/CommonIdentifiers.cpp:
3526         (KJS::CommonIdentifiers::CommonIdentifiers):
3527         * kjs/CommonIdentifiers.h:
3528         * kjs/DebuggerCallFrame.cpp:
3529         (KJS::DebuggerCallFrame::evaluate):
3530         * kjs/ExecState.cpp:
3531         (KJS::ExecState::ExecState):
3532         * kjs/ExecState.h:
3533         (KJS::ExecState::globalData):
3534         (KJS::ExecState::identifierTable):
3535         (KJS::ExecState::propertyNames):
3536         (KJS::ExecState::emptyList):
3537         (KJS::ExecState::lexer):
3538         (KJS::ExecState::parser):
3539         (KJS::ExecState::arrayTable):
3540         (KJS::ExecState::dateTable):
3541         (KJS::ExecState::mathTable):
3542         (KJS::ExecState::numberTable):
3543         (KJS::ExecState::RegExpImpTable):
3544         (KJS::ExecState::RegExpObjectImpTable):
3545         (KJS::ExecState::stringTable):
3546         * kjs/InitializeThreading.cpp:
3547         (KJS::initializeThreadingOnce):
3548         * kjs/JSGlobalObject.cpp:
3549         (KJS::JSGlobalObject::init):
3550         * kjs/JSGlobalObject.h:
3551         (KJS::JSGlobalObject::JSGlobalObjectData::JSGlobalObjectData):
3552         (KJS::JSGlobalObject::head):
3553         (KJS::JSGlobalObject::globalData):
3554         * kjs/Parser.cpp:
3555         (KJS::Parser::parse):
3556         * kjs/Parser.h:
3557         * kjs/function.cpp:
3558         (KJS::FunctionImp::getParameterName):
3559         (KJS::IndexToNameMap::unMap):
3560         (KJS::globalFuncEval):
3561         * kjs/function_object.cpp:
3562         (KJS::FunctionObjectImp::construct):
3563         * kjs/interpreter.cpp:
3564         (KJS::Interpreter::checkSyntax):
3565         (KJS::Interpreter::evaluate):
3566         * kjs/lexer.cpp:
3567         (kjsyylex):
3568         * kjs/lexer.h:
3569         * kjs/testkjs.cpp:
3570         (prettyPrintScript):
3571         Updated for the above changes. Most of threadInstance uses here will need to be replaced with
3572         explicitly passed pointers to support legacy JSC clients.
3573
3574         * JavaScriptCore.exp: Removed KJS::parser().
3575
3576 2008-06-06  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3577
3578         Reviewed by Oliver.
3579
3580         Bug 19424: Add support for logging opcode pair counts
3581         <https://bugs.webkit.org/show_bug.cgi?id=19424>
3582
3583         * VM/Machine.cpp:
3584         (KJS::Machine::privateExecute):
3585         * VM/Opcode.cpp:
3586         (KJS::OpcodeStats::OpcodeStats):
3587         (KJS::compareOpcodeIndices):
3588         (KJS::compareOpcodePairIndices):
3589         (KJS::OpcodeStats::~OpcodeStats):
3590         (KJS::OpcodeStats::recordInstruction):
3591         (KJS::OpcodeStats::resetLastInstruction):
3592         * VM/Opcode.h:
3593
3594 2008-06-06  Kevin McCullough  <kmccullough@apple.com>
3595
3596         Reviewed by Adam.
3597
3598         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3599         profiler.
3600         - Change the remaining functions that do not take arguments, from using
3601         recursion to using iteration.
3602
3603         * JavaScriptCore.exp:
3604         * profiler/Profile.cpp:
3605         (KJS::stopProfiling):
3606         (KJS::restoreAll):
3607         (KJS::Profile::stopProfiling): Use foreach instead of recursion.
3608         (KJS::Profile::restoreAll): Ditto.
3609         * profiler/Profile.h:
3610         * profiler/ProfileNode.cpp: Remove recursion.
3611         (KJS::ProfileNode::stopProfiling):
3612         (KJS::ProfileNode::restore):
3613         * profiler/ProfileNode.h:
3614
3615 2008-06-05  Oliver Hunt  <oliver@apple.com>
3616
3617         Reviewed by Alexey.
3618
3619         Fix Greater and GreaterEq nodes to emit code for the left
3620         and right sub-expressions in the correct order.
3621
3622         * kjs/nodes.cpp:
3623         (KJS::GreaterNode::emitCode):
3624         (KJS::GreaterEqNode::emitCode):
3625
3626 2008-06-05  Antti Koivisto  <antti@apple.com>
3627
3628         Reviewed by Alp Toker.
3629         
3630         Fix whitespaces.
3631
3632         * kjs/collector.cpp:
3633         (KJS::getPlatformThreadRegisters):
3634
3635 2008-06-05  Antti Koivisto  <antti@apple.com>
3636
3637         Reviewed by Darin.
3638         
3639         Support compiling JavaScriptCore for ARM.
3640
3641         * kjs/collector.cpp:
3642         (KJS::getPlatformThreadRegisters):
3643         (KJS::otherThreadStackPointer):
3644
3645 2008-06-05  Kevin McCullough  <kmccullough@apple.com>
3646
3647         Reviewed by Jon.
3648
3649         - Name changes.
3650
3651         * JavaScriptCore.exp:
3652         * profiler/Profile.cpp:
3653         (KJS::Profile::Profile):
3654         (KJS::Profile::stopProfiling):
3655         (KJS::Profile::didExecute):
3656         (KJS::Profile::forEach):
3657         (KJS::Profile::debugPrintData):
3658         (KJS::Profile::debugPrintDataSampleStyle):
3659         * profiler/Profile.h:
3660         (KJS::Profile::callTree):
3661         (KJS::Profile::totalTime):
3662         (KJS::Profile::sortTotalTimeDescending):
3663         (KJS::Profile::sortTotalTimeAscending):
3664         (KJS::Profile::sortSelfTimeDescending):
3665         (KJS::Profile::sortSelfTimeAscending):
3666         (KJS::Profile::sortCallsDescending):
3667         (KJS::Profile::sortCallsAscending):
3668         (KJS::Profile::sortFunctionNameDescending):
3669         (KJS::Profile::sortFunctionNameAscending):
3670         (KJS::Profile::focus):
3671         (KJS::Profile::exclude):
3672         (KJS::Profile::restoreAll):
3673
3674 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3675
3676         Reviewed by Stephanie Lewis.
3677
3678         Added the -fno-move-loop-invariants flag to the pcre_exec.cpp build, to
3679         tell GCC not to perform loop invariant motion, since GCC's loop
3680         invariant motion doesn't do very well with computed goto code.
3681         
3682         SunSpider reports no change.
3683
3684 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3685
3686         Reviewed by Stephanie Lewis.
3687         
3688         Added the -fno-tree-pre flag to the Machine.cpp build, to tell GCC not
3689         to perform Partial Redundancy Elimination (PRE) on trees in Machine.cpp,
3690         since GCC's PRE doesn't do very well with computed goto code.
3691         
3692         SunSpider reports a .7% speedup.
3693         
3694 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
3695
3696         Reviewed by Stephanie Lewis (or maybe the other way around).
3697         
3698         Minor change to PCRE to help out certain compilers.
3699         
3700         SunSpider reports no change, maybe a small speedup.
3701
3702         * pcre/pcre_exec.cpp:
3703         (match): Use instructionPtr++ a little less, to avoid confusing the
3704         optimizer.
3705
3706 2008-06-05  Alexey Proskuryakov  <ap@webkit.org>
3707
3708         Re-landing an independent part of a previously rolled out threading patch.
3709
3710         * wtf/ThreadSpecific.h: Make sure to initialize POD thread-specific varaibles, too
3711         (replaced "new T" with "new T()").
3712
3713 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
3714
3715         Reviewed by Hyatt.
3716         
3717         - force inlining of a template function that only has one call site per specialization
3718         1.3% speedup on SunSpider
3719
3720         * kjs/collector.cpp:
3721         (KJS::Collector::heapAllocate): This template function is only
3722         called from allocate() and allocateNumber() (once per
3723         specialization) and the extra call overhead for GC allocation
3724         shows up, so force inlining.
3725
3726 2008-06-05  Maciej Stachowiak  <mjs@apple.com>
3727
3728         Reviewed by Alexey and Oliver.
3729         
3730         - remove profiler fetch hack
3731         I measure an 0.5% progression from this, others show a wash. It seems not needed any more.
3732
3733         * VM/Machine.cpp:
3734         (KJS::Machine::privateExecute):
3735
3736 2008-06-05  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3737
3738         Reviewed by Maciej.
3739
3740         Bug 19400: subscript operator does not protect base when necessary
3741         <https://bugs.webkit.org/show_bug.cgi?id=19400>
3742
3743         Use a temporary for the base in BracketAccessorNode if the subscript
3744         might possibly modify it.
3745
3746         * kjs/grammar.y:
3747         * kjs/nodes.cpp:
3748         (KJS::BracketAccessorNode::emitCode):
3749         * kjs/nodes.h:
3750         (KJS::BracketAccessorNode::):
3751
3752 2008-06-04  Sam Weinig  <sam@webkit.org>
3753
3754         Reviewed by Maciej Stachowiak.
3755
3756         Big cleanup of formatting and whitespace.
3757
3758 2008-06-04  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3759
3760         Reviewed by Oliver.
3761
3762         Add an option to dump statistics on executed instructions.
3763
3764         * VM/Machine.cpp:
3765         (KJS::Machine::privateExecute):
3766         * VM/Opcode.cpp:
3767         (KJS::OpcodeStats::~OpcodeStats):
3768         (KJS::OpcodeStats::recordInstruction):
3769         * VM/Opcode.h:
3770
3771 2008-06-04  Kevin McCullough  <kmccullough@apple.com>
3772
3773         Reviewed by Geoff.
3774
3775         <rdar://problem/5969992> JSProfiler: Remove the recursion limit in the
3776         profiler.
3777         - This patch removes the use of recursion for the sort functions.
3778
3779         * JavaScriptCore.exp: Change the signatures of the functions being
3780         exported.
3781         * profiler/Profile.cpp:
3782         (KJS::Profile::sort): This generic function will accept any of the
3783         static sort functions and apply them to the whole tree.
3784         * profiler/Profile.h: All of the sorting functions now call the new
3785         sort() function.
3786         (KJS::Profile::sortTotalTimeDescending):
3787         (KJS::Profile::sortTotalTimeAscending):
3788         (KJS::Profile::sortSelfTimeDescending):
3789         (KJS::Profile::sortSelfTimeAscending):
3790         (KJS::Profile::sortCallsDescending):
3791         (KJS::Profile::sortCallsAscending):
3792         (KJS::Profile::sortFunctionNameDescending):
3793         (KJS::Profile::sortFunctionNameAscending):
3794         * profiler/ProfileNode.cpp:
3795         (KJS::ProfileNode::ProfileNode): m_head used to point to the head node
3796         if this was the head node.  It now points to null to make iteration easy
3797         (KJS::ProfileNode::willExecute): Now must check if m_head is null, this
3798         check used to happend in the constructor.
3799         (KJS::ProfileNode::stopProfiling): Again the check is slightly different
3800         to determine if this is the head.
3801         (KJS::ProfileNode::traverseNextNode): This function returns the next
3802         node in post order.
3803         (KJS::ProfileNode::sort): This generic function will sort according to
3804         the comparator passed in, then reset the children pointers to macth the
3805         new order.
3806         * profiler/ProfileNode.h: The sorting function were removed from the
3807         definition file and instead use the new generic sort() function
3808         (KJS::ProfileNode::totalPercent): because the head can now be empty we
3809         need to check here too for the head node.
3810         (KJS::ProfileNode::selfPercent): Ditto
3811         (KJS::ProfileNode::firstChild): This function is necessary for the 
3812         iterative algorithm in Profile.cpp.
3813         (KJS::ProfileNode::sortTotalTimeDescending):
3814         (KJS::ProfileNode::sortTotalTimeAscending):
3815         (KJS::ProfileNode::sortSelfTimeDescending):
3816         (KJS::ProfileNode::sortSelfTimeAscending):
3817         (KJS::ProfileNode::sortCallsDescending):
3818         (KJS::ProfileNode::sortCallsAscending):
3819         (KJS::ProfileNode::sortFunctionNameDescending):
3820         (KJS::ProfileNode::sortFunctionNameAscending):
3821         (KJS::ProfileNode::childrenBegin):
3822         (KJS::ProfileNode::childrenEnd):
3823         (KJS::ProfileNode::totalTimeDescendingComparator):
3824         (KJS::ProfileNode::totalTimeAscendingComparator):
3825         (KJS::ProfileNode::selfTimeDescendingComparator):
3826         (KJS::ProfileNode::selfTimeAscendingComparator):
3827         (KJS::ProfileNode::callsDescendingComparator):
3828         (KJS::ProfileNode::callsAscendingComparator):
3829         (KJS::ProfileNode::functionNameDescendingComparator):
3830         (KJS::ProfileNode::functionNameAscendingComparator):
3831
3832 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
3833
3834         Reviewed by Darin.
3835
3836         Fix JSClassCreate to work with old JSCore API threading model.
3837
3838         No change on SunSpider.
3839
3840         * API/JSClassRef.cpp: (OpaqueJSClass::OpaqueJSClass): Since JSClass is constructed without
3841         a context, there is no way for it to create Identifiers.
3842         Also, added initializeThreading(), just for good measure.
3843
3844         * API/JSCallbackObjectFunctions.h: (KJS::::getPropertyNames): Make an Identifier out of the
3845         string here, because propertyNames.add() needs that.
3846
3847         * kjs/identifier.cpp:
3848         * kjs/identifier.h:
3849         (KJS::Identifier::equal):
3850         * kjs/ustring.cpp:
3851         (KJS::equal):
3852         Moved equal() from identifier.h to ustring.h, because it's not really about Identifiers,
3853         and to make it possible to use it from StrHash.
3854         Include StrHash.h from ustring.h to avoid having the behavior depend on headers that happen
3855         to be included.
3856
3857         * wtf/StrHash.h: Removed.
3858         * kjs/ustring.h: Made RefPtr<UString::Rep> use the same default hash as UString::Rep* (it
3859         used to default to pointer equality). Moved the whole StrHash header into ustring.h.
3860
3861         * JavaScriptCore.exp: Export equal() for WebCore use (this StrHash is used in c_class.cpp,
3862         jni_class.cpp, and npruntime.cpp).
3863
3864 2008-06-04  Alexey Proskuryakov  <ap@webkit.org>
3865
3866         Rubber-stamped by Darin.
3867
3868         Fix spacing in collector.{h,cpp}.
3869
3870         * kjs/collector.cpp:
3871         * kjs/collector.h:
3872
3873 2008-06-03  Cameron Zwarich  <cwzwarich@uwaterloo.ca>
3874
3875         Reviewed by Maciej.
3876
3877         Build fix. The cleanup in r34355 missed a method.
3878
3879         * kjs/nodes.cpp:
3880         * kjs/nodes.h:
3881
3882 2008-06-03  Darin Adler  <darin@apple.com>
3883
3884         Reviewed by Geoff.
3885
3886         - https://bugs.webkit.org/show_bug.cgi?id=19269
3887           speed up SunSpider by eliminating the toObject call for most get/put/delete
3888
3889         Makes standalone SunSpider 1.025x as fast as before.
3890
3891         The getOwnPropertySlot virtual function now takes care of the toObject call
3892         for get. Similarly, the put function (and later deleteProperty) does the
3893         same for those operations. To do this, the virtual functions were moved from
3894         the JSObject class to the JSCell class. Also, since the caller no longer knows
3895         the identity of the "original object", which is used by JavaScript-function
3896         based getters, changed the PropertySlot class so the original object is
3897         already stored in the slot when getOwnPropertySlot is called, if the caller
3898         intends to call getValue.
3899
3900         This affected the old interpreter code enough that the easiest thing for me
3901         was to just delete it. While I am not certain the mysterious slowdown is not
3902         still occurring, the net change is definitely a significant speedup.
3903
3904         * JavaScriptCore.exp: Updated.
3905
3906         * VM/Machine.cpp: Moved the UNLIKELY macro into AlwaysInline.h.
3907         (KJS::resolve): Set up the originalObject in the PropertySlot before
3908         calling getPropertySlot. Also removed the originalObject argument from
3909         getValue.
3910         (KJS::resolve_skip): Ditto.
3911         (KJS::resolveBaseAndProperty): Ditto.
3912         (KJS::resolveBaseAndFunc): Ditto.
3913         (KJS::Machine::privateExecute): Removed the toObject calls from the get and
3914         put functions where possible, instead calling directly with JSValue and letting
3915         the JSValue and JSCell calls handle toObject. Same for toThisObject.
3916
3917         * kjs/ExecState.h: Removed OldInterpreterExecState.
3918
3919         * API/JSBase.cpp: Updated includes.
3920
3921         * kjs/LocalStorageEntry.h: Removed contents. Later we can remove the file too.
3922
3923         * kjs/array_instance.cpp:
3924         (KJS::ArrayInstance::lengthGetter): Removed originalObject argumet.
3925         (KJS::ArrayInstance::inlineGetOwnPropertySlot): Don't pass a base value to
3926         setValueSlot. Also use UNLIKELY around the "getting elements past the end of
3927         the array" code path; less common than successfully getting an element.
3928
3929         * kjs/array_object.cpp:
3930         (KJS::getProperty): Initialize the PropertySlot with the original object.
3931         Don't pass the original object to the get function.
3932         (KJS::arrayProtoFuncFilter): Ditto.
3933         (KJS::arrayProtoFuncMap): Ditto.
3934         (KJS::arrayProtoFuncEvery): Ditto.
3935         (KJS::arrayProtoFuncForEach): Ditto.
3936         (KJS::arrayProtoFuncSome): Ditto.
3937
3938         * kjs/function_object.cpp:
3939         (KJS::FunctionObjectImp::construct): Removed an obsolete comment.
3940
3941         * kjs/grammar.y: Eliminated support for some of the node types that were
3942         used to optimize executing from the syntax tree.
3943
3944         * kjs/internal.cpp:
3945         (KJS::StringImp::toThisObject): Added. Same as toObject.
3946         (KJS::NumberImp::toThisObject): Ditto.
3947         (KJS::GetterSetterImp::getOwnPropertySlot): Added. Not reached.
3948         (KJS::GetterSetterImp::put): Ditto.
3949         (KJS::GetterSetterImp::toThisObject): Ditto.
3950
3951         * kjs/internal.h: Added toThisObject to NumberImp for speed.
3952
3953         * kjs/lexer.cpp:
3954         (KJS::Lexer::shift): Changed shift to just do a single character, to unroll
3955         the loop and especially to make the one character case faster.
3956         (KJS::Lexer::setCode): Call shift multiple times instead of passing a number.
3957         (KJS::Lexer::lex): Ditto.
3958         (KJS::Lexer::matchPunctuator): Ditto. Also removed unneeded elses after returns.
3959         (KJS::Lexer::scanRegExp): Ditto.
3960         * kjs/lexer.h: Removed the count argument from shift.
3961
3962         * kjs/math_object.cpp:
3963         (KJS::mathProtoFuncPow): Call jsNaN instead of jsNumber(NaN).
3964
3965         * kjs/nodes.cpp: Removed some of the things needed only for the pre-SquirrelFish
3966         execution model.
3967         (KJS::ForNode::emitCode): Handle cases where some expressions are missing by
3968         not emitting any code at all. The old way was to emit code for "true", but
3969         this is an unnecessary remnant of the old way of doing things.
3970
3971         * kjs/nodes.h: Removed some of the things needed only for the pre-SquirrelFish
3972         execution model.
3973
3974         * kjs/object.cpp:
3975         (KJS::JSObject::fillGetterPropertySlot): Changed to only pass in the getter
3976         function. The old code passed in a base, but it was never used when
3977         actually getting the property; the toThisObject call was pointless. Also
3978         changed to not pass a base for setUndefined.
3979
3980         * kjs/object.h: Added the new JSCell operations to GetterSetterImp.
3981         Never called.
3982         (KJS::JSObject::get): Initialize the object in the PropertySlot and don't
3983         pass it in getValue.
3984         (KJS::JSObject::getOwnPropertySlotForWrite): Removed the base argument
3985         in calls to setValueSlot.
3986         (KJS::JSObject::getOwnPropertySlot): Ditto.
3987         (KJS::JSValue::get): Added. Here because it calls through to JSObject.
3988         A version of JSObject::get that also handles the other types of JSValue
3989         by creating the appropriate wrapper. Saves the virtual call to toObject.
3990         (KJS::JSValue::put): Ditto.
3991         (KJS::JSValue::deleteProperty): Ditto.
3992
3993         * kjs/property_slot.cpp:
3994         (KJS::PropertySlot::undefinedGetter): Removed the originalObject argument.
3995         (KJS::PropertySlot::ungettableGetter): Ditto.
3996         (KJS::PropertySlot::functionGetter): Ditto. Use the value in the base
3997         as the "this" object, which will be set to the original object by the new
3998         PropertySlot initialization code. Also call toThisObject. The old code did
3999         not do this, but needed to so we can properly handle the activation object
4000         like the other similar code paths.
4001
4002         * kjs/property_slot.h:
4003         (KJS::PropertySlot::PropertySlot): Added a constructor that takes a base
4004         object. In debug builds, set the base to 0 if you don't pass one.
4005         (KJS::PropertySlot::getValue): Don't take or pass the originalObject.
4006         (KJS::PropertySlot::setValueSlot): Don't take a base object, and clear the
4007         base object in debug builds.
4008         (KJS::PropertySlot::setGetterSlot): Ditto.
4009         (KJS::PropertySlot::setUndefined): Ditto.
4010         (KJS::PropertySlot::setUngettable): Ditto.
4011         (KJS::PropertySlot::slotBase): Assert that a base object is present.
4012         This will fire if someone actually calls the get function without having
4013         passed in a base object and the getter needs it.
4014         (KJS::PropertySlot::setBase): Added. Used by the code that implements
4015         toObject so it can supply the original object after the fact.
4016         (KJS::PropertySlot::clearBase): Added. Clears the base, but is debug-only
4017         code because it's an error to fetch the base if you don't have a guarantee
4018         it was set.
4019
4020         * API/JSCallbackObject.h:
4021         * API/JSCallbackObjectFunctions.h:
4022         (KJS::JSCallbackObject::cachedValueGetter):
4023         (KJS::JSCallbackObject::staticValueGetter):
4024         (KJS::JSCallbackObject::staticFunctionGetter):
4025         (KJS::JSCallbackObject::callbackGetter):
4026         * kjs/JSActivation.cpp:
4027         (KJS::JSActivation::getOwnPropertySlot):
4028         (KJS::JSActivation::argumentsGetter):
4029         * kjs/JSActivation.h:
4030         * kjs/JSVariableObject.h:
4031         (KJS::JSVariableObject::symbolTableGet):
4032         * kjs/array_instance.h:
4033         * kjs/function.cpp:
4034         (KJS::FunctionImp::argumentsGetter):
4035         (KJS::FunctionImp::callerGetter):
4036         (KJS::FunctionImp::lengthGetter):
4037         (KJS::Arguments::mappedIndexGetter):
4038         * kjs/function.h:
4039         * kjs/lookup.h:
4040         (KJS::staticFunctionGetter):
4041         (KJS::staticValueGetter):
4042         * kjs/string_object.cpp:
4043         (KJS::StringInstance::lengthGetter):
4044         (KJS::StringInstance::indexGetter):
4045         (KJS::stringInstanceNumericPropertyGetter):
4046         * kjs/string_object.h:
4047         Removed originalObject arguments from getters. Don't pass base values to
4048         the various PropertySlot functions that no longer take them.
4049
4050         * kjs/value.cpp:
4051         (KJS::JSCell::getOwnPropertySlot): Added. Calls toObject and then sets the slot.
4052         This function has to always return true, because the caller can't walk the prototype
4053         chain. Because of that, we do a getPropertySlot, not getOwnPropertySlot, which works
4054         for the caller. This is private, only called by getOwnPropertySlotInternal.
4055         (KJS::JSCell::put): Added. Calls toObject and then put.
4056         (KJS::JSCell::toThisObject): Added. Calls toObject.
4057
4058         * kjs/value.h: Added get, put, and toThisObject to both JSValue
4059         and JSCell. These take care of the toObject operation without an additional virtual
4060         function call, and so make the common "already an object" case faster.
4061
4062         * wtf/AlwaysInline.h: Moved the UNLIKELY macro here for now. Maybe we can find a
4063         better place later, or rename this header.
4064
4065 2008-06-03  Oliver Hunt  <oliver@apple.com>
4066
4067         Reviewed by Tim.
4068
4069         Bug 12983: Web Inspector break on the debugger keyword
4070         <https://bugs.webkit.org/show_bug.cgi?id=12983>
4071
4072         Added a DebuggerStatementNode to handle codegen, and added a new
4073         DidReachBreakPoint debug event (which will hopefully be useful
4074         if we ever move breakpoint management into JSC proper).  Also
4075         added didReachBreakpoint to Debugger to allow us to actually respond
4076         to this event.
4077
4078         * VM/CodeBlock.cpp:
4079         (KJS::debugHookName):
4080         * VM/Machine.cpp:
4081         (KJS::Machine::debug):
4082         * VM/Machine.h:
4083         * kjs/debugger.h:
4084         * kjs/grammar.y:
4085         * kjs/nodes.cpp:
4086         (KJS::DebuggerStatementNode::emitCode):
4087         (KJS::DebuggerStatementNode::execute):
4088         * kjs/nodes.h:
4089         (KJS::DebuggerStatementNode::):
4090         * kjs/nodes2string.cpp:
4091         (KJS::DebuggerStatementNode::streamTo):
4092
4093 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
4094
4095         Reviewed by Oliver.
4096         
4097         - document remaining opcodes.
4098
4099         * VM/Machine.cpp:
4100         (KJS::Machine::privateExecute): Document call, call_eval,
4101         construct, ret and end opcodes.
4102
4103 2008-06-03  Maciej Stachowiak  <mjs@apple.com>
4104
4105         Reviewed by Oliver.
4106
4107         * VM/Machine.cpp:
4108         (KJS::Machine::privateExecute): Document throw and catch opcodes.
4109
4110 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
4111
4112         Reviewed by Alexey Proskuryakov.
4113
4114         Removed JSObject::call, since it just called JSObject::callAsFunction.
4115
4116         SunSpider reports no change.
4117
4118 2008-06-02  Geoffrey Garen  <ggaren@apple.com>
4119
4120         Reviewed by Darin Adler.
4121         
4122         A little cleanup in the CodeGenerator.
4123
4124         * VM/CodeGenerator.cpp: A few changes here.
4125
4126         (1) Removed remaining cases of the old hack of putting "this" into the
4127         symbol table; replaced with explicit tracking of m_thisRegister.
4128
4129         (2) Made m_thisRegister behave the same for function, eval, and program
4130         code, removing the static programCodeThis() function.
4131
4132         (3) Added a feature to nix a ScopeNode's declaration stacks when done
4133         compiling, to save memory.
4134
4135         (4) Removed code that copied eval declarations into special vectors: we
4136         just use the originals in the ScopeNode now.
4137         
4138         * VM/CodeGenerator.h: Removed unneded parameters from the CodeGenerator
4139         constructor: we just use get that data from the ScopeNode now.
4140
4141         * VM/Machine.cpp:
4142         (KJS::Machine::execute): When executing an eval node, don't iterate a
4143         special copy of its declarations; iterate the originals, instead.
4144
4145         * kjs/nodes.cpp: Moved responsibility for knowing what AST data to throw
4146         away into the CodeGenerator. Nodes no longer call shrinkCapacity on
4147         their data directly.
4148         
4149         * kjs/nodes.h: Changed FunctionStack to ref its contents, so declaration
4150         data stays around even after we've thrown&n