Changeset 50789 in webkit
- Timestamp:
- Nov 10, 2009 11:22:30 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r50711 r50789 1 2009-11-10 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Gavin "avGni arBalroguch" Barraclough. 4 5 Faster Math.random, based on GameRand. 6 7 SunSpider says 1.4% faster. 8 9 * GNUmakefile.am: 10 * JavaScriptCore.gypi: 11 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12 * JavaScriptCore.xcodeproj/project.pbxproj: Added the header to the project. 13 14 * runtime/JSGlobalData.cpp: 15 (JSC::JSGlobalData::JSGlobalData): 16 * runtime/JSGlobalData.h: Use an object to track random number generation 17 state, initialized to the current time. 18 19 * runtime/MathObject.cpp: 20 (JSC::MathObject::MathObject): 21 (JSC::mathProtoFuncRandom): Use the new hotness. 22 23 * runtime/WeakRandom.h: Added. 24 (JSC::WeakRandom::WeakRandom): 25 (JSC::WeakRandom::get): 26 (JSC::WeakRandom::advance): The new hotness. 27 1 28 2009-11-09 Geoffrey Garen <ggaren@apple.com> 2 29 -
trunk/JavaScriptCore/GNUmakefile.am
r50174 r50789 499 499 JavaScriptCore/runtime/UString.cpp \ 500 500 JavaScriptCore/runtime/UString.h \ 501 JavaScriptCore/runtime/WeakRandom.h \ 501 502 JavaScriptCore/wtf/FastAllocBase.h \ 502 503 JavaScriptCore/wtf/FastMalloc.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.gypi
r50174 r50789 333 333 'runtime/UString.cpp', 334 334 'runtime/UString.h', 335 'runtime/WeakRandom.h', 335 336 'wrec/CharacterClass.cpp', 336 337 'wrec/CharacterClass.h', -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r50608 r50789 1211 1211 <File 1212 1212 RelativePath="..\..\runtime\UString.h" 1213 > 1214 </File> 1215 <File 1216 RelativePath="..\..\runtime\WeakRandom.h" 1213 1217 > 1214 1218 </File> -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r50179 r50789 52 52 141211310A48794D00480255 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; }; 53 53 141211340A48795800480255 /* minidom.c in Sources */ = {isa = PBXBuildFile; fileRef = 141211020A48780900480255 /* minidom.c */; }; 54 1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */; }; 54 55 1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; }; 55 56 14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; }; … … 562 563 141211200A48793C00480255 /* minidom */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidom; sourceTree = BUILT_PRODUCTS_DIR; }; 563 564 1419D32C0CEA7CDE00FF507A /* RefCounted.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RefCounted.h; sourceTree = "<group>"; }; 565 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakRandom.h; sourceTree = "<group>"; }; 564 566 1421359A0A677F4F00A8195E /* JSBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBase.cpp; sourceTree = "<group>"; }; 565 567 142711380A460BBB0080EEEA /* JSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBase.h; sourceTree = "<group>"; }; … … 1594 1596 F692A8850255597D01FF60F7 /* UString.cpp */, 1595 1597 F692A8860255597D01FF60F7 /* UString.h */, 1598 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */, 1596 1599 ); 1597 1600 path = runtime; … … 2003 2006 148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */, 2004 2007 14A1563210966365006FA260 /* DateInstanceCache.h in Headers */, 2008 1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */, 2005 2009 ); 2006 2010 runOnlyForDeploymentPostprocessing = 0; -
trunk/JavaScriptCore/runtime/JSGlobalData.cpp
r50711 r50789 149 149 , markStack(vptrSet.jsArrayVPtr) 150 150 , cachedUTCOffset(NaN) 151 , weakRandom(static_cast<int>(currentTime())) 151 152 #ifndef NDEBUG 152 153 , mainThreadOnly(false) -
trunk/JavaScriptCore/runtime/JSGlobalData.h
r50711 r50789 39 39 #include "SmallStrings.h" 40 40 #include "TimeoutChecker.h" 41 #include "WeakRandom.h" 41 42 #include <wtf/Forward.h> 42 43 #include <wtf/HashMap.h> … … 179 180 UString cachedDateString; 180 181 double cachedDateStringValue; 182 183 WeakRandom weakRandom; 181 184 182 185 #ifndef NDEBUG -
trunk/JavaScriptCore/runtime/MathObject.cpp
r48836 r50789 97 97 putDirectWithoutTransition(Identifier(exec, "SQRT1_2"), jsNumber(exec, sqrt(0.5)), DontDelete | DontEnum | ReadOnly); 98 98 putDirectWithoutTransition(Identifier(exec, "SQRT2"), jsNumber(exec, sqrt(2.0)), DontDelete | DontEnum | ReadOnly); 99 WTF::initializeWeakRandomNumberGenerator();100 99 } 101 100 … … 212 211 JSValue JSC_HOST_CALL mathProtoFuncRandom(ExecState* exec, JSObject*, JSValue, const ArgList&) 213 212 { 214 return jsNumber(exec, WTF::weakRandomNumber());213 return jsNumber(exec, exec->globalData().weakRandom.get()); 215 214 } 216 215
Note: See TracChangeset
for help on using the changeset viewer.