Ignore:
Timestamp:
Nov 10, 2009, 11:22:30 PM (16 years ago)
Author:
[email protected]
Message:

Faster Math.random, based on GameRand.

Reviewed by Gavin "avGni arBalroguch" Barraclough.

SunSpider says 1.4% faster.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):

  • runtime/JSGlobalData.h: Use an object to track random number generation

state, initialized to the current time.

  • runtime/MathObject.cpp:

(JSC::MathObject::MathObject):
(JSC::mathProtoFuncRandom): Use the new hotness.

  • runtime/WeakRandom.h: Added.

(JSC::WeakRandom::WeakRandom):
(JSC::WeakRandom::get):
(JSC::WeakRandom::advance): The new hotness.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r50179 r50789  
    5252                141211310A48794D00480255 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
    5353                141211340A48795800480255 /* minidom.c in Sources */ = {isa = PBXBuildFile; fileRef = 141211020A48780900480255 /* minidom.c */; };
     54                1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */ = {isa = PBXBuildFile; fileRef = 1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */; };
    5455                1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1421359A0A677F4F00A8195E /* JSBase.cpp */; };
    5556                14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F692A8580255597D01FF60F7 /* Debugger.cpp */; };
     
    562563                141211200A48793C00480255 /* minidom */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidom; sourceTree = BUILT_PRODUCTS_DIR; };
    563564                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>"; };
    564566                1421359A0A677F4F00A8195E /* JSBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBase.cpp; sourceTree = "<group>"; };
    565567                142711380A460BBB0080EEEA /* JSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBase.h; sourceTree = "<group>"; };
     
    15941596                                F692A8850255597D01FF60F7 /* UString.cpp */,
    15951597                                F692A8860255597D01FF60F7 /* UString.h */,
     1598                                1420BE7A10AA6DDB00F455D2 /* WeakRandom.h */,
    15961599                        );
    15971600                        path = runtime;
     
    20032006                                148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */,
    20042007                                14A1563210966365006FA260 /* DateInstanceCache.h in Headers */,
     2008                                1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */,
    20052009                        );
    20062010                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.