1 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
5 Bug 20419: Remove op_jless
6 <https://bugs.webkit.org/show_bug.cgi?id=20419>
8 Remove op_jless, which is rarely used now that we have op_loop_if_less.
11 (KJS::CodeBlock::dump):
12 * VM/CodeGenerator.cpp:
13 (KJS::CodeGenerator::emitJumpIfTrue):
15 (KJS::Machine::privateExecute):
18 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca>
20 Reviewed by Dan Bernstein.
22 Fix a typo in r35807 that is also causing build failures for
25 * kjs/NumberConstructor.cpp:
27 2008-08-17 Geoffrey Garen <ggaren@apple.com>
29 Reviewed by Cameron Zwarich.
31 Made room for a free word in JSCell.
33 SunSpider says no change.
35 I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to
36 store auxiliary data in a secondary structure.
38 I changed InternalFunction to store the function's name in the property
41 I changed JSGlobalObjectData to use a virtual destructor, so WebCore's
42 JSDOMWindowBaseData could inherit from it safely. (It's a strange design
43 for JSDOMWindowBase to allocate an object that JSGlobalObject deletes,
44 but that's really our only option, given the size constraint.)
46 I also added a bunch of compile-time ASSERTs, and removed lots of comments
47 in JSObject.h because they were often out of date, and they got in the
48 way of reading what was actually going on.
50 Also renamed JSArray::getLength to JSArray::length, to match our style
53 2008-08-16 Geoffrey Garen <ggaren@apple.com>
55 Reviewed by Oliver Hunt.
57 Sped up property access for array.length and string.length by adding a
58 mechanism for returning a temporary value directly instead of returning
59 a pointer to a function that retrieves the value.
61 Also removed some unused cruft from PropertySlot.
63 SunSpider says 0.5% - 1.2% faster.
65 NOTE: This optimization is not a good idea in general, because it's
66 actually a pessimization in the case of resolve for assignment,
67 and it may get in the way of other optimizations in the future.
69 2008-08-16 Dan Bernstein <mitz@apple.com>
71 Reviewed by Geoffrey Garen.
73 Disable dead code stripping in debug builds.
75 * Configurations/Base.xcconfig:
76 * JavaScriptCore.xcodeproj/project.pbxproj:
78 2008-08-15 Mark Rowe <mrowe@apple.com>
80 Reviewed by Oliver Hunt.
82 <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap
85 (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with
86 a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that.
87 (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can
88 be used when calculating local addresses.
89 (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto.
91 2008-08-15 Mark Rowe <mrowe@apple.com>
93 Rubber-stamped by Geoff Garen.
95 <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework
97 * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared
98 between the Debug configuration and debug Production variant.
99 * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant.
101 2008-08-15 Mark Rowe <mrowe@apple.com>
103 Fix the 64-bit build.
105 Add extra cast to avoid warnings about loss of precision when casting from
106 JSValue* to an integer type.
109 (KJS::JSImmediate::intValue):
110 (KJS::JSImmediate::uintValue):
112 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
114 Still fixing Windows build.
116 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString
117 to yet another place.
119 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
121 Trying to fix non-Apple builds.
123 * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added.
125 2008-08-15 Gavin Barraclough <barraclough@apple.com>
127 Reviewed by Geoff Garen.
129 Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a
130 JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a
131 JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer,
132 but instead holds an immediate value encoded within the pointer. This patch changes the
133 encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing
134 a 31 bit value to be stored. All other immediates are tagged with the value 10, and
135 distinguished by a secondary tag.
137 Roughly +2% on SunSpider.
139 * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for
140 descption of new layout.
142 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
146 * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC.
147 * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly.
148 * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build.
150 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
154 * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private
156 * kjs/identifier.cpp:
157 (KJS::Identifier::checkSameIdentifierTable):
159 (KJS::Identifier::add):
160 Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be
161 non-inline in release builds, too.
163 * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor.
165 2008-08-15 Alexey Proskuryakov <ap@webkit.org>
167 Reviewed by Geoff Garen.
169 JSStringRef is created context-free, but can get linked to one via an identifier table,
170 breaking an implicit API contract.
172 Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString.
174 * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a
177 * kjs/identifier.cpp:
178 (KJS::Identifier::checkSameIdentifierTable):
180 (KJS::Identifier::add):
181 (KJS::UString::checkSameIdentifierTable):
182 Added assertions to verify that an identifier is not being added to a different JSGlobalData.
184 * API/JSObjectRef.cpp:
185 (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to
186 hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance
187 in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast.
189 * API/OpaqueJSString.cpp: Added.
190 (OpaqueJSString::create):
191 (OpaqueJSString::ustring):
192 (OpaqueJSString::identifier):
193 * API/OpaqueJSString.h: Added.
194 (OpaqueJSString::create):
195 (OpaqueJSString::characters):
196 (OpaqueJSString::length):
197 (OpaqueJSString::OpaqueJSString):
198 (OpaqueJSString::~OpaqueJSString):
202 (JSCheckScriptSyntax):
203 * API/JSCallbackObjectFunctions.h:
204 (KJS::::getOwnPropertySlot):
206 (KJS::::deleteProperty):
207 (KJS::::staticValueGetter):
208 (KJS::::callbackGetter):
209 * API/JSStringRef.cpp:
210 (JSStringCreateWithCharacters):
211 (JSStringCreateWithUTF8CString):
215 (JSStringGetCharactersPtr):
216 (JSStringGetMaximumUTF8CStringSize):
217 (JSStringGetUTF8CString):
219 * API/JSStringRefCF.cpp:
220 (JSStringCreateWithCFString):
221 (JSStringCopyCFString):
222 * API/JSValueRef.cpp:
224 (JSValueToStringCopy):
225 Updated to use OpaqueJSString.
228 * JavaScriptCore.exp:
229 * JavaScriptCore.pri:
230 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
231 * JavaScriptCore.xcodeproj/project.pbxproj:
232 * JavaScriptCoreSources.bkl:
233 Added OpaqueJSString.
235 2008-08-14 Kevin McCullough <kmccullough@apple.com>
239 <rdar://problem/6115819> Notify of profile in console
240 - Profiles now have a unique ID so that they can be linked to the
241 console message that announces that a profile completed.
243 * profiler/HeavyProfile.cpp:
244 (KJS::HeavyProfile::HeavyProfile):
245 * profiler/Profile.cpp:
246 (KJS::Profile::create):
247 (KJS::Profile::Profile):
248 * profiler/Profile.h:
250 * profiler/ProfileGenerator.cpp:
251 (KJS::ProfileGenerator::create):
252 (KJS::ProfileGenerator::ProfileGenerator):
253 * profiler/ProfileGenerator.h:
254 * profiler/Profiler.cpp:
255 (KJS::Profiler::startProfiling):
256 * profiler/TreeProfile.cpp:
257 (KJS::TreeProfile::create):
258 (KJS::TreeProfile::TreeProfile):
259 * profiler/TreeProfile.h:
261 2008-08-13 Geoffrey Garen <ggaren@apple.com>
263 Reviewed by Oliver Hunt.
265 Nixed a PIC branch from JSObject::getOwnPropertySlot, by forcing
266 fillGetterProperty, which references a global function pointer,
269 .2% SunSpider speedup, 4.3% access-nbody speedup, 8.7% speedup on a
270 custom property access benchmark for objects with one property.
273 (KJS::JSObject::fillGetterPropertySlot):
275 2008-08-13 Alp Toker <alp@nuanti.com>
277 Reviewed by Eric Seidel.
279 https://bugs.webkit.org/show_bug.cgi?id=20349
280 WTF::initializeThreading() fails if threading is already initialized
282 Fix threading initialization logic to support cases where
283 g_thread_init() has already been called elsewhere.
285 Resolves database-related crashers reported in several applications.
287 * wtf/ThreadingGtk.cpp:
288 (WTF::initializeThreading):
290 2008-08-13 Brad Hughes <bhughes@trolltech.com>
294 Fix compiling of QtWebKit in release mode with the Intel C++ Compiler for Linux
296 The latest upgrade of the intel compiler allows us to compile all of
297 Qt with optimizations enabled (yay!).
299 * JavaScriptCore.pro:
301 2008-08-12 Oliver Hunt <oliver@apple.com>
303 Reviewed by Geoff Garen.
305 Add peephole optimisation to 'op_not... jfalse...' (eg. if(!...) )
307 This is a very slight win in sunspider, and a fairly substantial win
308 in hot code that does if(!...), etc.
310 * VM/CodeGenerator.cpp:
311 (KJS::CodeGenerator::retrieveLastUnaryOp):
312 (KJS::CodeGenerator::rewindBinaryOp):
313 (KJS::CodeGenerator::rewindUnaryOp):
314 (KJS::CodeGenerator::emitJumpIfFalse):
315 * VM/CodeGenerator.h:
317 2008-08-12 Dan Bernstein <mitz@apple.com>
319 - JavaScriptCore part of <rdar://problem/6121636>
320 Make fast*alloc() abort() on failure and add "try" variants that
321 return NULL on failure.
323 Reviewed by Darin Adler.
325 * JavaScriptCore.exp: Exported tryFastCalloc().
327 (KJS::RegisterFile::RegisterFile): Removed an ASSERT().
329 (KJS::JSArray::putSlowCase): Changed to use tryFastRealloc().
330 (KJS::JSArray::increaseVectorLength): Ditto.
332 (KJS::allocChars): Changed to use tryFastMalloc().
333 (KJS::reallocChars): Changed to use tryFastRealloc().
334 * wtf/FastMalloc.cpp:
335 (WTF::fastZeroedMalloc): Removed null checking of fastMalloc()'s result
336 and removed extra call to InvokeNewHook().
337 (WTF::tryFastZeroedMalloc): Added. Uses tryFastMalloc().
338 (WTF::tryFastMalloc): Renamed fastMalloc() to this.
339 (WTF::fastMalloc): Added. This version abort()s if allocation fails.
340 (WTF::tryFastCalloc): Renamed fastCalloc() to this.
341 (WTF::fastCalloc): Added. This version abort()s if allocation fails.
342 (WTF::tryFastRealloc): Renamed fastRealloc() to this.
343 (WTF::fastRealloc): Added. This version abort()s if allocation fails.
344 (WTF::do_malloc): Made this a function template. When the abortOnFailure
345 template parameter is set, the function abort()s on failure to allocate.
346 Otherwise, it sets errno to ENOMEM and returns zero.
347 (WTF::TCMallocStats::fastMalloc): Defined to abort() on failure.
348 (WTF::TCMallocStats::tryFastMalloc): Added. Does not abort() on
350 (WTF::TCMallocStats::fastCalloc): Defined to abort() on failure.
351 (WTF::TCMallocStats::tryFastCalloc): Added. Does not abort() on
353 (WTF::TCMallocStats::fastRealloc): Defined to abort() on failure.
354 (WTF::TCMallocStats::tryFastRealloc): Added. Does not abort() on
356 * wtf/FastMalloc.h: Declared the "try" variants.
358 2008-08-11 Adam Roben <aroben@apple.com>
360 Move WTF::notFound into its own header so that it can be used
361 independently of Vector
363 Rubberstamped by Darin Adler.
365 * JavaScriptCore.vcproj/WTF/WTF.vcproj:
366 * JavaScriptCore.xcodeproj/project.pbxproj:
367 Added NotFound.h to the project.
368 * wtf/NotFound.h: Added. Moved the notFound constant here...
369 * wtf/Vector.h: ...from here.
371 2008-08-11 Alexey Proskuryakov <ap@webkit.org>
373 Reviewed by Mark Rowe.
375 <rdar://problem/6130393> REGRESSION: PhotoBooth hangs after launching under TOT Webkit
377 * API/JSContextRef.cpp: (JSGlobalContextRelease): Corrected a comment.
379 * kjs/collector.cpp: (KJS::Heap::~Heap): Ensure that JSGlobalData is not deleted while
382 == Rolled over to ChangeLog-2008-08-10 ==