[webkit-changes] [94985] trunk/Source/JavaScriptCore
Title: [94985] trunk/Source/_javascript_Core Revision 94985 Author msab...@apple.com Date 2011-09-12 15:43:51 -0700 (Mon, 12 Sep 2011) Log Message Broken ARM build - missing semicolon in _javascript_Core/assembler/MacroAssemblerARM.h https://bugs.webkit.org/show_bug.cgi?id=67961 Added missing semicolon. Reviewed by Ryosuke Niwa. * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::branch16): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (94984 => 94985) --- trunk/Source/_javascript_Core/ChangeLog 2011-09-12 22:43:00 UTC (rev 94984) +++ trunk/Source/_javascript_Core/ChangeLog 2011-09-12 22:43:51 UTC (rev 94985) @@ -1,5 +1,17 @@ 2011-09-12 Michael Saboff msab...@apple.com +Broken ARM build - missing semicolon in _javascript_Core/assembler/MacroAssemblerARM.h +https://bugs.webkit.org/show_bug.cgi?id=67961 + +Added missing semicolon. + +Reviewed by Ryosuke Niwa. + +* assembler/MacroAssemblerARM.h: +(JSC::MacroAssemblerARM::branch16): + +2011-09-12 Michael Saboff msab...@apple.com + Update RegExp and related classes to use 8 bit strings when available https://bugs.webkit.org/show_bug.cgi?id=67337 Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h (94984 => 94985) --- trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h 2011-09-12 22:43:00 UTC (rev 94984) +++ trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h 2011-09-12 22:43:51 UTC (rev 94985) @@ -426,7 +426,7 @@ ASSERT(!(right.m_value 0x)); right.m_value = 16; m_assembler.mov_r(ARMRegisters::S1, left); -lshift32(16, ARMRegisters::S1) +lshift32(16, ARMRegisters::S1); return branch32(cond, ARMRegisters::S1, right); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [94987] trunk/Source/JavaScriptCore
Title: [94987] trunk/Source/_javascript_Core Revision 94987 Author msab...@apple.com Date 2011-09-12 16:14:30 -0700 (Mon, 12 Sep 2011) Log Message Broken Build for ARM - lshift32() needs TrustedImm32 arg https://bugs.webkit.org/show_bug.cgi?id=67965 Change lshift32(16, ARMRegisters::S1); to lshift32(TrustedImm32(16), ARMRegisters::S1); Reviewed by Anders Carlsson. * assembler/MacroAssemblerARM.h: (JSC::MacroAssemblerARM::branch16): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (94986 => 94987) --- trunk/Source/_javascript_Core/ChangeLog 2011-09-12 22:48:38 UTC (rev 94986) +++ trunk/Source/_javascript_Core/ChangeLog 2011-09-12 23:14:30 UTC (rev 94987) @@ -1,5 +1,17 @@ 2011-09-12 Michael Saboff msab...@apple.com +Broken Build for ARM - lshift32() needs TrustedImm32 arg +https://bugs.webkit.org/show_bug.cgi?id=67965 + +Change lshift32(16, ARMRegisters::S1); to lshift32(TrustedImm32(16), ARMRegisters::S1); + +Reviewed by Anders Carlsson. + +* assembler/MacroAssemblerARM.h: +(JSC::MacroAssemblerARM::branch16): + +2011-09-12 Michael Saboff msab...@apple.com + Broken ARM build - missing semicolon in _javascript_Core/assembler/MacroAssemblerARM.h https://bugs.webkit.org/show_bug.cgi?id=67961 Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h (94986 => 94987) --- trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h 2011-09-12 22:48:38 UTC (rev 94986) +++ trunk/Source/_javascript_Core/assembler/MacroAssemblerARM.h 2011-09-12 23:14:30 UTC (rev 94987) @@ -426,7 +426,7 @@ ASSERT(!(right.m_value 0x)); right.m_value = 16; m_assembler.mov_r(ARMRegisters::S1, left); -lshift32(16, ARMRegisters::S1); +lshift32(TrustedImm32(16), ARMRegisters::S1); return branch32(cond, ARMRegisters::S1, right); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [98256] trunk/WebKitLibraries
Title: [98256] trunk/WebKitLibraries Revision 98256 Author msab...@apple.com Date 2011-10-24 11:07:39 -0700 (Mon, 24 Oct 2011) Log Message WebKit doesn't build with recent changes to libdispatch https://bugs.webkit.org/show_bug.cgi?id=70737 Added new WebKitSystemInterface method CreateVMPressureDispatchOnMainQueue. * WebKitSystemInterface.h: * libWebKitSystemInterfaceLeopard.a: * libWebKitSystemInterfaceLion.a: * libWebKitSystemInterfaceSnowLeopard.a: Modified Paths trunk/WebKitLibraries/ChangeLog trunk/WebKitLibraries/WebKitSystemInterface.h trunk/WebKitLibraries/libWebKitSystemInterfaceLeopard.a trunk/WebKitLibraries/libWebKitSystemInterfaceLion.a trunk/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a Diff Modified: trunk/WebKitLibraries/ChangeLog (98255 => 98256) --- trunk/WebKitLibraries/ChangeLog 2011-10-24 18:05:57 UTC (rev 98255) +++ trunk/WebKitLibraries/ChangeLog 2011-10-24 18:07:39 UTC (rev 98256) @@ -1,3 +1,15 @@ +2011-10-24 Michael Saboff msab...@apple.com + +WebKit doesn't build with recent changes to libdispatch +https://bugs.webkit.org/show_bug.cgi?id=70737 + +Added new WebKitSystemInterface method CreateVMPressureDispatchOnMainQueue. + +* WebKitSystemInterface.h: +* libWebKitSystemInterfaceLeopard.a: +* libWebKitSystemInterfaceLion.a: +* libWebKitSystemInterfaceSnowLeopard.a: + 2011-10-21 Jeff Miller je...@apple.com Focus rings are too thin in HiDPI in WebKit2 Modified: trunk/WebKitLibraries/WebKitSystemInterface.h (98255 => 98256) --- trunk/WebKitLibraries/WebKitSystemInterface.h 2011-10-24 18:05:57 UTC (rev 98255) +++ trunk/WebKitLibraries/WebKitSystemInterface.h 2011-10-24 18:07:39 UTC (rev 98256) @@ -445,6 +445,14 @@ #endif +#if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) + +#import dispatch/dispatch.h + +dispatch_source_t WKCreateVMPressureDispatchOnMainQueue(void); + +#endif + #ifdef __cplusplus } #endif Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceLeopard.a (Binary files differ) Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceLion.a (Binary files differ) Modified: trunk/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a (Binary files differ) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [98280] trunk/Source
Title: [98280] trunk/Source Revision 98280 Author msab...@apple.com Date 2011-10-24 13:57:59 -0700 (Mon, 24 Oct 2011) Log Message WebKit doesn't build with recent changes to libdispatch https://bugs.webkit.org/show_bug.cgi?id=70737 Source/WebCore: Added initialization for new WebKitSystemInterface function CreateVMPressureDispatchOnMainQueue. Changed MemoryPressureHandler::install to use new function. Reviewed by Geoffrey Garen. No new tests. Moved functionality to WebKitSystemInterface. * WebCore.exp.in: * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::install): * platform/mac/WebCoreSystemInterface.h: * platform/mac/WebCoreSystemInterface.mm: Source/WebKit/mac: Added initialization for new WebKitSystemInterface function CreateVMPressureDispatchOnMainQueue. Reviewed by Geoffrey Garen. * WebCoreSupport/WebSystemInterface.mm: (InitWebCoreSystemInterface): Source/WebKit2: Added initialization for new WebKitSystemInterface function CreateVMPressureDispatchOnMainQueue. Reviewed by Geoffrey Garen. * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm: (InitWebCoreSystemInterface): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/WebCore.exp.in trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.mm trunk/Source/WebKit/mac/ChangeLog trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm Diff Modified: trunk/Source/WebCore/ChangeLog (98279 => 98280) --- trunk/Source/WebCore/ChangeLog 2011-10-24 20:54:14 UTC (rev 98279) +++ trunk/Source/WebCore/ChangeLog 2011-10-24 20:57:59 UTC (rev 98280) @@ -1,3 +1,22 @@ +2011-10-24 Michael Saboff msab...@apple.com + +WebKit doesn't build with recent changes to libdispatch +https://bugs.webkit.org/show_bug.cgi?id=70737 + +Added initialization for new WebKitSystemInterface function +CreateVMPressureDispatchOnMainQueue. Changed MemoryPressureHandler::install +to use new function. + +Reviewed by Geoffrey Garen. + +No new tests. Moved functionality to WebKitSystemInterface. + +* WebCore.exp.in: +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore::MemoryPressureHandler::install): +* platform/mac/WebCoreSystemInterface.h: +* platform/mac/WebCoreSystemInterface.mm: + 2011-10-24 Joshua Bell jsb...@chromium.org IndexedDB: Throw DATA_ERR on invalid keys, remove null key support Modified: trunk/Source/WebCore/WebCore.exp.in (98279 => 98280) --- trunk/Source/WebCore/WebCore.exp.in 2011-10-24 20:54:14 UTC (rev 98279) +++ trunk/Source/WebCore/WebCore.exp.in 2011-10-24 20:57:59 UTC (rev 98280) @@ -1981,3 +1981,7 @@ __ZN7WebCore7IntSizeC1ERK7_NSSize __ZNK7WebCore7IntSizecv7_NSSizeEv #endif + +#if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) +_wkCreateVMPressureDispatchOnMainQueue +#endif Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (98279 => 98280) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-10-24 20:54:14 UTC (rev 98279) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-10-24 20:57:59 UTC (rev 98280) @@ -33,20 +33,10 @@ #import wtf/FastMalloc.h #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) -#import dispatch/dispatch.h +#import WebCoreSystemInterface.h #import notify.h - -#ifndef DISPATCH_SOURCE_TYPE_VM -#define DISPATCH_SOURCE_TYPE_VM (_dispatch_source_type_vm) -DISPATCH_EXPORT const struct dispatch_source_type_s _dispatch_source_type_vm; - -enum { - DISPATCH_VM_PRESSURE = 0x8000, -}; #endif -#endif - namespace WebCore { #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) @@ -66,7 +56,7 @@ return; dispatch_async(dispatch_get_main_queue(), ^{ -_cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VM, 0, DISPATCH_VM_PRESSURE, dispatch_get_main_queue()); +_cache_event_source = wkCreateVMPressureDispatchOnMainQueue(); if (_cache_event_source) { dispatch_set_context(_cache_event_source, this); dispatch_source_set_event_handler(_cache_event_source, ^{ memoryPressureHandler().respondToMemoryPressure();}); Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (98279 => 98280) --- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2011-10-24 20:54:14 UTC (rev 98279) +++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h 2011-10-24 20:57:59 UTC (rev 98280) @@ -310,6 +310,13 @@ extern void (*wkCFURLRequestSetHTTPRequestBodyParts)(CFMutableURLRequestRef, CFArrayRef bodyParts); extern void (*wkSetRequestStorageSession)(CFURLStorageSessionRef, CFMutableURLRequestRef); #endif + +#if
[webkit-changes] [98495] trunk/Source
Title: [98495] trunk/Source Revision 98495 Author msab...@apple.com Date 2011-10-26 10:12:13 -0700 (Wed, 26 Oct 2011) Log Message Increase StringImpl Flag Bits for 8 bit Strings https://bugs.webkit.org/show_bug.cgi?id=70937 Increased the number of bits used for flags in StringImpl from 6 to 8 bits. This frees up 2 flag bits that will be used for 8-bit string support. Updated hash methods accordingly. Changed hash value masking from the low bits to the high bits. Reviewed by Darin Adler. Source/_javascript_Core: * create_hash_table: * wtf/StringHasher.h: (WTF::StringHasher::hash): * wtf/text/StringImpl.h: Source/WebCore: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHashValue): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/create_hash_table trunk/Source/_javascript_Core/wtf/StringHasher.h trunk/Source/_javascript_Core/wtf/text/StringImpl.h trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm Diff Modified: trunk/Source/_javascript_Core/ChangeLog (98494 => 98495) --- trunk/Source/_javascript_Core/ChangeLog 2011-10-26 17:06:03 UTC (rev 98494) +++ trunk/Source/_javascript_Core/ChangeLog 2011-10-26 17:12:13 UTC (rev 98495) @@ -1,3 +1,21 @@ +2011-10-26 Michael Saboff msab...@apple.com + +Increase StringImpl Flag Bits for 8 bit Strings +https://bugs.webkit.org/show_bug.cgi?id=70937 + +Increased the number of bits used for flags in StringImpl +from 6 to 8 bits. This frees up 2 flag bits that will be +used for 8-bit string support. Updated hash methods accordingly. +Changed hash value masking from the low bits to the high +bits. + +Reviewed by Darin Adler. + +* create_hash_table: +* wtf/StringHasher.h: +(WTF::StringHasher::hash): +* wtf/text/StringImpl.h: + 2011-10-26 Dan Bernstein m...@apple.com Build fix. Modified: trunk/Source/_javascript_Core/create_hash_table (98494 => 98495) --- trunk/Source/_javascript_Core/create_hash_table 2011-10-26 17:06:03 UTC (rev 98494) +++ trunk/Source/_javascript_Core/create_hash_table 2011-10-26 17:12:13 UTC (rev 98495) @@ -221,14 +221,14 @@ $hash = $hash% $EXP2_32; $hash ^= (leftShift($hash, 10)% $EXP2_32); - # Save 6 bits for StringImpl to use as flags. - $hash = ($hash 6); + # Save 8 bits for StringImpl to use as flags. + $hash = 0xff; # This avoids ever returning a hash code of 0, since that is used to # signal hash not computed yet. Setting the high bit maintains # reasonable fidelity to a hash code of 0 because it is likely to yield # exactly 0 when hash lookup masks out the high bits. - $hash = (0x8000 6) if ($hash == 0); + $hash = (0x8000 8) if ($hash == 0); return $hash; } Modified: trunk/Source/_javascript_Core/wtf/StringHasher.h (98494 => 98495) --- trunk/Source/_javascript_Core/wtf/StringHasher.h 2011-10-26 17:06:03 UTC (rev 98494) +++ trunk/Source/_javascript_Core/wtf/StringHasher.h 2011-10-26 17:12:13 UTC (rev 98495) @@ -36,7 +36,7 @@ // _javascript_Core and the CodeGeneratorJS.pm script in WebCore. class StringHasher { public: -static const unsigned flagCount = 6; // Save 6 bits for StringImpl to use as flags. +static const unsigned flagCount = 8; // Save 8 bits for StringImpl to use as flags. inline StringHasher() : m_hash(stringHashingStartValue) @@ -81,9 +81,9 @@ result += result 15; result ^= result 10; -// Reserving the high bits for flags preserves most of the hash's value, -// since hash lookup typically masks out the high bits anyway. -result = flagCount; +// Reserving space from the high bits for flags preserves most of the hash's +// value, since hash lookup typically masks out the high bits anyway. +result = (1u (sizeof(result) * 8 - flagCount)) - 1; // This avoids ever returning a hash code of 0, since that is used to // signal hash not computed yet. Setting the high bit maintains Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.h (98494 => 98495) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-10-26 17:06:03 UTC (rev 98494) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-10-26 17:12:13 UTC (rev 98495) @@ -381,8 +381,8 @@ static const unsigned s_refCountFlagIsStaticString = 0x1; static const unsigned s_refCountIncrement = 0x2; // This allows us to ref / deref without disturbing the static string flag. -// The bottom 6 bits in the hash are flags. -static const unsigned s_flagCount = 6; +// The bottom 8 bits in the hash are flags. +static const unsigned s_flagCount = 8; static const unsigned s_flagMask = (1u s_flagCount) - 1; COMPILE_ASSERT(s_flagCount == StringHasher::flagCount, StringHasher_reserves_enough_bits_for_StringImpl_flags); Modified: trunk/Source/WebCore/ChangeLog (98494 => 98495)
[webkit-changes] [98643] trunk/Source/JavaScriptCore
Title: [98643] trunk/Source/_javascript_Core Revision 98643 Author msab...@apple.com Date 2011-10-27 14:54:11 -0700 (Thu, 27 Oct 2011) Log Message 32bit build failure after r98624 https://bugs.webkit.org/show_bug.cgi?id=71064 Disambiguated operator overload with unsigned index (0u). Reviewed by Sam Weinig. * runtime/UString.h: (JSC::operator==): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/UString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (98642 => 98643) --- trunk/Source/_javascript_Core/ChangeLog 2011-10-27 21:48:34 UTC (rev 98642) +++ trunk/Source/_javascript_Core/ChangeLog 2011-10-27 21:54:11 UTC (rev 98643) @@ -1,3 +1,15 @@ +2011-10-27 Michael Saboff msab...@apple.com + +32bit build failure after r98624 +https://bugs.webkit.org/show_bug.cgi?id=71064 + +Disambiguated operator overload with unsigned index (0u). + +Reviewed by Sam Weinig. + +* runtime/UString.h: +(JSC::operator==): + 2011-10-27 Gustavo Noronha Silva g...@gnome.org Fix building on GNU/kFreeBSD Modified: trunk/Source/_javascript_Core/runtime/UString.h (98642 => 98643) --- trunk/Source/_javascript_Core/runtime/UString.h 2011-10-27 21:48:34 UTC (rev 98642) +++ trunk/Source/_javascript_Core/runtime/UString.h 2011-10-27 21:54:11 UTC (rev 98643) @@ -161,7 +161,7 @@ return true; if (size1 == 1) -return (*rep1)[0] == (*rep2)[0]; +return (*rep1)[0u] == (*rep2)[0u]; return equalSlowCase(s1, s2); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [98674] trunk/Source/JavaScriptCore
Title: [98674] trunk/Source/_javascript_Core Revision 98674 Author msab...@apple.com Date 2011-10-27 18:09:53 -0700 (Thu, 27 Oct 2011) Log Message ENH: Add 8 bit string support to JSC JIT https://bugs.webkit.org/show_bug.cgi?id=71073 Changed the JIT String character access generation to create code to check the character size and load8() or load16() as approriate. Reviewed by Gavin Barraclough. * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::load8): * assembler/X86Assembler.h: (JSC::X86Assembler::movzbl_mr): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): (JSC::DFG::SpeculativeJIT::compileGetByValOnString): * jit/JITInlineMethods.h: (JSC::JIT::emitLoadCharacterString): * jit/JITPropertyAccess.cpp: (JSC::JIT::stringGetByValStubGenerator): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::stringGetByValStubGenerator): * jit/JSInterfaceJIT.h: (JSC::ThunkHelpers::stringImplFlagsOffset): (JSC::ThunkHelpers::stringImpl8BitFlag): * jit/ThunkGenerators.cpp: (JSC::stringCharLoad): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/MacroAssemblerX86Common.h trunk/Source/_javascript_Core/assembler/X86Assembler.h trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp trunk/Source/_javascript_Core/jit/JITInlineMethods.h trunk/Source/_javascript_Core/jit/JITPropertyAccess.cpp trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp trunk/Source/_javascript_Core/jit/JSInterfaceJIT.h trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (98673 => 98674) --- trunk/Source/_javascript_Core/ChangeLog 2011-10-28 01:01:45 UTC (rev 98673) +++ trunk/Source/_javascript_Core/ChangeLog 2011-10-28 01:09:53 UTC (rev 98674) @@ -1,3 +1,32 @@ +2011-10-27 Michael Saboff msab...@apple.com + +ENH: Add 8 bit string support to JSC JIT +https://bugs.webkit.org/show_bug.cgi?id=71073 + +Changed the JIT String character access generation to create code +to check the character size and load8() or load16() as approriate. + +Reviewed by Gavin Barraclough. + +* assembler/MacroAssemblerX86Common.h: +(JSC::MacroAssemblerX86Common::load8): +* assembler/X86Assembler.h: +(JSC::X86Assembler::movzbl_mr): +* dfg/DFGSpeculativeJIT.cpp: +(JSC::DFG::SpeculativeJIT::compileGetCharCodeAt): +(JSC::DFG::SpeculativeJIT::compileGetByValOnString): +* jit/JITInlineMethods.h: +(JSC::JIT::emitLoadCharacterString): +* jit/JITPropertyAccess.cpp: +(JSC::JIT::stringGetByValStubGenerator): +* jit/JITPropertyAccess32_64.cpp: +(JSC::JIT::stringGetByValStubGenerator): +* jit/JSInterfaceJIT.h: +(JSC::ThunkHelpers::stringImplFlagsOffset): +(JSC::ThunkHelpers::stringImpl8BitFlag): +* jit/ThunkGenerators.cpp: +(JSC::stringCharLoad): + 2011-10-27 Filip Pizlo fpi...@apple.com If the bytecode generator emits code after the return in the first basic block, Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerX86Common.h (98673 => 98674) --- trunk/Source/_javascript_Core/assembler/MacroAssemblerX86Common.h 2011-10-28 01:01:45 UTC (rev 98673) +++ trunk/Source/_javascript_Core/assembler/MacroAssemblerX86Common.h 2011-10-28 01:09:53 UTC (rev 98674) @@ -481,6 +481,11 @@ m_assembler.movzbl_mr(address.offset, address.base, address.index, address.scale, dest); } +void load8(ImplicitAddress address, RegisterID dest) +{ +m_assembler.movzbl_mr(address.offset, address.base, dest); +} + void load16(BaseIndex address, RegisterID dest) { m_assembler.movzwl_mr(address.offset, address.base, address.index, address.scale, dest); Modified: trunk/Source/_javascript_Core/assembler/X86Assembler.h (98673 => 98674) --- trunk/Source/_javascript_Core/assembler/X86Assembler.h 2011-10-28 01:01:45 UTC (rev 98673) +++ trunk/Source/_javascript_Core/assembler/X86Assembler.h 2011-10-28 01:09:53 UTC (rev 98674) @@ -1231,6 +1231,11 @@ m_formatter.twoByteOp(OP2_MOVZX_GvEw, dst, base, index, scale, offset); } +void movzbl_mr(int offset, RegisterID base, RegisterID dst) +{ +m_formatter.twoByteOp(OP2_MOVZX_GvEb, dst, base, offset); +} + void movzbl_mr(int offset, RegisterID base, RegisterID index, int scale, RegisterID dst) { m_formatter.twoByteOp(OP2_MOVZX_GvEb, dst, base, index, scale, offset); Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (98673 => 98674) --- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2011-10-28 01:01:45 UTC (rev 98673) +++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp 2011-10-28 01:09:53 UTC (rev 98674) @@ -581,28 +581,38 @@ ASSERT(node.child3() == NoNode); SpeculateCellOperand string(this, node.child1()); SpeculateStrictInt32Operand index(this,
[webkit-changes] [98691] trunk/LayoutTests
Title: [98691] trunk/LayoutTests Revision 98691 Author msab...@apple.com Date 2011-10-27 22:22:35 -0700 (Thu, 27 Oct 2011) Log Message Test Failure in fast/dom/prototype-inheritance-2.html after r98495 https://bugs.webkit.org/show_bug.cgi?id=71058 Rebaselined these results due to hash order changes in r98495. Reviewed by Darin Adler. * fast/dom/prototype-inheritance-2-expected.txt: * platform/mac/fast/dom/prototype-inheritance-2-expected.txt: * platform/qt/fast/dom/prototype-inheritance-2-expected.txt: * platform/win/fast/dom/prototype-inheritance-2-expected.txt: Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt trunk/LayoutTests/platform/mac/fast/dom/prototype-inheritance-2-expected.txt trunk/LayoutTests/platform/qt/fast/dom/prototype-inheritance-2-expected.txt trunk/LayoutTests/platform/win/fast/dom/prototype-inheritance-2-expected.txt Diff Modified: trunk/LayoutTests/ChangeLog (98690 => 98691) --- trunk/LayoutTests/ChangeLog 2011-10-28 05:11:31 UTC (rev 98690) +++ trunk/LayoutTests/ChangeLog 2011-10-28 05:22:35 UTC (rev 98691) @@ -1,3 +1,17 @@ +2011-10-27 Michael Saboff msab...@apple.com + +Test Failure in fast/dom/prototype-inheritance-2.html after r98495 +https://bugs.webkit.org/show_bug.cgi?id=71058 + +Rebaselined these results due to hash order changes in r98495. + +Reviewed by Darin Adler. + +* fast/dom/prototype-inheritance-2-expected.txt: +* platform/mac/fast/dom/prototype-inheritance-2-expected.txt: +* platform/qt/fast/dom/prototype-inheritance-2-expected.txt: +* platform/win/fast/dom/prototype-inheritance-2-expected.txt: + 2011-10-27 Ryosuke Niwa rn...@webkit.org Remove erroneous expected results after r98685. Modified: trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt (98690 => 98691) --- trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt 2011-10-28 05:11:31 UTC (rev 98690) +++ trunk/LayoutTests/fast/dom/prototype-inheritance-2-expected.txt 2011-10-28 05:22:35 UTC (rev 98691) @@ -168,26 +168,26 @@ PASS MediaListPrototype from inner.document.forms.testForm.0.ownerDocument.styleSheets.0.media.__proto__ PASS MemoryInfo from inner.document.forms.testForm.0.ownerDocument.defaultView.console.memory PASS MemoryInfoPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.console.memory.__proto__ -PASS MimeType from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes.0 -PASS MimeTypeArray from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes -PASS MimeTypeArrayConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes.constructor -PASS MimeTypeArrayPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes.__proto__ -PASS MimeTypeConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes.0.constructor -PASS MimeTypePrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.mimeTypes.0.__proto__ +PASS MimeType from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.0 +PASS MimeTypeArray from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes +PASS MimeTypeArrayConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.constructor +PASS MimeTypeArrayPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.__proto__ +PASS MimeTypeConstructor from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.0.constructor +PASS MimeTypePrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.mimeTypes.0.__proto__ PASS NamedNodeMap from inner.document.forms.testForm.0.parentNode.attributes -PASS Navigator from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator -PASS NavigatorPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.__proto__ +PASS Navigator from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation +PASS NavigatorPrototype from inner.document.forms.testForm.0.ownerDocument.defaultView.clientInformation.__proto__ PASS NodeList from inner.document.forms.testForm PASS NodeListConstructor from inner.document.forms.testForm.constructor PASS NodeListPrototype from inner.document.forms.testForm.__proto__ -PASS NodePrototype from inner.document.forms.testForm.0.ownerDocument.__proto__.__proto__.__proto__ +PASS NodePrototype from inner.document.forms.testForm.0.attributes.0.__proto__.__proto__ PASS Object from inner.document.location.__proto__.__proto__ -PASS Plugin from inner.document.forms.testForm.0.ownerDocument.defaultView.navigator.plugins.5 -PASS PluginArray from
[webkit-changes] [87157] trunk/Source/JavaScriptCore
Title: [87157] trunk/Source/_javascript_Core Revision 87157 Author msab...@apple.com Date 2011-05-24 09:06:18 -0700 (Tue, 24 May 2011) Log Message 2011-05-23 Michael Saboff msab...@apple.com Reviewed by Mark Rowe. Safari often freezes when clicking Return free memory in Caches dialog https://bugs.webkit.org/show_bug.cgi?id=61325 There are two fixes and improvement in instrumentation code used to find one of the problems. Changed ReleaseFreeList() to set the decommitted bit when releasing pages to the system and moving Spans from the normal list to the returned list. Added a not making forward progress check to TCMalloc_PageHeap::scavenge to eliminate an infinite loop if we can't meet the pagesToRelease target. Added a check for the decommitted bit being set properly in TCMalloc_PageHeap::CheckList. * wtf/FastMalloc.cpp: (WTF::TCMalloc_PageHeap::scavenge): (WTF::TCMalloc_PageHeap::Check): (WTF::TCMalloc_PageHeap::CheckList): (WTF::ReleaseFreeList): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/FastMalloc.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (87156 => 87157) --- trunk/Source/_javascript_Core/ChangeLog 2011-05-24 15:49:28 UTC (rev 87156) +++ trunk/Source/_javascript_Core/ChangeLog 2011-05-24 16:06:18 UTC (rev 87157) @@ -1,3 +1,26 @@ +2011-05-23 Michael Saboff msab...@apple.com + +Reviewed by Mark Rowe. + +Safari often freezes when clicking Return free memory in Caches dialog +https://bugs.webkit.org/show_bug.cgi?id=61325 + +There are two fixes and improvement in instrumentation code used to find +one of the problems. +Changed ReleaseFreeList() to set the decommitted bit when releasing +pages to the system and moving Spans from the normal list to the returned +list. +Added a not making forward progress check to TCMalloc_PageHeap::scavenge +to eliminate an infinite loop if we can't meet the pagesToRelease target. +Added a check for the decommitted bit being set properly in +TCMalloc_PageHeap::CheckList. + +* wtf/FastMalloc.cpp: +(WTF::TCMalloc_PageHeap::scavenge): +(WTF::TCMalloc_PageHeap::Check): +(WTF::TCMalloc_PageHeap::CheckList): +(WTF::ReleaseFreeList): + 2011-05-23 Gavin Barraclough barraclo...@apple.com Reviewed by Geoff Garen. Modified: trunk/Source/_javascript_Core/wtf/FastMalloc.cpp (87156 => 87157) --- trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-05-24 15:49:28 UTC (rev 87156) +++ trunk/Source/_javascript_Core/wtf/FastMalloc.cpp 2011-05-24 16:06:18 UTC (rev 87157) @@ -1357,7 +1357,7 @@ } bool Check(); - bool CheckList(Span* list, Length min_pages, Length max_pages); + bool CheckList(Span* list, Length min_pages, Length max_pages, bool decommitted); // Release all pages on the free list for reuse by the OS: void ReleaseFreePages(); @@ -1637,7 +1637,9 @@ size_t pagesToRelease = min_free_committed_pages_since_last_scavenge_ * kScavengePercentage; size_t targetPageCount = std::maxsize_t(kMinimumFreeCommittedPageCount, free_committed_pages_ - pagesToRelease); +Length lastFreeCommittedPages = free_committed_pages_; while (free_committed_pages_ targetPageCount) { +ASSERT(Check()); for (int i = kMaxPages; i 0 free_committed_pages_ = targetPageCount; i--) { SpanList* slist = (static_castsize_t(i) == kMaxPages) ? large_ : free_[i]; // If the span size is bigger than kMinSpanListsWithSpans pages return all the spans in the list, else return all but 1 span. @@ -1658,6 +1660,10 @@ DLL_Prepend(slist-returned, s); } } + +if (lastFreeCommittedPages == free_committed_pages_) +break; +lastFreeCommittedPages = free_committed_pages_; } min_free_committed_pages_since_last_scavenge_ = free_committed_pages_; @@ -2113,27 +2119,28 @@ bool TCMalloc_PageHeap::Check() { ASSERT(free_[0].normal.next == free_[0].normal); ASSERT(free_[0].returned.next == free_[0].returned); - CheckList(large_.normal, kMaxPages, 10); - CheckList(large_.returned, kMaxPages, 10); + CheckList(large_.normal, kMaxPages, 10, false); + CheckList(large_.returned, kMaxPages, 10, true); for (Length s = 1; s kMaxPages; s++) { -CheckList(free_[s].normal, s, s); -CheckList(free_[s].returned, s, s); +CheckList(free_[s].normal, s, s, false); +CheckList(free_[s].returned, s, s, true); } return true; } #if ASSERT_DISABLED -bool TCMalloc_PageHeap::CheckList(Span*, Length, Length) { +bool TCMalloc_PageHeap::CheckList(Span*, Length, Length, bool) { return true; } #else -bool TCMalloc_PageHeap::CheckList(Span* list, Length min_pages, Length
[webkit-changes] [87330] trunk/Source/WebCore
Title: [87330] trunk/Source/WebCore Revision 87330 Author msab...@apple.com Date 2011-05-25 16:05:29 -0700 (Wed, 25 May 2011) Log Message 2011-05-25 Michael Saboff msab...@apple.com Reviewed by Sam Weinig. Cleanup of commented items from https://bugs.webkit.org/show_bug.cgi?id=61222 https://bugs.webkit.org/show_bug.cgi?id=61478 Cleanup of further comments after patch was landed. Changes include using /2 instead of 1, adding a blank line after class include, making method names start with lower case and adding clarifying comments. No new tests as the changes are stylistic and not functional. * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::pruneLiveResourcesToPercentage): (WebCore::MemoryCache::pruneDeadResourcesToPercentage): * loader/cache/MemoryCache.h: (WebCore::MemoryCache::pruneToPercentage): * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::respondToMemoryPressure): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/loader/cache/MemoryCache.cpp trunk/Source/WebCore/loader/cache/MemoryCache.h trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (87329 => 87330) --- trunk/Source/WebCore/ChangeLog 2011-05-25 23:00:45 UTC (rev 87329) +++ trunk/Source/WebCore/ChangeLog 2011-05-25 23:05:29 UTC (rev 87330) @@ -1,3 +1,25 @@ +2011-05-25 Michael Saboff msab...@apple.com + +Reviewed by Sam Weinig. + +Cleanup of commented items from https://bugs.webkit.org/show_bug.cgi?id=61222 +https://bugs.webkit.org/show_bug.cgi?id=61478 + +Cleanup of further comments after patch was landed. Changes include +using /2 instead of 1, adding a blank line after class include, +making method names start with lower case and adding clarifying +comments. + +No new tests as the changes are stylistic and not functional. + +* loader/cache/MemoryCache.cpp: +(WebCore::MemoryCache::pruneLiveResourcesToPercentage): +(WebCore::MemoryCache::pruneDeadResourcesToPercentage): +* loader/cache/MemoryCache.h: +(WebCore::MemoryCache::pruneToPercentage): +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore::MemoryPressureHandler::respondToMemoryPressure): + 2011-05-25 Stephanie Lewis sle...@apple.com Reviewed by Brady Eidson. Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (87329 => 87330) --- trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2011-05-25 23:00:45 UTC (rev 87329) +++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp 2011-05-25 23:05:29 UTC (rev 87330) @@ -176,7 +176,7 @@ pruneLiveResourcesToSize(targetSize); } -void MemoryCache::PruneLiveResourcesToPercentage(float prunePercentage) +void MemoryCache::pruneLiveResourcesToPercentage(float prunePercentage) { if (!m_pruneEnabled) return; @@ -239,7 +239,7 @@ pruneDeadResourcesToSize(targetSize); } -void MemoryCache::PruneDeadResourcesToPercentage(float prunePercentage) +void MemoryCache::pruneDeadResourcesToPercentage(float prunePercentage) { if (!m_pruneEnabled) return; Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (87329 => 87330) --- trunk/Source/WebCore/loader/cache/MemoryCache.h 2011-05-25 23:00:45 UTC (rev 87329) +++ trunk/Source/WebCore/loader/cache/MemoryCache.h 2011-05-25 23:05:29 UTC (rev 87330) @@ -141,8 +141,8 @@ void pruneToPercentage(float targetPercentLive) { -PruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was borrowing capacity from live. -PruneLiveResourcesToPercentage(targetPercentLive); +pruneDeadResourcesToPercentage(targetPercentLive); // Prune dead first, in case it was borrowing capacity from live. +pruneLiveResourcesToPercentage(targetPercentLive); } void setDeadDecodedDataDeletionInterval(double interval) { m_deadDecodedDataDeletionInterval = interval; } @@ -193,8 +193,8 @@ // pruneLive*() - Flush decoded data from resources still referenced by Web pages. void pruneDeadResources(); // Automatically decide how much to prune. void pruneLiveResources(); -void PruneDeadResourcesToPercentage(float prunePercentage); -void PruneLiveResourcesToPercentage(float prunePercentage); +void pruneDeadResourcesToPercentage(float prunePercentage); // Prune to % current size +void pruneLiveResourcesToPercentage(float prunePercentage); void pruneDeadResourcesToSize(unsigned targetSize); void pruneLiveResourcesToSize(unsigned targetSize); Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (87329 => 87330) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-05-25 23:00:45 UTC (rev 87329) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm
[webkit-changes] [87524] trunk/Source/WebCore
Title: [87524] trunk/Source/WebCore Revision 87524 Author msab...@apple.com Date 2011-05-27 10:52:05 -0700 (Fri, 27 May 2011) Log Message 2011-05-27 Michael Saboff msab...@apple.com Reviewed by David Hyatt. https://bugs.webkit.org/show_bug.cgi?id=61646 Duplicate Fonts Put in Font Cache on Mac Due to Duplicate CGFontRefs for Same Font Change the platformIsEqual to just compare the m_font members if either is not null. No tests added - functionality unchanged, fixing memory abandonment. * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::platformIsEqual): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm Diff Modified: trunk/Source/WebCore/ChangeLog (87523 => 87524) --- trunk/Source/WebCore/ChangeLog 2011-05-27 17:39:53 UTC (rev 87523) +++ trunk/Source/WebCore/ChangeLog 2011-05-27 17:52:05 UTC (rev 87524) @@ -1,3 +1,18 @@ +2011-05-27 Michael Saboff msab...@apple.com + +Reviewed by David Hyatt. + +https://bugs.webkit.org/show_bug.cgi?id=61646 +Duplicate Fonts Put in Font Cache on Mac Due to Duplicate CGFontRefs for Same Font + +Change the platformIsEqual to just compare the m_font members if +either is not null. + +No tests added - functionality unchanged, fixing memory abandonment. + +* platform/graphics/cocoa/FontPlatformDataCocoa.mm: +(WebCore::FontPlatformData::platformIsEqual): + 2011-05-25 Martin Robinson mrobin...@igalia.com Reviewed by Dirk Schulze. Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm (87523 => 87524) --- trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2011-05-27 17:39:53 UTC (rev 87523) +++ trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm 2011-05-27 17:52:05 UTC (rev 87524) @@ -106,8 +106,9 @@ bool FontPlatformData::platformIsEqual(const FontPlatformData other) const { -return m_font == other.m_font - m_cgFont == other.m_cgFont; +if (m_font || other.m_font) +return m_font == other.m_font; +return m_cgFont == other.m_cgFont; } void FontPlatformData::setFont(NSFont *font) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [88261] trunk/Source/WebCore
Title: [88261] trunk/Source/WebCore Revision 88261 Author msab...@apple.com Date 2011-06-07 13:49:01 -0700 (Tue, 07 Jun 2011) Log Message 2011-06-07 Michael Saboff msab...@apple.com Reviewed by Geoffrey Garen. Need to enable font cache purging in MemoryPressureHandler https://bugs.webkit.org/show_bug.cgi?id=62060 Improve memory usage under pressure. Added call to fontCache()-purgeInactiveFontData() in MemoryPressureHandler::respondToMemoryPressure(). Added protection to MemoryPressureHandler::install() being called multiple times. No new tests as funtionality wasn't changed. * platform/MemoryPressureHandler.cpp: (WebCore::MemoryPressureHandler::MemoryPressureHandler): * platform/MemoryPressureHandler.h: * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::install): (WebCore::MemoryPressureHandler::respondToMemoryPressure): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/MemoryPressureHandler.cpp trunk/Source/WebCore/platform/MemoryPressureHandler.h trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (88260 => 88261) --- trunk/Source/WebCore/ChangeLog 2011-06-07 20:46:28 UTC (rev 88260) +++ trunk/Source/WebCore/ChangeLog 2011-06-07 20:49:01 UTC (rev 88261) @@ -2,6 +2,27 @@ Reviewed by Geoffrey Garen. +Need to enable font cache purging in MemoryPressureHandler +https://bugs.webkit.org/show_bug.cgi?id=62060 + +Improve memory usage under pressure. +Added call to fontCache()-purgeInactiveFontData() in +MemoryPressureHandler::respondToMemoryPressure(). Added protection to +MemoryPressureHandler::install() being called multiple times. + +No new tests as funtionality wasn't changed. + +* platform/MemoryPressureHandler.cpp: +(WebCore::MemoryPressureHandler::MemoryPressureHandler): +* platform/MemoryPressureHandler.h: +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore::MemoryPressureHandler::install): +(WebCore::MemoryPressureHandler::respondToMemoryPressure): + +2011-06-07 Michael Saboff msab...@apple.com + +Reviewed by Geoffrey Garen. + Fonts returned by FontCache::getFontDataForCharacters() are never released https://bugs.webkit.org/show_bug.cgi?id=61875 Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (88260 => 88261) --- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp 2011-06-07 20:46:28 UTC (rev 88260) +++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp 2011-06-07 20:49:01 UTC (rev 88261) @@ -36,7 +36,10 @@ return staticMemoryPressureHandler; } -MemoryPressureHandler::MemoryPressureHandler() { } +MemoryPressureHandler::MemoryPressureHandler() +: m_installed(false) +{ +} #if !PLATFORM(MAC) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) void MemoryPressureHandler::install() { } Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.h (88260 => 88261) --- trunk/Source/WebCore/platform/MemoryPressureHandler.h 2011-06-07 20:46:28 UTC (rev 88260) +++ trunk/Source/WebCore/platform/MemoryPressureHandler.h 2011-06-07 20:49:01 UTC (rev 88261) @@ -41,6 +41,8 @@ ~MemoryPressureHandler(); void respondToMemoryPressure(); + +bool m_installed; }; // Function to obtain the global memory pressure object. Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (88260 => 88261) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-07 20:46:28 UTC (rev 88260) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-07 20:49:01 UTC (rev 88261) @@ -27,6 +27,7 @@ #import MemoryPressureHandler.h #import WebCore/GCController.h +#import WebCore/FontCache.h #import WebCore/MemoryCache.h #import WebCore/PageCache.h #import wtf/FastMalloc.h @@ -58,30 +59,31 @@ void MemoryPressureHandler::install() { -if (!_cache_event_source) { -dispatch_async(dispatch_get_main_queue(), ^{ -_cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VM, 0, DISPATCH_VM_PRESSURE, dispatch_get_main_queue()); -if (_cache_event_source) { -dispatch_set_context(_cache_event_source, this); -dispatch_source_set_event_handler(_cache_event_source, ^{ memoryPressureHandler().respondToMemoryPressure();}); -dispatch_resume(_cache_event_source); -} -}); -} +if (m_installed) +return; +dispatch_async(dispatch_get_main_queue(), ^{ +_cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_VM, 0, DISPATCH_VM_PRESSURE, dispatch_get_main_queue()); +if (_cache_event_source) { +dispatch_set_context(_cache_event_source, this); +
[webkit-changes] [88611] trunk/Source/WebCore
Title: [88611] trunk/Source/WebCore Revision 88611 Author msab...@apple.com Date 2011-06-11 23:01:25 -0700 (Sat, 11 Jun 2011) Log Message 2011-06-11 Michael Saboff msab...@apple.com Reviewed by James Robinson. REGRESSION(88260): 10-50% performance regression across many page cyclers https://bugs.webkit.org/show_bug.cgi?id=62349 Made CHROMIUM platform specific values for cMaxInactiveFontData and cTargetInactiveFontData to mitigate the current performance issue on Chromium page cycler tests. Made the chromium value for cMaxInactiveFontData 250 based on recommendation from James Robinson. Changed cTargetInactiveFontData to 200 so that 50 inactive fonts will be cleaned up at a time. Change made to address existing Chromium performance test regression. * platform/graphics/FontCache.cpp: Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/graphics/FontCache.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (88610 => 88611) --- trunk/Source/WebCore/ChangeLog 2011-06-12 04:19:39 UTC (rev 88610) +++ trunk/Source/WebCore/ChangeLog 2011-06-12 06:01:25 UTC (rev 88611) @@ -1,3 +1,20 @@ +2011-06-11 Michael Saboff msab...@apple.com + +Reviewed by James Robinson. + +REGRESSION(88260): 10-50% performance regression across many page cyclers +https://bugs.webkit.org/show_bug.cgi?id=62349 + +Made CHROMIUM platform specific values for cMaxInactiveFontData and +cTargetInactiveFontData to mitigate the current performance issue on Chromium +page cycler tests. Made the chromium value for cMaxInactiveFontData 250 based +on recommendation from James Robinson. Changed cTargetInactiveFontData to 200 +so that 50 inactive fonts will be cleaned up at a time. + +Change made to address existing Chromium performance test regression. + +* platform/graphics/FontCache.cpp: + 2011-06-11 Adam Barth aba...@webkit.org Reviewed by Darin Adler. Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (88610 => 88611) --- trunk/Source/WebCore/platform/graphics/FontCache.cpp 2011-06-12 04:19:39 UTC (rev 88610) +++ trunk/Source/WebCore/platform/graphics/FontCache.cpp 2011-06-12 06:01:25 UTC (rev 88611) @@ -251,8 +251,13 @@ static FontDataCache* gFontDataCache = 0; -const int cMaxInactiveFontData = 120; // Pretty Low Threshold -const int cTargetInactiveFontData = 100; +#if PLATFORM(CHROMIUM) +const int cMaxInactiveFontData = 250; +const int cTargetInactiveFontData = 200; +#else +const int cMaxInactiveFontData = 50; // Pretty Low Threshold +const int cTargetInactiveFontData = 30; +#endif static ListHashSetconst SimpleFontData** gInactiveFontData = 0; SimpleFontData* FontCache::getCachedFontData(const FontDescription fontDescription, const AtomicString family, bool checkingAlternateName, ShouldRetain shouldRetain) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [88691] trunk/Source/WebCore
Title: [88691] trunk/Source/WebCore Revision 88691 Author msab...@apple.com Date 2011-06-13 14:08:34 -0700 (Mon, 13 Jun 2011) Log Message 2011-06-13 Michael Saboff msab...@apple.com Reviewed by Oliver Hunt. Additional FontCache::FontCachePurgePreventer instances needed https://bugs.webkit.org/show_bug.cgi?id=62498 Added some needed and speculative FontCachePurgePreventer objects. Built and ran Safari with debug version of webkit that purges all purgeable fonts in FontCache::purgeInactiveFontDataIfNeeded in order to find system fallback fonts access via code paths that aren't protected with FontCachePurgePreventer objects. Also examined platform specific code that calls either Font::drawText() or Canvas::drawText(). For those methods that may be called from currently unprotected paths, added FontCachePurgePreventer objects. No new functionality so no new tests. * inspector/DOMNodeHighlighter.cpp: * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: (PlatformCALayerWinInternal::displayCallback): * platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp: (WebCore::CCHeadsUpDisplay::drawHudContents): * platform/mac/DragImageMac.mm: (WebCore::widthWithFont): (WebCore::drawAtPoint): * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateOptionsWidth): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp trunk/Source/WebCore/platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp trunk/Source/WebCore/platform/mac/DragImageMac.mm trunk/Source/WebCore/rendering/RenderMenuList.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (88690 => 88691) --- trunk/Source/WebCore/ChangeLog 2011-06-13 20:59:26 UTC (rev 88690) +++ trunk/Source/WebCore/ChangeLog 2011-06-13 21:08:34 UTC (rev 88691) @@ -1,3 +1,32 @@ +2011-06-13 Michael Saboff msab...@apple.com + +Reviewed by Oliver Hunt. + +Additional FontCache::FontCachePurgePreventer instances needed +https://bugs.webkit.org/show_bug.cgi?id=62498 + +Added some needed and speculative FontCachePurgePreventer objects. +Built and ran Safari with debug version of webkit that purges all +purgeable fonts in FontCache::purgeInactiveFontDataIfNeeded in order +to find system fallback fonts access via code paths that aren't +protected with FontCachePurgePreventer objects. Also examined +platform specific code that calls either Font::drawText() or +Canvas::drawText(). For those methods that may be called from currently +unprotected paths, added FontCachePurgePreventer objects. + +No new functionality so no new tests. + +* inspector/DOMNodeHighlighter.cpp: +* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp: +(PlatformCALayerWinInternal::displayCallback): +* platform/graphics/chromium/cc/CCHeadsUpDisplay.cpp: +(WebCore::CCHeadsUpDisplay::drawHudContents): +* platform/mac/DragImageMac.mm: +(WebCore::widthWithFont): +(WebCore::drawAtPoint): +* rendering/RenderMenuList.cpp: +(WebCore::RenderMenuList::updateOptionsWidth): + 2011-06-13 Ryosuke Niwa rn...@webkit.org Reviewed by Dan Bernstein. Modified: trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp (88690 => 88691) --- trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp 2011-06-13 20:59:26 UTC (rev 88690) +++ trunk/Source/WebCore/inspector/DOMNodeHighlighter.cpp 2011-06-13 21:08:34 UTC (rev 88691) @@ -32,6 +32,7 @@ #if ENABLE(INSPECTOR) #include Element.h +#include FontCache.h #include Frame.h #include FrameView.h #include GraphicsContext.h @@ -139,6 +140,7 @@ static const Color tooltipBackgroundColor(255, 255, 194, 255); static const Color tooltipBorderColor(Color::black); static const Color tooltipFontColor(Color::black); +FontCachePurgePreventer fontCachePurgePreventer; Element* element = static_castElement*(node); bool isXHTML = element-document()-isXHTMLDocument(); Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp (88690 => 88691) --- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp 2011-06-13 20:59:26 UTC (rev 88690) +++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWinInternal.cpp 2011-06-13 21:08:34 UTC (rev 88691) @@ -30,6 +30,7 @@ #include PlatformCALayerWinInternal.h #include Font.h +#include FontCache.h #include PlatformCALayer.h #include TextRun.h #include QuartzCore/CACFLayer.h @@ -93,6 +94,8 @@ #endif if (owner()-owner()-platformCALayerShowRepaintCounter()) { +FontCachePurgePreventer fontCachePurgePreventer; + String text =
[webkit-changes] [101147] trunk/Source/JavaScriptCore
Title: [101147] trunk/Source/_javascript_Core Revision 101147 Author msab...@apple.com Date 2011-11-24 22:23:00 -0800 (Thu, 24 Nov 2011) Log Message Tune JSStringBuilder for 8 bit Strings https://bugs.webkit.org/show_bug.cgi?id=72683 Changed JSStringBuilder to use 8 bit buffers until 16 bit data is added. When 16 bit data is to be added, the 8 bit buffer is converted to 16 bit and building continues with a 16 bit buffer. Reviewed by Filip Pizlo. * runtime/JSStringBuilder.h: (JSC::JSStringBuilder::JSStringBuilder): (JSC::JSStringBuilder::append): (JSC::JSStringBuilder::upConvert): (JSC::JSStringBuilder::build): * runtime/UString.h: (JSC::UString::adopt): * wtf/text/StringImpl.h: (WTF::StringImpl::adopt): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSStringBuilder.h trunk/Source/_javascript_Core/runtime/UString.h trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101146 => 101147) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-24 23:23:20 UTC (rev 101146) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:23:00 UTC (rev 101147) @@ -1,3 +1,24 @@ +2011-11-24 Michael Saboff msab...@apple.com + +Tune JSStringBuilder for 8 bit Strings +https://bugs.webkit.org/show_bug.cgi?id=72683 + +Changed JSStringBuilder to use 8 bit buffers until 16 bit data is added. +When 16 bit data is to be added, the 8 bit buffer is converted to 16 bit +and building continues with a 16 bit buffer. + +Reviewed by Filip Pizlo. + +* runtime/JSStringBuilder.h: +(JSC::JSStringBuilder::JSStringBuilder): +(JSC::JSStringBuilder::append): +(JSC::JSStringBuilder::upConvert): +(JSC::JSStringBuilder::build): +* runtime/UString.h: +(JSC::UString::adopt): +* wtf/text/StringImpl.h: +(WTF::StringImpl::adopt): + 2011-11-24 Zeno Albisser z...@webkit.org [Qt]WK2][Mac] Use Mac port's IPC implementation instead of Unix sockets Modified: trunk/Source/_javascript_Core/runtime/JSStringBuilder.h (101146 => 101147) --- trunk/Source/_javascript_Core/runtime/JSStringBuilder.h 2011-11-24 23:23:20 UTC (rev 101146) +++ trunk/Source/_javascript_Core/runtime/JSStringBuilder.h 2011-11-25 06:23:00 UTC (rev 101147) @@ -37,12 +37,21 @@ public: JSStringBuilder() : m_okay(true) +, m_is8Bit(true) { } void append(const UChar u) { -m_okay = buffer.tryAppend(u, 1); +if (m_is8Bit) { +if (u 0xff) { +LChar c = u; +m_okay = buffer8.tryAppend(c, 1); +return; +} +upConvert(); +} +m_okay = buffer16.tryAppend(u, 1); } void append(const char* str) @@ -52,36 +61,74 @@ void append(const char* str, size_t len) { -m_okay = buffer.tryReserveCapacity(buffer.size() + len); +if (m_is8Bit) { +m_okay = buffer8.tryAppend(reinterpret_castconst LChar*(str), len); +return; +} +m_okay = buffer8.tryReserveCapacity(buffer16.size() + len); for (size_t i = 0; i len; i++) { UChar u = static_castunsigned char(str[i]); -m_okay = buffer.tryAppend(u, 1); +m_okay = buffer16.tryAppend(u, 1); } } void append(const UChar* str, size_t len) { -m_okay = buffer.tryAppend(str, len); +if (m_is8Bit) +upConvert(); // FIXME: We could check character by character its size. +m_okay = buffer16.tryAppend(str, len); } void append(const UString str) { -m_okay = buffer.tryAppend(str.characters(), str.length()); +unsigned length = str.length(); + +if (!length) +return; + +if (m_is8Bit) { +if (str.is8Bit()) { +m_okay = buffer8.tryAppend(str.characters8(), length); +return; +} +upConvert(); +} +m_okay = buffer16.tryAppend(str.characters(), length); } +void upConvert() +{ +ASSERT(m_is8Bit); +size_t len = buffer8.size(); + +for (size_t i = 0; i len; i++) +buffer16.append(buffer8[i]); + +buffer8.clear(); +m_is8Bit = false; +} + JSValue build(ExecState* exec) { if (!m_okay) return throwOutOfMemoryError(exec); -buffer.shrinkToFit(); -if (!buffer.data()) +if (m_is8Bit) { +buffer8.shrinkToFit(); +if (!buffer8.data()) +return throwOutOfMemoryError(exec); +return jsString(exec, UString::adopt(buffer8)); +} +buffer16.shrinkToFit(); +if (!buffer16.data()) return throwOutOfMemoryError(exec); -return jsString(exec, UString::adopt(buffer)); +return
[webkit-changes] [101148] trunk/Source/JavaScriptCore
Title: [101148] trunk/Source/_javascript_Core Revision 101148 Author msab...@apple.com Date 2011-11-24 22:35:52 -0800 (Thu, 24 Nov 2011) Log Message Empty JSStrings are created as 16 bit https://bugs.webkit.org/show_bug.cgi?id=72968 Clear m_is8Bit flag for empty strings. Reviewed by Filip Pizlo. * runtime/JSString.h: (JSC::RopeBuilder::finishCreation): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101147 => 101148) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:23:00 UTC (rev 101147) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:35:52 UTC (rev 101148) @@ -1,5 +1,17 @@ 2011-11-24 Michael Saboff msab...@apple.com +Empty JSStrings are created as 16 bit +https://bugs.webkit.org/show_bug.cgi?id=72968 + +Clear m_is8Bit flag for empty strings. + +Reviewed by Filip Pizlo. + +* runtime/JSString.h: +(JSC::RopeBuilder::finishCreation): + +2011-11-24 Michael Saboff msab...@apple.com + Tune JSStringBuilder for 8 bit Strings https://bugs.webkit.org/show_bug.cgi?id=72683 Modified: trunk/Source/_javascript_Core/runtime/JSString.h (101147 => 101148) --- trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-25 06:23:00 UTC (rev 101147) +++ trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-25 06:35:52 UTC (rev 101148) @@ -120,6 +120,7 @@ { Base::finishCreation(globalData); m_length = 0; +m_is8Bit = true; } void finishCreation(JSGlobalData globalData, size_t length) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [101151] trunk/Source/JavaScriptCore
Title: [101151] trunk/Source/_javascript_Core Revision 101151 Author msab...@apple.com Date 2011-11-24 22:47:48 -0800 (Thu, 24 Nov 2011) Log Message _javascript_ string to number conversion functions use characters() https://bugs.webkit.org/show_bug.cgi?id=72974 Change the various JS to number routines to process strings using characters8() or characters16() as appropriate. Implemented using static template methods. Reviewed by Filip Pizlo. * runtime/JSGlobalObjectFunctions.cpp: (JSC::isInfinity): (JSC::jsHexIntegerLiteral): (JSC::jsStrDecimalLiteral): (JSC::toDouble): (JSC::jsToNumber): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101150 => 101151) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:44:19 UTC (rev 101150) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:47:48 UTC (rev 101151) @@ -1,5 +1,23 @@ 2011-11-24 Michael Saboff msab...@apple.com +_javascript_ string to number conversion functions use characters() +https://bugs.webkit.org/show_bug.cgi?id=72974 + +Change the various JS to number routines to process strings +using characters8() or characters16() as appropriate. +Implemented using static template methods. + +Reviewed by Filip Pizlo. + +* runtime/JSGlobalObjectFunctions.cpp: +(JSC::isInfinity): +(JSC::jsHexIntegerLiteral): +(JSC::jsStrDecimalLiteral): +(JSC::toDouble): +(JSC::jsToNumber): + +2011-11-24 Michael Saboff msab...@apple.com + Empty JSStrings are created as 16 bit https://bugs.webkit.org/show_bug.cgi?id=72968 Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (101150 => 101151) --- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-11-25 06:44:19 UTC (rev 101150) +++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-11-25 06:47:48 UTC (rev 101151) @@ -277,7 +277,8 @@ static const int SizeOfInfinity = 8; -static bool isInfinity(const UChar* data, const UChar* end) +template typename CharType +static bool isInfinity(const CharType* data, const CharType* end) { return (end - data) = SizeOfInfinity data[0] == 'I' @@ -291,11 +292,12 @@ } // See ecma-262 9.3.1 -static double jsHexIntegerLiteral(const UChar* data, const UChar* end) +template typename CharType +static double jsHexIntegerLiteral(const CharType* data, const CharType* end) { // Hex number. data += 2; -const UChar* firstDigitPosition = data; +const CharType* firstDigitPosition = data; double number = 0; while (true) { number = number * 16 + toASCIIHexValue(*data); @@ -312,15 +314,16 @@ } // See ecma-262 9.3.1 -static double jsStrDecimalLiteral(const UChar* data, const UChar* end) +template typename CharType +static double jsStrDecimalLiteral(const CharType* data, const CharType* end) { ASSERT(data end); // Copy the sting into a null-terminated byte buffer, and call strtod. Vectorchar, 32 byteBuffer; -for (const UChar* characters = data; characters end; ++characters) { -UChar character = *characters; -byteBuffer.append(isASCII(character) ? character : 0); +for (const CharType* characters = data; characters end; ++characters) { +CharType character = *characters; +byteBuffer.append(isASCII(character) ? static_castchar(character) : 0); } byteBuffer.append(0); char* endOfNumber; @@ -361,50 +364,57 @@ return std::numeric_limitsdouble::quiet_NaN(); } -// See ecma-262 9.3.1 -double jsToNumber(const UString s) +template typename CharType +static double toDouble(const CharType* characters, unsigned size) { -unsigned size = s.length(); +const CharType* endCharacters = characters + size; -if (size == 1) { -UChar c = s[0]; -if (isASCIIDigit(c)) -return c - '0'; -if (isStrWhiteSpace(c)) -return 0; -return std::numeric_limitsdouble::quiet_NaN(); -} - -const UChar* data = "" -const UChar* end = data + size; - // Skip leading white space. -for (; data end; ++data) { -if (!isStrWhiteSpace(*data)) +for (; characters endCharacters; ++characters) { +if (!isStrWhiteSpace(*characters)) break; } - + // Empty string. -if (data == end) +if (characters == endCharacters) return 0.0; - + double number; -if (data[0] == '0' data + 2 end (data[1] | 0x20) == 'x' isASCIIHexDigit(data[2])) -number = jsHexIntegerLiteral(data, end); +if (characters[0] == '0' characters + 2 endCharacters (characters[1] | 0x20) == 'x' isASCIIHexDigit(characters[2])) +number = jsHexIntegerLiteral(characters, endCharacters); else -number = jsStrDecimalLiteral(data,
[webkit-changes] [101152] trunk/Source/JavaScriptCore
Title: [101152] trunk/Source/_javascript_Core Revision 101152 Author msab...@apple.com Date 2011-11-24 22:55:34 -0800 (Thu, 24 Nov 2011) Log Message UString methods are not character size aware https://bugs.webkit.org/show_bug.cgi?id=72975 Changed the UString number constructors to build 8 bit strings. Modified the other methods to check string bitness and process with 8 bits wherre appropriate. * runtime/UString.cpp: (JSC::UString::number): (JSC::operator==): (JSC::operator): (JSC::UString::ascii): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/UString.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101151 => 101152) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:47:48 UTC (rev 101151) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-25 06:55:34 UTC (rev 101152) @@ -1,5 +1,20 @@ 2011-11-24 Michael Saboff msab...@apple.com +UString methods are not character size aware +https://bugs.webkit.org/show_bug.cgi?id=72975 + +Changed the UString number constructors to build 8 bit strings. +Modified the other methods to check string bitness and process +with 8 bits wherre appropriate. + +* runtime/UString.cpp: +(JSC::UString::number): +(JSC::operator==): +(JSC::operator): +(JSC::UString::ascii): + +2011-11-24 Michael Saboff msab...@apple.com + _javascript_ string to number conversion functions use characters() https://bugs.webkit.org/show_bug.cgi?id=72974 Modified: trunk/Source/_javascript_Core/runtime/UString.cpp (101151 => 101152) --- trunk/Source/_javascript_Core/runtime/UString.cpp 2011-11-25 06:47:48 UTC (rev 101151) +++ trunk/Source/_javascript_Core/runtime/UString.cpp 2011-11-25 06:55:34 UTC (rev 101152) @@ -96,9 +96,9 @@ UString UString::number(int i) { -UChar buf[1 + sizeof(i) * 3]; -UChar* end = buf + WTF_ARRAY_LENGTH(buf); -UChar* p = end; +LChar buf[1 + sizeof(i) * 3]; +LChar* end = buf + WTF_ARRAY_LENGTH(buf); +LChar* p = end; if (i == 0) *--p = '0'; @@ -125,9 +125,9 @@ UString UString::number(long long i) { -UChar buf[1 + sizeof(i) * 3]; -UChar* end = buf + WTF_ARRAY_LENGTH(buf); -UChar* p = end; +LChar buf[1 + sizeof(i) * 3]; +LChar* end = buf + WTF_ARRAY_LENGTH(buf); +LChar* p = end; if (i == 0) *--p = '0'; @@ -158,9 +158,9 @@ UString UString::number(unsigned u) { -UChar buf[sizeof(u) * 3]; -UChar* end = buf + WTF_ARRAY_LENGTH(buf); -UChar* p = end; +LChar buf[sizeof(u) * 3]; +LChar* end = buf + WTF_ARRAY_LENGTH(buf); +LChar* p = end; if (u == 0) *--p = '0'; @@ -176,9 +176,9 @@ UString UString::number(long l) { -UChar buf[1 + sizeof(l) * 3]; -UChar* end = buf + WTF_ARRAY_LENGTH(buf); -UChar* p = end; +LChar buf[1 + sizeof(l) * 3]; +LChar* end = buf + WTF_ARRAY_LENGTH(buf); +LChar* p = end; if (l == 0) *--p = '0'; @@ -224,19 +224,10 @@ bool operator==(const UString s1, const char *s2) { -if (s2 == 0) -return s1.isEmpty(); +if (s1.isEmpty()) +return !s2; -const UChar* u = s1.characters(); -const UChar* uend = u + s1.length(); -while (u != uend *s2) { -if (u[0] != (unsigned char)*s2) -return false; -s2++; -u++; -} - -return u == uend *s2 == 0; +return equal(s1.impl(), s2); } // This method assumes that all simple checks have been performed by @@ -315,15 +306,29 @@ const unsigned l1 = s1.length(); const unsigned l2 = s2.length(); const unsigned lmin = l1 l2 ? l1 : l2; +if (s1.is8Bit() s2.is8Bit()) { +const LChar* c1 = s1.characters8(); +const LChar* c2 = s2.characters8(); +unsigned length = 0; +while (length lmin *c1 == *c2) { +c1++; +c2++; +length++; +} +if (length lmin) +return (c1[0] c2[0]); + +return (l1 l2); +} const UChar* c1 = s1.characters(); const UChar* c2 = s2.characters(); -unsigned l = 0; -while (l lmin *c1 == *c2) { +unsigned length = 0; +while (length lmin *c1 == *c2) { c1++; c2++; -l++; +length++; } -if (l lmin) +if (length lmin) return (c1[0] c2[0]); return (l1 l2); @@ -354,8 +359,23 @@ // preserved, characters outside of this range are converted to '?'. unsigned length = this-length(); -const UChar* characters = this-characters(); +if (this-is8Bit()) { +const LChar* characters = this-characters8(); + +char* characterBuffer; +CString result = CString::newUninitialized(length, characterBuffer); + +for (unsigned i = 0; i length; ++i) { +LChar ch = characters[i]; +characterBuffer[i] = ch (ch
[webkit-changes] [101186] trunk/Source/JavaScriptCore
Title: [101186] trunk/Source/_javascript_Core Revision 101186 Author msab...@apple.com Date 2011-11-25 22:01:06 -0800 (Fri, 25 Nov 2011) Log Message Array.toString always uses StringImpl::characters() https://bugs.webkit.org/show_bug.cgi?id=72969 If all component strings are 8 bit, create an 8 bit result string for toString(). This appears to be performance neutral to sunspider and v8. Reviewed by Filip Pizlo. * runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncToString): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101185 => 101186) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-26 04:28:39 UTC (rev 101185) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-26 06:01:06 UTC (rev 101186) @@ -1,3 +1,17 @@ +2011-11-25 Michael Saboff msab...@apple.com + +Array.toString always uses StringImpl::characters() +https://bugs.webkit.org/show_bug.cgi?id=72969 + +If all component strings are 8 bit, create an 8 bit result string for toString(). + +This appears to be performance neutral to sunspider and v8. + +Reviewed by Filip Pizlo. + +* runtime/ArrayPrototype.cpp: +(JSC::arrayProtoFuncToString): + 2011-11-24 Michael Saboff msab...@apple.com UString methods are not character size aware Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (101185 => 101186) --- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2011-11-26 04:28:39 UTC (rev 101185) +++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2011-11-26 06:01:06 UTC (rev 101186) @@ -185,6 +185,7 @@ unsigned totalSize = length ? length - 1 : 0; VectorRefPtrStringImpl, 256 strBuffer(length); +bool allStrings8Bit = true; for (unsigned k = 0; k length; k++) { JSValue element; @@ -199,6 +200,7 @@ UString str = element.toString(exec); strBuffer[k] = str.impl(); totalSize += str.length(); +allStrings8Bit = allStrings8Bit str.is8Bit(); if (!strBuffer.data()) { throwOutOfMemoryError(exec); @@ -209,6 +211,23 @@ } if (!totalSize) return JSValue::encode(jsEmptyString(exec)); + +if (allStrings8Bit) { +VectorLChar buffer; +buffer.reserveCapacity(totalSize); +if (!buffer.data()) +return JSValue::encode(throwOutOfMemoryError(exec)); + +for (unsigned i = 0; i length; i++) { +if (i) +buffer.append(','); +if (RefPtrStringImpl rep = strBuffer[i]) +buffer.append(rep-characters8(), rep-length()); +} +ASSERT(buffer.size() == totalSize); +return JSValue::encode(jsString(exec, UString::adopt(buffer))); +} + VectorUChar buffer; buffer.reserveCapacity(totalSize); if (!buffer.data()) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [101187] trunk/Source/JavaScriptCore
Title: [101187] trunk/Source/_javascript_Core Revision 101187 Author msab...@apple.com Date 2011-11-25 22:15:20 -0800 (Fri, 25 Nov 2011) Log Message String.prototype.toLower should be optimized for 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=73154 Changed stringProtoFuncToLowerCase to use StringImpl::lower() which has been optimized for 8 bit strings. This is worth ~7% to sunspider string.tagcloud. Reviewed by Filip Pizlo. * runtime/StringPrototype.cpp: (JSC::stringProtoFuncToLowerCase): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/StringPrototype.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101186 => 101187) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-26 06:01:06 UTC (rev 101186) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-26 06:15:20 UTC (rev 101187) @@ -1,5 +1,20 @@ 2011-11-25 Michael Saboff msab...@apple.com +String.prototype.toLower should be optimized for 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=73154 + +Changed stringProtoFuncToLowerCase to use StringImpl::lower() which has +been optimized for 8 bit strings. + +This is worth ~7% to sunspider string.tagcloud. + +Reviewed by Filip Pizlo. + +* runtime/StringPrototype.cpp: +(JSC::stringProtoFuncToLowerCase): + +2011-11-25 Michael Saboff msab...@apple.com + Array.toString always uses StringImpl::characters() https://bugs.webkit.org/show_bug.cgi?id=72969 Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (101186 => 101187) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-26 06:01:06 UTC (rev 101186) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-26 06:15:20 UTC (rev 101187) @@ -1189,32 +1189,7 @@ if (!sSize) return JSValue::encode(sVal); -const UChar* sData = s.characters(); -VectorUChar buffer(sSize); - -UChar ored = 0; -for (int i = 0; i sSize; i++) { -UChar c = sData[i]; -ored |= c; -buffer[i] = toASCIILower(c); -} -if (!(ored ~0x7f)) -return JSValue::encode(jsString(exec, UString::adopt(buffer))); - -bool error; -int length = Unicode::toLower(buffer.data(), sSize, sData, sSize, error); -if (error) { -buffer.resize(length); -length = Unicode::toLower(buffer.data(), length, sData, sSize, error); -if (error) -return JSValue::encode(sVal); -} -if (length == sSize) { -if (memcmp(buffer.data(), sData, length * sizeof(UChar)) == 0) -return JSValue::encode(sVal); -} else -buffer.resize(length); -return JSValue::encode(jsString(exec, UString::adopt(buffer))); +return JSValue::encode(jsString(exec, UString(s.impl()-lower(; } EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [101277] trunk/Tools
Title: [101277] trunk/Tools Revision 101277 Author msab...@apple.com Date 2011-11-28 13:41:20 -0800 (Mon, 28 Nov 2011) Log Message Fixed help message for --exclude-kraken to say that it excludes Kraken and not SunSpider. Rubber-stamped by Filip Pizlo. * Scripts/bencher: Modified Paths trunk/Tools/ChangeLog trunk/Tools/Scripts/bencher Diff Modified: trunk/Tools/ChangeLog (101276 => 101277) --- trunk/Tools/ChangeLog 2011-11-28 21:33:12 UTC (rev 101276) +++ trunk/Tools/ChangeLog 2011-11-28 21:41:20 UTC (rev 101277) @@ -1,3 +1,12 @@ +2011-11-28 Michael Saboff msab...@apple.com + +Fixed help message for --exclude-kraken to say that +it excludes Kraken and not SunSpider. + +Rubber-stamped by Filip Pizlo. + +* Scripts/bencher: + 2011-11-28 Sheriff Bot webkit.review@gmail.com Unreviewed, rolling out r101273. Modified: trunk/Tools/Scripts/bencher (101276 => 101277) --- trunk/Tools/Scripts/bencher 2011-11-28 21:33:12 UTC (rev 101276) +++ trunk/Tools/Scripts/bencher 2011-11-28 21:41:20 UTC (rev 101277) @@ -277,7 +277,7 @@ puts --kraken-onlyOnly run Kraken. puts --exclude-v8 Exclude V8 (only run SunSpider and Kraken). puts --exclude-sunspider Exclude SunSpider (only run V8 and Kraken). - puts --exclude-kraken Exclude SunSpider (only run SunSpider and V8). + puts --exclude-kraken Exclude Kraken (only run SunSpider and V8). puts --benchmarks Only run benchmarks matching the given regular _expression_. puts --measure-gc Turn off manual calls to gc(), so that GC time is measured. puts Works best with large values of --inner. You can also say ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [101278] trunk/Source/JavaScriptCore
Title: [101278] trunk/Source/_javascript_Core Revision 101278 Author msab...@apple.com Date 2011-11-28 13:42:31 -0800 (Mon, 28 Nov 2011) Log Message Change set 101187 from bug 73154 removed already lower case optimization https://bugs.webkit.org/show_bug.cgi?id=73174 Added back the string is already lower case optimization. Reviewed by Geoffrey Garen. * runtime/StringPrototype.cpp: (JSC::stringProtoFuncToLowerCase): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/StringPrototype.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101277 => 101278) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-28 21:41:20 UTC (rev 101277) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-28 21:42:31 UTC (rev 101278) @@ -1,3 +1,15 @@ +2011-11-28 Michael Saboff msab...@apple.com + +Change set 101187 from bug 73154 removed already lower case optimization +https://bugs.webkit.org/show_bug.cgi?id=73174 + +Added back the string is already lower case optimization. + +Reviewed by Geoffrey Garen. + +* runtime/StringPrototype.cpp: +(JSC::stringProtoFuncToLowerCase): + 2011-11-28 Simon Hausmann simon.hausm...@nokia.com Unreviewed prospective build fix. Touch the file to trigger correct Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (101277 => 101278) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-28 21:41:20 UTC (rev 101277) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-28 21:42:31 UTC (rev 101278) @@ -1189,7 +1189,11 @@ if (!sSize) return JSValue::encode(sVal); -return JSValue::encode(jsString(exec, UString(s.impl()-lower(; +StringImpl* ourImpl = s.impl(); +RefPtrStringImpl lower = ourImpl-lower(); +if (ourImpl == lower.get()) +return JSValue::encode(sVal); +return JSValue::encode(jsString(exec, UString(lower.release(; } EncodedJSValue JSC_HOST_CALL stringProtoFuncToUpperCase(ExecState* exec) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [101747] trunk/Source/JavaScriptCore
Title: [101747] trunk/Source/_javascript_Core Revision 101747 Author msab...@apple.com Date 2011-12-01 23:04:29 -0800 (Thu, 01 Dec 2011) Log Message Changes proposed for 73457 slow down Kraken json-parse-financial https://bugs.webkit.org/show_bug.cgi?id=73584 Restructured StringImpl::equal to take advantage of 8 or 4 bytes at a time when possible. This is worth ~3% on Kraken json-parse-financial. It provides ~2% on SunSpider string-unpack-code. Reviewed by Sam Weinig. * wtf/text/StringImpl.cpp: (WTF::equal): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (101746 => 101747) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-02 07:01:52 UTC (rev 101746) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-02 07:04:29 UTC (rev 101747) @@ -1,3 +1,19 @@ +2011-12-01 Michael Saboff msab...@apple.com + +Changes proposed for 73457 slow down Kraken json-parse-financial +https://bugs.webkit.org/show_bug.cgi?id=73584 + +Restructured StringImpl::equal to take advantage of 8 or 4 bytes +at a time when possible. + +This is worth ~3% on Kraken json-parse-financial. It provides +~2% on SunSpider string-unpack-code. + +Reviewed by Sam Weinig. + +* wtf/text/StringImpl.cpp: +(WTF::equal): + 2011-12-01 Oliver Hunt oli...@apple.com Support integer typed arrays in the DFG JIT Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp (101746 => 101747) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2011-12-02 07:01:52 UTC (rev 101746) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2011-12-02 07:04:29 UTC (rev 101747) @@ -711,17 +711,133 @@ return charactersToFloat(characters16(), m_length, ok, didReadNumber); } -static bool equal(const UChar* a, const LChar* b, int length) +// Do comparisons 8 or 4 bytes-at-a-time on architectures where it's safe. +#if CPU(X86_64) +ALWAYS_INLINE static bool equal(const LChar* a, const LChar* b, unsigned length) { -ASSERT(length = 0); -while (length--) { -LChar bc = *b++; -if (*a++ != bc) +unsigned dwordLength = length 3; + +if (dwordLength) { +const uint64_t* aDWordCharacters = reinterpret_castconst uint64_t*(a); +const uint64_t* bDWordCharacters = reinterpret_castconst uint64_t*(b); + +for (unsigned i = 0; i != dwordLength; ++i) { +if (*aDWordCharacters++ != *bDWordCharacters++) +return false; +} + +a = reinterpret_castconst LChar*(aDWordCharacters); +b = reinterpret_castconst LChar*(bDWordCharacters); +} + +if (length 4) { +if (*reinterpret_castconst uint32_t*(a) != *reinterpret_castconst uint32_t*(b)) return false; + +a += 4; +b += 4; } + +if (length 2) { +if (*reinterpret_castconst uint16_t*(a) != *reinterpret_castconst uint16_t*(b)) +return false; + +a += 2; +b += 2; +} + +if (length 1 (*a != *b)) +return false; + return true; } +ALWAYS_INLINE static bool equal(const UChar* a, const UChar* b, unsigned length) +{ +unsigned dwordLength = length 2; + +if (dwordLength) { +const uint64_t* aDWordCharacters = reinterpret_castconst uint64_t*(a); +const uint64_t* bDWordCharacters = reinterpret_castconst uint64_t*(b); + +for (unsigned i = 0; i != dwordLength; ++i) { +if (*aDWordCharacters++ != *bDWordCharacters++) +return false; +} + +a = reinterpret_castconst UChar*(aDWordCharacters); +b = reinterpret_castconst UChar*(bDWordCharacters); +} + +if (length 2) { +if (*reinterpret_castconst uint32_t*(a) != *reinterpret_castconst uint32_t*(b)) +return false; + +a += 2; +b += 2; +} + +if (length 1 (*a != *b)) +return false; + +return true; +} +#elif CPU(X86) +ALWAYS_INLINE static bool equal(const LChar* a, const LChar* b, unsigned length) +{ +const uint32_t* aCharacters = reinterpret_castconst uint32_t*(a); +const uint32_t* bCharacters = reinterpret_castconst uint32_t*(b); + +unsigned wordLength = length 2; +for (unsigned i = 0; i != wordLength; ++i) { +if (*aCharacters++ != *bCharacters++) +return false; +} + +length = 3; + +if (length) { +const LChar* aRemainder = reinterpret_castconst LChar*(aCharacters); +const LChar* bRemainder = reinterpret_castconst LChar*(bCharacters); + +for (unsigned i = 0; i length; ++i) { +if (aRemainder[i] != bRemainder[i]) +return false; +} +} + +return true; +} + +ALWAYS_INLINE static bool equal(const UChar* a, const UChar* b, unsigned length) +{ +const uint32_t* aCharacters = reinterpret_castconst uint32_t*(a); +
[webkit-changes] [102017] trunk/Source/JavaScriptCore
Title: [102017] trunk/Source/_javascript_Core Revision 102017 Author msab...@apple.com Date 2011-12-05 11:08:44 -0800 (Mon, 05 Dec 2011) Log Message 8 bit string work slows down Kraken json-stringify-tinderbox https://bugs.webkit.org/show_bug.cgi?id=73457 Added 8 bit path to StringBuilder. StringBuilder starts assuming 8 bit contents and gets converted to 16 bit upon seeing the first 16 bit character or string. Split appendUninitialiezed into an inlined fast and function call slow case. Factored out the processing of the UString argument from Stringifier::appendQuotedString() to a static templated function based on character size. This change eliminates 5% of the 7% slowdown to json-stringify-tinderbox. This change introduces a 4.8% slowdown to json-parse-financial. This slowdown will be addressed in a subsequent patch to StringImpl::equal. Reviewed by Oliver Hunt. * runtime/JSONObject.cpp: (JSC::appendStringToUStringBuilder): (JSC::Stringifier::appendQuotedString): * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::resize): (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::allocateBufferUpConvert): (WTF::LChar): (WTF::UChar): (WTF::StringBuilder::reserveCapacity): (WTF::StringBuilder::appendUninitialized): (WTF::StringBuilder::appendUninitializedSlow): (WTF::StringBuilder::append): (WTF::StringBuilder::shrinkToFit): * wtf/text/StringBuilder.h: (WTF::StringBuilder::StringBuilder): (WTF::StringBuilder::append): (WTF::StringBuilder::operator[]): (WTF::StringBuilder::characters8): (WTF::StringBuilder::characters16): (WTF::StringBuilder::charactersBlah): (WTF::LChar): (WTF::UChar): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSONObject.cpp trunk/Source/_javascript_Core/wtf/text/StringBuilder.cpp trunk/Source/_javascript_Core/wtf/text/StringBuilder.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102016 => 102017) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-05 18:46:55 UTC (rev 102016) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-05 19:08:44 UTC (rev 102017) @@ -1,3 +1,48 @@ +2011-12-05 Michael Saboff msab...@apple.com + +8 bit string work slows down Kraken json-stringify-tinderbox +https://bugs.webkit.org/show_bug.cgi?id=73457 + +Added 8 bit path to StringBuilder. StringBuilder starts +assuming 8 bit contents and gets converted to 16 bit upon +seeing the first 16 bit character or string. Split +appendUninitialiezed into an inlined fast and function call +slow case. + +Factored out the processing of the UString argument from +Stringifier::appendQuotedString() to a static templated function +based on character size. + +This change eliminates 5% of the 7% slowdown to json-stringify-tinderbox. +This change introduces a 4.8% slowdown to json-parse-financial. +This slowdown will be addressed in a subsequent patch to StringImpl::equal. + +Reviewed by Oliver Hunt. + +* runtime/JSONObject.cpp: +(JSC::appendStringToUStringBuilder): +(JSC::Stringifier::appendQuotedString): +* wtf/text/StringBuilder.cpp: +(WTF::StringBuilder::resize): +(WTF::StringBuilder::allocateBuffer): +(WTF::StringBuilder::allocateBufferUpConvert): +(WTF::LChar): +(WTF::UChar): +(WTF::StringBuilder::reserveCapacity): +(WTF::StringBuilder::appendUninitialized): +(WTF::StringBuilder::appendUninitializedSlow): +(WTF::StringBuilder::append): +(WTF::StringBuilder::shrinkToFit): +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::StringBuilder): +(WTF::StringBuilder::append): +(WTF::StringBuilder::operator[]): +(WTF::StringBuilder::characters8): +(WTF::StringBuilder::characters16): +(WTF::StringBuilder::charactersBlah): +(WTF::LChar): +(WTF::UChar): + 2011-12-01 Gavin Barraclough barraclo...@apple.com https://bugs.webkit.org/show_bug.cgi?id=73624 Modified: trunk/Source/_javascript_Core/runtime/JSONObject.cpp (102016 => 102017) --- trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2011-12-05 18:46:55 UTC (rev 102016) +++ trunk/Source/_javascript_Core/runtime/JSONObject.cpp 2011-12-05 19:08:44 UTC (rev 102017) @@ -266,13 +266,9 @@ return LocalUnknown(m_exec-globalData(), jsString(m_exec, result.toUString())); } -void Stringifier::appendQuotedString(UStringBuilder builder, const UString value) +template typename CharType +static void appendStringToUStringBuilder(UStringBuilder builder, const CharType* data, int length) { -int length = value.length(); - -builder.append(''); - -const UChar* data = "" for (int i = 0; i length; ++i) { int start = i; while (i length (data[i] 0x1F data[i] != '' data[i] != '\\')) @@ -281,44 +277,56 @@ if (i = length) break; switch
[webkit-changes] [102082] trunk/Source/JavaScriptCore
Title: [102082] trunk/Source/_javascript_Core Revision 102082 Author msab...@apple.com Date 2011-12-05 18:06:48 -0800 (Mon, 05 Dec 2011) Log Message Create StringImpl::empty() as an 8 bit string https://bugs.webkit.org/show_bug.cgi?id=73871 Reviewed by Oliver Hunt. * wtf/text/StringStatics.cpp: (WTF::StringImpl::empty): Changed to be an 8 bit string. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/StringStatics.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102081 => 102082) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-06 02:04:16 UTC (rev 102081) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-06 02:06:48 UTC (rev 102082) @@ -1,3 +1,13 @@ +2011-12-05 Michael Saboff msab...@apple.com + +Create StringImpl::empty() as an 8 bit string +https://bugs.webkit.org/show_bug.cgi?id=73871 + +Reviewed by Oliver Hunt. + +* wtf/text/StringStatics.cpp: +(WTF::StringImpl::empty): Changed to be an 8 bit string. + 2011-12-05 Darin Adler da...@apple.com Convert JSClassRef to use HashMapOwnPtr Modified: trunk/Source/_javascript_Core/wtf/text/StringStatics.cpp (102081 => 102082) --- trunk/Source/_javascript_Core/wtf/text/StringStatics.cpp 2011-12-06 02:04:16 UTC (rev 102081) +++ trunk/Source/_javascript_Core/wtf/text/StringStatics.cpp 2011-12-06 02:06:48 UTC (rev 102082) @@ -46,8 +46,8 @@ // into the zero-page. // Replace this with 'reinterpret_castUChar*(static_castintptr_t(1))' once // PCRE goes away. -static UChar emptyUCharData = 0; -DEFINE_STATIC_LOCAL(StringImpl, emptyString, (emptyUCharData, 0, ConstructStaticString)); +static LChar emptyLCharData = 0; +DEFINE_STATIC_LOCAL(StringImpl, emptyString, (emptyLCharData, 0, ConstructStaticString)); WTF_ANNOTATE_BENIGN_RACE(emptyString, Benign race on StringImpl::emptyString reference counter); return emptyString; } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [102146] trunk/Source/JavaScriptCore
Title: [102146] trunk/Source/_javascript_Core Revision 102146 Author msab...@apple.com Date 2011-12-06 09:21:11 -0800 (Tue, 06 Dec 2011) Log Message Add 8 bit paths to global object functions https://bugs.webkit.org/show_bug.cgi?id=73875 Added 8 bit paths for converions methods. This is worth 1.5% on kraken audio-oscillator, 1.6% on stanford-crypto-ccm and 2.5% on stanford-crypto-sha256-iterative. See bug for a full report. Reviewed by Oliver Hunt. * runtime/JSGlobalObjectFunctions.cpp: (JSC::decode): Split into a templated helper. (JSC::parseInt): Split into a templated helper. (JSC::parseFloat): Added an 8 bit path (JSC::globalFuncEscape): Added 8 bit path (JSC::globalFuncUnescape): Added 8 bit path * runtime/JSStringBuilder.h: (JSC::JSStringBuilder::append): New append for LChar * wtf/text/StringBuilder.h: (WTF::StringBuilder::append): New append for LChar Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp trunk/Source/_javascript_Core/runtime/JSStringBuilder.h trunk/Source/_javascript_Core/wtf/text/StringBuilder.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102145 => 102146) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-06 17:20:15 UTC (rev 102145) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-06 17:21:11 UTC (rev 102146) @@ -1,3 +1,28 @@ +2011-12-06 Michael Saboff msab...@apple.com + +Add 8 bit paths to global object functions +https://bugs.webkit.org/show_bug.cgi?id=73875 + +Added 8 bit paths for converions methods. + +This is worth 1.5% on kraken audio-oscillator, +1.6% on stanford-crypto-ccm and 2.5% on +stanford-crypto-sha256-iterative. See bug for +a full report. + +Reviewed by Oliver Hunt. + +* runtime/JSGlobalObjectFunctions.cpp: +(JSC::decode): Split into a templated helper. +(JSC::parseInt): Split into a templated helper. +(JSC::parseFloat): Added an 8 bit path +(JSC::globalFuncEscape): Added 8 bit path +(JSC::globalFuncUnescape): Added 8 bit path +* runtime/JSStringBuilder.h: +(JSC::JSStringBuilder::append): New append for LChar +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::append): New append for LChar + 2011-11-21 Balazs Kelemen kbal...@webkit.org Enable ParallelJobs by default Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (102145 => 102146) --- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-12-06 17:20:15 UTC (rev 102145) +++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-12-06 17:21:11 UTC (rev 102146) @@ -71,30 +71,29 @@ return builder.build(exec); } -static JSValue decode(ExecState* exec, const char* doNotUnescape, bool strict) +template typename CharType +ALWAYS_INLINE +static JSValue decode(ExecState* exec, const CharType* characters, int length, const char* doNotUnescape, bool strict) { JSStringBuilder builder; -UString str = exec-argument(0).toString(exec); int k = 0; -int len = str.length(); -const UChar* d = str.characters(); UChar u = 0; -while (k len) { -const UChar* p = d + k; -UChar c = *p; +while (k length) { +const CharType* p = characters + k; +CharType c = *p; if (c == '%') { int charLen = 0; -if (k = len - 3 isASCIIHexDigit(p[1]) isASCIIHexDigit(p[2])) { -const char b0 = LexerUChar::convertHex(p[1], p[2]); +if (k = length - 3 isASCIIHexDigit(p[1]) isASCIIHexDigit(p[2])) { +const char b0 = LexerCharType::convertHex(p[1], p[2]); const int sequenceLen = UTF8SequenceLength(b0); -if (sequenceLen != 0 k = len - sequenceLen * 3) { +if (sequenceLen k = length - sequenceLen * 3) { charLen = sequenceLen * 3; char sequence[5]; sequence[0] = b0; for (int i = 1; i sequenceLen; ++i) { -const UChar* q = p + i * 3; +const CharType* q = p + i * 3; if (q[0] == '%' isASCIIHexDigit(q[1]) isASCIIHexDigit(q[2])) -sequence[i] = LexerUChar::convertHex(q[1], q[2]); +sequence[i] = LexerCharType::convertHex(q[1], q[2]); else { charLen = 0; break; @@ -119,7 +118,7 @@ return throwError(exec, createURIError(exec, URI error)); // The only case where we don't use strict mode is the unescape function. // For that, it's good to support the wonky %u syntax for compatibility with WinIE. -if (k = len - 6 p[1] == 'u' +if (k = length - 6 p[1] == 'u'
[webkit-changes] [102182] trunk/Source/JavaScriptCore
Title: [102182] trunk/Source/_javascript_Core Revision 102182 Author msab...@apple.com Date 2011-12-06 14:41:56 -0800 (Tue, 06 Dec 2011) Log Message r102146 from 73875 broke fast/js/encode-URI-test.html https://bugs.webkit.org/show_bug.cgi?id=73950 Reviewed by Gavin Barraclough. * runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncUnescape): Restructured to handle the %u case to output the resulting character and continue so that a failure in finding 4 hex digits will fall through and output the '%'. Due to style check, changed the temporary character variable to a more descriptive name. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102181 => 102182) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-06 22:37:12 UTC (rev 102181) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-06 22:41:56 UTC (rev 102182) @@ -1,3 +1,18 @@ +2011-12-06 Michael Saboff msab...@apple.com + +r102146 from 73875 broke fast/js/encode-URI-test.html +https://bugs.webkit.org/show_bug.cgi?id=73950 + +Reviewed by Gavin Barraclough. + +* runtime/JSGlobalObjectFunctions.cpp: +(JSC::globalFuncUnescape): Restructured to handle +the %u case to output the resulting character +and continue so that a failure in finding 4 hex +digits will fall through and output the '%'. +Due to style check, changed the temporary +character variable to a more descriptive name. + 2011-12-06 Filip Pizlo fpi...@apple.com GC zapping logic could benefit from some more assertions Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp (102181 => 102182) --- trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-12-06 22:37:12 UTC (rev 102181) +++ trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp 2011-12-06 22:41:56 UTC (rev 102182) @@ -646,19 +646,21 @@ if (str.is8Bit()) { const LChar* characters = str.characters8(); - +LChar convertedLChar; while (k len) { const LChar* c = characters + k; if (c[0] == '%' k = len - 6 c[1] == 'u') { if (isASCIIHexDigit(c[2]) isASCIIHexDigit(c[3]) isASCIIHexDigit(c[4]) isASCIIHexDigit(c[5])) { builder.append(LexerUChar::convertUnicode(c[2], c[3], c[4], c[5])); -k += 5; +k += 6; +continue; } } else if (c[0] == '%' k = len - 3 isASCIIHexDigit(c[1]) isASCIIHexDigit(c[2])) { -builder.append(LexerLChar::convertHex(c[1], c[2])); +convertedLChar = LChar(LexerLChar::convertHex(c[1], c[2])); +c = convertedLChar; k += 2; -} else -builder.append(*c); +} +builder.append(*c); k++; } } else { @@ -666,16 +668,16 @@ while (k len) { const UChar* c = characters + k; -UChar u; +UChar convertedUChar; if (c[0] == '%' k = len - 6 c[1] == 'u') { if (isASCIIHexDigit(c[2]) isASCIIHexDigit(c[3]) isASCIIHexDigit(c[4]) isASCIIHexDigit(c[5])) { -u = LexerUChar::convertUnicode(c[2], c[3], c[4], c[5]); -c = u; +convertedUChar = LexerUChar::convertUnicode(c[2], c[3], c[4], c[5]); +c = convertedUChar; k += 5; } } else if (c[0] == '%' k = len - 3 isASCIIHexDigit(c[1]) isASCIIHexDigit(c[2])) { -u = UChar(LexerUChar::convertHex(c[1], c[2])); -c = u; +convertedUChar = UChar(LexerUChar::convertHex(c[1], c[2])); +c = convertedUChar; k += 2; } k++; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [102298] trunk
Title: [102298] trunk Revision 102298 Author msab...@apple.com Date 2011-12-07 18:19:59 -0800 (Wed, 07 Dec 2011) Log Message StringBuilderTest.Append and StringBuilderTest.ToStringPreserveCapacity are failing. https://bugs.webkit.org/show_bug.cgi?id=73995 Source/_javascript_Core: Reviewed by Geoffrey Garen. Problem was that a call to characters on an StringImpl associated with a StringBuilder that is being appended to gets stale. Added a new m_valid16BitShadowlen that keeps the length of the 16 bit shadow that has been upconverted or will be up converted with the first getCharacters(). When StringBuilder::characters or ::reifyString is called, further characters are upconverted if we have a shadow16bit copy and the m_valid16BitShadowlen is updated. * _javascript_Core.exp: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString): * wtf/text/StringBuilder.h: (WTF::StringBuilder::StringBuilder): (WTF::StringBuilder::characters): (WTF::StringBuilder::clear): Cleaned up as part of the change. * wtf/text/StringImpl.cpp: (WTF::StringImpl::getData16SlowCase): (WTF::StringImpl::upconvertCharacters): * wtf/text/StringImpl.h: Tools: Reenabled failing tests that the code part of the patch fixes. Reviewed by Geoffrey Garen. * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: (TestWebKitAPI::TEST): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.exp trunk/Source/_javascript_Core/wtf/text/StringBuilder.cpp trunk/Source/_javascript_Core/wtf/text/StringBuilder.h trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.h trunk/Tools/ChangeLog trunk/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102297 => 102298) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-08 02:11:09 UTC (rev 102297) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-08 02:19:59 UTC (rev 102298) @@ -1,3 +1,30 @@ +2011-12-07 Michael Saboff msab...@apple.com + +StringBuilderTest.Append and StringBuilderTest.ToStringPreserveCapacity are failing. +https://bugs.webkit.org/show_bug.cgi?id=73995 + +Reviewed by Geoffrey Garen. + +Problem was that a call to characters on an StringImpl associated +with a StringBuilder that is being appended to gets stale. +Added a new m_valid16BitShadowlen that keeps the length of +the 16 bit shadow that has been upconverted or will be up converted +with the first getCharacters(). When StringBuilder::characters or +::reifyString is called, further characters are upconverted if +we have a shadow16bit copy and the m_valid16BitShadowlen is updated. + +* _javascript_Core.exp: +* wtf/text/StringBuilder.cpp: +(WTF::StringBuilder::reifyString): +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::StringBuilder): +(WTF::StringBuilder::characters): +(WTF::StringBuilder::clear): Cleaned up as part of the change. +* wtf/text/StringImpl.cpp: +(WTF::StringImpl::getData16SlowCase): +(WTF::StringImpl::upconvertCharacters): +* wtf/text/StringImpl.h: + 2011-12-07 Filip Pizlo fpi...@apple.com Compare and Swap should be enabled on ARMv7 Modified: trunk/Source/_javascript_Core/_javascript_Core.exp (102297 => 102298) --- trunk/Source/_javascript_Core/_javascript_Core.exp 2011-12-08 02:11:09 UTC (rev 102297) +++ trunk/Source/_javascript_Core/_javascript_Core.exp 2011-12-08 02:19:59 UTC (rev 102298) @@ -583,6 +583,7 @@ __ZNK3JSC9HashTable11createTableEPNS_12JSGlobalDataE __ZNK3JSC9HashTable11deleteTableEv __ZNK3WTF10StringImpl17getData16SlowCaseEv +__ZNK3WTF10StringImpl19upconvertCharactersEjj __ZNK3WTF12AtomicString5lowerEv __ZNK3WTF13DecimalNumber15toStringDecimalEPtj __ZNK3WTF13DecimalNumber19toStringExponentialEPtj Modified: trunk/Source/_javascript_Core/wtf/text/StringBuilder.cpp (102297 => 102298) --- trunk/Source/_javascript_Core/wtf/text/StringBuilder.cpp 2011-12-08 02:11:09 UTC (rev 102297) +++ trunk/Source/_javascript_Core/wtf/text/StringBuilder.cpp 2011-12-08 02:19:59 UTC (rev 102298) @@ -51,6 +51,11 @@ m_string = (m_length == m_buffer-length()) ? m_buffer.get() : StringImpl::create(m_buffer, 0, m_length); + +if (m_buffer-has16BitShadow() m_valid16BitShadowLength m_length) +m_buffer-upconvertCharacters(m_valid16BitShadowLength, m_length); + +m_valid16BitShadowLength = m_length; } void StringBuilder::resize(unsigned newSize) Modified: trunk/Source/_javascript_Core/wtf/text/StringBuilder.h (102297 => 102298) --- trunk/Source/_javascript_Core/wtf/text/StringBuilder.h 2011-12-08 02:11:09 UTC (rev 102297) +++ trunk/Source/_javascript_Core/wtf/text/StringBuilder.h 2011-12-08 02:19:59 UTC (rev 102298) @@ -36,6 +36,7 @@ StringBuilder() : m_length(0) , m_is8Bit(true) +,
[webkit-changes] [102380] trunk/Source/JavaScriptCore
Title: [102380] trunk/Source/_javascript_Core Revision 102380 Author msab...@apple.com Date 2011-12-08 13:47:42 -0800 (Thu, 08 Dec 2011) Log Message Add 8 bit paths for StringTypeAdapter classes https://bugs.webkit.org/show_bug.cgi?id=73882 Reviewed by Darin Adler. Added is8Bit() method and writeTo(LChar*) methods to StringTypeAdapter classes. The writeTo(LChar*) method can be used if is8Bit() returns true. The non-native 8 bit classes contain ASSERT(is8Bit()) in their writeTo(LChar*). Updated all of the various versions of tryMakeString() to use 8 bit processing in the updated StringTypeAdapter classes. This has slight if any performance improvement on kraken. * runtime/UStringConcatenate.h: * wtf/text/StringConcatenate.h: (WTF::tryMakeString): * wtf/text/StringOperators.h: (WTF::StringAppend::is8Bit): (WTF::StringAppend::writeTo): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/UStringConcatenate.h trunk/Source/_javascript_Core/wtf/text/StringConcatenate.h trunk/Source/_javascript_Core/wtf/text/StringOperators.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102379 => 102380) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-08 21:29:31 UTC (rev 102379) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-08 21:47:42 UTC (rev 102380) @@ -1,3 +1,29 @@ +2011-12-08 Michael Saboff msab...@apple.com + +Add 8 bit paths for StringTypeAdapter classes +https://bugs.webkit.org/show_bug.cgi?id=73882 + +Reviewed by Darin Adler. + +Added is8Bit() method and writeTo(LChar*) methods +to StringTypeAdapter classes. The writeTo(LChar*) +method can be used if is8Bit() returns true. The +non-native 8 bit classes contain ASSERT(is8Bit()) +in their writeTo(LChar*). + +Updated all of the various versions of tryMakeString() to +use 8 bit processing in the updated StringTypeAdapter +classes. + +This has slight if any performance improvement on kraken. + +* runtime/UStringConcatenate.h: +* wtf/text/StringConcatenate.h: +(WTF::tryMakeString): +* wtf/text/StringOperators.h: +(WTF::StringAppend::is8Bit): +(WTF::StringAppend::writeTo): + 2011-12-07 Filip Pizlo fpi...@apple.com DFG CSE should know that CheckFunction is pure Modified: trunk/Source/_javascript_Core/runtime/UStringConcatenate.h (102379 => 102380) --- trunk/Source/_javascript_Core/runtime/UStringConcatenate.h 2011-12-08 21:29:31 UTC (rev 102379) +++ trunk/Source/_javascript_Core/runtime/UStringConcatenate.h 2011-12-08 21:47:42 UTC (rev 102380) @@ -35,21 +35,37 @@ class StringTypeAdapterJSC::UString { public: StringTypeAdapterJSC::UString(JSC::UString string) -: m_data(string.characters()) +: m_string(string) , m_length(string.length()) { } unsigned length() { return m_length; } -void writeTo(UChar* destination) +bool is8Bit() { return m_string.isNull() || m_string.is8Bit(); } + +void writeTo(LChar* destination) { +const LChar* characters = m_string.characters8(); for (unsigned i = 0; i m_length; ++i) -destination[i] = m_data[i]; +destination[i] = characters[i]; } +void writeTo(UChar* destination) +{ +if (is8Bit()) { +const LChar* characters = m_string.characters8(); +for (unsigned i = 0; i m_length; ++i) +destination[i] = characters[i]; +} else { +const UChar* characters = m_string.characters16(); +for (unsigned i = 0; i m_length; ++i) +destination[i] = characters[i]; +} +} + private: -const UChar* m_data; +const JSC::UString m_string; unsigned m_length; }; Modified: trunk/Source/_javascript_Core/wtf/text/StringConcatenate.h (102379 => 102380) --- trunk/Source/_javascript_Core/wtf/text/StringConcatenate.h 2011-12-08 21:29:31 UTC (rev 102379) +++ trunk/Source/_javascript_Core/wtf/text/StringConcatenate.h 2011-12-08 21:47:42 UTC (rev 102380) @@ -51,6 +51,14 @@ } unsigned length() { return 1; } + +bool is8Bit() { return true; } + +void writeTo(LChar* destination) +{ +*destination = m_buffer; +} + void writeTo(UChar* destination) { *destination = m_buffer; } private: @@ -66,6 +74,14 @@ } unsigned length() { return 1; } + +bool is8Bit() { return true; } + +void writeTo(LChar* destination) +{ +*destination = m_buffer; +} + void writeTo(UChar* destination) { *destination = m_buffer; } private: @@ -81,6 +97,15 @@ } unsigned length() { return 1; } + +bool is8Bit() { return m_buffer = 0xff; } + +void writeTo(LChar* destination) +{ +ASSERT(is8Bit()); +*destination = static_castLChar(m_buffer); +} + void writeTo(UChar* destination) { *destination = m_buffer;
[webkit-changes] [102475] trunk/Source/JavaScriptCore
Title: [102475] trunk/Source/_javascript_Core Revision 102475 Author msab...@apple.com Date 2011-12-09 14:42:31 -0800 (Fri, 09 Dec 2011) Log Message YARR: Multi-character read optimization for 8bit strings https://bugs.webkit.org/show_bug.cgi?id=74191 Reviewed by Oliver Hunt. Changed generatePatternCharacterOnce to generate code for 1 to 4 characters in the 8 bit case. This is worth 29% improvement on SunSpider regexp-dna test. It provides no benefit to v8-regexp. * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): (JSC::Yarr::YarrGenerator::generate): Spelling fix in comment. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/yarr/YarrJIT.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102474 => 102475) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-09 22:07:08 UTC (rev 102474) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-09 22:42:31 UTC (rev 102475) @@ -1,3 +1,19 @@ +2011-12-09 Michael Saboff msab...@apple.com + +YARR: Multi-character read optimization for 8bit strings +https://bugs.webkit.org/show_bug.cgi?id=74191 + +Reviewed by Oliver Hunt. + +Changed generatePatternCharacterOnce to generate +code for 1 to 4 characters in the 8 bit case. +This is worth 29% improvement on SunSpider regexp-dna test. +It provides no benefit to v8-regexp. + +* yarr/YarrJIT.cpp: +(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce): +(JSC::Yarr::YarrGenerator::generate): Spelling fix in comment. + 2011-12-09 David Levin le...@chromium.org Regression(r53595): Sync xhr requests in workers aren't terminated on worker close. Modified: trunk/Source/_javascript_Core/yarr/YarrJIT.cpp (102474 => 102475) --- trunk/Source/_javascript_Core/yarr/YarrJIT.cpp 2011-12-09 22:07:08 UTC (rev 102474) +++ trunk/Source/_javascript_Core/yarr/YarrJIT.cpp 2011-12-09 22:42:31 UTC (rev 102475) @@ -655,14 +655,14 @@ { YarrOp op = m_ops[opIndex]; +if (op.m_isDeadCode) +return; + // m_ops always ends with a OpBodyAlternativeEnd or OpMatchFailed // node, so there must always be at least one more node. ASSERT(opIndex + 1 m_ops.size()); -YarrOp nextOp = m_ops[opIndex + 1]; +YarrOp* nextOp = m_ops[opIndex + 1]; -if (op.m_isDeadCode) -return; - PatternTerm* term = op.m_term; UChar ch = term-patternCharacter; @@ -673,47 +673,90 @@ } const RegisterID character = regT0; +int maxCharactersAtOnce = m_charSize == Char8 ? 4 : 2; +unsigned ignoreCaseMask = 0; +unsigned currentCharacterMask = m_charSize == Char8 ? 0xff : 0x; +int allCharacters = ch; +int numberCharacters; +int startTermPosition = term-inputPosition; -if (nextOp.m_op == OpTerm) { -PatternTerm* nextTerm = nextOp.m_term; -if (nextTerm-type == PatternTerm::TypePatternCharacter - nextTerm-quantityType == QuantifierFixedCount - nextTerm-quantityCount == 1 - nextTerm-inputPosition == (term-inputPosition + 1)) { +// For case-insesitive compares, non-ascii characters that have different +// upper lower case representations are converted to a character class. +ASSERT(!m_pattern.m_ignoreCase || isASCIIAlpha(ch) || (Unicode::toLower(ch) == Unicode::toUpper(ch))); -UChar ch2 = nextTerm-patternCharacter; +if ((m_pattern.m_ignoreCase) (isASCIIAlpha(ch))) +ignoreCaseMask |= 32; -int shiftAmount = m_charSize == Char8 ? 8 : 16; -int mask = 0; -int chPair = ch | (ch2 shiftAmount); +for (numberCharacters = 1; numberCharacters maxCharactersAtOnce nextOp-m_op == OpTerm; ++numberCharacters, nextOp = m_ops[opIndex + numberCharacters]) { +PatternTerm* nextTerm = nextOp-m_term; + +if (nextTerm-type != PatternTerm::TypePatternCharacter +|| nextTerm-quantityType != QuantifierFixedCount +|| nextTerm-quantityCount != 1 +|| nextTerm-inputPosition != (startTermPosition + numberCharacters)) +break; -// For case-insesitive compares, non-ascii characters that have different -// upper lower case representations are converted to a character class. -ASSERT(!m_pattern.m_ignoreCase || isASCIIAlpha(ch) || (Unicode::toLower(ch) == Unicode::toUpper(ch))); -if (m_pattern.m_ignoreCase) { -if (isASCIIAlpha(ch)) -mask |= 32; -if (isASCIIAlpha(ch2)) -mask |= 32 shiftAmount; -} +nextOp-m_isDeadCode = true; -if (m_charSize == Char8) { -
[webkit-changes] [102631] trunk/Source/JavaScriptCore
Title: [102631] trunk/Source/_javascript_Core Revision 102631 Author msab...@apple.com Date 2011-12-12 15:21:51 -0800 (Mon, 12 Dec 2011) Log Message Eliminate Duplicate word at a time equal code in StringImpl.cpp and StringHash.h https://bugs.webkit.org/show_bug.cgi?id=73622 Reviewed by Oliver Hunt. Moved equal(charType1 *, charType2, unsigned) template methods from static StringImpl.cpp to StringImpl.h and then replaced the processor specific character comparison code in StringHash::equal with calls to these methods. This change is worth 3% on SunSpider string-unpack-code as reported by the SunSpider command line harness. No other tests appear to have measurable performance changes. * wtf/text/AtomicString.h: (WTF::operator==): * wtf/text/StringHash.h: (WTF::StringHash::equal): * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: (WTF::LChar): (WTF::UChar): (WTF::equal): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/AtomicString.h trunk/Source/_javascript_Core/wtf/text/StringHash.h trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102630 => 102631) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-12 23:17:52 UTC (rev 102630) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-12 23:21:51 UTC (rev 102631) @@ -1,3 +1,29 @@ +2011-12-12 Michael Saboff msab...@apple.com + +Eliminate Duplicate word at a time equal code in StringImpl.cpp and StringHash.h +https://bugs.webkit.org/show_bug.cgi?id=73622 + +Reviewed by Oliver Hunt. + +Moved equal(charType1 *, charType2, unsigned) template methods +from static StringImpl.cpp to StringImpl.h and then replaced the +processor specific character comparison code in StringHash::equal +with calls to these methods. + +This change is worth 3% on SunSpider string-unpack-code as reported +by the SunSpider command line harness. No other tests appear to +have measurable performance changes. + +* wtf/text/AtomicString.h: +(WTF::operator==): +* wtf/text/StringHash.h: +(WTF::StringHash::equal): +* wtf/text/StringImpl.cpp: +* wtf/text/StringImpl.h: +(WTF::LChar): +(WTF::UChar): +(WTF::equal): + 2011-12-12 Filip Pizlo fpi...@apple.com ARMv7 version of DFG soft modulo does register allocation inside of control flow Modified: trunk/Source/_javascript_Core/wtf/text/AtomicString.h (102630 => 102631) --- trunk/Source/_javascript_Core/wtf/text/AtomicString.h 2011-12-12 23:17:52 UTC (rev 102630) +++ trunk/Source/_javascript_Core/wtf/text/AtomicString.h 2011-12-12 23:21:51 UTC (rev 102631) @@ -139,7 +139,7 @@ inline bool operator==(const AtomicString a, const AtomicString b) { return a.impl() == b.impl(); } bool operator==(const AtomicString, const LChar*); inline bool operator==(const AtomicString a, const char* b) { return WTF::equal(a.impl(), reinterpret_castconst LChar*(b)); } -inline bool operator==(const AtomicString a, const VectorUChar b) { return a.impl() equal(a.impl(), b.data(), b.size()); } +inline bool operator==(const AtomicString a, const VectorUChar b) { return a.impl() equal(static_castStringImpl*(a.impl()), b.data(), b.size()); } inline bool operator==(const AtomicString a, const String b) { return equal(a.impl(), b.impl()); } inline bool operator==(const LChar* a, const AtomicString b) { return b == a; } inline bool operator==(const String a, const AtomicString b) { return equal(a.impl(), b.impl()); } Modified: trunk/Source/_javascript_Core/wtf/text/StringHash.h (102630 => 102631) --- trunk/Source/_javascript_Core/wtf/text/StringHash.h 2011-12-12 23:17:52 UTC (rev 102630) +++ trunk/Source/_javascript_Core/wtf/text/StringHash.h 2011-12-12 23:21:51 UTC (rev 102631) @@ -56,84 +56,19 @@ if (a-is8Bit()) { if (b-is8Bit()) { // Both a b are 8 bit. -const LChar* aChars = a-characters8(); -const LChar* bChars = b-characters8(); - -unsigned i = 0; - -// FIXME: perhaps we should have a more abstract macro that indicates when -// going 4 bytes at a time is unsafe -#if (CPU(X86) || CPU(X86_64)) -const unsigned charsPerInt = sizeof(uint32_t) / sizeof(char); - -if (aLength charsPerInt) { -unsigned stopCount = aLength ~(charsPerInt - 1); - -const uint32_t* aIntCharacters = reinterpret_castconst uint32_t*(aChars); -const uint32_t* bIntCharacters = reinterpret_castconst uint32_t*(bChars); -for (unsigned j = 0; i stopCount; i += charsPerInt, ++j) { -if
[webkit-changes] [102692] trunk/Source/JavaScriptCore
Title: [102692] trunk/Source/_javascript_Core Revision 102692 Author msab...@apple.com Date 2011-12-13 11:39:12 -0800 (Tue, 13 Dec 2011) Log Message Cleanup of StringImpl::equal in r102631 post commit https://bugs.webkit.org/show_bug.cgi?id=74421 Reviewed by Darin Adler. * wtf/text/AtomicString.h: (WTF::operator==): Removed cast no longer needed. * wtf/text/StringImpl.h: (WTF::equal): Changed template to several overloaded methods. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/AtomicString.h trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (102691 => 102692) --- trunk/Source/_javascript_Core/ChangeLog 2011-12-13 18:48:21 UTC (rev 102691) +++ trunk/Source/_javascript_Core/ChangeLog 2011-12-13 19:39:12 UTC (rev 102692) @@ -1,3 +1,15 @@ +2011-12-13 Michael Saboff msab...@apple.com + +Cleanup of StringImpl::equal in r102631 post commit +https://bugs.webkit.org/show_bug.cgi?id=74421 + +Reviewed by Darin Adler. + +* wtf/text/AtomicString.h: +(WTF::operator==): Removed cast no longer needed. +* wtf/text/StringImpl.h: +(WTF::equal): Changed template to several overloaded methods. + 2011-12-12 Michael Saboff msab...@apple.com Eliminate Duplicate word at a time equal code in StringImpl.cpp and StringHash.h Modified: trunk/Source/_javascript_Core/wtf/text/AtomicString.h (102691 => 102692) --- trunk/Source/_javascript_Core/wtf/text/AtomicString.h 2011-12-13 18:48:21 UTC (rev 102691) +++ trunk/Source/_javascript_Core/wtf/text/AtomicString.h 2011-12-13 19:39:12 UTC (rev 102692) @@ -139,7 +139,7 @@ inline bool operator==(const AtomicString a, const AtomicString b) { return a.impl() == b.impl(); } bool operator==(const AtomicString, const LChar*); inline bool operator==(const AtomicString a, const char* b) { return WTF::equal(a.impl(), reinterpret_castconst LChar*(b)); } -inline bool operator==(const AtomicString a, const VectorUChar b) { return a.impl() equal(static_castStringImpl*(a.impl()), b.data(), b.size()); } +inline bool operator==(const AtomicString a, const VectorUChar b) { return a.impl() equal(a.impl(), b.data(), b.size()); } inline bool operator==(const AtomicString a, const String b) { return equal(a.impl(), b.impl()); } inline bool operator==(const LChar* a, const AtomicString b) { return b == a; } inline bool operator==(const String a, const AtomicString b) { return equal(a.impl(), b.impl()); } Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.h (102691 => 102692) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-12-13 18:48:21 UTC (rev 102691) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.h 2011-12-13 19:39:12 UTC (rev 102692) @@ -562,97 +562,92 @@ inline bool equal(const LChar* a, StringImpl* b) { return equal(b, a); } inline bool equal(const char* a, StringImpl* b) { return equal(b, reinterpret_castconst LChar*(a)); } bool equal(const StringImpl*, const UChar*, unsigned); -template typename CharTypeL, typename CharTypeR -ALWAYS_INLINE bool equal(const CharTypeL*, const CharTypeR*, unsigned); // Do comparisons 8 or 4 bytes-at-a-time on architectures where it's safe. #if CPU(X86_64) -template -ALWAYS_INLINE bool equalLChar, LChar(const LChar* a, const LChar* b, unsigned length) +ALWAYS_INLINE bool equal(const LChar* a, const LChar* b, unsigned length) { unsigned dwordLength = length 3; - + if (dwordLength) { const uint64_t* aDWordCharacters = reinterpret_castconst uint64_t*(a); const uint64_t* bDWordCharacters = reinterpret_castconst uint64_t*(b); - + for (unsigned i = 0; i != dwordLength; ++i) { if (*aDWordCharacters++ != *bDWordCharacters++) return false; } - + a = reinterpret_castconst LChar*(aDWordCharacters); b = reinterpret_castconst LChar*(bDWordCharacters); } - + if (length 4) { if (*reinterpret_castconst uint32_t*(a) != *reinterpret_castconst uint32_t*(b)) return false; - + a += 4; b += 4; } - + if (length 2) { if (*reinterpret_castconst uint16_t*(a) != *reinterpret_castconst uint16_t*(b)) return false; - + a += 2; b += 2; } - + if (length 1 (*a != *b)) return false; - + return true; } -template -ALWAYS_INLINE bool equalUChar, UChar(const UChar* a, const UChar* b, unsigned length) +ALWAYS_INLINE bool equal(const UChar* a, const UChar* b, unsigned length) { unsigned dwordLength = length 2; if (dwordLength) { const uint64_t* aDWordCharacters = reinterpret_castconst uint64_t*(a); const uint64_t* bDWordCharacters = reinterpret_castconst uint64_t*(b); - + for (unsigned i = 0; i != dwordLength; ++i) { if
[webkit-changes] [93189] trunk/Source/JavaScriptCore
Title: [93189] trunk/Source/_javascript_Core Revision 93189 Author msab...@apple.com Date 2011-08-16 18:34:29 -0700 (Tue, 16 Aug 2011) Log Message Crash in Structure::visitChildren running iAd.js regression test suite under memory pressure https://bugs.webkit.org/show_bug.cgi?id=66351 JIT::privateCompilePutByIdTransition expects that regT0 and regT1 have the basePayload and baseTag respectively. In some cases, we may get to this generated code with one or both of these registers trash. One know case is that regT0 on ARM may be trashed as regT0 (r0) is also arg0 and can be overrun with sp due to calls to JIT::restoreReturnAddress(). This patch uses the values on the stack. A longer term solution is to work out all cases so that the register entry assumptions can assured. While fixing this, also determined that the additional stack offset of sizeof(void*) is not needed for ARM. Reviewed by Gavin Barraclough. * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::privateCompilePutByIdTransition): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (93188 => 93189) --- trunk/Source/_javascript_Core/ChangeLog 2011-08-17 01:32:20 UTC (rev 93188) +++ trunk/Source/_javascript_Core/ChangeLog 2011-08-17 01:34:29 UTC (rev 93189) @@ -1,3 +1,25 @@ +2011-08-16 Michael Saboff msab...@apple.com + +Crash in Structure::visitChildren running iAd.js regression test suite under memory pressure +https://bugs.webkit.org/show_bug.cgi?id=66351 + +JIT::privateCompilePutByIdTransition expects that regT0 and regT1 +have the basePayload and baseTag respectively. In some cases, +we may get to this generated code with one or both of these +registers trash. One know case is that regT0 on ARM may be +trashed as regT0 (r0) is also arg0 and can be overrun with sp due +to calls to JIT::restoreReturnAddress(). This patch uses the +values on the stack. A longer term solution is to work out all +cases so that the register entry assumptions can assured. + +While fixing this, also determined that the additional stack offset +of sizeof(void*) is not needed for ARM. + +Reviewed by Gavin Barraclough. + +* jit/JITPropertyAccess32_64.cpp: +(JSC::JIT::privateCompilePutByIdTransition): + 2011-08-15 Gavin Barraclough barraclo...@apple.com https://bugs.webkit.org/show_bug.cgi?id=66263 Modified: trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp (93188 => 93189) --- trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2011-08-17 01:32:20 UTC (rev 93188) +++ trunk/Source/_javascript_Core/jit/JITPropertyAccess32_64.cpp 2011-08-17 01:34:29 UTC (rev 93189) @@ -470,8 +470,17 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress, bool direct) { -// It is assumed that regT0 contains the basePayload and regT1 contains the baseTag. The value can be found on the stack. - +// The code below assumes that regT0 contains the basePayload and regT1 contains the baseTag. Restore them from the stack. +#if CPU(MIPS) || CPU(SH4) || CPU(ARM) +// For MIPS, we don't add sizeof(void*) to the stack offset. +load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); +// For MIPS, we don't add sizeof(void*) to the stack offset. +load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); +#else +load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[0]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); +load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[0]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); +#endif + JumpList failureCases; failureCases.append(branch32(NotEqual, regT1, TrustedImm32(JSValue::CellTag))); failureCases.append(branchPtr(NotEqual, Address(regT0, JSCell::structureOffset()), TrustedImmPtr(oldStructure))); @@ -498,14 +507,24 @@ stubCall.addArgument(TrustedImm32(oldStructure-propertyStorageCapacity())); stubCall.addArgument(TrustedImm32(newStructure-propertyStorageCapacity())); stubCall.call(regT0); - + restoreReturnAddressBeforeReturn(regT3); + +#if CPU(MIPS) || CPU(SH4) || CPU(ARM) +// For MIPS, we don't add sizeof(void*) to the stack offset. +load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); +// For MIPS, we don't add sizeof(void*) to the stack offset. +load32(Address(stackPointerRegister,
[webkit-changes] [93546] trunk/Source/WebKit2
Title: [93546] trunk/Source/WebKit2 Revision 93546 Author msab...@apple.com Date 2011-08-22 14:46:58 -0700 (Mon, 22 Aug 2011) Log Message REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari https://bugs.webkit.org/show_bug.cgi?id=66464 Changed ArgumentEncoder to use system malloc instead of fastMalloc. FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY. The system malloc has no such limitation. Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it doesn't have size limitations that MACH_MSG_PHYSICAL_COPY. Reviewed by Anders Carlsson. * Platform/CoreIPC/ArgumentEncoder.cpp: (CoreIPC::ArgumentEncoder::~ArgumentEncoder): (CoreIPC::ArgumentEncoder::grow): * Platform/CoreIPC/mac/ConnectionMac.cpp: (CoreIPC::Connection::sendOutgoingMessage): Modified Paths trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp Diff Modified: trunk/Source/WebKit2/ChangeLog (93545 => 93546) --- trunk/Source/WebKit2/ChangeLog 2011-08-22 21:45:39 UTC (rev 93545) +++ trunk/Source/WebKit2/ChangeLog 2011-08-22 21:46:58 UTC (rev 93546) @@ -1,3 +1,23 @@ +2011-08-21 Michael Saboff msab...@apple.com + +REGRESSION (r92231): Apple campus proposal PDF doesn't display in Safari +https://bugs.webkit.org/show_bug.cgi?id=66464 + +Changed ArgumentEncoder to use system malloc instead of fastMalloc. +FastMalloc uses madvise(MADV_FREE_REUSABLE) which is incompatible with +mach message Out Of Line (OOL) messages that use MACH_MSG_VIRTUAL_COPY. +The system malloc has no such limitation. +Changed sendOutgoingMessage to use MACH_MSG_VIRTUAL_COPY again as it +doesn't have size limitations that MACH_MSG_PHYSICAL_COPY. + +Reviewed by Anders Carlsson. + +* Platform/CoreIPC/ArgumentEncoder.cpp: +(CoreIPC::ArgumentEncoder::~ArgumentEncoder): +(CoreIPC::ArgumentEncoder::grow): +* Platform/CoreIPC/mac/ConnectionMac.cpp: +(CoreIPC::Connection::sendOutgoingMessage): + 2011-08-22 Anders Carlsson ander...@apple.com Use -[NSApplication updateWindows] to update the current input context Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp (93545 => 93546) --- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2011-08-22 21:45:39 UTC (rev 93545) +++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2011-08-22 21:46:58 UTC (rev 93546) @@ -50,7 +50,7 @@ ArgumentEncoder::~ArgumentEncoder() { if (m_buffer) -fastFree(m_buffer); +free(m_buffer); #if !USE(UNIX_DOMAIN_SOCKETS) // FIXME: We need to dispose of the attachments in cases of failure. #else @@ -70,10 +70,13 @@ if (alignedSize + size m_bufferCapacity) { size_t newCapacity = std::max(alignedSize + size, std::max(static_castsize_t(32), m_bufferCapacity + m_bufferCapacity / 4 + 1)); +// Use system malloc / realloc instead of fastMalloc due to +// fastMalloc using MADV_FREE_REUSABLE doesn't work with +// mach messages with OOL message and MACH_MSG_VIRTUAL_COPY. if (!m_buffer) -m_buffer = static_castuint8_t*(fastMalloc(newCapacity)); +m_buffer = static_castuint8_t*(malloc(newCapacity)); else -m_buffer = static_castuint8_t*(fastRealloc(m_buffer, newCapacity)); +m_buffer = static_castuint8_t*(realloc(m_buffer, newCapacity)); // FIXME: What should we do if allocating memory fails? Modified: trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp (93545 => 93546) --- trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp 2011-08-22 21:45:39 UTC (rev 93545) +++ trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp 2011-08-22 21:46:58 UTC (rev 93546) @@ -155,7 +155,7 @@ if (messageSize sizeof(buffer)) { messageBodyIsOOL = true; -attachments.append(Attachment(arguments-buffer(), arguments-bufferSize(), MACH_MSG_PHYSICAL_COPY, false)); +attachments.append(Attachment(arguments-buffer(), arguments-bufferSize(), MACH_MSG_VIRTUAL_COPY, false)); numberOfOOLMemoryDescriptors++; messageSize = machMessageSize(0, numberOfPortDescriptors, numberOfOOLMemoryDescriptors); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [93754] trunk/Source/WebKit2
Title: [93754] trunk/Source/WebKit2 Revision 93754 Author msab...@apple.com Date 2011-08-24 18:23:43 -0700 (Wed, 24 Aug 2011) Log Message Improper comment in CoreIPC/ArgumentEncoder.cpp from 66464 https://bugs.webkit.org/show_bug.cgi?id=66912 Updated the comment in ArgumentEncoder::grow to reflect that system malloc currently checks to see if a MADV_FREE_REUSABLE will fail before calling it. Reviewed by Mark Rowe. * Platform/CoreIPC/ArgumentEncoder.cpp: (CoreIPC::ArgumentEncoder::grow): Modified Paths trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp Diff Modified: trunk/Source/WebKit2/ChangeLog (93753 => 93754) --- trunk/Source/WebKit2/ChangeLog 2011-08-25 01:05:59 UTC (rev 93753) +++ trunk/Source/WebKit2/ChangeLog 2011-08-25 01:23:43 UTC (rev 93754) @@ -1,3 +1,16 @@ +2011-08-24 Michael Saboff msab...@apple.com + +Improper comment in CoreIPC/ArgumentEncoder.cpp from 66464 +https://bugs.webkit.org/show_bug.cgi?id=66912 + +Updated the comment in ArgumentEncoder::grow to reflect that system malloc +currently checks to see if a MADV_FREE_REUSABLE will fail before calling it. + +Reviewed by Mark Rowe. + +* Platform/CoreIPC/ArgumentEncoder.cpp: +(CoreIPC::ArgumentEncoder::grow): + 2011-08-24 Anders Carlsson ander...@apple.com Rename -[WKTextInputWindowController keyboardInputSourceChanged] to unmarkText to indicate what the method does Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp (93753 => 93754) --- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2011-08-25 01:05:59 UTC (rev 93753) +++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentEncoder.cpp 2011-08-25 01:23:43 UTC (rev 93754) @@ -71,8 +71,11 @@ if (alignedSize + size m_bufferCapacity) { size_t newCapacity = std::max(alignedSize + size, std::max(static_castsize_t(32), m_bufferCapacity + m_bufferCapacity / 4 + 1)); // Use system malloc / realloc instead of fastMalloc due to -// fastMalloc using MADV_FREE_REUSABLE doesn't work with +// fastMalloc using MADV_FREE_REUSABLE which doesn't work with // mach messages with OOL message and MACH_MSG_VIRTUAL_COPY. +// System malloc also calls madvise(MADV_FREE_REUSABLE) but after first +// checking via madvise(CAN_REUSE) that it will succeed. Should this +// behavior change we'll need to revisit this. if (!m_buffer) m_buffer = static_castuint8_t*(malloc(newCapacity)); else ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [94336] trunk/Source/JavaScriptCore
Title: [94336] trunk/Source/_javascript_Core Revision 94336 Author msab...@apple.com Date 2011-09-01 13:04:34 -0700 (Thu, 01 Sep 2011) Log Message Remove simple usage of UString::characters() from _javascript_Core https://bugs.webkit.org/show_bug.cgi?id=67340 In preparation to allowing StringImpl to be backed by 8 bit characters when appropriate, we need to eliminate or change the usage of StringImpl::characters(). Most of the changes below change s-characters()[0] to s[0]. Reviewed by Geoffrey Garen. * bytecompiler/BytecodeGenerator.cpp: (JSC::keyForCharacterSwitch): * bytecompiler/NodesCodegen.cpp: (JSC::processClauseList): * interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Identifier.cpp: (JSC::Identifier::addSlowCase): * runtime/JSGlobalObjectFunctions.cpp: (JSC::jsToNumber): (JSC::parseFloat): * runtime/JSString.cpp: (JSC::JSString::substringFromRope): * runtime/JSString.h: (JSC::jsSingleCharacterSubstring): (JSC::jsString): (JSC::jsSubstring): (JSC::jsOwnedString): * runtime/RegExp.cpp: (JSC::regExpFlags): * wtf/text/StringBuilder.h: (WTF::StringBuilder::operator[]): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp trunk/Source/_javascript_Core/interpreter/Interpreter.cpp trunk/Source/_javascript_Core/jit/JITStubs.cpp trunk/Source/_javascript_Core/runtime/Identifier.cpp trunk/Source/_javascript_Core/runtime/JSGlobalObjectFunctions.cpp trunk/Source/_javascript_Core/runtime/JSString.cpp trunk/Source/_javascript_Core/runtime/JSString.h trunk/Source/_javascript_Core/runtime/RegExp.cpp trunk/Source/_javascript_Core/wtf/text/StringBuilder.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (94335 => 94336) --- trunk/Source/_javascript_Core/ChangeLog 2011-09-01 19:56:45 UTC (rev 94335) +++ trunk/Source/_javascript_Core/ChangeLog 2011-09-01 20:04:34 UTC (rev 94336) @@ -1,3 +1,40 @@ +2011-09-01 Michael Saboff msab...@apple.com + +Remove simple usage of UString::characters() from _javascript_Core +https://bugs.webkit.org/show_bug.cgi?id=67340 + +In preparation to allowing StringImpl to be backed by 8 bit +characters when appropriate, we need to eliminate or change the +usage of StringImpl::characters(). Most of the changes below +change s-characters()[0] to s[0]. + +Reviewed by Geoffrey Garen. + +* bytecompiler/BytecodeGenerator.cpp: +(JSC::keyForCharacterSwitch): +* bytecompiler/NodesCodegen.cpp: +(JSC::processClauseList): +* interpreter/Interpreter.cpp: +(JSC::Interpreter::privateExecute): +* jit/JITStubs.cpp: +(JSC::DEFINE_STUB_FUNCTION): +* runtime/Identifier.cpp: +(JSC::Identifier::addSlowCase): +* runtime/JSGlobalObjectFunctions.cpp: +(JSC::jsToNumber): +(JSC::parseFloat): +* runtime/JSString.cpp: +(JSC::JSString::substringFromRope): +* runtime/JSString.h: +(JSC::jsSingleCharacterSubstring): +(JSC::jsString): +(JSC::jsSubstring): +(JSC::jsOwnedString): +* runtime/RegExp.cpp: +(JSC::regExpFlags): +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::operator[]): + 2011-09-01 Ada Chan adac...@apple.com Export fastMallocStatistics and Heap::objectTypeCounts for https://bugs.webkit.org/show_bug.cgi?id=67160. Modified: trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (94335 => 94336) --- trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2011-09-01 19:56:45 UTC (rev 94335) +++ trunk/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp 2011-09-01 20:04:34 UTC (rev 94336) @@ -2273,7 +2273,7 @@ StringImpl* clause = static_castStringNode*(node)-value().impl(); ASSERT(clause-length() == 1); -int32_t key = clause-characters()[0]; +int32_t key = (*clause)[0]; ASSERT(key = min); ASSERT(key = max); return key - min; Modified: trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp (94335 => 94336) --- trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2011-09-01 19:56:45 UTC (rev 94335) +++ trunk/Source/_javascript_Core/bytecompiler/NodesCodegen.cpp 2011-09-01 20:04:34 UTC (rev 94336) @@ -1740,7 +1740,7 @@ } const UString value = static_castStringNode*(clauseExpression)-value().ustring(); if (singleCharacterSwitch = value.length() == 1) { -int32_t intVal = value.impl()-characters()[0]; +int32_t intVal = value[0]; if (intVal min_num) min_num = intVal; if (intVal max_num) Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (94335 => 94336) ---
[webkit-changes] [94468] trunk/Source/JavaScriptCore
Title: [94468] trunk/Source/_javascript_Core Revision 94468 Author msab...@apple.com Date 2011-09-02 17:20:43 -0700 (Fri, 02 Sep 2011) Log Message Add JSC:RegExp functional test data generator https://bugs.webkit.org/show_bug.cgi?id=67519 Add a data generator for regular expressions. To enable, change the #undef REGEXP_FUNC_TEST_DATA_GEN to #define. Then compile and use regular expressions. The resulting data will be in /tmp/RegExpTestsData. Reviewed by Gavin Barraclough. * runtime/RegExp.cpp: (JSC::regExpFlags): (JSC::RegExpFunctionalTestCollector::clearRegExp): (JSC::RegExpFunctionalTestCollector::get): (JSC::RegExpFunctionalTestCollector::outputOneTest): (JSC::RegExpFunctionalTestCollector::RegExpFunctionalTestCollector): (JSC::RegExpFunctionalTestCollector::~RegExpFunctionalTestCollector): (JSC::RegExpFunctionalTestCollector::outputEscapedUString): (JSC::RegExp::~RegExp): (JSC::RegExp::compile): (JSC::RegExp::match): (JSC::RegExp::matchCompareWithInterpreter): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/RegExp.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (94467 => 94468) --- trunk/Source/_javascript_Core/ChangeLog 2011-09-03 00:20:41 UTC (rev 94467) +++ trunk/Source/_javascript_Core/ChangeLog 2011-09-03 00:20:43 UTC (rev 94468) @@ -1,3 +1,27 @@ +2011-09-02 Michael Saboff msab...@apple.com + +Add JSC:RegExp functional test data generator +https://bugs.webkit.org/show_bug.cgi?id=67519 + +Add a data generator for regular expressions. To enable, change the +#undef REGEXP_FUNC_TEST_DATA_GEN to #define. Then compile and use +regular expressions. The resulting data will be in /tmp/RegExpTestsData. + +Reviewed by Gavin Barraclough. + +* runtime/RegExp.cpp: +(JSC::regExpFlags): +(JSC::RegExpFunctionalTestCollector::clearRegExp): +(JSC::RegExpFunctionalTestCollector::get): +(JSC::RegExpFunctionalTestCollector::outputOneTest): +(JSC::RegExpFunctionalTestCollector::RegExpFunctionalTestCollector): +(JSC::RegExpFunctionalTestCollector::~RegExpFunctionalTestCollector): +(JSC::RegExpFunctionalTestCollector::outputEscapedUString): +(JSC::RegExp::~RegExp): +(JSC::RegExp::compile): +(JSC::RegExp::match): +(JSC::RegExp::matchCompareWithInterpreter): + 2011-09-02 Mark Hahnenberg mhahnenb...@apple.com Fix the broken build due to dtoa patch Modified: trunk/Source/_javascript_Core/runtime/RegExp.cpp (94467 => 94468) --- trunk/Source/_javascript_Core/runtime/RegExp.cpp 2011-09-03 00:20:41 UTC (rev 94467) +++ trunk/Source/_javascript_Core/runtime/RegExp.cpp 2011-09-03 00:20:43 UTC (rev 94468) @@ -33,6 +33,9 @@ #include wtf/Assertions.h #include wtf/OwnArrayPtr.h + +#define REGEXP_FUNC_TEST_DATA_GEN 0 + namespace JSC { const ClassInfo RegExp::s_info = { RegExp, 0, 0, 0 }; @@ -68,7 +71,152 @@ return flags; } - + +#if REGEXP_FUNC_TEST_DATA_GEN +class RegExpFunctionalTestCollector { +// This class is not thread safe. +protected: +static const char* const s_fileName; + +public: +static RegExpFunctionalTestCollector* get(); + +~RegExpFunctionalTestCollector(); + +void outputOneTest(RegExp*, UString, int, int*, int); +void clearRegExp(RegExp* regExp) +{ +if (regExp == m_lastRegExp) +m_lastRegExp = 0; +} + +private: +RegExpFunctionalTestCollector(); + +void outputEscapedUString(const UString, bool escapeSlash = false); + +static RegExpFunctionalTestCollector* s_instance; +FILE* m_file; +RegExp* m_lastRegExp; +}; + +const char* const RegExpFunctionalTestCollector::s_fileName = /tmp/RegExpTestsData; +RegExpFunctionalTestCollector* RegExpFunctionalTestCollector::s_instance = 0; + +RegExpFunctionalTestCollector* RegExpFunctionalTestCollector::get() +{ +if (!s_instance) +s_instance = new RegExpFunctionalTestCollector(); + +return s_instance; +} + +void RegExpFunctionalTestCollector::outputOneTest(RegExp* regExp, UString s, int startOffset, int* ovector, int result) +{ +if ((!m_lastRegExp) || (m_lastRegExp != regExp)) { +m_lastRegExp = regExp; +fputc('/', m_file); +outputEscapedUString(regExp-pattern(), true); +fputc('/', m_file); +if (regExp-global()) +fputc('g', m_file); +if (regExp-ignoreCase()) +fputc('i', m_file); +if (regExp-multiline()) +fputc('m', m_file); +fprintf(m_file, \n); +} + +fprintf(m_file, \); +outputEscapedUString(s); +fprintf(m_file, \, %d, %d, (, startOffset, result); +for (unsigned i = 0; i = regExp-numSubpatterns(); i++) { +int subPatternBegin = ovector[i * 2]; +int subPatternEnd = ovector[i * 2 + 1]; +if (subPatternBegin == -1) +subPatternEnd = -1; +fprintf(m_file, %d, %d, subPatternBegin,
[webkit-changes] [94472] trunk/Source/WebKit2
Title: [94472] trunk/Source/WebKit2 Revision 94472 Author msab...@apple.com Date 2011-09-02 18:01:35 -0700 (Fri, 02 Sep 2011) Log Message 2011-09-02 Michael Saboff msab...@apple.com Fixed release build by removing #ifndef NDEBUG to allow definition of gcController(). Rubber-stamp by Sam Weinig. * WebProcess/WebProcess.cpp: Modified Paths trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/WebProcess/WebProcess.cpp Diff Modified: trunk/Source/WebKit2/ChangeLog (94471 => 94472) --- trunk/Source/WebKit2/ChangeLog 2011-09-03 00:42:36 UTC (rev 94471) +++ trunk/Source/WebKit2/ChangeLog 2011-09-03 01:01:35 UTC (rev 94472) @@ -1,3 +1,12 @@ +2011-09-02 Michael Saboff msab...@apple.com + +Fixed release build by removing #ifndef NDEBUG to +allow definition of gcController(). + +Rubber-stamp by Sam Weinig. + +* WebProcess/WebProcess.cpp: + 2011-09-02 Anders Carlsson ander...@apple.com NPN_SetException doesn't work with OOP plug-ins Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (94471 => 94472) --- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2011-09-03 00:42:36 UTC (rev 94471) +++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2011-09-03 01:01:35 UTC (rev 94472) @@ -59,6 +59,7 @@ #include WebCore/CrossOriginPreflightResultCache.h #include WebCore/Font.h #include WebCore/FontCache.h +#include WebCore/GCController.h #include WebCore/GlyphPageTreeNode.h #include WebCore/IconDatabase.h #include WebCore/JSDOMWindow.h @@ -78,10 +79,6 @@ #include wtf/PassRefPtr.h #include wtf/RandomNumber.h -#ifndef NDEBUG -#include WebCore/GCController.h -#endif - #if !OS(WINDOWS) #include unistd.h #endif ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [94475] trunk/Source/JavaScriptCore
Title: [94475] trunk/Source/_javascript_Core Revision 94475 Author msab...@apple.com Date 2011-09-02 18:08:10 -0700 (Fri, 02 Sep 2011) Log Message Replace local implementation of string equals() methods with UString versions https://bugs.webkit.org/show_bug.cgi?id=67342 In preparation to allowing StringImpl to be backed by 8 bit characters when appropriate, we need to eliminate or change the usage of StringImpl::characters(). Change the uses of characters() that are used to implement redundant equals() methods. Reviewed by Gavin Barraclough. * runtime/Identifier.cpp: (JSC::Identifier::equal): * runtime/Identifier.h: (JSC::Identifier::equal): * wtf/text/AtomicString.cpp: (WTF::CStringTranslator::equal): Moved an optimized method to here. (WTF::operator==): * wtf/text/StringImpl.cpp: (WTF::equal): * wtf/text/StringImpl.h: Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.exp trunk/Source/_javascript_Core/runtime/Identifier.cpp trunk/Source/_javascript_Core/runtime/Identifier.h trunk/Source/_javascript_Core/wtf/text/AtomicString.cpp trunk/Source/_javascript_Core/wtf/text/AtomicString.h trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (94474 => 94475) --- trunk/Source/_javascript_Core/ChangeLog 2011-09-03 01:06:27 UTC (rev 94474) +++ trunk/Source/_javascript_Core/ChangeLog 2011-09-03 01:08:10 UTC (rev 94475) @@ -1,5 +1,28 @@ 2011-09-02 Michael Saboff msab...@apple.com +Replace local implementation of string equals() methods with UString versions +https://bugs.webkit.org/show_bug.cgi?id=67342 + +In preparation to allowing StringImpl to be backed by 8 bit +characters when appropriate, we need to eliminate or change the +usage of StringImpl::characters(). Change the uses of characters() +that are used to implement redundant equals() methods. + +Reviewed by Gavin Barraclough. + +* runtime/Identifier.cpp: +(JSC::Identifier::equal): +* runtime/Identifier.h: +(JSC::Identifier::equal): +* wtf/text/AtomicString.cpp: +(WTF::CStringTranslator::equal): Moved an optimized method to here. +(WTF::operator==): +* wtf/text/StringImpl.cpp: +(WTF::equal): +* wtf/text/StringImpl.h: + +2011-09-02 Michael Saboff msab...@apple.com + Add JSC:RegExp functional tests https://bugs.webkit.org/show_bug.cgi?id=67339 Modified: trunk/Source/_javascript_Core/_javascript_Core.exp (94474 => 94475) --- trunk/Source/_javascript_Core/_javascript_Core.exp 2011-09-03 01:06:27 UTC (rev 94474) +++ trunk/Source/_javascript_Core/_javascript_Core.exp 2011-09-03 01:08:10 UTC (rev 94475) @@ -108,7 +108,6 @@ __ZN3JSC10Identifier3addEPNS_9ExecStateEPKc __ZN3JSC10Identifier4fromEPNS_9ExecStateEi __ZN3JSC10Identifier4fromEPNS_9ExecStateEj -__ZN3JSC10Identifier5equalEPKN3WTF10StringImplEPKc __ZN3JSC10Identifier8toUInt32ERKNS_7UStringERb __ZN3JSC10JSFunction14finishCreationEPNS_9ExecStateEPNS_14JSGlobalObjectEPNS_18FunctionExecutableEPNS_14ScopeChainNodeE __ZN3JSC10JSFunction14finishCreationEPNS_9ExecStateEPNS_14JSGlobalObjectEiRKNS_10IdentifierEPNS_14ExecutableBaseE @@ -477,6 +476,7 @@ __ZN3WTF5MutexC1Ev __ZN3WTF5MutexD1Ev __ZN3WTF5equalEPKNS_10StringImplEPKc +__ZN3WTF5equalEPKNS_10StringImplEPKtj __ZN3WTF5equalEPKNS_10StringImplES2_ __ZN3WTF5yieldEv __ZN3WTF6String26fromUTF8WithLatin1FallbackEPKcm @@ -524,8 +524,6 @@ __ZN3WTF9dayInYearEdi __ZN3WTF9emptyAtomE __ZN3WTF9xmlnsAtomE -__ZN3WTFeqERKNS_12AtomicStringEPKc -__ZN3WTFeqERKNS_12AtomicStringERKNS_6VectorItLm0EEE __ZN3WTFeqERKNS_7CStringES2_ __ZNK3JSC10JSFunction23isHostFunctionNonInlineEv __ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_10JSFunctionE Modified: trunk/Source/_javascript_Core/runtime/Identifier.cpp (94474 => 94475) --- trunk/Source/_javascript_Core/runtime/Identifier.cpp 2011-09-03 01:06:27 UTC (rev 94474) +++ trunk/Source/_javascript_Core/runtime/Identifier.cpp 2011-09-03 01:08:10 UTC (rev 94475) @@ -67,16 +67,6 @@ delete table; } -bool Identifier::equal(const StringImpl* r, const char* s) -{ -int length = r-length(); -const UChar* d = r-characters(); -for (int i = 0; i != length; ++i) -if (d[i] != (unsigned char)s[i]) -return false; -return s[length] == 0; -} - struct IdentifierCStringTranslator { static unsigned hash(const char* c) { Modified: trunk/Source/_javascript_Core/runtime/Identifier.h (94474 => 94475) --- trunk/Source/_javascript_Core/runtime/Identifier.h 2011-09-03 01:06:27 UTC (rev 94474) +++ trunk/Source/_javascript_Core/runtime/Identifier.h 2011-09-03 01:08:10 UTC (rev 94475) @@ -135,15 +135,14 @@ return !Identifier::equal(a, b); } +inline bool Identifier::equal(const StringImpl* r, const char* s) +{ +return
[webkit-changes] [88823] trunk/Source/WebCore
Title: [88823] trunk/Source/WebCore Revision 88823 Author msab...@apple.com Date 2011-06-14 10:54:55 -0700 (Tue, 14 Jun 2011) Log Message 2011-06-14 Michael Saboff msab...@apple.com Reviewed by Joseph Pecoraro. Incorrect #if[n]def for building without DISPATCH_VM_PRESSURE https://bugs.webkit.org/show_bug.cgi?id=62649 The #ifdef DISPATCH_VM_PRESSURE actually needs to be #ifndef to handle when DISPATCH_VM_PRESSURE is NOT defined in the system header files. No functional changes, fixing build issue therefore no tests. * platform/mac/MemoryPressureHandlerMac.mm: Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (88822 => 88823) --- trunk/Source/WebCore/ChangeLog 2011-06-14 17:44:45 UTC (rev 88822) +++ trunk/Source/WebCore/ChangeLog 2011-06-14 17:54:55 UTC (rev 88823) @@ -1,3 +1,18 @@ +2011-06-14 Michael Saboff msab...@apple.com + +Reviewed by Joseph Pecoraro. + +Incorrect #if[n]def for building without DISPATCH_VM_PRESSURE +https://bugs.webkit.org/show_bug.cgi?id=62649 + +The #ifdef DISPATCH_VM_PRESSURE actually needs to be #ifndef +to handle when DISPATCH_VM_PRESSURE is NOT defined in the +system header files. + +No functional changes, fixing build issue therefore no tests. + +* platform/mac/MemoryPressureHandlerMac.mm: + 2011-06-13 Adrienne Walker e...@google.com Reviewed by James Robinson. Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (88822 => 88823) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-14 17:44:45 UTC (rev 88822) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-14 17:54:55 UTC (rev 88823) @@ -40,7 +40,7 @@ DISPATCH_EXPORT const struct dispatch_source_type_s _dispatch_source_type_vm; #endif -#ifdef DISPATCH_VM_PRESSURE +#ifndef DISPATCH_VM_PRESSURE enum { DISPATCH_VM_PRESSURE = 0x8000, }; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [88871] trunk/Source/WebCore
Title: [88871] trunk/Source/WebCore Revision 88871 Author msab...@apple.com Date 2011-06-14 16:29:51 -0700 (Tue, 14 Jun 2011) Log Message 2011-06-14 Michael Saboff msab...@apple.com Reviewed by Joseph Pecoraro. Incorrect #if[n]def for building without DISPATCH_VM_PRESSURE https://bugs.webkit.org/show_bug.cgi?id=62649 Take 2. The #ifdef DISPATCH_VM_PRESSURE doesn't work. Combined the code inside this #ifdef with the prior #ifndef DISPATCH_SOURCE_TYPE_VM. No functional changes, fixing build issue therefore no tests. * platform/mac/MemoryPressureHandlerMac.mm: Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (88870 => 88871) --- trunk/Source/WebCore/ChangeLog 2011-06-14 23:25:45 UTC (rev 88870) +++ trunk/Source/WebCore/ChangeLog 2011-06-14 23:29:51 UTC (rev 88871) @@ -1,3 +1,18 @@ +2011-06-14 Michael Saboff msab...@apple.com + +Reviewed by Joseph Pecoraro. + +Incorrect #if[n]def for building without DISPATCH_VM_PRESSURE +https://bugs.webkit.org/show_bug.cgi?id=62649 + +Take 2. +The #ifdef DISPATCH_VM_PRESSURE doesn't work. Combined the code +inside this #ifdef with the prior #ifndef DISPATCH_SOURCE_TYPE_VM. + +No functional changes, fixing build issue therefore no tests. + +* platform/mac/MemoryPressureHandlerMac.mm: + 2011-06-14 Jeffrey Pfau jp...@apple.com Reviewed by David Hyatt. Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (88870 => 88871) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-14 23:25:45 UTC (rev 88870) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-14 23:29:51 UTC (rev 88871) @@ -38,9 +38,7 @@ #ifndef DISPATCH_SOURCE_TYPE_VM #define DISPATCH_SOURCE_TYPE_VM (_dispatch_source_type_vm) DISPATCH_EXPORT const struct dispatch_source_type_s _dispatch_source_type_vm; -#endif -#ifdef DISPATCH_VM_PRESSURE enum { DISPATCH_VM_PRESSURE = 0x8000, }; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [89214] trunk/Source/WebCore
Title: [89214] trunk/Source/WebCore Revision 89214 Author msab...@apple.com Date 2011-06-19 05:55:20 -0700 (Sun, 19 Jun 2011) Log Message 2011-06-19 Michael Saboff msab...@apple.com Reviewed by Darin Adler. Add notify handler to trigger MemoryPressureHandler in all builds https://bugs.webkit.org/show_bug.cgi?id=62679 Removed SIGUSR2 trigger and added a notify trigger for the MemoryPressureHandler. The notify trigger is enabled for all builds. No test added as only added new memory pressure trigger. * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::install): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (89213 => 89214) --- trunk/Source/WebCore/ChangeLog 2011-06-19 10:53:03 UTC (rev 89213) +++ trunk/Source/WebCore/ChangeLog 2011-06-19 12:55:20 UTC (rev 89214) @@ -1,3 +1,18 @@ +2011-06-19 Michael Saboff msab...@apple.com + +Reviewed by Darin Adler. + +Add notify handler to trigger MemoryPressureHandler in all builds +https://bugs.webkit.org/show_bug.cgi?id=62679 + +Removed SIGUSR2 trigger and added a notify trigger for the +MemoryPressureHandler. The notify trigger is enabled for all builds. + +No test added as only added new memory pressure trigger. + +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore::MemoryPressureHandler::install): + 2011-06-19 Robert Hogan rob...@webkit.org Reviewed by Alexey Proskuryakov. Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (89213 => 89214) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-19 10:53:03 UTC (rev 89213) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-06-19 12:55:20 UTC (rev 89214) @@ -34,6 +34,7 @@ #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) #import dispatch/dispatch.h +#import notify.h #ifndef DISPATCH_SOURCE_TYPE_VM #define DISPATCH_SOURCE_TYPE_VM (_dispatch_source_type_vm) @@ -51,12 +52,11 @@ #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) static dispatch_source_t _cache_event_source = 0; -#ifndef NDEBUG -static dispatch_source_t _cache_event_source2 = 0; -#endif void MemoryPressureHandler::install() { +static int notifyToken; + if (m_installed) return; @@ -69,17 +69,8 @@ } }); -#ifndef NDEBUG -dispatch_async(dispatch_get_main_queue(), ^{ -_cache_event_source2 = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGUSR2, 0, dispatch_get_main_queue()); -if (_cache_event_source2) { -dispatch_set_context(_cache_event_source2, this); -dispatch_source_set_event_handler(_cache_event_source2, ^{ memoryPressureHandler().respondToMemoryPressure();}); -dispatch_resume(_cache_event_source2); -signal((int)SIGUSR2, SIG_IGN); -} -}); -#endif +notify_register_dispatch(org.WebKit.lowMemory, notifyToken, + dispatch_get_main_queue(), ^(int) { memoryPressureHandler().respondToMemoryPressure();}); m_installed = true; } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [89425] trunk/Source/WebCore
Title: [89425] trunk/Source/WebCore Revision 89425 Author msab...@apple.com Date 2011-06-22 06:34:59 -0700 (Wed, 22 Jun 2011) Log Message 2011-06-21 Michael Saboff msab...@apple.com Reviewed by Adam Roben. REGRESSION (r88260): Assertion failure in FontCache::getCachedFontData when typing in Safari's address field https://bugs.webkit.org/show_bug.cgi?id=63078 Added FontCachePurgePreventer in WebCore::WebCoreTextFloatWidth to handle assertion failure when typing in address field on windows. Investigated other possible code paths that need purge prevention. Added FontCachePurgeProtection to WebCore::createDragImageForLink and WebCore::doDrawTextAtPoint. No change to functionality, therefore no new tests. * platform/win/DragImageWin.cpp: (WebCore::createDragImageForLink): * platform/win/WebCoreTextRenderer.cpp: (WebCore::doDrawTextAtPoint): (WebCore::WebCoreTextFloatWidth): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/win/DragImageWin.cpp trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (89424 => 89425) --- trunk/Source/WebCore/ChangeLog 2011-06-22 12:31:49 UTC (rev 89424) +++ trunk/Source/WebCore/ChangeLog 2011-06-22 13:34:59 UTC (rev 89425) @@ -1,3 +1,24 @@ +2011-06-21 Michael Saboff msab...@apple.com + +Reviewed by Adam Roben. + +REGRESSION (r88260): Assertion failure in FontCache::getCachedFontData when typing in Safari's address field +https://bugs.webkit.org/show_bug.cgi?id=63078 + +Added FontCachePurgePreventer in WebCore::WebCoreTextFloatWidth to handle +assertion failure when typing in address field on windows. Investigated +other possible code paths that need purge prevention. Added +FontCachePurgeProtection to WebCore::createDragImageForLink and +WebCore::doDrawTextAtPoint. + +No change to functionality, therefore no new tests. + +* platform/win/DragImageWin.cpp: +(WebCore::createDragImageForLink): +* platform/win/WebCoreTextRenderer.cpp: +(WebCore::doDrawTextAtPoint): +(WebCore::WebCoreTextFloatWidth): + 2011-06-22 Darin Adler da...@apple.com Reviewed by Sam Weinig. Modified: trunk/Source/WebCore/platform/win/DragImageWin.cpp (89424 => 89425) --- trunk/Source/WebCore/platform/win/DragImageWin.cpp 2011-06-22 12:31:49 UTC (rev 89424) +++ trunk/Source/WebCore/platform/win/DragImageWin.cpp 2011-06-22 13:34:59 UTC (rev 89425) @@ -28,6 +28,7 @@ #include CachedImage.h #include Font.h +#include FontCache.h #include FontDescription.h #include FontSelector.h #include Frame.h @@ -130,6 +131,7 @@ const Font* labelFont; const Font* urlFont; +FontCachePurgePreventer fontCachePurgePreventer; if (frame-settings() frame-settings()-fontRenderingMode() == AlternateRenderingMode) { static const Font alternateRenderingModeLabelFont = dragLabelFont(DragLinkLabelFontsize, true, AlternateRenderingMode); Modified: trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp (89424 => 89425) --- trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp 2011-06-22 12:31:49 UTC (rev 89424) +++ trunk/Source/WebCore/platform/win/WebCoreTextRenderer.cpp 2011-06-22 13:34:59 UTC (rev 89425) @@ -26,6 +26,7 @@ #include WebCoreTextRenderer.h #include Font.h +#include FontCache.h #include FontDescription.h #include GraphicsContext.h #include StringTruncator.h @@ -48,6 +49,8 @@ static void doDrawTextAtPoint(GraphicsContext context, const String text, const IntPoint point, const Font font, const Color color, int underlinedIndex) { +FontCachePurgePreventer fontCachePurgePreventer; + TextRun run(text.characters(), text.length()); context.setFillColor(color, ColorSpaceDeviceRGB); @@ -101,6 +104,8 @@ float WebCoreTextFloatWidth(const String text, const Font font) { +FontCachePurgePreventer fontCachePurgePreventer; + return StringTruncator::width(text, font); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [90962] trunk
Title: [90962] trunk Revision 90962 Author msab...@apple.com Date 2011-07-13 16:05:40 -0700 (Wed, 13 Jul 2011) Log Message https://bugs.webkit.org/show_bug.cgi?id=64202 Enh: Improve handling of RegExp in the form of /.*blah.*/ Reviewed by Gavin Barraclough. ../../../../Volumes/Data/src/webkit/LayoutTests: New tests to support /.*_expression_.*/ enhancement. * fast/regex/dotstar-expected.txt: Added. * fast/regex/dotstar.html: Added. * fast/regex/script-tests/dotstar.js: Added. ../../../../Volumes/Data/src/webkit/Source/_javascript_Core: Added code to both the Yarr interpreter and JIT to handle these expressions a little differently. First off, the terms in between the leading and trailing .*'s cannot capture and also this enhancement is limited to single alternative expressions. If an _expression_ is of the right form with the aforementioned restrictions, we process the inner terms and then look for the beginning of the string and end of the string. There is handling for multiline expressions to allow the beginning and end to be right after and right before newlines. This enhancement speeds up expressions of this type 12x on a MacBookPro. Cleaned up 'case' statement indentation. A new set of tests was added as LayoutTests/fast/regex/dotstar.html * yarr/YarrInterpreter.cpp: (JSC::Yarr::Interpreter::InputStream::end): (JSC::Yarr::Interpreter::matchDotStarEnclosure): (JSC::Yarr::Interpreter::matchDisjunction): (JSC::Yarr::ByteCompiler::assertionDotStarEnclosure): (JSC::Yarr::ByteCompiler::emitDisjunction): * yarr/YarrInterpreter.h: (JSC::Yarr::ByteTerm::DotStarEnclosure): * yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::generateDotStarEnclosure): (JSC::Yarr::YarrGenerator::backtrackDotStarEnclosure): (JSC::Yarr::YarrGenerator::generateTerm): (JSC::Yarr::YarrGenerator::backtrackTerm): * yarr/YarrPattern.cpp: (JSC::Yarr::YarrPatternConstructor::setupAlternativeOffsets): (JSC::Yarr::YarrPatternConstructor::containsCapturingTerms): (JSC::Yarr::YarrPatternConstructor::optimizeDotStarWrappedExpressions): (JSC::Yarr::YarrPattern::compile): * yarr/YarrPattern.h: (JSC::Yarr::PatternTerm::PatternTerm): Modified Paths trunk/LayoutTests/ChangeLog trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp trunk/Source/_javascript_Core/yarr/YarrInterpreter.h trunk/Source/_javascript_Core/yarr/YarrJIT.cpp trunk/Source/_javascript_Core/yarr/YarrPattern.cpp trunk/Source/_javascript_Core/yarr/YarrPattern.h Added Paths trunk/LayoutTests/fast/regex/dotstar-expected.txt trunk/LayoutTests/fast/regex/dotstar.html trunk/LayoutTests/fast/regex/script-tests/dotstar.js Diff Modified: trunk/LayoutTests/ChangeLog (90961 => 90962) --- trunk/LayoutTests/ChangeLog 2011-07-13 23:00:52 UTC (rev 90961) +++ trunk/LayoutTests/ChangeLog 2011-07-13 23:05:40 UTC (rev 90962) @@ -1,3 +1,16 @@ +2011-07-13 Michael Saboff msab...@apple.com + +https://bugs.webkit.org/show_bug.cgi?id=64202 +Enh: Improve handling of RegExp in the form of /.*blah.*/ + +Reviewed by Gavin Barraclough. + +New tests to support /.*_expression_.*/ enhancement. + +* fast/regex/dotstar-expected.txt: Added. +* fast/regex/dotstar.html: Added. +* fast/regex/script-tests/dotstar.js: Added. + 2011-07-13 Vincent Scheib sch...@chromium.org [chromium] Update chromium test expectations. Added: trunk/LayoutTests/fast/regex/dotstar-expected.txt (0 => 90962) --- trunk/LayoutTests/fast/regex/dotstar-expected.txt (rev 0) +++ trunk/LayoutTests/fast/regex/dotstar-expected.txt 2011-07-13 23:05:40 UTC (rev 90962) @@ -0,0 +1,118 @@ +This page tests handling of parentheses subexpressions. + +On success, you will see a series of PASS messages, followed by TEST COMPLETE. + + +PASS regexp1.exec('test') is null +PASS regexp1.exec('blah') is ['blah'] +PASS regexp1.exec('1blah') is ['1blah'] +PASS regexp1.exec('blah1') is ['blah1'] +PASS regexp1.exec('blah blah blah') is ['blah blah blah'] +PASS regexp1.exec('blah\nsecond') is ['blah'] +PASS regexp1.exec('first\nblah') is ['blah'] +PASS regexp1.exec('first\nblah\nthird') is ['blah'] +PASS regexp1.exec('first\nblah2\nblah3') is ['blah2'] +PASS regexp2.exec('test') is null +PASS regexp2.exec('blah') is ['blah'] +PASS regexp2.exec('1blah') is ['1blah'] +PASS regexp2.exec('blah1') is ['blah1'] +PASS regexp2.exec('blah blah blah') is ['blah blah blah'] +PASS regexp2.exec('blah\nsecond') is ['blah'] +PASS regexp2.exec('first\nblah') is null +PASS regexp2.exec('first\nblah\nthird') is null +PASS regexp2.exec('first\nblah2\nblah3') is null +PASS regexp3.exec('test') is null +PASS regexp3.exec('blah') is ['blah'] +PASS regexp3.exec('1blah') is ['1blah'] +PASS regexp3.exec('blah1') is ['blah1'] +PASS regexp3.exec('blah blah blah') is ['blah blah blah'] +PASS regexp3.exec('blah\nsecond') is null +PASS regexp3.exec('first\nblah') is ['blah'] +PASS regexp3.exec('first\nblah\nthird') is null +PASS
[webkit-changes] [92231] trunk/Source
Title: [92231] trunk/Source Revision 92231 Author msab...@apple.com Date 2011-08-02 14:19:05 -0700 (Tue, 02 Aug 2011) Log Message Virtual copying of FastMalloc allocated memory causes madvise MADV_FREE_REUSABLE errors https://bugs.webkit.org/show_bug.cgi?id=65502 Reviewed by Anders Carlsson. Source/_javascript_Core: With the fix of the issues causing madvise MADV_FREE_REUSABLE to fail, added an assert to the return code of madvise to catch any regressions. * wtf/TCSystemAlloc.cpp: (TCMalloc_SystemRelease): Source/WebCore: Change the vm_copy in PurgeableBuffer::create to be a memcpy. The vm_copy causes the process to have additional references to the same memory region. These additional reference caused madvise(MADV_FREE_REUSABLE) to fail when it encountered such pages. No tests added this is a resource defect and not a functional issue. * platform/mac/PurgeableBufferMac.cpp: (WebCore::PurgeableBuffer::create): Source/WebKit2: Changed OOL message to use MACH_MSG_PHYSICAL_COPY flag instead of virtual flag so that the original memory region isn't referenced by the message and ultimately the receiving process. The additional reference caused madvise(MADV_FREE_REUSABLE) to fail when it encountered such pages. * Platform/CoreIPC/mac/ConnectionMac.cpp: (CoreIPC::Connection::sendOutgoingMessage): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/TCSystemAlloc.cpp trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/PurgeableBufferMac.cpp trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (92230 => 92231) --- trunk/Source/_javascript_Core/ChangeLog 2011-08-02 21:13:05 UTC (rev 92230) +++ trunk/Source/_javascript_Core/ChangeLog 2011-08-02 21:19:05 UTC (rev 92231) @@ -1,3 +1,16 @@ +2011-08-01 Michael Saboff msab...@apple.com + +Virtual copying of FastMalloc allocated memory causes madvise MADV_FREE_REUSABLE errors +https://bugs.webkit.org/show_bug.cgi?id=65502 + +Reviewed by Anders Carlsson. + +With the fix of the issues causing madvise MADV_FREE_REUSABLE to fail, +added an assert to the return code of madvise to catch any regressions. + +* wtf/TCSystemAlloc.cpp: +(TCMalloc_SystemRelease): + 2011-08-02 Anders Carlsson ander...@apple.com Fix Windows build. Modified: trunk/Source/_javascript_Core/wtf/TCSystemAlloc.cpp (92230 => 92231) --- trunk/Source/_javascript_Core/wtf/TCSystemAlloc.cpp 2011-08-02 21:13:05 UTC (rev 92230) +++ trunk/Source/_javascript_Core/wtf/TCSystemAlloc.cpp 2011-08-02 21:19:05 UTC (rev 92231) @@ -392,7 +392,12 @@ void TCMalloc_SystemRelease(void* start, size_t length) { -while (madvise(start, length, MADV_FREE_REUSABLE) == -1 errno == EAGAIN) { } +int madviseResult; + +while ((madviseResult = madvise(start, length, MADV_FREE_REUSABLE)) == -1 errno == EAGAIN) { } + +// Although really advisory, if madvise fail, we want to know about it. +ASSERT_UNUSED(madviseResult, madviseResult != -1); } #elif HAVE(MADV_FREE) || HAVE(MADV_DONTNEED) Modified: trunk/Source/WebCore/ChangeLog (92230 => 92231) --- trunk/Source/WebCore/ChangeLog 2011-08-02 21:13:05 UTC (rev 92230) +++ trunk/Source/WebCore/ChangeLog 2011-08-02 21:19:05 UTC (rev 92231) @@ -1,3 +1,20 @@ +2011-08-01 Michael Saboff msab...@apple.com + +Virtual copying of FastMalloc allocated memory causes madvise MADV_FREE_REUSABLE errors +https://bugs.webkit.org/show_bug.cgi?id=65502 + +Reviewed by Anders Carlsson. + +Change the vm_copy in PurgeableBuffer::create to be a memcpy. The +vm_copy causes the process to have additional references to the same +memory region. These additional reference caused madvise(MADV_FREE_REUSABLE) +to fail when it encountered such pages. + +No tests added this is a resource defect and not a functional issue. + +* platform/mac/PurgeableBufferMac.cpp: +(WebCore::PurgeableBuffer::create): + 2011-08-02 Stephen White senorbla...@chromium.org [Chromium] Remove an unnecessary readback during accelerated Modified: trunk/Source/WebCore/platform/mac/PurgeableBufferMac.cpp (92230 => 92231) --- trunk/Source/WebCore/platform/mac/PurgeableBufferMac.cpp 2011-08-02 21:13:05 UTC (rev 92230) +++ trunk/Source/WebCore/platform/mac/PurgeableBufferMac.cpp 2011-08-02 21:19:05 UTC (rev 92231) @@ -64,14 +64,8 @@ if (ret != KERN_SUCCESS) return nullptr; -ret = vm_copy(mach_task_self(), reinterpret_castvm_address_t(data), size, buffer); +memcpy(reinterpret_castchar*(buffer), data, size); -ASSERT(ret == KERN_SUCCESS); -if (ret != KERN_SUCCESS) { -vm_deallocate(mach_task_self(), buffer, size); -return nullptr; -} - return adoptPtr(new PurgeableBuffer(reinterpret_castchar*(buffer), size)); } Modified:
[webkit-changes] [99608] trunk/Source/JavaScriptCore
Title: [99608] trunk/Source/_javascript_Core Revision 99608 Author msab...@apple.com Date 2011-11-08 12:37:52 -0800 (Tue, 08 Nov 2011) Log Message JSC::Parser::Parser leaks Lexer member https://bugs.webkit.org/show_bug.cgi?id=71847 Changed m_lexer member of Parser to be OwnPtr to fix a memory leak. Reviewed by Oliver Hunt. * parser/Parser.cpp: (JSC::Parser::Parser): (JSC::Parser::parseFunctionBody): * parser/Parser.h: Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/parser/Parser.cpp trunk/Source/_javascript_Core/parser/Parser.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (99607 => 99608) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-08 20:33:30 UTC (rev 99607) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-08 20:37:52 UTC (rev 99608) @@ -1,3 +1,17 @@ +2011-11-08 Michael Saboff msab...@apple.com + +JSC::Parser::Parser leaks Lexer member +https://bugs.webkit.org/show_bug.cgi?id=71847 + +Changed m_lexer member of Parser to be OwnPtr to fix a memory leak. + +Reviewed by Oliver Hunt. + +* parser/Parser.cpp: +(JSC::Parser::Parser): +(JSC::Parser::parseFunctionBody): +* parser/Parser.h: + 2011-11-08 Yuqiang Xian yuqiang.x...@intel.com Enable DFG JIT by default on X86 Linux and Mac platforms Modified: trunk/Source/_javascript_Core/parser/Parser.cpp (99607 => 99608) --- trunk/Source/_javascript_Core/parser/Parser.cpp 2011-11-08 20:33:30 UTC (rev 99607) +++ trunk/Source/_javascript_Core/parser/Parser.cpp 2011-11-08 20:37:52 UTC (rev 99608) @@ -57,7 +57,7 @@ , m_lastIdentifier(0) , m_sourceElements(0) { -m_lexer = new LexerUChar(globalData); +m_lexer = adoptPtr(new LexerUChar(globalData)); m_arena = m_globalData-parserArena; m_lexer-setCode(source, m_arena); @@ -740,7 +740,7 @@ return context.createFunctionBody(m_lexer-lastLineNumber(), strictMode()); DepthManager statementDepth(m_statementDepth); m_statementDepth = 0; -typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_castJSGlobalData*(m_globalData), m_lexer); +typename TreeBuilder::FunctionBodyBuilder bodyBuilder(const_castJSGlobalData*(m_globalData), m_lexer.get()); failIfFalse(parseSourceElementsCheckForStrictMode(bodyBuilder)); return context.createFunctionBody(m_lexer-lastLineNumber(), strictMode()); } Modified: trunk/Source/_javascript_Core/parser/Parser.h (99607 => 99608) --- trunk/Source/_javascript_Core/parser/Parser.h 2011-11-08 20:33:30 UTC (rev 99607) +++ trunk/Source/_javascript_Core/parser/Parser.h 2011-11-08 20:37:52 UTC (rev 99608) @@ -920,7 +920,7 @@ mutable const JSGlobalData* m_globalData; const SourceCode* m_source; ParserArena* m_arena; -LexerUChar* m_lexer; +OwnPtr LexerUChar m_lexer; StackBounds m_stack; bool m_error; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [100167] trunk/Source/JavaScriptCore
Title: [100167] trunk/Source/_javascript_Core Revision 100167 Author msab...@apple.com Date 2011-11-14 11:25:40 -0800 (Mon, 14 Nov 2011) Log Message Towards 8 Bit Strings: Templatize YARR Parser https://bugs.webkit.org/show_bug.cgi?id=72288 Changed Yarr::Parser to be a template based on character type. Reviewed by Oliver Hunt. * yarr/YarrParser.h: (JSC::Yarr::Parser::Parser): (JSC::Yarr::parse): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/yarr/YarrParser.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100166 => 100167) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-14 19:23:36 UTC (rev 100166) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-14 19:25:40 UTC (rev 100167) @@ -1,3 +1,16 @@ +2011-11-14 Michael Saboff msab...@apple.com + +Towards 8 Bit Strings: Templatize YARR Parser +https://bugs.webkit.org/show_bug.cgi?id=72288 + +Changed Yarr::Parser to be a template based on character type. + +Reviewed by Oliver Hunt. + +* yarr/YarrParser.h: +(JSC::Yarr::Parser::Parser): +(JSC::Yarr::parse): + 2011-11-14 Geoffrey Garen gga...@apple.com 32-bit build fix: Removed unused declaration. Modified: trunk/Source/_javascript_Core/yarr/YarrParser.h (100166 => 100167) --- trunk/Source/_javascript_Core/yarr/YarrParser.h 2011-11-14 19:23:36 UTC (rev 100166) +++ trunk/Source/_javascript_Core/yarr/YarrParser.h 2011-11-14 19:25:40 UTC (rev 100167) @@ -43,7 +43,7 @@ }; // The Parser class should not be used directly - only via the Yarr::parse() method. -templateclass Delegate +templateclass Delegate, typename CharType class Parser { private: templateclass FriendDelegate @@ -231,13 +231,13 @@ : m_delegate(delegate) , m_backReferenceLimit(backReferenceLimit) , m_err(NoError) -, m_data(pattern.characters16()) +, m_data(pattern.getCharactersCharType()) , m_size(pattern.length()) , m_index(0) , m_parenthesesNestingDepth(0) { } - + /* * parseEscape(): * @@ -793,7 +793,7 @@ Delegate m_delegate; unsigned m_backReferenceLimit; ErrorCode m_err; -const UChar* m_data; +const CharType* m_data; unsigned m_size; unsigned m_index; unsigned m_parenthesesNestingDepth; @@ -864,7 +864,9 @@ templateclass Delegate const char* parse(Delegate delegate, const UString pattern, unsigned backReferenceLimit = quantifyInfinite) { -return ParserDelegate(delegate, pattern, backReferenceLimit).parse(); +if (pattern.is8Bit()) +return ParserDelegate, LChar(delegate, pattern, backReferenceLimit).parse(); +return ParserDelegate, UChar(delegate, pattern, backReferenceLimit).parse(); } } } // namespace JSC::Yarr ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [100195] trunk/Source/JavaScriptCore
Title: [100195] trunk/Source/_javascript_Core Revision 100195 Author msab...@apple.com Date 2011-11-14 14:42:36 -0800 (Mon, 14 Nov 2011) Log Message Towards 8 bit strings - Add 8 bit paths to StringImpl methods https://bugs.webkit.org/show_bug.cgi?id=72290 Added 8 bit patchs to StringImpl to number and find methods. Reviewed by Oliver Hunt. * wtf/text/StringImpl.cpp: (WTF::StringImpl::toIntStrict): (WTF::StringImpl::toUIntStrict): (WTF::StringImpl::toInt64Strict): (WTF::StringImpl::toUInt64Strict): (WTF::StringImpl::toIntPtrStrict): (WTF::StringImpl::toInt): (WTF::StringImpl::toUInt): (WTF::StringImpl::toInt64): (WTF::StringImpl::toUInt64): (WTF::StringImpl::toIntPtr): (WTF::StringImpl::toDouble): (WTF::StringImpl::toFloat): (WTF::StringImpl::find): (WTF::StringImpl::reverseFind): * wtf/text/WTFString.cpp: (WTF::toIntegralType): (WTF::lengthOfCharactersAsInteger): (WTF::charactersToIntStrict): (WTF::charactersToUIntStrict): (WTF::charactersToInt64Strict): (WTF::charactersToUInt64Strict): (WTF::charactersToIntPtrStrict): (WTF::charactersToInt): (WTF::charactersToUInt): (WTF::charactersToInt64): (WTF::charactersToUInt64): (WTF::charactersToIntPtr): (WTF::toDoubleType): (WTF::charactersToDouble): (WTF::charactersToFloat): * wtf/text/WTFString.h: (WTF::find): (WTF::reverseFind): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/text/WTFString.cpp trunk/Source/_javascript_Core/wtf/text/WTFString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100194 => 100195) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-14 22:39:48 UTC (rev 100194) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-14 22:42:36 UTC (rev 100195) @@ -1,3 +1,47 @@ +2011-11-14 Michael Saboff msab...@apple.com + +Towards 8 bit strings - Add 8 bit paths to StringImpl methods +https://bugs.webkit.org/show_bug.cgi?id=72290 + +Added 8 bit patchs to StringImpl to number and find methods. + +Reviewed by Oliver Hunt. + +* wtf/text/StringImpl.cpp: +(WTF::StringImpl::toIntStrict): +(WTF::StringImpl::toUIntStrict): +(WTF::StringImpl::toInt64Strict): +(WTF::StringImpl::toUInt64Strict): +(WTF::StringImpl::toIntPtrStrict): +(WTF::StringImpl::toInt): +(WTF::StringImpl::toUInt): +(WTF::StringImpl::toInt64): +(WTF::StringImpl::toUInt64): +(WTF::StringImpl::toIntPtr): +(WTF::StringImpl::toDouble): +(WTF::StringImpl::toFloat): +(WTF::StringImpl::find): +(WTF::StringImpl::reverseFind): +* wtf/text/WTFString.cpp: +(WTF::toIntegralType): +(WTF::lengthOfCharactersAsInteger): +(WTF::charactersToIntStrict): +(WTF::charactersToUIntStrict): +(WTF::charactersToInt64Strict): +(WTF::charactersToUInt64Strict): +(WTF::charactersToIntPtrStrict): +(WTF::charactersToInt): +(WTF::charactersToUInt): +(WTF::charactersToInt64): +(WTF::charactersToUInt64): +(WTF::charactersToIntPtr): +(WTF::toDoubleType): +(WTF::charactersToDouble): +(WTF::charactersToFloat): +* wtf/text/WTFString.h: +(WTF::find): +(WTF::reverseFind): + 2011-11-14 Vincent Scheib sch...@chromium.org Mouse Lock: Renaming to 'Pointer Lock': ENABLE Flags Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp (100194 => 100195) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2011-11-14 22:39:48 UTC (rev 100194) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2011-11-14 22:42:36 UTC (rev 100195) @@ -611,63 +611,85 @@ int StringImpl::toIntStrict(bool* ok, int base) { +if (is8Bit()) +return charactersToIntStrict(characters8(), m_length, ok, base); return charactersToIntStrict(characters16(), m_length, ok, base); } unsigned StringImpl::toUIntStrict(bool* ok, int base) { +if (is8Bit()) +return charactersToUIntStrict(characters8(), m_length, ok, base); return charactersToUIntStrict(characters16(), m_length, ok, base); } int64_t StringImpl::toInt64Strict(bool* ok, int base) { +if (is8Bit()) +return charactersToInt64Strict(characters8(), m_length, ok, base); return charactersToInt64Strict(characters16(), m_length, ok, base); - } uint64_t StringImpl::toUInt64Strict(bool* ok, int base) { +if (is8Bit()) +return charactersToUInt64Strict(characters8(), m_length, ok, base); return charactersToUInt64Strict(characters16(), m_length, ok, base); } intptr_t StringImpl::toIntPtrStrict(bool* ok, int base) { +if (is8Bit()) +return charactersToIntPtrStrict(characters8(), m_length, ok, base); return charactersToIntPtrStrict(characters16(), m_length, ok, base); } int StringImpl::toInt(bool* ok) { +if (is8Bit()) +return charactersToInt(characters8(),
[webkit-changes] [100202] trunk/Source/JavaScriptCore
Title: [100202] trunk/Source/_javascript_Core Revision 100202 Author msab...@apple.com Date 2011-11-14 15:51:06 -0800 (Mon, 14 Nov 2011) Log Message Towards 8 bit strings - Add 8 bit handling to JSString Ropes https://bugs.webkit.org/show_bug.cgi?id=72317 Added bit to track that a rope is made up of all 8 bit fibers. Created an 8 bit path (fast and slow cases) to handle 8 bit only ropes. Reviewed by Oliver Hunt. * runtime/JSString.cpp: (JSC::JSString::resolveRope): (JSC::JSString::resolveRopeSlowCase8): (JSC::JSString::resolveRopeSlowCase16): * runtime/JSString.h: (JSC::RopeBuilder::finishCreation): (JSC::RopeBuilder::is8Bit): (JSC::jsSubstring8): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSString.cpp trunk/Source/_javascript_Core/runtime/JSString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100201 => 100202) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-14 23:33:30 UTC (rev 100201) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-14 23:51:06 UTC (rev 100202) @@ -1,3 +1,23 @@ +2011-11-14 Michael Saboff msab...@apple.com + +Towards 8 bit strings - Add 8 bit handling to JSString Ropes +https://bugs.webkit.org/show_bug.cgi?id=72317 + +Added bit to track that a rope is made up of all 8 bit fibers. +Created an 8 bit path (fast and slow cases) to handle 8 bit +only ropes. + +Reviewed by Oliver Hunt. + +* runtime/JSString.cpp: +(JSC::JSString::resolveRope): +(JSC::JSString::resolveRopeSlowCase8): +(JSC::JSString::resolveRopeSlowCase16): +* runtime/JSString.h: +(JSC::RopeBuilder::finishCreation): +(JSC::RopeBuilder::is8Bit): +(JSC::jsSubstring8): + 2011-11-14 Geoffrey Garen gga...@apple.com A little bit of function call cleanup Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (100201 => 100202) --- trunk/Source/_javascript_Core/runtime/JSString.cpp 2011-11-14 23:33:30 UTC (rev 100201) +++ trunk/Source/_javascript_Core/runtime/JSString.cpp 2011-11-14 23:51:06 UTC (rev 100202) @@ -62,6 +62,34 @@ { ASSERT(isRope()); +if (is8Bit()) { +LChar* buffer; +if (PassRefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) +m_value = newImpl; +else { +outOfMemory(exec); +return; +} + +for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { +if (m_fibers[i]-isRope()) +return resolveRopeSlowCase(exec, buffer); +} + +LChar* position = buffer; +for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { +StringImpl* string = m_fibers[i]-m_value.impl(); +unsigned length = string-length(); +StringImpl::copyChars(position, string-characters8(), length); +position += length; +m_fibers[i].clear(); +} +ASSERT((buffer + m_length) == position); +ASSERT(!isRope()); + +return; +} + UChar* buffer; if (PassRefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) m_value = newImpl; @@ -79,7 +107,7 @@ for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { StringImpl* string = m_fibers[i]-m_value.impl(); unsigned length = string-length(); -StringImpl::copyChars(position, string-characters16(), length); +StringImpl::copyChars(position, string-characters(), length); position += length; m_fibers[i].clear(); } @@ -87,7 +115,7 @@ ASSERT(!isRope()); } -// Overview: this methods converts a JSString from holding a string in rope form +// Overview: These functions convert a JSString from holding a string in rope form // down to a simple UString representation. It does so by building up the string // backwards, since we want to avoid recursion, we expect that the tree structure // representing the rope is likely imbalanced with more nodes down the left side @@ -97,11 +125,11 @@ // Vector before performing any concatenation, but by working backwards we likely // only fill the queue with the number of substrings at any given level in a // rope-of-ropes.) -void JSString::resolveRopeSlowCase(ExecState* exec, UChar* buffer) const +void JSString::resolveRopeSlowCase(ExecState* exec, LChar* buffer) const { UNUSED_PARAM(exec); -UChar* position = buffer + m_length; // We will be working backwards over the rope. +LChar* position = buffer + m_length; // We will be working backwards over the rope. VectorJSString*, 32 workQueue; // Putting strings into a Vector is only OK because there are no GC points in this method. for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { @@ -123,13 +151,43 @@ StringImpl* string = static_castStringImpl*(currentFiber-m_value.impl());
[webkit-changes] [100208] trunk/Source/JavaScriptCore
Title: [100208] trunk/Source/_javascript_Core Revision 100208 Author msab...@apple.com Date 2011-11-14 16:16:59 -0800 (Mon, 14 Nov 2011) Log Message Further changes and cleanup to JSString.h and cpp. Reviewed by Darin Adler. * runtime/JSString.cpp: (JSC::JSString::resolveRope): Change PassRefPtr to RefPtr. Eliminated exec in slow case calls. (JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name. (JSC::JSString::resolveRopeSlowCase): Removed exec parameter. * runtime/JSString.h: Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSString.cpp trunk/Source/_javascript_Core/runtime/JSString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100207 => 100208) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-15 00:12:56 UTC (rev 100207) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-15 00:16:59 UTC (rev 100208) @@ -1,3 +1,15 @@ +2011-11-14 Michael Saboff msab...@apple.com + +Further changes and cleanup to JSString.h and cpp. + +Reviewed by Darin Adler. + +* runtime/JSString.cpp: +(JSC::JSString::resolveRope): Change PassRefPtr to RefPtr. Eliminated exec in slow case calls. +(JSC::JSString::resolveRopeSlowCase8): Darin and I agreed that this should have 8 in name. +(JSC::JSString::resolveRopeSlowCase): Removed exec parameter. +* runtime/JSString.h: + 2011-11-14 Adam Barth aba...@webkit.org DateMath.cpp should not depend on _javascript_Core Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (100207 => 100208) --- trunk/Source/_javascript_Core/runtime/JSString.cpp 2011-11-15 00:12:56 UTC (rev 100207) +++ trunk/Source/_javascript_Core/runtime/JSString.cpp 2011-11-15 00:16:59 UTC (rev 100208) @@ -64,8 +64,8 @@ if (is8Bit()) { LChar* buffer; -if (PassRefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) -m_value = newImpl; +if (RefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) +m_value = newImpl.release(); else { outOfMemory(exec); return; @@ -73,7 +73,7 @@ for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { if (m_fibers[i]-isRope()) -return resolveRopeSlowCase(exec, buffer); +return resolveRopeSlowCase8(buffer); } LChar* position = buffer; @@ -91,8 +91,8 @@ } UChar* buffer; -if (PassRefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) -m_value = newImpl; +if (RefPtrStringImpl newImpl = StringImpl::tryCreateUninitialized(m_length, buffer)) +m_value = newImpl.release(); else { outOfMemory(exec); return; @@ -100,7 +100,7 @@ for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { if (m_fibers[i]-isRope()) -return resolveRopeSlowCase(exec, buffer); +return resolveRopeSlowCase(buffer); } UChar* position = buffer; @@ -125,10 +125,8 @@ // Vector before performing any concatenation, but by working backwards we likely // only fill the queue with the number of substrings at any given level in a // rope-of-ropes.) -void JSString::resolveRopeSlowCase(ExecState* exec, LChar* buffer) const +void JSString::resolveRopeSlowCase8(LChar* buffer) const { -UNUSED_PARAM(exec); - LChar* position = buffer + m_length; // We will be working backwards over the rope. VectorJSString*, 32 workQueue; // Putting strings into a Vector is only OK because there are no GC points in this method. @@ -158,10 +156,8 @@ ASSERT(!isRope()); } -void JSString::resolveRopeSlowCase(ExecState* exec, UChar* buffer) const +void JSString::resolveRopeSlowCase(UChar* buffer) const { -UNUSED_PARAM(exec); - UChar* position = buffer + m_length; // We will be working backwards over the rope. VectorJSString*, 32 workQueue; // These strings are kept alive by the parent rope, so using a Vector is OK. Modified: trunk/Source/_javascript_Core/runtime/JSString.h (100207 => 100208) --- trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-15 00:12:56 UTC (rev 100207) +++ trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-15 00:16:59 UTC (rev 100208) @@ -248,8 +248,8 @@ } void resolveRope(ExecState*) const; -void resolveRopeSlowCase(ExecState*, LChar*) const; -void resolveRopeSlowCase(ExecState*, UChar*) const; +void resolveRopeSlowCase8(LChar*) const; +void resolveRopeSlowCase(UChar*) const; void outOfMemory(ExecState*) const; static JSObject* toThisObject(JSCell*, ExecState*); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [100314] trunk/Source/JavaScriptCore
Title: [100314] trunk/Source/_javascript_Core Revision 100314 Author msab...@apple.com Date 2011-11-15 13:38:35 -0800 (Tue, 15 Nov 2011) Log Message Towards 8 bit Strings - Initial JS String Tuning https://bugs.webkit.org/show_bug.cgi?id=72326 Added 8 bit optimized paths for the methods below. Reviewed by Geoffrey Garen. * runtime/JSString.h: (JSC::jsSubstring8): * runtime/StringPrototype.cpp: (JSC::jsSpliceSubstrings): (JSC::jsSpliceSubstringsWithSeparators): (JSC::stringProtoFuncReplace): (JSC::stringProtoFuncCharCodeAt): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSString.h trunk/Source/_javascript_Core/runtime/StringPrototype.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100313 => 100314) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-15 21:03:52 UTC (rev 100313) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-15 21:38:35 UTC (rev 100314) @@ -1,3 +1,20 @@ +2011-11-15 Michael Saboff msab...@apple.com + +Towards 8 bit Strings - Initial JS String Tuning +https://bugs.webkit.org/show_bug.cgi?id=72326 + +Added 8 bit optimized paths for the methods below. + +Reviewed by Geoffrey Garen. + +* runtime/JSString.h: +(JSC::jsSubstring8): +* runtime/StringPrototype.cpp: +(JSC::jsSpliceSubstrings): +(JSC::jsSpliceSubstringsWithSeparators): +(JSC::stringProtoFuncReplace): +(JSC::stringProtoFuncCharCodeAt): + 2011-11-15 Gavin Barraclough barraclo...@apple.com Result of Error.prototype.toString not ES5 conformant Modified: trunk/Source/_javascript_Core/runtime/JSString.h (100313 => 100314) --- trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-15 21:03:52 UTC (rev 100313) +++ trunk/Source/_javascript_Core/runtime/JSString.h 2011-11-15 21:38:35 UTC (rev 100314) @@ -363,6 +363,21 @@ return jsSubstring(globalData, s-value(exec), offset, length); } +inline JSString* jsSubstring8(JSGlobalData* globalData, const UString s, unsigned offset, unsigned length) +{ +ASSERT(offset = static_castunsigned(s.length())); +ASSERT(length = static_castunsigned(s.length())); +ASSERT(offset + length = static_castunsigned(s.length())); +if (!length) +return globalData-smallStrings.emptyString(globalData); +if (length == 1) { +UChar c = s[offset]; +if (c = maxSingleCharacterString) +return globalData-smallStrings.singleCharacterString(globalData, c); +} +return fixupVPtr(globalData, JSString::createHasOtherOwner(*globalData, StringImpl::create8(s.impl(), offset, length))); +} + inline JSString* jsSubstring(JSGlobalData* globalData, const UString s, unsigned offset, unsigned length) { ASSERT(offset = static_castunsigned(s.length())); @@ -399,6 +414,7 @@ inline JSString* jsEmptyString(ExecState* exec) { return jsEmptyString(exec-globalData()); } inline JSString* jsString(ExecState* exec, const UString s) { return jsString(exec-globalData(), s); } inline JSString* jsSingleCharacterString(ExecState* exec, UChar c) { return jsSingleCharacterString(exec-globalData(), c); } +inline JSString* jsSubstring8(ExecState* exec, const UString s, unsigned offset, unsigned length) { return jsSubstring8(exec-globalData(), s, offset, length); } inline JSString* jsSubstring(ExecState* exec, const UString s, unsigned offset, unsigned length) { return jsSubstring(exec-globalData(), s, offset, length); } inline JSString* jsNontrivialString(ExecState* exec, const UString s) { return jsNontrivialString(exec-globalData(), s); } inline JSString* jsNontrivialString(ExecState* exec, const char* s) { return jsNontrivialString(exec-globalData(), s); } Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (100313 => 100314) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-15 21:03:52 UTC (rev 100313) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2011-11-15 21:38:35 UTC (rev 100314) @@ -283,7 +283,27 @@ if (!totalLength) return jsString(exec, ); +if (source.is8Bit()) { +LChar* buffer; +const LChar* sourceData = source.characters8(); +RefPtrStringImpl impl = StringImpl::tryCreateUninitialized(totalLength, buffer); +if (!impl) +return throwOutOfMemoryError(exec); + +int bufferPos = 0; +for (int i = 0; i rangeCount; i++) { +if (int srcLen = substringRanges[i].length) { +StringImpl::copyChars(buffer + bufferPos, sourceData + substringRanges[i].position, srcLen); +bufferPos += srcLen; +} +} + +return jsString(exec, impl.release()); +} + UChar* buffer; +const UChar* sourceData = source.characters16(); + RefPtrStringImpl impl =
[webkit-changes] [100405] trunk/Source/JavaScriptCore
Title: [100405] trunk/Source/_javascript_Core Revision 100405 Author msab...@apple.com Date 2011-11-15 22:06:21 -0800 (Tue, 15 Nov 2011) Log Message Towards 8 bit Strings - Update utf8() and ascii() methods for 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=72323 Added 8 bit optimized paths for String and UString ascii() and utf8() methods. Added String::characters8(), characters16() and is8Bit() helper methods. Added an new Unicode::convertLatin1ToUTF8() method that works on LChar (8 bit) strings that is a stripped down version of convertUTF16ToUTF8(). Reviewed by Geoff Garen. * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def: * runtime/UString.cpp: (JSC::UString::utf8): * wtf/text/WTFString.cpp: (WTF::String::ascii): (WTF::String::utf8): * wtf/text/WTFString.h: (WTF::String::characters8): (WTF::String::characters16): (WTF::String::is8Bit): (WTF::LChar): (WTF::UChar): * wtf/unicode/UTF8.cpp: (WTF::Unicode::convertLatin1ToUTF8): * wtf/unicode/UTF8.h: * wtf/unicode/Unicode.h: Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def trunk/Source/_javascript_Core/runtime/UString.cpp trunk/Source/_javascript_Core/wtf/text/WTFString.cpp trunk/Source/_javascript_Core/wtf/text/WTFString.h trunk/Source/_javascript_Core/wtf/unicode/UTF8.cpp trunk/Source/_javascript_Core/wtf/unicode/UTF8.h trunk/Source/_javascript_Core/wtf/unicode/Unicode.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (100404 => 100405) --- trunk/Source/_javascript_Core/ChangeLog 2011-11-16 05:46:55 UTC (rev 100404) +++ trunk/Source/_javascript_Core/ChangeLog 2011-11-16 06:06:21 UTC (rev 100405) @@ -1,3 +1,34 @@ +2011-11-15 Michael Saboff msab...@apple.com + +Towards 8 bit Strings - Update utf8() and ascii() methods for 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=72323 + +Added 8 bit optimized paths for String and UString ascii() and utf8() methods. + +Added String::characters8(), characters16() and is8Bit() helper methods. + +Added an new Unicode::convertLatin1ToUTF8() method that works on +LChar (8 bit) strings that is a stripped down version of convertUTF16ToUTF8(). + +Reviewed by Geoff Garen. + +* _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def: +* runtime/UString.cpp: +(JSC::UString::utf8): +* wtf/text/WTFString.cpp: +(WTF::String::ascii): +(WTF::String::utf8): +* wtf/text/WTFString.h: +(WTF::String::characters8): +(WTF::String::characters16): +(WTF::String::is8Bit): +(WTF::LChar): +(WTF::UChar): +* wtf/unicode/UTF8.cpp: +(WTF::Unicode::convertLatin1ToUTF8): +* wtf/unicode/UTF8.h: +* wtf/unicode/Unicode.h: + 2011-11-15 Darin Adler da...@apple.com REGRESSION (r98887): ParserArena and Keywords leaking Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def (100404 => 100405) --- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def 2011-11-16 05:46:55 UTC (rev 100404) +++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def 2011-11-16 06:06:21 UTC (rev 100405) @@ -99,6 +99,7 @@ ?constructEmptyArray@JSC@@YAPAVJSArray@1@PAVExecState@1@@Z ?constructEmptyObject@JSC@@YAPAVJSObject@1@PAVExecState@1@@Z ?constructFunctionSkippingEvalEnabledCheck@JSC@@YAPAVJSObject@1@PAVExecState@1@PAVJSGlobalObject@1@ABVArgList@1@ABVIdentifier@1@ABVUString@1@ABVTextPosition@WTF@@@Z +?convertLatin1ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBEPBEPAPADPAD@Z ?convertUTF16ToUTF8@Unicode@WTF@@YA?AW4ConversionResult@12@PAPB_WPB_WPAPADPAD_N@Z ?convertUTF8ToUTF16@Unicode@WTF@@YA?AW4ConversionResult@12@PAPBDPBDPAPA_WPA_W_N@Z ?create@ByteArray@WTF@@SA?AV?$PassRefPtr@VByteArray@WTF@@@2@I@Z Modified: trunk/Source/_javascript_Core/runtime/UString.cpp (100404 => 100405) --- trunk/Source/_javascript_Core/runtime/UString.cpp 2011-11-16 05:46:55 UTC (rev 100404) +++ trunk/Source/_javascript_Core/runtime/UString.cpp 2011-11-16 06:06:21 UTC (rev 100405) @@ -399,8 +399,8 @@ { unsigned length = this-length(); -if (is8Bit()) -return CString(reinterpret_castconst char*(characters8()), length); +if (!length) +return CString(, 0); // Allocate a buffer big enough to hold all the characters // (an individual UTF-16 UChar can only expand to 3 UTF-8 bytes). @@ -415,30 +415,38 @@ if (length numeric_limitsunsigned::max() / 3) return CString(); -const UChar* characters = this-characters16(); Vectorchar, 1024 bufferVector(length * 3); - char* buffer = bufferVector.data(); -ConversionResult result = convertUTF16ToUTF8(characters, characters + length, buffer, buffer + bufferVector.size(), strict); -
[webkit-changes] [100681] trunk/Source/WebCore
Title: [100681] trunk/Source/WebCore Revision 100681 Author msab...@apple.com Date 2011-11-17 14:49:31 -0800 (Thu, 17 Nov 2011) Log Message Leaks seen in MemoryPressureHandlerMac.mm on Leaks bot https://bugs.webkit.org/show_bug.cgi?id=72416 Added code to release _cache_event_source and _timer_event_source after they are canceled. Also added defensive code to clean up the _timer_event_source in uninstall(). Reviewed by Geoffrey Garen. No new tests, fixing leaks caught by leaks bot. * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::uninstall): (WebCore::MemoryPressureHandler::holdOff): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (100680 => 100681) --- trunk/Source/WebCore/ChangeLog 2011-11-17 22:49:26 UTC (rev 100680) +++ trunk/Source/WebCore/ChangeLog 2011-11-17 22:49:31 UTC (rev 100681) @@ -1,3 +1,20 @@ +2011-11-17 Michael Saboff msab...@apple.com + +Leaks seen in MemoryPressureHandlerMac.mm on Leaks bot +https://bugs.webkit.org/show_bug.cgi?id=72416 + +Added code to release _cache_event_source and _timer_event_source +after they are canceled. Also added defensive code to +clean up the _timer_event_source in uninstall(). + +Reviewed by Geoffrey Garen. + +No new tests, fixing leaks caught by leaks bot. + +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore::MemoryPressureHandler::uninstall): +(WebCore::MemoryPressureHandler::holdOff): + 2011-11-17 Ken Buchanan ke...@chromium.org Crash from positioned generated content under run-in Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (100680 => 100681) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-11-17 22:49:26 UTC (rev 100680) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2011-11-17 22:49:31 UTC (rev 100681) @@ -76,7 +76,15 @@ return; dispatch_source_cancel(_cache_event_source); +dispatch_release(_cache_event_source); _cache_event_source = 0; + +if (_timer_event_source) { +dispatch_source_cancel(_timer_event_source); +dispatch_release(_timer_event_source); +_timer_event_source = 0; +} + m_installed = false; notify_cancel(_notifyToken); @@ -93,6 +101,7 @@ dispatch_source_set_timer(_timer_event_source, dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, 1 * s_secondsBetweenMemoryCleanup); dispatch_source_set_event_handler(_timer_event_source, ^{ dispatch_source_cancel(_timer_event_source); +dispatch_release(_timer_event_source); _timer_event_source = 0; memoryPressureHandler().install(); }); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [108252] trunk
Title: [108252] trunk Revision 108252 Author msab...@apple.com Date 2012-02-20 10:49:22 -0800 (Mon, 20 Feb 2012) Log Message Update toLower and toUpper tests for Unicode 6.1 changes https://bugs.webkit.org/show_bug.cgi?id=78923 Reviewed by Oliver Hunt. Source/_javascript_Core: * tests/mozilla/ecma/String/15.5.4.11-2.js: Updated the test to handle a third set of results for updated Unicode 6.1 changes. (getTestCases): (TestCaseMultiExpected): (writeTestCaseResultMultiExpected): (getTestCaseResultMultiExpected): (test): (GetUnicodeValues): (DecimalToHexString): LayoutTests: * fast/js/script-tests/string-capitalization.js: Updated the test to handle a new set of characters that have different results depending on what version of Unicode the platform supports. The tests work for Unicode 5.0 through 6.1. (createExpected): * fast/js/string-capitalization-expected.txt: Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/fast/js/script-tests/string-capitalization.js trunk/LayoutTests/fast/js/string-capitalization-expected.txt trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/tests/mozilla/ecma/String/15.5.4.11-2.js Diff Modified: trunk/LayoutTests/ChangeLog (108251 => 108252) --- trunk/LayoutTests/ChangeLog 2012-02-20 18:46:41 UTC (rev 108251) +++ trunk/LayoutTests/ChangeLog 2012-02-20 18:49:22 UTC (rev 108252) @@ -1,3 +1,18 @@ +2012-02-20 Michael Saboff msab...@apple.com + +Update toLower and toUpper tests for Unicode 6.1 changes +https://bugs.webkit.org/show_bug.cgi?id=78923 + +Reviewed by Oliver Hunt. + + +* fast/js/script-tests/string-capitalization.js: Updated the test +to handle a new set of characters that have different results depending +on what version of Unicode the platform supports. The tests work +for Unicode 5.0 through 6.1. +(createExpected): +* fast/js/string-capitalization-expected.txt: + 2012-02-20 David Barton dbar...@mathscribe.com MathML internals - remove nonOperatorHeight(), hasBase() Modified: trunk/LayoutTests/fast/js/script-tests/string-capitalization.js (108251 => 108252) --- trunk/LayoutTests/fast/js/script-tests/string-capitalization.js 2012-02-20 18:46:41 UTC (rev 108251) +++ trunk/LayoutTests/fast/js/script-tests/string-capitalization.js 2012-02-20 18:49:22 UTC (rev 108252) @@ -13,3 +13,60 @@ shouldBe('String(ffi).toUpperCase()', 'FFI'); shouldBe('String(FFI).toLowerCase()', 'ffi'); shouldBe('String(IJ).toLowerCase()', 'ij'); + +// Test the toUpper and toLower changes made in Unicode versions 5.2 and 6.1 +// Construct the tests so that it passes if the toLowerCase()/toUpperCase() +// either return the updated results for compliant platforms or the +// passed in arguments if not. This should be changed when all platforms +// support Unicode 5.2 and Unicode 6.1. +function createExpected(/* ... */) +{ +expected = {}; + +for (var i = 0; i arguments.length; i++) { +var s = String.fromCharCode(arguments[i]); +expected[s] = true; +} + +return expected; +} + +// Check Unicode additions in version 5.2. From UnicodeData.txt: +// 0265;LATIN SMALL LETTER TURNED H;Ll;0;L;N;;;A78D;;A78D +// A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;N0265; + +var expected = createExpected(0xA78D, 0x0265); +shouldBeTrue('expected[String.fromCharCode(0xA78D).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x0265).toUpperCase()]'); + +// Check Unicode additions in version 6.1 From UnicodeData.txt: +// 0266;LATIN SMALL LETTER H WITH HOOK;Ll;0;L;N;LATIN SMALL LETTER H HOOK;;A7AA;;A7AA +// 10C7;GEORGIAN CAPITAL LETTER YN;Lu;0;L;N2D27; +// 10CD;GEORGIAN CAPITAL LETTER AEN;Lu;0;L;N2D2D; +// 2CF2;COPTIC CAPITAL LETTER BOHAIRIC KHEI;Lu;0;L;N2CF3; +// 2CF3;COPTIC SMALL LETTER BOHAIRIC KHEI;Ll;0;L;N;;;2CF2;;2CF2 +// 2D27;GEORGIAN SMALL LETTER YN;Ll;0;L;N;;;10C7;;10C7 +// 2D2D;GEORGIAN SMALL LETTER AEN;Ll;0;L;N;;;10CD;;10CD +// A792;LATIN CAPITAL LETTER C WITH BAR;Lu;0;L;NA793; +// A793;LATIN SMALL LETTER C WITH BAR;Ll;0;L;N;;;A792;;A792 +// A7AA;LATIN CAPITAL LETTER H WITH HOOK;Lu;0;L;N0266; + +var expected = createExpected(0x10C7, 0x2D27); +shouldBeTrue('expected[String.fromCharCode(0x10C7).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x2D27).toUpperCase()]'); + +var expected = createExpected(0x10CD, 0x2D2D); +shouldBeTrue('expected[String.fromCharCode(0x2D2D).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x10CD).toUpperCase()]'); + +var expected = createExpected(0x2CF2, 0x2CF3); +shouldBeTrue('expected[String.fromCharCode(0x2CF2).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0x2CF3).toUpperCase()]'); + +var expected = createExpected(0xA792, 0xA793); +shouldBeTrue('expected[String.fromCharCode(0xA792).toLowerCase()]'); +shouldBeTrue('expected[String.fromCharCode(0xA793).toUpperCase()]'); + +var expected =
[webkit-changes] [108869] trunk/Source/JavaScriptCore
Title: [108869] trunk/Source/_javascript_Core Revision 108869 Author msab...@apple.com Date 2012-02-24 16:45:57 -0800 (Fri, 24 Feb 2012) Log Message Unreviewed, Windows build fix. Changed signature in export to match change made in r108858. * _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def: Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def Diff Modified: trunk/Source/_javascript_Core/ChangeLog (108868 => 108869) --- trunk/Source/_javascript_Core/ChangeLog 2012-02-25 00:30:36 UTC (rev 108868) +++ trunk/Source/_javascript_Core/ChangeLog 2012-02-25 00:45:57 UTC (rev 108869) @@ -1,3 +1,10 @@ +2012-02-24 Michael Saboff msab...@apple.com + +Unreviewed, Windows build fix. Changed signature in export to match +change made in r108858. + +* _javascript_Core.vcproj/_javascript_Core/_javascript_Core.def: + 2012-02-24 Filip Pizlo fpi...@apple.com DFG support for op_new_regexp should be enabled Modified: trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def (108868 => 108869) --- trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def 2012-02-25 00:30:36 UTC (rev 108868) +++ trunk/Source/_javascript_Core/_javascript_Core.vcproj/_javascript_Core/_javascript_Core.def 2012-02-25 00:45:57 UTC (rev 108869) @@ -229,7 +229,7 @@ ?initializeMainThread@WTF@@YAXXZ ?initializeThreading@JSC@@YAXXZ ?initializeThreading@WTF@@YAXXZ -?interpret@Yarr@JSC@@YAHPAUBytecodePattern@12@ABVUString@2@IIPAH@Z +?interpret@Yarr@JSC@@YAIPAUBytecodePattern@12@ABVUString@2@IIPAI@Z ?isAccessorDescriptor@PropertyDescriptor@JSC@@QBE_NXZ ?isBusy@Heap@JSC@@QAE_NXZ ?isDataDescriptor@PropertyDescriptor@JSC@@QBE_NXZ ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [108874] trunk/Source/WebCore
Title: [108874] trunk/Source/WebCore Revision 108874 Author msab...@apple.com Date 2012-02-24 17:11:14 -0800 (Fri, 24 Feb 2012) Log Message Unreviewed, Windows build fix. Changed -1 to newly created constant JSC::Yarr::offsetNoMatch added in r108858. * platform/text/RegularExpression.cpp: (WebCore::RegularExpression::match): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/text/RegularExpression.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (108873 => 108874) --- trunk/Source/WebCore/ChangeLog 2012-02-25 01:10:21 UTC (rev 108873) +++ trunk/Source/WebCore/ChangeLog 2012-02-25 01:11:14 UTC (rev 108874) @@ -1,3 +1,11 @@ +2012-02-24 Michael Saboff msab...@apple.com + +Unreviewed, Windows build fix. Changed -1 to newly +created constant JSC::Yarr::offsetNoMatch added in r108858. + +* platform/text/RegularExpression.cpp: +(WebCore::RegularExpression::match): + 2012-02-24 Eric Carlson eric.carl...@apple.com Update TextTrackCue API Modified: trunk/Source/WebCore/platform/text/RegularExpression.cpp (108873 => 108874) --- trunk/Source/WebCore/platform/text/RegularExpression.cpp 2012-02-25 01:10:21 UTC (rev 108873) +++ trunk/Source/WebCore/platform/text/RegularExpression.cpp 2012-02-25 01:11:14 UTC (rev 108874) @@ -108,7 +108,7 @@ ASSERT(offsetVector); for (unsigned j = 0, i = 0; i d-m_numSubpatterns + 1; j += 2, i++) -offsetVector[j] = -1; +offsetVector[j] = JSC::Yarr::offsetNoMatch; unsigned result; if (str.length() = INT_MAX) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [108999] trunk
Title: [108999] trunk Revision 108999 Author msab...@apple.com Date 2012-02-27 09:22:29 -0800 (Mon, 27 Feb 2012) Log Message Error check regexp min quantifier https://bugs.webkit.org/show_bug.cgi?id=70648 Reviewed by Gavin Barraclough. Source/_javascript_Core: Added checking for min or only quantifier being UINT_MAX. When encountered this becomes a SyntaxError during parsing. * yarr/YarrParser.h: (JSC::Yarr::Parser::parseQuantifier): (JSC::Yarr::Parser::parse): (Parser): LayoutTests: New test added to check for newly generated SyntaxError. * fast/regex/overflow-expected.txt: * fast/regex/script-tests/overflow.js: (quantifyMaxInt): Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/fast/regex/overflow-expected.txt trunk/LayoutTests/fast/regex/script-tests/overflow.js trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/yarr/YarrParser.h Diff Modified: trunk/LayoutTests/ChangeLog (108998 => 108999) --- trunk/LayoutTests/ChangeLog 2012-02-27 17:01:53 UTC (rev 108998) +++ trunk/LayoutTests/ChangeLog 2012-02-27 17:22:29 UTC (rev 108999) @@ -1,3 +1,16 @@ +2012-02-27 Michael Saboff msab...@apple.com + +Error check regexp min quantifier +https://bugs.webkit.org/show_bug.cgi?id=70648 + +Reviewed by Gavin Barraclough. + +New test added to check for newly generated SyntaxError. + +* fast/regex/overflow-expected.txt: +* fast/regex/script-tests/overflow.js: +(quantifyMaxInt): + 2012-02-27 Pavel Feldman pfeld...@google.com Web Inspector: extract TimelineModel and TimelinePresentationModel into their own files. Modified: trunk/LayoutTests/fast/regex/overflow-expected.txt (108998 => 108999) --- trunk/LayoutTests/fast/regex/overflow-expected.txt 2012-02-27 17:01:53 UTC (rev 108998) +++ trunk/LayoutTests/fast/regex/overflow-expected.txt 2012-02-27 17:22:29 UTC (rev 108999) @@ -5,7 +5,8 @@ PASS regexp1.exec('') is null PASS regexp2.exec('') is null -PASS regexp2.exec(s3) is null +PASS regexp3.exec(s3) is null +PASS function f() { /[^a$]{4294967295}/ } threw exception SyntaxError: Invalid regular _expression_: number too large in {} quantifier. PASS successfullyParsed is true TEST COMPLETE Modified: trunk/LayoutTests/fast/regex/script-tests/overflow.js (108998 => 108999) --- trunk/LayoutTests/fast/regex/script-tests/overflow.js 2012-02-27 17:01:53 UTC (rev 108998) +++ trunk/LayoutTests/fast/regex/script-tests/overflow.js 2012-02-27 17:22:29 UTC (rev 108999) @@ -8,4 +8,6 @@ var s3 = {6}u4a64YfQP{C}u88c4u5772Qu8693{4294967167}u85f2u7f3fs((uf202){4})u5bc6u1947; var regexp3 = new RegExp(s3, ); -shouldBe(regexp2.exec(s3), 'null'); +shouldBe(regexp3.exec(s3), 'null'); + +shouldThrow(function f() { /[^a$]{4294967295}/ }, 'SyntaxError: Invalid regular _expression_: number too large in {} quantifier'); Modified: trunk/Source/_javascript_Core/ChangeLog (108998 => 108999) --- trunk/Source/_javascript_Core/ChangeLog 2012-02-27 17:01:53 UTC (rev 108998) +++ trunk/Source/_javascript_Core/ChangeLog 2012-02-27 17:22:29 UTC (rev 108999) @@ -1,3 +1,18 @@ +2012-02-27 Michael Saboff msab...@apple.com + +Error check regexp min quantifier +https://bugs.webkit.org/show_bug.cgi?id=70648 + +Reviewed by Gavin Barraclough. + +Added checking for min or only quantifier being UINT_MAX. +When encountered this becomes a SyntaxError during parsing. + +* yarr/YarrParser.h: +(JSC::Yarr::Parser::parseQuantifier): +(JSC::Yarr::Parser::parse): +(Parser): + 2012-02-27 Carlos Garcia Campos cgar...@igalia.com Unreviewed. Fix make distcheck. Modified: trunk/Source/_javascript_Core/yarr/YarrParser.h (108998 => 108999) --- trunk/Source/_javascript_Core/yarr/YarrParser.h 2012-02-27 17:01:53 UTC (rev 108998) +++ trunk/Source/_javascript_Core/yarr/YarrParser.h 2012-02-27 17:22:29 UTC (rev 108999) @@ -54,6 +54,7 @@ PatternTooLarge, QuantifierOutOfOrder, QuantifierWithoutAtom, +QuantifierTooLarge, MissingParentheses, ParenthesesUnmatched, ParenthesesTypeInvalid, @@ -546,6 +547,11 @@ ASSERT(!m_err); ASSERT(min = max); +if (min == UINT_MAX) { +m_err = QuantifierTooLarge; +return; +} + if (lastTokenWasAnAtom) m_delegate.quantifyAtom(min, max, !tryConsume('?')); else @@ -685,6 +691,7 @@ REGEXP_ERROR_PREFIX regular _expression_ too large, REGEXP_ERROR_PREFIX numbers out of order in {} quantifier, REGEXP_ERROR_PREFIX nothing to repeat, +REGEXP_ERROR_PREFIX number too large in {} quantifier, REGEXP_ERROR_PREFIX missing ), REGEXP_ERROR_PREFIX unmatched parentheses, REGEXP_ERROR_PREFIX unrecognized character after (?, @@ -696,7 +703,6 @@ return errorMessages[m_err]; } - // Misc helper
[webkit-changes] [104751] trunk/Source/JavaScriptCore
Title: [104751] trunk/Source/_javascript_Core Revision 104751 Author msab...@apple.com Date 2012-01-11 15:27:08 -0800 (Wed, 11 Jan 2012) Log Message v8-regexp spends 35% of its time allocating and copying internal regexp results data https://bugs.webkit.org/show_bug.cgi?id=76079 Reviewed by Geoffrey Garen. Added a new RegExpResults struct that has the input string, the number of subexpressions and the output vector. Changed RegExpConstructor to include a RegExpConstructorPrivate instead of having a reference to one. Changed RegExpMatchesArray to include a RegExpResults instead of a reference to a RegExpConstructorPrivate. Created an overloaded assignment operator to assign a RegExpConstructorPrivate to a RegExpResults. Collectively this change is worth 24% performance improvement to v8-regexp. * runtime/RegExpConstructor.cpp: (JSC::RegExpResult::operator=): (JSC::RegExpConstructor::RegExpConstructor): (JSC::RegExpMatchesArray::RegExpMatchesArray): (JSC::RegExpMatchesArray::finishCreation): (JSC::RegExpMatchesArray::~RegExpMatchesArray): (JSC::RegExpMatchesArray::fillArrayInstance): (JSC::RegExpConstructor::arrayOfMatches): (JSC::RegExpConstructor::getBackref): (JSC::RegExpConstructor::getLastParen): (JSC::RegExpConstructor::getLeftContext): (JSC::RegExpConstructor::getRightContext): (JSC::RegExpConstructor::setInput): (JSC::RegExpConstructor::input): (JSC::RegExpConstructor::setMultiline): (JSC::RegExpConstructor::multiline): * runtime/RegExpConstructor.h: (JSC::RegExpResult::RegExpResult): (JSC::RegExpConstructor::performMatch): * runtime/RegExpMatchesArray.h: (JSC::RegExpMatchesArray::create): (JSC::RegExpMatchesArray::getOwnPropertySlot): (JSC::RegExpMatchesArray::getOwnPropertySlotByIndex): (JSC::RegExpMatchesArray::getOwnPropertyDescriptor): (JSC::RegExpMatchesArray::put): (JSC::RegExpMatchesArray::putByIndex): (JSC::RegExpMatchesArray::deleteProperty): (JSC::RegExpMatchesArray::deletePropertyByIndex): (JSC::RegExpMatchesArray::getOwnPropertyNames): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp trunk/Source/_javascript_Core/runtime/RegExpConstructor.h trunk/Source/_javascript_Core/runtime/RegExpMatchesArray.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (104750 => 104751) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-11 23:15:20 UTC (rev 104750) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-11 23:27:08 UTC (rev 104751) @@ -1,3 +1,48 @@ +2012-01-11 Michael Saboff msab...@apple.com + +v8-regexp spends 35% of its time allocating and copying internal regexp results data +https://bugs.webkit.org/show_bug.cgi?id=76079 + +Reviewed by Geoffrey Garen. + +Added a new RegExpResults struct that has the input string, the number of +subexpressions and the output vector. Changed RegExpConstructor to +include a RegExpConstructorPrivate instead of having a reference to one. +Changed RegExpMatchesArray to include a RegExpResults instead of a +reference to a RegExpConstructorPrivate. Created an overloaded assignment +operator to assign a RegExpConstructorPrivate to a RegExpResults. +Collectively this change is worth 24% performance improvement to v8-regexp. + +* runtime/RegExpConstructor.cpp: +(JSC::RegExpResult::operator=): +(JSC::RegExpConstructor::RegExpConstructor): +(JSC::RegExpMatchesArray::RegExpMatchesArray): +(JSC::RegExpMatchesArray::finishCreation): +(JSC::RegExpMatchesArray::~RegExpMatchesArray): +(JSC::RegExpMatchesArray::fillArrayInstance): +(JSC::RegExpConstructor::arrayOfMatches): +(JSC::RegExpConstructor::getBackref): +(JSC::RegExpConstructor::getLastParen): +(JSC::RegExpConstructor::getLeftContext): +(JSC::RegExpConstructor::getRightContext): +(JSC::RegExpConstructor::setInput): +(JSC::RegExpConstructor::input): +(JSC::RegExpConstructor::setMultiline): +(JSC::RegExpConstructor::multiline): +* runtime/RegExpConstructor.h: +(JSC::RegExpResult::RegExpResult): +(JSC::RegExpConstructor::performMatch): +* runtime/RegExpMatchesArray.h: +(JSC::RegExpMatchesArray::create): +(JSC::RegExpMatchesArray::getOwnPropertySlot): +(JSC::RegExpMatchesArray::getOwnPropertySlotByIndex): +(JSC::RegExpMatchesArray::getOwnPropertyDescriptor): +(JSC::RegExpMatchesArray::put): +(JSC::RegExpMatchesArray::putByIndex): +(JSC::RegExpMatchesArray::deleteProperty): +(JSC::RegExpMatchesArray::deletePropertyByIndex): +(JSC::RegExpMatchesArray::getOwnPropertyNames): + 2012-01-11 Eugene Girard gir...@google.com Typo in error message: Unexpected token 'defualt' Modified: trunk/Source/_javascript_Core/runtime/RegExpConstructor.cpp (104750 => 104751) ---
[webkit-changes] [106019] trunk/Source/JavaScriptCore
Title: [106019] trunk/Source/_javascript_Core Revision 106019 Author msab...@apple.com Date 2012-01-26 11:23:50 -0800 (Thu, 26 Jan 2012) Log Message Dromaeo tests usage of StringImpl find routines cause 8-16 bit conversions https://bugs.webkit.org/show_bug.cgi?id=76645 Reviewed by Geoffrey Garen. * wtf/text/StringImpl.cpp: (WTF::equalIgnoringCase): New LChar version. (WTF::findInner): New helper function. (WTF::StringImpl::find): Added 8 bit path. (WTF::reverseFindInner): New helper funciton. (WTF::StringImpl::reverseFind): Added 8 bit path. (WTF::StringImpl::reverseFindIgnoringCase): Added 8 bit path. * wtf/text/StringImpl.h: (WTF): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106018 => 106019) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-26 19:23:42 UTC (rev 106018) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-26 19:23:50 UTC (rev 106019) @@ -1,3 +1,20 @@ +2012-01-26 Michael Saboff msab...@apple.com + +Dromaeo tests usage of StringImpl find routines cause 8-16 bit conversions +https://bugs.webkit.org/show_bug.cgi?id=76645 + +Reviewed by Geoffrey Garen. + +* wtf/text/StringImpl.cpp: +(WTF::equalIgnoringCase): New LChar version. +(WTF::findInner): New helper function. +(WTF::StringImpl::find): Added 8 bit path. +(WTF::reverseFindInner): New helper funciton. +(WTF::StringImpl::reverseFind): Added 8 bit path. +(WTF::StringImpl::reverseFindIgnoringCase): Added 8 bit path. +* wtf/text/StringImpl.h: +(WTF): + 2012-01-26 Csaba Osztrogonác o...@webkit.org [Qt][Win] One more speculative buildfix after r105970. Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp (106018 => 106019) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-01-26 19:23:42 UTC (rev 106018) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-01-26 19:23:50 UTC (rev 106019) @@ -715,6 +715,16 @@ return charactersToFloat(characters16(), m_length, ok, didReadNumber); } +bool equalIgnoringCase(const LChar* a, const LChar* b, unsigned length) +{ +while (length--) { +LChar bc = *b++; +if (foldCase(*a++) != foldCase(bc)) +return false; +} +return true; +} + bool equalIgnoringCase(const UChar* a, const LChar* b, unsigned length) { while (length--) { @@ -849,6 +859,35 @@ return index + i; } +template typename CharType +ALWAYS_INLINE static size_t findInner(const CharType* searchCharacters, const CharType* matchCharacters, unsigned index, unsigned searchLength, unsigned matchLength) +{ +// Optimization: keep a running hash of the strings, +// only call memcmp if the hashes match. + +// delta is the number of additional times to test; delta == 0 means test only once. +unsigned delta = searchLength - matchLength; + +unsigned searchHash = 0; +unsigned matchHash = 0; + +for (unsigned i = 0; i matchLength; ++i) { +searchHash += searchCharacters[i]; +matchHash += matchCharacters[i]; +} + +unsigned i = 0; +// keep looping until we match +while (searchHash != matchHash || memcmp(searchCharacters + i, matchCharacters, matchLength * sizeof(CharType))) { +if (i == delta) +return notFound; +searchHash += searchCharacters[i + matchLength]; +searchHash -= searchCharacters[i]; +++i; +} +return index + i; +} + size_t StringImpl::find(StringImpl* matchString, unsigned index) { // Check for null or empty string to match against @@ -871,31 +910,12 @@ unsigned searchLength = length() - index; if (matchLength searchLength) return notFound; -// delta is the number of additional times to test; delta == 0 means test only once. -unsigned delta = searchLength - matchLength; -const UChar* searchCharacters = characters() + index; -const UChar* matchCharacters = matchString-characters(); +if (is8Bit() matchString-is8Bit()) +return findInner(characters8() + index, matchString-characters8(), index, searchLength, matchLength); -// Optimization 2: keep a running hash of the strings, -// only call memcmp if the hashes match. -unsigned searchHash = 0; -unsigned matchHash = 0; -for (unsigned i = 0; i matchLength; ++i) { -searchHash += searchCharacters[i]; -matchHash += matchCharacters[i]; -} +return findInner(characters() + index, matchString-characters(), index, searchLength, matchLength); -unsigned i = 0; -// keep looping until we match -while (searchHash != matchHash || memcmp(searchCharacters + i, matchCharacters, matchLength * sizeof(UChar))) { -if (i == delta) -return notFound; -searchHash +=
[webkit-changes] [106020] trunk/Source/JavaScriptCore
Title: [106020] trunk/Source/_javascript_Core Revision 106020 Author msab...@apple.com Date 2012-01-26 11:26:15 -0800 (Thu, 26 Jan 2012) Log Message String::latin1() should take advantage of 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=76646 Reviewed by Geoffrey Garen. * wtf/text/WTFString.cpp: (WTF::String::latin1): For 8 bit strings, use existing buffer without conversion. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/WTFString.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106019 => 106020) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-26 19:23:50 UTC (rev 106019) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-26 19:26:15 UTC (rev 106020) @@ -1,5 +1,16 @@ 2012-01-26 Michael Saboff msab...@apple.com +String::latin1() should take advantage of 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=76646 + +Reviewed by Geoffrey Garen. + +* wtf/text/WTFString.cpp: +(WTF::String::latin1): For 8 bit strings, use existing buffer +without conversion. + +2012-01-26 Michael Saboff msab...@apple.com + Dromaeo tests usage of StringImpl find routines cause 8-16 bit conversions https://bugs.webkit.org/show_bug.cgi?id=76645 Modified: trunk/Source/_javascript_Core/wtf/text/WTFString.cpp (106019 => 106020) --- trunk/Source/_javascript_Core/wtf/text/WTFString.cpp 2012-01-26 19:23:50 UTC (rev 106019) +++ trunk/Source/_javascript_Core/wtf/text/WTFString.cpp 2012-01-26 19:26:15 UTC (rev 106020) @@ -687,6 +687,13 @@ // preserved, characters outside of this range are converted to '?'. unsigned length = this-length(); + +if (!length) +return CString(, 0); + +if (is8Bit()) +return CString(reinterpret_castconst char*(this-characters8()), length); + const UChar* characters = this-characters(); char* characterBuffer; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [106167] trunk/Source/JavaScriptCore
Title: [106167] trunk/Source/_javascript_Core Revision 106167 Author msab...@apple.com Date 2012-01-27 16:05:51 -0800 (Fri, 27 Jan 2012) Log Message StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase https://bugs.webkit.org/show_bug.cgi?id=76647 Reviewed by Geoffrey Garen. Changed stringProtoFuncToUpperCase to call StringImpl::upper() is a manor similar to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle the two 8 bit characters that when converted to upper case become 16 bit characters. * runtime/StringPrototype.cpp: (JSC::stringProtoFuncToLowerCase): Removed extra trailing whitespace. (JSC::stringProtoFuncToUpperCase): * wtf/text/StringImpl.cpp: (WTF::StringImpl::upper): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/StringPrototype.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106166 => 106167) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-28 00:05:00 UTC (rev 106166) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-28 00:05:51 UTC (rev 106167) @@ -1,3 +1,20 @@ +2012-01-27 Michael Saboff msab...@apple.com + +StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase +https://bugs.webkit.org/show_bug.cgi?id=76647 + +Reviewed by Geoffrey Garen. + +Changed stringProtoFuncToUpperCase to call StringImpl::upper() is a manor similar +to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle the two +8 bit characters that when converted to upper case become 16 bit characters. + +* runtime/StringPrototype.cpp: +(JSC::stringProtoFuncToLowerCase): Removed extra trailing whitespace. +(JSC::stringProtoFuncToUpperCase): +* wtf/text/StringImpl.cpp: +(WTF::StringImpl::upper): + 2012-01-27 Hajime Morita morr...@google.com [JSC] ThunkGenerators.cpp should hide its asm-defined symbols Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (106166 => 106167) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-28 00:05:00 UTC (rev 106166) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-28 00:05:51 UTC (rev 106167) @@ -1180,7 +1180,7 @@ if (!sSize) return JSValue::encode(sVal); -StringImpl* ourImpl = s.impl(); +StringImpl* ourImpl = s.impl(); RefPtrStringImpl lower = ourImpl-lower(); if (ourImpl == lower.get()) return JSValue::encode(sVal); @@ -1199,32 +1199,11 @@ if (!sSize) return JSValue::encode(sVal); -const UChar* sData = s.characters(); -VectorUChar buffer(sSize); - -UChar ored = 0; -for (int i = 0; i sSize; i++) { -UChar c = sData[i]; -ored |= c; -buffer[i] = toASCIIUpper(c); -} -if (!(ored ~0x7f)) -return JSValue::encode(jsString(exec, UString::adopt(buffer))); - -bool error; -int length = Unicode::toUpper(buffer.data(), sSize, sData, sSize, error); -if (error) { -buffer.resize(length); -length = Unicode::toUpper(buffer.data(), length, sData, sSize, error); -if (error) -return JSValue::encode(sVal); -} -if (length == sSize) { -if (memcmp(buffer.data(), sData, length * sizeof(UChar)) == 0) -return JSValue::encode(sVal); -} else -buffer.resize(length); -return JSValue::encode(jsString(exec, UString::adopt(buffer))); +StringImpl* ourImpl = s.impl(); +RefPtrStringImpl upper = ourImpl-upper(); +if (ourImpl == upper.get()) +return JSValue::encode(sVal); +return JSValue::encode(jsString(exec, UString(upper.release(; } EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec) Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp (106166 => 106167) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-01-28 00:05:00 UTC (rev 106166) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-01-28 00:05:51 UTC (rev 106167) @@ -363,6 +363,8 @@ CRASH(); int32_t length = m_length; +const UChar* source16; + if (is8Bit()) { LChar* data8; RefPtrStringImpl newImpl = createUninitialized(m_length, data8); @@ -378,19 +380,30 @@ return newImpl.release(); // Do a slower implementation for cases that include non-ASCII Latin-1 characters. -for (int32_t i = 0; i length; i++) -data8[i] = static_castLChar(Unicode::toUpper(m_data8[i])); +for (int32_t i = 0; i length; i++) { +UChar upper = Unicode::toUpper(m_data8[i]); +if (UNLIKELY(upper 0xff)) { +// Have a character that is 16bit when converted to uppercase. +source16 = characters(); +goto upconvert; +} + +
[webkit-changes] [106169] trunk/LayoutTests
Title: [106169] trunk/LayoutTests Revision 106169 Author msab...@apple.com Date 2012-01-27 16:54:06 -0800 (Fri, 27 Jan 2012) Log Message New Regression Test for r106075 https://bugs.webkit.org/show_bug.cgi?id=77262 Reviewed by Geoffrey Garen. Added a test that verifies that a function called with less than the declared number of arguments has the missing arguments filled in with undefined. The test makes sure that the called function gets JIT compiled by calling it several times. This test verifies that the problem found in r106075 does not regress. * fast/js/apply-varargs-expected.txt: Added. * fast/js/apply-varargs.html: Added. * fast/js/script-tests/apply-varargs.js: Added. (callee): (dummy): (BaseObj): (caller): Modified Paths trunk/LayoutTests/ChangeLog Added Paths trunk/LayoutTests/fast/js/apply-varargs-expected.txt trunk/LayoutTests/fast/js/apply-varargs.html trunk/LayoutTests/fast/js/script-tests/apply-varargs.js Diff Modified: trunk/LayoutTests/ChangeLog (106168 => 106169) --- trunk/LayoutTests/ChangeLog 2012-01-28 00:40:07 UTC (rev 106168) +++ trunk/LayoutTests/ChangeLog 2012-01-28 00:54:06 UTC (rev 106169) @@ -1,3 +1,24 @@ +2012-01-27 Michael Saboff msab...@apple.com + +New Regression Test for r106075 +https://bugs.webkit.org/show_bug.cgi?id=77262 + +Reviewed by Geoffrey Garen. + +Added a test that verifies that a function called with less than the +declared number of arguments has the missing arguments filled in +with undefined. The test makes sure that the called function gets +JIT compiled by calling it several times. This test verifies that +the problem found in r106075 does not regress. + +* fast/js/apply-varargs-expected.txt: Added. +* fast/js/apply-varargs.html: Added. +* fast/js/script-tests/apply-varargs.js: Added. +(callee): +(dummy): +(BaseObj): +(caller): + 2012-01-27 Joshua Bell jsb...@chromium.org IndexedDB does not update r/w index cursors that are mutated during iteration Added: trunk/LayoutTests/fast/js/apply-varargs-expected.txt (0 => 106169) --- trunk/LayoutTests/fast/js/apply-varargs-expected.txt (rev 0) +++ trunk/LayoutTests/fast/js/apply-varargs-expected.txt 2012-01-28 00:54:06 UTC (rev 106169) @@ -0,0 +1,18 @@ +Test that we properly fill in missing args with undefined in JIT code. + +On success, you will see a series of PASS messages, followed by TEST COMPLETE. + + +PASS caller(0) is undefined +PASS caller(1) is undefined +PASS caller(2) is undefined +PASS caller(3) is undefined +PASS caller(4) is undefined +PASS caller(5) is undefined +PASS caller(6) is undefined +PASS caller(7) is undefined +PASS caller(8) is undefined +PASS successfullyParsed is true + +TEST COMPLETE + Added: trunk/LayoutTests/fast/js/apply-varargs.html (0 => 106169) --- trunk/LayoutTests/fast/js/apply-varargs.html (rev 0) +++ trunk/LayoutTests/fast/js/apply-varargs.html 2012-01-28 00:54:06 UTC (rev 106169) @@ -0,0 +1,13 @@ +!DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN +html +head +link rel=stylesheet href="" +script src="" +/head +body +p id=description/p +div id=console/div +script src="" +script src="" +/body +/html Added: trunk/LayoutTests/fast/js/script-tests/apply-varargs.js (0 => 106169) --- trunk/LayoutTests/fast/js/script-tests/apply-varargs.js (rev 0) +++ trunk/LayoutTests/fast/js/script-tests/apply-varargs.js 2012-01-28 00:54:06 UTC (rev 106169) @@ -0,0 +1,74 @@ +description('Test that we properly fill in missing args with undefined in JIT code.'); + +// Regression test for rdar://problem/10763509 + + +function callee(a1, a2, a3, a4, a5, a6, a7, a8) +{ +// We expect that the unused actual parameters will be filled +// with undefined. +if (a1 !== undefined) +return Arg1 is wrong; +if (a2 !== undefined) +return Arg2 is wrong; +if (a3 !== undefined) +return Arg3 is wrong; +if (a4 !== undefined) +return Arg4 is wrong; +if (a5 !== undefined) +return Arg5 is wrong; +if (a6 !== undefined) +return Arg6 is wrong; +if (a7 !== undefined) +return Arg7 is wrong; +if (a8 !== undefined) +return Arg8 is wrong; + +return undefined; +} + +function dummy(a1, a2, a3, a4, a5, a6, a7, a8) +{ +} + +function BaseObj() +{ +} + +function caller(testArgCount) +{ +var baseObj = new BaseObj(); + +var allArgs = [0, String, callee, true, null, 2.5, [1, 2, 3], {'a': 1, 'b' : 2}]; +argCounts = [8, testArgCount]; + +for (argCountIndex = 0; argCountIndex argCounts.length; argCountIndex++) { +argCount = argCounts[argCountIndex]; + +var varArgs = []; +for (i = 0; i argCount; i++) +varArgs[i] = undefined; + +for (numCalls = 0; numCalls 10; numCalls++) { +// Run multiple times so that the JIT kicks in +
[webkit-changes] [106253] trunk/Source
Title: [106253] trunk/Source Revision 106253 Author msab...@apple.com Date 2012-01-30 10:10:43 -0800 (Mon, 30 Jan 2012) Log Message WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. https://bugs.webkit.org/show_bug.cgi?id=76648 Reviewed by Geoffrey Garen. Source/_javascript_Core: Added a new overloaded append member that takes a String argument, an offest and a length to do direct sub string appending to a StringBuilder. * wtf/text/StringBuilder.h: (WTF::StringBuilder::append): Source/WebCore: Using new overloaded append(String, offset, length) member to build result string. The new member properly handles 8/16 bit-ness of strings. Functionality not changed, therefore no new tests. * platform/text/DecodeEscapeSequences.h: (WebCore::decodeEscapeSequences): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/wtf/text/StringBuilder.h trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/text/DecodeEscapeSequences.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106252 => 106253) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-30 17:53:53 UTC (rev 106252) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-30 18:10:43 UTC (rev 106253) @@ -1,3 +1,16 @@ +2012-01-30 Michael Saboff msab...@apple.com + +WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. +https://bugs.webkit.org/show_bug.cgi?id=76648 + +Reviewed by Geoffrey Garen. + +Added a new overloaded append member that takes a String argument, an offest +and a length to do direct sub string appending to a StringBuilder. + +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::append): + 2012-01-29 Zoltan Herczeg zherc...@webkit.org Custom written CSS lexer Modified: trunk/Source/_javascript_Core/wtf/text/StringBuilder.h (106252 => 106253) --- trunk/Source/_javascript_Core/wtf/text/StringBuilder.h 2012-01-30 17:53:53 UTC (rev 106252) +++ trunk/Source/_javascript_Core/wtf/text/StringBuilder.h 2012-01-30 18:10:43 UTC (rev 106253) @@ -86,6 +86,20 @@ append(other.characters(), other.m_length); } +void append(const String string, unsigned offset, unsigned length) +{ +if (!string.length()) +return; + +if ((offset + length) string.length()) +return; + +if (string.is8Bit()) +append(string.characters8() + offset, length); +else +append(string.characters16() + offset, length); +} + void append(const char* characters) { if (characters) Modified: trunk/Source/WebCore/ChangeLog (106252 => 106253) --- trunk/Source/WebCore/ChangeLog 2012-01-30 17:53:53 UTC (rev 106252) +++ trunk/Source/WebCore/ChangeLog 2012-01-30 18:10:43 UTC (rev 106253) @@ -1,3 +1,18 @@ +2012-01-30 Michael Saboff msab...@apple.com + +WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. +https://bugs.webkit.org/show_bug.cgi?id=76648 + +Reviewed by Geoffrey Garen. + +Using new overloaded append(String, offset, length) member to build result string. +The new member properly handles 8/16 bit-ness of strings. + +Functionality not changed, therefore no new tests. + +* platform/text/DecodeEscapeSequences.h: +(WebCore::decodeEscapeSequences): + 2012-01-30 Pavel Feldman pfeld...@google.com Not reviewed: follow up to r105625, use proper event categoty in inspector frontend. Modified: trunk/Source/WebCore/platform/text/DecodeEscapeSequences.h (106252 => 106253) --- trunk/Source/WebCore/platform/text/DecodeEscapeSequences.h 2012-01-30 17:53:53 UTC (rev 106252) +++ trunk/Source/WebCore/platform/text/DecodeEscapeSequences.h 2012-01-30 18:10:43 UTC (rev 106253) @@ -139,11 +139,11 @@ if (decoded.isEmpty()) continue; -result.append(string.characters() + decodedPosition, encodedRunPosition - decodedPosition); +result.append(string, decodedPosition, encodedRunPosition - decodedPosition); result.append(decoded); decodedPosition = encodedRunEnd; } -result.append(string.characters() + decodedPosition, length - decodedPosition); +result.append(string, decodedPosition, length - decodedPosition); return result.toString(); } ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [106254] trunk/Source
Title: [106254] trunk/Source Revision 106254 Author msab...@apple.com Date 2012-01-30 10:22:50 -0800 (Mon, 30 Jan 2012) Log Message Dromaeo tests call parseSimpleLengthValue() on 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=76649 Reviewed by Geoffrey Garen. Source/_javascript_Core: * _javascript_Core.exp: Added export for charactersToDouble. Source/WebCore: No functionality change, therefore no new tests. Added 8 bit patch for parseSimpleLengthValue(). * css/CSSParser.cpp: (WebCore::parseSimpleLengthValue): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.exp trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/css/CSSParser.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106253 => 106254) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-30 18:10:43 UTC (rev 106253) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-30 18:22:50 UTC (rev 106254) @@ -1,5 +1,14 @@ 2012-01-30 Michael Saboff msab...@apple.com +Dromaeo tests call parseSimpleLengthValue() on 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=76649 + +Reviewed by Geoffrey Garen. + +* _javascript_Core.exp: Added export for charactersToDouble. + +2012-01-30 Michael Saboff msab...@apple.com + WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. https://bugs.webkit.org/show_bug.cgi?id=76648 Modified: trunk/Source/_javascript_Core/_javascript_Core.exp (106253 => 106254) --- trunk/Source/_javascript_Core/_javascript_Core.exp 2012-01-30 18:10:43 UTC (rev 106253) +++ trunk/Source/_javascript_Core/_javascript_Core.exp 2012-01-30 18:22:50 UTC (rev 106254) @@ -451,6 +451,7 @@ __ZN3WTF17equalIgnoringCaseEPNS_10StringImplES1_ __ZN3WTF18calculateDSTOffsetEdd __ZN3WTF18calculateUTCOffsetEv +__ZN3WTF18charactersToDoubleEPKhmPbS2_ __ZN3WTF18charactersToDoubleEPKtmPbS2_ __ZN3WTF18dateToDaysFrom1970Eiii __ZN3WTF18monthFromDayInYearEib Modified: trunk/Source/WebCore/ChangeLog (106253 => 106254) --- trunk/Source/WebCore/ChangeLog 2012-01-30 18:10:43 UTC (rev 106253) +++ trunk/Source/WebCore/ChangeLog 2012-01-30 18:22:50 UTC (rev 106254) @@ -1,5 +1,19 @@ 2012-01-30 Michael Saboff msab...@apple.com +Dromaeo tests call parseSimpleLengthValue() on 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=76649 + +Reviewed by Geoffrey Garen. + +No functionality change, therefore no new tests. + +Added 8 bit patch for parseSimpleLengthValue(). + +* css/CSSParser.cpp: +(WebCore::parseSimpleLengthValue): + +2012-01-30 Michael Saboff msab...@apple.com + WebCore decodeEscapeSequences unnecessarily converts 8 bit strings to 16 bit when decoding. https://bugs.webkit.org/show_bug.cgi?id=76648 Modified: trunk/Source/WebCore/css/CSSParser.cpp (106253 => 106254) --- trunk/Source/WebCore/css/CSSParser.cpp 2012-01-30 18:10:43 UTC (rev 106253) +++ trunk/Source/WebCore/css/CSSParser.cpp 2012-01-30 18:22:50 UTC (rev 106254) @@ -411,28 +411,58 @@ static bool parseSimpleLengthValue(CSSMutableStyleDeclaration* declaration, int propertyId, const String string, bool important, bool strict, CSSStyleSheet* contextStyleSheet = 0) { -const UChar* characters = string.characters(); +bool acceptsNegativeNumbers; unsigned length = string.length(); -if (!characters || !length) + +if (!length) return false; -bool acceptsNegativeNumbers; -if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers)) -return false; +double number; +bool ok; CSSPrimitiveValue::UnitTypes unit = CSSPrimitiveValue::CSS_NUMBER; -if (length 2 isASCIIAlphaCaselessEqual(characters[length - 2], 'p') isASCIIAlphaCaselessEqual(characters[length - 1], 'x')) { -length -= 2; -unit = CSSPrimitiveValue::CSS_PX; -} else if (length 1 characters[length - 1] == '%') { -length -= 1; -unit = CSSPrimitiveValue::CSS_PERCENTAGE; + +if (string.is8Bit()) { +const LChar* characters8 = string.characters8(); +if (!characters8) +return false; + +if (!isSimpleLengthPropertyID(propertyId, acceptsNegativeNumbers)) +return false; + +if (length 2 (characters8[length - 2] | 0x20) == 'p' (characters8[length - 1] | 0x20) == 'x') { +length -= 2; +unit = CSSPrimitiveValue::CSS_PX; +} else if (length 1 characters8[length - 1] == '%') { +length -= 1; +unit = CSSPrimitiveValue::CSS_PERCENTAGE; +} + +// We rely on charactersToDouble for validation as well. The function +// will set ok to false if the entire passed-in character range does +// not represent a double. +number = charactersToDouble(characters8, length, ok); +} else { +const UChar* characters16 = string.characters16(); +
[webkit-changes] [106257] trunk/Source/JavaScriptCore
Title: [106257] trunk/Source/_javascript_Core Revision 106257 Author msab...@apple.com Date 2012-01-30 10:51:36 -0800 (Mon, 30 Jan 2012) Log Message stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement https://bugs.webkit.org/show_bug.cgi?id=76651 Reviewed by Geoffrey Garen. Made local function substituteBackreferencesSlow a template function based on character width. Cleaned up getCharacters() in both UString and StringImpl. Changed getCharactersUChar to up convert an 8 bit string to 16 bits if necessary. * runtime/StringPrototype.cpp: (JSC::substituteBackreferencesSlow): (JSC::substituteBackreferences): * runtime/UString.h: (JSC::LChar): (JSC::UChar): * wtf/text/StringImpl.h: (WTF::UChar): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/StringPrototype.cpp trunk/Source/_javascript_Core/runtime/UString.h trunk/Source/_javascript_Core/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106256 => 106257) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-30 18:36:18 UTC (rev 106256) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-30 18:51:36 UTC (rev 106257) @@ -1,3 +1,24 @@ +2012-01-30 Michael Saboff msab...@apple.com + +stringProtoFuncReplace converts 8 bit strings to 16 bit during replacement +https://bugs.webkit.org/show_bug.cgi?id=76651 + +Reviewed by Geoffrey Garen. + +Made local function substituteBackreferencesSlow a template function +based on character width. Cleaned up getCharacters() in both UString +and StringImpl. Changed getCharactersUChar to up convert an 8 bit +string to 16 bits if necessary. + +* runtime/StringPrototype.cpp: +(JSC::substituteBackreferencesSlow): +(JSC::substituteBackreferences): +* runtime/UString.h: +(JSC::LChar): +(JSC::UChar): +* wtf/text/StringImpl.h: +(WTF::UChar): + 2012-01-30 Gavin Barraclough barraclo...@apple.com Clean up putDirect Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (106256 => 106257) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-30 18:36:18 UTC (rev 106256) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-01-30 18:51:36 UTC (rev 106257) @@ -170,9 +170,10 @@ return jsString(exec, string); } +template typename CharType static NEVER_INLINE UString substituteBackreferencesSlow(const UString replacement, const UString source, const int* ovector, RegExp* reg, size_t i) { -VectorUChar substitutedReplacement; +VectorCharType substitutedReplacement; int offset = 0; do { if (i + 1 == replacement.length()) @@ -182,7 +183,7 @@ if (ref == '$') { // $$ - $ ++i; -substitutedReplacement.append(replacement.characters() + offset, i - offset); +substitutedReplacement.append(replacement.getCharactersCharType() + offset, i - offset); offset = i + 1; continue; } @@ -222,15 +223,15 @@ continue; if (i - offset) -substitutedReplacement.append(replacement.characters() + offset, i - offset); +substitutedReplacement.append(replacement.getCharactersCharType() + offset, i - offset); i += 1 + advance; offset = i + 1; if (backrefStart = 0) -substitutedReplacement.append(source.characters() + backrefStart, backrefLength); +substitutedReplacement.append(source.getCharactersCharType() + backrefStart, backrefLength); } while ((i = replacement.find('$', i + 1)) != notFound); if (replacement.length() - offset) -substitutedReplacement.append(replacement.characters() + offset, replacement.length() - offset); +substitutedReplacement.append(replacement.getCharactersCharType() + offset, replacement.length() - offset); substitutedReplacement.shrinkToFit(); return UString::adopt(substitutedReplacement); @@ -239,8 +240,11 @@ static inline UString substituteBackreferences(const UString replacement, const UString source, const int* ovector, RegExp* reg) { size_t i = replacement.find('$', 0); -if (UNLIKELY(i != notFound)) -return substituteBackreferencesSlow(replacement, source, ovector, reg, i); +if (UNLIKELY(i != notFound)) { +if (replacement.is8Bit() source.is8Bit()) +return substituteBackreferencesSlowLChar(replacement, source, ovector, reg, i); +return substituteBackreferencesSlowUChar(replacement, source, ovector, reg, i); +} return replacement; } Modified: trunk/Source/_javascript_Core/runtime/UString.h (106256 => 106257) --- trunk/Source/_javascript_Core/runtime/UString.h 2012-01-30 18:36:18 UTC (rev 106256) +++ trunk/Source/_javascript_Core/runtime/UString.h 2012-01-30 18:51:36 UTC (rev 106257) @@ -139,18 +139,10 @@ }; template -inline
[webkit-changes] [106370] trunk/Source/JavaScriptCore
Title: [106370] trunk/Source/_javascript_Core Revision 106370 Author msab...@apple.com Date 2012-01-31 11:07:44 -0800 (Tue, 31 Jan 2012) Log Message ASSERT(m_jumpsToLink.isEmpty()) failing in ARMv7Assembler dtor https://bugs.webkit.org/show_bug.cgi?id=77443 Reviewed by Gavin Barraclough. Removed failing ASSERT() and thus destructor. The ASSERT isn't needed. We are hitting it in the YARR JIT case where we bail out and go to the interpreter with a partially JIT'ed function. Since we haven't linked the JIT'ed code, there is likely to be some unresolved jumps in the vector when the ARMv7Assembler destructor is called. For the case where we complete the JIT process, we clear the vector at the end of LinkBuffer::linkCode (LinkBuffer.h:292). * assembler/ARMv7Assembler.h: (ARMv7Assembler): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106369 => 106370) --- trunk/Source/_javascript_Core/ChangeLog 2012-01-31 19:00:21 UTC (rev 106369) +++ trunk/Source/_javascript_Core/ChangeLog 2012-01-31 19:07:44 UTC (rev 106370) @@ -1,3 +1,21 @@ +2012-01-31 Michael Saboff msab...@apple.com + +ASSERT(m_jumpsToLink.isEmpty()) failing in ARMv7Assembler dtor +https://bugs.webkit.org/show_bug.cgi?id=77443 + +Reviewed by Gavin Barraclough. + +Removed failing ASSERT() and thus destructor. The ASSERT isn't needed. +We are hitting it in the YARR JIT case where we bail out and go to the +interpreter with a partially JIT'ed function. Since we haven't linked +the JIT'ed code, there is likely to be some unresolved jumps in the vector +when the ARMv7Assembler destructor is called. For the case where we +complete the JIT process, we clear the vector at the end of +LinkBuffer::linkCode (LinkBuffer.h:292). + +* assembler/ARMv7Assembler.h: +(ARMv7Assembler): + 2012-01-31 Anders Carlsson ander...@apple.com VectorT::operator== shouldn't require T to have operator!= Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (106369 => 106370) --- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-01-31 19:00:21 UTC (rev 106369) +++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-01-31 19:07:44 UTC (rev 106370) @@ -414,11 +414,6 @@ class ARMv7Assembler { public: -~ARMv7Assembler() -{ -ASSERT(m_jumpsToLink.isEmpty()); -} - typedef ARMRegisters::RegisterID RegisterID; typedef ARMRegisters::FPSingleRegisterID FPSingleRegisterID; typedef ARMRegisters::FPDoubleRegisterID FPDoubleRegisterID; ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [106417] trunk/Source/JavaScriptCore
Title: [106417] trunk/Source/_javascript_Core Revision 106417 Author msab...@apple.com Date 2012-01-31 17:49:15 -0800 (Tue, 31 Jan 2012) Log Message StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase https://bugs.webkit.org/show_bug.cgi?id=76647 Reviewed by Darin Adler. Changed stringProtoFuncToUpperCase to call StringImpl::upper() in a manor similar to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle to special cases. One case is s-sharp (0xdf) which converts to SS. The other case is for characters which become 16 bit values when converted to upper case. For those, we up convert the the source string and use the 16 bit path. * runtime/StringPrototype.cpp: (JSC::stringProtoFuncToUpperCase): * wtf/text/StringImpl.cpp: (WTF::StringImpl::upper): * wtf/unicode/CharacterNames.h: (smallLetterSharpS): New constant Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/StringPrototype.cpp trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp trunk/Source/_javascript_Core/wtf/unicode/CharacterNames.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (106416 => 106417) --- trunk/Source/_javascript_Core/ChangeLog 2012-02-01 01:41:35 UTC (rev 106416) +++ trunk/Source/_javascript_Core/ChangeLog 2012-02-01 01:49:15 UTC (rev 106417) @@ -1,3 +1,23 @@ +2012-01-31 Michael Saboff msab...@apple.com + +StringProtoFuncToUpperCase should call StringImpl::upper similar to StringProtoToLowerCase +https://bugs.webkit.org/show_bug.cgi?id=76647 + +Reviewed by Darin Adler. + +Changed stringProtoFuncToUpperCase to call StringImpl::upper() in a manor similar +to stringProtoFuncToLowerCase(). Fixed StringImpl::upper() to handle to special +cases. One case is s-sharp (0xdf) which converts to SS. The other case is +for characters which become 16 bit values when converted to upper case. For +those, we up convert the the source string and use the 16 bit path. + +* runtime/StringPrototype.cpp: +(JSC::stringProtoFuncToUpperCase): +* wtf/text/StringImpl.cpp: +(WTF::StringImpl::upper): +* wtf/unicode/CharacterNames.h: +(smallLetterSharpS): New constant + 2012-01-31 Oliver Hunt oli...@apple.com Remove unneeded sourceId property Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (106416 => 106417) --- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-02-01 01:41:35 UTC (rev 106416) +++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp 2012-02-01 01:49:15 UTC (rev 106417) @@ -1184,9 +1184,9 @@ if (!sSize) return JSValue::encode(sVal); -StringImpl* ourImpl = s.impl(); +StringImpl* ourImpl = s.impl(); RefPtrStringImpl lower = ourImpl-lower(); -if (ourImpl == lower.get()) +if (ourImpl == lower) return JSValue::encode(sVal); return JSValue::encode(jsString(exec, UString(lower.release(; } @@ -1203,32 +1203,11 @@ if (!sSize) return JSValue::encode(sVal); -const UChar* sData = s.characters(); -VectorUChar buffer(sSize); - -UChar ored = 0; -for (int i = 0; i sSize; i++) { -UChar c = sData[i]; -ored |= c; -buffer[i] = toASCIIUpper(c); -} -if (!(ored ~0x7f)) -return JSValue::encode(jsString(exec, UString::adopt(buffer))); - -bool error; -int length = Unicode::toUpper(buffer.data(), sSize, sData, sSize, error); -if (error) { -buffer.resize(length); -length = Unicode::toUpper(buffer.data(), length, sData, sSize, error); -if (error) -return JSValue::encode(sVal); -} -if (length == sSize) { -if (memcmp(buffer.data(), sData, length * sizeof(UChar)) == 0) -return JSValue::encode(sVal); -} else -buffer.resize(length); -return JSValue::encode(jsString(exec, UString::adopt(buffer))); +StringImpl* sImpl = s.impl(); +RefPtrStringImpl upper = sImpl-upper(); +if (sImpl == upper) +return JSValue::encode(sVal); +return JSValue::encode(jsString(exec, UString(upper.release(; } EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(ExecState* exec) Modified: trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp (106416 => 106417) --- trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-02-01 01:41:35 UTC (rev 106416) +++ trunk/Source/_javascript_Core/wtf/text/StringImpl.cpp 2012-02-01 01:49:15 UTC (rev 106417) @@ -30,7 +30,9 @@ #include StringHash.h #include wtf/StdLibExtras.h #include wtf/WTFThreadData.h +#include wtf/unicode/CharacterNames.h + using namespace std; namespace WTF { @@ -378,19 +380,53 @@ return newImpl.release(); // Do a slower implementation for cases that include non-ASCII Latin-1 characters. -for (int32_t i = 0; i length; i++) -data8[i] =
[webkit-changes] [121806] trunk/Source/JavaScriptCore
Title: [121806] trunk/Source/_javascript_Core Revision 121806 Author msab...@apple.com Date 2012-07-03 15:57:00 -0700 (Tue, 03 Jul 2012) Log Message Enh: Hash Const JSString in Backing Stores to Save Memory https://bugs.webkit.org/show_bug.cgi?id=86024 Reviewed by Oliver Hunt. During garbage collection, each marking thread keeps a HashMap of strings. While visiting via MarkStack::copyAndAppend(), we check to see if the string we are visiting is already in the HashMap. If not we add it. If so, we change the reference to the current string we're visiting to the prior string. To reduce the performance impact of this change, two throttles have ben added. 1) We only try hash consting if a significant number of new strings have been created since the last hash const. Currently this is set at 100 strings. 2) If a string is unique at the end of a marking it will not be checked during further GC phases. In some cases this won't catch all duplicates, but we are trying to catch the growth of duplicate strings. * heap/Heap.cpp: (JSC::Heap::markRoots): * heap/MarkStack.cpp: (JSC::MarkStackThreadSharedData::resetChildren): (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): (JSC::MarkStackThreadSharedData::reset): (JSC::MarkStack::setup): Check to see if enough strings have been created to hash const. (JSC::MarkStack::reset): Added call to clear m_uniqueStrings. (JSC::JSString::tryHashConstLock): New method to lock JSString for hash consting. (JSC::JSString::releaseHashConstLock): New unlock method. (JSC::JSString::shouldTryHashConst): Set of checks to see if we should try to hash const the string. (JSC::MarkStack::internalAppend): New method that performs the hash consting. (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash consting internalAppend(). * heap/MarkStack.h: (MarkStackThreadSharedData): (MarkStack): * runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData): * runtime/JSGlobalData.h: (JSGlobalData): (JSC::JSGlobalData::haveEnoughNewStringsToHashConst): (JSC::JSGlobalData::resetNewStringsSinceLastHashConst): * runtime/JSString.h: (JSString): Changed from using bool flags to using an unsigned m_flags field. This works better with the weakCompareAndSwap in JSString::tryHashConstLock(). Changed the 8bitness setting and checking to use new accessors. (JSC::JSString::JSString): (JSC::JSString::finishCreation): (JSC::JSString::is8Bit): Updated for new m_flags. (JSC::JSString::setIs8Bit): New setter. New hash const flags accessors: (JSC::JSString::isHashConstSingleton): (JSC::JSString::clearHashConstSingleton): (JSC::JSString::setHashConstSingleton): (JSC::JSRopeString::finishCreation): (JSC::JSRopeString::append): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/heap/Heap.cpp trunk/Source/_javascript_Core/heap/MarkStack.cpp trunk/Source/_javascript_Core/heap/MarkStack.h trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp trunk/Source/_javascript_Core/runtime/JSGlobalData.h trunk/Source/_javascript_Core/runtime/JSString.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (121805 => 121806) --- trunk/Source/_javascript_Core/ChangeLog 2012-07-03 21:56:05 UTC (rev 121805) +++ trunk/Source/_javascript_Core/ChangeLog 2012-07-03 22:57:00 UTC (rev 121806) @@ -1,3 +1,66 @@ +2012-07-03 Michael Saboff msab...@apple.com + +Enh: Hash Const JSString in Backing Stores to Save Memory +https://bugs.webkit.org/show_bug.cgi?id=86024 + +Reviewed by Oliver Hunt. + +During garbage collection, each marking thread keeps a HashMap of +strings. While visiting via MarkStack::copyAndAppend(), we check to +see if the string we are visiting is already in the HashMap. If not +we add it. If so, we change the reference to the current string we're +visiting to the prior string. + +To reduce the performance impact of this change, two throttles have +ben added. 1) We only try hash consting if a significant number of new +strings have been created since the last hash const. Currently this is +set at 100 strings. 2) If a string is unique at the end of a marking +it will not be checked during further GC phases. In some cases this +won't catch all duplicates, but we are trying to catch the growth of +duplicate strings. + +* heap/Heap.cpp: +(JSC::Heap::markRoots): +* heap/MarkStack.cpp: +(JSC::MarkStackThreadSharedData::resetChildren): +(JSC::MarkStackThreadSharedData::MarkStackThreadSharedData): +(JSC::MarkStackThreadSharedData::reset): +(JSC::MarkStack::setup): Check to see if enough strings have been created +to hash const. +(JSC::MarkStack::reset): Added call to clear m_uniqueStrings. +(JSC::JSString::tryHashConstLock): New method to lock JSString for +hash consting. +(JSC::JSString::releaseHashConstLock): New unlock method. +
[webkit-changes] [121928] trunk/Source/JavaScriptCore
Title: [121928] trunk/Source/_javascript_Core Revision 121928 Author msab...@apple.com Date 2012-07-05 17:04:05 -0700 (Thu, 05 Jul 2012) Log Message JSString::tryHashConstLock() fails to get exclusive lock https://bugs.webkit.org/show_bug.cgi?id=90639 Reviewed by Oliver Hunt. Added check that the string is already locked even before compare and swap. * heap/MarkStack.cpp: (JSC::JSString::tryHashConstLock): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/heap/MarkStack.cpp Diff Modified: trunk/Source/_javascript_Core/ChangeLog (121927 => 121928) --- trunk/Source/_javascript_Core/ChangeLog 2012-07-05 23:31:00 UTC (rev 121927) +++ trunk/Source/_javascript_Core/ChangeLog 2012-07-06 00:04:05 UTC (rev 121928) @@ -1,3 +1,15 @@ +2012-07-05 Michael Saboff msab...@apple.com + +JSString::tryHashConstLock() fails to get exclusive lock +https://bugs.webkit.org/show_bug.cgi?id=90639 + +Reviewed by Oliver Hunt. + +Added check that the string is already locked even before compare and swap. + +* heap/MarkStack.cpp: +(JSC::JSString::tryHashConstLock): + 2012-07-04 Filip Pizlo fpi...@apple.com Inline property storage should not be wasted when it is exhausted Modified: trunk/Source/_javascript_Core/heap/MarkStack.cpp (121927 => 121928) --- trunk/Source/_javascript_Core/heap/MarkStack.cpp 2012-07-05 23:31:00 UTC (rev 121927) +++ trunk/Source/_javascript_Core/heap/MarkStack.cpp 2012-07-06 00:04:05 UTC (rev 121928) @@ -546,6 +546,10 @@ { #if ENABLE(PARALLEL_GC) unsigned currentFlags = m_flags; + +if (currentFlags HashConstLock) +return false; + unsigned newFlags = currentFlags | HashConstLock; if (!WTF::weakCompareAndSwap(m_flags, currentFlags, newFlags)) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [123008] trunk/Source
Title: [123008] trunk/Source Revision 123008 Author msab...@apple.com Date 2012-07-18 13:22:43 -0700 (Wed, 18 Jul 2012) Log Message Make TextCodecLatin1 handle 8 bit data without converting to UChar's https://bugs.webkit.org/show_bug.cgi?id=90319 Reviewed by Oliver Hunt. Source/WebCore: Updated codec to create 8 bit strings where possible. We assume that the incoming stream can all be decoded as 8-bit values. If we find a 16-bit value, we take the already decoded data and copy / convert it to a 16-bit buffer and then continue process the rest of the stream as 16-bits. No new tests, functionality covered with existing tests. * platform/text/TextCodecASCIIFastPath.h: (WebCore::copyASCIIMachineWord): * platform/text/TextCodecLatin1.cpp: (WebCore::TextCodecLatin1::decode): Source/WTF: * wtf/text/StringImpl.h: (StringImpl): Exported LChar variant of adopt(). * wtf/text/WTFString.h: (WTF::String::createUninitialized): Exported LChar variant. Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringImpl.h trunk/Source/WTF/wtf/text/WTFString.h trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/text/TextCodecASCIIFastPath.h trunk/Source/WebCore/platform/text/TextCodecLatin1.cpp Diff Modified: trunk/Source/WTF/ChangeLog (123007 => 123008) --- trunk/Source/WTF/ChangeLog 2012-07-18 20:21:34 UTC (rev 123007) +++ trunk/Source/WTF/ChangeLog 2012-07-18 20:22:43 UTC (rev 123008) @@ -1,3 +1,15 @@ +2012-07-18 Michael Saboff msab...@apple.com + +Make TextCodecLatin1 handle 8 bit data without converting to UChar's +https://bugs.webkit.org/show_bug.cgi?id=90319 + +Reviewed by Oliver Hunt. + +* wtf/text/StringImpl.h: +(StringImpl): Exported LChar variant of adopt(). +* wtf/text/WTFString.h: +(WTF::String::createUninitialized): Exported LChar variant. + 2012-07-18 Rob Buis rb...@rim.com Alignment crash in MIMESniffer Modified: trunk/Source/WTF/wtf/text/StringImpl.h (123007 => 123008) --- trunk/Source/WTF/wtf/text/StringImpl.h 2012-07-18 20:21:34 UTC (rev 123007) +++ trunk/Source/WTF/wtf/text/StringImpl.h 2012-07-18 20:22:43 UTC (rev 123008) @@ -282,7 +282,7 @@ return adoptRef(new StringImpl(rep-m_data16 + offset, length, ownerRep)); } -static PassRefPtrStringImpl createUninitialized(unsigned length, LChar* data); +WTF_EXPORT_PRIVATE static PassRefPtrStringImpl createUninitialized(unsigned length, LChar* data); WTF_EXPORT_PRIVATE static PassRefPtrStringImpl createUninitialized(unsigned length, UChar* data); template typename T static ALWAYS_INLINE PassRefPtrStringImpl tryCreateUninitialized(unsigned length, T* output) { @@ -336,8 +336,8 @@ return empty(); } -static PassRefPtrStringImpl adopt(StringBufferLChar buffer); -WTF_EXPORT_PRIVATE static PassRefPtrStringImpl adopt(StringBufferUChar buffer); +WTF_EXPORT_PRIVATE static PassRefPtrStringImpl adopt(StringBufferUChar); +WTF_EXPORT_PRIVATE static PassRefPtrStringImpl adopt(StringBufferLChar); #if PLATFORM(QT) HAVE(QT5) static PassRefPtrStringImpl adopt(QStringData*); Modified: trunk/Source/WTF/wtf/text/WTFString.h (123007 => 123008) --- trunk/Source/WTF/wtf/text/WTFString.h 2012-07-18 20:21:34 UTC (rev 123007) +++ trunk/Source/WTF/wtf/text/WTFString.h 2012-07-18 20:22:43 UTC (rev 123008) @@ -321,6 +321,7 @@ // into the buffer returned in data before the returned string is used. // Failure to do this will have unpredictable results. static String createUninitialized(unsigned length, UChar* data) { return StringImpl::createUninitialized(length, data); } +static String createUninitialized(unsigned length, LChar* data) { return StringImpl::createUninitialized(length, data); } WTF_EXPORT_PRIVATE void split(const String separator, VectorString result) const; WTF_EXPORT_PRIVATE void split(const String separator, bool allowEmptyEntries, VectorString result) const; Modified: trunk/Source/WebCore/ChangeLog (123007 => 123008) --- trunk/Source/WebCore/ChangeLog 2012-07-18 20:21:34 UTC (rev 123007) +++ trunk/Source/WebCore/ChangeLog 2012-07-18 20:22:43 UTC (rev 123008) @@ -1,3 +1,23 @@ +2012-07-18 Michael Saboff msab...@apple.com + +Make TextCodecLatin1 handle 8 bit data without converting to UChar's +https://bugs.webkit.org/show_bug.cgi?id=90319 + +Reviewed by Oliver Hunt. + +Updated codec to create 8 bit strings where possible. +We assume that the incoming stream can all be decoded as 8-bit values. +If we find a 16-bit value, we take the already decoded data and +copy / convert it to a 16-bit buffer and then continue process the rest +of the stream as 16-bits. + +No new tests, functionality covered with existing tests. + +* platform/text/TextCodecASCIIFastPath.h: +(WebCore::copyASCIIMachineWord): +* platform/text/TextCodecLatin1.cpp: +
[webkit-changes] [123011] trunk/Source/WebCore
Title: [123011] trunk/Source/WebCore Revision 123011 Author msab...@apple.com Date 2012-07-18 13:28:39 -0700 (Wed, 18 Jul 2012) Log Message Make TextCodecUTF8 handle 8 bit data without converting to UChar's https://bugs.webkit.org/show_bug.cgi?id=90320 Reviewed by Oliver Hunt. Change UTF8 Codec to produce 8-bit strings when data fits in 8-bit range. First we try decoding the string as all 8-bit and then fall back to 16 bit when we find the first character that doesn't fit in 8 bits. Then we take the already decoded data and copy / convert it to a 16-bit buffer and then continue process the rest of the stream as 16-bits. No new tests, no change in functionality. * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::handleError): (WebCore::TextCodecUTF8::decode): * platform/text/TextCodecUTF8.h: (TextCodecUTF8): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp trunk/Source/WebCore/platform/text/TextCodecUTF8.h Diff Modified: trunk/Source/WebCore/ChangeLog (123010 => 123011) --- trunk/Source/WebCore/ChangeLog 2012-07-18 20:27:23 UTC (rev 123010) +++ trunk/Source/WebCore/ChangeLog 2012-07-18 20:28:39 UTC (rev 123011) @@ -1,3 +1,24 @@ +2012-07-18 Michael Saboff msab...@apple.com + +Make TextCodecUTF8 handle 8 bit data without converting to UChar's +https://bugs.webkit.org/show_bug.cgi?id=90320 + +Reviewed by Oliver Hunt. + +Change UTF8 Codec to produce 8-bit strings when data fits in 8-bit range. +First we try decoding the string as all 8-bit and then fall back to 16 bit +when we find the first character that doesn't fit in 8 bits. Then we take +the already decoded data and copy / convert it to a 16-bit buffer and then +continue process the rest of the stream as 16-bits. + +No new tests, no change in functionality. + +* platform/text/TextCodecUTF8.cpp: +(WebCore::TextCodecUTF8::handleError): +(WebCore::TextCodecUTF8::decode): +* platform/text/TextCodecUTF8.h: +(TextCodecUTF8): + 2012-07-18 Sailesh Agrawal s...@chromium.org Chromium Mac: Add TEXTURE_RECTANGLE_ARB support to CCVideoLayerImpl Modified: trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp (123010 => 123011) --- trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp 2012-07-18 20:27:23 UTC (rev 123010) +++ trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp 2012-07-18 20:28:39 UTC (rev 123011) @@ -167,7 +167,8 @@ consumePartialSequenceByte(); } -void TextCodecUTF8::handlePartialSequence(UChar* destination, const uint8_t* source, const uint8_t* end, bool flush, bool stopOnError, bool sawError) +template +bool TextCodecUTF8::handlePartialSequenceLChar(LChar* destination, const uint8_t* source, const uint8_t* end, bool flush, bool, bool) { ASSERT(m_partialSequenceSize); do { @@ -177,10 +178,53 @@ continue; } int count = nonASCIISequenceLength(m_partialSequence[0]); +if (!count) +return true; + +if (count m_partialSequenceSize) { +if (count - m_partialSequenceSize end - source) { +if (!flush) { +// The new data is not enough to complete the sequence, so +// add it to the existing partial sequence. +memcpy(m_partialSequence + m_partialSequenceSize, source, end - source); +m_partialSequenceSize += end - source; +return false; +} +// An incomplete partial sequence at the end is an error, but it will create +// a 16 bit string due to the replacementCharacter. Let the 16 bit path handle +// the error. +return true; +} +memcpy(m_partialSequence + m_partialSequenceSize, source, count - m_partialSequenceSize); +source += count - m_partialSequenceSize; +m_partialSequenceSize = count; +} +int character = decodeNonASCIISequence(m_partialSequence, count); +if ((character == nonCharacter) || (character 0xff)) +return true; + +m_partialSequenceSize -= count; +*destination++ = character; +} while (m_partialSequenceSize); + +return false; +} + +template +bool TextCodecUTF8::handlePartialSequenceUChar(UChar* destination, const uint8_t* source, const uint8_t* end, bool flush, bool stopOnError, bool sawError) +{ +ASSERT(m_partialSequenceSize); +do { +if (isASCII(m_partialSequence[0])) { +*destination++ = m_partialSequence[0]; +consumePartialSequenceByte(); +continue; +} +int count = nonASCIISequenceLength(m_partialSequence[0]); if (!count) { handleError(destination, stopOnError, sawError); if (stopOnError) -return; +return false;
[webkit-changes] [111906] trunk/Source/JavaScriptCore
Title: [111906] trunk/Source/_javascript_Core Revision 111906 Author msab...@apple.com Date 2012-03-23 14:27:20 -0700 (Fri, 23 Mar 2012) Log Message DFG::compileValueToInt32 Sometime Generates GPR to FPR reg back to GPR https://bugs.webkit.org/show_bug.cgi?id=81805 Reviewed by Filip Pizlo. Added SpeculativeJIT::checkGeneratedType() to determine the current format of an operand. Used that information in SpeculativeJIT::compileValueToInt32 to generate code that will use integer and JSValue types in integer format directly without a conversion to double. * _javascript_Core.xcodeproj/project.pbxproj: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::checkGeneratedType): (DFG): (JSC::DFG::SpeculativeJIT::compileValueToInt32): * dfg/DFGSpeculativeJIT.h: (DFG): (SpeculativeJIT): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (111905 => 111906) --- trunk/Source/_javascript_Core/ChangeLog 2012-03-23 21:19:27 UTC (rev 111905) +++ trunk/Source/_javascript_Core/ChangeLog 2012-03-23 21:27:20 UTC (rev 111906) @@ -1,3 +1,24 @@ +2012-03-23 Michael Saboff msab...@apple.com + +DFG::compileValueToInt32 Sometime Generates GPR to FPR reg back to GPR +https://bugs.webkit.org/show_bug.cgi?id=81805 + +Reviewed by Filip Pizlo. + +Added SpeculativeJIT::checkGeneratedType() to determine the current format +of an operand. Used that information in SpeculativeJIT::compileValueToInt32 +to generate code that will use integer and JSValue types in integer +format directly without a conversion to double. + +* _javascript_Core.xcodeproj/project.pbxproj: +* dfg/DFGSpeculativeJIT.cpp: +(JSC::DFG::SpeculativeJIT::checkGeneratedType): +(DFG): +(JSC::DFG::SpeculativeJIT::compileValueToInt32): +* dfg/DFGSpeculativeJIT.h: +(DFG): +(SpeculativeJIT): + 2012-03-23 Steve Falkenburg sfal...@apple.com Update Apple Windows build files for WTF move Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (111905 => 111906) --- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-03-23 21:19:27 UTC (rev 111905) +++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-03-23 21:27:20 UTC (rev 111906) @@ -322,6 +322,10 @@ 651122FD14046A4C002B101D /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* _javascript_Core.framework */; }; 651122FE14046A4C002B101D /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; }; 6511230714046B0A002B101D /* testRegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651122E5140469BA002B101D /* testRegExp.cpp */; }; + 651E7B14151D0F640014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; + 651E7B15151D0FD60014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; + 651E7B16151D0FD70014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; + 651E7B17151D0FD80014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; }; 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; 7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -476,7 +480,6 @@ A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */; }; A7FB60A4103F7DC20017A286 /* PropertyDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */; }; A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; - A8A4748E151A8306004123FF /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; }; BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile;
[webkit-changes] [111907] trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project. pbxproj
Title: [111907] trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj Revision 111907 Author msab...@apple.com Date 2012-03-23 14:38:22 -0700 (Fri, 23 Mar 2012) Log Message Reverting unintential change to _javascript_Core xcode project file checked in with change set r111906. Modified Paths trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj Diff Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (111906 => 111907) --- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-03-23 21:27:20 UTC (rev 111906) +++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj 2012-03-23 21:38:22 UTC (rev 111907) @@ -322,10 +322,6 @@ 651122FD14046A4C002B101D /* _javascript_Core.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* _javascript_Core.framework */; }; 651122FE14046A4C002B101D /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; }; 6511230714046B0A002B101D /* testRegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651122E5140469BA002B101D /* testRegExp.cpp */; }; - 651E7B14151D0F640014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; - 651E7B15151D0FD60014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; - 651E7B16151D0FD70014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; - 651E7B17151D0FD80014C5C2 /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 651E7B13151D0F640014C5C2 /* libWTF.a */; }; 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; }; 655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; }; 7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4EE7080EBB7963005934AA /* StructureChain.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -480,6 +476,7 @@ A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7F9935E0FD7325100A0B2D0 /* JSONObject.cpp */; }; A7FB60A4103F7DC20017A286 /* PropertyDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */; }; A7FB61001040C38B0017A286 /* PropertyDescriptor.h in Headers */ = {isa = PBXBuildFile; fileRef = A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */; settings = {ATTRIBUTES = (Private, ); }; }; + A8A4748E151A8306004123FF /* libWTF.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A8A4748D151A8306004123FF /* libWTF.a */; }; BC02E90D0E1839DB000F9297 /* ErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9050E1839DB000F9297 /* ErrorConstructor.h */; }; BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9070E1839DB000F9297 /* ErrorPrototype.h */; }; BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BC02E9090E1839DB000F9297 /* NativeErrorConstructor.h */; }; @@ -943,7 +940,6 @@ 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypeInfo.h; sourceTree = group; }; 651122E5140469BA002B101D /* testRegExp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = testRegExp.cpp; sourceTree = group; }; 6511230514046A4C002B101D /* testRegExp */ = {isa = PBXFileReference; explicitFileType = compiled.mach-o.executable; includeInIndex = 0; path = testRegExp; sourceTree = BUILT_PRODUCTS_DIR; }; - 651E7B13151D0F640014C5C2 /* libWTF.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libWTF.a; path = ../../WebKitBuild/Debug/libWTF.a; sourceTree = group; }; 65303D631447B9E100D3F904 /* ParserTokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParserTokens.h; sourceTree = group; }; 65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyNameArray.cpp; sourceTree = group; }; 65400C100A69BAF200509887 /* PropertyNameArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PropertyNameArray.h; sourceTree = group; }; @@ -1319,7 +1315,6 @@ files = ( 143A97E60A4A06E200456B66 /* CoreFoundation.framework in Frameworks */, 14BD59C50A3E8F9F00BAF59C /* _javascript_Core.framework in Frameworks */, -651E7B15151D0FD60014C5C2 /* libWTF.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; };
[webkit-changes] [112910] trunk/Source/WebCore
Title: [112910] trunk/Source/WebCore Revision 112910 Author msab...@apple.com Date 2012-04-02 11:13:37 -0700 (Mon, 02 Apr 2012) Log Message WebKit should throttle memory pressure notifications in proportion to handler time https://bugs.webkit.org/show_bug.cgi?id=82674 Reviewed by Geoffrey Garen. Changed the MemoryPressureHandler hold off timer to start timing after respondToMemoryPressure runs. The delay time is now 20 times longer than the time it took for respondToMemoryPressure to run with a minimum of 5 seconds. This throttles the response to low memory events in the extreme case where we are spending most of our time paging / swapping. This is a Mac only change. No additional tests. This passes existing test and was verified using manual tests on a small memory system with many websites open. * platform/mac/MemoryPressureHandlerMac.mm: (WebCore): (WebCore::MemoryPressureHandler::holdOff): (WebCore::MemoryPressureHandler::respondToMemoryPressure): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (112909 => 112910) --- trunk/Source/WebCore/ChangeLog 2012-04-02 18:08:03 UTC (rev 112909) +++ trunk/Source/WebCore/ChangeLog 2012-04-02 18:13:37 UTC (rev 112910) @@ -1,3 +1,25 @@ +2012-04-02 Michael Saboff msab...@apple.com + +WebKit should throttle memory pressure notifications in proportion to handler time +https://bugs.webkit.org/show_bug.cgi?id=82674 + +Reviewed by Geoffrey Garen. + +Changed the MemoryPressureHandler hold off timer to start timing after +respondToMemoryPressure runs. The delay time is now 20 times longer than the +time it took for respondToMemoryPressure to run with a minimum of 5 seconds. +This throttles the response to low memory events in the extreme case where +we are spending most of our time paging / swapping. +This is a Mac only change. + +No additional tests. This passes existing test and was verified using +manual tests on a small memory system with many websites open. + +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore): +(WebCore::MemoryPressureHandler::holdOff): +(WebCore::MemoryPressureHandler::respondToMemoryPressure): + 2012-04-02 Sheriff Bot webkit.review@gmail.com Unreviewed, rolling out r112163. Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (112909 => 112910) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2012-04-02 18:08:03 UTC (rev 112909) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2012-04-02 18:13:37 UTC (rev 112910) @@ -30,6 +30,7 @@ #import WebCore/FontCache.h #import WebCore/MemoryCache.h #import WebCore/PageCache.h +#import wtf/CurrentTime.h #import wtf/FastMalloc.h #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) !PLATFORM(IOS) @@ -46,10 +47,14 @@ static dispatch_source_t _timer_event_source = 0; static int _notifyToken; -// Disable memory event reception for 5 seconds after receiving an event. -// This value seems reasonable and testing verifies that it throttles frequent +// Disable memory event reception for a minimum of s_minimumHoldOffTime +// seconds after receiving an event. Don't let events fire any sooner than +// s_holdOffMultiplier times the last cleanup processing time. Effectively +// this is 1 / s_holdOffMultiplier percent of the time. +// These value seems reasonable and testing verifies that it throttles frequent // low memory events, greatly reducing CPU usage. -static const time_t s_secondsBetweenMemoryCleanup = 5; +static const time_t s_minimumHoldOffTime = 5; +static const time_t s_holdOffMultiplier = 20; void MemoryPressureHandler::install() { @@ -93,13 +98,11 @@ void MemoryPressureHandler::holdOff(unsigned seconds) { -uninstall(); - dispatch_async(dispatch_get_main_queue(), ^{ _timer_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_main_queue()); if (_timer_event_source) { dispatch_set_context(_timer_event_source, this); -dispatch_source_set_timer(_timer_event_source, dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, 1 * s_secondsBetweenMemoryCleanup); +dispatch_source_set_timer(_timer_event_source, dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC), DISPATCH_TIME_FOREVER, 1 * s_minimumHoldOffTime); dispatch_source_set_event_handler(_timer_event_source, ^{ dispatch_source_cancel(_timer_event_source); dispatch_release(_timer_event_source); @@ -113,9 +116,23 @@ void MemoryPressureHandler::respondToMemoryPressure() { -holdOff(s_secondsBetweenMemoryCleanup); +double startTime, endTime; +unsigned holdOffTime; +uninstall(); + +startTime =
[webkit-changes] [112930] trunk/Source/WebCore
Title: [112930] trunk/Source/WebCore Revision 112930 Author msab...@apple.com Date 2012-04-02 13:34:59 -0700 (Mon, 02 Apr 2012) Log Message WebKit should throttle memory pressure notifications in proportion to handler time https://bugs.webkit.org/show_bug.cgi?id=82674 Rubber-stamped by Darin Adler. Updated r112910: http://trac.webkit.org/changeset/112910 to address post checkin concerns raised in original bug. No additional tests. This passes existing test and was verified using manual tests on a small memory system with many websites open. * platform/mac/MemoryPressureHandlerMac.mm: (WebCore): (WebCore::MemoryPressureHandler::respondToMemoryPressure): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/WebCore/ChangeLog (112929 => 112930) --- trunk/Source/WebCore/ChangeLog 2012-04-02 20:34:55 UTC (rev 112929) +++ trunk/Source/WebCore/ChangeLog 2012-04-02 20:34:59 UTC (rev 112930) @@ -1,3 +1,20 @@ +2012-04-02 Michael Saboff msab...@apple.com + +WebKit should throttle memory pressure notifications in proportion to handler time +https://bugs.webkit.org/show_bug.cgi?id=82674 + +Rubber-stamped by Darin Adler. + +Updated r112910: http://trac.webkit.org/changeset/112910 to address +post checkin concerns raised in original bug. + +No additional tests. This passes existing test and was verified using +manual tests on a small memory system with many websites open. + +* platform/mac/MemoryPressureHandlerMac.mm: +(WebCore): +(WebCore::MemoryPressureHandler::respondToMemoryPressure): + 2012-04-02 Darin Fisher da...@chromium.org HistoryItem not updated properly when a form submission begins before a Modified: trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm (112929 => 112930) --- trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2012-04-02 20:34:55 UTC (rev 112929) +++ trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm 2012-04-02 20:34:59 UTC (rev 112930) @@ -38,6 +38,8 @@ #import notify.h #endif +using std::max; + namespace WebCore { #if !defined(BUILDING_ON_LEOPARD) !defined(BUILDING_ON_SNOW_LEOPARD) @@ -53,8 +55,8 @@ // this is 1 / s_holdOffMultiplier percent of the time. // These value seems reasonable and testing verifies that it throttles frequent // low memory events, greatly reducing CPU usage. -static const time_t s_minimumHoldOffTime = 5; -static const time_t s_holdOffMultiplier = 20; +static const unsigned s_minimumHoldOffTime = 5; +static const unsigned s_holdOffMultiplier = 20; void MemoryPressureHandler::install() { @@ -116,23 +118,15 @@ void MemoryPressureHandler::respondToMemoryPressure() { -double startTime, endTime; -unsigned holdOffTime; - uninstall(); -startTime = monotonicallyIncreasingTime(); +double startTime = monotonicallyIncreasingTime(); releaseMemory(false); -endTime = monotonicallyIncreasingTime(); +unsigned holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier; -holdOffTime = (unsigned)((endTime - startTime) * (double)s_holdOffMultiplier); - -if (holdOffTime s_minimumHoldOffTime) -holdOffTime = s_minimumHoldOffTime; - -holdOff(holdOffTime); +holdOff(max(holdOffTime, s_minimumHoldOffTime)); } #endif // !PLATFORM(IOS) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [113253] trunk/Source/JavaScriptCore
Title: [113253] trunk/Source/_javascript_Core Revision 113253 Author msab...@apple.com Date 2012-04-04 15:42:29 -0700 (Wed, 04 Apr 2012) Log Message Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP https://bugs.webkit.org/show_bug.cgi?id=83191 Reviewed by Oliver Hunt. Make are that blinded constant pairs are similarly aligned to the original immediate values so that instructions that expect that alignment work correctly. One example is ARMv7 add/sub imm to SP. * assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::add): Added ASSERT that immediate is word aligned. (JSC::ARMv7Assembler::sub): Added ASSERT that immediate is word aligned. (JSC::ARMv7Assembler::sub_S): Added ASSERT that immediate is word aligned. * assembler/MacroAssembler.h: (JSC::MacroAssembler::additionBlindedConstant): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h trunk/Source/_javascript_Core/assembler/MacroAssembler.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (113252 => 113253) --- trunk/Source/_javascript_Core/ChangeLog 2012-04-04 22:41:56 UTC (rev 113252) +++ trunk/Source/_javascript_Core/ChangeLog 2012-04-04 22:42:29 UTC (rev 113253) @@ -1,3 +1,21 @@ +2012-04-04 Michael Saboff msab...@apple.com + +Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP +https://bugs.webkit.org/show_bug.cgi?id=83191 + +Reviewed by Oliver Hunt. + +Make are that blinded constant pairs are similarly aligned to the +original immediate values so that instructions that expect that +alignment work correctly. One example is ARMv7 add/sub imm to SP. + +* assembler/ARMv7Assembler.h: +(JSC::ARMv7Assembler::add): Added ASSERT that immediate is word aligned. +(JSC::ARMv7Assembler::sub): Added ASSERT that immediate is word aligned. +(JSC::ARMv7Assembler::sub_S): Added ASSERT that immediate is word aligned. +* assembler/MacroAssembler.h: +(JSC::MacroAssembler::additionBlindedConstant): + 2012-04-04 Filip Pizlo fpi...@apple.com DFG should short-circuit Branch(LogicalNot(...)) Modified: trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h (113252 => 113253) --- trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-04-04 22:41:56 UTC (rev 113252) +++ trunk/Source/_javascript_Core/assembler/ARMv7Assembler.h 2012-04-04 22:42:29 UTC (rev 113253) @@ -739,6 +739,7 @@ ASSERT(imm.isValid()); if (rn == ARMRegisters::sp) { +ASSERT(!(imm.getUInt16() 3)); if (!(rd 8) imm.isUInt10()) { m_formatter.oneWordOp5Reg3Imm8(OP_ADD_SP_imm_T1, rd, static_castuint8_t(imm.getUInt10() 2)); return; @@ -1511,6 +1512,7 @@ ASSERT(imm.isValid()); if ((rn == ARMRegisters::sp) (rd == ARMRegisters::sp) imm.isUInt9()) { +ASSERT(!(imm.getUInt16() 3)); m_formatter.oneWordOp9Imm7(OP_SUB_SP_imm_T1, static_castuint8_t(imm.getUInt9() 2)); return; } else if (!((rd | rn) 8)) { @@ -1572,6 +1574,7 @@ ASSERT(imm.isValid()); if ((rn == ARMRegisters::sp) (rd == ARMRegisters::sp) imm.isUInt9()) { +ASSERT(!(imm.getUInt16() 3)); m_formatter.oneWordOp9Imm7(OP_SUB_SP_imm_T1, static_castuint8_t(imm.getUInt9() 2)); return; } else if (!((rd | rn) 8)) { Modified: trunk/Source/_javascript_Core/assembler/MacroAssembler.h (113252 => 113253) --- trunk/Source/_javascript_Core/assembler/MacroAssembler.h 2012-04-04 22:41:56 UTC (rev 113252) +++ trunk/Source/_javascript_Core/assembler/MacroAssembler.h 2012-04-04 22:42:29 UTC (rev 113253) @@ -699,8 +699,11 @@ BlindedImm32 additionBlindedConstant(Imm32 imm) { +// The addition immediate may be used as a pointer offset. Keep aligned based on imm. +static uint32_t maskTable[4] = { 0xfffc, 0x, 0xfffe, 0x }; + uint32_t baseValue = imm.asTrustedImm32().m_value; -uint32_t key = keyForConstant(baseValue); +uint32_t key = keyForConstant(baseValue) maskTable[baseValue 3]; if (key baseValue) key = key - baseValue; return BlindedImm32(baseValue - key, key); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [113262] trunk/Source/JavaScriptCore
Title: [113262] trunk/Source/_javascript_Core Revision 113262 Author msab...@apple.com Date 2012-04-04 16:50:53 -0700 (Wed, 04 Apr 2012) Log Message Fixed minor error: 3 should be 2. Rubber-stamped by Oliver Hunt. * assembler/MacroAssembler.h: (JSC::MacroAssembler::additionBlindedConstant): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/assembler/MacroAssembler.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (113261 => 113262) --- trunk/Source/_javascript_Core/ChangeLog 2012-04-04 23:28:25 UTC (rev 113261) +++ trunk/Source/_javascript_Core/ChangeLog 2012-04-04 23:50:53 UTC (rev 113262) @@ -1,5 +1,14 @@ 2012-04-04 Michael Saboff msab...@apple.com +Fixed minor error: 3 should be 2. + +Rubber-stamped by Oliver Hunt. + +* assembler/MacroAssembler.h: +(JSC::MacroAssembler::additionBlindedConstant): + +2012-04-04 Michael Saboff msab...@apple.com + Constant Blinding for add/sub immediate crashes in ArmV7 when dest is SP https://bugs.webkit.org/show_bug.cgi?id=83191 Modified: trunk/Source/_javascript_Core/assembler/MacroAssembler.h (113261 => 113262) --- trunk/Source/_javascript_Core/assembler/MacroAssembler.h 2012-04-04 23:28:25 UTC (rev 113261) +++ trunk/Source/_javascript_Core/assembler/MacroAssembler.h 2012-04-04 23:50:53 UTC (rev 113262) @@ -703,7 +703,7 @@ static uint32_t maskTable[4] = { 0xfffc, 0x, 0xfffe, 0x }; uint32_t baseValue = imm.asTrustedImm32().m_value; -uint32_t key = keyForConstant(baseValue) maskTable[baseValue 3]; +uint32_t key = keyForConstant(baseValue) maskTable[baseValue 2]; if (key baseValue) key = key - baseValue; return BlindedImm32(baseValue - key, key); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes
[webkit-changes] [113445] trunk/Source
Title: [113445] trunk/Source Revision 113445 Author msab...@apple.com Date 2012-04-06 09:09:22 -0700 (Fri, 06 Apr 2012) Log Message Call Heap::discardAllCompiledCode() in low memory situations https://bugs.webkit.org/show_bug.cgi?id=83335 Reviewed by Geoffrey Garen. Source/_javascript_Core: Restructured Heap::discardAllCompiledCode() to do the Is _javascript_Running? check inline so that it can be called directly without this check. * heap/Heap.cpp: (JSC::Heap::discardAllCompiledCode): (JSC::Heap::collectAllGarbage): * heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be called from WebCore. (Heap): * runtime/JSGlobalData.h: Removed unused void discardAllCompiledCode() declaration. (JSGlobalData): Source/WebCore: Added call to discardAllCompiledCode() when under memory pressure. We can re-JIT as needed. This is similar to what we used to do when we did a full GC which also cleaned up JIT code. Doing a full GC typically didn't help our memory situation, in fact it made things worse in the really low memory situation as it caused more paging. Added pass through discardAllCompiledCode() method to GCController. * bindings/js/GCController.cpp: (WebCore::GCController::discardAllCompiledCode): (WebCore): * bindings/js/GCController.h: (GCController): * platform/mac/MemoryPressureHandlerMac.mm: (WebCore::MemoryPressureHandler::releaseMemory): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/heap/Heap.cpp trunk/Source/_javascript_Core/heap/Heap.h trunk/Source/_javascript_Core/runtime/JSGlobalData.h trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/bindings/js/GCController.cpp trunk/Source/WebCore/bindings/js/GCController.h trunk/Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm Diff Modified: trunk/Source/_javascript_Core/ChangeLog (113444 => 113445) --- trunk/Source/_javascript_Core/ChangeLog 2012-04-06 16:05:06 UTC (rev 113444) +++ trunk/Source/_javascript_Core/ChangeLog 2012-04-06 16:09:22 UTC (rev 113445) @@ -1,3 +1,22 @@ +2012-04-05 Michael Saboff msab...@apple.com + +Call Heap::discardAllCompiledCode() in low memory situations +https://bugs.webkit.org/show_bug.cgi?id=83335 + +Reviewed by Geoffrey Garen. + +Restructured Heap::discardAllCompiledCode() to do the Is _javascript_Running? +check inline so that it can be called directly without this check. + +* heap/Heap.cpp: +(JSC::Heap::discardAllCompiledCode): +(JSC::Heap::collectAllGarbage): +* heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be +called from WebCore. +(Heap): +* runtime/JSGlobalData.h: Removed unused void discardAllCompiledCode() declaration. +(JSGlobalData): + 2012-04-05 Benjamin Poulain bpoul...@apple.com Speed up the conversion from JSValue to String for bulk operations Modified: trunk/Source/_javascript_Core/heap/Heap.cpp (113444 => 113445) --- trunk/Source/_javascript_Core/heap/Heap.cpp 2012-04-06 16:05:06 UTC (rev 113444) +++ trunk/Source/_javascript_Core/heap/Heap.cpp 2012-04-06 16:09:22 UTC (rev 113445) @@ -772,8 +772,9 @@ { // If _javascript_ is running, it's not safe to recompile, since we'll end // up throwing away code that is live on the stack. -ASSERT(!m_globalData-dynamicGlobalObject); - +if (m_globalData-dynamicGlobalObject) +return; + for (FunctionExecutable* current = m_functions.head(); current; current = current-next()) current-discardCode(); } @@ -782,8 +783,7 @@ { if (!m_isSafeToCollect) return; -if (!m_globalData-dynamicGlobalObject) -discardAllCompiledCode(); +discardAllCompiledCode(); collect(DoSweep); } Modified: trunk/Source/_javascript_Core/heap/Heap.h (113444 => 113445) --- trunk/Source/_javascript_Core/heap/Heap.h 2012-04-06 16:05:06 UTC (rev 113444) +++ trunk/Source/_javascript_Core/heap/Heap.h 2012-04-06 16:09:22 UTC (rev 113445) @@ -148,7 +148,7 @@ double lastGCLength() { return m_lastGCLength; } -void discardAllCompiledCode(); +JS_EXPORT_PRIVATE void discardAllCompiledCode(); private: friend class CodeBlock; Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (113444 => 113445) --- trunk/Source/_javascript_Core/runtime/JSGlobalData.h 2012-04-06 16:05:06 UTC (rev 113444) +++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h 2012-04-06 16:09:22 UTC (rev 113445) @@ -324,7 +324,6 @@ JS_EXPORT_PRIVATE void startSampling(); JS_EXPORT_PRIVATE void stopSampling(); JS_EXPORT_PRIVATE void dumpSampleData(ExecState* exec); -void discardAllCompiledCode(); RegExpCache* regExpCache() { return m_regExpCache; } #if ENABLE(REGEXP_TRACING) void addRegExpToTrace(PassRefPtrRegExp regExp); Modified: trunk/Source/WebCore/ChangeLog (113444 => 113445) --- trunk/Source/WebCore/ChangeLog
[webkit-changes] [123639] trunk/Source/WebCore
Title: [123639] trunk/Source/WebCore Revision 123639 Author msab...@apple.com Date 2012-07-25 11:19:09 -0700 (Wed, 25 Jul 2012) Log Message Unreviewed build fix after r123624. * inspector/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::clearGeolocationOverride): Changed ASSERT_UNUSED() to UNUSED_PARAM(). Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/inspector/InspectorPageAgent.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (123638 => 123639) --- trunk/Source/WebCore/ChangeLog 2012-07-25 18:16:18 UTC (rev 123638) +++ trunk/Source/WebCore/ChangeLog 2012-07-25 18:19:09 UTC (rev 123639) @@ -1,3 +1,11 @@ +2012-07-25 Michael Saboff msab...@apple.com + +Unreviewed build fix after r123624. + +* inspector/InspectorPageAgent.cpp: +(WebCore::InspectorPageAgent::clearGeolocationOverride): +Changed ASSERT_UNUSED() to UNUSED_PARAM(). + 2012-07-25 Pavel Feldman pfeld...@chromium.org Web inspector auto-completes optimizequality but then complains Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (123638 => 123639) --- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-07-25 18:16:18 UTC (rev 123638) +++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp 2012-07-25 18:19:09 UTC (rev 123639) @@ -1001,7 +1001,7 @@ if (!m_geolocationOverridden) return; #if ENABLE(GEOLOCATION) -ASSERT_UNUSED(error, true); +UNUSED_PARAM(error); m_geolocationOverridden = false; m_geolocationPosition.clear(); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [123650] trunk/LayoutTests
Title: [123650] trunk/LayoutTests Revision 123650 Author msab...@apple.com Date 2012-07-25 13:15:31 -0700 (Wed, 25 Jul 2012) Log Message r123492 Changed output of msub-anonymous-child-render-crash.html LayoutTest https://bugs.webkit.org/show_bug.cgi?id=92284 Rubber-stamped by Beth Dakin. Rebaselined test output. * mathml/msub-anonymous-child-render-crash-expected.txt: r123492 changed the way inline-tables are rendered. Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt Diff Modified: trunk/LayoutTests/ChangeLog (123649 => 123650) --- trunk/LayoutTests/ChangeLog 2012-07-25 20:06:55 UTC (rev 123649) +++ trunk/LayoutTests/ChangeLog 2012-07-25 20:15:31 UTC (rev 123650) @@ -1,3 +1,15 @@ +2012-07-25 Michael Saboff msab...@apple.com + +r123492 Changed output of msub-anonymous-child-render-crash.html LayoutTest +https://bugs.webkit.org/show_bug.cgi?id=92284 + +Rubber-stamped by Beth Dakin. + +Rebaselined test output. + +* mathml/msub-anonymous-child-render-crash-expected.txt: +r123492 changed the way inline-tables are rendered. + 2012-07-25 Andrew Wilson atwil...@chromium.org Unreviewed chromium expectations change to mark tests as slow. Modified: trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt (123649 => 123650) --- trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt 2012-07-25 20:06:55 UTC (rev 123649) +++ trunk/LayoutTests/mathml/msub-anonymous-child-render-crash-expected.txt 2012-07-25 20:15:31 UTC (rev 123650) @@ -1,5 +1,7 @@ This test passes if it does not crash. -X3Y3X +X 3 +Y3X +3 2Y32 ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [123954] trunk/LayoutTests
Title: [123954] trunk/LayoutTests Revision 123954 Author msab...@apple.com Date 2012-07-27 23:11:15 -0700 (Fri, 27 Jul 2012) Log Message https://bugs.webkit.org/show_bug.cgi?id=92573 Mac Lion: http/tests/misc/submit-post-keygen.html fails on buildbots * platform/mac-lion/Skipped: Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/platform/mac-lion/Skipped Diff Modified: trunk/LayoutTests/ChangeLog (123953 => 123954) --- trunk/LayoutTests/ChangeLog 2012-07-28 06:00:39 UTC (rev 123953) +++ trunk/LayoutTests/ChangeLog 2012-07-28 06:11:15 UTC (rev 123954) @@ -1,3 +1,10 @@ +2012-07-27 Michael Saboff msab...@apple.com + +https://bugs.webkit.org/show_bug.cgi?id=92573 +Mac Lion: http/tests/misc/submit-post-keygen.html fails on buildbots + +* platform/mac-lion/Skipped: + 2012-07-27 Kihong Kwon kihong.k...@samsung.com [EFL] Support for HTML media capture Modified: trunk/LayoutTests/platform/mac-lion/Skipped (123953 => 123954) --- trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-28 06:00:39 UTC (rev 123953) +++ trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-28 06:11:15 UTC (rev 123954) @@ -123,3 +123,6 @@ # https://bugs.webkit.org/show_bug.cgi?id=86785 fast/repaint/float-overflow-right.html fast/repaint/float-overflow.html + +# https://bugs.webkit.org/show_bug.cgi?id=92573 +http/tests/misc/submit-post-keygen.html ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [124126] trunk/LayoutTests
Title: [124126] trunk/LayoutTests Revision 124126 Author msab...@apple.com Date 2012-07-30 17:46:23 -0700 (Mon, 30 Jul 2012) Log Message inspector/profiler/heap-snapshot-containment-show-all.html test crashing during WebView closing rdar://problem/11991881 * platform/mac-lion/Skipped: Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/platform/mac-lion/Skipped Diff Modified: trunk/LayoutTests/ChangeLog (124125 => 124126) --- trunk/LayoutTests/ChangeLog 2012-07-31 00:42:17 UTC (rev 124125) +++ trunk/LayoutTests/ChangeLog 2012-07-31 00:46:23 UTC (rev 124126) @@ -1,3 +1,10 @@ +2012-07-30 Michael Saboff msab...@apple.com + +inspector/profiler/heap-snapshot-containment-show-all.html test crashing during WebView closing +rdar://problem/11991881 + +* platform/mac-lion/Skipped: + 2012-07-30 Sadrul Habib Chowdhury sad...@chromium.org Propagate gesture events to plugins. Modified: trunk/LayoutTests/platform/mac-lion/Skipped (124125 => 124126) --- trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-31 00:42:17 UTC (rev 124125) +++ trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-31 00:46:23 UTC (rev 124126) @@ -126,3 +126,6 @@ # https://bugs.webkit.org/show_bug.cgi?id=92573 http/tests/misc/submit-post-keygen.html + +# rdar://problem/11991881 +inspector/profiler/heap-snapshot-containment-show-all.html ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [124221] trunk/LayoutTests
Title: [124221] trunk/LayoutTests Revision 124221 Author msab...@apple.com Date 2012-07-31 10:43:30 -0700 (Tue, 31 Jul 2012) Log Message inspector/profiler/heap-snapshot-containment-show-all.html test crashing during WebView closing rdar://problem/11991881 * platform/mac-lion/Skipped: Added inspector/debugger/debugger-expand-scope.html to skip list. Modified Paths trunk/LayoutTests/ChangeLog trunk/LayoutTests/platform/mac-lion/Skipped Diff Modified: trunk/LayoutTests/ChangeLog (124220 => 124221) --- trunk/LayoutTests/ChangeLog 2012-07-31 17:42:46 UTC (rev 124220) +++ trunk/LayoutTests/ChangeLog 2012-07-31 17:43:30 UTC (rev 124221) @@ -1,3 +1,10 @@ +2012-07-31 Michael Saboff msab...@apple.com + +inspector/profiler/heap-snapshot-containment-show-all.html test crashing during WebView closing +rdar://problem/11991881 + +* platform/mac-lion/Skipped: Added inspector/debugger/debugger-expand-scope.html to skip list. + 2012-07-31 Csaba Osztrogonác o...@webkit.org [Qt][WK2] Unreviewed gardening, last attempt to paint the WK2 bot green today. Modified: trunk/LayoutTests/platform/mac-lion/Skipped (124220 => 124221) --- trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-31 17:42:46 UTC (rev 124220) +++ trunk/LayoutTests/platform/mac-lion/Skipped 2012-07-31 17:43:30 UTC (rev 124221) @@ -129,3 +129,4 @@ # rdar://problem/11991881 inspector/profiler/heap-snapshot-containment-show-all.html +inspector/debugger/debugger-expand-scope.html ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [127082] trunk
Title: [127082] trunk Revision 127082 Author msab...@apple.com Date 2012-08-29 19:05:15 -0700 (Wed, 29 Aug 2012) Log Message use after free in WebCore::FileReader::doAbort https://bugs.webkit.org/show_bug.cgi?id=91004 Reviewed by Jian Li. Source/WebCore: Added check in FileReader::abort to not process the abort if we aren't in the LOADING state. This is per the FileAPI spec section 8.5.6 step #1. Tests: fast/files/file-reader-immediate-abort.html fast/files/file-reader-done-reading-abort.html * fileapi/FileReader.cpp: (WebCore::FileReader::abort): LayoutTests: New tests to check that FileReader::abort doesn't crash or create events before or after reading. * fast/files/file-reader-done-reading-abort-expected.txt: Added. * fast/files/file-reader-done-reading-abort.html: Added. * fast/files/file-reader-immediate-abort-expected.txt: Added. * fast/files/file-reader-immediate-abort.html: Added. Modified Paths trunk/LayoutTests/ChangeLog trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/fileapi/FileReader.cpp Added Paths trunk/LayoutTests/fast/files/file-reader-done-reading-abort-expected.txt trunk/LayoutTests/fast/files/file-reader-done-reading-abort.html trunk/LayoutTests/fast/files/file-reader-immediate-abort-expected.txt trunk/LayoutTests/fast/files/file-reader-immediate-abort.html Diff Modified: trunk/LayoutTests/ChangeLog (127081 => 127082) --- trunk/LayoutTests/ChangeLog 2012-08-30 02:02:38 UTC (rev 127081) +++ trunk/LayoutTests/ChangeLog 2012-08-30 02:05:15 UTC (rev 127082) @@ -1,3 +1,18 @@ +2012-08-29 Michael Saboff msab...@apple.com + +use after free in WebCore::FileReader::doAbort +https://bugs.webkit.org/show_bug.cgi?id=91004 + +Reviewed by Jian Li. + +New tests to check that FileReader::abort doesn't crash or create events before +or after reading. + +* fast/files/file-reader-done-reading-abort-expected.txt: Added. +* fast/files/file-reader-done-reading-abort.html: Added. +* fast/files/file-reader-immediate-abort-expected.txt: Added. +* fast/files/file-reader-immediate-abort.html: Added. + 2012-08-29 Jessie Berlin jber...@apple.com ASSERTION FAILURE in JSC::JSGlobalData::float32ArrayDescriptor when running fast/js/dfg-float64array.html Added: trunk/LayoutTests/fast/files/file-reader-done-reading-abort-expected.txt (0 => 127082) --- trunk/LayoutTests/fast/files/file-reader-done-reading-abort-expected.txt (rev 0) +++ trunk/LayoutTests/fast/files/file-reader-done-reading-abort-expected.txt 2012-08-30 02:05:15 UTC (rev 127082) @@ -0,0 +1,3 @@ +Test that FileReader.abort after reading is done doesn't fire events. +DONE + Added: trunk/LayoutTests/fast/files/file-reader-done-reading-abort.html (0 => 127082) --- trunk/LayoutTests/fast/files/file-reader-done-reading-abort.html (rev 0) +++ trunk/LayoutTests/fast/files/file-reader-done-reading-abort.html 2012-08-30 02:05:15 UTC (rev 127082) @@ -0,0 +1,67 @@ +!DOCTYPE html +html +body +pre id='console'/pre +script src="" +script +function log(message) +{ +document.getElementById('console').appendChild(document.createTextNode(message + \n)); +} + +function runTest() +{ +log(Test that FileReader.abort after reading is done doesn't fire events.); + +var text = Hello; +var reader = new FileReader(); + +reader._onloadend_ = function(event) { +fileString = event.target.result; +if (fileString != text) +log(Incorrect data read, expected + text + , got + fileString); + +reader._onabort_ = function() { +log(Received abort event after reading); +}; +reader._onload_ = function() { +log(Received load event after reading); +}; +reader._onloadend_ = function() { +log(Received loadend event after reading); +}; +reader._onloadstart_ = function() { +log(Received load start event after reading); +}; +reader._onprogress_ = function() { +log(Received progress event after reading); +}; + +reader.abort(); +gc(); +finishTest(); +} + +reader._onerror_ = function(event) { +log(Received error event: + event.target.error.code); +}; + +reader.readAsText(new Blob([text])); +} + +function finishTest() +{ +log(DONE); +if (testRunner.notifyDone) +testRunner.notifyDone(); +} + +if (window.testRunner) { +testRunner.dumpAsText(); +testRunner.waitUntilDone(); +} + +window._onload_ = runTest; +/script +/body +/html Added: trunk/LayoutTests/fast/files/file-reader-immediate-abort-expected.txt (0 => 127082) --- trunk/LayoutTests/fast/files/file-reader-immediate-abort-expected.txt (rev 0) +++ trunk/LayoutTests/fast/files/file-reader-immediate-abort-expected.txt 2012-08-30 02:05:15 UTC (rev 127082) @@ -0,0 +1,6 @@ +Test that
[webkit-changes] [127508] trunk
Title: [127508] trunk Revision 127508 Author msab...@apple.com Date 2012-09-04 14:32:19 -0700 (Tue, 04 Sep 2012) Log Message equal() in CSSParser.cpp should check the length of characters https://bugs.webkit.org/show_bug.cgi?id=95706 Source/WebCore: Reviewed by Abhishek Arya. Pass the length of string literals to CSSParser static functions equal() and equalIgnoringCase() so that checks won't access out of bounds memory. Added test fast/css/crash-comparing-equal.html. * css/CSSParser.cpp: (WebCore::equal): Use template to retrieve the length of string literal. (WebCore::equalIgnoringCase): Ditto. (WebCore::CSSParser::parseDashboardRegions): Use const char[] instead of const char* LayoutTests: Added test from duplicate defect https://bugs.webkit.org/show_bug.cgi?id=95634. Reviewed by Abhishek Arya. * fast/css/crash-comparing-equal-expected.txt: Added. * fast/css/crash-comparing-equal.html: Added. Modified Paths trunk/LayoutTests/ChangeLog trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/css/CSSParser.cpp Added Paths trunk/LayoutTests/fast/css/crash-comparing-equal-expected.txt trunk/LayoutTests/fast/css/crash-comparing-equal.html Diff Modified: trunk/LayoutTests/ChangeLog (127507 => 127508) --- trunk/LayoutTests/ChangeLog 2012-09-04 21:23:01 UTC (rev 127507) +++ trunk/LayoutTests/ChangeLog 2012-09-04 21:32:19 UTC (rev 127508) @@ -1,3 +1,15 @@ +2012-09-04 Michael Saboff msab...@apple.com + +equal() in CSSParser.cpp should check the length of characters +https://bugs.webkit.org/show_bug.cgi?id=95706 + +Added test from duplicate defect https://bugs.webkit.org/show_bug.cgi?id=95634. + +Reviewed by Abhishek Arya. + +* fast/css/crash-comparing-equal-expected.txt: Added. +* fast/css/crash-comparing-equal.html: Added. + 2012-09-04 Roger Fong roger_f...@apple.com Unreviewed gardening. meda/video-controls-captions.html fails on Windows after it was introduced in http://trac.webkit.org/changeset/127035. Added: trunk/LayoutTests/fast/css/crash-comparing-equal-expected.txt (0 => 127508) --- trunk/LayoutTests/fast/css/crash-comparing-equal-expected.txt (rev 0) +++ trunk/LayoutTests/fast/css/crash-comparing-equal-expected.txt 2012-09-04 21:32:19 UTC (rev 127508) @@ -0,0 +1 @@ +This page shouldn't crash when parsing CSS - Bug 95706. Added: trunk/LayoutTests/fast/css/crash-comparing-equal.html (0 => 127508) --- trunk/LayoutTests/fast/css/crash-comparing-equal.html (rev 0) +++ trunk/LayoutTests/fast/css/crash-comparing-equal.html 2012-09-04 21:32:19 UTC (rev 127508) @@ -0,0 +1,15 @@ +html +head +script +if (window.testRunner) +testRunner.dumpAsText(); +/script +style +#parent { +font: 20px/1 ahem; +/style +/head +body +This page shouldn't crash when parsing CSS - Bug 95706. +/body +/html Modified: trunk/Source/WebCore/ChangeLog (127507 => 127508) --- trunk/Source/WebCore/ChangeLog 2012-09-04 21:23:01 UTC (rev 127507) +++ trunk/Source/WebCore/ChangeLog 2012-09-04 21:32:19 UTC (rev 127508) @@ -1,3 +1,20 @@ +2012-09-04 Michael Saboff msab...@apple.com + +equal() in CSSParser.cpp should check the length of characters +https://bugs.webkit.org/show_bug.cgi?id=95706 + +Reviewed by Abhishek Arya. + +Pass the length of string literals to CSSParser static functions equal() and +equalIgnoringCase() so that checks won't access out of bounds memory. + +Added test fast/css/crash-comparing-equal.html. + +* css/CSSParser.cpp: +(WebCore::equal): Use template to retrieve the length of string literal. +(WebCore::equalIgnoringCase): Ditto. +(WebCore::CSSParser::parseDashboardRegions): Use const char[] instead of const char* + 2012-09-04 Antonio Gomes ago...@rim.com [BlackBerry] Use child/ScrollableContent layer's position instead of parent/ScrollLayer's boundsOrigin Modified: trunk/Source/WebCore/css/CSSParser.cpp (127507 => 127508) --- trunk/Source/WebCore/css/CSSParser.cpp 2012-09-04 21:23:01 UTC (rev 127507) +++ trunk/Source/WebCore/css/CSSParser.cpp 2012-09-04 21:32:19 UTC (rev 127508) @@ -156,14 +156,24 @@ static const unsigned INVALID_NUM_PARSED_PROPERTIES = UINT_MAX; static const double MAX_SCALE = 100; -static bool equal(const CSSParserString a, const char* b) +template unsigned N +static bool equal(const CSSParserString a, const char (b)[N]) { -return a.is8Bit() ? WTF::equal(a.characters8(), reinterpret_castconst LChar*(b), a.length()) : WTF::equal(a.characters16(), reinterpret_castconst LChar*(b), a.length()); +unsigned length = N - 1; // Ignore the trailing null character +if (a.length() != length) +return false; + +return a.is8Bit() ? WTF::equal(a.characters8(), reinterpret_castconst LChar*(b), length) : WTF::equal(a.characters16(), reinterpret_castconst LChar*(b), length); } -static bool
[webkit-changes] [127753] trunk/Source/WebKit2
Title: [127753] trunk/Source/WebKit2 Revision 127753 Author msab...@apple.com Date 2012-09-06 10:14:32 -0700 (Thu, 06 Sep 2012) Log Message WebKit2 IPC always sends strings using 16 bit data format https://bugs.webkit.org/show_bug.cgi?id=95811 Reviewed by Benjamin Poulain. Changed string encoding to pass an 8bit flag and then send either 8 or 16 bit character data. * Platform/CoreIPC/ArgumentCoders.cpp: (CoreIPCencode): (CoreIPC::decodeStringText): New templatized string creation and decoder method. (CoreIPCdecode): Modified Paths trunk/Source/WebKit2/ChangeLog trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp Diff Modified: trunk/Source/WebKit2/ChangeLog (127752 => 127753) --- trunk/Source/WebKit2/ChangeLog 2012-09-06 17:13:48 UTC (rev 127752) +++ trunk/Source/WebKit2/ChangeLog 2012-09-06 17:14:32 UTC (rev 127753) @@ -1,3 +1,18 @@ +2012-09-06 Michael Saboff msab...@apple.com + +WebKit2 IPC always sends strings using 16 bit data format +https://bugs.webkit.org/show_bug.cgi?id=95811 + +Reviewed by Benjamin Poulain. + +Changed string encoding to pass an 8bit flag and then send either 8 or 16 bit +character data. + +* Platform/CoreIPC/ArgumentCoders.cpp: +(CoreIPCencode): +(CoreIPC::decodeStringText): New templatized string creation and decoder method. +(CoreIPCdecode): + 2012-09-06 Carlos Garcia Campos cgar...@igalia.com [GTK] [WK2] Crash when navigating between pages Modified: trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp (127752 => 127753) --- trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp 2012-09-06 17:13:48 UTC (rev 127752) +++ trunk/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.cpp 2012-09-06 17:14:32 UTC (rev 127753) @@ -97,9 +97,32 @@ uint32_t length = string.length(); encoder-encode(length); -encoder-encodeFixedLengthData(reinterpret_castconst uint8_t*(string.characters()), length * sizeof(UChar), __alignof(UChar)); +bool is8Bit = string.is8Bit(); +encoder-encodeBool(is8Bit); +if (is8Bit) +encoder-encodeFixedLengthData(reinterpret_castconst uint8_t*(string.characters8()), length * sizeof(LChar), __alignof(LChar)); +else +encoder-encodeFixedLengthData(reinterpret_castconst uint8_t*(string.characters16()), length * sizeof(UChar), __alignof(UChar)); } +template typename CharacterType +static inline bool decodeStringText(ArgumentDecoder* decoder, uint32_t length, String result) +{ +// Before allocating the string, make sure that the decoder buffer is big enough. +if (!decoder-bufferIsLargeEnoughToContainCharacterType(length)) { +decoder-markInvalid(); +return false; +} + +CharacterType* buffer; +String string = String::createUninitialized(length, buffer); +if (!decoder-decodeFixedLengthData(reinterpret_castuint8_t*(buffer), length * sizeof(CharacterType), __alignof(CharacterType))) +return false; + +result = string; +return true; +} + bool ArgumentCoderString::decode(ArgumentDecoder* decoder, String result) { uint32_t length; @@ -112,19 +135,14 @@ return true; } -// Before allocating the string, make sure that the decoder buffer is big enough. -if (!decoder-bufferIsLargeEnoughToContainUChar(length)) { -decoder-markInvalid(); +bool is8Bit; + +if (!decoder-decodeBool(is8Bit)) return false; -} - -UChar* buffer; -String string = String::createUninitialized(length, buffer); -if (!decoder-decodeFixedLengthData(reinterpret_castuint8_t*(buffer), length * sizeof(UChar), __alignof(UChar))) -return false; - -result = string; -return true; + +if (is8Bit) +return decodeStringTextLChar(decoder, length, result); +return decodeStringTextUChar(decoder, length, result); } } // namespace CoreIPC ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [127799] trunk/Source/WTF
Title: [127799] trunk/Source/WTF Revision 127799 Author msab...@apple.com Date 2012-09-06 16:41:29 -0700 (Thu, 06 Sep 2012) Log Message ENH: Add Logging to StringImpl to track String Types https://bugs.webkit.org/show_bug.cgi?id=95807 Reviewed by Benjamin Poulain. Added StringsStats class that keeps track of the number of strings, number of 8 and 16 bit strings as well as the number of 8 bit strings up converted to 16 bits. The number of characrters for each type is also accumulated. These statistics are output via DataLog every 5000 calls to StringImpl destructor. The 5000 can be adjusted via s_printStringStatsFrequency. This StringStats code is disabled by default and enabled by defining STRING_STATS in wtf/text/StringImpl.h. * wtf/text/StringImpl.cpp: (WTF::StringStats::removeString): (WTF::StringStats::printStats): (WTF::StringImpl::~StringImpl): (WTF::StringImpl::getData16SlowCase): * wtf/text/StringImpl.h: (WTF::StringStats::add8BitString): (StringStats): (WTF::StringStats::add16BitString): (WTF::StringStats::addUpconvertedString): (WTF::StringImpl::StringImpl): (StringImpl): (WTF::StringImpl::isSubString): (WTF::StringImpl::stringStats): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringImpl.cpp trunk/Source/WTF/wtf/text/StringImpl.h Diff Modified: trunk/Source/WTF/ChangeLog (127798 => 127799) --- trunk/Source/WTF/ChangeLog 2012-09-06 23:40:56 UTC (rev 127798) +++ trunk/Source/WTF/ChangeLog 2012-09-06 23:41:29 UTC (rev 127799) @@ -1,3 +1,32 @@ +2012-09-06 Michael Saboff msab...@apple.com + +ENH: Add Logging to StringImpl to track String Types +https://bugs.webkit.org/show_bug.cgi?id=95807 + +Reviewed by Benjamin Poulain. + +Added StringsStats class that keeps track of the number of strings, number of 8 and 16 bit +strings as well as the number of 8 bit strings up converted to 16 bits. The number of characrters +for each type is also accumulated. These statistics are output via DataLog every 5000 +calls to StringImpl destructor. The 5000 can be adjusted via s_printStringStatsFrequency. +This StringStats code is disabled by default and enabled by defining STRING_STATS in +wtf/text/StringImpl.h. + +* wtf/text/StringImpl.cpp: +(WTF::StringStats::removeString): +(WTF::StringStats::printStats): +(WTF::StringImpl::~StringImpl): +(WTF::StringImpl::getData16SlowCase): +* wtf/text/StringImpl.h: +(WTF::StringStats::add8BitString): +(StringStats): +(WTF::StringStats::add16BitString): +(WTF::StringStats::addUpconvertedString): +(WTF::StringImpl::StringImpl): +(StringImpl): +(WTF::StringImpl::isSubString): +(WTF::StringImpl::stringStats): + 2012-09-06 Patrick Gansterer par...@webkit.org Fix export macros in IntegerToStringConversion.h Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (127798 => 127799) --- trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-06 23:40:56 UTC (rev 127798) +++ trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-06 23:41:29 UTC (rev 127799) @@ -32,6 +32,9 @@ #include wtf/WTFThreadData.h #include wtf/unicode/CharacterNames.h +#ifdef STRING_STATS +#include wtf/DataLog.h +#endif using namespace std; @@ -41,10 +44,69 @@ COMPILE_ASSERT(sizeof(StringImpl) == 2 * sizeof(int) + 3 * sizeof(void*), StringImpl_should_stay_small); +#ifdef STRING_STATS +StringStats StringImpl::m_stringStats; + +static unsigned StringStats::s_stringRemovesTillPrintStats = StringStats::s_printStringStatsFrequency; + +void StringStats::removeString(StringImpl* string) +{ +unsigned length = string-length(); +bool isSubString = string-isSubString(); + +--m_totalNumberStrings; + +if (string-has16BitShadow()) { +--m_numberUpconvertedStrings; +if (!isSubString) +m_totalUpconvertedData -= length; +} + +if (string-is8Bit()) { +--m_number8BitStrings; +if (!isSubString) +m_total8BitData -= length; +} else { +--m_number16BitStrings; +if (!isSubString) +m_total16BitData -= length; +} + +if (!--s_stringRemovesTillPrintStats) { +s_stringRemovesTillPrintStats = s_printStringStatsFrequency; +printStats(); +} +} + +void StringStats::printStats() +{ +dataLog(String stats for process id %d:\n, getpid()); + +unsigned long long totalNumberCharacters = m_total8BitData + m_total16BitData; +double percent8Bit = m_totalNumberStrings ? ((double)m_number8BitStrings * 100) / (double)m_totalNumberStrings : 0.0; +double average8bitLength = m_number8BitStrings ? (double)m_total8BitData / (double)m_number8BitStrings : 0.0; +dataLog(%8u (%5.2f%%) 8 bit%12llu chars %12llu bytes avg length %6.1f\n, m_number8BitStrings, percent8Bit, m_total8BitData, m_total8BitData, average8bitLength); + +double percent16Bit =
[webkit-changes] [127801] trunk/Source/WebCore
Title: [127801] trunk/Source/WebCore Revision 127801 Author msab...@apple.com Date 2012-09-06 16:52:46 -0700 (Thu, 06 Sep 2012) Log Message Add 8 bit string data path to TextRun https://bugs.webkit.org/show_bug.cgi?id=95812 Reviewed by Dan Bernstein. Added 8 bit string path to TextRun. Refactored TextRun::data() and ::characters into 8 and 16 bit versions. Made corresponding changes to users of TextRun. For efl, gtk, qt and win platform specific code using TextRun, only the methods have been renamed and the creation of 8 bit TextRuns has been disabled via compilation flags. Someone knowledgeable in those platforms will need to make corresponding changes to enable 8 bit processing of TextRuns. No changes to functionality - behavior covered by existing tests. * platform/graphics/Font.cpp: (WebCore::normalizeSpacesInternal): (WebCore::Font::normalizeSpaces): (WebCore::Font:normalizeSpaces): (WebCore::Font::codePath): (WebCore::Font::expansionOpportunityCount): * platform/graphics/Font.h: (WebCore::Font::characterRangeCodePath): (WebCore::Font::normalizeSpaces): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawBidiText): * platform/graphics/TextRun.cpp: (ExpectedTextRunSize): * platform/graphics/TextRun.h: (WebCore::TextRun::TextRun): (WebCore::TextRun::subRun): (WebCore::TextRun::operator[]): (WebCore::TextRun::data8): (WebCore::TextRun::data16): (WebCore::TextRun::characters8): (WebCore::TextRun::characters16): (WebCore::TextRun::is8Bit): (WebCore::TextRun::setText): (WebCore::TextRun::setCharactersLength): * platform/graphics/WidthIterator.cpp: (WebCore::WidthIterator::WidthIterator): (WebCore::WidthIterator::advance): * platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp: (WebCore::HarfBuzzShaperBase::setNormalizedBuffer): * platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp: (WebCore::HarfBuzzShaper::HarfBuzzShaper): * platform/graphics/mac/ComplexTextController.cpp: (WebCore::ComplexTextController::ComplexTextController): (WebCore::ComplexTextController::collectComplexTextRuns): (WebCore::ComplexTextController::adjustGlyphsAndAdvances): * platform/graphics/pango/FontPango.cpp: (WebCore::Font::drawComplexText): (WebCore::Font::floatWidthForComplexText): (WebCore::Font::offsetForPositionForComplexText): (WebCore::Font::selectionRectForComplexText): * platform/graphics/qt/FontQt.cpp: (WebCore::Font::drawComplexText): (WebCore::Font::floatWidthForComplexText): (WebCore::Font::offsetForPositionForComplexText): (WebCore::Font::selectionRectForComplexText): * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::advance): (WebCore::UniscribeController::shapeAndPlaceItem): * rendering/RenderText.cpp: (WebCore::RenderText::computeCanUseSimpleFontCodePath): * rendering/svg/SVGTextMetrics.cpp: (WebCore::SVGTextMetrics::SVGTextMetrics): * rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::SVGTextMetricsBuilder): (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * svg/SVGFontData.cpp: (WebCore::SVGFontData::applySVGGlyphSelection): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/platform/graphics/Font.cpp trunk/Source/WebCore/platform/graphics/Font.h trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp trunk/Source/WebCore/platform/graphics/TextRun.cpp trunk/Source/WebCore/platform/graphics/TextRun.h trunk/Source/WebCore/platform/graphics/WidthIterator.cpp trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaperBase.cpp trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzShaper.cpp trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp trunk/Source/WebCore/platform/graphics/pango/FontPango.cpp trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp trunk/Source/WebCore/platform/graphics/win/UniscribeController.cpp trunk/Source/WebCore/rendering/RenderText.cpp trunk/Source/WebCore/rendering/svg/SVGTextMetrics.cpp trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp trunk/Source/WebCore/svg/SVGFontData.cpp Diff Modified: trunk/Source/WebCore/ChangeLog (127800 => 127801) --- trunk/Source/WebCore/ChangeLog 2012-09-06 23:50:59 UTC (rev 127800) +++ trunk/Source/WebCore/ChangeLog 2012-09-06 23:52:46 UTC (rev 127801) @@ -1,3 +1,77 @@ +2012-09-06 Michael Saboff msab...@apple.com + +Add 8 bit string data path to TextRun +https://bugs.webkit.org/show_bug.cgi?id=95812 + +Reviewed by Dan Bernstein. + +Added 8 bit string path to TextRun. Refactored TextRun::data() and ::characters into +8 and 16 bit versions. Made corresponding changes to users of TextRun. +For efl, gtk, qt and win platform specific code using TextRun, only the methods have +been renamed and the creation of 8 bit TextRuns has been disabled via compilation +flags. Someone knowledgeable in those platforms will need to make corresponding changes +to enable 8 bit processing of TextRuns. + +No changes to functionality - behavior
[webkit-changes] [127805] trunk/Source/WTF
Title: [127805] trunk/Source/WTF Revision 127805 Author msab...@apple.com Date 2012-09-06 17:43:42 -0700 (Thu, 06 Sep 2012) Log Message Unreviewed fix to r127799. https://bugs.webkit.org/show_bug.cgi?id=95807 Unreviewed fix. Removed extraneous static. This code is hidden behind STRING_STATS define and therefore is not enabled by default. * wtf/text/StringImpl.cpp: Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringImpl.cpp Diff Modified: trunk/Source/WTF/ChangeLog (127804 => 127805) --- trunk/Source/WTF/ChangeLog 2012-09-07 00:36:29 UTC (rev 127804) +++ trunk/Source/WTF/ChangeLog 2012-09-07 00:43:42 UTC (rev 127805) @@ -1,3 +1,15 @@ +2012-09-06 Michael Saboff msab...@apple.com + +Unreviewed fix to r127799. +https://bugs.webkit.org/show_bug.cgi?id=95807 + +Unreviewed fix. + +Removed extraneous static. This code is hidden behind STRING_STATS define and +therefore is not enabled by default. + +* wtf/text/StringImpl.cpp: + 2012-09-06 Lauro Neto lauro.n...@openbossa.org [Qt] Deprecate String += operator Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (127804 => 127805) --- trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 00:36:29 UTC (rev 127804) +++ trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 00:43:42 UTC (rev 127805) @@ -47,7 +47,7 @@ #ifdef STRING_STATS StringStats StringImpl::m_stringStats; -static unsigned StringStats::s_stringRemovesTillPrintStats = StringStats::s_printStringStatsFrequency; +unsigned StringStats::s_stringRemovesTillPrintStats = StringStats::s_printStringStatsFrequency; void StringStats::removeString(StringImpl* string) { ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [127809] trunk/Source
Title: [127809] trunk/Source Revision 127809 Author msab...@apple.com Date 2012-09-06 18:29:12 -0700 (Thu, 06 Sep 2012) Log Message 16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution https://bugs.webkit.org/show_bug.cgi?id=95810 Reviewed by Benjamin Poulain. Source/_javascript_Core: Added 8 bit path that copies the contents of an 8 bit fiber to the 16 bit buffer when resolving a 16 bit rope. * runtime/JSString.cpp: (JSC::JSRopeString::resolveRopeSlowCase): Source/WTF: New copy routine that takes an 8 bit source and a 16 bit destination. Used when copying the contents of an 8 bit fiber to the 16 bit buffer when resolving a 16 bit rope. * wtf/text/StringImpl.h: (WTF::StringImpl::copyChars): (StringImpl): Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/_javascript_Core/runtime/JSString.cpp trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringImpl.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (127808 => 127809) --- trunk/Source/_javascript_Core/ChangeLog 2012-09-07 01:29:12 UTC (rev 127808) +++ trunk/Source/_javascript_Core/ChangeLog 2012-09-07 01:29:12 UTC (rev 127809) @@ -1,3 +1,16 @@ +2012-09-06 Michael Saboff msab...@apple.com + +16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution +https://bugs.webkit.org/show_bug.cgi?id=95810 + +Reviewed by Benjamin Poulain. + +Added 8 bit path that copies the contents of an 8 bit fiber to the 16 bit buffer +when resolving a 16 bit rope. + +* runtime/JSString.cpp: +(JSC::JSRopeString::resolveRopeSlowCase): + 2012-09-06 Gavin Barraclough barraclo...@apple.com JS test suite puts incorrect limitations on Function.toString() Modified: trunk/Source/_javascript_Core/runtime/JSString.cpp (127808 => 127809) --- trunk/Source/_javascript_Core/runtime/JSString.cpp 2012-09-07 01:29:12 UTC (rev 127808) +++ trunk/Source/_javascript_Core/runtime/JSString.cpp 2012-09-07 01:29:12 UTC (rev 127809) @@ -130,7 +130,10 @@ for (size_t i = 0; i s_maxInternalRopeLength m_fibers[i]; ++i) { StringImpl* string = m_fibers[i]-m_value.impl(); unsigned length = string-length(); -StringImpl::copyChars(position, string-characters(), length); +if (string-is8Bit()) +StringImpl::copyChars(position, string-characters8(), length); +else +StringImpl::copyChars(position, string-characters16(), length); position += length; m_fibers[i].clear(); } @@ -202,7 +205,10 @@ StringImpl* string = static_castStringImpl*(currentFiber-m_value.impl()); unsigned length = string-length(); position -= length; -StringImpl::copyChars(position, string-characters(), length); +if (string-is8Bit()) +StringImpl::copyChars(position, string-characters8(), length); +else +StringImpl::copyChars(position, string-characters16(), length); } ASSERT(buffer == position); Modified: trunk/Source/WTF/ChangeLog (127808 => 127809) --- trunk/Source/WTF/ChangeLog 2012-09-07 01:29:12 UTC (rev 127808) +++ trunk/Source/WTF/ChangeLog 2012-09-07 01:29:12 UTC (rev 127809) @@ -1,5 +1,19 @@ 2012-09-06 Michael Saboff msab...@apple.com +16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution +https://bugs.webkit.org/show_bug.cgi?id=95810 + +Reviewed by Benjamin Poulain. + +New copy routine that takes an 8 bit source and a 16 bit destination. Used when copying +the contents of an 8 bit fiber to the 16 bit buffer when resolving a 16 bit rope. + +* wtf/text/StringImpl.h: +(WTF::StringImpl::copyChars): +(StringImpl): + +2012-09-06 Michael Saboff msab...@apple.com + Unreviewed fix to r127799. https://bugs.webkit.org/show_bug.cgi?id=95807 Modified: trunk/Source/WTF/wtf/text/StringImpl.h (127808 => 127809) --- trunk/Source/WTF/wtf/text/StringImpl.h 2012-09-07 01:29:12 UTC (rev 127808) +++ trunk/Source/WTF/wtf/text/StringImpl.h 2012-09-07 01:29:12 UTC (rev 127809) @@ -611,6 +611,12 @@ memcpy(destination, source, numCharacters * sizeof(T)); } +ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source, unsigned numCharacters) +{ +for (unsigned i = 0; i numCharacters; ++i) +destination[i] = source[i]; +} + // Some string features, like refcounting and the atomicity flag, are not // thread-safe. We achieve thread safety by isolation, giving each thread // its own copy of the string. ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [127821] trunk/Source/WTF
Title: [127821] trunk/Source/WTF Revision 127821 Author msab...@apple.com Date 2012-09-06 21:48:23 -0700 (Thu, 06 Sep 2012) Log Message StringBuilder::toAtomicString() can create an 16 bit string with 8 bit contents https://bugs.webkit.org/show_bug.cgi?id=96029 Reviewed by Benjamin Poulain. Added 8 bit path when creating an AtomicString from a partial 8 bit buffer. * wtf/text/StringBuilder.h: (WTF::StringBuilder::toAtomicString): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringBuilder.h Diff Modified: trunk/Source/WTF/ChangeLog (127820 => 127821) --- trunk/Source/WTF/ChangeLog 2012-09-07 04:39:50 UTC (rev 127820) +++ trunk/Source/WTF/ChangeLog 2012-09-07 04:48:23 UTC (rev 127821) @@ -1,5 +1,17 @@ 2012-09-06 Michael Saboff msab...@apple.com +StringBuilder::toAtomicString() can create an 16 bit string with 8 bit contents +https://bugs.webkit.org/show_bug.cgi?id=96029 + +Reviewed by Benjamin Poulain. + +Added 8 bit path when creating an AtomicString from a partial 8 bit buffer. + +* wtf/text/StringBuilder.h: +(WTF::StringBuilder::toAtomicString): + +2012-09-06 Michael Saboff msab...@apple.com + 16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution https://bugs.webkit.org/show_bug.cgi?id=95810 Modified: trunk/Source/WTF/wtf/text/StringBuilder.h (127820 => 127821) --- trunk/Source/WTF/wtf/text/StringBuilder.h 2012-09-07 04:39:50 UTC (rev 127820) +++ trunk/Source/WTF/wtf/text/StringBuilder.h 2012-09-07 04:48:23 UTC (rev 127821) @@ -154,8 +154,11 @@ return AtomicString(); // If the buffer is sufficiently over-allocated, make a new AtomicString from a copy so its buffer is not so large. -if (canShrink()) -return AtomicString(characters(), length()); +if (canShrink()) { +if (is8Bit()) +return AtomicString(characters8(), length()); +return AtomicString(characters16(), length()); +} if (!m_string.isNull()) return AtomicString(m_string); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [127887] trunk/Source/WTF
Title: [127887] trunk/Source/WTF Revision 127887 Author msab...@apple.com Date 2012-09-07 10:46:43 -0700 (Fri, 07 Sep 2012) Log Message equalIgnoringCase of two StringImpls doesn't handle 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=96028 Reviewed by Benjamin Poulain. Added 8 bit checks and paths to CaseFoldingHash::equal. Also cleaned up StringHash::equal(), removing obvious and in one case wrong comments. Moved equalIgnoringCase(UChar*, UChar*) from StringImpl.cpp to StringImpl.h. * wtf/text/StringHash.h: (WTF::StringHash::equal): (WTF::CaseFoldingHash::equal): * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: (WTF::equalIgnoringCase): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringHash.h trunk/Source/WTF/wtf/text/StringImpl.cpp trunk/Source/WTF/wtf/text/StringImpl.h Diff Modified: trunk/Source/WTF/ChangeLog (127886 => 127887) --- trunk/Source/WTF/ChangeLog 2012-09-07 17:25:52 UTC (rev 127886) +++ trunk/Source/WTF/ChangeLog 2012-09-07 17:46:43 UTC (rev 127887) @@ -1,3 +1,21 @@ +2012-09-07 Michael Saboff msab...@apple.com + +equalIgnoringCase of two StringImpls doesn't handle 8 bit strings +https://bugs.webkit.org/show_bug.cgi?id=96028 + +Reviewed by Benjamin Poulain. + +Added 8 bit checks and paths to CaseFoldingHash::equal. Also cleaned up StringHash::equal(), removing +obvious and in one case wrong comments. Moved equalIgnoringCase(UChar*, UChar*) from StringImpl.cpp +to StringImpl.h. + +* wtf/text/StringHash.h: +(WTF::StringHash::equal): +(WTF::CaseFoldingHash::equal): +* wtf/text/StringImpl.cpp: +* wtf/text/StringImpl.h: +(WTF::equalIgnoringCase): + 2012-09-07 Patrick Gansterer par...@webkit.org [WIN] Deprecate String += operator Modified: trunk/Source/WTF/wtf/text/StringHash.h (127886 => 127887) --- trunk/Source/WTF/wtf/text/StringHash.h 2012-09-07 17:25:52 UTC (rev 127886) +++ trunk/Source/WTF/wtf/text/StringHash.h 2012-09-07 17:46:43 UTC (rev 127887) @@ -56,19 +56,14 @@ return false; if (a-is8Bit()) { -if (b-is8Bit()) { -// Both a b are 8 bit. +if (b-is8Bit()) return WTF::equal(a-characters8(), b-characters8(), aLength); -} -// We know that a is 8 bit b is 16 bit. return WTF::equal(a-characters8(), b-characters16(), aLength); } -if (b-is8Bit()) { -// We know that a is 8 bit and b is 16 bit. +if (b-is8Bit()) return WTF::equal(a-characters16(), b-characters8(), aLength); -} return WTF::equal(a-characters16(), b-characters16(), aLength); } @@ -126,7 +121,18 @@ unsigned length = a-length(); if (length != b-length()) return false; -return WTF::Unicode::umemcasecmp(a-characters(), b-characters(), length) == 0; + +if (a-is8Bit()) { +if (b-is8Bit()) +return equalIgnoringCase(a-characters8(), b-characters8(), length); + +return equalIgnoringCase(b-characters16(), a-characters8(), length); +} + +if (b-is8Bit()) +return equalIgnoringCase(a-characters16(), b-characters8(), length); + +return equalIgnoringCase(a-characters16(), b-characters16(), length); } static unsigned hash(const RefPtrStringImpl key) Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (127886 => 127887) --- trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 17:25:52 UTC (rev 127886) +++ trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 17:46:43 UTC (rev 127887) @@ -855,12 +855,6 @@ return true; } -static inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length) -{ -ASSERT(length = 0); -return umemcasecmp(a, b, length) == 0; -} - size_t StringImpl::find(CharacterMatchFunctionPtr matchFunction, unsigned start) { if (is8Bit()) Modified: trunk/Source/WTF/wtf/text/StringImpl.h (127886 => 127887) --- trunk/Source/WTF/wtf/text/StringImpl.h 2012-09-07 17:25:52 UTC (rev 127886) +++ trunk/Source/WTF/wtf/text/StringImpl.h 2012-09-07 17:46:43 UTC (rev 127887) @@ -942,6 +942,11 @@ inline bool equalIgnoringCase(const LChar* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, a, length); } inline bool equalIgnoringCase(const char* a, const UChar* b, unsigned length) { return equalIgnoringCase(b, reinterpret_castconst LChar*(a), length); } inline bool equalIgnoringCase(const char* a, const LChar* b, unsigned length) { return equalIgnoringCase(b, reinterpret_castconst LChar*(a), length); } +inline bool equalIgnoringCase(const UChar* a, const UChar* b, int length) +{ +ASSERT(length = 0); +return !Unicode::umemcasecmp(a, b, length); +} WTF_EXPORT_STRING_API
[webkit-changes] [127928] trunk/Source/WTF
Title: [127928] trunk/Source/WTF Revision 127928 Author msab...@apple.com Date 2012-09-07 15:25:24 -0700 (Fri, 07 Sep 2012) Log Message StringImpl::find(StringImpl*) doesn't handle cases where search and match strings are different bitness https://bugs.webkit.org/show_bug.cgi?id=96125 Reviewed by Benjamin Poulain. Changed findInner and reverseFindInner to be templated on both search and match character types. Changed both find's and reverseFind to use all four bitness combinations of findInner and reverseFindInner. * wtf/text/StringImpl.cpp: (WTF::findInner): (WTF::StringImpl::find): (WTF::reverseFindInner): (WTF::StringImpl::reverseFind): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/wtf/text/StringImpl.cpp Diff Modified: trunk/Source/WTF/ChangeLog (127927 => 127928) --- trunk/Source/WTF/ChangeLog 2012-09-07 22:22:04 UTC (rev 127927) +++ trunk/Source/WTF/ChangeLog 2012-09-07 22:25:24 UTC (rev 127928) @@ -1,5 +1,22 @@ 2012-09-07 Michael Saboff msab...@apple.com +StringImpl::find(StringImpl*) doesn't handle cases where search and match strings are different bitness +https://bugs.webkit.org/show_bug.cgi?id=96125 + +Reviewed by Benjamin Poulain. + +Changed findInner and reverseFindInner to be templated on both search and match character types. +Changed both find's and reverseFind to use all four bitness combinations of findInner and +reverseFindInner. + +* wtf/text/StringImpl.cpp: +(WTF::findInner): +(WTF::StringImpl::find): +(WTF::reverseFindInner): +(WTF::StringImpl::reverseFind): + +2012-09-07 Michael Saboff msab...@apple.com + equalIgnoringCase of two StringImpls doesn't handle 8 bit strings https://bugs.webkit.org/show_bug.cgi?id=96028 Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (127927 => 127928) --- trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 22:22:04 UTC (rev 127927) +++ trunk/Source/WTF/wtf/text/StringImpl.cpp 2012-09-07 22:25:24 UTC (rev 127928) @@ -890,7 +890,7 @@ const UChar* searchCharacters = characters() + index; // Optimization 2: keep a running hash of the strings, -// only call memcmp if the hashes match. +// only call equal if the hashes match. unsigned searchHash = 0; unsigned matchHash = 0; for (unsigned i = 0; i matchLength; ++i) { @@ -943,11 +943,11 @@ return index + i; } -template typename CharType -ALWAYS_INLINE static size_t findInner(const CharType* searchCharacters, const CharType* matchCharacters, unsigned index, unsigned searchLength, unsigned matchLength) +template typename SearchCharacterType, typename MatchCharacterType +ALWAYS_INLINE static size_t findInner(const SearchCharacterType* searchCharacters, const MatchCharacterType* matchCharacters, unsigned index, unsigned searchLength, unsigned matchLength) { // Optimization: keep a running hash of the strings, -// only call memcmp if the hashes match. +// only call equal() if the hashes match. // delta is the number of additional times to test; delta == 0 means test only once. unsigned delta = searchLength - matchLength; @@ -962,7 +962,7 @@ unsigned i = 0; // keep looping until we match -while (searchHash != matchHash || memcmp(searchCharacters + i, matchCharacters, matchLength * sizeof(CharType))) { +while (searchHash != matchHash || !equal(searchCharacters + i, matchCharacters, matchLength)) { if (i == delta) return notFound; searchHash += searchCharacters[i + matchLength]; @@ -999,10 +999,16 @@ if (UNLIKELY(!matchLength)) return 0; -if (is8Bit() matchString-is8Bit()) -return findInner(characters8(), matchString-characters8(), 0, length(), matchLength); +if (is8Bit()) { +if (matchString-is8Bit()) +return findInner(characters8(), matchString-characters8(), 0, length(), matchLength); +return findInner(characters8(), matchString-characters16(), 0, length(), matchLength); +} -return findInner(characters(), matchString-characters(), 0, length(), matchLength); +if (matchString-is8Bit()) +return findInner(characters16(), matchString-characters8(), 0, length(), matchLength); + +return findInner(characters16(), matchString-characters16(), 0, length(), matchLength); } size_t StringImpl::find(StringImpl* matchString, unsigned index) @@ -1035,10 +1041,16 @@ if (matchLength searchLength) return notFound; -if (is8Bit() matchString-is8Bit()) -return findInner(characters8() + index, matchString-characters8(), index, searchLength, matchLength); +if (is8Bit()) { +if (matchString-is8Bit()) +return findInner(characters8() + index, matchString-characters8(), index, searchLength, matchLength); +return findInner(characters8() + index, matchString-characters16(), index, searchLength, matchLength); +} -
[webkit-changes] [128244] trunk/Source/WebCore
Title: [128244] trunk/Source/WebCore Revision 128244 Author msab...@apple.com Date 2012-09-11 16:53:46 -0700 (Tue, 11 Sep 2012) Log Message jsStringWithCache shouldn't call StringImpl::characters() for single character strings https://bugs.webkit.org/show_bug.cgi?id=96439 Reviewed by Geoffrey Garen. Replaced StringImpl-characters()[0] with operator[] access which is character size aware. Also fixed the other FIXME so we now use SmallStrings to retunr the single character string. No functional change, so no new tests. * bindings/js/JSDOMBinding.h: (WebCore::jsStringWithCache): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/bindings/js/JSDOMBinding.h Diff Modified: trunk/Source/WebCore/ChangeLog (128243 => 128244) --- trunk/Source/WebCore/ChangeLog 2012-09-11 23:50:50 UTC (rev 128243) +++ trunk/Source/WebCore/ChangeLog 2012-09-11 23:53:46 UTC (rev 128244) @@ -1,5 +1,20 @@ 2012-09-11 Michael Saboff msab...@apple.com +jsStringWithCache shouldn't call StringImpl::characters() for single character strings +https://bugs.webkit.org/show_bug.cgi?id=96439 + +Reviewed by Geoffrey Garen. + +Replaced StringImpl-characters()[0] with operator[] access which is character size aware. +Also fixed the other FIXME so we now use SmallStrings to retunr the single character string. + +No functional change, so no new tests. + +* bindings/js/JSDOMBinding.h: +(WebCore::jsStringWithCache): + +2012-09-11 Michael Saboff msab...@apple.com + Update ICU header files to more recent version https://bugs.webkit.org/show_bug.cgi?id=96422 Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (128243 => 128244) --- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-09-11 23:50:50 UTC (rev 128243) +++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-09-11 23:53:46 UTC (rev 128244) @@ -421,10 +421,13 @@ if (!stringImpl || !stringImpl-length()) return jsEmptyString(exec); -// FIXME: we shouldn't invoke StringImpl::characters(). -// FIXME: why not just return a SmallStrings when possible? -if (stringImpl-length() == 1 stringImpl-characters()[0] = 0xFF) -return JSC::jsString(exec, s); +if (stringImpl-length() == 1) { +UChar singleCharacter = (*stringImpl)[0]; +if (singleCharacter = JSC::maxSingleCharacterString) { +JSC::JSGlobalData* globalData = exec-globalData(); +return globalData-smallStrings.singleCharacterString(globalData, static_castunsigned char(singleCharacter)); +} +} JSStringCache stringCache = currentWorld(exec)-m_stringCache; if (JSC::JSString* string = stringCache.get(stringImpl)) ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [128246] trunk/Source
Title: [128246] trunk/Source Revision 128246 Author msab...@apple.com Date 2012-09-11 17:09:44 -0700 (Tue, 11 Sep 2012) Log Message Build fixed for http://trac.webkit.org/changeset/128243 Rubber stamped by Stephanie Lewis. Added missing include file needed by 96422. * icu/unicode/ptypes.h: Added. Modified Paths trunk/Source/_javascript_Core/ChangeLog trunk/Source/WTF/ChangeLog trunk/Source/WebCore/ChangeLog trunk/Source/WebKit/mac/ChangeLog Added Paths trunk/Source/_javascript_Core/icu/unicode/ptypes.h trunk/Source/WTF/icu/unicode/ptypes.h trunk/Source/WebCore/icu/unicode/ptypes.h trunk/Source/WebKit/mac/icu/unicode/ptypes.h Diff Modified: trunk/Source/_javascript_Core/ChangeLog (128245 => 128246) --- trunk/Source/_javascript_Core/ChangeLog 2012-09-12 00:00:18 UTC (rev 128245) +++ trunk/Source/_javascript_Core/ChangeLog 2012-09-12 00:09:44 UTC (rev 128246) @@ -1,5 +1,15 @@ 2012-09-11 Michael Saboff msab...@apple.com +Build fixed for http://trac.webkit.org/changeset/128243 + +Rubber stamped by Stephanie Lewis. + +Added missing include file needed by 96422. + +* icu/unicode/ptypes.h: Added. + +2012-09-11 Michael Saboff msab...@apple.com + Update ICU header files to more recent version https://bugs.webkit.org/show_bug.cgi?id=96422 Added: trunk/Source/_javascript_Core/icu/unicode/ptypes.h (0 => 128246) --- trunk/Source/_javascript_Core/icu/unicode/ptypes.h (rev 0) +++ trunk/Source/_javascript_Core/icu/unicode/ptypes.h 2012-09-12 00:09:44 UTC (rev 128246) @@ -0,0 +1,92 @@ +/* +** +* +* Copyright (C) 1997-2010, International Business Machines +* Corporation and others. All Rights Reserved. +* +** +* +* FILE NAME : ptypes.h +* +* DateNameDescription +* 05/13/98nos Creation (content moved here from ptypes.h). +* 03/02/99stephen Added AS400 support. +* 03/30/99stephen Added Linux support. +* 04/13/99stephen Reworked for autoconf. +* 09/18/08srl Moved basic types back to ptypes.h from platform.h +** +*/ + +#ifndef _PTYPES_H +#define _PTYPES_H + +#include sys/types.h + +#include unicode/platform.h + +/*===*/ +/* Generic data types*/ +/*===*/ + +/* If your platform does not have the inttypes.h header, you may + need to edit the typedefs below. */ +#if U_HAVE_INTTYPES_H + +/* autoconf 2.13 sometimes can't properly find the data types in inttypes.h */ +/* os/390 needs inttypes.h, but it doesn't have int8_t, and it sometimes */ +/* doesn't have uint8_t depending on the OS version. */ +/* So we have this work around. */ +#ifdef OS390 +/* The features header is needed to get (u)int64_t sometimes. */ +#include features.h +#if ! U_HAVE_INT8_T +typedef signed char int8_t; +#endif +#if !defined(__uint8_t) +#define __uint8_t 1 +typedef unsigned char uint8_t; +#endif +#endif /* OS390 */ + +#include inttypes.h + +#else /* U_HAVE_INTTYPES_H */ + +#if ! U_HAVE_INT8_T +typedef signed char int8_t; +#endif + +#if ! U_HAVE_UINT8_T +typedef unsigned char uint8_t; +#endif + +#if ! U_HAVE_INT16_T +typedef signed short int16_t; +#endif + +#if ! U_HAVE_UINT16_T +typedef unsigned short uint16_t; +#endif + +#if ! U_HAVE_INT32_T +typedef signed int int32_t; +#endif + +#if ! U_HAVE_UINT32_T +typedef unsigned int uint32_t; +#endif + +#if ! U_HAVE_INT64_T +typedef signed long long int64_t; +/* else we may not have a 64-bit type */ +#endif + +#if ! U_HAVE_UINT64_T +typedef unsigned long long uint64_t; +/* else we may not have a 64-bit type */ +#endif + +#endif /* U_HAVE_INTTYPES_H */ + +#endif /* _PTYPES_H */ + Modified: trunk/Source/WTF/ChangeLog (128245 => 128246) --- trunk/Source/WTF/ChangeLog 2012-09-12 00:00:18 UTC (rev 128245) +++ trunk/Source/WTF/ChangeLog 2012-09-12 00:09:44 UTC (rev 128246) @@ -1,5 +1,15 @@ 2012-09-11 Michael Saboff msab...@apple.com +Build fixed for http://trac.webkit.org/changeset/128243 + +Rubber stamped by Stephanie Lewis. + +Added missing include file needed by 96422. + +* icu/unicode/ptypes.h: Added. + +2012-09-11 Michael Saboff msab...@apple.com + Update ICU header files to more recent version https://bugs.webkit.org/show_bug.cgi?id=96422 Added: trunk/Source/WTF/icu/unicode/ptypes.h (0 => 128246) --- trunk/Source/WTF/icu/unicode/ptypes.h (rev 0) +++ trunk/Source/WTF/icu/unicode/ptypes.h 2012-09-12 00:09:44 UTC (rev 128246) @@ -0,0 +1,92 @@ +/*
[webkit-changes] [128247] trunk/Source/WebCore
Title: [128247] trunk/Source/WebCore Revision 128247 Author msab...@apple.com Date 2012-09-11 17:25:34 -0700 (Tue, 11 Sep 2012) Log Message Unreviewed build fix for http://trac.webkit.org/changeset/128244 Some compilers don't like 0 for operator[](unsigned). Changed to 0u. * bindings/js/JSDOMBinding.h: (WebCore::jsStringWithCache): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/bindings/js/JSDOMBinding.h Diff Modified: trunk/Source/WebCore/ChangeLog (128246 => 128247) --- trunk/Source/WebCore/ChangeLog 2012-09-12 00:09:44 UTC (rev 128246) +++ trunk/Source/WebCore/ChangeLog 2012-09-12 00:25:34 UTC (rev 128247) @@ -1,5 +1,14 @@ 2012-09-11 Michael Saboff msab...@apple.com +Unreviewed build fix for http://trac.webkit.org/changeset/128244 + +Some compilers don't like 0 for operator[](unsigned). Changed to 0u. + +* bindings/js/JSDOMBinding.h: +(WebCore::jsStringWithCache): + +2012-09-11 Michael Saboff msab...@apple.com + Build fixed for http://trac.webkit.org/changeset/128243 Rubber stamped by Stephanie Lewis. Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (128246 => 128247) --- trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-09-12 00:09:44 UTC (rev 128246) +++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h 2012-09-12 00:25:34 UTC (rev 128247) @@ -422,7 +422,7 @@ return jsEmptyString(exec); if (stringImpl-length() == 1) { -UChar singleCharacter = (*stringImpl)[0]; +UChar singleCharacter = (*stringImpl)[0u]; if (singleCharacter = JSC::maxSingleCharacterString) { JSC::JSGlobalData* globalData = exec-globalData(); return globalData-smallStrings.singleCharacterString(globalData, static_castunsigned char(singleCharacter)); ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [128256] trunk/Source/WebCore
Title: [128256] trunk/Source/WebCore Revision 128256 Author msab...@apple.com Date 2012-09-11 18:57:23 -0700 (Tue, 11 Sep 2012) Log Message Build fixed for http://trac.webkit.org/changeset/128243 Unreviewed build fix. Added missing include file needed by 96422 for C++ ICU APIs. * icu/unicode/chariter.h: Added. Modified Paths trunk/Source/WebCore/ChangeLog Added Paths trunk/Source/WebCore/icu/unicode/chariter.h Diff Modified: trunk/Source/WebCore/ChangeLog (128255 => 128256) --- trunk/Source/WebCore/ChangeLog 2012-09-12 01:46:27 UTC (rev 128255) +++ trunk/Source/WebCore/ChangeLog 2012-09-12 01:57:23 UTC (rev 128256) @@ -6,6 +6,16 @@ Added missing include file needed by 96422 for C++ ICU APIs. +* icu/unicode/chariter.h: Added. + +2012-09-11 Michael Saboff msab...@apple.com + +Build fixed for http://trac.webkit.org/changeset/128243 + +Unreviewed build fix. + +Added missing include file needed by 96422 for C++ ICU APIs. + * icu/unicode/bytestream.h: Added. * icu/unicode/rep.h: Added. * icu/unicode/std_string.h: Added. Added: trunk/Source/WebCore/icu/unicode/chariter.h (0 => 128256) --- trunk/Source/WebCore/icu/unicode/chariter.h (rev 0) +++ trunk/Source/WebCore/icu/unicode/chariter.h 2012-09-12 01:57:23 UTC (rev 128256) @@ -0,0 +1,716 @@ +/* + +* +* Copyright (C) 1997-2005, International Business Machines +* Corporation and others. All Rights Reserved. +* + +*/ + +#ifndef CHARITER_H +#define CHARITER_H + +#include unicode/utypes.h +#include unicode/uobject.h +#include unicode/unistr.h +/** + * \file + * \brief C++ API: Character Iterator + */ + +U_NAMESPACE_BEGIN +/** + * Abstract class that defines an API for forward-only iteration + * on text objects. + * This is a minimal interface for iteration without random access + * or backwards iteration. It is especially useful for wrapping + * streams with converters into an object for collation or + * normalization. + * + * pCharacters can be accessed in two ways: as code units or as + * code points. + * Unicode code points are 21-bit integers and are the scalar values + * of Unicode characters. ICU uses the type UChar32 for them. + * Unicode code units are the storage units of a given + * Unicode/UCS Transformation Format (a character encoding scheme). + * With UTF-16, all code points can be represented with either one + * or two code units (surrogates). + * String storage is typically based on code units, while properties + * of characters are typically determined using code point values. + * Some processes may be designed to work with sequences of code units, + * or it may be known that all characters that are important to an + * algorithm can be represented with single code units. + * Other processes will need to use the code point access functions./p + * + * pForwardCharacterIterator provides nextPostInc() to access + * a code unit and advance an internal position into the text object, + * similar to a codereturn text[position++]/code.br + * It provides next32PostInc() to access a code point and advance an internal + * position./p + * + * pnext32PostInc() assumes that the current position is that of + * the beginning of a code point, i.e., of its first code unit. + * After next32PostInc(), this will be true again. + * In general, access to code units and code points in the same + * iteration loop should not be mixed. In UTF-16, if the current position + * is on a second code unit (Low Surrogate), then only that code unit + * is returned even by next32PostInc()./p + * + * pFor iteration with either function, there are two ways to + * check for the end of the iteration. When there are no more + * characters in the text object: + * ul + * liThe hasNext() function returns FALSE./li + * linextPostInc() and next32PostInc() return DONE + * when one attempts to read beyond the end of the text object./li + * /ul + * + * Example: + * \code + * void function1(ForwardCharacterIterator it) { + * UChar32 c; + * while(it.hasNext()) { + * c=it.next32PostInc(); + * // use c + * } + * } + * + * void function1(ForwardCharacterIterator it) { + * UChar c; + * while((c=it.nextPostInc())!=ForwardCharacterIterator::DONE) { + * // use c + * } + * } + * \endcode + * /p + * + * @stable ICU 2.0 + */ +class U_COMMON_API ForwardCharacterIterator : public UObject { +public: +/** + * Value returned by most of ForwardCharacterIterator's functions + * when the iterator has reached the limits of its iteration. + * @stable ICU 2.0 + */ +enum { DONE = 0x }; + +/** + * Destructor. + * @stable ICU 2.0 + */ +virtual ~ForwardCharacterIterator(); + +/** + * Returns true when both iterators refer to the same + *
[webkit-changes] [128339] trunk/Source/WTF
Title: [128339] trunk/Source/WTF Revision 128339 Author msab...@apple.com Date 2012-09-12 10:46:45 -0700 (Wed, 12 Sep 2012) Log Message Build fixed for http://trac.webkit.org/changeset/128243 Unreviewed build fix. Change UnicodeString::extract for gcc based on ICU fix described in http://bugs.icu-project.org/trac/ticket/8197. * icu/unicode/unistr.h: (UnicodeString::extract): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/icu/unicode/unistr.h Diff Modified: trunk/Source/WTF/ChangeLog (128338 => 128339) --- trunk/Source/WTF/ChangeLog 2012-09-12 17:42:23 UTC (rev 128338) +++ trunk/Source/WTF/ChangeLog 2012-09-12 17:46:45 UTC (rev 128339) @@ -1,3 +1,15 @@ +2012-09-12 Michael Saboff msab...@apple.com + +Build fixed for http://trac.webkit.org/changeset/128243 + +Unreviewed build fix. + +Change UnicodeString::extract for gcc based on ICU fix described in +http://bugs.icu-project.org/trac/ticket/8197. + +* icu/unicode/unistr.h: +(UnicodeString::extract): + 2012-09-12 Ilya Tikhonovsky loi...@chromium.org Web Inspector: NMI move String* instrumentation to wtf. Modified: trunk/Source/WTF/icu/unicode/unistr.h (128338 => 128339) --- trunk/Source/WTF/icu/unicode/unistr.h 2012-09-12 17:42:23 UTC (rev 128338) +++ trunk/Source/WTF/icu/unicode/unistr.h 2012-09-12 17:46:45 UTC (rev 128339) @@ -4086,15 +4086,14 @@ { // This dstSize value will be checked explicitly -#if defined(__GNUC__) - // Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address - // This is only an issue when using GCC and certain optimizations are turned on. - return extract(start, _length, dst, dst!=0 ? ((dst = (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage); -#else + // Removed #if defined(__GNUC__) per ICU defect http://bugs.icu-project.org/trac/ticket/8197 return extract(start, _length, dst, dst!=0 ? 0x : 0, codepage); -#endif } - +extract(int32_t start, +int32_t startLength, +char *target, +uint32_t targetLength, +const char *codepage) #endif inline void ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [128340] trunk/Source/WTF
Title: [128340] trunk/Source/WTF Revision 128340 Author msab...@apple.com Date 2012-09-12 11:11:16 -0700 (Wed, 12 Sep 2012) Log Message Build fixed for http://trac.webkit.org/changeset/128243 Unreviewed build fix. Removed temporarily added function signature. * icu/unicode/unistr.h: (UnicodeString::extract): Modified Paths trunk/Source/WTF/ChangeLog trunk/Source/WTF/icu/unicode/unistr.h Diff Modified: trunk/Source/WTF/ChangeLog (128339 => 128340) --- trunk/Source/WTF/ChangeLog 2012-09-12 17:46:45 UTC (rev 128339) +++ trunk/Source/WTF/ChangeLog 2012-09-12 18:11:16 UTC (rev 128340) @@ -4,6 +4,17 @@ Unreviewed build fix. +Removed temporarily added function signature. + +* icu/unicode/unistr.h: +(UnicodeString::extract): + +2012-09-12 Michael Saboff msab...@apple.com + +Build fixed for http://trac.webkit.org/changeset/128243 + +Unreviewed build fix. + Change UnicodeString::extract for gcc based on ICU fix described in http://bugs.icu-project.org/trac/ticket/8197. Modified: trunk/Source/WTF/icu/unicode/unistr.h (128339 => 128340) --- trunk/Source/WTF/icu/unicode/unistr.h 2012-09-12 17:46:45 UTC (rev 128339) +++ trunk/Source/WTF/icu/unicode/unistr.h 2012-09-12 18:11:16 UTC (rev 128340) @@ -4089,11 +4089,6 @@ // Removed #if defined(__GNUC__) per ICU defect http://bugs.icu-project.org/trac/ticket/8197 return extract(start, _length, dst, dst!=0 ? 0x : 0, codepage); } -extract(int32_t start, -int32_t startLength, -char *target, -uint32_t targetLength, -const char *codepage) #endif inline void ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes
[webkit-changes] [128345] trunk/Source/WebCore
Title: [128345] trunk/Source/WebCore Revision 128345 Author msab...@apple.com Date 2012-09-12 12:02:39 -0700 (Wed, 12 Sep 2012) Log Message Build fixed for http://trac.webkit.org/changeset/128243 Unreviewed build fix. Change UnicodeString::extract for gcc based on ICU fix described in http://bugs.icu-project.org/trac/ticket/8197. * icu/unicode/unistr.h: (UnicodeString::extract): Modified Paths trunk/Source/WebCore/ChangeLog trunk/Source/WebCore/icu/unicode/unistr.h Diff Modified: trunk/Source/WebCore/ChangeLog (128344 => 128345) --- trunk/Source/WebCore/ChangeLog 2012-09-12 18:49:25 UTC (rev 128344) +++ trunk/Source/WebCore/ChangeLog 2012-09-12 19:02:39 UTC (rev 128345) @@ -1,3 +1,15 @@ +2012-09-12 Michael Saboff msab...@apple.com + +Build fixed for http://trac.webkit.org/changeset/128243 + +Unreviewed build fix. + +Change UnicodeString::extract for gcc based on ICU fix described in +http://bugs.icu-project.org/trac/ticket/8197. + +* icu/unicode/unistr.h: +(UnicodeString::extract): + 2012-09-12 Christopher Cameron ccame...@chromium.org [chromium] Evict textures through the texture manager instead of the resource provider Modified: trunk/Source/WebCore/icu/unicode/unistr.h (128344 => 128345) --- trunk/Source/WebCore/icu/unicode/unistr.h 2012-09-12 18:49:25 UTC (rev 128344) +++ trunk/Source/WebCore/icu/unicode/unistr.h 2012-09-12 19:02:39 UTC (rev 128345) @@ -4086,15 +4086,9 @@ { // This dstSize value will be checked explicitly -#if defined(__GNUC__) - // Ticket #7039: Clip length to the maximum valid length to the end of addressable memory given the starting address - // This is only an issue when using GCC and certain optimizations are turned on. - return extract(start, _length, dst, dst!=0 ? ((dst = (char*)((size_t)-1) - UINT32_MAX) ? (((char*)UINT32_MAX) - dst) : UINT32_MAX) : 0, codepage); -#else + // Removed #if defined(__GNUC__) per ICU defect http://bugs.icu-project.org/trac/ticket/8197 return extract(start, _length, dst, dst!=0 ? 0x : 0, codepage); -#endif } - #endif inline void ___ webkit-changes mailing list webkit-changes@lists.webkit.org http://lists.webkit.org/mailman/listinfo/webkit-changes