| | 1 | 2008-08-18 Cameron Zwarich <cwzwarich@uwaterloo.ca> |
|---|
| | 2 | |
|---|
| | 3 | Reviewed by Maciej. |
|---|
| | 4 | |
|---|
| | 5 | Change the counting of constants so that preincrement and predecrement of |
|---|
| | 6 | const local variables are considered unexpected loads. |
|---|
| | 7 | |
|---|
| | 8 | * kjs/nodes.cpp: |
|---|
| | 9 | (KJS::PrefixResolveNode::emitCode): |
|---|
| | 10 | * kjs/nodes.h: |
|---|
| | 11 | (KJS::ScopeNode::neededConstants): |
|---|
| | 12 | |
|---|
| | 13 | 2008-08-17 Oliver Hunt <oliver@apple.com> |
|---|
| | 14 | |
|---|
| | 15 | Reviewed by Cameron Zwarich. |
|---|
| | 16 | |
|---|
| | 17 | <rdar://problem/6150322> In Gmail, a crash occurs at KJS::Machine::privateExecute() when applying list styling to text after a quote had been removed |
|---|
| | 18 | <https://bugs.webkit.org/show_bug.cgi?id=20386> |
|---|
| | 19 | |
|---|
| | 20 | This crash was caused by "depth()" incorrectly determining the scope depth |
|---|
| | 21 | of a 0 depth function without a full scope chain. Because such a function |
|---|
| | 22 | would not have an activation the depth function would return the scope depth |
|---|
| | 23 | of the parent frame, thus triggering an incorrect unwind. Any subsequent |
|---|
| | 24 | look up that walked the scope chain would result in incorrect behaviour, |
|---|
| | 25 | leading to a crash or incorrect variable resolution. This can only actually |
|---|
| | 26 | happen in try...finally statements as that's the only path that can result in |
|---|
| | 27 | the need to unwind the scope chain, but not force the function to need a |
|---|
| | 28 | full scope chain. |
|---|
| | 29 | |
|---|
| | 30 | The fix is simply to check for this case before attempting to walk the scope chain. |
|---|
| | 31 | |
|---|
| | 32 | * VM/Machine.cpp: |
|---|
| | 33 | (KJS::depth): |
|---|
| | 34 | (KJS::Machine::throwException): |
|---|
| | 35 | |
|---|
| | 36 | 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> |
|---|
| | 37 | |
|---|
| | 38 | Reviewed by Maciej. |
|---|
| | 39 | |
|---|
| | 40 | Bug 20419: Remove op_jless |
|---|
| | 41 | <https://bugs.webkit.org/show_bug.cgi?id=20419> |
|---|
| | 42 | |
|---|
| | 43 | Remove op_jless, which is rarely used now that we have op_loop_if_less. |
|---|
| | 44 | |
|---|
| | 45 | * VM/CodeBlock.cpp: |
|---|
| | 46 | (KJS::CodeBlock::dump): |
|---|
| | 47 | * VM/CodeGenerator.cpp: |
|---|
| | 48 | (KJS::CodeGenerator::emitJumpIfTrue): |
|---|
| | 49 | * VM/Machine.cpp: |
|---|
| | 50 | (KJS::Machine::privateExecute): |
|---|
| | 51 | * VM/Opcode.h: |
|---|
| | 52 | |
|---|
| | 53 | 2008-08-17 Cameron Zwarich <cwzwarich@uwaterloo.ca> |
|---|
| | 54 | |
|---|
| | 55 | Reviewed by Dan Bernstein. |
|---|
| | 56 | |
|---|
| | 57 | Fix a typo in r35807 that is also causing build failures for |
|---|
| | 58 | non-AllInOne builds. |
|---|
| | 59 | |
|---|
| | 60 | * kjs/NumberConstructor.cpp: |
|---|
| | 61 | |
|---|
| | 62 | 2008-08-17 Geoffrey Garen <ggaren@apple.com> |
|---|
| | 63 | |
|---|
| | 64 | Reviewed by Cameron Zwarich. |
|---|
| | 65 | |
|---|
| | 66 | Made room for a free word in JSCell. |
|---|
| | 67 | |
|---|
| | 68 | SunSpider says no change. |
|---|
| | 69 | |
|---|
| | 70 | I changed JSCallbackObjectData, Arguments, JSArray, and RegExpObject to |
|---|
| | 71 | store auxiliary data in a secondary structure. |
|---|
| | 72 | |
|---|
| | 73 | I changed InternalFunction to store the function's name in the property |
|---|
| | 74 | map. |
|---|
| | 75 | |
|---|
| | 76 | I changed JSGlobalObjectData to use a virtual destructor, so WebCore's |
|---|
| | 77 | JSDOMWindowBaseData could inherit from it safely. (It's a strange design |
|---|
| | 78 | for JSDOMWindowBase to allocate an object that JSGlobalObject deletes, |
|---|
| | 79 | but that's really our only option, given the size constraint.) |
|---|
| | 80 | |
|---|
| | 81 | I also added a bunch of compile-time ASSERTs, and removed lots of comments |
|---|
| | 82 | in JSObject.h because they were often out of date, and they got in the |
|---|
| | 83 | way of reading what was actually going on. |
|---|
| | 84 | |
|---|
| | 85 | Also renamed JSArray::getLength to JSArray::length, to match our style |
|---|
| | 86 | guidelines. |
|---|
| | 87 | |
|---|
| | 88 | 2008-08-16 Geoffrey Garen <ggaren@apple.com> |
|---|
| | 89 | |
|---|
| | 90 | Reviewed by Oliver Hunt. |
|---|
| | 91 | |
|---|
| | 92 | Sped up property access for array.length and string.length by adding a |
|---|
| | 93 | mechanism for returning a temporary value directly instead of returning |
|---|
| | 94 | a pointer to a function that retrieves the value. |
|---|
| | 95 | |
|---|
| | 96 | Also removed some unused cruft from PropertySlot. |
|---|
| | 97 | |
|---|
| | 98 | SunSpider says 0.5% - 1.2% faster. |
|---|
| | 99 | |
|---|
| | 100 | NOTE: This optimization is not a good idea in general, because it's |
|---|
| | 101 | actually a pessimization in the case of resolve for assignment, |
|---|
| | 102 | and it may get in the way of other optimizations in the future. |
|---|
| | 103 | |
|---|
| | 104 | 2008-08-16 Dan Bernstein <mitz@apple.com> |
|---|
| | 105 | |
|---|
| | 106 | Reviewed by Geoffrey Garen. |
|---|
| | 107 | |
|---|
| | 108 | Disable dead code stripping in debug builds. |
|---|
| | 109 | |
|---|
| | 110 | * Configurations/Base.xcconfig: |
|---|
| | 111 | * JavaScriptCore.xcodeproj/project.pbxproj: |
|---|
| | 112 | |
|---|
| | 113 | 2008-08-15 Mark Rowe <mrowe@apple.com> |
|---|
| | 114 | |
|---|
| | 115 | Reviewed by Oliver Hunt. |
|---|
| | 116 | |
|---|
| | 117 | <rdar://problem/6143072> FastMallocZone's enumeration code makes assumptions about handling of remote memory regions that overlap |
|---|
| | 118 | |
|---|
| | 119 | * wtf/FastMalloc.cpp: |
|---|
| | 120 | (WTF::TCMalloc_Central_FreeList::enumerateFreeObjects): Don't directly compare pointers mapped into the local process with |
|---|
| | 121 | a pointer that has not been mapped. Instead, calculate a local address for the pointer and compare with that. |
|---|
| | 122 | (WTF::TCMallocStats::FreeObjectFinder::findFreeObjects): Pass in the remote address of the central free list so that it can |
|---|
| | 123 | be used when calculating local addresses. |
|---|
| | 124 | (WTF::TCMallocStats::FastMallocZone::enumerate): Ditto. |
|---|
| | 125 | |
|---|
| | 126 | 2008-08-15 Mark Rowe <mrowe@apple.com> |
|---|
| | 127 | |
|---|
| | 128 | Rubber-stamped by Geoff Garen. |
|---|
| | 129 | |
|---|
| | 130 | <rdar://problem/6139914> Please include a _debug version of JavaScriptCore framework |
|---|
| | 131 | |
|---|
| | 132 | * Configurations/Base.xcconfig: Factor out the debug-only settings so that they can shared |
|---|
| | 133 | between the Debug configuration and debug Production variant. |
|---|
| | 134 | * JavaScriptCore.xcodeproj/project.pbxproj: Enable the debug variant. |
|---|
| | 135 | |
|---|
| | 136 | 2008-08-15 Mark Rowe <mrowe@apple.com> |
|---|
| | 137 | |
|---|
| | 138 | Fix the 64-bit build. |
|---|
| | 139 | |
|---|
| | 140 | Add extra cast to avoid warnings about loss of precision when casting from |
|---|
| | 141 | JSValue* to an integer type. |
|---|
| | 142 | |
|---|
| | 143 | * kjs/JSImmediate.h: |
|---|
| | 144 | (KJS::JSImmediate::intValue): |
|---|
| | 145 | (KJS::JSImmediate::uintValue): |
|---|
| | 146 | |
|---|
| | 147 | 2008-08-15 Alexey Proskuryakov <ap@webkit.org> |
|---|
| | 148 | |
|---|
| | 149 | Still fixing Windows build. |
|---|
| | 150 | |
|---|
| | 151 | * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make: Added OpaqueJSString |
|---|
| | 152 | to yet another place. |
|---|
| | 153 | |
|---|
| | 154 | 2008-08-15 Alexey Proskuryakov <ap@webkit.org> |
|---|
| | 155 | |
|---|
| | 156 | Trying to fix non-Apple builds. |
|---|
| | 157 | |
|---|
| | 158 | * ForwardingHeaders/JavaScriptCore/OpaqueJSString.h: Added. |
|---|
| | 159 | |
|---|
| | 160 | 2008-08-15 Gavin Barraclough <barraclough@apple.com> |
|---|
| | 161 | |
|---|
| | 162 | Reviewed by Geoff Garen. |
|---|
| | 163 | |
|---|
| | 164 | Allow JSImmediate to hold 31 bit signed integer immediate values. The low two bits of a |
|---|
| | 165 | JSValue* are a tag, with the tag value 00 indicating the JSValue* is a pointer to a |
|---|
| | 166 | JSCell. Non-zero tag values used to indicate that the JSValue* is not a real pointer, |
|---|
| | 167 | but instead holds an immediate value encoded within the pointer. This patch changes the |
|---|
| | 168 | encoding so both the tag values 01 and 11 indicate the value is a signed integer, allowing |
|---|
| | 169 | a 31 bit value to be stored. All other immediates are tagged with the value 10, and |
|---|
| | 170 | distinguished by a secondary tag. |
|---|
| | 171 | |
|---|
| | 172 | Roughly +2% on SunSpider. |
|---|
| | 173 | |
|---|
| | 174 | * kjs/JSImmediate.h: Encoding of JSImmediates has changed - see comment at head of file for |
|---|
| | 175 | descption of new layout. |
|---|
| | 176 | |
|---|
| | 177 | 2008-08-15 Alexey Proskuryakov <ap@webkit.org> |
|---|
| | 178 | |
|---|
| | 179 | More build fixes. |
|---|
| | 180 | |
|---|
| | 181 | * API/OpaqueJSString.h: Add a namespace to friend declaration to appease MSVC. |
|---|
| | 182 | * API/JSStringRefCF.h: (JSStringCreateWithCFString) Cast UniChar* to UChar* explicitly. |
|---|
| | 183 | * JavaScriptCore.exp: Added OpaqueJSString::create(const KJS::UString&) to fix WebCore build. |
|---|
| | 184 | |
|---|
| | 185 | 2008-08-15 Alexey Proskuryakov <ap@webkit.org> |
|---|
| | 186 | |
|---|
| | 187 | Build fix. |
|---|
| | 188 | |
|---|
| | 189 | * JavaScriptCore.xcodeproj/project.pbxproj: Marked OpaqueJSString as private |
|---|
| | 190 | |
|---|
| | 191 | * kjs/identifier.cpp: |
|---|
| | 192 | (KJS::Identifier::checkSameIdentifierTable): |
|---|
| | 193 | * kjs/identifier.h: |
|---|
| | 194 | (KJS::Identifier::add): |
|---|
| | 195 | Since checkSameIdentifierTable is exported for debug build's sake, gcc wants it to be |
|---|
| | 196 | non-inline in release builds, too. |
|---|
| | 197 | |
|---|
| | 198 | * JavaScriptCore.exp: Don't export inline OpaqueJSString destructor. |
|---|
| | 199 | |
|---|
| | 200 | 2008-08-15 Alexey Proskuryakov <ap@webkit.org> |
|---|
| | 201 | |
|---|
| | 202 | Reviewed by Geoff Garen. |
|---|
| | 203 | |
|---|
| | 204 | JSStringRef is created context-free, but can get linked to one via an identifier table, |
|---|
| | 205 | breaking an implicit API contract. |
|---|
| | 206 | |
|---|
| | 207 | Made JSStringRef point to OpaqueJSString, which is a new string object separate from UString. |
|---|
| | 208 | |
|---|
| | 209 | * API/APICast.h: Removed toRef/toJS conversions for JSStringRef, as this is no longer a |
|---|
| | 210 | simple typecast. |
|---|
| | 211 | |
|---|
| | 212 | * kjs/identifier.cpp: |
|---|
| | 213 | (KJS::Identifier::checkSameIdentifierTable): |
|---|
| | 214 | * kjs/identifier.h: |
|---|
| | 215 | (KJS::Identifier::add): |
|---|
| | 216 | (KJS::UString::checkSameIdentifierTable): |
|---|
| | 217 | Added assertions to verify that an identifier is not being added to a different JSGlobalData. |
|---|
| | 218 | |
|---|
| | 219 | * API/JSObjectRef.cpp: |
|---|
| | 220 | (OpaqueJSPropertyNameArray::OpaqueJSPropertyNameArray): Changed OpaqueJSPropertyNameArray to |
|---|
| | 221 | hold JSStringRefs. This is necessary to avoid having to construct (and leak) a new instance |
|---|
| | 222 | in JSPropertyNameArrayGetNameAtIndex(), now that making a JSStringRef is not just a typecast. |
|---|
| | 223 | |
|---|
| | 224 | * API/OpaqueJSString.cpp: Added. |
|---|
| | 225 | (OpaqueJSString::create): |
|---|
| | 226 | (OpaqueJSString::ustring): |
|---|
| | 227 | (OpaqueJSString::identifier): |
|---|
| | 228 | * API/OpaqueJSString.h: Added. |
|---|
| | 229 | (OpaqueJSString::create): |
|---|
| | 230 | (OpaqueJSString::characters): |
|---|
| | 231 | (OpaqueJSString::length): |
|---|
| | 232 | (OpaqueJSString::OpaqueJSString): |
|---|
| | 233 | (OpaqueJSString::~OpaqueJSString): |
|---|
| | 234 | |
|---|
| | 235 | * API/JSBase.cpp: |
|---|
| | 236 | (JSEvaluateScript): |
|---|
| | 237 | (JSCheckScriptSyntax): |
|---|
| | 238 | * API/JSCallbackObjectFunctions.h: |
|---|
| | 239 | (KJS::::getOwnPropertySlot): |
|---|
| | 240 | (KJS::::put): |
|---|
| | 241 | (KJS::::deleteProperty): |
|---|
| | 242 | (KJS::::staticValueGetter): |
|---|
| | 243 | (KJS::::callbackGetter): |
|---|
| | 244 | * API/JSStringRef.cpp: |
|---|
| | 245 | (JSStringCreateWithCharacters): |
|---|
| | 246 | (JSStringCreateWithUTF8CString): |
|---|
| | 247 | (JSStringRetain): |
|---|
| | 248 | (JSStringRelease): |
|---|
| | 249 | (JSStringGetLength): |
|---|
| | 250 | (JSStringGetCharactersPtr): |
|---|
| | 251 | (JSStringGetMaximumUTF8CStringSize): |
|---|
| | 252 | (JSStringGetUTF8CString): |
|---|
| | 253 | (JSStringIsEqual): |
|---|
| | 254 | * API/JSStringRefCF.cpp: |
|---|
| | 255 | (JSStringCreateWithCFString): |
|---|
| | 256 | (JSStringCopyCFString): |
|---|
| | 257 | * API/JSValueRef.cpp: |
|---|
| | 258 | (JSValueMakeString): |
|---|
| | 259 | (JSValueToStringCopy): |
|---|
| | 260 | Updated to use OpaqueJSString. |
|---|
| | 261 | |
|---|
| | 262 | * GNUmakefile.am: |
|---|
| | 263 | * JavaScriptCore.exp: |
|---|
| | 264 | * JavaScriptCore.pri: |
|---|
| | 265 | * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: |
|---|
| | 266 | * JavaScriptCore.xcodeproj/project.pbxproj: |
|---|
| | 267 | * JavaScriptCoreSources.bkl: |
|---|
| | 268 | Added OpaqueJSString. |
|---|
| | 269 | |
|---|