pax_global_header00006660000000000000000000000064121151157360014514gustar00rootroot0000000000000052 comment=6b10fef46edfb4dc2a7aed389d75574c40a14243 v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/000077500000000000000000000000001211511573600172105ustar00rootroot00000000000000v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/.gitignore000066400000000000000000000013511211511573600212000ustar00rootroot00000000000000*.a *.exe *.idb *.lib *.log *.map *.mk *.ncb *.pdb *.pyc *.scons* *.sln *.so *.suo *.user *.vcproj *.xcodeproj #*# *~ .cpplint-cache d8 d8_g shell shell_g /build/Debug /build/gyp /build/Release /obj /out /test/cctest/cctest.status2 /test/es5conform/data /test/message/message.status2 /test/mjsunit/mjsunit.status2 /test/mozilla/CHECKED_OUT_VERSION /test/mozilla/data /test/mozilla/downloaded_* /test/mozilla/mozilla.status2 /test/preparser/preparser.status2 /test/sputnik/sputniktests /test/test262/data /test/test262/test262-* /test/test262/test262.status2 /third_party /tools/jsfunfuzz /tools/jsfunfuzz.zip /tools/oom_dump/oom_dump /tools/oom_dump/oom_dump.o /tools/visual_studio/Debug /tools/visual_studio/Release /xcodebuild TAGS *.Makefile v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/AUTHORS000066400000000000000000000037551211511573600202720ustar00rootroot00000000000000# Below is a list of people and organizations that have contributed # to the V8 project. Names should be added to the list like so: # # Name/Organization Google Inc. Sigma Designs Inc. ARM Ltd. Hewlett-Packard Development Company, LP Igalia, S.L. Joyent, Inc. Akinori MUSHA Alexander Botero-Lowry Alexander Karpinsky Alexandre Vassalotti Andreas Anyuru Bert Belder Burcu Dogan Craig Schlenter Daniel Andersson Daniel James Derek J Conrod Dineel D Sule Erich Ocean Fedor Indutny Filipe David Manana Haitao Feng Ioseb Dzmanashvili Jan de Mooij Jay Freeman James Pike Joel Stanley John Jozwiak Jonathan Liu Kun Zhang Martyn Capewell Mathias Bynens Matt Hanselman Maxim Mossienko Michael Lutz Michael Smith Mike Gilbert Paolo Giarrusso Patrick Gansterer Peter Varga Rafal Krypa Rene Rebe Robert Mustacchi Rodolph Perfetta Ryan Dahl Sandro Santilli Sanjoy Das Subrato K De Tobias Burnus Vlad Burlik Yuqiang Xian Zaheer Ahmad Zhongping Wang v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/ChangeLog000066400000000000000000004124441211511573600207730ustar00rootroot000000000000002012-10-22: Version 3.14.5 Killed off the SCons based build. Added a faster API for creating v8::Integer objects. Speeded up function deoptimization by avoiding quadratic pass over optimized function list. (Chromium issue 155270) Always invoke the default Array.sort functions from builtin functions. (issue 2372) Reverted recent CPU profiler changes because they broke --prof. (issue 2364) Switched code flushing to use different JSFunction field. (issue 1609) Performance and stability improvements on all platforms. 2012-10-15: Version 3.14.4 Allow evals for debugger even if they are prohibited in the debugee context. (Chromium issue 154733) Enabled --verify-heap in release mode (issue 2120) Performance and stability improvements on all platforms. 2012-10-11: Version 3.14.3 Use native context to retrieve ErrorMessageForCodeGenerationFromStrings (Chromium issue 155076). Bumped variable limit further to 2^17 (Chromium issue 151625). Performance and stability improvements on all platforms. 2012-10-10: Version 3.14.2 ARM: allowed VFP3 instructions when hardfloat is enabled. (Chromium issue 152506) Fixed instance_descriptors() and PushStackTraceAndDie regressions. (Chromium issue 151749) Made GDBJIT interface compile again. (issue 1804) Fixed Accessors::FunctionGetPrototype's proto chain traversal. (Chromium issue 143967) Made sure that names of temporaries do not clash with real variables. (issue 2322) Rejected local module declarations. (Chromium issue 150628) Rejected uses of lexical for-loop variable on the RHS. (issue 2322) Fixed slot recording of code target patches. (Chromium issue 152615,chromium:144230) Changed the Android makefile to use GCC 4.6 instead of GCC 4.4.3. Performance and stability improvements on all platforms. 2012-10-01: Version 3.14.1 Don't set -m32 flag when compiling with Android ARM compiler. (Chromium issue 143889) Restore the descriptor array before returning allocation failure. (Chromium issue 151750) Lowered kMaxVirtualRegisters (v8 issue 2139, Chromium issues 123822 and 128252). Pull more recent gyp in 'make dependencies'. Made sure that the generic KeyedStoreIC changes length and element_kind atomically (issue 2346). Bumped number of allowed variables per scope to 65535, to address GWT. (Chromium issue 151625) Support sourceURL for dynamically inserted scripts (issue 2342). Performance and stability improvements on all platforms. 2012-09-20: Version 3.14.0 Fixed missing slot recording during clearing of CallICs. (Chromium issue 144230) Fixed LBoundsCheck on x64 to handle (stack slot + constant) correctly. (Chromium issue 150729) Fixed minus zero test. (Issue 2133) Fixed setting array length to zero for slow elements. (Chromium issue 146910) Fixed lost arguments dropping in HLeaveInlined. (Chromium issue 150545) Fixed casting error for receiver of interceptors. (Chromium issue 149912) Throw a more descriptive exception when blocking 'eval' via CSP. (Chromium issue 140191) Fixed debugger's eval when close to stack overflow. (issue 2318) Added checks to live edit. (issue 2297) Switched on code compaction on incremental GCs. Fixed caching of optimized code for OSR. (issue 2326) Not mask exception thrown by toString in String::UtfValue etc. (issue 2317) Fixed API check for length of external arrays. (Chromium issue 148896) Ensure correct enumeration indices in the dict (Chromium issue 148376) Correctly initialize regexp global cache. (Chromium issue 148378) Fixed arguments object materialization during deopt. (issue 2261) Introduced new API to expose external string resource regardless of encoding. Fixed CHECK failure in LCodeGen::DoWrapReceiver when --deopt-every-n-times flag is present (Chromium issue 148389) Fixed edge case of extension with NULL as source string. (Chromium issue 144649) Fixed array index dehoisting. (Chromium issue 141395) Performance and stability improvements on all platforms. 2012-09-11: Version 3.13.7 Enable/disable LiveEdit using the (C++) debug API. Performance and stability improvements on all platforms. 2012-09-06: Version 3.13.6 Added validity checking to API functions and calls. Disabled accessor inlining (Chromium issue 134609). Fixed bug in Math.min/max in optimized code (Chromium issue 145961). Directly use %ObjectKeys in json stringify (Chromium issue 2312). Fixed VS2005 build (issue 2313). Activated fixed ES5 readonly semantics by default. Added hardfp flag to the Makefile. Performance and stability improvements on all platforms. 2012-08-29: Version 3.13.5 Release stack trace data after firing Error.stack accessor. (issue 2308) Added a new API V8::SetJitCodeEventHandler to push code name and location to users such as profilers. Allocate block-scoped global bindings to global context. Performance and stability improvements on all platforms. 2012-08-28: Version 3.13.4 Print reason for disabling optimization. Kill --trace-bailout flag. Provided option to disable full DEBUG build on Android. Introduced global contexts to represent lexical global scope(s). Fixed rounding in Uint8ClampedArray setter. (issue 2294) Performance and stability improvements on all platforms. 2012-08-21: Version 3.13.3 Performance and stability improvements on all platforms. 2012-08-20: Version 3.13.2 Performance and stability improvements on all platforms. 2012-08-16: Version 3.13.1 Performance and stability improvements on all platforms. 2012-08-10: Version 3.13.0 Added histograms for total allocated/live heap size, as well as allocated size and percentage of total for map and cell space. Fixed parseInt's octal parsing behavior (ECMA-262 Annex E 15.1.2.2). (issue 1645) Added checks for interceptors to negative lookup code in Crankshaft. (Chromium issue 140473) Made incremental marking clear ICs and type feedback cells. Performance and stability improvements on all platforms. 2012-08-01: Version 3.12.19 Performance and stability improvements on all platforms. 2012-07-30: Version 3.12.18 Forced using bit-pattern for signed zero double. (issue 2239) Made sure double to int conversion is correct. (issue 2260) Performance and stability improvements on all platforms. 2012-07-27: Version 3.12.17 Always set the callee's context when calling a function from optimized code. (Chromium issue 138887) Fixed building with GCC 3.x (issue 2016, 2017) Improved API calls that return empty handles. (issue 2245) Performance and stability improvements on all platforms. 2012-07-25: Version 3.12.16 Performance and stability improvements on all platforms. 2012-07-24: Version 3.12.15 Added PRESERVE_ASCII_NULL option to String::WriteAscii. (issue 2252) Added dependency to HLoadKeyed* instructions to prevent invalid hoisting. (Chromium issue 137768) Enabled building d8 for Android on Mac. Interpret negative hexadecimal literals as NaN. (issue 2240) Expose counters in javascript when using --track-gc-object-stats. Enabled building and testing V8 on Android IA. Added --trace-parse flag to parser. Performance and stability improvements on all platforms. 2012-07-18: Version 3.12.14 Deactivated optimization of packed arrays. (Chromium issue 137768) Fixed broken accessor transition. (Chromium issue 137689) Performance and stability improvements on all platforms. 2012-07-17: Version 3.12.13 Fixed missing tagging of stack value in finally block. (Chromium issue 137496) Added more support for heap analysis. Performance and stability improvements on all platforms. 2012-07-16: Version 3.12.12 Added an option to the tickprocessor to specify the directory for lib lookup. Fixed ICs for slow objects with native accessor (Chromium issue 137002). Fixed transcendental cache on ARM in optimized code (issue 2234). New heap inspection tools: counters for object sizes and counts, histograms for external fragmentation. Incorporated constness into inferred interfaces (in preparation for handling imports) (issue 1569). Performance and stability improvements on all platforms. 2012-07-12: Version 3.12.11 Renamed "mips" arch to "mipsel" in the GYP build. Fixed computation of call targets on prototypes in Crankshaft. (Chromium issue 125148) Removed use of __lookupGetter__ when generating stack trace. (issue 1591) Turned on ES 5.2 globals semantics by default. (issue 1991, Chromium issue 80591) Synced preparser and parser wrt syntax error in switch..case. (issue 2210) Fixed reporting of octal literals in strict mode when preparsing. (issue 2220) Fixed inline constructors for Harmony Proxy prototypes. (issue 2225) Performance and stability improvements on all platforms. 2012-07-10: Version 3.12.10 Re-enabled and fixed issue with array bounds check elimination (Chromium issue 132114). Fixed Debug::Break crash. (Chromium issue 131642) Added optimizing compiler support for JavaScript getters. Performance and stability improvements on all platforms. 2012-07-06: Version 3.12.9 Correctly advance the scanner when scanning unicode regexp flag. (Chromium issue 136084) Fixed unhandlified code calling Harmony Proxy traps. (issue 2219) Performance and stability improvements on all platforms. 2012-07-05: Version 3.12.8 Implemented TypedArray.set and ArrayBuffer.slice in d8. Performance and stability improvements on all platforms. 2012-07-03: Version 3.12.7 Fixed lazy compilation for strict eval scopes. (Chromium issue 135066) Made MACOSX_DEPLOYMENT_TARGET configurable in GYP. (issue 2151) Report "hidden properties" in heap profiler for properties case. (issue 2212) Activated optimization of packed arrays by default. Performance and stability improvements on all platforms. 2012-06-29: Version 3.12.6 Cleaned up hardfp ABI detection for ARM (V8 issue 2140). Extended TypedArray support in d8. 2012-06-28: Version 3.12.5 Fixed lazy parsing heuristics to respect outer scope. (Chromium issue 135008) Allow using test-wrapper-gypbuild.py on Windows when no python interpreter is registered. Performance and stability improvements on all platforms. 2012-06-27: Version 3.12.4 Removed -fomit-frame-pointer flag from Release builds to make the stack walkable by TCMalloc (Chromium issue 133723). Ported r7868 (constant masking) to x64 (issue 1374). Expose more detailed memory statistics (issue 2201). Fixed Harmony Maps and WeakMaps for undefined values (Chromium issue 132744). Correctly throw reference error in strict mode with ICs disabled (issue 2119). Performance and stability improvements on all platforms. 2012-06-25: Version 3.12.3 Reverted r11835 'Unify promotion and allocation limit computation' due to V8 Splay performance regression on Mac. (Chromium issue 134183) Fixed sharing of literal boilerplates for optimized code. (issue 2193) Performance and stability improvements on all platforms. 2012-06-22: Version 3.12.2 Made near-jump check more strict in LoadNamedFieldPolymorphic on ia32/x64. (Chromium issue 134055) Fixed lazy sweeping heuristics to prevent old-space expansion. (issue 2194) Performance and stability improvements on all platforms. 2012-06-21: Version 3.12.1 Performance and stability improvements on all platforms. 2012-06-20: Version 3.12.0 Fixed Chromium issues: 115100, 129628, 131994, 132727, 132741, 132742, 133211 Fixed V8 issues: 915, 1914, 2034, 2087, 2094, 2134, 2156, 2166, 2172, 2177, 2179, 2185 Added --extra-code flag to mksnapshot to load JS code into the VM before creating the snapshot. Support 'restart call frame' command in the debugger. Performance and stability improvements on all platforms. 2012-06-13: Version 3.11.10 Implemented heap profiler memory usage reporting. Preserved error message during finally block in try..finally. (Chromium issue 129171) Fixed EnsureCanContainElements to properly handle double values. (issue 2170) Improved heuristics to keep objects in fast mode with inherited constructors. Performance and stability improvements on all platforms. 2012-06-06: Version 3.11.9 Implemented ES5-conformant semantics for inherited setters and read-only properties. Currently behind --es5_readonly flag, because it breaks WebKit bindings. Exposed last seen heap object id via v8 public api. Performance and stability improvements on all platforms. 2012-05-31: Version 3.11.8 Avoid overdeep recursion in regexp where a guarded expression with a minimum repetition count is inside another quantifier. (Chromium issue 129926) Fixed missing write barrier in store field stub. (issues 2143, 1465, Chromium issue 129355) Proxies: Fixed receiver for setters inherited from proxies. Proxies: Fixed ToStringArray function so that it does not reject some keys. (issue 1543) Performance and stability improvements on all platforms. 2012-05-29: Version 3.11.7 Get better function names in stack traces. Performance and stability improvements on all platforms. 2012-05-24: Version 3.11.6 Fixed RegExp.prototype.toString for incompatible receivers (issue 1981). Performance and stability improvements on all platforms. 2012-05-23: Version 3.11.5 Performance and stability improvements on all platforms. 2012-05-22: Version 3.11.4 Some cleanup to common.gypi. This fixes some host/target combinations that weren't working in the Make build on Mac. Handle EINTR in socket functions and continue incomplete sends. (issue 2098) Fixed python deprecations. (issue 1391) Made socket send and receive more robust and return 0 on failure. (Chromium issue 15719) Fixed GCC 4.7 (C++11) compilation. (issue 2136) Set '-m32' option for host and target platforms Performance and stability improvements on all platforms. 2012-05-18: Version 3.11.3 Disable optimization for functions that have scopes that cannot be reconstructed from the context chain. (issue 2071) Define V8_EXPORT to nothing for clients of v8. (Chromium issue 90078) Correctly check for native error objects. (Chromium issue 2138) Performance and stability improvements on all platforms. 2012-05-16: Version 3.11.2 Revert r11496. (Chromium issue 128146) Implement map collection for incremental marking. (issue 1465) Add toString method to CallSite (which describes a frame of the stack trace). 2012-05-15: Version 3.11.1 Added a readbuffer function to d8 that reads a file into an ArrayBuffer. Fix freebsd build. (V8 issue 2126) Performance and stability improvements on all platforms. 2012-05-11: Version 3.11.0 Fixed compose-discard crasher from r11524 (issue 2123). Activated new global semantics by default. Global variables can now shadow properties of the global object (ES5.1 erratum). Properly set ElementsKind of empty FAST_DOUBLE_ELEMENTS arrays when transitioning (Chromium issue 117409). Made Error.prototype.name writable again, as required by the spec and the web (Chromium issue 69187). Implemented map collection with incremental marking (issue 1465). Regexp: Fixed overflow in min-match-length calculation (Chromium issue 126412). MIPS: Fixed illegal instruction use on Loongson in code for Math.random() (issue 2115). Fixed crash bug in VisitChoice (Chromium issue 126272). Fixed unsigned-Smi check in MappedArgumentsLookup (Chromium issue 126414). Fixed LiveEdit for function with no locals (issue 825). Fixed register clobbering in LoadIC for interceptors (Chromium issue 125988). Implemented clearing of CompareICs (issue 2102). Performance and stability improvements on all platforms. 2012-05-03: Version 3.10.8 Enabled MIPS cross-compilation. Ensured reload of elements pointer in StoreFastDoubleElement stub. (Chromium issue 125515) Fixed corner cases in truncation behavior when storing to TypedArrays. (issue 2110) Fixed failure to properly recognize and report out-of-memory conditions when allocating code space pages. (Chromium issue 118625) Fixed idle notifications to perform a round of incremental GCs after context disposal. (issue 2107) Fixed preparser for try statement. (issue 2109) Performance and stability improvements on all platforms. 2012-04-30: Version 3.10.7 Performance and stability improvements on all platforms. 2012-04-26: Version 3.10.6 Fixed some bugs in accessing details of the last regexp match. Fixed source property of empty RegExp objects. (issue 1982) Enabled inlining some V8 API functions. Performance and stability improvements on all platforms. 2012-04-23: Version 3.10.5 Put new global var semantics behind a flag until WebKit tests are cleaned up. Enabled stepping into callback passed to builtins. (Chromium issue 109564) Performance and stability improvements on all platforms. 2012-04-19: Version 3.10.4 Fixed issues when stressing compaction with WeakMaps. Fixed missing GVN flag for new-space promotion. (Chromium issue 123919) Simplify invocation sequence at monomorphic function invocation sites. (issue 2079) Performance and stability improvements on all platforms. 2012-04-17: Version 3.10.3 Fixed several bugs in heap profiles (including issue 2078). Throw syntax errors on illegal escape sequences. Implemented rudimentary module linking (behind --harmony flag) Implemented ES5 erratum: Global declarations should shadow inherited properties. Made handling of const more consistent when combined with 'eval' and 'with'. Fixed V8 on MinGW-x64 (issue 2026). Performance and stability improvements on all platforms. 2012-04-13: Version 3.10.2 Fixed native ARM build (issues 1744, 539) Return LOOKUP variable instead of CONTEXT for non-context allocated outer scope parameters (Chromium issue 119609). Fixed regular and ElementsKind transitions interfering with each other (Chromium issue 122271). Improved performance of keyed loads/stores which have a HeapNumber index (issues 1388, 1295). Fixed WeakMap processing for evacuation candidates (issue 2060). Bailout on possible direct eval calls (Chromium issue 122681). Do not assume that names of function expressions are context-allocated (issue 2051). Performance and stability improvements on all platforms. 2012-04-10: Version 3.10.1 Fixed bug with arguments object in inlined functions (issue 2045). Fixed performance bug with lazy initialization (Chromium issue 118686). Added suppport for Mac OS X 64bit builds with GYP. (Patch contributed by Filipe David Manana ) Fixed bug with hidden properties (issue 2034). Fixed a performance bug when reloading pages (Chromium issue 117767, V8 issue 1902). Fixed bug when optimizing throw in top-level code (issue 2054). Fixed two bugs with array literals (issue 2055, Chromium issue 121407). Fixed bug with Math.min/Math.max with NaN inputs (issue 2056). Fixed a bug with the new runtime profiler (Chromium issue 121147). Fixed compilation of V8 using uClibc. Optimized boot-up memory use. Optimized regular expressions. 2012-03-30: Version 3.10.0 Fixed store IC writability check in strict mode (Chromium issue 120099). Resynchronize timers if the Windows system time was changed. (Chromium issue 119815) Removed "-mfloat-abi=hard" from host compiler cflags when building for hardfp ARM (https://code.google.com/p/chrome-os-partner/issues/detail?id=8539) Fixed edge case for case independent regexp character classes (issue 2032). Reset function info counters after context disposal. (Chromium issue 117767, V8 issue 1902) Fixed missing write barrier in CopyObjectToObjectElements. (Chromium issue 119926) Fixed missing bounds check in HasElementImpl. (Chromium issue 119925) Performance and stability improvements on all platforms. 2012-03-23: Version 3.9.24 Activated count-based profiler for ARM. Fixed use of proxies as f.prototype properties. (issue 2021) Enabled snapshots on MIPS. Performance and stability improvements on all platforms. 2012-03-21: Version 3.9.23 Use correct arguments adaptation environment when inlining function containing arguments. (Issue 2014) Performance and stability improvements on all platforms. 2012-03-20: Version 3.9.22 Enabled count-based profiler by default. Implemented a hash based look-up to speed up address checks in large object space (issue 853). Performance and stability improvements on all platforms. 2012-03-19: Version 3.9.21 Fixed push-to-trunk script (and re-push). Added API call that identifies strings that are guaranteed only to contain ASCII characters. 2012-03-19: Version 3.9.20 Fixed declarations escaping global strict eval. (Issue 1624) Fixed wrapping of receiver for non-strict callbacks. (Issue 1973) Fixed function declarations overwriting read-only global properties. (Chromium issue 115452) Fixed --use-strict flag in combination with --harmony[-scoping]. Debugger: naive implementation of "step into Function.prototype.bind". Debugger: added ability to set script source from within OnBeforeCompile Added flag to always call DebugBreak on abort. Re-enabled constructor inlining and inline === comparison with boolean constants. (Issue 2009) Don't use an explicit s0 in ClampDoubleToUint8. (Issue 2004) Performance and stability improvements on all platforms. 2012-03-14: Version 3.9.19 Ensure there is a smi check of the receiver for global load and call ICs (Chromium issue 117794). Performance and stability improvements on all platforms. 2012-03-13: Version 3.9.18 Ensure consistency of Math.sqrt on Intel platforms. Remove static initializers in v8. (issue 1859) Add explicit dependency on v8_base in the GYP-based build. Performance and stability improvements on all platforms. 2012-03-12: Version 3.9.17 Fixed VFP detection through compiler defines. (issue 1996) Add Code-related fields to postmortem metadata. Performance and stability improvements on all platforms. 2012-03-09: Version 3.9.16 Added basic interface inference for modules (behind the --harmony flag). Added Object.is, Number.isFinite, Number.isNaN. Updated the Unicode tables to Unicode version 6.1.0. Performance and stability improvements on all platforms. 2012-03-06: Version 3.9.15 Fix the heap profiler crash caused by memory layout changes between passes. Fix Error.prototype.toString to throw TypeError. (issue 1980) Fix double-rounding in strtod for MinGW. (issue 1062) Fix corrupted snapshot serializaton on ia32. (Chromium issue v8/1985) Performance and stability improvements on all platforms. 2012-03-01: Version 3.9.14 Performance and stability improvements on all platforms. 2012-02-29: Version 3.9.13 Added code kind check before preparing for OSR. (issue 1900, 115073) Fixed issue 1802: Pass zone explicitly to zone-allocation on x64 and ARM. Ported string construct stub to x64. (issue 849) Performance and stability improvements on all platforms. 2012-02-28: Version 3.9.12 Fixed the negative lookup stub to handle deleted entries in a dictionary. (issue 1964) Added a new API where the host can supply a callback function. The callback function can resolve the location of a return address on stack to the location where a return-address rewriting profiler stashed the original return address. Fixed Chromium issue http://crbug.com/115646: When compiling for-in pass correct context value to the increment instruction. Fixed issue 1853: Update breakpoints set with partial file name after compile. 2012-02-27: Version 3.9.11 Made 'module' a context-sensitive keyword (V8 issue 1957). 2012-02-24: Version 3.9.10 Fixed V8 issues 1322, 1772 and 1969. Conformance improvements. Performance and stability improvements on all platforms. 2012-02-23: Version 3.9.9 Supported fast case for-in in Crankshaft. Sped up heap snapshot serialization and dominators construction. Randomized allocation addresses on windows. (Chromium issue 115151) Fixed compilation with MinGW-w64. (issue 1943) Fixed incorrect value of assignments to non-extensible properties. Fixed a crash bug in generated code on ia32. Performance and stability improvements on all platforms. 2012-02-21: Version 3.9.8 Fixed memory leak and missing #include in StartupDataDecompressor (issue 1960). Renamed static methods to avoid shadowing virtual methods and fix Clang C++11 compile error. Fixed sequence of element access in array builtins (issue 1790). Performance and stability improvements on all platforms. 2012-02-16: Version 3.9.7 Fixed V8 issues 1322, 1878, 1942, 1945 and Chromium issue 113924. Fixed GCC-4.7 warnings. Added Navier-Stokes benchmark. Performance and stability improvements on all platforms. 2012-02-14: Version 3.9.6 Fixed template-related linker error. (issue 1936) Allowed inlining of functions containing object literals. (issue 1322) Added --call-graph-size option to tickprocessor. (issue 1937) Heap Snapshot maximum size limit is too low for really big apps. At the moment the limit is 256MB. (Chromium issue 113015) Performance and stability improvements on all platforms. 2012-02-09: Version 3.9.5 Removed unused command line flags. Performance and stability improvements on all platforms. 2012-02-08: Version 3.9.4 Properly initialize element-transitioning array literals on ARM. (issue 1930) Bug fixes on all platforms. 2012-02-07: Version 3.9.3 When rethrowing an exception, print the stack trace of its original site instead of rethrow site (Chromium issue 60240). Increased size of small stacks from 32k to 64k to avoid hitting limits in Chromium (Chromium issue 112843). 2012-02-06: Version 3.9.2 Added timestamp to --trace-gc output. (issue 1932) Heap profiler reports implicit references. Optionally export metadata with libv8 to enable debuggers to inspect V8 state. 2012-02-02: Version 3.9.1 Fixed memory leak in NativeObjectsExplorer::FindOrAddGroupInfo (Chromium issue 112315). Fixed a crash in dev tools (Chromium issue 107996). Added 'dependencies_traverse': 1 to v8 GYP target. Performance and stability improvements on all platforms. 2012-02-01: Version 3.9.0 Reduced memory use immediately after starting V8. Stability fixes and performance improvements on all platforms. 2012-01-26: Version 3.8.9 Flush number string cache on GC (issue 1605). Provide access to function inferred name with v8::Function::GetInferredName in V8 public API. Fix building with Clang (issue 1912). Reduce the space used by the stack for the profiling thread. Fix misleading documentation of v8::Locker (issue 542). Introduce readbinary function in d8 to read binary files. Performance and stability improvements on all platforms. 2012-01-23: Version 3.8.8 Limited number of loop iterations in Heap::ReserveSpace (Chromium issue 99027). Fixed solaris build (VirtualMemory) (issue 1761). Fixed strict vs. non-strict handling of function proxies in higher-order array and string methods. Enabled asynchronous remote debugging with d8 (issue 1691). Stability and performance improvements on all platforms. 2012-01-19: Version 3.8.7 Ensure that LRandom restores rsi after call to the C function on x64. (Chromium issue http://crbug.com/110509) Fixing include issues on *bsd when building with scons. (issue 1897) Provide a switch to specify -fno-strict-aliasing (issue 1887) Move WIN32 define from standalone.gypi to common.gypi (issue 1760) Fix corner-case in heap size estimation. (issue 1893) Fix and enable NEW_NON_STRICT_FAST ArgumentsAccess stub on x64. (issue 1903) Performance improvements and bug fixes. 2012-01-16: Version 3.8.6 Add primitive WebGL array support to d8. Improve heap size estimation (issue 1893). Hash collision DOS workaround extended from string keys to numeric keys. Provide an API for iterating through all external strings referenced from the JS heap. Adjust position recorded for call expressions. http://crbug.com/109195 Fix GC crash related to instanceof. http://crbug.com/109448 Performance improvements and bug fixes. 2012-01-05: Version 3.8.5 Fix broken test that assumes that no GC can clear the regexp cache (GC can happen at any time due to Crankshaft). Fix handling of bogus receivers for Harmony collections. (issue 1884) Add netbsd support to gyp build. Determine page size at runtime on posix platforms. Ensure that store buffer filtering hash sets are cleared after StoreBuffer::Filter. Randomize the seed used for string hashing. This helps guard against CPU-eating DOS attacks against node.js servers. Based on code from Bert Belder. This version only solves the issue for those that compile V8 themselves or those that do not use snapshots. A snapshot-based precompiled V8 will still have predictable string hash codes. Implement callback when script finishes running in V8 API. Improve performance of Math.min and Math.max for the case of two arguments. (issue 1325) 2012-01-02: Version 3.8.4 Performance improvements for large Smi-only arrays. Fixed InternalArrays construction. (issue 1878) 2011-12-27: Version 3.8.3 Avoid embedding new space objects into code objects in the lithium gap resolver. (chromium:108296) Bug fixes and performance optimizations on all platforms. 2011-12-21: Version 3.8.2 Add max optimization flag to v8 gyp build to ensure V8 is always built fully optimized in Chrome. MIPS: Bring MIPS to parity with other platforms. Optimizations and stability improvements on all platforms. 2011-12-19: Version 3.8.1 Fixed GCC 4.7 warnings. Patch from Tobias Burnus. Stability improvements on all platforms. 2011-12-13: Version 3.8.0 Fixed handling of arrays in DefineOwnProperty. (issue 1756) Sync parser and preparser on do-while and return statements. (issue 1856) Fixed another corner case for DefineOwnProperty on arrays (issue 1756). Stability and performance improvements on all platforms. 2011-12-01: Version 3.7.12 Increase tick interval for the android platform. Fix a bug in the register allocator. (chromium:105112) Fix handling of recompiling code. (chromium:105375, v8:1782) Start incremental marking on idle notification. (v8:1458) Build fixes for various platforms. Various performance improvements. 2011-11-29: Version 3.7.11 Fixed bug when generating padding to ensure space for lazy deoptimization. (issue 1846) Further reduced pause times due to GC. Stability and performance improvements on all platforms. 2011-11-23: Version 3.7.10 Set maximum length of FixedArray in terms of elements instead an absolute number of bytes. (Chromium issue 103103) Stability and performance improvements on all platforms. 2011-11-21: Version 3.7.9 Removed exit-time destructors. Stability and performance improvements on all platforms. 2011-11-17: Version 3.7.8 Removed hidden prototype from builtins, i.e., deleting an overridden function on builtins will not make the original function reappear. Added NetBSD support for scons build. Performance improvements on all platforms. 2011-11-14: Version 3.7.7 Fix missing fast property accessors in heap snapshots. (issue 1818) 2011-11-11: Version 3.7.6 Fixed filtering of store buffer for large object pages. (issue 1817) Fixed generated hash function on all platforms. (issue 1808) Fixed Heap::Shrink to ensure that it does not free pages that are still in use. (Chromium issue 100414) Stability and performance improvements on all platforms. 2011-11-10: Version 3.7.5 Added initial gyp infrastructure for MIPS. Implemented performance improvements to the incremental garbage collector. Added optimizations and stability improvements on all platforms. 2011-11-07: Version 3.7.4 Proper "libv8.so.3.7.4" SONAME for Linux shared library (issue 1786). Fix Harmony sets and maps to allow null and undefined as keys (still hidden behind --harmony flag) (issue 1622). Implement VirtualMemory on FreeBSD to fix build (issue 1807). Enable VFP instructions for Android. Fix error handling in Date.prototype.toISOString (issue 1792). Bug fixes and performance improvements for all platforms. Not officially supported but noteworthy: Crankshaft for MIPS :-) 2011-10-28: Version 3.7.3 Slight deoptimization as a workaround for issue with jslint: Issue 1789. 2011-10-27: Version 3.7.2 Fix bug in deoptimization. Known issue with jslint: Issue 1789. 2011-10-26: Version 3.7.1 Achieved 33% speedup in debug-mode tests. Removed special casing of calls to RegExp test and exec methods with no argument. Now matches new JSC behaviour. crbug.com/75740. Return the empty string on cyclic references in toString (ES5 conformance). Fixed bug triggered by JSBeautifier. crbug.com/100409. Made Math.random state per-context instead of per-process (issue 864). Fixed stack traces to skip native functions. Make snapshots (new contexts) smaller and faster. Fixed handling of Function.apply for non-array arguments. Fixed evaluation order in defineProperties to match FireFox. Fixed handling of non-object receivers for array builtins, crbug.com/100702. Multiple fixes to improve compliance with test262. Fixed compatibility with older Android releases. Fixed compilation with gcc-4.5.3. Improved performance of WriteUtf8, issue 1665. Made native syntax an early error in the preparser. Fixed issues 793 and 893 relating to Function.prototype.bind. Improved let, const, Set and Map support and other Harmony features (behind the --harmony flag). Changed evaluation order for > and <= to match ES5 instead of ES3. Bug fixes and performance improvements on all platforms. 2011-10-13: Version 3.7.0 Fixed array handling for Object.defineOwnProperty (ES5 conformance). Fixed issue 1757 (string slices of external strings). Fixed issue 1759 (ARM). Added flag --noclever-optimizations to disable some things that caused trouble in the past. Added flag --stress-compaction for testing. Added flag --harmony to activate all experimental Harmony features. 2011-10-10: Version 3.6.6 Added a GC pause visualization tool. Added presubmit=no and werror=no flags to Makefile. ES5/Test262 conformance improvements. Fixed compilation issues with GCC 4.5.x (issue 1743). Bug fixes and performance improvements on all platforms. 2011-10-05: Version 3.6.5 New incremental garbage collector. Removed the hard heap size limit (soft heap size limit is still 700/1400Mbytes by default). Implemented ES5 generic Array.prototype.toString (Issue 1361). V8 now allows surrogate pair codes in decodeURIComponent (Issue 1415). Fixed x64 RegExp start-of-string bug (Issues 1746, 1748). Fixed propertyIsEnumerable for numeric properties (Issue 1692). Fixed the MinGW and Windows 2000 builds. Fixed "Prototype chain is not searched if named property handler does not set a property" (Issue 1636). Made the RegExp.prototype object be a RegExp object (Issue 1217). Disallowed future reserved words as labels in strict mode. Fixed string split to correctly coerce the separator to a string (Issue 1711). API: Added an optional source length field to the Extension constructor. API: Added Debug::DisableAgent to match existing Debug::EnableAgent (Issue 1573). Added "native" target to Makefile for the benefit of Linux distros. Fixed: debugger stops stepping outside evaluate (Issue 1639). More work on ES-Harmony proxies. Still hidden behind a flag. Bug fixes and performance improvements on all platforms. 2011-09-15: Version 3.6.4 Fixed d8's broken readline history. Removed the need for code delete events in CPU profiler (Issue 1466). Fixed debugger stepping next with trycatch recursion (Issue 1639). Fixing parallel execution in d8 (with -p) and some memory leaks. Support for precise stepping in functions compiled before debugging was started (step 1). 2011-09-13: Version 3.6.3 Implemented better support of typed arrays in the d8 shell. Bug fixes and performance improvements on all platforms. 2011-09-08: Version 3.6.2 Added "dependencies" target to top-level Makefile. Added ability to turn profiler on/off in d8. Added "soname_version" parameter to common.gypi, v8.gyp, and Makefile. Fixed several crash bugs. 2011-09-07: Version 3.6.1 Fixed a bug in abrupt exit from with or catch inside finally. Fixed possible crash in FixedDoubleArray::Initialize() (Chromium issue 95113). Fixed a bug in Page::GetRegionMaskForSpan (Chromium issue 94425). Fixed a few clang warnings (which -Werror treated as errors). Performance improvements on all platforms. 2011-09-05: Version 3.6.0 Fixed a bug when optimizing named function expression (issue 1647). Fixed a bug when optimizing f.call.apply (issue 1650). Made arguments and caller always be null on native functions (issues 1548 and 1643). Fixed issue 1648 (cross-compiling x64 targeting ia32). Fixed issue 371 (d8 printing of strings containing \0). Fixed order of evaluation in arguments to parseInt (issue 1649). Fixed a problem with large heap snapshots in Chrome DevTools (issue 1658, chromium issue 89268). Upped default maximum heap size from 512M to 700M. 2011-08-31: Version 3.5.10 Added dependency of v8_base on WinSocket2 Windows library in the GYP-build. Various bugfixes. 2011-08-29: Version 3.5.9 Made FromPropertyDescriptor not trigger inherited setters. Fixed .gyp files to work on the ARM simulator. Fixed shared library build warnings for MSVS. 2011-08-24: Version 3.5.8 Added V8EXPORT attributes for v8::Array::CheckCast and v8::Number::CheckCast. Made a slight API change enabling opting out from null termination in String::Write*(). Fixed arm build for gcc-4.6. 2011-08-22: Version 3.5.7 Make scanner handle invalid unicode escapes in identifiers correctly. Make regexp flag parsing stricter. Fix several memory leaks. 2011-08-17: Version 3.5.6 Fixed issue that could cause crashes when running with --heap-stats. Fixed compilation on Linux 2.6.9 and older. Fixed live-object-list to work with isolates. Fixed memory leaks in zones and isolates. Fixed a performance regression for TypedArrays on x64. Stability improvements on all platforms. 2011-08-15: Version 3.5.5 Fixed bugs involving negative zero and the optimizing compiler. Fixed optimized version of Function.apply(x, arguments). (issue 1592) Eliminated uses of deprecated ARM instructions. Sped up Math.floor by using SSE 4.1 roundsd instruction on ia32. Removed restriction on the size of disassembled code that is printed. 2011-08-10: Version 3.5.4 Added a preliminary implementation of ES Harmony weak maps. Weak maps can be enabled by the flag --harmony-weakmaps. Introduced a toplevel Makefile to support GYP-based building. GYP can be obtained from http://gyp.googlecode.com. Fixed a bug in the length property of functions created by Function.prototype.bind. Reduced malloc heap allocation on process startup. Several important code generation bug fixes. Performance improvements on all platforms. 2011-08-03: Version 3.5.3 MIPS: Port of fix to ClassOf check from ARM. Patch from Paul Lind . Stopped using mprotect on Cygwin. Avoided uninitialized member warning on gcc 4.3.4 Both patches by Bert Belder. Bug fixes and performance improvements on all platforms. 2011-08-01: Version 3.5.2 Performance improvements on all platforms. 2011-07-28: Version 3.5.1 Fixed setting the readonly flag on the prototype property using the API call FunctionTemplate::SetPrototypeAttributes (issue 1539). Changed the tools/test.py script to use d8 instead of shell for testing. Fixed crash in ToBooleanStub when GC happens during invocation. Enabled automatic unboxing of double arrays. Performance improvements on all platforms. 2011-07-25: Version 3.5.0 Implemented Object.prototype.{hasOwnProperty, propertyIsEnumerable} for proxies. Removed logging to memory support. Bugfixes and performance work. 2011-07-20: Version 3.4.14 Fix the debugger for strict-mode functions. (Chromium issue 89236) Add GetPropertyAttribute method for Object in the API. (Patch by Peter Varga) Fix -Wunused-but-set-variable for gcc-4.6 on x64. (Issue 1291) 2011-07-18: Version 3.4.13 Improved debugger support to allow inspection of optimized frames (issue 1140). Fixed a bug in prototype transitions cache clearing introduced by r8165. Fixed shortcutting bug in HInferRepresentation. Patch by Andy Wingo. Fixed a memory leak in sample/shell.cc (dispose semaphores). Simplified HClampToUint8. Patch by Andy Wingo. Exposed APIs for detecting boxed primitives, native errors. Patch by Luke Zarko. Added map check for COW elements to crankshaft array handling code (issue 1560). Sample shell and (a light version of) D8 links against a shared library now. Fixed bug in array filter and reduce functions (issue 1559). Avoid TLS load in AstNode constructor. Introduced a random entropy source which can optionally be provided at initialization. (Chromium issue 89462). 2011-07-13: Version 3.4.12 Added --prof profiling option to d8 shell. Fixed a bug where reading a directory in d8 shell hangs (issue 1533). Fixed a potential assertion failure in const declarations. Fixed an assertion failure in descriptor arrays (issue 1526). Enabled fast thread-local storage by default on supported platforms. Improved reporting of source position for global variable loads (issue 1527). 2011-07-11: Version 3.4.11 Fixed MinGW32 build. Fixed a GC bug with RegExp code flushing. Implemented Object.defineProperty for proxies. Fixed a bug in for/in iteration of arguments objects (issue 1531). Added debugger support for inspecting optimized frames (issue 1140). Allowed JSObject::PreventExtensions to work for arguments objects. Bugfixes and performance work. 2011-07-06: Version 3.4.10 Fixed debugger not breaking on certain "if" statements (issue 1523). Fixed assertion failure in runtime profiler when running on IA32 without snapshot (issue 1522). Fixed ABI for API calls on IA32 (for clang compatibility). Introduced code flushing of RegExp code to free memory used by RegExps sooner. Fixed linux-tick-processor built wrong version of v8 (issue 1532). Fixed assertion failure in v8::TryCache::StackTrace (issue 1529). Performance improvements on all platforms. 2011-07-04: Version 3.4.9 Added support for debugger inspection of locals in optimized frames (issue 1140). Fixed SConstruct to pass correct defines to samples/preparser when building with library=shared. Made date parser handle ES5 Date Time Strings correctly (issue 1498). Fixed a bug in Object.defineProperty on the arguments object. Performance improvements on all platforms. 2011-06-29: Version 3.4.8 Ensure 16-byte stack alignment on Solaris (issue 1505). Fix "illegal access" when calling parseInt with a radix that is not a smi. (issue 1246). 2011-06-27: Version 3.4.7 Fixed 64-bit build on FreeBSD. Added API to set the property attributes for the prototype property on functions created from FunctionTemplates. Bugfixes and performance work. 2011-06-22: Version 3.4.6 Lowered limit on code space for systems with low memory supply. Allowed compiling v8_shell with the 'host' toolset (issue 82437). Extended setBreakpoint API to accept partial script name (issue 1418). Made multi-line comments not count when deciding whether the '-->' comment starter is first on a line. This matches Safari. Made handling of non-array recievers in Array length setter correct (issue 1491). Added ability to heap profiler to iterate over snapshot's node (issue 1481). 2011-06-20: Version 3.4.5 Fixed issues 794, 1097, 1215(partial), 1417, 1435, 1472, 1473, 1476, and 1477. Improved code generation for !0 and !1. Reduced memory usage for regular expressions with nested qualifiers. (issue 1472) Fixed V8 to count line terminators in multi-line comments. (Chromium issue 86431) Fixed disassembler=on option for release-mode builds. (issue 1473) Performance improvements on all platforms. 2011-06-15: Version 3.4.4 Added snapshot compression support and --stress-opt flag to d8. Improved performance of try/catch. Several GYP-related changes: Added support for building Xcode project files. Make the ARM simulator build with GYP again. Generate Makefiles for all architectures on Linux. Fixed Array.prototype.{reduce,reduceRight} to pass undefined as the receiver for strict mode callbacks. (issue 1436) Fixed a bug where an array load was incorrectly hoisted by GVN. Handle 'undefined' correctly when === has been specialized for doubles. (issue 1434) Corrected the limit of local variables in an optimized function from 64 to 63. Correctly set ReadOnly flag on indexed properties when using the API Set method. (issue 1470) Give the correct error message when Object.isExtensible is called on a non-object. (issue 1452) Added GetOwnPropertyNames method for Object in the API. Patch by Peter Varga. Do not redefine properties unneccesarily in seal and freeze. (issue 1447) IsExecutionTerminating has an Isolate parameter now. Distinguish keyed loads with a symbol key from fast elements loads, avoiding some useless deoptimizations. (issue 1471) 2011-06-08: Version 3.4.3 Clear the global thread table when an isolate is disposed (issue 1433). Converted time zone name to UTF8 on Windows (issue 1290). Limited the number of arguments in a function call to 32766 (issue 1413). Compress sources of JS libraries in addition to the snapshot. Fixed a bug in Lithium environment iteration. Performance improvements on all platforms. 2011-06-06: Version 3.4.2 More work on ES-Harmony proxies. Still hidden behind a flag. Fixed some crash bugs and improved performance. Fixed building with gdb debugging support. Do not install SIGPROF handler until it is needed. Added DateTimeFormat to i18n API. Fixed compilation on OpenBSD. Take the ulimit into account when sizing the heap. OpenBSD users may still have to increase the default ulimit to run heavy pages in the browser. 2011-06-01: Version 3.4.1 Fixed JSON stringify issue with arrays. Changed calls to JS builtins to be passed undefined when called with implicit receiver. Implemented the set trap for Harmony proxies. Proxies still need to be enabled with the --harmony-proxies flag. 2011-05-30: Version 3.4.0 Changed calls to undefined property setters to not throw (issue 1355). Made RegExp objects not callable. Fixed issues on special case large JSON strings in new json parser (issues http://crbug.com/83877 and http://crbug.com/84186). Performance improvements on all platforms. 2011-05-25: Version 3.3.10 Fixed calls of strict mode function with an implicit receiver. Fixed fast handling of arrays to properly deal with changes to the Object prototype (issue 1403). Changed strict mode poison pill to be the same type error function (issue 1387). Fixed a debug crash in arguments object handling (issue 1227). Fixed a bug in deoptimization on x64 (issue 1404). Performance improvements and bug fixes on all platforms. 2011-05-23: Version 3.3.9 Added DateTimeFormat class to experimental i18n API. Extended preparser to give early errors for some strict mode restrictions. Removed legacy execScript function from V8. Extended isolate API with the ability to add embedder-specific data to an isolate. Added basic support for polymorphic loads from JS and external arrays. Fixed bug in handling of switch statements in the optimizing compiler. 2011-05-18: Version 3.3.8 Added MarkIndependent to the persistent handle API. Independent handles are independent of all other persistent handles and can be garbage collected more frequently. Implemented the get trap for Harmony proxies. Proxies are enabled with the --harmony-proxies flag. Performance improvements and bug fixes on all platforms. 2011-05-16: Version 3.3.7 Updated MIPS infrastructure files. Performance improvements and bug fixes on all platforms. 2011-05-11: Version 3.3.6 Updated MIPS infrastructure files. Added method IsCallable for Object to the API. Patch by Peter Varga. 2011-05-09: Version 3.3.5 Fixed build on FreeBSD. Patch by Akinori MUSHA. Added check that receiver is JSObject on API calls. Implemented CallAsConstructor method for Object in the API (Issue 1348). Patch by Peter Varga. Added CallAsFunction method to the Object class in the API (Issue 1336). Patch by Peter Varga. Added per-isolate locking and unlocking. Fixed bug in x64 >>> operator (Issue 1359). 2011-05-04: Version 3.3.4 Implemented API to disallow code generation from strings for a context (issue 1258). Fixed bug with whitespaces in parseInt (issue 955). Fixed bug with == comparison of Date objects (issue 1356). Added GYP variables for ARM code generation: v8_can_use_vfp_instructions, v8_can_use_unaligned_accesses and v8_use_arm_eabi_hardfloat. 2011-05-02: Version 3.3.3 Added support for generating Visual Studio solution and project files using GYP. Implemented support for ARM EABI calling convention variation where floating-point arguments are passed in registers (hardfloat). Added Object::HasOwnProperty() to the API. Added support for compressing startup data to reduce binary size. This includes build time support and an API for the embedder to decompress the startup data before initializing V8. Reduced the profiling hooks overhead from >400% to 25% when using ll_prof. Performance improvements and bug fixes on all platforms. 2011-04-27: Version 3.3.2 Fixed crash bug on ARM with no VFP3 hardware. Fixed compilation of V8 without debugger support. Improved performance on JSLint. Added support Float64 WebGL arrays. Fixed crash bug in regexp replace. 2011-04-20: Version 3.3.1 Reduced V8 binary size by removing virtual functions from hydrogen. Fixed crash bug on x64. Performance improvements on ARM and IA32. 2011-04-18: Version 3.3.0 Fixed bug in floating point rounding in Crankshaft on ARM (issue 958) Fixed a number of issues with running without VFPv3 support on ARM (issue 1315) Introduced v8Locale.Collator, a partial implementation of Collator per last ECMAScript meeting + mailing list. Minor performance improvements and bug fixes. 2011-04-13: Version 3.2.10 Fixed bug in external float arrays on ARM (issue 1323). Minor performance improvements and bug fixes. 2011-04-11: Version 3.2.9 Removed support for ABI prior to EABI on ARM. Fixed multiple crash bugs. Added GCMole to the repository, a simple static analysis tool that searches for GC-unsafe evaluation order dependent callsites. Made preparser API be exported in shared libraries. Fixed multiple issues in EcmaScript 5 strict mode implementation. Fixed mutable __proto__ property if object is not extensible (Issue 1309). Fixed auto suspension of the sampler thread. 2011-04-06: Version 3.2.8 Exposed WebGL typed array constructors in the shell sample. Performance improvements on all platforms. 2011-04-04: Version 3.2.7 Disabled the original 'classic' V8 code generator. Crankshaft is now the default on all platforms. Changed the heap profiler to use more descriptive names. Performance and stability improvements to isolates on all platforms. 2011-03-30: Version 3.2.6 Fixed xcode build warning in shell.cc (out of order initialization). Fixed null-pointer dereference in the compiler when running without SSE3 support (Chromium issue 77654). Fixed x64 compilation error due to some dead code. (Issue 1286) Introduced scons target to build the preparser stand-alone example. Made FreeBSD build and pass all tests. 2011-03-28: Version 3.2.5 Fixed build with Irregexp interpreter (issue 1266). Added Crankshaft support for external arrays. Fixed two potential crash bugs. 2011-03-23: Version 3.2.4 Added isolates which allows several V8 instances in the same process. This is controlled through the new Isolate class in the API. Implemented more of EcmaScript 5 strict mode. Reduced the time it takes to make detailed heap snapshot. Added a number of commands to the ARM simulator and enhanced the ARM disassembler. 2011-03-17: Version 3.2.3 Fixed a number of crash bugs. Fixed Array::New(length) to return an array with a length (issue 1256). Fixed FreeBSD build. Changed __defineGetter__ to not throw (matching the behavior of Safari). Implemented more of EcmaScript 5 strict mode. Improved Crankshaft performance on all platforms. 2011-03-14: Version 3.2.2 Fixed a number of crash and correctness bugs. Improved Crankshaft performance on all platforms. Fixed Crankshaft on Solaris/Illumos. 2011-03-10: Version 3.2.1 Fixed a number of crash bugs. Improved Crankshaft for x64 and ARM. Implemented more of EcmaScript 5 strict mode. 2011-03-07: Version 3.2.0 Fixed a number of crash bugs. Turned on Crankshaft by default on x64 and ARM. Improved Crankshaft for x64 and ARM. Implemented more of EcmaScript 5 strict mode. 2011-03-02: Version 3.1.8 Fixed a number of crash bugs. Improved Crankshaft for x64 and ARM. Implemented more of EcmaScript 5 strict mode. Fixed issue with unaligned reads and writes on ARM. Improved heap profiler support. 2011-02-28: Version 3.1.7 Fixed a number of crash bugs. Improved Crankshaft for x64 and ARM. Fixed implementation of indexOf/lastIndexOf for sparse arrays (http://crbug.com/73940). Fixed bug in map space compaction (http://crbug.com/59688). Added support for direct getter accessors calls on ARM. 2011-02-24: Version 3.1.6 Fixed a number of crash bugs. Added support for Cygwin (issue 64). Improved Crankshaft for x64 and ARM. Added Crankshaft support for stores to pixel arrays. Fixed issue in CPU profiler with Crankshaft. 2011-02-16: Version 3.1.5 Change RegExp parsing to disallow /(*)/. Added GDB JIT support for ARM. Fixed several crash bugs. Performance improvements on the IA32 platform. 2011-02-14: Version 3.1.4 Fixed incorrect compare of prototypes of the global object (issue 1082). Fixed a bug in optimizing calls to global functions (issue 1106). Made optimized Function.prototype.apply safe for non-JSObject first arguments (issue 1128). Fixed an error related to element accessors on Object.prototype and parser errors (issue 1130). Fixed a bug in sorting an array with large array indices (issue 1131). Properly treat exceptions thrown while compiling (issue 1132). Fixed bug in register requirements for function.apply (issue 1133). Fixed a representation change bug in the Hydrogen graph construction (issue 1134). Fixed the semantics of delete on parameters (issue 1136). Fixed a optimizer bug related to moving instructions with side effects (issue 1138). Added support for the global object in Object.keys (issue 1150). Fixed incorrect value for Math.LOG10E (issue http://code.google.com/p/chromium/issues/detail?id=72555) Performance improvements on the IA32 platform. Implement assignment to undefined reference in ES5 Strict Mode. 2011-02-09: Version 3.1.3 Fixed a bug triggered by functions with huge numbers of declared arguments. Fixed zap value aliasing a real object - debug mode only (issue 866). Fixed issue where Array.prototype.__proto__ had been set to null (issue 1121). Fixed stability bugs in Crankshaft for x86. 2011-02-07: Version 3.1.2 Added better security checks when accessing properties via Object.getOwnPropertyDescriptor. Fixed bug in Object.defineProperty and related access bugs (issues 992, 1083 and 1092). Added LICENSE.v8, LICENSE.strongtalk and LICENSE.valgrind to ease copyright notice generation for embedders. 2011-02-02: Version 3.1.1 Perform security checks before fetching the value in Object.getOwnPropertyDescriptor. Fixed a bug in Array.prototype.splice triggered by passing no arguments. Fixed bugs in -0 in arithmetic and in Math.pow. Fixed bugs in the register allocator and in switching from optimized to unoptimized code. 2011-01-31: Version 3.1.0 Performance improvements on all platforms. 2011-01-28: Version 3.0.12 Added support for strict mode parameter and object property validation. Fixed a couple of crash bugs. 2011-01-25: Version 3.0.11 Fixed a bug in deletion of lookup slots that could cause global variables to be accidentally deleted (http://crbug.com/70066). Added support for strict mode octal literal verification. Fixed a couple of crash bugs (issues 1070 and 1071). 2011-01-24: Version 3.0.10 Fixed External::Wrap for 64-bit addresses (issue 1037). Fixed incorrect .arguments variable proxy handling in the full code generator (issue 1060). Introduced partial strict mode support. Changed formatting of recursive error messages to match Firefox and Safari (issue http://crbug.com/70334). Fixed incorrect rounding for float-to-integer conversions for external array types, which implement the Typed Array spec (issue http://crbug.com/50972). Performance improvements on the IA32 platform. 2011-01-19: Version 3.0.9 Added basic GDB JIT Interface integration. Make invalid break/continue statements a syntax error instead of a runtime error. 2011-01-17: Version 3.0.8 Exposed heap size limit to the heap statistics gathered by the GetHeapStatistics API. Wrapped external pointers more carefully (issue 1037). Hardened the implementation of error objects to avoid setters intercepting the properties set then throwing an error. Avoided trashing the FPSCR when calculating Math.floor on ARM. Performance improvements on the IA32 platform. 2011-01-10: Version 3.0.7 Stopped calling inherited setters when creating object literals (issue 1015). Changed interpretation of malformed \c? escapes in RegExp to match JSC. Enhanced the command-line debugger interface and fixed some minor bugs in the debugger. Performance improvements on the IA32 platform. 2011-01-05: Version 3.0.6 Allowed getters and setters on JSArray elements (issue 900). Stopped JSON objects from hitting inherited setters (part of issue 1015). Allowed numbers and strings as names of getters/setters in object initializer (issue 820). Added use_system_v8 option to gyp (off by default), to make it easier for Linux distributions to ship with system-provided V8 library. Exported external array data accessors (issue 1016). Added labelled thread names to help with debugging (on Linux). 2011-01-03: Version 3.0.5 Fixed a couple of cast errors for gcc-3.4.3. Performance improvements in GC and IA32 code generator. 2010-12-21: Version 3.0.4 Added Date::ResetCache() to the API so that the cached values in the Date object can be reset to allow live DST / timezone changes. Extended existing support for printing (while debugging) the contents of objects. Added support for printing objects from release builds. Fixed V8 issues 989, 1006, and 1007. 2010-12-17: Version 3.0.3 Reapplied all changes for version 3.0.1. Improved debugger protocol for remote debugging. Added experimental support for using gyp to generate build files for V8. Fixed implementation of String::Write in the API (issue 975). 2010-12-15: Version 3.0.2 Revert version 3.0.1 and patch 3.0.1.1. 2010-12-13: Version 3.0.1 Added support for an experimental internationalization API as an extension. This extension is disabled by default but can be enabled when building V8. The ECMAScript internationalization strawman is at http://wiki.ecmascript.org/doku.php?id=strawman:i18n_api. Made RegExp character class parsing stricter. This mirrors a change to RegExp parsing in WebKit. Fixed a bug in Object.defineProperty when used to change attributes of an existing property. It incorrectly set the property value to undefined (issue 965). Fixed several different compilation failures on various platforms caused by the 3.0.0 release. Optimized Math.pow so it can work on unboxed doubles. Sped up quoting of JSON strings by removing one traversal of the string. 2010-12-07: Version 3.0.0 Improved performance by (partially) addressing issue 957 on IA-32. Still needs more work for the other architectures. 2010-11-29: Version 2.5.9 Fixed crashes during GC caused by partially initialize heap objects. Fixed bug in process sample that caused memory leaks. Improved performance on ARM by implementing missing stubs and inlining. Improved heap profiler support. Added separate seeding on Windows of the random number generator used internally by the compiler (issue 936). Exposed API for getting the name of the function used to construct an object. Fixed date parser to handle one and two digit millisecond values (issue 944). Fixed number parsing to disallow space between sign and digits (issue 946). 2010-11-23: Version 2.5.8 Removed dependency on Gay's dtoa. Improved heap profiler precision and speed. Reduced overhead of callback invocations on ARM. 2010-11-18: Version 2.5.7 Fixed obscure evaluation order bug (issue 931). Split the random number state between JavaScript and the private API. Fixed performance bug causing GCs when generating stack traces on code from very large scripts. Fixed bug in parser that allowed (foo):42 as a labelled statement (issue 918). Provide more accurate results about used heap size via GetHeapStatistics. Allow build-time customization of the max semispace size. Made String.prototype.split honor limit when separator is empty (issue 929). Added missing failure check after expecting an identifier in preparser (Chromium issue 62639). 2010-11-10: Version 2.5.6 Added support for VFP rounding modes to the ARM simulator. Fixed multiplication overflow bug (issue 927). Added a limit for the amount of executable memory (issue 925). 2010-11-08: Version 2.5.5 Added more aggressive GC of external objects in near out-of-memory situations. Fixed a bug that gave the incorrect result for String.split called on the empty string (issue 924). 2010-11-03: Version 2.5.4 Improved V8 VFPv3 runtime detection to address issue 914. 2010-11-01: Version 2.5.3 Fixed a bug that prevents constants from overwriting function values in object literals (issue 907). Fixed a bug with reporting of impossible nested calls of DOM functions (issue http://crbug.com/60753). 2010-10-27: Version 2.5.2 Improved sampler resolution on Linux. Allowed forcing the use of a simulator from the build script independently of the host architecture. Fixed FreeBSD port (issue 912). Made windows-tick-processor respect D8_PATH. Implemented --noinline-new flag fully on IA32, X64 and ARM platforms. 2010-10-20: Version 2.5.1 Fixed bug causing spurious out of memory exceptions (issue http://crbug.com/54580). Fixed compilation error on Solaris platform (issue 901). Fixed error in strtod (string to floating point number conversion) due to glibc's use of 80-bit floats in the FPU on 32-bit linux. Adjusted randomized allocations of executable memory to have 64k granularity (issue http://crbug.com/56036). Supported profiling using kernel perf_events on linux. Added ll_prof script to tools and --ll-prof flag to V8. 2010-10-18: Version 2.5.0 Fixed bug in cache handling of lastIndex on global regexps (issue http://crbug.com/58740). Added USE_SIMULATOR macro that explicitly indicates that we wish to use the simulator as the execution engine (by Mark Lam from Hewlett-Packard Development Company, LP). Fixed compilation error on ARM with gcc 4.4 (issue 894). 2010-10-13: Version 2.4.9 Fixed a bug in the handling of conditional expressions in test contexts in compiler for top-level code. Added "//@ sourceURL" information to the StackTrace API. Exposed RegExp construction through the API. 2010-10-04: Version 2.4.8 Fixed a bug in ResumeProfilerEx causing it to not always write out the whole snapshot (issue 868). Performance improvements on all platforms. 2010-09-30: Version 2.4.7 Changed the command-line flag --max-new-space-size to be in kB and the flag --max-old-space-size to be in MB (previously they were in bytes). Added Debug::CancelDebugBreak to the debugger API. Fixed a bug in getters for negative numeric property names (https://bugs.webkit.org/show_bug.cgi?id=46689). Performance improvements on all platforms. 2010-09-27: Version 2.4.6 Fixed assertion failure related to copy-on-write arrays (issue 876). Fixed build failure of 64-bit V8 on Windows. Fixed a bug in RegExp (issue http://crbug.com/52801). Improved the profiler's coverage to cover more functions (issue 858). Fixed error in shift operators on 64-bit V8 (issue http://crbug.com/54521). 2010-09-22: Version 2.4.5 Changed the RegExp benchmark to exercise the regexp engine on different inputs by scrambling the input strings. Fixed a bug in keyed loads on strings. Fixed a bug with loading global function prototypes. Fixed a bug with profiling RegExp calls (issue http://crbug.com/55999). Performance improvements on all platforms. 2010-09-15: Version 2.4.4 Fixed bug with hangs on very large sparse arrays. Now tries harder to free up memory when running out of space. Added heap snapshots to JSON format to API. Recalibrated benchmarks. 2010-09-13: Version 2.4.3 Made Date.parse properly handle TZ offsets (issue 857). Performance improvements on all platforms. 2010-09-08: Version 2.4.2 Fixed GC crash bug. Fixed stack corruption bug. Fixed compilation for newer C++ compilers that found Operand(0) ambiguous. 2010-09-06: Version 2.4.1 Added the ability for an embedding application to receive a callback when V8 allocates (V8::AddMemoryAllocationCallback) or deallocates (V8::RemoveMemoryAllocationCallback) from the OS. Fixed several JSON bugs (including issue 855). Fixed memory overrun crash bug triggered during V8's tick-based profiling. Performance improvements on all platforms. 2010-09-01: Version 2.4.0 Fixed bug in Object.freeze and Object.seal when Array.prototype or Object.prototype are changed (issue 842). Updated Array.splice to follow Safari and Firefox when called with zero arguments. Fixed a missing live register when breaking at keyed loads on ARM. Performance improvements on all platforms. 2010-08-25: Version 2.3.11 Fixed bug in RegExp related to copy-on-write arrays. Refactored tools/test.py script, including the introduction of VARIANT_FLAGS that allows specification of sets of flags with which all tests should be run. Fixed a bug in the handling of debug breaks in CallIC. Performance improvements on all platforms. 2010-08-23: Version 2.3.10 Fixed bug in bitops on ARM. Build fixes for unusual compilers. Track high water mark for RWX memory. Performance improvements on all platforms. 2010-08-18: Version 2.3.9 Fixed compilation for ARMv4 on OpenBSD/FreeBSD. Removed specialized handling of GCC 4.4 (issue 830). Fixed DST cache to take into account the suspension of DST in Egypt during the 2010 Ramadan (issue http://crbug.com/51855). Performance improvements on all platforms. 2010-08-16: Version 2.3.8 Fixed build with strict aliasing on GCC 4.4 (issue 463). Fixed issue with incorrect handling of custom valueOf methods on string wrappers (issue 760). Fixed compilation for ARMv4 (issue 590). Improved performance. 2010-08-11: Version 2.3.7 Reduced size of heap snapshots produced by heap profiler (issue 783). Introduced v8::Value::IsRegExp method. Fixed CPU profiler crash in start / stop sequence when non-existent name is passed (issue http://crbug.com/51594). Introduced new indexed property query callbacks API (issue 816). This API is guarded by USE_NEW_QUERY_CALLBACK define and is disabled by default. Removed support for object literal get/set with number/string property name. Fixed handling of JSObject::elements in CalculateNetworkSize (issue 822). Allowed compiling with strict aliasing enabled on GCC 4.4 (issue 463). 2010-08-09: Version 2.3.6 RegExp literals create a new object every time they are evaluated (issue 704). Object.seal and Object.freeze return the modified object (issue 809). Fixed building using GCC 4.4.4. 2010-08-04: Version 2.3.5 Added support for ES5 property names. Object initialisers and dot-notation property access now allows keywords. Also allowed non-identifiers after "get" or "set" in an object initialiser. Randomized the addresses of allocated executable memory on Windows. 2010-08-02: Version 2.3.4 Fixed problems in implementation of ES5 function.prototype.bind. Fixed error when using apply with arguments object on ARM (issue 784). Added setting of global flags to debugger protocol. Fixed an error affecting cached results of sin and cos (issue 792). Removed memory leak from a boundary case where V8 is not initialized. Fixed issue where debugger could set breakpoints outside the body of a function. Fixed issue in debugger when using both live edit and step in features. Added Number-letter (Nl) category to Unicode tables. These characters can now be used in identifiers. Fixed an assert failure on X64 (issue 806). Performance improvements on all platforms. 2010-07-26: Version 2.3.3 Fixed error when building the d8 shell in a fresh checkout. Implemented Function.prototype.bind (ES5 15.3.4.5). Fixed an error in inlined stores on ia32. Fixed an error when setting a breakpoint at the end of a function that does not end with a newline character. Performance improvements on all platforms. 2010-07-21: Version 2.3.2 Fixed compiler warnings when building with LLVM. Fixed a bug with for-in applied to strings (issue 785). Performance improvements on all platforms. 2010-07-19: Version 2.3.1 Fixed compilation and linking with V8_INTERPRETED_REGEXP flag. Fixed bug related to code flushing while compiling a lazy compilable function (issue http://crbug.com/49099). Performance improvements on all platforms. 2010-07-15: Version 2.3.0 Added ES5 Object.seal and Object.isSealed. Added debugger API for scheduling debugger commands from a separate thread. 2010-07-14: Version 2.2.24 Added API for capturing stack traces for uncaught exceptions. Fixed crash bug when preparsing from a non-external V8 string (issue 775). Fixed JSON.parse bug causing input not to be converted to string (issue 764). Added ES5 Object.freeze and Object.isFrozen. Performance improvements on all platforms. 2010-07-07: Version 2.2.23 API change: Convert Unicode code points outside the basic multilingual plane to the replacement character. Previous behavior was to silently truncate the value to 16 bits. Fixed crash: handle all flat string types in regexp replace. Prevent invalid pre-parsing data passed in through the API from crashing V8. Performance improvements on all platforms. 2010-07-05: Version 2.2.22 Added ES5 Object.isExtensible and Object.preventExtensions. Enabled building V8 as a DLL. Fixed a bug in date code where -0 was not interpreted as 0 (issue 736). Performance improvements on all platforms. 2010-06-30: Version 2.2.21 Fixed bug in externalizing some ASCII strings (Chromium issue 47824). Updated JSON.stringify to floor the space parameter (issue 753). Updated the Mozilla test expectations to the newest version. Updated the ES5 Conformance Test expectations to the latest version. Updated the V8 benchmark suite. Provide actual breakpoints locations in response to setBreakpoint and listBreakpoints requests. 2010-06-28: Version 2.2.20 Fixed bug with for-in on x64 platform (issue 748). Fixed crash bug on x64 platform (issue 756). Fixed bug in Object.getOwnPropertyNames. (chromium issue 41243). Fixed a bug on ARM that caused the result of 1 << x to be miscalculated for some inputs. Performance improvements on all platforms. 2010-06-23: Version 2.2.19 Fixed bug that causes the build to break when profillingsupport=off (issue 738). Added expose-externalize-string flag for testing extensions. Resolve linker issues with using V8 as a DLL causing a number of problems with unresolved symbols. Fixed build failure for cctests when ENABLE_DEBUGGER_SUPPORT is not defined. Performance improvements on all platforms. 2010-06-16: Version 2.2.18 Added API functions to retrieve information on indexed properties managed by the embedding layer. Fixes bug 737. Made ES5 Object.defineProperty support array elements. Fixes bug 619. Added heap profiling to the API. Removed old named property query from the API. Incremental performance improvements. 2010-06-14: Version 2.2.17 Improved debugger support for stepping out of functions. Incremental performance improvements. 2010-06-09: Version 2.2.16 Removed the SetExternalStringDiposeCallback API. Changed the disposal of external string resources to call a virtual Dispose method on the resource. Added support for more precise break points when debugging and stepping. Memory usage improvements on all platforms. 2010-06-07: Version 2.2.15 Added an API to control the disposal of external string resources. Added missing initialization of a couple of variables which makes some compilers complaint when compiling with -Werror. Improved performance on all platforms. 2010-06-02: Version 2.2.14 Fixed a crash in code generated for String.charCodeAt. Fixed a compilation issue with some GCC versions (issue 727). Performance optimizations on x64 and ARM platforms. 2010-05-31: Version 2.2.13 Implemented Object.getOwnPropertyDescriptor for element indices and strings (issue 599). Fixed bug for windows 64 bit C calls from generated code. Added new scons flag unalignedaccesses for arm builds. Performance improvements on all platforms. 2010-05-26: Version 2.2.12 Allowed accessors to be defined on objects rather than just object templates. Changed the ScriptData API. 2010-05-21: Version 2.2.11 Fixed crash bug in liveedit on 64 bit. Use 'full compiler' when debugging is active. This should increase the density of possible break points, making single step more fine grained. This will only take effect for functions compiled after debugging has been started, so recompilation of all functions is required to get the full effect. IA32 and x64 only for now. Misc. fixes to the Solaris build. Added new flags --print-cumulative-gc-stat and --trace-gc-nvp. Added filtering of CPU profiles by security context. Fixed crash bug on ARM when running without VFP2 or VFP3. Incremental performance improvements in all backends. 2010-05-17: Version 2.2.10 Performance improvements in the x64 and ARM backends. 2010-05-10: Version 2.2.9 Allowed Object.create to be called with a function (issue 697). Fixed bug with Date.parse returning a non-NaN value when called on a non date string (issue 696). Allowed unaligned memory accesses on ARM targets that support it (by Subrato K De of CodeAurora ). C++ API for retrieving JavaScript stack trace information. 2010-05-05: Version 2.2.8 Performance improvements in the x64 and ARM backends. 2010-05-03: Version 2.2.7 Added support for ES5 date time string format to Date.parse. Performance improvements in the x64 backend. 2010-04-28: Version 2.2.6 Added "amd64" as recognized architecture in scons build script (by Ryan Dahl ). Fixed bug in String search and replace with very simple RegExps. Fixed bug in RegExp containing "\b^". Performance improvements on all platforms. 2010-04-26: Version 2.2.5 Various performance improvements (especially for ARM and x64) Fixed bug in CPU profiling (http://crbug.com/42137) Fixed a bug with the natives cache. Fixed two bugs in the ARM code generator that can cause wrong calculations. Fixed a bug that may cause a wrong result for shift operations. 2010-04-21: Version 2.2.4 Fixed warnings on arm on newer GCC versions. Fixed a number of minor bugs. Performance improvements on all platforms. 2010-04-14: Version 2.2.3 Added stack command and mem command to ARM simulator debugger. Fixed scons snapshot and ARM build, and Windows X64 build issues. Performance improvements on all platforms. 2010-04-12: Version 2.2.2 Introduced new profiler API. Fixed random number generator to produce full 32 random bits. 2010-04-06: Version 2.2.1 Debugger improvements. Fixed minor bugs. 2010-03-29: Version 2.2.0 Fixed a few minor bugs. Performance improvements for string operations. 2010-03-26: Version 2.1.10 Fixed scons build issues. Fixed a couple of minor bugs. 2010-03-25: Version 2.1.9 Added API support for reattaching a global object to a context. Extended debugger API with access to the internal debugger context. Fixed Chromium crashes (issues http://crbug.com/39128 and http://crbug.com/39160) 2010-03-24: Version 2.1.8 Added fine-grained garbage collection callbacks to the API. Performance improvements on all platforms. 2010-03-22: Version 2.1.7 Fixed issue 650. Fixed a bug where __proto__ was sometimes enumerated (issue 646). Performance improvements for arithmetic operations. Performance improvements for string operations. Print script name and line number information in stack trace. 2010-03-17: Version 2.1.6 Performance improvements for arithmetic operations. Performance improvements for string operations. 2010-03-10: Version 2.1.4 Fixed code cache lookup for keyed IC's (issue http://crbug.com/37853). Performance improvements on all platforms. 2010-03-10: Version 2.1.3 Added API method for context-disposal notifications. Added API method for accessing elements by integer index. Added missing implementation of Uint32::Value and Value::IsUint32 API methods. Added IsExecutionTerminating API method. Disabled strict aliasing for GCC 4.4. Fixed string-concatenation bug (issue 636). Performance improvements on all platforms. 2010-02-23: Version 2.1.2 Fixed a crash bug caused by wrong assert. Fixed a bug with register names on 64-bit V8 (issue 615). Performance improvements on all platforms. 2010-02-19: Version 2.1.1 [ES5] Implemented Object.defineProperty. Improved profiler support. Added SetPrototype method in the public V8 API. Added GetScriptOrigin and GetScriptLineNumber methods to Function objects in the API. Performance improvements on all platforms. 2010-02-03: Version 2.1.0 Values are now always wrapped in objects when used as a receiver. (issue 223). [ES5] Implemented Object.getOwnPropertyNames. [ES5] Restrict JSON.parse to only accept strings that conforms to the JSON grammar. Improvement of debugger agent (issue 549 and 554). Fixed problem with skipped stack frame in profiles (issue 553). Solaris support by Erich Ocean and Ryan Dahl . Fixed a bug that Math.round() returns incorrect results for huge integers. Fixed enumeration order for objects created from some constructor functions (isue http://crbug.com/3867). Fixed arithmetic on some integer constants (issue 580). Numerous performance improvements including porting of previous IA-32 optimizations to x64 and ARM architectures. 2010-01-14: Version 2.0.6 Added ES5 Object.getPrototypeOf, GetOwnPropertyDescriptor, GetOwnProperty, FromPropertyDescriptor. Fixed Mac x64 build errors. Improved performance of some math and string operations. Improved performance of some regexp operations. Improved performance of context creation. Improved performance of hash tables. 2009-12-18: Version 2.0.5 Extended to upper limit of map space to allow for 7 times as many map to be allocated (issue 524). Improved performance of code using closures. Improved performance of some binary operations involving doubles. 2009-12-16: Version 2.0.4 Added ECMAScript 5 Object.create. Improved performance of Math.max and Math.min. Optimized adding of strings on 64-bit platforms. Improved handling of external strings by using a separate table instead of weak handles. This improves garbage collection performance and uses less memory. Changed code generation for object and array literals in toplevel code to be more compact by doing more work in the runtime. Fixed a crash bug triggered when garbage collection happened during generation of a callback load inline cache stub. Fixed crash bug sometimes triggered when local variables shadowed parameters in functions that used the arguments object. 2009-12-03: Version 2.0.3 Optimized handling and adding of strings, for-in and Array.join. Heap serialization is now non-destructive. Improved profiler support with information on time spend in C++ callbacks registered through the API. Added commands to the debugger protocol for starting/stopping profiling. Enabled the non-optimizing compiler for top-level code. Changed the API to only allow strings to be set as data objects on Contexts and scripts to avoid potentially keeping global objects around for too long (issue 528). OpenBSD support patch by Peter Valchev . Fixed bugs. 2009-11-24: Version 2.0.2 Improved profiler support. Fixed bug that broke compilation of d8 with readline support. 2009-11-20: Version 2.0.1 Fixed crash bug in String.prototype.replace. Reverted a change which caused Chromium interactive ui test failures. 2009-11-18: Version 2.0.0 Added support for VFP on ARM. Added TryCatch::ReThrow method to the API. Reduced the size of snapshots and improved the snapshot load time. Improved heap profiler support. 64-bit version now supported on Windows. Fixed a number of debugger issues. Fixed bugs. 2009-10-29: Version 1.3.18 Reverted a change which caused crashes in RegExp replace. Reverted a change which caused Chromium ui_tests failure. 2009-10-28: Version 1.3.17 Added API method to get simple heap statistics. Improved heap profiler support. Fixed the implementation of the resource constraint API so it works when using snapshots. Fixed a number of issues in the Windows 64-bit version. Optimized calls to API getters. Added valgrind notification on code modification to the 64-bit version. Fixed issue where we logged shared library addresses on Windows at startup and never used them. 2009-10-16: Version 1.3.16 X64: Convert smis to holding 32 bits of payload. Introduced v8::Integer::NewFromUnsigned method. Added missing null check in Context::GetCurrent. Added trim, trimLeft and trimRight methods to String Patch by Jan de Mooij Implement ES5 Array.isArray Patch by Jan de Mooij Skip access checks for hidden properties. Added String::Concat(Handle left, Handle right) to the V8 API. Fixed GYP-based builds of V8. 2009-10-07: Version 1.3.15 Expanded the maximum size of the code space to 512MB for 64-bit mode. Fixed a crash bug happening when starting profiling (issue http://crbug.com/23768). 2009-10-07: Version 1.3.14 Added GetRealNamedProperty to the API to lookup real properties located on the object or in the prototype chain skipping any interceptors. Fixed the stack limits setting API to work correctly with threads. The stack limit now needs to be set to each thread thich is used with V8. Removed the high-priority flag from IdleNotification() Ensure V8 is initialized before locking and unlocking threads. Implemented a new JavaScript minifier for compressing the source of the built-in JavaScript. This removes non-Open Source code from Douglas Crockford from the project. Added a missing optimization in StringCharAt. Fixed some flaky socket tests. Change by Alexander Botero-Lowry to fix profiler sampling on FreeBSD in 64-bit mode. Fixed memory leaks in the thread management code. Fixed the result of assignment to a pixel array. The assigned value is now the result. Error reporting for invalid left-hand sides in for-in statements, pre- and postfix count expressions, and assignments now matches the JSC behavior in Safari 4. Follow the spec in disallowing function declarations without a name. Always allocate code objects within a 2 GB range. On x64 architecture this is used to use near calls (32-bit displacement) in Code objects. Optimized array construction ported to x64 and ARM architectures. [ES5] Changed Object.keys to return strings for element indices. 2009-09-23: Version 1.3.13 Fixed uninitialized memory problem. Improved heap profiler support. 2009-09-22: Version 1.3.12 Changed behavior of |function|.toString() on built-in functions to be compatible with other implementations. Patch by Jan de Mooij. Added Object::IsDirty in the API. Optimized array construction; it is now handled purely in native code. [ES5] Made properties of the arguments array enumerable. [ES5] Added test suite adapter for the es5conform test suite. [ES5] Added Object.keys function. 2009-09-15: Version 1.3.11 Fixed crash in error reporting during bootstrapping. Optimized generated IA32 math code by using SSE2 instructions when available. Implemented missing pieces of debugger infrastructure on ARM. The debugger is now fully functional on ARM. Made 'hidden' the default visibility for gcc. 2009-09-09: Version 1.3.10 Fixed profiler on Mac in 64-bit mode. Optimized creation of objects from simple constructor functions on ARM. Fixed a number of debugger issues. Reduced the amount of memory consumed by V8. 2009-09-02: Version 1.3.9 Optimized stack guard checks on ARM. Optimized API operations by inlining more in the API. Optimized creation of objects from simple constructor functions. Enabled a number of missing optimizations in the 64-bit port. Implemented native-code support for regular expressions on ARM. Stopped using the 'sahf' instruction on 64-bit machines that do not support it. Fixed a bug in the support for forceful termination of JavaScript execution. 2009-08-26: Version 1.3.8 Changed the handling of idle notifications to allow idle notifications when V8 has not yet been initialized. Fixed ARM simulator compilation problem on Windows. 2009-08-25: Version 1.3.7 Reduced the size of generated code on ARM platforms by reducing the size of constant pools. Changed build files to not include the 'ENV' user environment variable in the build environment. Changed the handling of idle notifications. 2009-08-21: Version 1.3.6 Added support for forceful termination of JavaScript execution. Added low memory notification to the API. The embedding host can signal a low memory situation to V8. Changed the handling of global handles (persistent handles in the API sense) to avoid issues regarding allocation of new global handles during weak handle callbacks. Changed the growth policy of the young space. Fixed a GC issue introduced in version 1.3.5. 2009-08-19: Version 1.3.5 Optimized initialization of some arrays in the builtins. Fixed mac-nm script to support filenames with spaces. Support for using the V8 profiler when V8 is embedded in a Windows DLL. Changed typeof RegExp from 'object' to 'function' for compatibility. Fixed bug where regexps were not callable across contexts. Added context independent script compilation to the API. Added API call to get the stack trace for an exception. Added API for getting object mirrors. Made sure that SSE3 instructions are used whenever possible even when running off a snapshot generated without using SSE3 instructions. Tweaked the handling of the initial size and growth policy of the heap. Added native code generation for RegExp to 64-bit version. Added JavaScript debugger support to 64-bit version. 2009-08-13: Version 1.3.4 Added a readline() command to the d8 shell. Fixed bug in json parsing. Added idle notification to the API and reduced memory on idle notifications. 2009-08-12: Version 1.3.3 Fixed issue 417: incorrect %t placeholder expansion. Added .gitignore file similar to Chromium's one. Fixed SConstruct file to build with new logging code for Android. API: added function to find instance of template in prototype chain. Inlined Object::IsInstanceOf. Land change to notify valgrind when we modify code on x86. Added api call to determine whether a string can be externalized. Added a write() command to d8. 2009-08-05: Version 1.3.2 Started new compiler infrastructure for two-pass compilation using a control flow graph constructed from the AST. Profiler stack sampling for X64. Safe handling of NaN to Posix platform-dependent time functions. Added a new profiler control API to unify controlling various aspects of profiling. Fixed issue 392. 2009-07-30: Version 1.3.1 Speed improvements to accessors and interceptors. Added support for capturing stack information on custom errors. Added support for morphing an object into a pixel array where its indexed properties are stored in an external byte array. Values written are always clamped to the 0..255 interval. Profiler on x64 now handles C/C++ functions from shared libraries. Changed the debugger to avoid stepping into function.call/apply if the function is a built-in. Initial implementation of constructor heap profile for JS objects. More fine grained control of profiling aspects through the API. Optimized the called as constructor check for API calls. 2009-07-27: Version 1.3.0 Allowed RegExp objects to be called as functions (issue 132). Fixed issue where global property cells would escape after detaching the global object; see http://crbug.com/16276. Added support for stepping into setters and getters in the debugger. Changed the debugger to avoid stopping in its own JavaScript code and in the code of built-in functions. Fixed issue 345 by avoiding duplicate escaping labels. Fixed ARM code generator crash in short-circuited boolean expressions and added regression tests. Added an external allocation limit to avoid issues where small V8 objects would hold on to large amounts of external memory without causing garbage collections. Finished more of the inline caching stubs for x64 targets. 2009-07-13: Version 1.2.14 Added separate paged heap space for global property cells and avoid updating the write barrier when storing into them. Improved peep-hole optimization on ARM platforms by not emitting unnecessary debug information. Re-enabled ICs for loads and calls that skip a global object during lookup through the prototype chain. Allowed access through global proxies to use ICs. Fixed issue 401. 2009-07-09: Version 1.2.13 Fixed issue 397, issue 398, and issue 399. Added support for breakpoint groups. Fixed bugs introduced with the new global object representation. Fixed a few bugs in the ARM code generator. 2009-07-06: Version 1.2.12 Added stack traces collection to Error objects accessible through the e.stack property. Changed RegExp parser to use a recursive data structure instead of stack-based recursion. Optimized Date object construction and string concatenation. Improved performance of div, mod, and mul on ARM platforms. 2009-07-02: Version 1.2.11 Improved performance on IA-32 and ARM. Fixed profiler sampler implementation on Mac OS X. Changed the representation of global objects to improve performance of adding a lot of new properties. 2009-06-29: Version 1.2.10 Improved debugger support. Fixed bug in exception message reporting (issue 390). Improved overall performance. 2009-06-23: Version 1.2.9 Improved math performance on ARM. Fixed profiler name-inference bug. Fixed handling of shared libraries in the profiler tick processor scripts. Fixed handling of tests that time out in the test scripts. Fixed compilation on MacOS X version 10.4. Fixed two bugs in the regular expression engine. Fixed a bug in the string type inference. Fixed a bug in the handling of 'constant function' properties. Improved overall performance. 2009-06-16: Version 1.2.8 Optimized math on ARM platforms. Fixed two crash bugs in the handling of getters and setters. Improved the debugger support by adding scope chain information. Improved the profiler support by compressing log data transmitted to clients. Improved overall performance. 2009-06-08: Version 1.2.7 Improved debugger and profiler support. Reduced compilation time by improving the handling of deferred code. Optimized interceptor accesses where the property is on the object on which the interceptors is attached. Fixed compilation problem on GCC 4.4 by changing the stack alignment to 16 bytes. Fixed handle creation to follow stric aliasing rules. Fixed compilation on FreeBSD. Introduced API for forcing the deletion of a property ignoring interceptors and attributes. 2009-05-29: Version 1.2.6 Added a histogram recording hit rates at different levels of the compilation cache. Added stack overflow check for the RegExp analysis phase. Previously a very long regexp graph could overflow the stack with recursive calls. Use a dynamic buffer when collecting log events in memory. Added start/stop events to the profiler log. Fixed infinite loop which could happen when setting a debug break while executing a RegExp compiled to native code. Fixed handling of lastIndexOf called with negative index (issue 351). Fixed irregular crash in profiler test (issue 358). Fixed compilation issues with some versions of gcc. 2009-05-26: Version 1.2.5 Fixed bug in initial boundary check for Boyer-Moore text search (issue 349). Fixed compilation issues with MinGW and gcc 4.3+ and added support for armv7 and cortex-a8 architectures. Patches by Lei Zhang and Craig Schlenter. Added a script cache to the debugger. Optimized compilation performance by improving internal data structures and avoiding expensive property load optimizations for code that's infrequently executed. Exposed the calling JavaScript context through the static API function Context::GetCalling(). 2009-05-18: Version 1.2.4 Improved performance of floating point number allocation for ARM platforms. Fixed crash when using the instanceof operator on functions with number values in their prototype chain (issue 341). Optimized virtual frame operations in the code generator to speed up compilation time and allocated the frames in the zone. Made the representation of virtual frames and jump targets in the code generator much more compact. Avoided linear search for non-locals in scope code when resolving variables inside with and eval scopes. Optimized lexical scanner by dealing with whitespace as part of the token scanning instead of as a separate step before it. Changed the scavenging collector so that promoted objects do not reside in the old generation while their remembered set is being swept for pointers into the young generation. Fixed numeric overflow handling when compiling count operations. 2009-05-11: Version 1.2.3 Fixed bug in reporting of out-of-memory situations. Introduced hidden prototypes on certain builtin prototype objects such as String.prototype to emulate JSC's behavior of restoring the original function when deleting functions from those prototype objects. Fixed crash bug in the register allocator. 2009-05-04: Version 1.2.2 Fixed bug in array sorting for sparse arrays (issue 326). Added support for adding a soname when building a shared library on Linux (issue 151). Fixed bug caused by morphing internal ASCII strings to external two-byte strings. Slices over ASCII strings have to forward ASCII checks to the underlying buffer string. Allowed API call-as-function handlers to be called as constructors. Fixed a crash bug where an external string was disposed but a slice of the external string survived as a symbol. 2009-04-27: Version 1.2.1 Added EcmaScript 5 JSON object. Fixed bug in preemption support on ARM. 2009-04-23: Version 1.2.0 Optimized floating-point operations on ARM. Added a number of extensions to the debugger API. Changed the enumeration order for unsigned integer keys to always be numerical order. Added a "read" extension to the shell sample. Added support for Array.prototype.reduce and Array.prototype.reduceRight. Added an option to the SCons build to control Microsoft Visual C++ link-time code generation. Fixed a number of bugs (in particular issue 315, issue 316, issue 317 and issue 318). 2009-04-15: Version 1.1.10 Fixed crash bug that occurred when loading a const variable in the presence of eval. Allowed using with and eval in registered extensions in debug mode by fixing bogus assert. Fixed the source position for function returns to enable the debugger to break there. 2009-04-14: Version 1.1.9 Made the stack traversal code in the profiler robust by avoiding to look into the heap. Added name inferencing for anonymous functions to facilitate debugging and profiling. Re-enabled stats timers in the developer shell (d8). Fixed issue 303 by avoiding to shortcut cons-symbols. 2009-04-11: Version 1.1.8 Changed test-debug/ThreadedDebugging to be non-flaky (issue 96). Fixed step-in handling for Function.prototype.apply and call in the debugger (issue 269). Fixed v8::Object::DeleteHiddenValue to not bail out when there are no hidden properties. Added workaround for crash bug, where external symbol table entries with deleted resources would lead to NPEs when looking up in the symbol table. 2009-04-07: Version 1.1.7 Added support for easily importing additional environment variables into the SCons build. Optimized strict equality checks. Fixed crash in indexed setters on objects without a corresponding getter (issue 298). Re-enabled script compilation cache. 2009-04-01: Version 1.1.6 Reverted an unsafe code generator change. 2009-04-01: Version 1.1.5 Fixed bug that caused function literals to not be optimized as much as other functions. Improved profiler support. Fixed a crash bug in connection with debugger unloading. Fixed a crash bug in the code generator caused by losing the information that a frame element was copied. Fixed an exception propagation bug that could cause non-null return values when exceptions were thrown. 2009-03-30: Version 1.1.4 Optimized String.prototype.match. Improved the stack information in profiles. Fixed bug in ARM port making it possible to compile the runtime system for thumb mode again. Implemented a number of optimizations in the code generator. Fixed a number of memory leaks in tests. Fixed crash bug in connection with script source code and external strings. 2009-03-24: Version 1.1.3 Fixed assertion failures in compilation of loop conditions. Removed STL dependency from developer shell (d8). Added infrastructure for protecting the V8 heap from corruption caused by memory modifications from the outside. 2009-03-24: Version 1.1.2 Improved frame merge code generated by the code generator. Optimized String.prototype.replace. Implemented __defineGetter__ and __defineSetter__ for properties with integer keys on non-array objects. Improved debugger and profiler support. Fixed a number of portability issues to allow compilation for smaller ARM devices. Exposed object cloning through the API. Implemented hidden properties. This is used to expose an identity hash for objects through the API. Implemented restarting of regular expressions if their input string changes representation during preemption. Fixed a code generator bug that could cause assignments in loops to be ignored if using continue to break out of the loop (issue 284). 2009-03-12: Version 1.1.1 Fixed an assertion in the new compiler to take stack overflow exceptions into account. Removed exception propagation code that could cause crashes. Fixed minor bug in debugger line number computations. 8-byte align the C stack on Linux and Windows to speed up floating point computations. 2009-03-12: Version 1.1.0 Improved code generation infrastructure by doing simple register allocation and constant folding and propagation. Optimized regular expression matching by avoiding to create intermediate string arrays and by flattening nested array representations of RegExp data. Traverse a few stack frames when recording profiler samples to include partial call graphs in the profiling output. Added support for using OProfile to profile generated code. Added remote debugging support to the D8 developer shell. Optimized creation of nested literals like JSON objects. Fixed a bug in garbage collecting unused maps and turned it on by default (--collect-maps). Added support for running tests under Valgrind. 2009-02-27: Version 1.0.3 Optimized double-to-integer conversions in bit operations by using SSE3 instructions if available. Optimized initialization sequences that store to multiple properties of the same object. Changed the D8 debugger frontend to use JSON messages. Force garbage collections when disposing contexts. Align code objects at 32-byte boundaries. 2009-02-25: Version 1.0.2 Improved profiling support by performing simple call stack sampling for ticks and by fixing a bug in the logging of code addresses. Fixed a number of debugger issues. Optimized code that uses eval. Fixed a couple of bugs in the regular expression engine. Reduced the size of generated code for certain regular expressions. Removed JSCRE completely. Fixed issue where test could not be run if there was a dot in the checkout path. 2009-02-13: Version 1.0.1 Fixed two crash-bugs in irregexp (issue 231 and 233). Fixed a number of minor bugs (issue 87, 227 and 228). Added support for morphing strings to external strings on demand to avoid having to create copies in the embedding code. Removed experimental support for external symbol callbacks. 2009-02-09: Version 1.0.0 Fixed crash-bug in the code generation for case independent 16 bit backreferences. Made shells more robust in the presence of string conversion failures (issue 224). Fixed a potential infinite loop when attempting to resolve eval (issue 221). Miscellaneous fixes to the new regular expression engine. Reduced binary by stripping unneeded text from JavaScript library and minifying some JavaScript files. 2009-01-27: Version 0.4.9 Enabled new regular expression engine. Made a number of changes to the debugger protocol. Fixed a number of bugs in the preemption support. Added -p option to the developer shell to run files in parallel using preemption. Fixed a number of minor bugs (including issues 176, 187, 189, 192, 193, 198 and 201). Fixed a number of bugs in the serialization/deserialization support for the ARM platform. 2009-01-19: Version 0.4.8.1 Minor patch to debugger support. 2009-01-16: Version 0.4.8 Fixed string length bug on ARM (issue 171). Made most methods in the API const. Optimized object literals by improving data locality. Fixed bug that caused incomplete functions to be cached in case of stack overflow exceptions. Fixed bugs that caused catch variables and variables introduced by eval to behave incorrectly when using accessors (issues 186, 190 and 191). 2009-01-06: Version 0.4.7 Minor bugfixes and optimizations. Added command line debugger to D8 shell. Fixed subtle bug that caused the wrong 'this' to be used when calling a caught function in a catch clause. Inline array loads within loops directly in the code instead of always calling a stub. 2008-12-11: Version 0.4.6 Fixed exception reporting bug where certain exceptions were incorrectly reported as uncaught. Improved the memory allocation strategy used during compilation to make running out of memory when compiling huge scripts less likely. Optimized String.replace by avoiding the construction of certain sub strings. Fixed bug in code generation for large switch statements on ARM. Fixed bug that caused V8 to change the global object template passed in by the user. Changed the API for creating object groups used during garbage collection. Entire object groups are now passed to V8 instead of individual members of the groups. 2008-12-03: Version 0.4.5 Added experimental API support for allocating V8 symbols as external strings. Fixed bugs in debugging support on ARM. Changed eval implementation to correctly detect whether or not a call to eval is aliased. Fixed bug caused by a combination of the compilation cache and dictionary probing in native code. The bug caused us to sometimes call functions that had not yet been compiled. Added platform support for FreeBSD. Added support for building V8 on Windows with either the shared or static version of MSVCRT Added the v8::jscre namespace around the jscre functions to avoid link errors (duplicate symbols) when building Google Chrome. Added support for calling a JavaScript function with the current debugger execution context as its argument to the debugger interface. Changed the type of names of counters from wchar_t to char. Changed the Windows system call used to compute daylight savings time. The system call that we used to use became four times slower on WinXP SP3. Added support in the d8 developer shell for memory-mapped counters and added a stats-viewer tool. Fixed bug in upper/lower case mappings (issue 149). 2008-11-17: Version 0.4.4 Reduced code size by using shorter instruction encoding when possible. Added a --help option to the shell sample and to the d8 shell. Added visual studio project files for building the ARM simulator. Fixed a number of ARM simulator issues. Fixed bug in out-of-memory handling on ARM. Implemented shell support for passing arguments to a script from the command line. Fixed bug in date code that made certain date functions return -0 instead of 0 for dates before the epoch. Restricted applications of eval so it can only be used in the context of the associated global object. Treat byte-order marks as whitespace characters. 2008-11-04: Version 0.4.3 Added support for API accessors that prohibit overwriting by accessors defined in JavaScript code by using __defineGetter__ and __defineSetter__. Improved handling of conditionals in test status files. Introduced access control in propertyIsEnumerable. Improved performance of some string operations by caching information about the type of the string between operations. Fixed bug in fast-case code for switch statements that only have integer labels. 2008-10-30: Version 0.4.2 Improved performance of Array.prototype.concat by moving the implementation to C++ (issue 123). Fixed heap growth policy to avoid growing old space to its maximum capacity before doing a garbage collection and fixed issue that would lead to artificial out of memory situations (issue 129). Fixed Date.prototype.toLocaleDateString to return the date in the same format as WebKit. Added missing initialization checks to debugger API. Added removing of unused maps during GC. 2008-10-28: Version 0.4.1 Added caching of RegExp data in compilation cache. Added Visual Studio project file for d8 shell. Fixed function call performance regression introduced in version 0.4.0 when splitting the global object in two parts (issue 120). Fixed issue 131 by checking for empty handles before throwing and reporting exceptions. 2008-10-23: Version 0.4.0 Split the global object into two parts: The state holding global object and the global object proxy. Fixed bug that affected the value of an assignment to an element in certain cases (issue 116). Added GetPropertyNames functionality (issue 33) and extra Date functions (issue 77) to the API. Changed WeakReferenceCallback to take a Persistent instead of a Persistent (issue 101). Fixed issues with message reporting for exceptions in try-finally blocks (issues 73 and 75). Optimized flattening of strings and string equality checking. Improved Boyer-Moore implementation for faster indexOf operations. Added development shell (d8) which includes counters and completion support. Fixed problem with the receiver passed to functions called from eval (issue 124). 2008-10-16: Version 0.3.5 Improved string hash-code distribution by excluding bit-field bits from the hash-code. Changed string search algorithm used in indexOf from KMP to Boyer-Moore. Improved the generated code for the instanceof operator. Improved performance of slow-case string equality checks by specializing the code based on the string representation. Improve the handling of out-of-memory situations (issue 70). Improved performance of strict equality checks. Improved profiler output to make it easier to see anonymous functions. Improved performance of slow-case keyed loads. Improved property access performance by allocating a number of properties in the front object. Changed the toString behavior on the built-in object constructors to print [native code] instead of the actual source. Some web applications do not like constructors with complex toString results. 2008-10-06: Version 0.3.4 Changed Array.prototype.sort to use quick sort. Fixed code generation issue where leaving a finally block with break or continue would accumulate elements on the expression stack (issue 86). Made sure that the name accessor on functions returns the expected names for builtin JavaScript functions and C++ callback functions. Added fast case code for extending the property storage array of JavaScript objects. Ported switch statement optimizations introduced in version 0.3.3 to the ARM code generator. Allowed GCC to use strict-aliasing rules when compiling. Improved performance of arguments object allocation by taking care of arguments adaptor frames in the generated code. Updated the V8 benchmark suite to version 2. 2008-09-25: Version 0.3.3 Improved handling of relocation information to enable more peep-hole optimizations. Optimized switch statements where all labels are constant small integers. Optimized String.prototype.indexOf for common cases. Fixed more build issues (issue 80). Fixed a couple of profiler issues. Fixed bug where the body of a function created using the Function constructor was not allowed to end with a single-line comment (issue 85). Improved handling of object literals by canonicalizing object literal maps. This will allow JSON objects with the same set of properties to share the same map making inline caching work better for JSON objects. 2008-09-17: Version 0.3.2 Generalized the EvalCache into a CompilationCache and enabled it for scripts too. The current strategy is to retire all entries whenever a mark-sweep collection is started. Fixed bug where switch statements containing only a default case would lead to an unbalanced stack (issue 69). Fixed bug that made access to the function in a named function expression impossible in certain situations (issue 24). Fixed even more build issues. Optimized calling conventions on ARM. The conventions on ARM and IA-32 now match. Removed static initializers for flags and counters. Improved inline caching behavior for uncommon cases where lazily loading Date and RegExp code could force certain code paths go megamorphic. Removed arguments adaption for builtins written in C++. This makes Array.prototype.push and Array.prototype.pop slightly faster. 2008-09-11: Version 0.3.1 Fixed a number of build issues. Fixed problem with missing I-cache flusing on ARM. Changed space layout in memory management by splitting up code space into old data space and code space. Added utf-8 conversion support to the API (issue 57). Optimized repeated calls to eval with the same strings. These repeated calls are common in web applications. Added Xcode project file. Optimized a couple of Array operation. Fixed parser bug by checking for end-of-string when parsing break and continue (issue 35). Fixed problem where asian characters were not categorized as letters. Fixed bug that disallowed calling functions fetched from an array using a string as an array index (issue 32). Fixed bug where the internal field count on object templates were sometimes ignored (issue 54). Added -f option to the shell sample for compatibility with other engines (issue 18). Added source info to TryCatches in the API. Fixed problem where the seed for the random number generator was clipped in a double to unsigned int conversion. Fixed bug where cons string symbols were sometimes converted to non-symbol flat strings during GC. Fixed bug in error reporting when attempting to convert null to an object. 2008-09-04: Version 0.3.0 Added support for running tests on the ARM simulator. Fixed bug in the 'in' operator where negative indices were not treated correctly. Fixed build issues on gcc-4.3.1. Changed Date.prototype.toLocaleTimeString to not print the timezone part of the time. Renamed debug.h to v8-debug.h to reduce the risk of name conflicts with user code. 2008-09-02: Version 0.2.5 Renamed the top level directory 'public' to 'include'. Added 'env' option to the SCons build scripts to support overriding the ENV part of the build environment. This is mostly to support Windows builds in cases where SCons cannot find the correct paths to the Windows SDK, as these paths cannot be passed through shell environment variables. Enabled "Buffer Security Check" on for the Windows SCons build and added the linker option /OPT:ICF as an optimization. Added the V8 benchmark suite to the repository. 2008-09-01: Version 0.2.4 Included mjsunit JavaScript test suite and C++ unit tests. Changed the shell sample to not print the result of executing a script provided on the command line. Fixed issue when building samples on Windows using a shared V8 library. Added visibility option on Linux build which makes the generated library 18% smaller. Changed build system to accept multiple build modes in one build and generate separate objects, libraries and executables for each mode. Removed deferred negation optimization (a * -b => -(a * b)) since this visibly changes operand conversion order. Improved parsing performance by introducing stack guard in preparsing. Without a stack guard preparsing always bails out with stack overflow. Changed shell sample to take flags directly from the command-line. Added API call that implements this. Added load, quit and version functions to the shell sample so it's easier to run benchmarks and tests. Fixed issue with building samples and cctests on 64-bit machines. Fixed bug in the runtime system where the prototype chain was not always searched for a setter when setting a property that does not exist locally. 2008-08-14: Version 0.2.3 Improved performance of garbage collection by moving the function that updates pointers during compacting collection into the updating visitor. This gives the compiler a better chance to inline and avoid a function call per (potential) pointer. Extended the shell sample with a --runtime-flags option. Added Visual Studio project files for the shell.cc and process.cc samples. 2008-08-13: Version 0.2.2 Improved performance of garbage collection by changing the way we use the marking stack in the event of stack overflow during full garbage collection and by changing the way we mark roots. Cleaned up ARM version by removing top of stack caching and by introducing push/pop elimination. Cleaned up the way runtime functions are called to allow runtime calls with no arguments. Changed Windows build options to make sure that exceptions are disabled and that optimization flags are enabled. Added first version of Visual Studio project files. 2008-08-06: Version 0.2.1 Improved performance of unary addition by avoiding runtime calls. Fixed the handling of '>' and '<=' to use right-to-left conversion and left-to-right evaluation as specified by ECMA-262. Fixed a branch elimination bug on the ARM platform where incorrect code was generated because of overly aggressive branch elimination. Improved performance of code that repeatedly assigns the same function to the same property of different objects with the same map. Untangled DEBUG and ENABLE_DISASSEMBLER defines. The disassembler no longer expects DEBUG to be defined. Added platform-nullos.cc to serve as the basis for new platform implementations. 2008-07-30: Version 0.2.0 Changed all text files to have native svn:eol-style. Added a few samples and support for building them. The samples include a simple shell that can be used to benchmark and test V8. Changed V8::GetVersion to return the version as a string. Added source for lazily loaded scripts to snapshots and made serialization non-destructive. Improved ARM support by fixing the write barrier code to use aligned loads and stores and by removing premature locals optimization that relied on broken support for callee-saved registers (removed). Refactored the code for marking live objects during garbage collection and the code for allocating objects in paged spaces. Introduced an abstraction for the map word of a heap- allocated object and changed the memory allocator to allocate executable memory only for spaces that may contain code objects. Moved StringBuilder to utils.h and ScopedLock to platform.h, where they can be used by debugging and logging modules. Added thread-safe message queues for dealing with debugger events. Fixed the source code reported by toString for certain builtin empty functions and made sure that the prototype property of a function is enumerable. Improved performance of converting values to condition flags in generated code. Merged disassembler-{arch} files. 2008-07-28: Version 0.1.4 Added support for storing JavaScript stack traces in a stack allocated buffer to make it visible in shallow core dumps. Controlled by the --preallocate-message-memory flag which is disabled by default. 2008-07-25: Version 0.1.3 Fixed bug in JSObject::GetPropertyAttributePostInterceptor where map transitions would count as properties. Allowed aliased eval invocations by treating them as evals in the global context. This may change in the future. Added support for accessing the last entered context through the API and renamed Context::Current to Context::GetCurrent and Context::GetSecurityContext to Context::GetCurrentSecurityContext. Fixed bug in the debugger that would cause the debugger scripts to be recursively loaded and changed all disabling of interrupts to be block-structured. Made snapshot data read-only to allow it to be more easily shared across multiple users of V8 when linked as a shared library. 2008-07-16: Version 0.1.2 Fixed building on Mac OS X by recognizing i386 and friends as IA-32 platforms. Added propagation of stack overflow exceptions that occur while compiling nested functions. Improved debugger with support for recursive break points and handling of exceptions that occur in the debugger JavaScript code. Renamed GetInternal to GetInternalField and SetInternal to SetInternalField in the API and moved InternalFieldCount and SetInternalFieldCount from FunctionTemplate to ObjectTemplate. 2008-07-09: Version 0.1.1 Fixed bug in stack overflow check code for IA-32 targets where a non-tagged value in register eax was pushed to the stack. Fixed potential quadratic behavior when converting strings to numbers. Fixed bug where the return value from Object::SetProperty could end up being the property holder instead of the written value. Improved debugger support by allowing nested break points and by dealing with stack-overflows when compiling functions before setting break points in them. 2008-07-03: Version 0.1.0 Initial export. # Local Variables: # mode:text # End: v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/DEPS000066400000000000000000000013311211511573600176640ustar00rootroot00000000000000# Note: The buildbots evaluate this file with CWD set to the parent # directory and assume that the root of the checkout is in ./v8/, so # all paths in here must match this assumption. deps = { # Remember to keep the revision in sync with the Makefile. "v8/build/gyp": "http://gyp.googlecode.com/svn/trunk@1501", } deps_os = { "win": { "v8/third_party/cygwin": "http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844", "v8/third_party/python_26": "http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111", } } hooks = [ { # A change to a .gyp, .gypi, or to GYP itself should run the generator. "pattern": ".", "action": ["python", "v8/build/gyp_v8"], }, ] v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/LICENSE000066400000000000000000000053661211511573600202270ustar00rootroot00000000000000This license applies to all parts of V8 that are not externally maintained libraries. The externally maintained libraries used by V8 are: - PCRE test suite, located in test/mjsunit/third_party/regexp-pcre.js. This is based on the test suite from PCRE-7.3, which is copyrighted by the University of Cambridge and Google, Inc. The copyright notice and license are embedded in regexp-pcre.js. - Layout tests, located in test/mjsunit/third_party. These are based on layout tests from webkit.org which are copyrighted by Apple Computer, Inc. and released under a 3-clause BSD license. - Strongtalk assembler, the basis of the files assembler-arm-inl.h, assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. This code is copyrighted by Sun Microsystems Inc. and released under a 3-clause BSD license. - Valgrind client API header, located at third_party/valgrind/valgrind.h This is release under the BSD license. These libraries have their own licenses; we recommend you read them, as their terms may differ from the terms below. Copyright 2006-2012, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/LICENSE.strongtalk000066400000000000000000000027121211511573600224060ustar00rootroot00000000000000Copyright (c) 1994-2006 Sun Microsystems Inc. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Sun Microsystems or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/LICENSE.v8000066400000000000000000000027671211511573600205650ustar00rootroot00000000000000Copyright 2006-2011, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/LICENSE.valgrind000066400000000000000000000040161211511573600220230ustar00rootroot00000000000000---------------------------------------------------------------- Notice that the following BSD-style license applies to this one file (valgrind.h) only. The rest of Valgrind is licensed under the terms of the GNU General Public License, version 2, unless otherwise indicated. See the COPYING file in the source distribution for details. ---------------------------------------------------------------- This file is part of Valgrind, a dynamic binary instrumentation framework. Copyright (C) 2000-2007 Julian Seward. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 4. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/Makefile000066400000000000000000000237301211511573600206550ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Variable default definitions. Override them by exporting them in your shell. CXX ?= g++ LINK ?= g++ OUTDIR ?= out TESTJOBS ?= GYPFLAGS ?= TESTFLAGS ?= ANDROID_NDK_ROOT ?= ANDROID_TOOLCHAIN ?= ANDROID_V8 ?= /data/local/v8 # Special build flags. Use them like this: "make library=shared" # library=shared || component=shared_library ifeq ($(library), shared) GYPFLAGS += -Dcomponent=shared_library endif ifdef component GYPFLAGS += -Dcomponent=$(component) endif # console=readline ifdef console GYPFLAGS += -Dconsole=$(console) endif # disassembler=on ifeq ($(disassembler), on) GYPFLAGS += -Dv8_enable_disassembler=1 endif # objectprint=on ifeq ($(objectprint), on) GYPFLAGS += -Dv8_object_print=1 endif # verifyheap=on ifeq ($(verifyheap), on) GYPFLAGS += -Dv8_enable_verify_heap=1 endif # snapshot=off ifeq ($(snapshot), off) GYPFLAGS += -Dv8_use_snapshot='false' endif # extrachecks=on/off ifeq ($(extrachecks), on) GYPFLAGS += -Dv8_enable_extra_checks=1 endif ifeq ($(extrachecks), off) GYPFLAGS += -Dv8_enable_extra_checks=0 endif # gdbjit=on ifeq ($(gdbjit), on) GYPFLAGS += -Dv8_enable_gdbjit=1 endif # liveobjectlist=on ifeq ($(liveobjectlist), on) GYPFLAGS += -Dv8_use_liveobjectlist=true endif # vfp3=off ifeq ($(vfp3), off) GYPFLAGS += -Dv8_can_use_vfp3_instructions=false else GYPFLAGS += -Dv8_can_use_vfp3_instructions=true endif # debuggersupport=off ifeq ($(debuggersupport), off) GYPFLAGS += -Dv8_enable_debugger_support=0 endif # soname_version=1.2.3 ifdef soname_version GYPFLAGS += -Dsoname_version=$(soname_version) endif # werror=no ifeq ($(werror), no) GYPFLAGS += -Dwerror='' endif # presubmit=no ifeq ($(presubmit), no) TESTFLAGS += --no-presubmit endif # strictaliasing=off (workaround for GCC-4.5) ifeq ($(strictaliasing), off) GYPFLAGS += -Dv8_no_strict_aliasing=1 endif # regexp=interpreted ifeq ($(regexp), interpreted) GYPFLAGS += -Dv8_interpreted_regexp=1 endif # hardfp=on ifeq ($(hardfp), on) GYPFLAGS += -Dv8_use_arm_eabi_hardfloat=true endif # ----------------- available targets: -------------------- # - "dependencies": pulls in external dependencies (currently: GYP) # - any arch listed in ARCHES (see below) # - any mode listed in MODES # - every combination ., e.g. "ia32.release" # - "native": current host's architecture, release mode # - any of the above with .check appended, e.g. "ia32.release.check" # - "android": cross-compile for Android/ARM # - default (no target specified): build all DEFAULT_ARCHES and MODES # - "check": build all targets and run all tests # - ".clean" for any in ARCHES # - "clean": clean all ARCHES # ----------------- internal stuff ------------------------ # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). ARCHES = ia32 x64 arm mipsel DEFAULT_ARCHES = ia32 x64 arm MODES = release debug ANDROID_ARCHES = android_ia32 android_arm # List of files that trigger Makefile regeneration: GYPFILES = build/all.gyp build/common.gypi build/standalone.gypi \ preparser/preparser.gyp samples/samples.gyp src/d8.gyp \ test/cctest/cctest.gyp tools/gyp/v8.gyp # Generates all combinations of ARCHES and MODES, e.g. "ia32.release". BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) ANDROID_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(ANDROID_ARCHES))) # Generates corresponding test targets, e.g. "ia32.release.check". CHECKS = $(addsuffix .check,$(BUILDS)) ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) # File where previously used GYPFLAGS are stored. ENVFILE = $(OUTDIR)/environment .PHONY: all check clean dependencies $(ENVFILE).new native \ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN # Target definitions. "all" is the default. all: $(MODES) # Special target for the buildbots to use. Depends on $(OUTDIR)/Makefile # having been created before. buildbot: $(MAKE) -C "$(OUTDIR)" BUILDTYPE=$(BUILDTYPE) \ builddir="$(abspath $(OUTDIR))/$(BUILDTYPE)" mips mips.release mips.debug: @echo "V8 does not support big-endian MIPS builds at the moment," \ "please use little-endian builds (mipsel)." # Compile targets. MODES and ARCHES are convenience targets. .SECONDEXPANSION: $(MODES): $(addsuffix .$$@,$(DEFAULT_ARCHES)) $(ARCHES): $(addprefix $$@.,$(MODES)) # Defines how to build a particular target (e.g. ia32.release). $(BUILDS): $(OUTDIR)/Makefile.$$(basename $$@) @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \ CXX="$(CXX)" LINK="$(LINK)" \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ python -c "print raw_input().capitalize()") \ builddir="$(shell pwd)/$(OUTDIR)/$@" native: $(OUTDIR)/Makefile.native @$(MAKE) -C "$(OUTDIR)" -f Makefile.native \ CXX="$(CXX)" LINK="$(LINK)" BUILDTYPE=Release \ builddir="$(shell pwd)/$(OUTDIR)/$@" $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android @$(MAKE) -f Makefile.android $@ \ ARCH="$(basename $@)" \ MODE="$(subst .,,$(suffix $@))" \ OUTDIR="$(OUTDIR)" \ GYPFLAGS="$(GYPFLAGS)" # Test targets. check: all @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch=$(shell echo $(DEFAULT_ARCHES) | sed -e 's/ /,/g') \ $(TESTFLAGS) $(addsuffix .check,$(MODES)): $$(basename $$@) @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --mode=$(basename $@) $(TESTFLAGS) $(addsuffix .check,$(ARCHES)): $$(basename $$@) @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch=$(basename $@) $(TESTFLAGS) $(CHECKS): $$(basename $$@) @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) $(TESTFLAGS) $(addsuffix .sync, $(ANDROID_BUILDS)): $$(basename $$@) @tools/android-sync.sh $(basename $@) $(OUTDIR) \ $(shell pwd) $(ANDROID_V8) $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ --arch-and-mode=$(basename $@) \ --timeout=600 \ --command-prefix="tools/android-run.py" $(addsuffix .check, $(ANDROID_ARCHES)): \ $(addprefix $$(basename $$@).,$(MODES)).check native.check: native @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ --arch-and-mode=. $(TESTFLAGS) # Clean targets. You can clean each architecture individually, or everything. $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): rm -f $(OUTDIR)/Makefile.$(basename $@) rm -rf $(OUTDIR)/$(basename $@).release rm -rf $(OUTDIR)/$(basename $@).debug find $(OUTDIR) -regex '.*\(host\|target\).$(basename $@)\.mk' -delete native.clean: rm -f $(OUTDIR)/Makefile.native rm -rf $(OUTDIR)/native find $(OUTDIR) -regex '.*\(host\|target\).native\.mk' -delete clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean # GYP file generation targets. OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ARCHES)) $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) GYP_GENERATORS=make \ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=$(subst .,,$(suffix $@)) \ -S.$(subst .,,$(suffix $@)) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) GYP_GENERATORS=make \ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: ifndef ANDROID_NDK_ROOT ifndef ANDROID_TOOLCHAIN $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) endif endif # Replaces the old with the new environment file if they're different, which # will trigger GYP to regenerate Makefiles. $(ENVFILE): $(ENVFILE).new @if test -r $(ENVFILE) && cmp $(ENVFILE).new $(ENVFILE) >/dev/null; \ then rm $(ENVFILE).new; \ else mv $(ENVFILE).new $(ENVFILE); fi # Stores current GYPFLAGS in a file. $(ENVFILE).new: @mkdir -p $(OUTDIR); echo "GYPFLAGS=$(GYPFLAGS)" > $(ENVFILE).new; \ echo "CXX=$(CXX)" >> $(ENVFILE).new # Dependencies. # Remember to keep these in sync with the DEPS file. dependencies: svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \ --revision 1501 v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/Makefile.android000066400000000000000000000075711211511573600223010ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Those definitions should be consistent with the main Makefile ANDROID_ARCHES = android_ia32 android_arm MODES = release debug # Generates all combinations of ANDROID ARCHES and MODES, # e.g. "android_ia32.release" or "android_arm.release" ANDROID_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(ANDROID_ARCHES))) HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') ifeq ($(HOST_OS), linux) TOOLCHAIN_DIR = linux-x86 else ifeq ($(HOST_OS), mac) TOOLCHAIN_DIR = darwin-x86 else $(error Host platform "${HOST_OS}" is not supported) endif endif ifeq ($(ARCH), android_arm) DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm DEFINES += arm_neon=0 armv7=1 TOOLCHAIN_ARCH = arm-linux-androideabi-4.6 else ifeq ($(ARCH), android_ia32) DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 TOOLCHAIN_ARCH = x86-4.6 else $(error Target architecture "${ARCH}" is not supported) endif endif TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}") endif # For mksnapshot host generation. DEFINES += host_os=${HOST_OS} .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$(basename $$@) @$(MAKE) -C "$(OUTDIR)" -f Makefile.$(basename $@) \ CXX="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ AR="$(ANDROID_TOOLCHAIN)/bin/*-ar" \ RANLIB="$(ANDROID_TOOLCHAIN)/bin/*-ranlib" \ CC="$(ANDROID_TOOLCHAIN)/bin/*-gcc" \ LD="$(ANDROID_TOOLCHAIN)/bin/*-ld" \ LINK="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ python -c "print raw_input().capitalize()") \ builddir="$(shell pwd)/$(OUTDIR)/$@" # Android GYP file generation targets. ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_ARCHES)) $(ANDROID_MAKEFILES): @GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ CC="${ANDROID_TOOLCHAIN}/bin/*-gcc" \ CXX="${ANDROID_TOOLCHAIN}/bin/*-g++" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ -S.${ARCH} ${GYPFLAGS} v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/OWNERS000066400000000000000000000003551211511573600201530ustar00rootroot00000000000000danno@chromium.org jkummerow@chromium.org mmassi@chromium.org mstarzinger@chromium.org mvstanton@chromium.org rossberg@chromium.org svenpanne@chromium.org ulan@chromium.org vegorov@chromium.org verwaest@chromium.org yangguo@chromium.org v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/PRESUBMIT.py000066400000000000000000000057301211511573600211410ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Top-level presubmit script for V8. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built into gcl. """ def _V8PresubmitChecks(input_api, output_api): """Runs the V8 presubmit checks.""" import sys sys.path.append(input_api.os_path.join( input_api.PresubmitLocalPath(), 'tools')) from presubmit import CppLintProcessor from presubmit import SourceProcessor results = [] if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): results.append(output_api.PresubmitError("C++ lint check failed")) if not SourceProcessor().Run(input_api.PresubmitLocalPath()): results.append(output_api.PresubmitError( "Copyright header and trailing whitespaces check failed")) return results def _CommonChecks(input_api, output_api): """Checks common to both upload and commit.""" results = [] results.extend(input_api.canned_checks.CheckOwners( input_api, output_api, source_file_filter=None)) return results def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) return results def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) results.extend(input_api.canned_checks.CheckChangeHasDescription( input_api, output_api)) results.extend(_V8PresubmitChecks(input_api, output_api)) return results v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/SConstruct000066400000000000000000001345771211511573600212630ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import platform import re import subprocess import sys import os from os.path import join, dirname, abspath from types import DictType, StringTypes root_dir = dirname(File('SConstruct').rfile().abspath) src_dir = join(root_dir, 'src') sys.path.insert(0, join(root_dir, 'tools')) import js2c, utils # ARM_TARGET_LIB is the path to the dynamic library to use on the target # machine if cross-compiling to an arm machine. You will also need to set # the additional cross-compiling environment variables to the cross compiler. ARM_TARGET_LIB = os.environ.get('ARM_TARGET_LIB') if ARM_TARGET_LIB: ARM_LINK_FLAGS = ['-Wl,-rpath=' + ARM_TARGET_LIB + '/lib:' + ARM_TARGET_LIB + '/usr/lib', '-Wl,--dynamic-linker=' + ARM_TARGET_LIB + '/lib/ld-linux.so.3'] else: ARM_LINK_FLAGS = [] GCC_EXTRA_CCFLAGS = [] GCC_DTOA_EXTRA_CCFLAGS = [] LIBRARY_FLAGS = { 'all': { 'CPPPATH': [src_dir], 'regexp:interpreted': { 'CPPDEFINES': ['V8_INTERPRETED_REGEXP'] }, 'mode:debug': { 'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT', 'VERIFY_HEAP'] }, 'objectprint:on': { 'CPPDEFINES': ['OBJECT_PRINT'], }, 'debuggersupport:on': { 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT'], }, 'inspector:on': { 'CPPDEFINES': ['INSPECTOR'], }, 'fasttls:off': { 'CPPDEFINES': ['V8_NO_FAST_TLS'], }, 'liveobjectlist:on': { 'CPPDEFINES': ['ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR', 'LIVE_OBJECT_LIST', 'OBJECT_PRINT'], } }, 'gcc': { 'all': { 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], }, 'visibility:hidden': { # Use visibility=default to disable this. 'CXXFLAGS': ['-fvisibility=hidden'] }, 'strictaliasing:off': { 'CCFLAGS': ['-fno-strict-aliasing'] }, 'mode:debug': { 'CCFLAGS': ['-g', '-O0'], 'CPPDEFINES': ['ENABLE_DISASSEMBLER', 'DEBUG'], }, 'mode:release': { 'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections', '-ffunction-sections'], }, 'os:linux': { 'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS, 'library:shared': { 'CPPDEFINES': ['V8_SHARED', 'BUILDING_V8_SHARED'], 'LIBS': ['pthread'] } }, 'os:macos': { 'CCFLAGS': ['-ansi', '-mmacosx-version-min=10.4'], 'library:shared': { 'CPPDEFINES': ['V8_SHARED', 'BUILDING_V8_SHARED'], } }, 'os:freebsd': { 'CPPPATH' : [src_dir, '/usr/local/include'], 'LIBPATH' : ['/usr/local/lib'], 'CCFLAGS': ['-ansi'], 'LIBS': ['execinfo'] }, 'os:openbsd': { 'CPPPATH' : [src_dir, '/usr/local/include'], 'LIBPATH' : ['/usr/local/lib'], 'CCFLAGS': ['-ansi'], }, 'os:solaris': { # On Solaris, to get isinf, INFINITY, fpclassify and other macros one # needs to define __C99FEATURES__. 'CPPDEFINES': ['__C99FEATURES__'], 'CPPPATH' : [src_dir, '/usr/local/include'], 'LIBPATH' : ['/usr/local/lib'], 'CCFLAGS': ['-ansi'], }, 'os:netbsd': { 'CPPPATH' : [src_dir, '/usr/pkg/include'], 'LIBPATH' : ['/usr/pkg/lib'], }, 'os:win32': { 'CCFLAGS': ['-DWIN32'], 'CXXFLAGS': ['-DWIN32'], }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'], 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'arch:arm': { 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], 'unalignedaccesses:on' : { 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=1'] }, 'unalignedaccesses:off' : { 'CPPDEFINES' : ['CAN_USE_UNALIGNED_ACCESSES=0'] }, 'armeabi:soft' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=soft'], } }, 'armeabi:softfp' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], 'vfp3:on': { 'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS'] }, 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=softfp'], } }, 'armeabi:hard' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'], 'vfp3:on': { 'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS'] }, 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=hard'], } } }, 'simulator:arm': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'], }, 'arch:mips': { 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 'mips_arch_variant:mips32r2': { 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] }, 'mips_arch_variant:loongson': { 'CPPDEFINES': ['_MIPS_ARCH_LOONGSON'] }, 'simulator:none': { 'CCFLAGS': ['-EL'], 'LINKFLAGS': ['-EL'], 'mips_arch_variant:mips32r2': { 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2'] }, 'mips_arch_variant:mips32r1': { 'CCFLAGS': ['-mips32', '-Wa,-mips32'] }, 'mips_arch_variant:loongson': { 'CCFLAGS': ['-march=mips3', '-Wa,-march=mips3'] }, 'library:static': { 'LINKFLAGS': ['-static', '-static-libgcc'] }, 'mipsabi:softfloat': { 'CCFLAGS': ['-msoft-float'], 'LINKFLAGS': ['-msoft-float'] }, 'mipsabi:hardfloat': { 'CCFLAGS': ['-mhard-float'], 'LINKFLAGS': ['-mhard-float'] } } }, 'simulator:mips': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'], 'mipsabi:softfloat': { 'CPPDEFINES': ['__mips_soft_float=1'], 'fpu:on': { 'CPPDEFINES' : ['CAN_USE_FPU_INSTRUCTIONS'] } }, 'mipsabi:hardfloat': { 'CPPDEFINES': ['__mips_hard_float=1', 'CAN_USE_FPU_INSTRUCTIONS'], } }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], 'CCFLAGS': ['-m64'], 'LINKFLAGS': ['-m64'], }, 'gdbjit:on': { 'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE'] }, 'compress_startup_data:bz2': { 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'] } }, 'msvc': { 'all': { 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['/GR-', '/Gy'], 'CPPDEFINES': ['WIN32'], 'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'], 'CCPDBFLAGS': ['/Zi'] }, 'verbose:off': { 'DIALECTFLAGS': ['/nologo'], 'ARFLAGS': ['/NOLOGO'] }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', '_USE_32BIT_TIME_T'], 'LINKFLAGS': ['/MACHINE:X86'], 'ARFLAGS': ['/MACHINE:X86'] }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], 'LINKFLAGS': ['/MACHINE:X64'], 'ARFLAGS': ['/MACHINE:X64'] }, 'mode:debug': { 'CCFLAGS': ['/Od', '/Gm'], 'CPPDEFINES': ['_DEBUG', 'ENABLE_DISASSEMBLER', 'DEBUG'], 'LINKFLAGS': ['/DEBUG'], 'msvcrt:static': { 'CCFLAGS': ['/MTd'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MDd'] } }, 'mode:release': { 'CCFLAGS': ['/O2'], 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], 'msvcrt:static': { 'CCFLAGS': ['/MT'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MD'] }, 'msvcltcg:on': { 'CCFLAGS': ['/GL'], 'ARFLAGS': ['/LTCG'], 'pgo:off': { 'LINKFLAGS': ['/LTCG'], }, 'pgo:instrument': { 'LINKFLAGS': ['/LTCG:PGI'] }, 'pgo:optimize': { 'LINKFLAGS': ['/LTCG:PGO'] } } } } } V8_EXTRA_FLAGS = { 'gcc': { 'all': { 'WARNINGFLAGS': ['-Wall', '-Werror', '-W', '-Wno-unused-parameter', '-Woverloaded-virtual', '-Wnon-virtual-dtor'] }, 'os:win32': { 'WARNINGFLAGS': ['-pedantic', '-Wno-long-long', '-Wno-pedantic-ms-format'], 'library:shared': { 'LIBS': ['winmm', 'ws2_32'] } }, 'os:linux': { 'WARNINGFLAGS': ['-pedantic'], 'library:shared': { 'soname:on': { 'LINKFLAGS': ['-Wl,-soname,${SONAME}'] } } }, 'os:macos': { 'WARNINGFLAGS': ['-pedantic'] }, 'arch:arm': { # This is to silence warnings about ABI changes that some versions of the # CodeSourcery G++ tool chain produce for each occurrence of varargs. 'WARNINGFLAGS': ['-Wno-abi'] }, 'disassembler:on': { 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] } }, 'msvc': { 'all': { 'WARNINGFLAGS': ['/W3', '/WX', '/wd4351', '/wd4355', '/wd4800'] }, 'library:shared': { 'CPPDEFINES': ['BUILDING_V8_SHARED'], 'LIBS': ['winmm', 'ws2_32'] }, 'arch:arm': { 'CPPDEFINES': ['V8_TARGET_ARCH_ARM'], # /wd4996 is to silence the warning about sscanf # used by the arm simulator. 'WARNINGFLAGS': ['/wd4996'] }, 'arch:mips': { 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 'mips_arch_variant:mips32r2': { 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] }, }, 'disassembler:on': { 'CPPDEFINES': ['ENABLE_DISASSEMBLER'] } } } MKSNAPSHOT_EXTRA_FLAGS = { 'gcc': { 'os:linux': { 'LIBS': ['pthread'], }, 'os:macos': { 'LIBS': ['pthread'], }, 'os:freebsd': { 'LIBS': ['execinfo', 'pthread'] }, 'os:solaris': { 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], 'LINKFLAGS': ['-mt'] }, 'os:openbsd': { 'LIBS': ['execinfo', 'pthread'] }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'], }, 'os:netbsd': { 'LIBS': ['execinfo', 'pthread'] }, 'compress_startup_data:bz2': { 'os:linux': { 'LIBS': ['bz2'] } }, }, 'msvc': { 'all': { 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], 'LIBS': ['winmm', 'ws2_32'] } } } DTOA_EXTRA_FLAGS = { 'gcc': { 'all': { 'WARNINGFLAGS': ['-Werror', '-Wno-uninitialized'], 'CCFLAGS': GCC_DTOA_EXTRA_CCFLAGS } }, 'msvc': { 'all': { 'WARNINGFLAGS': ['/WX', '/wd4018', '/wd4244'] } } } CCTEST_EXTRA_FLAGS = { 'all': { 'CPPPATH': [src_dir], 'library:shared': { 'CPPDEFINES': ['USING_V8_SHARED'] }, }, 'gcc': { 'all': { 'LIBPATH': [abspath('.')], 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 'LINKFLAGS': ['$CCFLAGS'], }, 'os:linux': { 'LIBS': ['pthread'], 'CCFLAGS': ['-Wno-unused-but-set-variable'], }, 'os:macos': { 'LIBS': ['pthread'], }, 'os:freebsd': { 'LIBS': ['execinfo', 'pthread'] }, 'os:solaris': { 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], 'LINKFLAGS': ['-mt'] }, 'os:openbsd': { 'LIBS': ['execinfo', 'pthread'] }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'] }, 'os:netbsd': { 'LIBS': ['execinfo', 'pthread'] }, 'arch:arm': { 'LINKFLAGS': ARM_LINK_FLAGS }, }, 'msvc': { 'all': { 'CPPDEFINES': ['_HAS_EXCEPTIONS=0'], 'LIBS': ['winmm', 'ws2_32'] }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'] }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64'], 'LINKFLAGS': ['/STACK:2097152'] }, } } SAMPLE_FLAGS = { 'all': { 'CPPPATH': [join(root_dir, 'include')], 'library:shared': { 'CPPDEFINES': ['USING_V8_SHARED'] }, }, 'gcc': { 'all': { 'LIBPATH': ['.'], 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 'LINKFLAGS': ['$CCFLAGS'], }, 'os:linux': { 'LIBS': ['pthread'], }, 'os:macos': { 'LIBS': ['pthread'], }, 'os:freebsd': { 'LIBPATH' : ['/usr/local/lib'], 'LIBS': ['execinfo', 'pthread'] }, 'os:solaris': { # On Solaris, to get isinf, INFINITY, fpclassify and other macros one # needs to define __C99FEATURES__. 'CPPDEFINES': ['__C99FEATURES__'], 'LIBPATH' : ['/usr/local/lib'], 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], 'LINKFLAGS': ['-mt'] }, 'os:openbsd': { 'LIBPATH' : ['/usr/local/lib'], 'LIBS': ['execinfo', 'pthread'] }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'] }, 'os:netbsd': { 'LIBPATH' : ['/usr/pkg/lib'], 'LIBS': ['execinfo', 'pthread'] }, 'arch:arm': { 'LINKFLAGS': ARM_LINK_FLAGS, 'armeabi:soft' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=soft'], } }, 'armeabi:softfp' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=softfp'], } }, 'armeabi:hard' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=1'], 'vfp3:on': { 'CPPDEFINES' : ['CAN_USE_VFP_INSTRUCTIONS'] }, 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=hard'], } } }, 'arch:ia32': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'arch:x64': { 'CCFLAGS': ['-m64'], 'LINKFLAGS': ['-m64'] }, 'arch:mips': { 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 'mips_arch_variant:mips32r2': { 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] }, 'mips_arch_variant:loongson': { 'CPPDEFINES': ['_MIPS_ARCH_LOONGSON'] }, 'simulator:none': { 'CCFLAGS': ['-EL'], 'LINKFLAGS': ['-EL'], 'mips_arch_variant:mips32r2': { 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2'] }, 'mips_arch_variant:mips32r1': { 'CCFLAGS': ['-mips32', '-Wa,-mips32'] }, 'mips_arch_variant:loongson': { 'CCFLAGS': ['-march=mips3', '-Wa,-march=mips3'] }, 'library:static': { 'LINKFLAGS': ['-static', '-static-libgcc'] }, 'mipsabi:softfloat': { 'CCFLAGS': ['-msoft-float'], 'LINKFLAGS': ['-msoft-float'] }, 'mipsabi:hardfloat': { 'CCFLAGS': ['-mhard-float'], 'LINKFLAGS': ['-mhard-float'], 'fpu:on': { 'CPPDEFINES' : ['CAN_USE_FPU_INSTRUCTIONS'] } } } }, 'simulator:arm': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'simulator:mips': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'mode:release': { 'CCFLAGS': ['-O2'] }, 'mode:debug': { 'CCFLAGS': ['-g', '-O0'], 'CPPDEFINES': ['DEBUG'] }, 'compress_startup_data:bz2': { 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'], 'os:linux': { 'LIBS': ['bz2'] } }, }, 'msvc': { 'all': { 'LIBS': ['winmm', 'ws2_32'] }, 'verbose:off': { 'CCFLAGS': ['/nologo'], 'LINKFLAGS': ['/NOLOGO'] }, 'verbose:on': { 'LINKFLAGS': ['/VERBOSE'] }, 'prof:on': { 'LINKFLAGS': ['/MAP'] }, 'mode:release': { 'CCFLAGS': ['/O2'], 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], 'msvcrt:static': { 'CCFLAGS': ['/MT'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MD'] }, 'msvcltcg:on': { 'CCFLAGS': ['/GL'], 'pgo:off': { 'LINKFLAGS': ['/LTCG'], }, }, 'pgo:instrument': { 'LINKFLAGS': ['/LTCG:PGI'] }, 'pgo:optimize': { 'LINKFLAGS': ['/LTCG:PGO'] } }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X86'] }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152'] }, 'mode:debug': { 'CCFLAGS': ['/Od'], 'LINKFLAGS': ['/DEBUG'], 'CPPDEFINES': ['DEBUG'], 'msvcrt:static': { 'CCFLAGS': ['/MTd'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MDd'] } } } } PREPARSER_FLAGS = { 'all': { 'CPPPATH': [join(root_dir, 'include'), src_dir], 'library:shared': { 'CPPDEFINES': ['USING_V8_SHARED'] }, }, 'gcc': { 'all': { 'LIBPATH': ['.'], 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 'LINKFLAGS': ['$CCFLAGS'], }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'] }, 'arch:arm': { 'LINKFLAGS': ARM_LINK_FLAGS, 'armeabi:soft' : { 'CPPDEFINES' : ['USE_EABI_HARDFLOAT=0'], 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=soft'], } }, 'armeabi:softfp' : { 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=softfp'], } }, 'armeabi:hard' : { 'simulator:none': { 'CCFLAGS': ['-mfloat-abi=hard'], } } }, 'arch:ia32': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'arch:x64': { 'CCFLAGS': ['-m64'], 'LINKFLAGS': ['-m64'] }, 'arch:mips': { 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 'mips_arch_variant:mips32r2': { 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2'] }, 'mips_arch_variant:loongson': { 'CPPDEFINES': ['_MIPS_ARCH_LOONGSON'] }, 'simulator:none': { 'CCFLAGS': ['-EL'], 'LINKFLAGS': ['-EL'], 'mips_arch_variant:mips32r2': { 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2'] }, 'mips_arch_variant:mips32r1': { 'CCFLAGS': ['-mips32', '-Wa,-mips32'] }, 'mips_arch_variant:loongson': { 'CCFLAGS': ['-march=mips3', '-Wa,-march=mips3'] }, 'library:static': { 'LINKFLAGS': ['-static', '-static-libgcc'] }, 'mipsabi:softfloat': { 'CCFLAGS': ['-msoft-float'], 'LINKFLAGS': ['-msoft-float'] }, 'mipsabi:hardfloat': { 'CCFLAGS': ['-mhard-float'], 'LINKFLAGS': ['-mhard-float'] } } }, 'simulator:arm': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'] }, 'simulator:mips': { 'CCFLAGS': ['-m32'], 'LINKFLAGS': ['-m32'], 'mipsabi:softfloat': { 'CPPDEFINES': ['__mips_soft_float=1'], }, 'mipsabi:hardfloat': { 'CPPDEFINES': ['__mips_hard_float=1'], } }, 'mode:release': { 'CCFLAGS': ['-O2'] }, 'mode:debug': { 'CCFLAGS': ['-g', '-O0'], 'CPPDEFINES': ['DEBUG'] }, 'os:freebsd': { 'LIBPATH' : ['/usr/local/lib'], }, }, 'msvc': { 'all': { 'LIBS': ['winmm', 'ws2_32'] }, 'verbose:off': { 'CCFLAGS': ['/nologo'], 'LINKFLAGS': ['/NOLOGO'] }, 'verbose:on': { 'LINKFLAGS': ['/VERBOSE'] }, 'prof:on': { 'LINKFLAGS': ['/MAP'] }, 'mode:release': { 'CCFLAGS': ['/O2'], 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], 'msvcrt:static': { 'CCFLAGS': ['/MT'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MD'] }, 'msvcltcg:on': { 'CCFLAGS': ['/GL'], 'pgo:off': { 'LINKFLAGS': ['/LTCG'], }, }, 'pgo:instrument': { 'LINKFLAGS': ['/LTCG:PGI'] }, 'pgo:optimize': { 'LINKFLAGS': ['/LTCG:PGO'] } }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X86'] }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152'] }, 'mode:debug': { 'CCFLAGS': ['/Od'], 'LINKFLAGS': ['/DEBUG'], 'CPPDEFINES': ['DEBUG'], 'msvcrt:static': { 'CCFLAGS': ['/MTd'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MDd'] } } } } D8_FLAGS = { 'all': { 'library:shared': { 'CPPDEFINES': ['V8_SHARED'], 'LIBS': ['v8'], 'LIBPATH': ['.'] }, }, 'gcc': { 'all': { 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'], 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'], 'LINKFLAGS': ['$CCFLAGS'], }, 'console:readline': { 'LIBS': ['readline'] }, 'os:linux': { 'LIBS': ['pthread'], }, 'os:macos': { 'LIBS': ['pthread'], }, 'os:freebsd': { 'LIBS': ['pthread'], }, 'os:solaris': { 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'], 'LINKFLAGS': ['-mt'] }, 'os:openbsd': { 'LIBS': ['pthread'], }, 'os:win32': { 'LIBS': ['winmm', 'ws2_32'], }, 'os:netbsd': { 'LIBS': ['pthread'], }, 'arch:arm': { 'LINKFLAGS': ARM_LINK_FLAGS }, 'compress_startup_data:bz2': { 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'], 'os:linux': { 'LIBS': ['bz2'] } } }, 'msvc': { 'all': { 'LIBS': ['winmm', 'ws2_32'] }, 'verbose:off': { 'CCFLAGS': ['/nologo'], 'LINKFLAGS': ['/NOLOGO'] }, 'verbose:on': { 'LINKFLAGS': ['/VERBOSE'] }, 'prof:on': { 'LINKFLAGS': ['/MAP'] }, 'mode:release': { 'CCFLAGS': ['/O2'], 'LINKFLAGS': ['/OPT:REF', '/OPT:ICF'], 'msvcrt:static': { 'CCFLAGS': ['/MT'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MD'] }, 'msvcltcg:on': { 'CCFLAGS': ['/GL'], 'pgo:off': { 'LINKFLAGS': ['/LTCG'], }, }, 'pgo:instrument': { 'LINKFLAGS': ['/LTCG:PGI'] }, 'pgo:optimize': { 'LINKFLAGS': ['/LTCG:PGO'] } }, 'arch:ia32': { 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X86'] }, 'arch:x64': { 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'], 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152'] }, 'mode:debug': { 'CCFLAGS': ['/Od'], 'LINKFLAGS': ['/DEBUG'], 'CPPDEFINES': ['DEBUG'], 'msvcrt:static': { 'CCFLAGS': ['/MTd'] }, 'msvcrt:shared': { 'CCFLAGS': ['/MDd'] } } } } SUFFIXES = { 'release': '', 'debug': '_g' } def Abort(message): print message sys.exit(1) def GuessOS(env): return utils.GuessOS() def GuessArch(env): return utils.GuessArchitecture() def GuessToolchain(env): tools = env['TOOLS'] if 'gcc' in tools: return 'gcc' elif 'msvc' in tools: return 'msvc' else: return None def GuessVisibility(env): os = env['os'] toolchain = env['toolchain']; if (os == 'win32' or os == 'cygwin') and toolchain == 'gcc': # MinGW / Cygwin can't do it. return 'default' elif os == 'solaris': return 'default' else: return 'hidden' def GuessStrictAliasing(env): # There seems to be a problem with gcc 4.5.x. # See http://code.google.com/p/v8/issues/detail?id=884 # It can be worked around by disabling strict aliasing. toolchain = env['toolchain']; if toolchain == 'gcc': env = Environment(tools=['gcc']) # The gcc version should be available in env['CCVERSION'], # but when scons detects msvc this value is not set. version = subprocess.Popen([env['CC'], '-dumpversion'], stdout=subprocess.PIPE).communicate()[0] if version.find('4.5') == 0: return 'off' return 'default' PLATFORM_OPTIONS = { 'arch': { 'values': ['arm', 'ia32', 'x64', 'mips'], 'guess': GuessArch, 'help': 'the architecture to build for' }, 'os': { 'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin', 'netbsd'], 'guess': GuessOS, 'help': 'the os to build for' }, 'toolchain': { 'values': ['gcc', 'msvc'], 'guess': GuessToolchain, 'help': 'the toolchain to use' } } SIMPLE_OPTIONS = { 'regexp': { 'values': ['native', 'interpreted'], 'default': 'native', 'help': 'Whether to use native or interpreted regexp implementation' }, 'snapshot': { 'values': ['on', 'off', 'nobuild'], 'default': 'off', 'help': 'build using snapshots for faster start-up' }, 'prof': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable profiling of build target' }, 'gdbjit': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable GDB JIT interface' }, 'library': { 'values': ['static', 'shared'], 'default': 'static', 'help': 'the type of library to produce' }, 'objectprint': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable object printing' }, 'profilingsupport': { 'values': ['on', 'off'], 'default': 'on', 'help': 'enable profiling of JavaScript code' }, 'debuggersupport': { 'values': ['on', 'off'], 'default': 'on', 'help': 'enable debugging of JavaScript code' }, 'inspector': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable inspector features' }, 'liveobjectlist': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable live object list features in the debugger' }, 'soname': { 'values': ['on', 'off'], 'default': 'off', 'help': 'turn on setting soname for Linux shared library' }, 'msvcrt': { 'values': ['static', 'shared'], 'default': 'static', 'help': 'the type of Microsoft Visual C++ runtime library to use' }, 'msvcltcg': { 'values': ['on', 'off'], 'default': 'on', 'help': 'use Microsoft Visual C++ link-time code generation' }, 'simulator': { 'values': ['arm', 'mips', 'none'], 'default': 'none', 'help': 'build with simulator' }, 'unalignedaccesses': { 'values': ['default', 'on', 'off'], 'default': 'default', 'help': 'set whether the ARM target supports unaligned accesses' }, 'disassembler': { 'values': ['on', 'off'], 'default': 'off', 'help': 'enable the disassembler to inspect generated code' }, 'fasttls': { 'values': ['on', 'off'], 'default': 'on', 'help': 'enable fast thread local storage support ' '(if available on the current architecture/platform)' }, 'sourcesignatures': { 'values': ['MD5', 'timestamp'], 'default': 'MD5', 'help': 'set how the build system detects file changes' }, 'console': { 'values': ['dumb', 'readline'], 'default': 'dumb', 'help': 'the console to use for the d8 shell' }, 'verbose': { 'values': ['on', 'off'], 'default': 'off', 'help': 'more output from compiler and linker' }, 'visibility': { 'values': ['default', 'hidden'], 'guess': GuessVisibility, 'help': 'shared library symbol visibility' }, 'strictaliasing': { 'values': ['default', 'off'], 'guess': GuessStrictAliasing, 'help': 'assume strict aliasing while optimizing' }, 'pgo': { 'values': ['off', 'instrument', 'optimize'], 'default': 'off', 'help': 'select profile guided optimization variant', }, 'armeabi': { 'values': ['hard', 'softfp', 'soft'], 'default': 'softfp', 'help': 'generate calling conventiont according to selected ARM EABI variant' }, 'mipsabi': { 'values': ['hardfloat', 'softfloat', 'none'], 'default': 'hardfloat', 'help': 'generate calling conventiont according to selected mips ABI' }, 'mips_arch_variant': { 'values': ['mips32r2', 'mips32r1', 'loongson'], 'default': 'mips32r2', 'help': 'mips variant' }, 'compress_startup_data': { 'values': ['off', 'bz2'], 'default': 'off', 'help': 'compress startup data (snapshot) [Linux only]' }, 'vfp3': { 'values': ['on', 'off'], 'default': 'on', 'help': 'use vfp3 instructions when building the snapshot [Arm only]' }, 'fpu': { 'values': ['on', 'off'], 'default': 'on', 'help': 'use fpu instructions when building the snapshot [MIPS only]' }, 'I_know_I_should_build_with_GYP': { 'values': ['yes', 'no'], 'default': 'no', 'help': 'grace period: temporarily override SCons deprecation' } } ALL_OPTIONS = dict(PLATFORM_OPTIONS, **SIMPLE_OPTIONS) def AddOptions(options, result): guess_env = Environment(options=result) for (name, option) in options.iteritems(): if 'guess' in option: # Option has a guess function guess = option.get('guess') default = guess(guess_env) else: # Option has a fixed default default = option.get('default') help = '%s (%s)' % (option.get('help'), ", ".join(option['values'])) result.Add(name, help, default) def GetOptions(): result = Options() result.Add('mode', 'compilation mode (debug, release)', 'release') result.Add('sample', 'build sample (shell, process, lineprocessor)', '') result.Add('cache', 'directory to use for scons build cache', '') result.Add('env', 'override environment settings (NAME0:value0,NAME1:value1,...)', '') result.Add('importenv', 'import environment settings (NAME0,NAME1,...)', '') AddOptions(PLATFORM_OPTIONS, result) AddOptions(SIMPLE_OPTIONS, result) return result def GetTools(opts): env = Environment(options=opts) os = env['os'] toolchain = env['toolchain'] if os == 'win32' and toolchain == 'gcc': return ['mingw'] elif os == 'win32' and toolchain == 'msvc': return ['msvc', 'mslink', 'mslib', 'msvs'] else: return ['default'] def GetVersionComponents(): MAJOR_VERSION_PATTERN = re.compile(r"#define\s+MAJOR_VERSION\s+(.*)") MINOR_VERSION_PATTERN = re.compile(r"#define\s+MINOR_VERSION\s+(.*)") BUILD_NUMBER_PATTERN = re.compile(r"#define\s+BUILD_NUMBER\s+(.*)") PATCH_LEVEL_PATTERN = re.compile(r"#define\s+PATCH_LEVEL\s+(.*)") patterns = [MAJOR_VERSION_PATTERN, MINOR_VERSION_PATTERN, BUILD_NUMBER_PATTERN, PATCH_LEVEL_PATTERN] source = open(join(root_dir, 'src', 'version.cc')).read() version_components = [] for pattern in patterns: match = pattern.search(source) if match: version_components.append(match.group(1).strip()) else: version_components.append('0') return version_components def GetVersion(): version_components = GetVersionComponents() if version_components[len(version_components) - 1] == '0': version_components.pop() return '.'.join(version_components) def GetSpecificSONAME(): SONAME_PATTERN = re.compile(r"#define\s+SONAME\s+\"(.*)\"") source = open(join(root_dir, 'src', 'version.cc')).read() match = SONAME_PATTERN.search(source) if match: return match.group(1).strip() else: return '' def SplitList(str): return [ s for s in str.split(",") if len(s) > 0 ] def IsLegal(env, option, values): str = env[option] for s in SplitList(str): if not s in values: Abort("Illegal value for option %s '%s'." % (option, s)) return False return True def WarnAboutDeprecation(): print """ ##################################################################### # # # LAST WARNING: Building V8 with SCons is deprecated. # # # # This only works because you have overridden the kill switch. # # # # MIGRATE TO THE GYP-BASED BUILD NOW! # # # # Instructions: http://code.google.com/p/v8/wiki/BuildingWithGYP. # # # ##################################################################### """ def VerifyOptions(env): if env['I_know_I_should_build_with_GYP'] != 'yes': Abort("Building V8 with SCons is no longer supported. Please use GYP " "instead; you can find instructions are at " "http://code.google.com/p/v8/wiki/BuildingWithGYP.\n\n" "Quitting.\n\n" "For a limited grace period, you can specify " "\"I_know_I_should_build_with_GYP=yes\" to override.") else: WarnAboutDeprecation() import atexit atexit.register(WarnAboutDeprecation) if not IsLegal(env, 'mode', ['debug', 'release']): return False if not IsLegal(env, 'sample', ["shell", "process", "lineprocessor"]): return False if not IsLegal(env, 'regexp', ["native", "interpreted"]): return False if env['os'] == 'win32' and env['library'] == 'shared' and env['prof'] == 'on': Abort("Profiling on windows only supported for static library.") if env['gdbjit'] == 'on' and ((env['os'] != 'linux' and env['os'] != 'macos') or (env['arch'] != 'ia32' and env['arch'] != 'x64' and env['arch'] != 'arm')): Abort("GDBJIT interface is supported only for Intel-compatible (ia32 or x64) Linux/OSX target.") if env['os'] == 'win32' and env['soname'] == 'on': Abort("Shared Object soname not applicable for Windows.") if env['soname'] == 'on' and env['library'] == 'static': Abort("Shared Object soname not applicable for static library.") if env['os'] != 'win32' and env['pgo'] != 'off': Abort("Profile guided optimization only supported on Windows.") if env['cache'] and not os.path.isdir(env['cache']): Abort("The specified cache directory does not exist.") if not (env['arch'] == 'arm' or env['simulator'] == 'arm') and ('unalignedaccesses' in ARGUMENTS): print env['arch'] print env['simulator'] Abort("Option unalignedaccesses only supported for the ARM architecture.") if env['os'] != 'linux' and env['compress_startup_data'] != 'off': Abort("Startup data compression is only available on Linux") for (name, option) in ALL_OPTIONS.iteritems(): if (not name in env): message = ("A value for option %s must be specified (%s)." % (name, ", ".join(option['values']))) Abort(message) if not env[name] in option['values']: message = ("Unknown %s value '%s'. Possible values are (%s)." % (name, env[name], ", ".join(option['values']))) Abort(message) class BuildContext(object): def __init__(self, options, env_overrides, samples): self.library_targets = [] self.mksnapshot_targets = [] self.cctest_targets = [] self.sample_targets = [] self.d8_targets = [] self.options = options self.env_overrides = env_overrides self.samples = samples self.preparser_targets = [] self.use_snapshot = (options['snapshot'] != 'off') self.build_snapshot = (options['snapshot'] == 'on') self.flags = None def AddRelevantFlags(self, initial, flags): result = initial.copy() toolchain = self.options['toolchain'] if toolchain in flags: self.AppendFlags(result, flags[toolchain].get('all')) for option in sorted(self.options.keys()): value = self.options[option] self.AppendFlags(result, flags[toolchain].get(option + ':' + value)) self.AppendFlags(result, flags.get('all')) return result def AddRelevantSubFlags(self, options, flags): self.AppendFlags(options, flags.get('all')) for option in sorted(self.options.keys()): value = self.options[option] self.AppendFlags(options, flags.get(option + ':' + value)) def GetRelevantSources(self, source): result = [] result += source.get('all', []) for (name, value) in self.options.iteritems(): source_value = source.get(name + ':' + value, []) if type(source_value) == dict: result += self.GetRelevantSources(source_value) else: result += source_value return sorted(result) def AppendFlags(self, options, added): if not added: return for (key, value) in added.iteritems(): if key.find(':') != -1: self.AddRelevantSubFlags(options, { key: value }) else: if not key in options: options[key] = value else: prefix = options[key] if isinstance(prefix, StringTypes): prefix = prefix.split() options[key] = prefix + value def ConfigureObject(self, env, input, **kw): if (kw.has_key('CPPPATH') and env.has_key('CPPPATH')): kw['CPPPATH'] += env['CPPPATH'] if self.options['library'] == 'static': return env.StaticObject(input, **kw) else: return env.SharedObject(input, **kw) def ApplyEnvOverrides(self, env): if not self.env_overrides: return if type(env['ENV']) == DictType: env['ENV'].update(**self.env_overrides) else: env['ENV'] = self.env_overrides def PostprocessOptions(options, os): # Adjust architecture if the simulator option has been set if (options['simulator'] != 'none') and (options['arch'] != options['simulator']): if 'arch' in ARGUMENTS: # Print a warning if arch has explicitly been set print "Warning: forcing architecture to match simulator (%s)" % options['simulator'] options['arch'] = options['simulator'] if (options['prof'] != 'off') and (options['profilingsupport'] == 'off'): # Print a warning if profiling is enabled without profiling support print "Warning: forcing profilingsupport on when prof is on" options['profilingsupport'] = 'on' if os == 'win32' and options['pgo'] != 'off' and options['msvcltcg'] == 'off': if 'msvcltcg' in ARGUMENTS: print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo'] options['msvcltcg'] = 'on' if (options['mipsabi'] != 'none') and (options['arch'] != 'mips') and (options['simulator'] != 'mips'): options['mipsabi'] = 'none' if options['liveobjectlist'] == 'on': if (options['debuggersupport'] != 'on') or (options['mode'] == 'release'): # Print a warning that liveobjectlist will implicitly enable the debugger print "Warning: forcing debuggersupport on for liveobjectlist" options['debuggersupport'] = 'on' options['inspector'] = 'on' options['objectprint'] = 'on' def ParseEnvOverrides(arg, imports): # The environment overrides are in the format NAME0:value0,NAME1:value1,... # The environment imports are in the format NAME0,NAME1,... overrides = {} for var in imports.split(','): if var in os.environ: overrides[var] = os.environ[var] for override in arg.split(','): pos = override.find(':') if pos == -1: continue overrides[override[:pos].strip()] = override[pos+1:].strip() return overrides def BuildSpecific(env, mode, env_overrides, tools): options = {'mode': mode} for option in ALL_OPTIONS: options[option] = env[option] PostprocessOptions(options, env['os']) context = BuildContext(options, env_overrides, samples=SplitList(env['sample'])) # Remove variables which can't be imported from the user's external # environment into a construction environment. user_environ = os.environ.copy() try: del user_environ['ENV'] except KeyError: pass library_flags = context.AddRelevantFlags(user_environ, LIBRARY_FLAGS) v8_flags = context.AddRelevantFlags(library_flags, V8_EXTRA_FLAGS) mksnapshot_flags = context.AddRelevantFlags(library_flags, MKSNAPSHOT_EXTRA_FLAGS) dtoa_flags = context.AddRelevantFlags(library_flags, DTOA_EXTRA_FLAGS) cctest_flags = context.AddRelevantFlags(v8_flags, CCTEST_EXTRA_FLAGS) sample_flags = context.AddRelevantFlags(user_environ, SAMPLE_FLAGS) preparser_flags = context.AddRelevantFlags(user_environ, PREPARSER_FLAGS) d8_flags = context.AddRelevantFlags(library_flags, D8_FLAGS) context.flags = { 'v8': v8_flags, 'mksnapshot': mksnapshot_flags, 'dtoa': dtoa_flags, 'cctest': cctest_flags, 'sample': sample_flags, 'd8': d8_flags, 'preparser': preparser_flags } # Generate library base name. target_id = mode suffix = SUFFIXES[target_id] library_name = 'v8' + suffix preparser_library_name = 'v8preparser' + suffix version = GetVersion() if context.options['soname'] == 'on': # When building shared object with SONAME version the library name. library_name += '-' + version # Generate library SONAME if required by the build. if context.options['soname'] == 'on': soname = GetSpecificSONAME() if soname == '': soname = 'lib' + library_name + '.so' env['SONAME'] = soname # Build the object files by invoking SCons recursively. d8_env = Environment(tools=tools) d8_env.Replace(**context.flags['d8']) (object_files, shell_files, mksnapshot, preparser_files) = env.SConscript( join('src', 'SConscript'), build_dir=join('obj', target_id), exports='context tools d8_env', duplicate=False ) context.mksnapshot_targets.append(mksnapshot) # Link the object files into a library. env.Replace(**context.flags['v8']) context.ApplyEnvOverrides(env) if context.options['library'] == 'static': library = env.StaticLibrary(library_name, object_files) preparser_library = env.StaticLibrary(preparser_library_name, preparser_files) else: # There seems to be a glitch in the way scons decides where to put # PDB files when compiling using MSVC so we specify it manually. # This should not affect any other platforms. pdb_name = library_name + '.dll.pdb' library = env.SharedLibrary(library_name, object_files, PDB=pdb_name) preparser_pdb_name = preparser_library_name + '.dll.pdb'; preparser_soname = 'lib' + preparser_library_name + '.so'; preparser_library = env.SharedLibrary(preparser_library_name, preparser_files, PDB=preparser_pdb_name, SONAME=preparser_soname) context.library_targets.append(library) context.library_targets.append(preparser_library) context.ApplyEnvOverrides(d8_env) if context.options['library'] == 'static': shell = d8_env.Program('d8' + suffix, object_files + shell_files) else: shell = d8_env.Program('d8' + suffix, shell_files) d8_env.Depends(shell, library) context.d8_targets.append(shell) for sample in context.samples: sample_env = Environment(tools=tools) sample_env.Replace(**context.flags['sample']) sample_env.Prepend(LIBS=[library_name]) context.ApplyEnvOverrides(sample_env) sample_object = sample_env.SConscript( join('samples', 'SConscript'), build_dir=join('obj', 'sample', sample, target_id), exports='sample context tools', duplicate=False ) sample_name = sample + suffix sample_program = sample_env.Program(sample_name, sample_object) sample_env.Depends(sample_program, library) context.sample_targets.append(sample_program) cctest_env = env.Copy() cctest_env.Prepend(LIBS=[library_name]) cctest_program = cctest_env.SConscript( join('test', 'cctest', 'SConscript'), build_dir=join('obj', 'test', target_id), exports='context object_files tools', duplicate=False ) context.cctest_targets.append(cctest_program) preparser_env = env.Copy() preparser_env.Replace(**context.flags['preparser']) preparser_env.Prepend(LIBS=[preparser_library_name]) context.ApplyEnvOverrides(preparser_env) preparser_object = preparser_env.SConscript( join('preparser', 'SConscript'), build_dir=join('obj', 'preparser', target_id), exports='context tools', duplicate=False ) preparser_name = join('obj', 'preparser', target_id, 'preparser') preparser_program = preparser_env.Program(preparser_name, preparser_object); preparser_env.Depends(preparser_program, preparser_library) context.preparser_targets.append(preparser_program) return context def Build(): opts = GetOptions() tools = GetTools(opts) env = Environment(options=opts, tools=tools) Help(opts.GenerateHelpText(env)) VerifyOptions(env) env_overrides = ParseEnvOverrides(env['env'], env['importenv']) SourceSignatures(env['sourcesignatures']) libraries = [] mksnapshots = [] cctests = [] samples = [] preparsers = [] d8s = [] modes = SplitList(env['mode']) for mode in modes: context = BuildSpecific(env.Copy(), mode, env_overrides, tools) libraries += context.library_targets mksnapshots += context.mksnapshot_targets cctests += context.cctest_targets samples += context.sample_targets preparsers += context.preparser_targets d8s += context.d8_targets env.Alias('library', libraries) env.Alias('mksnapshot', mksnapshots) env.Alias('cctests', cctests) env.Alias('sample', samples) env.Alias('d8', d8s) env.Alias('preparser', preparsers) if env['sample']: env.Default('sample') else: env.Default('library') if env['cache']: CacheDir(env['cache']) # We disable deprecation warnings because we need to be able to use # env.Copy without getting warnings for compatibility with older # version of scons. Also, there's a bug in some revisions that # doesn't allow this flag to be set, so we swallow any exceptions. # Lovely. try: SetOption('warn', 'no-deprecated') except: pass Build() v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/000077500000000000000000000000001211511573600213255ustar00rootroot00000000000000v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/README.txt000066400000000000000000000065231211511573600230310ustar00rootroot00000000000000V8 Benchmark Suite ================== This is the V8 benchmark suite: A collection of pure JavaScript benchmarks that we have used to tune V8. The licenses for the individual benchmarks are included in the JavaScript files. In addition to the benchmarks, the suite consists of the benchmark framework (base.js), which must be loaded before any of the individual benchmark files, and two benchmark runners: An HTML version (run.html) and a standalone JavaScript version (run.js). Changes From Version 1 To Version 2 =================================== For version 2 the crypto benchmark was fixed. Previously, the decryption stage was given plaintext as input, which resulted in an error. Now, the decryption stage is given the output of the encryption stage as input. The result is checked against the original plaintext. For this to give the correct results the crypto objects are reset for each iteration of the benchmark. In addition, the size of the plain text has been increased a little and the use of Math.random() and new Date() to build an RNG pool has been removed. Other benchmarks were fixed to do elementary verification of the results of their calculations. This is to avoid accidentally obtaining scores that are the result of an incorrect JavaScript engine optimization. Changes From Version 2 To Version 3 =================================== Version 3 adds a new benchmark, RegExp. The RegExp benchmark is generated by loading 50 of the most popular pages on the web and logging all regexp operations performed. Each operation is given a weight that is calculated from an estimate of the popularity of the pages where it occurs and the number of times it is executed while loading each page. Finally the literal letters in the data are encoded using ROT13 in a way that does not affect how the regexps match their input. Changes from Version 3 to Version 4 =================================== The Splay benchmark is a newcomer in version 4. It manipulates a splay tree by adding and removing data nodes, thus exercising the memory management subsystem of the JavaScript engine. Furthermore, all the unused parts of the Prototype library were removed from the RayTrace benchmark. This does not affect the running of the benchmark. Changes from Version 4 to Version 5 =================================== Removed duplicate line in random seed code, and changed the name of the Object.prototype.inherits function in the DeltaBlue benchmark to inheritsFrom to avoid name clashes when running in Chromium with extensions enabled. Changes from Version 5 to Version 6 =================================== Removed dead code from the RayTrace benchmark and fixed a couple of typos in the DeltaBlue implementation. Changed the Splay benchmark to avoid converting the same numeric key to a string over and over again and to avoid inserting and removing the same element repeatedly thus increasing pressure on the memory subsystem. Changed the RegExp benchmark to exercise the regular expression engine on different input strings. Furthermore, the benchmark runner was changed to run the benchmarks for at least a few times to stabilize the reported numbers on slower machines. Changes from Version 6 to Version 7 =================================== Added the Navier-Stokes benchmark, a 2D differential equation solver that stresses arithmetic computations on double arrays. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/base.js000066400000000000000000000222071211511573600226000ustar00rootroot00000000000000// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Simple framework for running the benchmark suites and // computing a score based on the timing measurements. // A benchmark has a name (string) and a function that will be run to // do the performance measurement. The optional setup and tearDown // arguments are functions that will be invoked before and after // running the benchmark, but the running time of these functions will // not be accounted for in the benchmark score. function Benchmark(name, run, setup, tearDown) { this.name = name; this.run = run; this.Setup = setup ? setup : function() { }; this.TearDown = tearDown ? tearDown : function() { }; } // Benchmark results hold the benchmark and the measured time used to // run the benchmark. The benchmark score is computed later once a // full benchmark suite has run to completion. function BenchmarkResult(benchmark, time) { this.benchmark = benchmark; this.time = time; } // Automatically convert results to numbers. Used by the geometric // mean computation. BenchmarkResult.prototype.valueOf = function() { return this.time; } // Suites of benchmarks consist of a name and the set of benchmarks in // addition to the reference timing that the final score will be based // on. This way, all scores are relative to a reference run and higher // scores implies better performance. function BenchmarkSuite(name, reference, benchmarks) { this.name = name; this.reference = reference; this.benchmarks = benchmarks; BenchmarkSuite.suites.push(this); } // Keep track of all declared benchmark suites. BenchmarkSuite.suites = []; // Scores are not comparable across versions. Bump the version if // you're making changes that will affect that scores, e.g. if you add // a new benchmark or change an existing one. BenchmarkSuite.version = '7'; // To make the benchmark results predictable, we replace Math.random // with a 100% deterministic alternative. Math.random = (function() { var seed = 49734321; return function() { // Robert Jenkins' 32 bit integer hash function. seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff; seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff; return (seed & 0xfffffff) / 0x10000000; }; })(); // Runs all registered benchmark suites and optionally yields between // each individual benchmark to avoid running for too long in the // context of browsers. Once done, the final score is reported to the // runner. BenchmarkSuite.RunSuites = function(runner) { var continuation = null; var suites = BenchmarkSuite.suites; var length = suites.length; BenchmarkSuite.scores = []; var index = 0; function RunStep() { while (continuation || index < length) { if (continuation) { continuation = continuation(); } else { var suite = suites[index++]; if (runner.NotifyStart) runner.NotifyStart(suite.name); continuation = suite.RunStep(runner); } if (continuation && typeof window != 'undefined' && window.setTimeout) { window.setTimeout(RunStep, 25); return; } } if (runner.NotifyScore) { var score = BenchmarkSuite.GeometricMean(BenchmarkSuite.scores); var formatted = BenchmarkSuite.FormatScore(100 * score); runner.NotifyScore(formatted); } } RunStep(); } // Counts the total number of registered benchmarks. Useful for // showing progress as a percentage. BenchmarkSuite.CountBenchmarks = function() { var result = 0; var suites = BenchmarkSuite.suites; for (var i = 0; i < suites.length; i++) { result += suites[i].benchmarks.length; } return result; } // Computes the geometric mean of a set of numbers. BenchmarkSuite.GeometricMean = function(numbers) { var log = 0; for (var i = 0; i < numbers.length; i++) { log += Math.log(numbers[i]); } return Math.pow(Math.E, log / numbers.length); } // Converts a score value to a string with at least three significant // digits. BenchmarkSuite.FormatScore = function(value) { if (value > 100) { return value.toFixed(0); } else { return value.toPrecision(3); } } // Notifies the runner that we're done running a single benchmark in // the benchmark suite. This can be useful to report progress. BenchmarkSuite.prototype.NotifyStep = function(result) { this.results.push(result); if (this.runner.NotifyStep) this.runner.NotifyStep(result.benchmark.name); } // Notifies the runner that we're done with running a suite and that // we have a result which can be reported to the user if needed. BenchmarkSuite.prototype.NotifyResult = function() { var mean = BenchmarkSuite.GeometricMean(this.results); var score = this.reference / mean; BenchmarkSuite.scores.push(score); if (this.runner.NotifyResult) { var formatted = BenchmarkSuite.FormatScore(100 * score); this.runner.NotifyResult(this.name, formatted); } } // Notifies the runner that running a benchmark resulted in an error. BenchmarkSuite.prototype.NotifyError = function(error) { if (this.runner.NotifyError) { this.runner.NotifyError(this.name, error); } if (this.runner.NotifyStep) { this.runner.NotifyStep(this.name); } } // Runs a single benchmark for at least a second and computes the // average time it takes to run a single iteration. BenchmarkSuite.prototype.RunSingleBenchmark = function(benchmark, data) { function Measure(data) { var elapsed = 0; var start = new Date(); for (var n = 0; elapsed < 1000; n++) { benchmark.run(); elapsed = new Date() - start; } if (data != null) { data.runs += n; data.elapsed += elapsed; } } if (data == null) { // Measure the benchmark once for warm up and throw the result // away. Return a fresh data object. Measure(null); return { runs: 0, elapsed: 0 }; } else { Measure(data); // If we've run too few iterations, we continue for another second. if (data.runs < 32) return data; var usec = (data.elapsed * 1000) / data.runs; this.NotifyStep(new BenchmarkResult(benchmark, usec)); return null; } } // This function starts running a suite, but stops between each // individual benchmark in the suite and returns a continuation // function which can be invoked to run the next benchmark. Once the // last benchmark has been executed, null is returned. BenchmarkSuite.prototype.RunStep = function(runner) { this.results = []; this.runner = runner; var length = this.benchmarks.length; var index = 0; var suite = this; var data; // Run the setup, the actual benchmark, and the tear down in three // separate steps to allow the framework to yield between any of the // steps. function RunNextSetup() { if (index < length) { try { suite.benchmarks[index].Setup(); } catch (e) { suite.NotifyError(e); return null; } return RunNextBenchmark; } suite.NotifyResult(); return null; } function RunNextBenchmark() { try { data = suite.RunSingleBenchmark(suite.benchmarks[index], data); } catch (e) { suite.NotifyError(e); return null; } // If data is null, we're done with this benchmark. return (data == null) ? RunNextTearDown : RunNextBenchmark(); } function RunNextTearDown() { try { suite.benchmarks[index++].TearDown(); } catch (e) { suite.NotifyError(e); return null; } return RunNextSetup; } // Start out running the setup. return RunNextSetup(); } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/crypto.js000066400000000000000000001356151211511573600232160ustar00rootroot00000000000000/* * Copyright (c) 2003-2005 Tom Wu * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * In addition, the following condition applies: * * All redistributions must retain an intact copy of this copyright notice * and disclaimer. */ // The code has been adapted for use as a benchmark by Google. var Crypto = new BenchmarkSuite('Crypto', 266181, [ new Benchmark("Encrypt", encrypt), new Benchmark("Decrypt", decrypt) ]); // Basic JavaScript BN library - subset useful for RSA encryption. // Bits per digit var dbits; var BI_DB; var BI_DM; var BI_DV; var BI_FP; var BI_FV; var BI_F1; var BI_F2; // JavaScript engine analysis var canary = 0xdeadbeefcafe; var j_lm = ((canary&0xffffff)==0xefcafe); // (public) Constructor function BigInteger(a,b,c) { this.array = new Array(); if(a != null) if("number" == typeof a) this.fromNumber(a,b,c); else if(b == null && "string" != typeof a) this.fromString(a,256); else this.fromString(a,b); } // return new, unset BigInteger function nbi() { return new BigInteger(null); } // am: Compute w_j += (x*this_i), propagate carries, // c is initial carry, returns final carry. // c < 3*dvalue, x < 2*dvalue, this_i < dvalue // We need to select the fastest one that works in this environment. // am1: use a single mult and divide to get the high bits, // max digit bits should be 26 because // max internal value = 2*dvalue^2-2*dvalue (< 2^53) function am1(i,x,w,j,c,n) { var this_array = this.array; var w_array = w.array; while(--n >= 0) { var v = x*this_array[i++]+w_array[j]+c; c = Math.floor(v/0x4000000); w_array[j++] = v&0x3ffffff; } return c; } // am2 avoids a big mult-and-extract completely. // Max digit bits should be <= 30 because we do bitwise ops // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) function am2(i,x,w,j,c,n) { var this_array = this.array; var w_array = w.array; var xl = x&0x7fff, xh = x>>15; while(--n >= 0) { var l = this_array[i]&0x7fff; var h = this_array[i++]>>15; var m = xh*l+h*xl; l = xl*l+((m&0x7fff)<<15)+w_array[j]+(c&0x3fffffff); c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); w_array[j++] = l&0x3fffffff; } return c; } // Alternately, set max digit bits to 28 since some // browsers slow down when dealing with 32-bit numbers. function am3(i,x,w,j,c,n) { var this_array = this.array; var w_array = w.array; var xl = x&0x3fff, xh = x>>14; while(--n >= 0) { var l = this_array[i]&0x3fff; var h = this_array[i++]>>14; var m = xh*l+h*xl; l = xl*l+((m&0x3fff)<<14)+w_array[j]+c; c = (l>>28)+(m>>14)+xh*h; w_array[j++] = l&0xfffffff; } return c; } // This is tailored to VMs with 2-bit tagging. It makes sure // that all the computations stay within the 29 bits available. function am4(i,x,w,j,c,n) { var this_array = this.array; var w_array = w.array; var xl = x&0x1fff, xh = x>>13; while(--n >= 0) { var l = this_array[i]&0x1fff; var h = this_array[i++]>>13; var m = xh*l+h*xl; l = xl*l+((m&0x1fff)<<13)+w_array[j]+c; c = (l>>26)+(m>>13)+xh*h; w_array[j++] = l&0x3ffffff; } return c; } // am3/28 is best for SM, Rhino, but am4/26 is best for v8. // Kestrel (Opera 9.5) gets its best result with am4/26. // IE7 does 9% better with am3/28 than with am4/26. // Firefox (SM) gets 10% faster with am3/28 than with am4/26. setupEngine = function(fn, bits) { BigInteger.prototype.am = fn; dbits = bits; BI_DB = dbits; BI_DM = ((1<= 0; --i) r_array[i] = this_array[i]; r.t = this.t; r.s = this.s; } // (protected) set from integer value x, -DV <= x < DV function bnpFromInt(x) { var this_array = this.array; this.t = 1; this.s = (x<0)?-1:0; if(x > 0) this_array[0] = x; else if(x < -1) this_array[0] = x+DV; else this.t = 0; } // return bigint initialized to value function nbv(i) { var r = nbi(); r.fromInt(i); return r; } // (protected) set from string and radix function bnpFromString(s,b) { var this_array = this.array; var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var i = s.length, mi = false, sh = 0; while(--i >= 0) { var x = (k==8)?s[i]&0xff:intAt(s,i); if(x < 0) { if(s.charAt(i) == "-") mi = true; continue; } mi = false; if(sh == 0) this_array[this.t++] = x; else if(sh+k > BI_DB) { this_array[this.t-1] |= (x&((1<<(BI_DB-sh))-1))<>(BI_DB-sh)); } else this_array[this.t-1] |= x<= BI_DB) sh -= BI_DB; } if(k == 8 && (s[0]&0x80) != 0) { this.s = -1; if(sh > 0) this_array[this.t-1] |= ((1<<(BI_DB-sh))-1)< 0 && this_array[this.t-1] == c) --this.t; } // (public) return string representation in given radix function bnToString(b) { var this_array = this.array; if(this.s < 0) return "-"+this.negate().toString(b); var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else return this.toRadix(b); var km = (1< 0) { if(p < BI_DB && (d = this_array[i]>>p) > 0) { m = true; r = int2char(d); } while(i >= 0) { if(p < k) { d = (this_array[i]&((1<>(p+=BI_DB-k); } else { d = (this_array[i]>>(p-=k))&km; if(p <= 0) { p += BI_DB; --i; } } if(d > 0) m = true; if(m) r += int2char(d); } } return m?r:"0"; } // (public) -this function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } // (public) |this| function bnAbs() { return (this.s<0)?this.negate():this; } // (public) return + if this > a, - if this < a, 0 if equal function bnCompareTo(a) { var this_array = this.array; var a_array = a.array; var r = this.s-a.s; if(r != 0) return r; var i = this.t; r = i-a.t; if(r != 0) return r; while(--i >= 0) if((r=this_array[i]-a_array[i]) != 0) return r; return 0; } // returns bit length of the integer x function nbits(x) { var r = 1, t; if((t=x>>>16) != 0) { x = t; r += 16; } if((t=x>>8) != 0) { x = t; r += 8; } if((t=x>>4) != 0) { x = t; r += 4; } if((t=x>>2) != 0) { x = t; r += 2; } if((t=x>>1) != 0) { x = t; r += 1; } return r; } // (public) return the number of bits in "this" function bnBitLength() { var this_array = this.array; if(this.t <= 0) return 0; return BI_DB*(this.t-1)+nbits(this_array[this.t-1]^(this.s&BI_DM)); } // (protected) r = this << n*DB function bnpDLShiftTo(n,r) { var this_array = this.array; var r_array = r.array; var i; for(i = this.t-1; i >= 0; --i) r_array[i+n] = this_array[i]; for(i = n-1; i >= 0; --i) r_array[i] = 0; r.t = this.t+n; r.s = this.s; } // (protected) r = this >> n*DB function bnpDRShiftTo(n,r) { var this_array = this.array; var r_array = r.array; for(var i = n; i < this.t; ++i) r_array[i-n] = this_array[i]; r.t = Math.max(this.t-n,0); r.s = this.s; } // (protected) r = this << n function bnpLShiftTo(n,r) { var this_array = this.array; var r_array = r.array; var bs = n%BI_DB; var cbs = BI_DB-bs; var bm = (1<= 0; --i) { r_array[i+ds+1] = (this_array[i]>>cbs)|c; c = (this_array[i]&bm)<= 0; --i) r_array[i] = 0; r_array[ds] = c; r.t = this.t+ds+1; r.s = this.s; r.clamp(); } // (protected) r = this >> n function bnpRShiftTo(n,r) { var this_array = this.array; var r_array = r.array; r.s = this.s; var ds = Math.floor(n/BI_DB); if(ds >= this.t) { r.t = 0; return; } var bs = n%BI_DB; var cbs = BI_DB-bs; var bm = (1<>bs; for(var i = ds+1; i < this.t; ++i) { r_array[i-ds-1] |= (this_array[i]&bm)<>bs; } if(bs > 0) r_array[this.t-ds-1] |= (this.s&bm)<>= BI_DB; } if(a.t < this.t) { c -= a.s; while(i < this.t) { c += this_array[i]; r_array[i++] = c&BI_DM; c >>= BI_DB; } c += this.s; } else { c += this.s; while(i < a.t) { c -= a_array[i]; r_array[i++] = c&BI_DM; c >>= BI_DB; } c -= a.s; } r.s = (c<0)?-1:0; if(c < -1) r_array[i++] = BI_DV+c; else if(c > 0) r_array[i++] = c; r.t = i; r.clamp(); } // (protected) r = this * a, r != this,a (HAC 14.12) // "this" should be the larger one if appropriate. function bnpMultiplyTo(a,r) { var this_array = this.array; var r_array = r.array; var x = this.abs(), y = a.abs(); var y_array = y.array; var i = x.t; r.t = i+y.t; while(--i >= 0) r_array[i] = 0; for(i = 0; i < y.t; ++i) r_array[i+x.t] = x.am(0,y_array[i],r,i,0,x.t); r.s = 0; r.clamp(); if(this.s != a.s) BigInteger.ZERO.subTo(r,r); } // (protected) r = this^2, r != this (HAC 14.16) function bnpSquareTo(r) { var x = this.abs(); var x_array = x.array; var r_array = r.array; var i = r.t = 2*x.t; while(--i >= 0) r_array[i] = 0; for(i = 0; i < x.t-1; ++i) { var c = x.am(i,x_array[i],r,2*i,0,1); if((r_array[i+x.t]+=x.am(i+1,2*x_array[i],r,2*i+1,c,x.t-i-1)) >= BI_DV) { r_array[i+x.t] -= BI_DV; r_array[i+x.t+1] = 1; } } if(r.t > 0) r_array[r.t-1] += x.am(i,x_array[i],r,2*i,0,1); r.s = 0; r.clamp(); } // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) // r != q, this != m. q or r may be null. function bnpDivRemTo(m,q,r) { var pm = m.abs(); if(pm.t <= 0) return; var pt = this.abs(); if(pt.t < pm.t) { if(q != null) q.fromInt(0); if(r != null) this.copyTo(r); return; } if(r == null) r = nbi(); var y = nbi(), ts = this.s, ms = m.s; var pm_array = pm.array; var nsh = BI_DB-nbits(pm_array[pm.t-1]); // normalize modulus if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); } var ys = y.t; var y_array = y.array; var y0 = y_array[ys-1]; if(y0 == 0) return; var yt = y0*(1<1)?y_array[ys-2]>>BI_F2:0); var d1 = BI_FV/yt, d2 = (1<= 0) { r_array[r.t++] = 1; r.subTo(t,r); } BigInteger.ONE.dlShiftTo(ys,t); t.subTo(y,y); // "negative" y so we can replace sub with am later while(y.t < ys) y_array[y.t++] = 0; while(--j >= 0) { // Estimate quotient digit var qd = (r_array[--i]==y0)?BI_DM:Math.floor(r_array[i]*d1+(r_array[i-1]+e)*d2); if((r_array[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out y.dlShiftTo(j,t); r.subTo(t,r); while(r_array[i] < --qd) r.subTo(t,r); } } if(q != null) { r.drShiftTo(ys,q); if(ts != ms) BigInteger.ZERO.subTo(q,q); } r.t = ys; r.clamp(); if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder if(ts < 0) BigInteger.ZERO.subTo(r,r); } // (public) this mod a function bnMod(a) { var r = nbi(); this.abs().divRemTo(a,null,r); if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); return r; } // Modular reduction using "classic" algorithm function Classic(m) { this.m = m; } function cConvert(x) { if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); else return x; } function cRevert(x) { return x; } function cReduce(x) { x.divRemTo(this.m,null,x); } function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } Classic.prototype.convert = cConvert; Classic.prototype.revert = cRevert; Classic.prototype.reduce = cReduce; Classic.prototype.mulTo = cMulTo; Classic.prototype.sqrTo = cSqrTo; // (protected) return "-1/this % 2^DB"; useful for Mont. reduction // justification: // xy == 1 (mod m) // xy = 1+km // xy(2-xy) = (1+km)(1-km) // x[y(2-xy)] = 1-k^2m^2 // x[y(2-xy)] == 1 (mod m^2) // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. // JS multiply "overflows" differently from C/C++, so care is needed here. function bnpInvDigit() { var this_array = this.array; if(this.t < 1) return 0; var x = this_array[0]; if((x&1) == 0) return 0; var y = x&3; // y == 1/x mod 2^2 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 // last step - calculate inverse mod DV directly; // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints y = (y*(2-x*y%BI_DV))%BI_DV; // y == 1/x mod 2^dbits // we really want the negative inverse, and -DV < y < DV return (y>0)?BI_DV-y:-y; } // Montgomery reduction function Montgomery(m) { this.m = m; this.mp = m.invDigit(); this.mpl = this.mp&0x7fff; this.mph = this.mp>>15; this.um = (1<<(BI_DB-15))-1; this.mt2 = 2*m.t; } // xR mod m function montConvert(x) { var r = nbi(); x.abs().dlShiftTo(this.m.t,r); r.divRemTo(this.m,null,r); if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); return r; } // x/R mod m function montRevert(x) { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } // x = x/R mod m (HAC 14.32) function montReduce(x) { var x_array = x.array; while(x.t <= this.mt2) // pad x so am has enough room later x_array[x.t++] = 0; for(var i = 0; i < this.m.t; ++i) { // faster way of calculating u0 = x[i]*mp mod DV var j = x_array[i]&0x7fff; var u0 = (j*this.mpl+(((j*this.mph+(x_array[i]>>15)*this.mpl)&this.um)<<15))&BI_DM; // use am to combine the multiply-shift-add into one call j = i+this.m.t; x_array[j] += this.m.am(0,u0,x,i,0,this.m.t); // propagate carry while(x_array[j] >= BI_DV) { x_array[j] -= BI_DV; x_array[++j]++; } } x.clamp(); x.drShiftTo(this.m.t,x); if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = "x^2/R mod m"; x != r function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = "xy/R mod m"; x,y != r function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Montgomery.prototype.convert = montConvert; Montgomery.prototype.revert = montRevert; Montgomery.prototype.reduce = montReduce; Montgomery.prototype.mulTo = montMulTo; Montgomery.prototype.sqrTo = montSqrTo; // (protected) true iff this is even function bnpIsEven() { var this_array = this.array; return ((this.t>0)?(this_array[0]&1):this.s) == 0; } // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) function bnpExp(e,z) { if(e > 0xffffffff || e < 1) return BigInteger.ONE; var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; g.copyTo(r); while(--i >= 0) { z.sqrTo(r,r2); if((e&(1< 0) z.mulTo(r2,g,r); else { var t = r; r = r2; r2 = t; } } return z.revert(r); } // (public) this^e % m, 0 <= e < 2^32 function bnModPowInt(e,m) { var z; if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); return this.exp(e,z); } // protected BigInteger.prototype.copyTo = bnpCopyTo; BigInteger.prototype.fromInt = bnpFromInt; BigInteger.prototype.fromString = bnpFromString; BigInteger.prototype.clamp = bnpClamp; BigInteger.prototype.dlShiftTo = bnpDLShiftTo; BigInteger.prototype.drShiftTo = bnpDRShiftTo; BigInteger.prototype.lShiftTo = bnpLShiftTo; BigInteger.prototype.rShiftTo = bnpRShiftTo; BigInteger.prototype.subTo = bnpSubTo; BigInteger.prototype.multiplyTo = bnpMultiplyTo; BigInteger.prototype.squareTo = bnpSquareTo; BigInteger.prototype.divRemTo = bnpDivRemTo; BigInteger.prototype.invDigit = bnpInvDigit; BigInteger.prototype.isEven = bnpIsEven; BigInteger.prototype.exp = bnpExp; // public BigInteger.prototype.toString = bnToString; BigInteger.prototype.negate = bnNegate; BigInteger.prototype.abs = bnAbs; BigInteger.prototype.compareTo = bnCompareTo; BigInteger.prototype.bitLength = bnBitLength; BigInteger.prototype.mod = bnMod; BigInteger.prototype.modPowInt = bnModPowInt; // "constants" BigInteger.ZERO = nbv(0); BigInteger.ONE = nbv(1); // Copyright (c) 2005 Tom Wu // All Rights Reserved. // See "LICENSE" for details. // Extended JavaScript BN functions, required for RSA private ops. // (public) function bnClone() { var r = nbi(); this.copyTo(r); return r; } // (public) return value as integer function bnIntValue() { var this_array = this.array; if(this.s < 0) { if(this.t == 1) return this_array[0]-BI_DV; else if(this.t == 0) return -1; } else if(this.t == 1) return this_array[0]; else if(this.t == 0) return 0; // assumes 16 < DB < 32 return ((this_array[1]&((1<<(32-BI_DB))-1))<>24; } // (public) return value as short (assumes DB>=16) function bnShortValue() { var this_array = this.array; return (this.t==0)?this.s:(this_array[0]<<16)>>16; } // (protected) return x s.t. r^x < DV function bnpChunkSize(r) { return Math.floor(Math.LN2*BI_DB/Math.log(r)); } // (public) 0 if this == 0, 1 if this > 0 function bnSigNum() { var this_array = this.array; if(this.s < 0) return -1; else if(this.t <= 0 || (this.t == 1 && this_array[0] <= 0)) return 0; else return 1; } // (protected) convert to radix string function bnpToRadix(b) { if(b == null) b = 10; if(this.signum() == 0 || b < 2 || b > 36) return "0"; var cs = this.chunkSize(b); var a = Math.pow(b,cs); var d = nbv(a), y = nbi(), z = nbi(), r = ""; this.divRemTo(d,y,z); while(y.signum() > 0) { r = (a+z.intValue()).toString(b).substr(1) + r; y.divRemTo(d,y,z); } return z.intValue().toString(b) + r; } // (protected) convert from radix string function bnpFromRadix(s,b) { this.fromInt(0); if(b == null) b = 10; var cs = this.chunkSize(b); var d = Math.pow(b,cs), mi = false, j = 0, w = 0; for(var i = 0; i < s.length; ++i) { var x = intAt(s,i); if(x < 0) { if(s.charAt(i) == "-" && this.signum() == 0) mi = true; continue; } w = b*w+x; if(++j >= cs) { this.dMultiply(d); this.dAddOffset(w,0); j = 0; w = 0; } } if(j > 0) { this.dMultiply(Math.pow(b,j)); this.dAddOffset(w,0); } if(mi) BigInteger.ZERO.subTo(this,this); } // (protected) alternate constructor function bnpFromNumber(a,b,c) { if("number" == typeof b) { // new BigInteger(int,int,RNG) if(a < 2) this.fromInt(1); else { this.fromNumber(a,c); if(!this.testBit(a-1)) // force MSB set this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); if(this.isEven()) this.dAddOffset(1,0); // force odd while(!this.isProbablePrime(b)) { this.dAddOffset(2,0); if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); } } } else { // new BigInteger(int,RNG) var x = new Array(), t = a&7; x.length = (a>>3)+1; b.nextBytes(x); if(t > 0) x[0] &= ((1< 0) { if(p < BI_DB && (d = this_array[i]>>p) != (this.s&BI_DM)>>p) r[k++] = d|(this.s<<(BI_DB-p)); while(i >= 0) { if(p < 8) { d = (this_array[i]&((1<>(p+=BI_DB-8); } else { d = (this_array[i]>>(p-=8))&0xff; if(p <= 0) { p += BI_DB; --i; } } if((d&0x80) != 0) d |= -256; if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; if(k > 0 || d != this.s) r[k++] = d; } } return r; } function bnEquals(a) { return(this.compareTo(a)==0); } function bnMin(a) { return(this.compareTo(a)<0)?this:a; } function bnMax(a) { return(this.compareTo(a)>0)?this:a; } // (protected) r = this op a (bitwise) function bnpBitwiseTo(a,op,r) { var this_array = this.array; var a_array = a.array; var r_array = r.array; var i, f, m = Math.min(a.t,this.t); for(i = 0; i < m; ++i) r_array[i] = op(this_array[i],a_array[i]); if(a.t < this.t) { f = a.s&BI_DM; for(i = m; i < this.t; ++i) r_array[i] = op(this_array[i],f); r.t = this.t; } else { f = this.s&BI_DM; for(i = m; i < a.t; ++i) r_array[i] = op(f,a_array[i]); r.t = a.t; } r.s = op(this.s,a.s); r.clamp(); } // (public) this & a function op_and(x,y) { return x&y; } function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } // (public) this | a function op_or(x,y) { return x|y; } function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } // (public) this ^ a function op_xor(x,y) { return x^y; } function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } // (public) this & ~a function op_andnot(x,y) { return x&~y; } function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } // (public) ~this function bnNot() { var this_array = this.array; var r = nbi(); var r_array = r.array; for(var i = 0; i < this.t; ++i) r_array[i] = BI_DM&~this_array[i]; r.t = this.t; r.s = ~this.s; return r; } // (public) this << n function bnShiftLeft(n) { var r = nbi(); if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); return r; } // (public) this >> n function bnShiftRight(n) { var r = nbi(); if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); return r; } // return index of lowest 1-bit in x, x < 2^31 function lbit(x) { if(x == 0) return -1; var r = 0; if((x&0xffff) == 0) { x >>= 16; r += 16; } if((x&0xff) == 0) { x >>= 8; r += 8; } if((x&0xf) == 0) { x >>= 4; r += 4; } if((x&3) == 0) { x >>= 2; r += 2; } if((x&1) == 0) ++r; return r; } // (public) returns index of lowest 1-bit (or -1 if none) function bnGetLowestSetBit() { var this_array = this.array; for(var i = 0; i < this.t; ++i) if(this_array[i] != 0) return i*BI_DB+lbit(this_array[i]); if(this.s < 0) return this.t*BI_DB; return -1; } // return number of 1 bits in x function cbit(x) { var r = 0; while(x != 0) { x &= x-1; ++r; } return r; } // (public) return number of set bits function bnBitCount() { var r = 0, x = this.s&BI_DM; for(var i = 0; i < this.t; ++i) r += cbit(this_array[i]^x); return r; } // (public) true iff nth bit is set function bnTestBit(n) { var this_array = this.array; var j = Math.floor(n/BI_DB); if(j >= this.t) return(this.s!=0); return((this_array[j]&(1<<(n%BI_DB)))!=0); } // (protected) this op (1<>= BI_DB; } if(a.t < this.t) { c += a.s; while(i < this.t) { c += this_array[i]; r_array[i++] = c&BI_DM; c >>= BI_DB; } c += this.s; } else { c += this.s; while(i < a.t) { c += a_array[i]; r_array[i++] = c&BI_DM; c >>= BI_DB; } c += a.s; } r.s = (c<0)?-1:0; if(c > 0) r_array[i++] = c; else if(c < -1) r_array[i++] = BI_DV+c; r.t = i; r.clamp(); } // (public) this + a function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } // (public) this - a function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } // (public) this * a function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } // (public) this / a function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } // (public) this % a function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } // (public) [this/a,this%a] function bnDivideAndRemainder(a) { var q = nbi(), r = nbi(); this.divRemTo(a,q,r); return new Array(q,r); } // (protected) this *= n, this >= 0, 1 < n < DV function bnpDMultiply(n) { var this_array = this.array; this_array[this.t] = this.am(0,n-1,this,0,0,this.t); ++this.t; this.clamp(); } // (protected) this += n << w words, this >= 0 function bnpDAddOffset(n,w) { var this_array = this.array; while(this.t <= w) this_array[this.t++] = 0; this_array[w] += n; while(this_array[w] >= BI_DV) { this_array[w] -= BI_DV; if(++w >= this.t) this_array[this.t++] = 0; ++this_array[w]; } } // A "null" reducer function NullExp() {} function nNop(x) { return x; } function nMulTo(x,y,r) { x.multiplyTo(y,r); } function nSqrTo(x,r) { x.squareTo(r); } NullExp.prototype.convert = nNop; NullExp.prototype.revert = nNop; NullExp.prototype.mulTo = nMulTo; NullExp.prototype.sqrTo = nSqrTo; // (public) this^e function bnPow(e) { return this.exp(e,new NullExp()); } // (protected) r = lower n words of "this * a", a.t <= n // "this" should be the larger one if appropriate. function bnpMultiplyLowerTo(a,n,r) { var r_array = r.array; var a_array = a.array; var i = Math.min(this.t+a.t,n); r.s = 0; // assumes a,this >= 0 r.t = i; while(i > 0) r_array[--i] = 0; var j; for(j = r.t-this.t; i < j; ++i) r_array[i+this.t] = this.am(0,a_array[i],r,i,0,this.t); for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a_array[i],r,i,0,n-i); r.clamp(); } // (protected) r = "this * a" without lower n words, n > 0 // "this" should be the larger one if appropriate. function bnpMultiplyUpperTo(a,n,r) { var r_array = r.array; var a_array = a.array; --n; var i = r.t = this.t+a.t-n; r.s = 0; // assumes a,this >= 0 while(--i >= 0) r_array[i] = 0; for(i = Math.max(n-this.t,0); i < a.t; ++i) r_array[this.t+i-n] = this.am(n-i,a_array[i],r,0,0,this.t+i-n); r.clamp(); r.drShiftTo(1,r); } // Barrett modular reduction function Barrett(m) { // setup Barrett this.r2 = nbi(); this.q3 = nbi(); BigInteger.ONE.dlShiftTo(2*m.t,this.r2); this.mu = this.r2.divide(m); this.m = m; } function barrettConvert(x) { if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); else if(x.compareTo(this.m) < 0) return x; else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } } function barrettRevert(x) { return x; } // x = x mod m (HAC 14.42) function barrettReduce(x) { x.drShiftTo(this.m.t-1,this.r2); if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); x.subTo(this.r2,x); while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); } // r = x^2 mod m; x != r function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } // r = x*y mod m; x,y != r function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } Barrett.prototype.convert = barrettConvert; Barrett.prototype.revert = barrettRevert; Barrett.prototype.reduce = barrettReduce; Barrett.prototype.mulTo = barrettMulTo; Barrett.prototype.sqrTo = barrettSqrTo; // (public) this^e % m (HAC 14.85) function bnModPow(e,m) { var e_array = e.array; var i = e.bitLength(), k, r = nbv(1), z; if(i <= 0) return r; else if(i < 18) k = 1; else if(i < 48) k = 3; else if(i < 144) k = 4; else if(i < 768) k = 5; else k = 6; if(i < 8) z = new Classic(m); else if(m.isEven()) z = new Barrett(m); else z = new Montgomery(m); // precomputation var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { var g2 = nbi(); z.sqrTo(g[1],g2); while(n <= km) { g[n] = nbi(); z.mulTo(g2,g[n-2],g[n]); n += 2; } } var j = e.t-1, w, is1 = true, r2 = nbi(), t; i = nbits(e_array[j])-1; while(j >= 0) { if(i >= k1) w = (e_array[j]>>(i-k1))&km; else { w = (e_array[j]&((1<<(i+1))-1))<<(k1-i); if(j > 0) w |= e_array[j-1]>>(BI_DB+i-k1); } n = k; while((w&1) == 0) { w >>= 1; --n; } if((i -= n) < 0) { i += BI_DB; --j; } if(is1) { // ret == 1, don't bother squaring or multiplying it g[w].copyTo(r); is1 = false; } else { while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } z.mulTo(r2,g[w],r); } while(j >= 0 && (e_array[j]&(1< 0) { x.rShiftTo(g,x); y.rShiftTo(g,y); } while(x.signum() > 0) { if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); if(x.compareTo(y) >= 0) { x.subTo(y,x); x.rShiftTo(1,x); } else { y.subTo(x,y); y.rShiftTo(1,y); } } if(g > 0) y.lShiftTo(g,y); return y; } // (protected) this % n, n < 2^26 function bnpModInt(n) { var this_array = this.array; if(n <= 0) return 0; var d = BI_DV%n, r = (this.s<0)?n-1:0; if(this.t > 0) if(d == 0) r = this_array[0]%n; else for(var i = this.t-1; i >= 0; --i) r = (d*r+this_array[i])%n; return r; } // (public) 1/this % m (HAC 14.61) function bnModInverse(m) { var ac = m.isEven(); if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; var u = m.clone(), v = this.clone(); var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); while(u.signum() != 0) { while(u.isEven()) { u.rShiftTo(1,u); if(ac) { if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } a.rShiftTo(1,a); } else if(!b.isEven()) b.subTo(m,b); b.rShiftTo(1,b); } while(v.isEven()) { v.rShiftTo(1,v); if(ac) { if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } c.rShiftTo(1,c); } else if(!d.isEven()) d.subTo(m,d); d.rShiftTo(1,d); } if(u.compareTo(v) >= 0) { u.subTo(v,u); if(ac) a.subTo(c,a); b.subTo(d,b); } else { v.subTo(u,v); if(ac) c.subTo(a,c); d.subTo(b,d); } } if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; if(d.compareTo(m) >= 0) return d.subtract(m); if(d.signum() < 0) d.addTo(m,d); else return d; if(d.signum() < 0) return d.add(m); else return d; } var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509]; var lplim = (1<<26)/lowprimes[lowprimes.length-1]; // (public) test primality with certainty >= 1-.5^t function bnIsProbablePrime(t) { var i, x = this.abs(); var x_array = x.array; if(x.t == 1 && x_array[0] <= lowprimes[lowprimes.length-1]) { for(i = 0; i < lowprimes.length; ++i) if(x_array[0] == lowprimes[i]) return true; return false; } if(x.isEven()) return false; i = 1; while(i < lowprimes.length) { var m = lowprimes[i], j = i+1; while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; m = x.modInt(m); while(i < j) if(m%lowprimes[i++] == 0) return false; } return x.millerRabin(t); } // (protected) true if probably prime (HAC 4.24, Miller-Rabin) function bnpMillerRabin(t) { var n1 = this.subtract(BigInteger.ONE); var k = n1.getLowestSetBit(); if(k <= 0) return false; var r = n1.shiftRight(k); t = (t+1)>>1; if(t > lowprimes.length) t = lowprimes.length; var a = nbi(); for(var i = 0; i < t; ++i) { a.fromInt(lowprimes[i]); var y = a.modPow(r,this); if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { var j = 1; while(j++ < k && y.compareTo(n1) != 0) { y = y.modPowInt(2,this); if(y.compareTo(BigInteger.ONE) == 0) return false; } if(y.compareTo(n1) != 0) return false; } } return true; } // protected BigInteger.prototype.chunkSize = bnpChunkSize; BigInteger.prototype.toRadix = bnpToRadix; BigInteger.prototype.fromRadix = bnpFromRadix; BigInteger.prototype.fromNumber = bnpFromNumber; BigInteger.prototype.bitwiseTo = bnpBitwiseTo; BigInteger.prototype.changeBit = bnpChangeBit; BigInteger.prototype.addTo = bnpAddTo; BigInteger.prototype.dMultiply = bnpDMultiply; BigInteger.prototype.dAddOffset = bnpDAddOffset; BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; BigInteger.prototype.modInt = bnpModInt; BigInteger.prototype.millerRabin = bnpMillerRabin; // public BigInteger.prototype.clone = bnClone; BigInteger.prototype.intValue = bnIntValue; BigInteger.prototype.byteValue = bnByteValue; BigInteger.prototype.shortValue = bnShortValue; BigInteger.prototype.signum = bnSigNum; BigInteger.prototype.toByteArray = bnToByteArray; BigInteger.prototype.equals = bnEquals; BigInteger.prototype.min = bnMin; BigInteger.prototype.max = bnMax; BigInteger.prototype.and = bnAnd; BigInteger.prototype.or = bnOr; BigInteger.prototype.xor = bnXor; BigInteger.prototype.andNot = bnAndNot; BigInteger.prototype.not = bnNot; BigInteger.prototype.shiftLeft = bnShiftLeft; BigInteger.prototype.shiftRight = bnShiftRight; BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; BigInteger.prototype.bitCount = bnBitCount; BigInteger.prototype.testBit = bnTestBit; BigInteger.prototype.setBit = bnSetBit; BigInteger.prototype.clearBit = bnClearBit; BigInteger.prototype.flipBit = bnFlipBit; BigInteger.prototype.add = bnAdd; BigInteger.prototype.subtract = bnSubtract; BigInteger.prototype.multiply = bnMultiply; BigInteger.prototype.divide = bnDivide; BigInteger.prototype.remainder = bnRemainder; BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; BigInteger.prototype.modPow = bnModPow; BigInteger.prototype.modInverse = bnModInverse; BigInteger.prototype.pow = bnPow; BigInteger.prototype.gcd = bnGCD; BigInteger.prototype.isProbablePrime = bnIsProbablePrime; // BigInteger interfaces not implemented in jsbn: // BigInteger(int signum, byte[] magnitude) // double doubleValue() // float floatValue() // int hashCode() // long longValue() // static BigInteger valueOf(long val) // prng4.js - uses Arcfour as a PRNG function Arcfour() { this.i = 0; this.j = 0; this.S = new Array(); } // Initialize arcfour context from key, an array of ints, each from [0..255] function ARC4init(key) { var i, j, t; for(i = 0; i < 256; ++i) this.S[i] = i; j = 0; for(i = 0; i < 256; ++i) { j = (j + this.S[i] + key[i % key.length]) & 255; t = this.S[i]; this.S[i] = this.S[j]; this.S[j] = t; } this.i = 0; this.j = 0; } function ARC4next() { var t; this.i = (this.i + 1) & 255; this.j = (this.j + this.S[this.i]) & 255; t = this.S[this.i]; this.S[this.i] = this.S[this.j]; this.S[this.j] = t; return this.S[(t + this.S[this.i]) & 255]; } Arcfour.prototype.init = ARC4init; Arcfour.prototype.next = ARC4next; // Plug in your RNG constructor here function prng_newstate() { return new Arcfour(); } // Pool size must be a multiple of 4 and greater than 32. // An array of bytes the size of the pool will be passed to init() var rng_psize = 256; // Random number generator - requires a PRNG backend, e.g. prng4.js // For best results, put code like // // in your main HTML document. var rng_state; var rng_pool; var rng_pptr; // Mix in a 32-bit integer into the pool function rng_seed_int(x) { rng_pool[rng_pptr++] ^= x & 255; rng_pool[rng_pptr++] ^= (x >> 8) & 255; rng_pool[rng_pptr++] ^= (x >> 16) & 255; rng_pool[rng_pptr++] ^= (x >> 24) & 255; if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; } // Mix in the current time (w/milliseconds) into the pool function rng_seed_time() { // Use pre-computed date to avoid making the benchmark // results dependent on the current date. rng_seed_int(1122926989487); } // Initialize the pool with junk if needed. if(rng_pool == null) { rng_pool = new Array(); rng_pptr = 0; var t; while(rng_pptr < rng_psize) { // extract some randomness from Math.random() t = Math.floor(65536 * Math.random()); rng_pool[rng_pptr++] = t >>> 8; rng_pool[rng_pptr++] = t & 255; } rng_pptr = 0; rng_seed_time(); //rng_seed_int(window.screenX); //rng_seed_int(window.screenY); } function rng_get_byte() { if(rng_state == null) { rng_seed_time(); rng_state = prng_newstate(); rng_state.init(rng_pool); for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; rng_pptr = 0; //rng_pool = null; } // TODO: allow reseeding after first request return rng_state.next(); } function rng_get_bytes(ba) { var i; for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); } function SecureRandom() {} SecureRandom.prototype.nextBytes = rng_get_bytes; // Depends on jsbn.js and rng.js // convert a (hex) string to a bignum object function parseBigInt(str,r) { return new BigInteger(str,r); } function linebrk(s,n) { var ret = ""; var i = 0; while(i + n < s.length) { ret += s.substring(i,i+n) + "\n"; i += n; } return ret + s.substring(i,s.length); } function byte2Hex(b) { if(b < 0x10) return "0" + b.toString(16); else return b.toString(16); } // PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint function pkcs1pad2(s,n) { if(n < s.length + 11) { alert("Message too long for RSA"); return null; } var ba = new Array(); var i = s.length - 1; while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--); ba[--n] = 0; var rng = new SecureRandom(); var x = new Array(); while(n > 2) { // random non-zero pad x[0] = 0; while(x[0] == 0) rng.nextBytes(x); ba[--n] = x[0]; } ba[--n] = 2; ba[--n] = 0; return new BigInteger(ba); } // "empty" RSA key constructor function RSAKey() { this.n = null; this.e = 0; this.d = null; this.p = null; this.q = null; this.dmp1 = null; this.dmq1 = null; this.coeff = null; } // Set the public key fields N and e from hex strings function RSASetPublic(N,E) { if(N != null && E != null && N.length > 0 && E.length > 0) { this.n = parseBigInt(N,16); this.e = parseInt(E,16); } else alert("Invalid RSA public key"); } // Perform raw public operation on "x": return x^e (mod n) function RSADoPublic(x) { return x.modPowInt(this.e, this.n); } // Return the PKCS#1 RSA encryption of "text" as an even-length hex string function RSAEncrypt(text) { var m = pkcs1pad2(text,(this.n.bitLength()+7)>>3); if(m == null) return null; var c = this.doPublic(m); if(c == null) return null; var h = c.toString(16); if((h.length & 1) == 0) return h; else return "0" + h; } // Return the PKCS#1 RSA encryption of "text" as a Base64-encoded string //function RSAEncryptB64(text) { // var h = this.encrypt(text); // if(h) return hex2b64(h); else return null; //} // protected RSAKey.prototype.doPublic = RSADoPublic; // public RSAKey.prototype.setPublic = RSASetPublic; RSAKey.prototype.encrypt = RSAEncrypt; //RSAKey.prototype.encrypt_b64 = RSAEncryptB64; // Depends on rsa.js and jsbn2.js // Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext function pkcs1unpad2(d,n) { var b = d.toByteArray(); var i = 0; while(i < b.length && b[i] == 0) ++i; if(b.length-i != n-1 || b[i] != 2) return null; ++i; while(b[i] != 0) if(++i >= b.length) return null; var ret = ""; while(++i < b.length) ret += String.fromCharCode(b[i]); return ret; } // Set the private key fields N, e, and d from hex strings function RSASetPrivate(N,E,D) { if(N != null && E != null && N.length > 0 && E.length > 0) { this.n = parseBigInt(N,16); this.e = parseInt(E,16); this.d = parseBigInt(D,16); } else alert("Invalid RSA private key"); } // Set the private key fields N, e, d and CRT params from hex strings function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) { if(N != null && E != null && N.length > 0 && E.length > 0) { this.n = parseBigInt(N,16); this.e = parseInt(E,16); this.d = parseBigInt(D,16); this.p = parseBigInt(P,16); this.q = parseBigInt(Q,16); this.dmp1 = parseBigInt(DP,16); this.dmq1 = parseBigInt(DQ,16); this.coeff = parseBigInt(C,16); } else alert("Invalid RSA private key"); } // Generate a new random private key B bits long, using public expt E function RSAGenerate(B,E) { var rng = new SecureRandom(); var qs = B>>1; this.e = parseInt(E,16); var ee = new BigInteger(E,16); for(;;) { for(;;) { this.p = new BigInteger(B-qs,1,rng); if(this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break; } for(;;) { this.q = new BigInteger(qs,1,rng); if(this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break; } if(this.p.compareTo(this.q) <= 0) { var t = this.p; this.p = this.q; this.q = t; } var p1 = this.p.subtract(BigInteger.ONE); var q1 = this.q.subtract(BigInteger.ONE); var phi = p1.multiply(q1); if(phi.gcd(ee).compareTo(BigInteger.ONE) == 0) { this.n = this.p.multiply(this.q); this.d = ee.modInverse(phi); this.dmp1 = this.d.mod(p1); this.dmq1 = this.d.mod(q1); this.coeff = this.q.modInverse(this.p); break; } } } // Perform raw private operation on "x": return x^d (mod n) function RSADoPrivate(x) { if(this.p == null || this.q == null) return x.modPow(this.d, this.n); // TODO: re-calculate any missing CRT params var xp = x.mod(this.p).modPow(this.dmp1, this.p); var xq = x.mod(this.q).modPow(this.dmq1, this.q); while(xp.compareTo(xq) < 0) xp = xp.add(this.p); return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq); } // Return the PKCS#1 RSA decryption of "ctext". // "ctext" is an even-length hex string and the output is a plain string. function RSADecrypt(ctext) { var c = parseBigInt(ctext, 16); var m = this.doPrivate(c); if(m == null) return null; return pkcs1unpad2(m, (this.n.bitLength()+7)>>3); } // Return the PKCS#1 RSA decryption of "ctext". // "ctext" is a Base64-encoded string and the output is a plain string. //function RSAB64Decrypt(ctext) { // var h = b64tohex(ctext); // if(h) return this.decrypt(h); else return null; //} // protected RSAKey.prototype.doPrivate = RSADoPrivate; // public RSAKey.prototype.setPrivate = RSASetPrivate; RSAKey.prototype.setPrivateEx = RSASetPrivateEx; RSAKey.prototype.generate = RSAGenerate; RSAKey.prototype.decrypt = RSADecrypt; //RSAKey.prototype.b64_decrypt = RSAB64Decrypt; nValue="a5261939975948bb7a58dffe5ff54e65f0498f9175f5a09288810b8975871e99af3b5dd94057b0fc07535f5f97444504fa35169d461d0d30cf0192e307727c065168c788771c561a9400fb49175e9e6aa4e23fe11af69e9412dd23b0cb6684c4c2429bce139e848ab26d0829073351f4acd36074eafd036a5eb83359d2a698d3"; eValue="10001"; dValue="8e9912f6d3645894e8d38cb58c0db81ff516cf4c7e5a14c7f1eddb1459d2cded4d8d293fc97aee6aefb861859c8b6a3d1dfe710463e1f9ddc72048c09751971c4a580aa51eb523357a3cc48d31cfad1d4a165066ed92d4748fb6571211da5cb14bc11b6e2df7c1a559e6d5ac1cd5c94703a22891464fba23d0d965086277a161"; pValue="d090ce58a92c75233a6486cb0a9209bf3583b64f540c76f5294bb97d285eed33aec220bde14b2417951178ac152ceab6da7090905b478195498b352048f15e7d"; qValue="cab575dc652bb66df15a0359609d51d1db184750c00c6698b90ef3465c99655103edbf0d54c56aec0ce3c4d22592338092a126a0cc49f65a4a30d222b411e58f"; dmp1Value="1a24bca8e273df2f0e47c199bbf678604e7df7215480c77c8db39f49b000ce2cf7500038acfff5433b7d582a01f1826e6f4d42e1c57f5e1fef7b12aabc59fd25"; dmq1Value="3d06982efbbe47339e1f6d36b1216b8a741d410b0c662f54f7118b27b9a4ec9d914337eb39841d8666f3034408cf94f5b62f11c402fc994fe15a05493150d9fd"; coeffValue="3a3e731acd8960b7ff9eb81a7ff93bd1cfa74cbd56987db58b4594fb09c09084db1734c8143f98b602b981aaa9243ca28deb69b5b280ee8dcee0fd2625e53250"; setupEngine(am3, 28); var TEXT = "The quick brown fox jumped over the extremely lazy frog! " + "Now is the time for all good men to come to the party."; var encrypted; function encrypt() { var RSA = new RSAKey(); RSA.setPublic(nValue, eValue); RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue); encrypted = RSA.encrypt(TEXT); } function decrypt() { var RSA = new RSAKey(); RSA.setPublic(nValue, eValue); RSA.setPrivateEx(nValue, eValue, dValue, pValue, qValue, dmp1Value, dmq1Value, coeffValue); var decrypted = RSA.decrypt(encrypted); if (decrypted != TEXT) { throw new Error("Crypto operation failed"); } } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/deltablue.js000066400000000000000000000620651211511573600236350ustar00rootroot00000000000000// Copyright 2008 the V8 project authors. All rights reserved. // Copyright 1996 John Maloney and Mario Wolczko. // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // This implementation of the DeltaBlue benchmark is derived // from the Smalltalk implementation by John Maloney and Mario // Wolczko. Some parts have been translated directly, whereas // others have been modified more aggresively to make it feel // more like a JavaScript program. var DeltaBlue = new BenchmarkSuite('DeltaBlue', 66118, [ new Benchmark('DeltaBlue', deltaBlue) ]); /** * A JavaScript implementation of the DeltaBlue constraint-solving * algorithm, as described in: * * "The DeltaBlue Algorithm: An Incremental Constraint Hierarchy Solver" * Bjorn N. Freeman-Benson and John Maloney * January 1990 Communications of the ACM, * also available as University of Washington TR 89-08-06. * * Beware: this benchmark is written in a grotesque style where * the constraint model is built by side-effects from constructors. * I've kept it this way to avoid deviating too much from the original * implementation. */ /* --- O b j e c t M o d e l --- */ Object.prototype.inheritsFrom = function (shuper) { function Inheriter() { } Inheriter.prototype = shuper.prototype; this.prototype = new Inheriter(); this.superConstructor = shuper; } function OrderedCollection() { this.elms = new Array(); } OrderedCollection.prototype.add = function (elm) { this.elms.push(elm); } OrderedCollection.prototype.at = function (index) { return this.elms[index]; } OrderedCollection.prototype.size = function () { return this.elms.length; } OrderedCollection.prototype.removeFirst = function () { return this.elms.pop(); } OrderedCollection.prototype.remove = function (elm) { var index = 0, skipped = 0; for (var i = 0; i < this.elms.length; i++) { var value = this.elms[i]; if (value != elm) { this.elms[index] = value; index++; } else { skipped++; } } for (var i = 0; i < skipped; i++) this.elms.pop(); } /* --- * * S t r e n g t h * --- */ /** * Strengths are used to measure the relative importance of constraints. * New strengths may be inserted in the strength hierarchy without * disrupting current constraints. Strengths cannot be created outside * this class, so pointer comparison can be used for value comparison. */ function Strength(strengthValue, name) { this.strengthValue = strengthValue; this.name = name; } Strength.stronger = function (s1, s2) { return s1.strengthValue < s2.strengthValue; } Strength.weaker = function (s1, s2) { return s1.strengthValue > s2.strengthValue; } Strength.weakestOf = function (s1, s2) { return this.weaker(s1, s2) ? s1 : s2; } Strength.strongest = function (s1, s2) { return this.stronger(s1, s2) ? s1 : s2; } Strength.prototype.nextWeaker = function () { switch (this.strengthValue) { case 0: return Strength.WEAKEST; case 1: return Strength.WEAK_DEFAULT; case 2: return Strength.NORMAL; case 3: return Strength.STRONG_DEFAULT; case 4: return Strength.PREFERRED; case 5: return Strength.REQUIRED; } } // Strength constants. Strength.REQUIRED = new Strength(0, "required"); Strength.STONG_PREFERRED = new Strength(1, "strongPreferred"); Strength.PREFERRED = new Strength(2, "preferred"); Strength.STRONG_DEFAULT = new Strength(3, "strongDefault"); Strength.NORMAL = new Strength(4, "normal"); Strength.WEAK_DEFAULT = new Strength(5, "weakDefault"); Strength.WEAKEST = new Strength(6, "weakest"); /* --- * * C o n s t r a i n t * --- */ /** * An abstract class representing a system-maintainable relationship * (or "constraint") between a set of variables. A constraint supplies * a strength instance variable; concrete subclasses provide a means * of storing the constrained variables and other information required * to represent a constraint. */ function Constraint(strength) { this.strength = strength; } /** * Activate this constraint and attempt to satisfy it. */ Constraint.prototype.addConstraint = function () { this.addToGraph(); planner.incrementalAdd(this); } /** * Attempt to find a way to enforce this constraint. If successful, * record the solution, perhaps modifying the current dataflow * graph. Answer the constraint that this constraint overrides, if * there is one, or nil, if there isn't. * Assume: I am not already satisfied. */ Constraint.prototype.satisfy = function (mark) { this.chooseMethod(mark); if (!this.isSatisfied()) { if (this.strength == Strength.REQUIRED) alert("Could not satisfy a required constraint!"); return null; } this.markInputs(mark); var out = this.output(); var overridden = out.determinedBy; if (overridden != null) overridden.markUnsatisfied(); out.determinedBy = this; if (!planner.addPropagate(this, mark)) alert("Cycle encountered"); out.mark = mark; return overridden; } Constraint.prototype.destroyConstraint = function () { if (this.isSatisfied()) planner.incrementalRemove(this); else this.removeFromGraph(); } /** * Normal constraints are not input constraints. An input constraint * is one that depends on external state, such as the mouse, the * keybord, a clock, or some arbitraty piece of imperative code. */ Constraint.prototype.isInput = function () { return false; } /* --- * * U n a r y C o n s t r a i n t * --- */ /** * Abstract superclass for constraints having a single possible output * variable. */ function UnaryConstraint(v, strength) { UnaryConstraint.superConstructor.call(this, strength); this.myOutput = v; this.satisfied = false; this.addConstraint(); } UnaryConstraint.inheritsFrom(Constraint); /** * Adds this constraint to the constraint graph */ UnaryConstraint.prototype.addToGraph = function () { this.myOutput.addConstraint(this); this.satisfied = false; } /** * Decides if this constraint can be satisfied and records that * decision. */ UnaryConstraint.prototype.chooseMethod = function (mark) { this.satisfied = (this.myOutput.mark != mark) && Strength.stronger(this.strength, this.myOutput.walkStrength); } /** * Returns true if this constraint is satisfied in the current solution. */ UnaryConstraint.prototype.isSatisfied = function () { return this.satisfied; } UnaryConstraint.prototype.markInputs = function (mark) { // has no inputs } /** * Returns the current output variable. */ UnaryConstraint.prototype.output = function () { return this.myOutput; } /** * Calculate the walkabout strength, the stay flag, and, if it is * 'stay', the value for the current output of this constraint. Assume * this constraint is satisfied. */ UnaryConstraint.prototype.recalculate = function () { this.myOutput.walkStrength = this.strength; this.myOutput.stay = !this.isInput(); if (this.myOutput.stay) this.execute(); // Stay optimization } /** * Records that this constraint is unsatisfied */ UnaryConstraint.prototype.markUnsatisfied = function () { this.satisfied = false; } UnaryConstraint.prototype.inputsKnown = function () { return true; } UnaryConstraint.prototype.removeFromGraph = function () { if (this.myOutput != null) this.myOutput.removeConstraint(this); this.satisfied = false; } /* --- * * S t a y C o n s t r a i n t * --- */ /** * Variables that should, with some level of preference, stay the same. * Planners may exploit the fact that instances, if satisfied, will not * change their output during plan execution. This is called "stay * optimization". */ function StayConstraint(v, str) { StayConstraint.superConstructor.call(this, v, str); } StayConstraint.inheritsFrom(UnaryConstraint); StayConstraint.prototype.execute = function () { // Stay constraints do nothing } /* --- * * E d i t C o n s t r a i n t * --- */ /** * A unary input constraint used to mark a variable that the client * wishes to change. */ function EditConstraint(v, str) { EditConstraint.superConstructor.call(this, v, str); } EditConstraint.inheritsFrom(UnaryConstraint); /** * Edits indicate that a variable is to be changed by imperative code. */ EditConstraint.prototype.isInput = function () { return true; } EditConstraint.prototype.execute = function () { // Edit constraints do nothing } /* --- * * B i n a r y C o n s t r a i n t * --- */ var Direction = new Object(); Direction.NONE = 0; Direction.FORWARD = 1; Direction.BACKWARD = -1; /** * Abstract superclass for constraints having two possible output * variables. */ function BinaryConstraint(var1, var2, strength) { BinaryConstraint.superConstructor.call(this, strength); this.v1 = var1; this.v2 = var2; this.direction = Direction.NONE; this.addConstraint(); } BinaryConstraint.inheritsFrom(Constraint); /** * Decides if this constraint can be satisfied and which way it * should flow based on the relative strength of the variables related, * and record that decision. */ BinaryConstraint.prototype.chooseMethod = function (mark) { if (this.v1.mark == mark) { this.direction = (this.v2.mark != mark && Strength.stronger(this.strength, this.v2.walkStrength)) ? Direction.FORWARD : Direction.NONE; } if (this.v2.mark == mark) { this.direction = (this.v1.mark != mark && Strength.stronger(this.strength, this.v1.walkStrength)) ? Direction.BACKWARD : Direction.NONE; } if (Strength.weaker(this.v1.walkStrength, this.v2.walkStrength)) { this.direction = Strength.stronger(this.strength, this.v1.walkStrength) ? Direction.BACKWARD : Direction.NONE; } else { this.direction = Strength.stronger(this.strength, this.v2.walkStrength) ? Direction.FORWARD : Direction.BACKWARD } } /** * Add this constraint to the constraint graph */ BinaryConstraint.prototype.addToGraph = function () { this.v1.addConstraint(this); this.v2.addConstraint(this); this.direction = Direction.NONE; } /** * Answer true if this constraint is satisfied in the current solution. */ BinaryConstraint.prototype.isSatisfied = function () { return this.direction != Direction.NONE; } /** * Mark the input variable with the given mark. */ BinaryConstraint.prototype.markInputs = function (mark) { this.input().mark = mark; } /** * Returns the current input variable */ BinaryConstraint.prototype.input = function () { return (this.direction == Direction.FORWARD) ? this.v1 : this.v2; } /** * Returns the current output variable */ BinaryConstraint.prototype.output = function () { return (this.direction == Direction.FORWARD) ? this.v2 : this.v1; } /** * Calculate the walkabout strength, the stay flag, and, if it is * 'stay', the value for the current output of this * constraint. Assume this constraint is satisfied. */ BinaryConstraint.prototype.recalculate = function () { var ihn = this.input(), out = this.output(); out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength); out.stay = ihn.stay; if (out.stay) this.execute(); } /** * Record the fact that this constraint is unsatisfied. */ BinaryConstraint.prototype.markUnsatisfied = function () { this.direction = Direction.NONE; } BinaryConstraint.prototype.inputsKnown = function (mark) { var i = this.input(); return i.mark == mark || i.stay || i.determinedBy == null; } BinaryConstraint.prototype.removeFromGraph = function () { if (this.v1 != null) this.v1.removeConstraint(this); if (this.v2 != null) this.v2.removeConstraint(this); this.direction = Direction.NONE; } /* --- * * S c a l e C o n s t r a i n t * --- */ /** * Relates two variables by the linear scaling relationship: "v2 = * (v1 * scale) + offset". Either v1 or v2 may be changed to maintain * this relationship but the scale factor and offset are considered * read-only. */ function ScaleConstraint(src, scale, offset, dest, strength) { this.direction = Direction.NONE; this.scale = scale; this.offset = offset; ScaleConstraint.superConstructor.call(this, src, dest, strength); } ScaleConstraint.inheritsFrom(BinaryConstraint); /** * Adds this constraint to the constraint graph. */ ScaleConstraint.prototype.addToGraph = function () { ScaleConstraint.superConstructor.prototype.addToGraph.call(this); this.scale.addConstraint(this); this.offset.addConstraint(this); } ScaleConstraint.prototype.removeFromGraph = function () { ScaleConstraint.superConstructor.prototype.removeFromGraph.call(this); if (this.scale != null) this.scale.removeConstraint(this); if (this.offset != null) this.offset.removeConstraint(this); } ScaleConstraint.prototype.markInputs = function (mark) { ScaleConstraint.superConstructor.prototype.markInputs.call(this, mark); this.scale.mark = this.offset.mark = mark; } /** * Enforce this constraint. Assume that it is satisfied. */ ScaleConstraint.prototype.execute = function () { if (this.direction == Direction.FORWARD) { this.v2.value = this.v1.value * this.scale.value + this.offset.value; } else { this.v1.value = (this.v2.value - this.offset.value) / this.scale.value; } } /** * Calculate the walkabout strength, the stay flag, and, if it is * 'stay', the value for the current output of this constraint. Assume * this constraint is satisfied. */ ScaleConstraint.prototype.recalculate = function () { var ihn = this.input(), out = this.output(); out.walkStrength = Strength.weakestOf(this.strength, ihn.walkStrength); out.stay = ihn.stay && this.scale.stay && this.offset.stay; if (out.stay) this.execute(); } /* --- * * E q u a l i t y C o n s t r a i n t * --- */ /** * Constrains two variables to have the same value. */ function EqualityConstraint(var1, var2, strength) { EqualityConstraint.superConstructor.call(this, var1, var2, strength); } EqualityConstraint.inheritsFrom(BinaryConstraint); /** * Enforce this constraint. Assume that it is satisfied. */ EqualityConstraint.prototype.execute = function () { this.output().value = this.input().value; } /* --- * * V a r i a b l e * --- */ /** * A constrained variable. In addition to its value, it maintain the * structure of the constraint graph, the current dataflow graph, and * various parameters of interest to the DeltaBlue incremental * constraint solver. **/ function Variable(name, initialValue) { this.value = initialValue || 0; this.constraints = new OrderedCollection(); this.determinedBy = null; this.mark = 0; this.walkStrength = Strength.WEAKEST; this.stay = true; this.name = name; } /** * Add the given constraint to the set of all constraints that refer * this variable. */ Variable.prototype.addConstraint = function (c) { this.constraints.add(c); } /** * Removes all traces of c from this variable. */ Variable.prototype.removeConstraint = function (c) { this.constraints.remove(c); if (this.determinedBy == c) this.determinedBy = null; } /* --- * * P l a n n e r * --- */ /** * The DeltaBlue planner */ function Planner() { this.currentMark = 0; } /** * Attempt to satisfy the given constraint and, if successful, * incrementally update the dataflow graph. Details: If satifying * the constraint is successful, it may override a weaker constraint * on its output. The algorithm attempts to resatisfy that * constraint using some other method. This process is repeated * until either a) it reaches a variable that was not previously * determined by any constraint or b) it reaches a constraint that * is too weak to be satisfied using any of its methods. The * variables of constraints that have been processed are marked with * a unique mark value so that we know where we've been. This allows * the algorithm to avoid getting into an infinite loop even if the * constraint graph has an inadvertent cycle. */ Planner.prototype.incrementalAdd = function (c) { var mark = this.newMark(); var overridden = c.satisfy(mark); while (overridden != null) overridden = overridden.satisfy(mark); } /** * Entry point for retracting a constraint. Remove the given * constraint and incrementally update the dataflow graph. * Details: Retracting the given constraint may allow some currently * unsatisfiable downstream constraint to be satisfied. We therefore collect * a list of unsatisfied downstream constraints and attempt to * satisfy each one in turn. This list is traversed by constraint * strength, strongest first, as a heuristic for avoiding * unnecessarily adding and then overriding weak constraints. * Assume: c is satisfied. */ Planner.prototype.incrementalRemove = function (c) { var out = c.output(); c.markUnsatisfied(); c.removeFromGraph(); var unsatisfied = this.removePropagateFrom(out); var strength = Strength.REQUIRED; do { for (var i = 0; i < unsatisfied.size(); i++) { var u = unsatisfied.at(i); if (u.strength == strength) this.incrementalAdd(u); } strength = strength.nextWeaker(); } while (strength != Strength.WEAKEST); } /** * Select a previously unused mark value. */ Planner.prototype.newMark = function () { return ++this.currentMark; } /** * Extract a plan for resatisfaction starting from the given source * constraints, usually a set of input constraints. This method * assumes that stay optimization is desired; the plan will contain * only constraints whose output variables are not stay. Constraints * that do no computation, such as stay and edit constraints, are * not included in the plan. * Details: The outputs of a constraint are marked when it is added * to the plan under construction. A constraint may be appended to * the plan when all its input variables are known. A variable is * known if either a) the variable is marked (indicating that has * been computed by a constraint appearing earlier in the plan), b) * the variable is 'stay' (i.e. it is a constant at plan execution * time), or c) the variable is not determined by any * constraint. The last provision is for past states of history * variables, which are not stay but which are also not computed by * any constraint. * Assume: sources are all satisfied. */ Planner.prototype.makePlan = function (sources) { var mark = this.newMark(); var plan = new Plan(); var todo = sources; while (todo.size() > 0) { var c = todo.removeFirst(); if (c.output().mark != mark && c.inputsKnown(mark)) { plan.addConstraint(c); c.output().mark = mark; this.addConstraintsConsumingTo(c.output(), todo); } } return plan; } /** * Extract a plan for resatisfying starting from the output of the * given constraints, usually a set of input constraints. */ Planner.prototype.extractPlanFromConstraints = function (constraints) { var sources = new OrderedCollection(); for (var i = 0; i < constraints.size(); i++) { var c = constraints.at(i); if (c.isInput() && c.isSatisfied()) // not in plan already and eligible for inclusion sources.add(c); } return this.makePlan(sources); } /** * Recompute the walkabout strengths and stay flags of all variables * downstream of the given constraint and recompute the actual * values of all variables whose stay flag is true. If a cycle is * detected, remove the given constraint and answer * false. Otherwise, answer true. * Details: Cycles are detected when a marked variable is * encountered downstream of the given constraint. The sender is * assumed to have marked the inputs of the given constraint with * the given mark. Thus, encountering a marked node downstream of * the output constraint means that there is a path from the * constraint's output to one of its inputs. */ Planner.prototype.addPropagate = function (c, mark) { var todo = new OrderedCollection(); todo.add(c); while (todo.size() > 0) { var d = todo.removeFirst(); if (d.output().mark == mark) { this.incrementalRemove(c); return false; } d.recalculate(); this.addConstraintsConsumingTo(d.output(), todo); } return true; } /** * Update the walkabout strengths and stay flags of all variables * downstream of the given constraint. Answer a collection of * unsatisfied constraints sorted in order of decreasing strength. */ Planner.prototype.removePropagateFrom = function (out) { out.determinedBy = null; out.walkStrength = Strength.WEAKEST; out.stay = true; var unsatisfied = new OrderedCollection(); var todo = new OrderedCollection(); todo.add(out); while (todo.size() > 0) { var v = todo.removeFirst(); for (var i = 0; i < v.constraints.size(); i++) { var c = v.constraints.at(i); if (!c.isSatisfied()) unsatisfied.add(c); } var determining = v.determinedBy; for (var i = 0; i < v.constraints.size(); i++) { var next = v.constraints.at(i); if (next != determining && next.isSatisfied()) { next.recalculate(); todo.add(next.output()); } } } return unsatisfied; } Planner.prototype.addConstraintsConsumingTo = function (v, coll) { var determining = v.determinedBy; var cc = v.constraints; for (var i = 0; i < cc.size(); i++) { var c = cc.at(i); if (c != determining && c.isSatisfied()) coll.add(c); } } /* --- * * P l a n * --- */ /** * A Plan is an ordered list of constraints to be executed in sequence * to resatisfy all currently satisfiable constraints in the face of * one or more changing inputs. */ function Plan() { this.v = new OrderedCollection(); } Plan.prototype.addConstraint = function (c) { this.v.add(c); } Plan.prototype.size = function () { return this.v.size(); } Plan.prototype.constraintAt = function (index) { return this.v.at(index); } Plan.prototype.execute = function () { for (var i = 0; i < this.size(); i++) { var c = this.constraintAt(i); c.execute(); } } /* --- * * M a i n * --- */ /** * This is the standard DeltaBlue benchmark. A long chain of equality * constraints is constructed with a stay constraint on one end. An * edit constraint is then added to the opposite end and the time is * measured for adding and removing this constraint, and extracting * and executing a constraint satisfaction plan. There are two cases. * In case 1, the added constraint is stronger than the stay * constraint and values must propagate down the entire length of the * chain. In case 2, the added constraint is weaker than the stay * constraint so it cannot be accomodated. The cost in this case is, * of course, very low. Typical situations lie somewhere between these * two extremes. */ function chainTest(n) { planner = new Planner(); var prev = null, first = null, last = null; // Build chain of n equality constraints for (var i = 0; i <= n; i++) { var name = "v" + i; var v = new Variable(name); if (prev != null) new EqualityConstraint(prev, v, Strength.REQUIRED); if (i == 0) first = v; if (i == n) last = v; prev = v; } new StayConstraint(last, Strength.STRONG_DEFAULT); var edit = new EditConstraint(first, Strength.PREFERRED); var edits = new OrderedCollection(); edits.add(edit); var plan = planner.extractPlanFromConstraints(edits); for (var i = 0; i < 100; i++) { first.value = i; plan.execute(); if (last.value != i) alert("Chain test failed."); } } /** * This test constructs a two sets of variables related to each * other by a simple linear transformation (scale and offset). The * time is measured to change a variable on either side of the * mapping and to change the scale and offset factors. */ function projectionTest(n) { planner = new Planner(); var scale = new Variable("scale", 10); var offset = new Variable("offset", 1000); var src = null, dst = null; var dests = new OrderedCollection(); for (var i = 0; i < n; i++) { src = new Variable("src" + i, i); dst = new Variable("dst" + i, i); dests.add(dst); new StayConstraint(src, Strength.NORMAL); new ScaleConstraint(src, scale, offset, dst, Strength.REQUIRED); } change(src, 17); if (dst.value != 1170) alert("Projection 1 failed"); change(dst, 1050); if (src.value != 5) alert("Projection 2 failed"); change(scale, 5); for (var i = 0; i < n - 1; i++) { if (dests.at(i).value != i * 5 + 1000) alert("Projection 3 failed"); } change(offset, 2000); for (var i = 0; i < n - 1; i++) { if (dests.at(i).value != i * 5 + 2000) alert("Projection 4 failed"); } } function change(v, newValue) { var edit = new EditConstraint(v, Strength.PREFERRED); var edits = new OrderedCollection(); edits.add(edit); var plan = planner.extractPlanFromConstraints(edits); for (var i = 0; i < 10; i++) { v.value = newValue; plan.execute(); } edit.destroyConstraint(); } // Global variable holding the current planner. var planner = null; function deltaBlue() { chainTest(100); projectionTest(100); } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/earley-boyer.js000066400000000000000000005751721211511573600243030ustar00rootroot00000000000000// This file is automatically generated by scheme2js, except for the // benchmark harness code at the beginning and end of the file. var EarleyBoyer = new BenchmarkSuite('EarleyBoyer', 666463, [ new Benchmark("Earley", function () { BgL_earleyzd2benchmarkzd2(); }), new Benchmark("Boyer", function () { BgL_nboyerzd2benchmarkzd2(); }) ]); /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /************* GENERATED FILE - DO NOT EDIT *************/ /* * To use write/prints/... the default-output port has to be set first. * Simply setting SC_DEFAULT_OUT and SC_ERROR_OUT to the desired values * should do the trick. * In the following example the std-out and error-port are redirected to * a DIV. function initRuntime() { function escapeHTML(s) { var tmp = s; tmp = tmp.replace(/&/g, "&"); tmp = tmp.replace(//g, ">"); tmp = tmp.replace(/ /g, " "); tmp = tmp.replace(/\n/g, "
"); tmp = tmp.replace(/\t/g, "    "); return tmp; } document.write("
"); SC_DEFAULT_OUT = new sc_GenericOutputPort( function(s) { var stdout = document.getElementById('stdout'); stdout.innerHTML = stdout.innerHTML + escapeHTML(s); }); SC_ERROR_OUT = SC_DEFAULT_OUT; } */ function sc_print_debug() { sc_print.apply(null, arguments); } /*** META ((export *js*)) */ var sc_JS_GLOBALS = this; var __sc_LINE=-1; var __sc_FILE=""; /*** META ((export #t)) */ function sc_alert() { var len = arguments.length; var s = ""; var i; for( i = 0; i < len; i++ ) { s += sc_toDisplayString(arguments[ i ]); } return alert( s ); } /*** META ((export #t)) */ function sc_typeof( x ) { return typeof x; } /*** META ((export #t)) */ function sc_error() { var a = [sc_jsstring2symbol("*error*")]; for (var i = 0; i < arguments.length; i++) { a[i+1] = arguments[i]; } throw a; } /*** META ((export #t) (peephole (prefix "throw "))) */ function sc_raise(obj) { throw obj; } /*** META ((export with-handler-lambda)) */ function sc_withHandlerLambda(handler, body) { try { return body(); } catch(e) { if (!e._internalException) return handler(e); else throw e; } } var sc_properties = new Object(); /*** META ((export #t)) */ function sc_putpropBang(sym, key, val) { var ht = sc_properties[sym]; if (!ht) { ht = new Object(); sc_properties[sym] = ht; } ht[key] = val; } /*** META ((export #t)) */ function sc_getprop(sym, key) { var ht = sc_properties[sym]; if (ht) { if (key in ht) return ht[key]; else return false; } else return false; } /*** META ((export #t)) */ function sc_rempropBang(sym, key) { var ht = sc_properties[sym]; if (ht) delete ht[key]; } /*** META ((export #t)) */ function sc_any2String(o) { return jsstring2string(sc_toDisplayString(o)); } /*** META ((export #t) (peephole (infix 2 2 "===")) (type bool)) */ function sc_isEqv(o1, o2) { return (o1 === o2); } /*** META ((export #t) (peephole (infix 2 2 "===")) (type bool)) */ function sc_isEq(o1, o2) { return (o1 === o2); } /*** META ((export #t) (type bool)) */ function sc_isNumber(n) { return (typeof n === "number"); } /*** META ((export #t) (type bool)) */ function sc_isComplex(n) { return sc_isNumber(n); } /*** META ((export #t) (type bool)) */ function sc_isReal(n) { return sc_isNumber(n); } /*** META ((export #t) (type bool)) */ function sc_isRational(n) { return sc_isReal(n); } /*** META ((export #t) (type bool)) */ function sc_isInteger(n) { return (parseInt(n) === n); } /*** META ((export #t) (type bool) (peephole (postfix ", false"))) */ // we don't have exact numbers... function sc_isExact(n) { return false; } /*** META ((export #t) (peephole (postfix ", true")) (type bool)) */ function sc_isInexact(n) { return true; } /*** META ((export = =fx =fl) (type bool) (peephole (infix 2 2 "==="))) */ function sc_equal(x) { for (var i = 1; i < arguments.length; i++) if (x !== arguments[i]) return false; return true; } /*** META ((export < = arguments[i]) return false; x = arguments[i]; } return true; } /*** META ((export > >fx >fl) (type bool) (peephole (infix 2 2 ">"))) */ function sc_greater(x, y) { for (var i = 1; i < arguments.length; i++) { if (x <= arguments[i]) return false; x = arguments[i]; } return true; } /*** META ((export <= <=fx <=fl) (type bool) (peephole (infix 2 2 "<="))) */ function sc_lessEqual(x, y) { for (var i = 1; i < arguments.length; i++) { if (x > arguments[i]) return false; x = arguments[i]; } return true; } /*** META ((export >= >=fl >=fx) (type bool) (peephole (infix 2 2 ">="))) */ function sc_greaterEqual(x, y) { for (var i = 1; i < arguments.length; i++) { if (x < arguments[i]) return false; x = arguments[i]; } return true; } /*** META ((export #t) (type bool) (peephole (postfix "=== 0"))) */ function sc_isZero(x) { return (x === 0); } /*** META ((export #t) (type bool) (peephole (postfix "> 0"))) */ function sc_isPositive(x) { return (x > 0); } /*** META ((export #t) (type bool) (peephole (postfix "< 0"))) */ function sc_isNegative(x) { return (x < 0); } /*** META ((export #t) (type bool) (peephole (postfix "%2===1"))) */ function sc_isOdd(x) { return (x % 2 === 1); } /*** META ((export #t) (type bool) (peephole (postfix "%2===0"))) */ function sc_isEven(x) { return (x % 2 === 0); } /*** META ((export #t)) */ var sc_max = Math.max; /*** META ((export #t)) */ var sc_min = Math.min; /*** META ((export + +fx +fl) (peephole (infix 0 #f "+" "0"))) */ function sc_plus() { var sum = 0; for (var i = 0; i < arguments.length; i++) sum += arguments[i]; return sum; } /*** META ((export * *fx *fl) (peephole (infix 0 #f "*" "1"))) */ function sc_multi() { var product = 1; for (var i = 0; i < arguments.length; i++) product *= arguments[i]; return product; } /*** META ((export - -fx -fl) (peephole (minus))) */ function sc_minus(x) { if (arguments.length === 1) return -x; else { var res = x; for (var i = 1; i < arguments.length; i++) res -= arguments[i]; return res; } } /*** META ((export / /fl) (peephole (div))) */ function sc_div(x) { if (arguments.length === 1) return 1/x; else { var res = x; for (var i = 1; i < arguments.length; i++) res /= arguments[i]; return res; } } /*** META ((export #t)) */ var sc_abs = Math.abs; /*** META ((export quotient /fx) (peephole (hole 2 "parseInt(" x "/" y ")"))) */ function sc_quotient(x, y) { return parseInt(x / y); } /*** META ((export #t) (peephole (infix 2 2 "%"))) */ function sc_remainder(x, y) { return x % y; } /*** META ((export #t) (peephole (modulo))) */ function sc_modulo(x, y) { var remainder = x % y; // if they don't have the same sign if ((remainder * y) < 0) return remainder + y; else return remainder; } function sc_euclid_gcd(a, b) { var temp; if (a === 0) return b; if (b === 0) return a; if (a < 0) {a = -a;}; if (b < 0) {b = -b;}; if (b > a) {temp = a; a = b; b = temp;}; while (true) { a %= b; if(a === 0) {return b;}; b %= a; if(b === 0) {return a;}; }; return b; } /*** META ((export #t)) */ function sc_gcd() { var gcd = 0; for (var i = 0; i < arguments.length; i++) gcd = sc_euclid_gcd(gcd, arguments[i]); return gcd; } /*** META ((export #t)) */ function sc_lcm() { var lcm = 1; for (var i = 0; i < arguments.length; i++) { var f = Math.round(arguments[i] / sc_euclid_gcd(arguments[i], lcm)); lcm *= Math.abs(f); } return lcm; } // LIMITATION: numerator and denominator don't make sense in floating point world. //var SC_MAX_DECIMALS = 1000000 // // function sc_numerator(x) { // var rounded = Math.round(x * SC_MAX_DECIMALS); // return Math.round(rounded / sc_euclid_gcd(rounded, SC_MAX_DECIMALS)); // } // function sc_denominator(x) { // var rounded = Math.round(x * SC_MAX_DECIMALS); // return Math.round(SC_MAX_DECIMALS / sc_euclid_gcd(rounded, SC_MAX_DECIMALS)); // } /*** META ((export #t)) */ var sc_floor = Math.floor; /*** META ((export #t)) */ var sc_ceiling = Math.ceil; /*** META ((export #t)) */ var sc_truncate = parseInt; /*** META ((export #t)) */ var sc_round = Math.round; // LIMITATION: sc_rationalize doesn't make sense in a floating point world. /*** META ((export #t)) */ var sc_exp = Math.exp; /*** META ((export #t)) */ var sc_log = Math.log; /*** META ((export #t)) */ var sc_sin = Math.sin; /*** META ((export #t)) */ var sc_cos = Math.cos; /*** META ((export #t)) */ var sc_tan = Math.tan; /*** META ((export #t)) */ var sc_asin = Math.asin; /*** META ((export #t)) */ var sc_acos = Math.acos; /*** META ((export #t)) */ var sc_atan = Math.atan; /*** META ((export #t)) */ var sc_sqrt = Math.sqrt; /*** META ((export #t)) */ var sc_expt = Math.pow; // LIMITATION: we don't have complex numbers. // LIMITATION: the following functions are hence not implemented. // LIMITATION: make-rectangular, make-polar, real-part, imag-part, magnitude, angle // LIMITATION: 2 argument atan /*** META ((export #t) (peephole (id))) */ function sc_exact2inexact(x) { return x; } /*** META ((export #t) (peephole (id))) */ function sc_inexact2exact(x) { return x; } function sc_number2jsstring(x, radix) { if (radix) return x.toString(radix); else return x.toString(); } function sc_jsstring2number(s, radix) { if (s === "") return false; if (radix) { var t = parseInt(s, radix); if (!t && t !== 0) return false; // verify that each char is in range. (parseInt ignores leading // white and trailing chars) var allowedChars = "01234567890abcdefghijklmnopqrstuvwxyz".substring(0, radix+1); if ((new RegExp("^["+allowedChars+"]*$", "i")).test(s)) return t; else return false; } else { var t = +s; // does not ignore trailing chars. if (!t && t !== 0) return false; // simply verify that first char is not whitespace. var c = s.charAt(0); // if +c is 0, but the char is not "0", then we have a whitespace. if (+c === 0 && c !== "0") return false; return t; } } /*** META ((export #t) (type bool) (peephole (not))) */ function sc_not(b) { return b === false; } /*** META ((export #t) (type bool)) */ function sc_isBoolean(b) { return (b === true) || (b === false); } function sc_Pair(car, cdr) { this.car = car; this.cdr = cdr; } sc_Pair.prototype.toString = function() { return sc_toDisplayString(this); }; sc_Pair.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) { var current = this; var res = "("; while(true) { res += writeOrDisplay(current.car); if (sc_isPair(current.cdr)) { res += " "; current = current.cdr; } else if (current.cdr !== null) { res += " . " + writeOrDisplay(current.cdr); break; } else // current.cdr == null break; } res += ")"; return res; }; sc_Pair.prototype.sc_toDisplayString = function() { return this.sc_toWriteOrDisplayString(sc_toDisplayString); }; sc_Pair.prototype.sc_toWriteString = function() { return this.sc_toWriteOrDisplayString(sc_toWriteString); }; // sc_Pair.prototype.sc_toWriteCircleString in IO.js /*** META ((export #t) (type bool) (peephole (postfix " instanceof sc_Pair"))) */ function sc_isPair(p) { return (p instanceof sc_Pair); } function sc_isPairEqual(p1, p2, comp) { return (comp(p1.car, p2.car) && comp(p1.cdr, p2.cdr)); } /*** META ((export #t) (peephole (hole 2 "new sc_Pair(" car ", " cdr ")"))) */ function sc_cons(car, cdr) { return new sc_Pair(car, cdr); } /*** META ((export cons*)) */ function sc_consStar() { var res = arguments[arguments.length - 1]; for (var i = arguments.length-2; i >= 0; i--) res = new sc_Pair(arguments[i], res); return res; } /*** META ((export #t) (peephole (postfix ".car"))) */ function sc_car(p) { return p.car; } /*** META ((export #t) (peephole (postfix ".cdr"))) */ function sc_cdr(p) { return p.cdr; } /*** META ((export #t) (peephole (hole 2 p ".car = " val))) */ function sc_setCarBang(p, val) { p.car = val; } /*** META ((export #t) (peephole (hole 2 p ".cdr = " val))) */ function sc_setCdrBang(p, val) { p.cdr = val; } /*** META ((export #t) (peephole (postfix ".car.car"))) */ function sc_caar(p) { return p.car.car; } /*** META ((export #t) (peephole (postfix ".cdr.car"))) */ function sc_cadr(p) { return p.cdr.car; } /*** META ((export #t) (peephole (postfix ".car.cdr"))) */ function sc_cdar(p) { return p.car.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.cdr"))) */ function sc_cddr(p) { return p.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".car.car.car"))) */ function sc_caaar(p) { return p.car.car.car; } /*** META ((export #t) (peephole (postfix ".car.cdr.car"))) */ function sc_cadar(p) { return p.car.cdr.car; } /*** META ((export #t) (peephole (postfix ".cdr.car.car"))) */ function sc_caadr(p) { return p.cdr.car.car; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.car"))) */ function sc_caddr(p) { return p.cdr.cdr.car; } /*** META ((export #t) (peephole (postfix ".car.car.cdr"))) */ function sc_cdaar(p) { return p.car.car.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.car.cdr"))) */ function sc_cdadr(p) { return p.cdr.car.cdr; } /*** META ((export #t) (peephole (postfix ".car.cdr.cdr"))) */ function sc_cddar(p) { return p.car.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.cdr"))) */ function sc_cdddr(p) { return p.cdr.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".car.car.car.car"))) */ function sc_caaaar(p) { return p.car.car.car.car; } /*** META ((export #t) (peephole (postfix ".car.cdr.car.car"))) */ function sc_caadar(p) { return p.car.cdr.car.car; } /*** META ((export #t) (peephole (postfix ".cdr.car.car.car"))) */ function sc_caaadr(p) { return p.cdr.car.car.car; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.car.car"))) */ function sc_caaddr(p) { return p.cdr.cdr.car.car; } /*** META ((export #t) (peephole (postfix ".car.car.car.cdr"))) */ function sc_cdaaar(p) { return p.car.car.car.cdr; } /*** META ((export #t) (peephole (postfix ".car.cdr.car.cdr"))) */ function sc_cdadar(p) { return p.car.cdr.car.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.car.car.cdr"))) */ function sc_cdaadr(p) { return p.cdr.car.car.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.car.cdr"))) */ function sc_cdaddr(p) { return p.cdr.cdr.car.cdr; } /*** META ((export #t) (peephole (postfix ".car.car.cdr.car"))) */ function sc_cadaar(p) { return p.car.car.cdr.car; } /*** META ((export #t) (peephole (postfix ".car.cdr.cdr.car"))) */ function sc_caddar(p) { return p.car.cdr.cdr.car; } /*** META ((export #t) (peephole (postfix ".cdr.car.cdr.car"))) */ function sc_cadadr(p) { return p.cdr.car.cdr.car; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.cdr.car"))) */ function sc_cadddr(p) { return p.cdr.cdr.cdr.car; } /*** META ((export #t) (peephole (postfix ".car.car.cdr.cdr"))) */ function sc_cddaar(p) { return p.car.car.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".car.cdr.cdr.cdr"))) */ function sc_cdddar(p) { return p.car.cdr.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.car.cdr.cdr"))) */ function sc_cddadr(p) { return p.cdr.car.cdr.cdr; } /*** META ((export #t) (peephole (postfix ".cdr.cdr.cdr.cdr"))) */ function sc_cddddr(p) { return p.cdr.cdr.cdr.cdr; } /*** META ((export #t)) */ function sc_lastPair(l) { if (!sc_isPair(l)) sc_error("sc_lastPair: pair expected"); var res = l; var cdr = l.cdr; while (sc_isPair(cdr)) { res = cdr; cdr = res.cdr; } return res; } /*** META ((export #t) (type bool) (peephole (postfix " === null"))) */ function sc_isNull(o) { return (o === null); } /*** META ((export #t) (type bool)) */ function sc_isList(o) { var rabbit; var turtle; var rabbit = o; var turtle = o; while (true) { if (rabbit === null || (rabbit instanceof sc_Pair && rabbit.cdr === null)) return true; // end of list else if ((rabbit instanceof sc_Pair) && (rabbit.cdr instanceof sc_Pair)) { rabbit = rabbit.cdr.cdr; turtle = turtle.cdr; if (rabbit === turtle) return false; // cycle } else return false; // not pair } } /*** META ((export #t)) */ function sc_list() { var res = null; var a = arguments; for (var i = a.length-1; i >= 0; i--) res = new sc_Pair(a[i], res); return res; } /*** META ((export #t)) */ function sc_iota(num, init) { var res = null; if (!init) init = 0; for (var i = num - 1; i >= 0; i--) res = new sc_Pair(i + init, res); return res; } /*** META ((export #t)) */ function sc_makeList(nbEls, fill) { var res = null; for (var i = 0; i < nbEls; i++) res = new sc_Pair(fill, res); return res; } /*** META ((export #t)) */ function sc_length(l) { var res = 0; while (l !== null) { res++; l = l.cdr; } return res; } /*** META ((export #t)) */ function sc_remq(o, l) { var dummy = { cdr : null }; var tail = dummy; while (l !== null) { if (l.car !== o) { tail.cdr = sc_cons(l.car, null); tail = tail.cdr; } l = l.cdr; } return dummy.cdr; } /*** META ((export #t)) */ function sc_remqBang(o, l) { var dummy = { cdr : null }; var tail = dummy; var needsAssig = true; while (l !== null) { if (l.car === o) { needsAssig = true; } else { if (needsAssig) { tail.cdr = l; needsAssig = false; } tail = l; } l = l.cdr; } tail.cdr = null; return dummy.cdr; } /*** META ((export #t)) */ function sc_delete(o, l) { var dummy = { cdr : null }; var tail = dummy; while (l !== null) { if (!sc_isEqual(l.car, o)) { tail.cdr = sc_cons(l.car, null); tail = tail.cdr; } l = l.cdr; } return dummy.cdr; } /*** META ((export #t)) */ function sc_deleteBang(o, l) { var dummy = { cdr : null }; var tail = dummy; var needsAssig = true; while (l !== null) { if (sc_isEqual(l.car, o)) { needsAssig = true; } else { if (needsAssig) { tail.cdr = l; needsAssig = false; } tail = l; } l = l.cdr; } tail.cdr = null; return dummy.cdr; } function sc_reverseAppendBang(l1, l2) { var res = l2; while (l1 !== null) { var tmp = res; res = l1; l1 = l1.cdr; res.cdr = tmp; } return res; } function sc_dualAppend(l1, l2) { if (l1 === null) return l2; if (l2 === null) return l1; var rev = sc_reverse(l1); return sc_reverseAppendBang(rev, l2); } /*** META ((export #t)) */ function sc_append() { if (arguments.length === 0) return null; var res = arguments[arguments.length - 1]; for (var i = arguments.length - 2; i >= 0; i--) res = sc_dualAppend(arguments[i], res); return res; } function sc_dualAppendBang(l1, l2) { if (l1 === null) return l2; if (l2 === null) return l1; var tmp = l1; while (tmp.cdr !== null) tmp=tmp.cdr; tmp.cdr = l2; return l1; } /*** META ((export #t)) */ function sc_appendBang() { var res = null; for (var i = 0; i < arguments.length; i++) res = sc_dualAppendBang(res, arguments[i]); return res; } /*** META ((export #t)) */ function sc_reverse(l1) { var res = null; while (l1 !== null) { res = sc_cons(l1.car, res); l1 = l1.cdr; } return res; } /*** META ((export #t)) */ function sc_reverseBang(l) { return sc_reverseAppendBang(l, null); } /*** META ((export #t)) */ function sc_listTail(l, k) { var res = l; for (var i = 0; i < k; i++) { res = res.cdr; } return res; } /*** META ((export #t)) */ function sc_listRef(l, k) { return sc_listTail(l, k).car; } /* // unoptimized generic versions function sc_memX(o, l, comp) { while (l != null) { if (comp(l.car, o)) return l; l = l.cdr; } return false; } function sc_memq(o, l) { return sc_memX(o, l, sc_isEq); } function sc_memv(o, l) { return sc_memX(o, l, sc_isEqv); } function sc_member(o, l) { return sc_memX(o, l, sc_isEqual); } */ /* optimized versions */ /*** META ((export #t)) */ function sc_memq(o, l) { while (l !== null) { if (l.car === o) return l; l = l.cdr; } return false; } /*** META ((export #t)) */ function sc_memv(o, l) { while (l !== null) { if (l.car === o) return l; l = l.cdr; } return false; } /*** META ((export #t)) */ function sc_member(o, l) { while (l !== null) { if (sc_isEqual(l.car,o)) return l; l = l.cdr; } return false; } /* // generic unoptimized versions function sc_assX(o, al, comp) { while (al != null) { if (comp(al.car.car, o)) return al.car; al = al.cdr; } return false; } function sc_assq(o, al) { return sc_assX(o, al, sc_isEq); } function sc_assv(o, al) { return sc_assX(o, al, sc_isEqv); } function sc_assoc(o, al) { return sc_assX(o, al, sc_isEqual); } */ // optimized versions /*** META ((export #t)) */ function sc_assq(o, al) { while (al !== null) { if (al.car.car === o) return al.car; al = al.cdr; } return false; } /*** META ((export #t)) */ function sc_assv(o, al) { while (al !== null) { if (al.car.car === o) return al.car; al = al.cdr; } return false; } /*** META ((export #t)) */ function sc_assoc(o, al) { while (al !== null) { if (sc_isEqual(al.car.car, o)) return al.car; al = al.cdr; } return false; } /* can be used for mutable strings and characters */ function sc_isCharStringEqual(cs1, cs2) { return cs1.val === cs2.val; } function sc_isCharStringLess(cs1, cs2) { return cs1.val < cs2.val; } function sc_isCharStringGreater(cs1, cs2) { return cs1.val > cs2.val; } function sc_isCharStringLessEqual(cs1, cs2) { return cs1.val <= cs2.val; } function sc_isCharStringGreaterEqual(cs1, cs2) { return cs1.val >= cs2.val; } function sc_isCharStringCIEqual(cs1, cs2) { return cs1.val.toLowerCase() === cs2.val.toLowerCase(); } function sc_isCharStringCILess(cs1, cs2) { return cs1.val.toLowerCase() < cs2.val.toLowerCase(); } function sc_isCharStringCIGreater(cs1, cs2) { return cs1.val.toLowerCase() > cs2.val.toLowerCase(); } function sc_isCharStringCILessEqual(cs1, cs2) { return cs1.val.toLowerCase() <= cs2.val.toLowerCase(); } function sc_isCharStringCIGreaterEqual(cs1, cs2) { return cs1.val.toLowerCase() >= cs2.val.toLowerCase(); } function sc_Char(c) { var cached = sc_Char.lazy[c]; if (cached) return cached; this.val = c; sc_Char.lazy[c] = this; // add return, so FF does not complain. return undefined; } sc_Char.lazy = new Object(); // thanks to Eric sc_Char.char2readable = { "\000": "#\\null", "\007": "#\\bell", "\010": "#\\backspace", "\011": "#\\tab", "\012": "#\\newline", "\014": "#\\page", "\015": "#\\return", "\033": "#\\escape", "\040": "#\\space", "\177": "#\\delete", /* poeticless names */ "\001": "#\\soh", "\002": "#\\stx", "\003": "#\\etx", "\004": "#\\eot", "\005": "#\\enq", "\006": "#\\ack", "\013": "#\\vt", "\016": "#\\so", "\017": "#\\si", "\020": "#\\dle", "\021": "#\\dc1", "\022": "#\\dc2", "\023": "#\\dc3", "\024": "#\\dc4", "\025": "#\\nak", "\026": "#\\syn", "\027": "#\\etb", "\030": "#\\can", "\031": "#\\em", "\032": "#\\sub", "\033": "#\\esc", "\034": "#\\fs", "\035": "#\\gs", "\036": "#\\rs", "\037": "#\\us"}; sc_Char.readable2char = { "null": "\000", "bell": "\007", "backspace": "\010", "tab": "\011", "newline": "\012", "page": "\014", "return": "\015", "escape": "\033", "space": "\040", "delete": "\000", "soh": "\001", "stx": "\002", "etx": "\003", "eot": "\004", "enq": "\005", "ack": "\006", "bel": "\007", "bs": "\010", "ht": "\011", "nl": "\012", "vt": "\013", "np": "\014", "cr": "\015", "so": "\016", "si": "\017", "dle": "\020", "dc1": "\021", "dc2": "\022", "dc3": "\023", "dc4": "\024", "nak": "\025", "syn": "\026", "etb": "\027", "can": "\030", "em": "\031", "sub": "\032", "esc": "\033", "fs": "\034", "gs": "\035", "rs": "\036", "us": "\037", "sp": "\040", "del": "\177"}; sc_Char.prototype.toString = function() { return this.val; }; // sc_toDisplayString == toString sc_Char.prototype.sc_toWriteString = function() { var entry = sc_Char.char2readable[this.val]; if (entry) return entry; else return "#\\" + this.val; }; /*** META ((export #t) (type bool) (peephole (postfix "instanceof sc_Char"))) */ function sc_isChar(c) { return (c instanceof sc_Char); } /*** META ((export char=?) (type bool) (peephole (hole 2 c1 ".val === " c2 ".val"))) */ var sc_isCharEqual = sc_isCharStringEqual; /*** META ((export char?) (type bool) (peephole (hole 2 c1 ".val > " c2 ".val"))) */ var sc_isCharGreater = sc_isCharStringGreater; /*** META ((export char<=?) (type bool) (peephole (hole 2 c1 ".val <= " c2 ".val"))) */ var sc_isCharLessEqual = sc_isCharStringLessEqual; /*** META ((export char>=?) (type bool) (peephole (hole 2 c1 ".val >= " c2 ".val"))) */ var sc_isCharGreaterEqual = sc_isCharStringGreaterEqual; /*** META ((export char-ci=?) (type bool) (peephole (hole 2 c1 ".val.toLowerCase() === " c2 ".val.toLowerCase()"))) */ var sc_isCharCIEqual = sc_isCharStringCIEqual; /*** META ((export char-ci?) (type bool) (peephole (hole 2 c1 ".val.toLowerCase() > " c2 ".val.toLowerCase()"))) */ var sc_isCharCIGreater = sc_isCharStringCIGreater; /*** META ((export char-ci<=?) (type bool) (peephole (hole 2 c1 ".val.toLowerCase() <= " c2 ".val.toLowerCase()"))) */ var sc_isCharCILessEqual = sc_isCharStringCILessEqual; /*** META ((export char-ci>=?) (type bool) (peephole (hole 2 c1 ".val.toLowerCase() >= " c2 ".val.toLowerCase()"))) */ var sc_isCharCIGreaterEqual = sc_isCharStringCIGreaterEqual; var SC_NUMBER_CLASS = "0123456789"; var SC_WHITESPACE_CLASS = ' \r\n\t\f'; var SC_LOWER_CLASS = 'abcdefghijklmnopqrstuvwxyz'; var SC_UPPER_CLASS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; function sc_isCharOfClass(c, cl) { return (cl.indexOf(c) != -1); } /*** META ((export #t) (type bool)) */ function sc_isCharAlphabetic(c) { return sc_isCharOfClass(c.val, SC_LOWER_CLASS) || sc_isCharOfClass(c.val, SC_UPPER_CLASS); } /*** META ((export #t) (type bool) (peephole (hole 1 "SC_NUMBER_CLASS.indexOf(" c ".val) != -1"))) */ function sc_isCharNumeric(c) { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); } /*** META ((export #t) (type bool)) */ function sc_isCharWhitespace(c) { var tmp = c.val; return tmp === " " || tmp === "\r" || tmp === "\n" || tmp === "\t" || tmp === "\f"; } /*** META ((export #t) (type bool) (peephole (hole 1 "SC_UPPER_CLASS.indexOf(" c ".val) != -1"))) */ function sc_isCharUpperCase(c) { return sc_isCharOfClass(c.val, SC_UPPER_CLASS); } /*** META ((export #t) (type bool) (peephole (hole 1 "SC_LOWER_CLASS.indexOf(" c ".val) != -1"))) */ function sc_isCharLowerCase(c) { return sc_isCharOfClass(c.val, SC_LOWER_CLASS); } /*** META ((export #t) (peephole (postfix ".val.charCodeAt(0)"))) */ function sc_char2integer(c) { return c.val.charCodeAt(0); } /*** META ((export #t) (peephole (hole 1 "new sc_Char(String.fromCharCode(" n "))"))) */ function sc_integer2char(n) { return new sc_Char(String.fromCharCode(n)); } /*** META ((export #t) (peephole (hole 1 "new sc_Char(" c ".val.toUpperCase())"))) */ function sc_charUpcase(c) { return new sc_Char(c.val.toUpperCase()); } /*** META ((export #t) (peephole (hole 1 "new sc_Char(" c ".val.toLowerCase())"))) */ function sc_charDowncase(c) { return new sc_Char(c.val.toLowerCase()); } function sc_makeJSStringOfLength(k, c) { var fill; if (c === undefined) fill = " "; else fill = c; var res = ""; var len = 1; // every round doubles the size of fill. while (k >= len) { if (k & len) res = res.concat(fill); fill = fill.concat(fill); len *= 2; } return res; } function sc_makejsString(k, c) { var fill; if (c) fill = c.val; else fill = " "; return sc_makeJSStringOfLength(k, fill); } function sc_jsstring2list(s) { var res = null; for (var i = s.length - 1; i >= 0; i--) res = sc_cons(new sc_Char(s.charAt(i)), res); return res; } function sc_list2jsstring(l) { var a = new Array(); while(l !== null) { a.push(l.car.val); l = l.cdr; } return "".concat.apply("", a); } var sc_Vector = Array; sc_Vector.prototype.sc_toWriteOrDisplayString = function(writeOrDisplay) { if (this.length === 0) return "#()"; var res = "#(" + writeOrDisplay(this[0]); for (var i = 1; i < this.length; i++) res += " " + writeOrDisplay(this[i]); res += ")"; return res; }; sc_Vector.prototype.sc_toDisplayString = function() { return this.sc_toWriteOrDisplayString(sc_toDisplayString); }; sc_Vector.prototype.sc_toWriteString = function() { return this.sc_toWriteOrDisplayString(sc_toWriteString); }; /*** META ((export vector? array?) (type bool) (peephole (postfix " instanceof sc_Vector"))) */ function sc_isVector(v) { return (v instanceof sc_Vector); } // only applies to vectors function sc_isVectorEqual(v1, v2, comp) { if (v1.length !== v2.length) return false; for (var i = 0; i < v1.length; i++) if (!comp(v1[i], v2[i])) return false; return true; } /*** META ((export make-vector make-array)) */ function sc_makeVector(size, fill) { var a = new sc_Vector(size); if (fill !== undefined) sc_vectorFillBang(a, fill); return a; } /*** META ((export vector array) (peephole (vector))) */ function sc_vector() { var a = new sc_Vector(); for (var i = 0; i < arguments.length; i++) a.push(arguments[i]); return a; } /*** META ((export vector-length array-length) (peephole (postfix ".length"))) */ function sc_vectorLength(v) { return v.length; } /*** META ((export vector-ref array-ref) (peephole (hole 2 v "[" pos "]"))) */ function sc_vectorRef(v, pos) { return v[pos]; } /*** META ((export vector-set! array-set!) (peephole (hole 3 v "[" pos "] = " val))) */ function sc_vectorSetBang(v, pos, val) { v[pos] = val; } /*** META ((export vector->list array->list)) */ function sc_vector2list(a) { var res = null; for (var i = a.length-1; i >= 0; i--) res = sc_cons(a[i], res); return res; } /*** META ((export list->vector list->array)) */ function sc_list2vector(l) { var a = new sc_Vector(); while(l !== null) { a.push(l.car); l = l.cdr; } return a; } /*** META ((export vector-fill! array-fill!)) */ function sc_vectorFillBang(a, fill) { for (var i = 0; i < a.length; i++) a[i] = fill; } /*** META ((export #t)) */ function sc_copyVector(a, len) { if (len <= a.length) return a.slice(0, len); else { var tmp = a.concat(); tmp.length = len; return tmp; } } /*** META ((export #t) (peephole (hole 3 a ".slice(" start "," end ")"))) */ function sc_vectorCopy(a, start, end) { return a.slice(start, end); } /*** META ((export #t)) */ function sc_vectorCopyBang(target, tstart, source, sstart, send) { if (!sstart) sstart = 0; if (!send) send = source.length; // if target == source we don't want to overwrite not yet copied elements. if (tstart <= sstart) { for (var i = tstart, j = sstart; j < send; i++, j++) { target[i] = source[j]; } } else { var diff = send - sstart; for (var i = tstart + diff - 1, j = send - 1; j >= sstart; i--, j--) { target[i] = source[j]; } } return target; } /*** META ((export #t) (type bool) (peephole (hole 1 "typeof " o " === 'function'"))) */ function sc_isProcedure(o) { return (typeof o === "function"); } /*** META ((export #t)) */ function sc_apply(proc) { var args = new Array(); // first part of arguments are not in list-form. for (var i = 1; i < arguments.length - 1; i++) args.push(arguments[i]); var l = arguments[arguments.length - 1]; while (l !== null) { args.push(l.car); l = l.cdr; } return proc.apply(null, args); } /*** META ((export #t)) */ function sc_map(proc, l1) { if (l1 === undefined) return null; // else var nbApplyArgs = arguments.length - 1; var applyArgs = new Array(nbApplyArgs); var revres = null; while (l1 !== null) { for (var i = 0; i < nbApplyArgs; i++) { applyArgs[i] = arguments[i + 1].car; arguments[i + 1] = arguments[i + 1].cdr; } revres = sc_cons(proc.apply(null, applyArgs), revres); } return sc_reverseAppendBang(revres, null); } /*** META ((export #t)) */ function sc_mapBang(proc, l1) { if (l1 === undefined) return null; // else var l1_orig = l1; var nbApplyArgs = arguments.length - 1; var applyArgs = new Array(nbApplyArgs); while (l1 !== null) { var tmp = l1; for (var i = 0; i < nbApplyArgs; i++) { applyArgs[i] = arguments[i + 1].car; arguments[i + 1] = arguments[i + 1].cdr; } tmp.car = proc.apply(null, applyArgs); } return l1_orig; } /*** META ((export #t)) */ function sc_forEach(proc, l1) { if (l1 === undefined) return undefined; // else var nbApplyArgs = arguments.length - 1; var applyArgs = new Array(nbApplyArgs); while (l1 !== null) { for (var i = 0; i < nbApplyArgs; i++) { applyArgs[i] = arguments[i + 1].car; arguments[i + 1] = arguments[i + 1].cdr; } proc.apply(null, applyArgs); } // add return so FF does not complain. return undefined; } /*** META ((export #t)) */ function sc_filter(proc, l1) { var dummy = { cdr : null }; var tail = dummy; while (l1 !== null) { if (proc(l1.car) !== false) { tail.cdr = sc_cons(l1.car, null); tail = tail.cdr; } l1 = l1.cdr; } return dummy.cdr; } /*** META ((export #t)) */ function sc_filterBang(proc, l1) { var head = sc_cons("dummy", l1); var it = head; var next = l1; while (next !== null) { if (proc(next.car) !== false) { it.cdr = next it = next; } next = next.cdr; } it.cdr = null; return head.cdr; } function sc_filterMap1(proc, l1) { var revres = null; while (l1 !== null) { var tmp = proc(l1.car) if (tmp !== false) revres = sc_cons(tmp, revres); l1 = l1.cdr; } return sc_reverseAppendBang(revres, null); } function sc_filterMap2(proc, l1, l2) { var revres = null; while (l1 !== null) { var tmp = proc(l1.car, l2.car); if(tmp !== false) revres = sc_cons(tmp, revres); l1 = l1.cdr; l2 = l2.cdr } return sc_reverseAppendBang(revres, null); } /*** META ((export #t)) */ function sc_filterMap(proc, l1, l2, l3) { if (l2 === undefined) return sc_filterMap1(proc, l1); else if (l3 === undefined) return sc_filterMap2(proc, l1, l2); // else var nbApplyArgs = arguments.length - 1; var applyArgs = new Array(nbApplyArgs); var revres = null; while (l1 !== null) { for (var i = 0; i < nbApplyArgs; i++) { applyArgs[i] = arguments[i + 1].car; arguments[i + 1] = arguments[i + 1].cdr; } var tmp = proc.apply(null, applyArgs); if(tmp !== false) revres = sc_cons(tmp, revres); } return sc_reverseAppendBang(revres, null); } /*** META ((export #t)) */ function sc_any(proc, l) { var revres = null; while (l !== null) { var tmp = proc(l.car); if(tmp !== false) return tmp; l = l.cdr; } return false; } /*** META ((export any?) (peephole (hole 2 "sc_any(" proc "," l ") !== false"))) */ function sc_anyPred(proc, l) { return sc_any(proc, l)!== false; } /*** META ((export #t)) */ function sc_every(proc, l) { var revres = null; var tmp = true; while (l !== null) { tmp = proc(l.car); if (tmp === false) return false; l = l.cdr; } return tmp; } /*** META ((export every?) (peephole (hole 2 "sc_every(" proc "," l ") !== false"))) */ function sc_everyPred(proc, l) { var tmp = sc_every(proc, l); if (tmp !== false) return true; return false; } /*** META ((export #t) (peephole (postfix "()"))) */ function sc_force(o) { return o(); } /*** META ((export #t)) */ function sc_makePromise(proc) { var isResultReady = false; var result = undefined; return function() { if (!isResultReady) { var tmp = proc(); if (!isResultReady) { isResultReady = true; result = tmp; } } return result; }; } function sc_Values(values) { this.values = values; } /*** META ((export #t) (peephole (values))) */ function sc_values() { if (arguments.length === 1) return arguments[0]; else return new sc_Values(arguments); } /*** META ((export #t)) */ function sc_callWithValues(producer, consumer) { var produced = producer(); if (produced instanceof sc_Values) return consumer.apply(null, produced.values); else return consumer(produced); } /*** META ((export #t)) */ function sc_dynamicWind(before, thunk, after) { before(); try { var res = thunk(); return res; } finally { after(); } } // TODO: eval/scheme-report-environment/null-environment/interaction-environment // LIMITATION: 'load' doesn't exist without files. // LIMITATION: transcript-on/transcript-off doesn't exist without files. function sc_Struct(name) { this.name = name; } sc_Struct.prototype.sc_toDisplayString = function() { return "#"; }; sc_Struct.prototype.sc_toWriteString = sc_Struct.prototype.sc_toDisplayString; /*** META ((export #t) (peephole (hole 1 "new sc_Struct(" name ")"))) */ function sc_makeStruct(name) { return new sc_Struct(name); } /*** META ((export #t) (type bool) (peephole (postfix " instanceof sc_Struct"))) */ function sc_isStruct(o) { return (o instanceof sc_Struct); } /*** META ((export #t) (type bool) (peephole (hole 2 "(" 1 " instanceof sc_Struct) && ( " 1 ".name === " 0 ")"))) */ function sc_isStructNamed(name, s) { return ((s instanceof sc_Struct) && (s.name === name)); } /*** META ((export struct-field) (peephole (hole 3 0 "[" 2 "]"))) */ function sc_getStructField(s, name, field) { return s[field]; } /*** META ((export struct-field-set!) (peephole (hole 4 0 "[" 2 "] = " 3))) */ function sc_setStructFieldBang(s, name, field, val) { s[field] = val; } /*** META ((export #t) (peephole (prefix "~"))) */ function sc_bitNot(x) { return ~x; } /*** META ((export #t) (peephole (infix 2 2 "&"))) */ function sc_bitAnd(x, y) { return x & y; } /*** META ((export #t) (peephole (infix 2 2 "|"))) */ function sc_bitOr(x, y) { return x | y; } /*** META ((export #t) (peephole (infix 2 2 "^"))) */ function sc_bitXor(x, y) { return x ^ y; } /*** META ((export #t) (peephole (infix 2 2 "<<"))) */ function sc_bitLsh(x, y) { return x << y; } /*** META ((export #t) (peephole (infix 2 2 ">>"))) */ function sc_bitRsh(x, y) { return x >> y; } /*** META ((export #t) (peephole (infix 2 2 ">>>"))) */ function sc_bitUrsh(x, y) { return x >>> y; } /*** META ((export js-field js-property) (peephole (hole 2 o "[" field "]"))) */ function sc_jsField(o, field) { return o[field]; } /*** META ((export js-field-set! js-property-set!) (peephole (hole 3 o "[" field "] = " val))) */ function sc_setJsFieldBang(o, field, val) { return o[field] = val; } /*** META ((export js-field-delete! js-property-delete!) (peephole (hole 2 "delete" o "[" field "]"))) */ function sc_deleteJsFieldBang(o, field) { delete o[field]; } /*** META ((export #t) (peephole (jsCall))) */ function sc_jsCall(o, fun) { var args = new Array(); for (var i = 2; i < arguments.length; i++) args[i-2] = arguments[i]; return fun.apply(o, args); } /*** META ((export #t) (peephole (jsMethodCall))) */ function sc_jsMethodCall(o, field) { var args = new Array(); for (var i = 2; i < arguments.length; i++) args[i-2] = arguments[i]; return o[field].apply(o, args); } /*** META ((export new js-new) (peephole (jsNew))) */ function sc_jsNew(c) { var evalStr = "new c("; evalStr +=arguments.length > 1? "arguments[1]": ""; for (var i = 2; i < arguments.length; i++) evalStr += ", arguments[" + i + "]"; evalStr +=")"; return eval(evalStr); } // ======================== RegExp ==================== /*** META ((export #t)) */ function sc_pregexp(re) { return new RegExp(sc_string2jsstring(re)); } /*** META ((export #t)) */ function sc_pregexpMatch(re, s) { var reg = (re instanceof RegExp) ? re : sc_pregexp(re); var tmp = reg.exec(sc_string2jsstring(s)); if (tmp == null) return false; var res = null; for (var i = tmp.length-1; i >= 0; i--) { if (tmp[i] !== null) { res = sc_cons(sc_jsstring2string(tmp[i]), res); } else { res = sc_cons(false, res); } } return res; } /*** META ((export #t)) */ function sc_pregexpReplace(re, s1, s2) { var reg; var jss1 = sc_string2jsstring(s1); var jss2 = sc_string2jsstring(s2); if (re instanceof RegExp) { if (re.global) reg = re; else reg = new RegExp(re.source); } else { reg = new RegExp(sc_string2jsstring(re)); } return jss1.replace(reg, jss2); } /*** META ((export pregexp-replace*)) */ function sc_pregexpReplaceAll(re, s1, s2) { var reg; var jss1 = sc_string2jsstring(s1); var jss2 = sc_string2jsstring(s2); if (re instanceof RegExp) { if (re.global) reg = re; else reg = new RegExp(re.source, "g"); } else { reg = new RegExp(sc_string2jsstring(re), "g"); } return jss1.replace(reg, jss2); } /*** META ((export #t)) */ function sc_pregexpSplit(re, s) { var reg = ((re instanceof RegExp) ? re : new RegExp(sc_string2jsstring(re))); var jss = sc_string2jsstring(s); var tmp = jss.split(reg); if (tmp == null) return false; return sc_vector2list(tmp); } /* =========================================================================== */ /* Other library stuff */ /* =========================================================================== */ /*** META ((export #t) (peephole (hole 1 "Math.floor(Math.random()*" 'n ")"))) */ function sc_random(n) { return Math.floor(Math.random()*n); } /*** META ((export current-date) (peephole (hole 0 "new Date()"))) */ function sc_currentDate() { return new Date(); } function sc_Hashtable() { } sc_Hashtable.prototype.toString = function() { return "#{%hashtable}"; }; // sc_toWriteString == sc_toDisplayString == toString function sc_HashtableElement(key, val) { this.key = key; this.val = val; } /*** META ((export #t) (peephole (hole 0 "new sc_Hashtable()"))) */ function sc_makeHashtable() { return new sc_Hashtable(); } /*** META ((export #t)) */ function sc_hashtablePutBang(ht, key, val) { var hash = sc_hash(key); ht[hash] = new sc_HashtableElement(key, val); } /*** META ((export #t)) */ function sc_hashtableGet(ht, key) { var hash = sc_hash(key); if (hash in ht) return ht[hash].val; else return false; } /*** META ((export #t)) */ function sc_hashtableForEach(ht, f) { for (var v in ht) { if (ht[v] instanceof sc_HashtableElement) f(ht[v].key, ht[v].val); } } /*** META ((export hashtable-contains?) (peephole (hole 2 "sc_hash(" 1 ") in " 0))) */ function sc_hashtableContains(ht, key) { var hash = sc_hash(key); if (hash in ht) return true; else return false; } var SC_HASH_COUNTER = 0; function sc_hash(o) { if (o === null) return "null"; else if (o === undefined) return "undefined"; else if (o === true) return "true"; else if (o === false) return "false"; else if (typeof o === "number") return "num-" + o; else if (typeof o === "string") return "jsstr-" + o; else if (o.sc_getHash) return o.sc_getHash(); else return sc_counterHash.call(o); } function sc_counterHash() { if (!this.sc_hash) { this.sc_hash = "hash-" + SC_HASH_COUNTER; SC_HASH_COUNTER++; } return this.sc_hash; } function sc_Trampoline(args, maxTailCalls) { this['__trampoline return__'] = true; this.args = args; this.MAX_TAIL_CALLs = maxTailCalls; } // TODO: call/cc stuff sc_Trampoline.prototype.restart = function() { var o = this; while (true) { // set both globals. SC_TAIL_OBJECT.calls = o.MAX_TAIL_CALLs-1; var fun = o.args.callee; var res = fun.apply(SC_TAIL_OBJECT, o.args); if (res instanceof sc_Trampoline) o = res; else return res; } } /*** META ((export bind-exit-lambda)) */ function sc_bindExitLambda(proc) { var escape_obj = new sc_BindExitException(); var escape = function(res) { escape_obj.res = res; throw escape_obj; }; try { return proc(escape); } catch(e) { if (e === escape_obj) { return e.res; } throw e; } } function sc_BindExitException() { this._internalException = true; } var SC_SCM2JS_GLOBALS = new Object(); // default tail-call depth. // normally the program should set it again. but just in case... var SC_TAIL_OBJECT = new Object(); SC_SCM2JS_GLOBALS.TAIL_OBJECT = SC_TAIL_OBJECT; // ======================== I/O ======================= /*------------------------------------------------------------------*/ function sc_EOF() { } var SC_EOF_OBJECT = new sc_EOF(); function sc_Port() { } /* --------------- Input ports -------------------------------------*/ function sc_InputPort() { } sc_InputPort.prototype = new sc_Port(); sc_InputPort.prototype.peekChar = function() { if (!("peeked" in this)) this.peeked = this.getNextChar(); return this.peeked; } sc_InputPort.prototype.readChar = function() { var tmp = this.peekChar(); delete this.peeked; return tmp; } sc_InputPort.prototype.isCharReady = function() { return true; } sc_InputPort.prototype.close = function() { // do nothing } /* .............. String port ..........................*/ function sc_ErrorInputPort() { }; sc_ErrorInputPort.prototype = new sc_InputPort(); sc_ErrorInputPort.prototype.getNextChar = function() { throw "can't read from error-port."; }; sc_ErrorInputPort.prototype.isCharReady = function() { return false; }; /* .............. String port ..........................*/ function sc_StringInputPort(jsStr) { // we are going to do some charAts on the str. // instead of recreating all the time a String-object, we // create one in the beginning. (not sure, if this is really an optim) this.str = new String(jsStr); this.pos = 0; } sc_StringInputPort.prototype = new sc_InputPort(); sc_StringInputPort.prototype.getNextChar = function() { if (this.pos >= this.str.length) return SC_EOF_OBJECT; return this.str.charAt(this.pos++); }; /* ------------- Read and other lib-funs -------------------------------*/ function sc_Token(type, val, pos) { this.type = type; this.val = val; this.pos = pos; } sc_Token.EOF = 0/*EOF*/; sc_Token.OPEN_PAR = 1/*OPEN_PAR*/; sc_Token.CLOSE_PAR = 2/*CLOSE_PAR*/; sc_Token.OPEN_BRACE = 3/*OPEN_BRACE*/; sc_Token.CLOSE_BRACE = 4/*CLOSE_BRACE*/; sc_Token.OPEN_BRACKET = 5/*OPEN_BRACKET*/; sc_Token.CLOSE_BRACKET = 6/*CLOSE_BRACKET*/; sc_Token.WHITESPACE = 7/*WHITESPACE*/; sc_Token.QUOTE = 8/*QUOTE*/; sc_Token.ID = 9/*ID*/; sc_Token.DOT = 10/*DOT*/; sc_Token.STRING = 11/*STRING*/; sc_Token.NUMBER = 12/*NUMBER*/; sc_Token.ERROR = 13/*ERROR*/; sc_Token.VECTOR_BEGIN = 14/*VECTOR_BEGIN*/; sc_Token.TRUE = 15/*TRUE*/; sc_Token.FALSE = 16/*FALSE*/; sc_Token.UNSPECIFIED = 17/*UNSPECIFIED*/; sc_Token.REFERENCE = 18/*REFERENCE*/; sc_Token.STORE = 19/*STORE*/; sc_Token.CHAR = 20/*CHAR*/; var SC_ID_CLASS = SC_LOWER_CLASS + SC_UPPER_CLASS + "!$%*+-./:<=>?@^_~"; function sc_Tokenizer(port) { this.port = port; } sc_Tokenizer.prototype.peekToken = function() { if (this.peeked) return this.peeked; var newToken = this.nextToken(); this.peeked = newToken; return newToken; }; sc_Tokenizer.prototype.readToken = function() { var tmp = this.peekToken(); delete this.peeked; return tmp; }; sc_Tokenizer.prototype.nextToken = function() { var port = this.port; function isNumberChar(c) { return (c >= "0" && c <= "9"); }; function isIdOrNumberChar(c) { return SC_ID_CLASS.indexOf(c) != -1 || // ID-char (c >= "0" && c <= "9"); } function isWhitespace(c) { return c === " " || c === "\r" || c === "\n" || c === "\t" || c === "\f"; }; function isWhitespaceOrEOF(c) { return isWhitespace(c) || c === SC_EOF_OBJECT; }; function readString() { res = ""; while (true) { var c = port.readChar(); switch (c) { case '"': return new sc_Token(11/*STRING*/, res); case "\\": var tmp = port.readChar(); switch (tmp) { case '0': res += "\0"; break; case 'a': res += "\a"; break; case 'b': res += "\b"; break; case 'f': res += "\f"; break; case 'n': res += "\n"; break; case 'r': res += "\r"; break; case 't': res += "\t"; break; case 'v': res += "\v"; break; case '"': res += '"'; break; case '\\': res += '\\'; break; case 'x': /* hexa-number */ var nb = 0; while (true) { var hexC = port.peekChar(); if (hexC >= '0' && hexC <= '9') { port.readChar(); nb = nb * 16 + hexC.charCodeAt(0) - '0'.charCodeAt(0); } else if (hexC >= 'a' && hexC <= 'f') { port.readChar(); nb = nb * 16 + hexC.charCodeAt(0) - 'a'.charCodeAt(0); } else if (hexC >= 'A' && hexC <= 'F') { port.readChar(); nb = nb * 16 + hexC.charCodeAt(0) - 'A'.charCodeAt(0); } else { // next char isn't part of hex. res += String.fromCharCode(nb); break; } } break; default: if (tmp === SC_EOF_OBJECT) { return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res); } res += tmp; } break; default: if (c === SC_EOF_OBJECT) { return new sc_Token(13/*ERROR*/, "unclosed string-literal" + res); } res += c; } } }; function readIdOrNumber(firstChar) { var res = firstChar; while (isIdOrNumberChar(port.peekChar())) res += port.readChar(); if (isNaN(res)) return new sc_Token(9/*ID*/, res); else return new sc_Token(12/*NUMBER*/, res - 0); }; function skipWhitespaceAndComments() { var done = false; while (!done) { done = true; while (isWhitespace(port.peekChar())) port.readChar(); if (port.peekChar() === ';') { port.readChar(); done = false; while (true) { curChar = port.readChar(); if (curChar === SC_EOF_OBJECT || curChar === '\n') break; } } } }; function readDot() { if (isWhitespace(port.peekChar())) return new sc_Token(10/*DOT*/); else return readIdOrNumber("."); }; function readSharp() { var c = port.readChar(); if (isWhitespace(c)) return new sc_Token(13/*ERROR*/, "bad #-pattern0."); // reference if (isNumberChar(c)) { var nb = c - 0; while (isNumberChar(port.peekChar())) nb = nb*10 + (port.readChar() - 0); switch (port.readChar()) { case '#': return new sc_Token(18/*REFERENCE*/, nb); case '=': return new sc_Token(19/*STORE*/, nb); default: return new sc_Token(13/*ERROR*/, "bad #-pattern1." + nb); } } if (c === "(") return new sc_Token(14/*VECTOR_BEGIN*/); if (c === "\\") { // character var tmp = "" while (!isWhitespaceOrEOF(port.peekChar())) tmp += port.readChar(); switch (tmp.length) { case 0: // it's escaping a whitespace char: if (sc_isEOFObject(port.peekChar)) return new sc_Token(13/*ERROR*/, "bad #-pattern2."); else return new sc_Token(20/*CHAR*/, port.readChar()); case 1: return new sc_Token(20/*CHAR*/, tmp); default: var entry = sc_Char.readable2char[tmp.toLowerCase()]; if (entry) return new sc_Token(20/*CHAR*/, entry); else return new sc_Token(13/*ERROR*/, "unknown character description: #\\" + tmp); } } // some constants (#t, #f, #unspecified) var res; var needing; switch (c) { case 't': res = new sc_Token(15/*TRUE*/, true); needing = ""; break; case 'f': res = new sc_Token(16/*FALSE*/, false); needing = ""; break; case 'u': res = new sc_Token(17/*UNSPECIFIED*/, undefined); needing = "nspecified"; break; default: return new sc_Token(13/*ERROR*/, "bad #-pattern3: " + c); } while(true) { c = port.peekChar(); if ((isWhitespaceOrEOF(c) || c === ')') && needing == "") return res; else if (isWhitespace(c) || needing == "") return new sc_Token(13/*ERROR*/, "bad #-pattern4 " + c + " " + needing); else if (needing.charAt(0) == c) { port.readChar(); // consume needing = needing.slice(1); } else return new sc_Token(13/*ERROR*/, "bad #-pattern5"); } }; skipWhitespaceAndComments(); var curChar = port.readChar(); if (curChar === SC_EOF_OBJECT) return new sc_Token(0/*EOF*/, curChar); switch (curChar) { case " ": case "\n": case "\t": return readWhitespace(); case "(": return new sc_Token(1/*OPEN_PAR*/); case ")": return new sc_Token(2/*CLOSE_PAR*/); case "{": return new sc_Token(3/*OPEN_BRACE*/); case "}": return new sc_Token(4/*CLOSE_BRACE*/); case "[": return new sc_Token(5/*OPEN_BRACKET*/); case "]": return new sc_Token(6/*CLOSE_BRACKET*/); case "'": return new sc_Token(8/*QUOTE*/); case "#": return readSharp(); case ".": return readDot(); case '"': return readString(); default: if (isIdOrNumberChar(curChar)) return readIdOrNumber(curChar); throw "unexpected character: " + curChar; } }; function sc_Reader(tokenizer) { this.tokenizer = tokenizer; this.backref = new Array(); } sc_Reader.prototype.read = function() { function readList(listBeginType) { function matchesPeer(open, close) { return open === 1/*OPEN_PAR*/ && close === 2/*CLOSE_PAR*/ || open === 3/*OPEN_BRACE*/ && close === 4/*CLOSE_BRACE*/ || open === 5/*OPEN_BRACKET*/ && close === 6/*CLOSE_BRACKET*/; }; var res = null; while (true) { var token = tokenizer.peekToken(); switch (token.type) { case 2/*CLOSE_PAR*/: case 4/*CLOSE_BRACE*/: case 6/*CLOSE_BRACKET*/: if (matchesPeer(listBeginType, token.type)) { tokenizer.readToken(); // consume token return sc_reverseBang(res); } else throw "closing par doesn't match: " + listBeginType + " " + listEndType; case 0/*EOF*/: throw "unexpected end of file"; case 10/*DOT*/: tokenizer.readToken(); // consume token var cdr = this.read(); var par = tokenizer.readToken(); if (!matchesPeer(listBeginType, par.type)) throw "closing par doesn't match: " + listBeginType + " " + par.type; else return sc_reverseAppendBang(res, cdr); default: res = sc_cons(this.read(), res); } } }; function readQuote() { return sc_cons("quote", sc_cons(this.read(), null)); }; function readVector() { // opening-parenthesis is already consumed var a = new Array(); while (true) { var token = tokenizer.peekToken(); switch (token.type) { case 2/*CLOSE_PAR*/: tokenizer.readToken(); return a; default: a.push(this.read()); } } }; function storeRefence(nb) { var tmp = this.read(); this.backref[nb] = tmp; return tmp; }; function readReference(nb) { if (nb in this.backref) return this.backref[nb]; else throw "bad reference: " + nb; }; var tokenizer = this.tokenizer; var token = tokenizer.readToken(); // handle error if (token.type === 13/*ERROR*/) throw token.val; switch (token.type) { case 1/*OPEN_PAR*/: case 3/*OPEN_BRACE*/: case 5/*OPEN_BRACKET*/: return readList.call(this, token.type); case 8/*QUOTE*/: return readQuote.call(this); case 11/*STRING*/: return sc_jsstring2string(token.val); case 20/*CHAR*/: return new sc_Char(token.val); case 14/*VECTOR_BEGIN*/: return readVector.call(this); case 18/*REFERENCE*/: return readReference.call(this, token.val); case 19/*STORE*/: return storeRefence.call(this, token.val); case 9/*ID*/: return sc_jsstring2symbol(token.val); case 0/*EOF*/: case 12/*NUMBER*/: case 15/*TRUE*/: case 16/*FALSE*/: case 17/*UNSPECIFIED*/: return token.val; default: throw "unexpected token " + token.type + " " + token.val; } }; /*** META ((export #t)) */ function sc_read(port) { if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... var reader = new sc_Reader(new sc_Tokenizer(port)); return reader.read(); } /*** META ((export #t)) */ function sc_readChar(port) { if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... var t = port.readChar(); return t === SC_EOF_OBJECT? t: new sc_Char(t); } /*** META ((export #t)) */ function sc_peekChar(port) { if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... var t = port.peekChar(); return t === SC_EOF_OBJECT? t: new sc_Char(t); } /*** META ((export #t) (type bool)) */ function sc_isCharReady(port) { if (port === undefined) // we assume the port hasn't been given. port = SC_DEFAULT_IN; // THREAD: shared var... return port.isCharReady(); } /*** META ((export #t) (peephole (postfix ".close()"))) */ function sc_closeInputPort(p) { return p.close(); } /*** META ((export #t) (type bool) (peephole (postfix " instanceof sc_InputPort"))) */ function sc_isInputPort(o) { return (o instanceof sc_InputPort); } /*** META ((export eof-object?) (type bool) (peephole (postfix " === SC_EOF_OBJECT"))) */ function sc_isEOFObject(o) { return o === SC_EOF_OBJECT; } /*** META ((export #t) (peephole (hole 0 "SC_DEFAULT_IN"))) */ function sc_currentInputPort() { return SC_DEFAULT_IN; } /* ------------ file operations are not supported -----------*/ /*** META ((export #t)) */ function sc_callWithInputFile(s, proc) { throw "can't open " + s; } /*** META ((export #t)) */ function sc_callWithOutputFile(s, proc) { throw "can't open " + s; } /*** META ((export #t)) */ function sc_withInputFromFile(s, thunk) { throw "can't open " + s; } /*** META ((export #t)) */ function sc_withOutputToFile(s, thunk) { throw "can't open " + s; } /*** META ((export #t)) */ function sc_openInputFile(s) { throw "can't open " + s; } /*** META ((export #t)) */ function sc_openOutputFile(s) { throw "can't open " + s; } /* ----------------------------------------------------------------------------*/ /*** META ((export #t)) */ function sc_basename(p) { var i = p.lastIndexOf('/'); if(i >= 0) return p.substring(i + 1, p.length); else return ''; } /*** META ((export #t)) */ function sc_dirname(p) { var i = p.lastIndexOf('/'); if(i >= 0) return p.substring(0, i); else return ''; } /* ----------------------------------------------------------------------------*/ /*** META ((export #t)) */ function sc_withInputFromPort(p, thunk) { try { var tmp = SC_DEFAULT_IN; // THREAD: shared var. SC_DEFAULT_IN = p; return thunk(); } finally { SC_DEFAULT_IN = tmp; } } /*** META ((export #t)) */ function sc_withInputFromString(s, thunk) { return sc_withInputFromPort(new sc_StringInputPort(sc_string2jsstring(s)), thunk); } /*** META ((export #t)) */ function sc_withOutputToPort(p, thunk) { try { var tmp = SC_DEFAULT_OUT; // THREAD: shared var. SC_DEFAULT_OUT = p; return thunk(); } finally { SC_DEFAULT_OUT = tmp; } } /*** META ((export #t)) */ function sc_withOutputToString(thunk) { var p = new sc_StringOutputPort(); sc_withOutputToPort(p, thunk); return p.close(); } /*** META ((export #t)) */ function sc_withOutputToProcedure(proc, thunk) { var t = function(s) { proc(sc_jsstring2string(s)); }; return sc_withOutputToPort(new sc_GenericOutputPort(t), thunk); } /*** META ((export #t) (peephole (hole 0 "new sc_StringOutputPort()"))) */ function sc_openOutputString() { return new sc_StringOutputPort(); } /*** META ((export #t)) */ function sc_openInputString(str) { return new sc_StringInputPort(sc_string2jsstring(str)); } /* ----------------------------------------------------------------------------*/ function sc_OutputPort() { } sc_OutputPort.prototype = new sc_Port(); sc_OutputPort.prototype.appendJSString = function(obj) { /* do nothing */ } sc_OutputPort.prototype.close = function() { /* do nothing */ } function sc_StringOutputPort() { this.res = ""; } sc_StringOutputPort.prototype = new sc_OutputPort(); sc_StringOutputPort.prototype.appendJSString = function(s) { this.res += s; } sc_StringOutputPort.prototype.close = function() { return sc_jsstring2string(this.res); } /*** META ((export #t)) */ function sc_getOutputString(sp) { return sc_jsstring2string(sp.res); } function sc_ErrorOutputPort() { } sc_ErrorOutputPort.prototype = new sc_OutputPort(); sc_ErrorOutputPort.prototype.appendJSString = function(s) { throw "don't write on ErrorPort!"; } sc_ErrorOutputPort.prototype.close = function() { /* do nothing */ } function sc_GenericOutputPort(appendJSString, close) { this.appendJSString = appendJSString; if (close) this.close = close; } sc_GenericOutputPort.prototype = new sc_OutputPort(); /*** META ((export #t) (type bool) (peephole (postfix " instanceof sc_OutputPort"))) */ function sc_isOutputPort(o) { return (o instanceof sc_OutputPort); } /*** META ((export #t) (peephole (postfix ".close()"))) */ function sc_closeOutputPort(p) { return p.close(); } /* ------------------ write ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_write(o, p) { if (p === undefined) // we assume not given p = SC_DEFAULT_OUT; p.appendJSString(sc_toWriteString(o)); } function sc_toWriteString(o) { if (o === null) return "()"; else if (o === true) return "#t"; else if (o === false) return "#f"; else if (o === undefined) return "#unspecified"; else if (typeof o === 'function') return "#"; else if (o.sc_toWriteString) return o.sc_toWriteString(); else return o.toString(); } function sc_escapeWriteString(s) { var res = ""; var j = 0; for (i = 0; i < s.length; i++) { switch (s.charAt(i)) { case "\0": res += s.substring(j, i) + "\\0"; j = i + 1; break; case "\b": res += s.substring(j, i) + "\\b"; j = i + 1; break; case "\f": res += s.substring(j, i) + "\\f"; j = i + 1; break; case "\n": res += s.substring(j, i) + "\\n"; j = i + 1; break; case "\r": res += s.substring(j, i) + "\\r"; j = i + 1; break; case "\t": res += s.substring(j, i) + "\\t"; j = i + 1; break; case "\v": res += s.substring(j, i) + "\\v"; j = i + 1; break; case '"': res += s.substring(j, i) + '\\"'; j = i + 1; break; case "\\": res += s.substring(j, i) + "\\\\"; j = i + 1; break; default: var c = s.charAt(i); if ("\a" !== "a" && c == "\a") { res += s.substring(j, i) + "\\a"; j = i + 1; continue; } if ("\v" !== "v" && c == "\v") { res += s.substring(j, i) + "\\v"; j = i + 1; continue; } //if (s.charAt(i) < ' ' || s.charCodeAt(i) > 127) { // CARE: Manuel is this OK with HOP? if (s.charAt(i) < ' ') { /* non printable character and special chars */ res += s.substring(j, i) + "\\x" + s.charCodeAt(i).toString(16); j = i + 1; } // else just let i increase... } } res += s.substring(j, i); return res; } /* ------------------ display ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_display(o, p) { if (p === undefined) // we assume not given p = SC_DEFAULT_OUT; p.appendJSString(sc_toDisplayString(o)); } function sc_toDisplayString(o) { if (o === null) return "()"; else if (o === true) return "#t"; else if (o === false) return "#f"; else if (o === undefined) return "#unspecified"; else if (typeof o === 'function') return "#"; else if (o.sc_toDisplayString) return o.sc_toDisplayString(); else return o.toString(); } /* ------------------ newline ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_newline(p) { if (p === undefined) // we assume not given p = SC_DEFAULT_OUT; p.appendJSString("\n"); } /* ------------------ write-char ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_writeChar(c, p) { if (p === undefined) // we assume not given p = SC_DEFAULT_OUT; p.appendJSString(c.val); } /* ------------------ write-circle ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_writeCircle(o, p) { if (p === undefined) // we assume not given p = SC_DEFAULT_OUT; p.appendJSString(sc_toWriteCircleString(o)); } function sc_toWriteCircleString(o) { var symb = sc_gensym("writeCircle"); var nbPointer = new Object(); nbPointer.nb = 0; sc_prepWriteCircle(o, symb, nbPointer); return sc_genToWriteCircleString(o, symb); } function sc_prepWriteCircle(o, symb, nbPointer) { // TODO sc_Struct if (o instanceof sc_Pair || o instanceof sc_Vector) { if (o[symb] !== undefined) { // not the first visit. o[symb]++; // unless there is already a number, assign one. if (!o[symb + "nb"]) o[symb + "nb"] = nbPointer.nb++; return; } o[symb] = 0; if (o instanceof sc_Pair) { sc_prepWriteCircle(o.car, symb, nbPointer); sc_prepWriteCircle(o.cdr, symb, nbPointer); } else { for (var i = 0; i < o.length; i++) sc_prepWriteCircle(o[i], symb, nbPointer); } } } function sc_genToWriteCircleString(o, symb) { if (!(o instanceof sc_Pair || o instanceof sc_Vector)) return sc_toWriteString(o); return o.sc_toWriteCircleString(symb); } sc_Pair.prototype.sc_toWriteCircleString = function(symb, inList) { if (this[symb + "use"]) { // use-flag is set. Just use it. var nb = this[symb + "nb"]; if (this[symb]-- === 0) { // if we are the last use. remove all fields. delete this[symb]; delete this[symb + "nb"]; delete this[symb + "use"]; } if (inList) return '. #' + nb + '#'; else return '#' + nb + '#'; } if (this[symb]-- === 0) { // if we are the last use. remove all fields. delete this[symb]; delete this[symb + "nb"]; delete this[symb + "use"]; } var res = ""; if (this[symb] !== undefined) { // implies > 0 this[symb + "use"] = true; if (inList) res += '. #' + this[symb + "nb"] + '='; else res += '#' + this[symb + "nb"] + '='; inList = false; } if (!inList) res += "("; // print car res += sc_genToWriteCircleString(this.car, symb); if (sc_isPair(this.cdr)) { res += " " + this.cdr.sc_toWriteCircleString(symb, true); } else if (this.cdr !== null) { res += " . " + sc_genToWriteCircleString(this.cdr, symb); } if (!inList) res += ")"; return res; }; sc_Vector.prototype.sc_toWriteCircleString = function(symb) { if (this[symb + "use"]) { // use-flag is set. Just use it. var nb = this[symb + "nb"]; if (this[symb]-- === 0) { // if we are the last use. remove all fields. delete this[symb]; delete this[symb + "nb"]; delete this[symb + "use"]; } return '#' + nb + '#'; } if (this[symb]-- === 0) { // if we are the last use. remove all fields. delete this[symb]; delete this[symb + "nb"]; delete this[symb + "use"]; } var res = ""; if (this[symb] !== undefined) { // implies > 0 this[symb + "use"] = true; res += '#' + this[symb + "nb"] + '='; } res += "#("; for (var i = 0; i < this.length; i++) { res += sc_genToWriteCircleString(this[i], symb); if (i < this.length - 1) res += " "; } res += ")"; return res; }; /* ------------------ print ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_print(s) { if (arguments.length === 1) { sc_display(s); sc_newline(); } else { for (var i = 0; i < arguments.length; i++) sc_display(arguments[i]); sc_newline(); } } /* ------------------ format ---------------------------------------------------*/ /*** META ((export #t)) */ function sc_format(s, args) { var len = s.length; var p = new sc_StringOutputPort(); var i = 0, j = 1; while( i < len ) { var i2 = s.indexOf("~", i); if (i2 == -1) { p.appendJSString( s.substring( i, len ) ); return p.close(); } else { if (i2 > i) { if (i2 == (len - 1)) { p.appendJSString(s.substring(i, len)); return p.close(); } else { p.appendJSString(s.substring(i, i2)); i = i2; } } switch(s.charCodeAt(i2 + 1)) { case 65: case 97: // a sc_display(arguments[j], p); i += 2; j++; break; case 83: case 115: // s sc_write(arguments[j], p); i += 2; j++; break; case 86: case 118: // v sc_display(arguments[j], p); p.appendJSString("\n"); i += 2; j++; break; case 67: case 99: // c p.appendJSString(String.fromCharCode(arguments[j])); i += 2; j++; break; case 88: case 120: // x p.appendJSString(arguments[j].toString(6)); i += 2; j++; break; case 79: case 111: // o p.appendJSString(arguments[j].toString(8)); i += 2; j++; break; case 66: case 98: // b p.appendJSString(arguments[j].toString(2)); i += 2; j++; break; case 37: case 110: // %, n p.appendJSString("\n"); i += 2; break; case 114: // r p.appendJSString("\r"); i += 2; break; case 126: // ~ p.appendJSString("~"); i += 2; break; default: sc_error( "format: illegal ~" + String.fromCharCode(s.charCodeAt(i2 + 1)) + " sequence" ); return ""; } } } return p.close(); } /* ------------------ global ports ---------------------------------------------------*/ var SC_DEFAULT_IN = new sc_ErrorInputPort(); var SC_DEFAULT_OUT = new sc_ErrorOutputPort(); var SC_ERROR_OUT = new sc_ErrorOutputPort(); var sc_SYMBOL_PREFIX = "\u1E9C"; var sc_KEYWORD_PREFIX = "\u1E9D"; /*** META ((export #t) (peephole (id))) */ function sc_jsstring2string(s) { return s; } /*** META ((export #t) (peephole (prefix "'\\u1E9C' +"))) */ function sc_jsstring2symbol(s) { return sc_SYMBOL_PREFIX + s; } /*** META ((export #t) (peephole (id))) */ function sc_string2jsstring(s) { return s; } /*** META ((export #t) (peephole (symbol2jsstring_immutable))) */ function sc_symbol2jsstring(s) { return s.slice(1); } /*** META ((export #t) (peephole (postfix ".slice(1)"))) */ function sc_keyword2jsstring(k) { return k.slice(1); } /*** META ((export #t) (peephole (prefix "'\\u1E9D' +"))) */ function sc_jsstring2keyword(s) { return sc_KEYWORD_PREFIX + s; } /*** META ((export #t) (type bool)) */ function sc_isKeyword(s) { return (typeof s === "string") && (s.charAt(0) === sc_KEYWORD_PREFIX); } /*** META ((export #t)) */ var sc_gensym = function() { var counter = 1000; return function(sym) { counter++; if (!sym) sym = sc_SYMBOL_PREFIX; return sym + "s" + counter + "~" + "^sC-GeNsYm "; }; }(); /*** META ((export #t) (type bool)) */ function sc_isEqual(o1, o2) { return ((o1 === o2) || (sc_isPair(o1) && sc_isPair(o2) && sc_isPairEqual(o1, o2, sc_isEqual)) || (sc_isVector(o1) && sc_isVector(o2) && sc_isVectorEqual(o1, o2, sc_isEqual))); } /*** META ((export number->symbol integer->symbol)) */ function sc_number2symbol(x, radix) { return sc_SYMBOL_PREFIX + sc_number2jsstring(x, radix); } /*** META ((export number->string integer->string)) */ var sc_number2string = sc_number2jsstring; /*** META ((export #t)) */ function sc_symbol2number(s, radix) { return sc_jsstring2number(s.slice(1), radix); } /*** META ((export #t)) */ var sc_string2number = sc_jsstring2number; /*** META ((export #t) (peephole (prefix "+" s))) ;; peephole will only apply if no radix is given. */ function sc_string2integer(s, radix) { if (!radix) return +s; return parseInt(s, radix); } /*** META ((export #t) (peephole (prefix "+"))) */ function sc_string2real(s) { return +s; } /*** META ((export #t) (type bool)) */ function sc_isSymbol(s) { return (typeof s === "string") && (s.charAt(0) === sc_SYMBOL_PREFIX); } /*** META ((export #t) (peephole (symbol2string_immutable))) */ function sc_symbol2string(s) { return s.slice(1); } /*** META ((export #t) (peephole (prefix "'\\u1E9C' +"))) */ function sc_string2symbol(s) { return sc_SYMBOL_PREFIX + s; } /*** META ((export symbol-append) (peephole (symbolAppend_immutable))) */ function sc_symbolAppend() { var res = sc_SYMBOL_PREFIX; for (var i = 0; i < arguments.length; i++) res += arguments[i].slice(1); return res; } /*** META ((export #t) (peephole (postfix ".val"))) */ function sc_char2string(c) { return c.val; } /*** META ((export #t) (peephole (hole 1 "'\\u1E9C' + " c ".val"))) */ function sc_char2symbol(c) { return sc_SYMBOL_PREFIX + c.val; } /*** META ((export #t) (type bool)) */ function sc_isString(s) { return (typeof s === "string") && (s.charAt(0) !== sc_SYMBOL_PREFIX); } /*** META ((export #t)) */ var sc_makeString = sc_makejsString; /*** META ((export #t)) */ function sc_string() { for (var i = 0; i < arguments.length; i++) arguments[i] = arguments[i].val; return "".concat.apply("", arguments); } /*** META ((export #t) (peephole (postfix ".length"))) */ function sc_stringLength(s) { return s.length; } /*** META ((export #t)) */ function sc_stringRef(s, k) { return new sc_Char(s.charAt(k)); } /* there's no stringSet in the immutable version function sc_stringSet(s, k, c) */ /*** META ((export string=?) (type bool) (peephole (hole 2 str1 " === " str2))) */ function sc_isStringEqual(s1, s2) { return s1 === s2; } /*** META ((export string?) (type bool) (peephole (hole 2 str1 " > " str2))) */ function sc_isStringGreater(s1, s2) { return s1 > s2; } /*** META ((export string<=?) (type bool) (peephole (hole 2 str1 " <= " str2))) */ function sc_isStringLessEqual(s1, s2) { return s1 <= s2; } /*** META ((export string>=?) (type bool) (peephole (hole 2 str1 " >= " str2))) */ function sc_isStringGreaterEqual(s1, s2) { return s1 >= s2; } /*** META ((export string-ci=?) (type bool) (peephole (hole 2 str1 ".toLowerCase() === " str2 ".toLowerCase()"))) */ function sc_isStringCIEqual(s1, s2) { return s1.toLowerCase() === s2.toLowerCase(); } /*** META ((export string-ci?) (type bool) (peephole (hole 2 str1 ".toLowerCase() > " str2 ".toLowerCase()"))) */ function sc_isStringCIGreater(s1, s2) { return s1.toLowerCase() > s2.toLowerCase(); } /*** META ((export string-ci<=?) (type bool) (peephole (hole 2 str1 ".toLowerCase() <= " str2 ".toLowerCase()"))) */ function sc_isStringCILessEqual(s1, s2) { return s1.toLowerCase() <= s2.toLowerCase(); } /*** META ((export string-ci>=?) (type bool) (peephole (hole 2 str1 ".toLowerCase() >= " str2 ".toLowerCase()"))) */ function sc_isStringCIGreaterEqual(s1, s2) { return s1.toLowerCase() >= s2.toLowerCase(); } /*** META ((export #t) (peephole (hole 3 s ".substring(" start ", " end ")"))) */ function sc_substring(s, start, end) { return s.substring(start, end); } /*** META ((export #t)) */ function sc_isSubstring_at(s1, s2, i) { return s2 == s1.substring(i, i+ s2.length); } /*** META ((export #t) (peephole (infix 0 #f "+" "''"))) */ function sc_stringAppend() { return "".concat.apply("", arguments); } /*** META ((export #t)) */ var sc_string2list = sc_jsstring2list; /*** META ((export #t)) */ var sc_list2string = sc_list2jsstring; /*** META ((export #t) (peephole (id))) */ function sc_stringCopy(s) { return s; } /* there's no string-fill in the immutable version function sc_stringFill(s, c) */ /*** META ((export #t) (peephole (postfix ".slice(1)"))) */ function sc_keyword2string(o) { return o.slice(1); } /*** META ((export #t) (peephole (prefix "'\\u1E9D' +"))) */ function sc_string2keyword(o) { return sc_KEYWORD_PREFIX + o; } String.prototype.sc_toDisplayString = function() { if (this.charAt(0) === sc_SYMBOL_PREFIX) // TODO: care for symbols with spaces (escape-chars symbols). return this.slice(1); else if (this.charAt(0) === sc_KEYWORD_PREFIX) return ":" + this.slice(1); else return this.toString(); }; String.prototype.sc_toWriteString = function() { if (this.charAt(0) === sc_SYMBOL_PREFIX) // TODO: care for symbols with spaces (escape-chars symbols). return this.slice(1); else if (this.charAt(0) === sc_KEYWORD_PREFIX) return ":" + this.slice(1); else return '"' + sc_escapeWriteString(this) + '"'; }; /* Exported Variables */ var BgL_testzd2boyerzd2; var BgL_nboyerzd2benchmarkzd2; var BgL_setupzd2boyerzd2; /* End Exports */ var translate_term_nboyer; var translate_args_nboyer; var untranslate_term_nboyer; var BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer; var BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer; var translate_alist_nboyer; var apply_subst_nboyer; var apply_subst_lst_nboyer; var tautologyp_nboyer; var if_constructor_nboyer; var rewrite_count_nboyer; var rewrite_nboyer; var rewrite_args_nboyer; var unify_subst_nboyer; var one_way_unify1_nboyer; var false_term_nboyer; var true_term_nboyer; var trans_of_implies1_nboyer; var is_term_equal_nboyer; var is_term_member_nboyer; var const_nboyer; var sc_const_3_nboyer; var sc_const_4_nboyer; { (sc_const_4_nboyer = (new sc_Pair("\u1E9Cimplies",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cu",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cw",null)))))),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cw",null)))))),null))))))); (sc_const_3_nboyer = sc_list((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccompile",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Ccodegen",(new sc_Pair((new sc_Pair("\u1E9Coptimize",(new sc_Pair("\u1E9Cform",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreaterp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clesseqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cboolean",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ciff",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ceven1",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Codd",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccountps-",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccountps-loop",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cpred",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfact-",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfact-loop",(new sc_Pair("\u1E9Ci",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdivides",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-true",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassume-false",(new sc_Pair("\u1E9Cvar",(new sc_Pair("\u1E9Calist",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cvar",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))),(new sc_Pair("\u1E9Calist",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctautology-checker",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctautologyp",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfalsify",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfalsify1",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime1",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cx",null)))),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair("\u1E9Cp",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cimplies",(new sc_Pair("\u1E9Cp",(new sc_Pair("\u1E9Cq",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cp",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cq",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair((new sc_Pair("\u1E9Cf",null)),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Ct",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))))),(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",(new sc_Pair("\u1E9Ce",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cc",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cplus-fringe",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cexec",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cpds",(new sc_Pair("\u1E9Cenvrn",null)))))))),(new sc_Pair("\u1E9Cenvrn",null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmc-flatten",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Cintersect",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Ck",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ck",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair((new sc_Pair("\u1E9Cexp",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ck",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Cy",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Creverse-loop",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Csort-lp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ccount-list",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus1",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cl",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Ci",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cbase",null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cj",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cj",(new sc_Pair((1),null)))))),null)))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Ci",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cpower-eval",(new sc_Pair((new sc_Pair("\u1E9Cbig-plus",(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cpower-rep",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Cbase",null)))))))))),(new sc_Pair("\u1E9Cbase",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cj",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Ca",null)))),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cw",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cx",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cc",null)))))),null)))))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cb",(new sc_Pair("\u1E9Cc",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cz",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Cgcd",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair((new sc_Pair("\u1E9Cnormalize",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cvalue",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cy",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnlistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csamefringe",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((1),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair((new sc_Pair("\u1E9Cgreatest-factor",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ctimes-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cprime-list",(new sc_Pair("\u1E9Cy",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Cz",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cz",null)))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cz",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cw",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cgreatereqp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cor",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cand",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cy",(new sc_Pair((1),null)))))),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((1),null)))))),(new sc_Pair(sc_list("\u1E9Cand", (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair("\u1E9Cb",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Ca",null)))), (new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cb",null)))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csub1",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cl",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cl",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cl",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdsort",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Csort2",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx1",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx2",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx3",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx4",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx5",(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair("\u1E9Cx6",(new sc_Pair("\u1E9Cx7",null)))))),null)))))),null)))))),null)))))),null)))))),null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((6),(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cx7",null)))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((2),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair("\u1E9Cy",(new sc_Pair((2),null)))))),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Csigma",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ci",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Ci",null)))),null)))))),(new sc_Pair((2),null)))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cz",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnot",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cz",null)))),null)))))),null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair((new sc_Pair("\u1E9Cdelete",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmeaning",(new sc_Pair((new sc_Pair("\u1E9Cplus-tree",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair("\u1E9Ca",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cadd1",(new sc_Pair("\u1E9Cy",null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cnumberp",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cnth",(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Ci",null)))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Cb",null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Ca",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Clast",(new sc_Pair("\u1E9Ca",null)))),null)))),(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair("\u1E9Cb",null)))))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clessp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ct",null)),(new sc_Pair("\u1E9Cz",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cf",null)),(new sc_Pair("\u1E9Cz",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Cassignedp",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Ca",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cassignment",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cb",null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccar",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cgopher",(new sc_Pair("\u1E9Cx",null)))),null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Clistp",(new sc_Pair("\u1E9Cx",null)))),(new sc_Pair((new sc_Pair("\u1E9Ccdr",(new sc_Pair((new sc_Pair("\u1E9Cflatten",(new sc_Pair("\u1E9Cx",null)))),null)))),(new sc_Pair((new sc_Pair("\u1E9Ccons",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cquotient",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cx",null)))))),(new sc_Pair("\u1E9Cy",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Czerop",(new sc_Pair("\u1E9Cy",null)))),(new sc_Pair((new sc_Pair("\u1E9Czero",null)),(new sc_Pair((new sc_Pair("\u1E9Cfix",(new sc_Pair("\u1E9Cx",null)))),null)))))))),null)))))), (new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair((new sc_Pair("\u1E9Cset",(new sc_Pair("\u1E9Ci",(new sc_Pair("\u1E9Cval",(new sc_Pair("\u1E9Cmem",null)))))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cif",(new sc_Pair((new sc_Pair("\u1E9Ceqp",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Ci",null)))))),(new sc_Pair("\u1E9Cval",(new sc_Pair((new sc_Pair("\u1E9Cget",(new sc_Pair("\u1E9Cj",(new sc_Pair("\u1E9Cmem",null)))))),null)))))))),null)))))))); (const_nboyer = (new sc_Pair((new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair((new sc_Pair("\u1E9Czero",null)),null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cy",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair((new sc_Pair("\u1E9Ctimes",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Cc",(new sc_Pair("\u1E9Cd",null)))))),null)))))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cz",(new sc_Pair("\u1E9Cf",(new sc_Pair((new sc_Pair("\u1E9Creverse",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair((new sc_Pair("\u1E9Cappend",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cnil",null)),null)))))),null)))),null)))))),(new sc_Pair((new sc_Pair("\u1E9Cu",(new sc_Pair("\u1E9Cequal",(new sc_Pair((new sc_Pair("\u1E9Cplus",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cdifference",(new sc_Pair("\u1E9Cx",(new sc_Pair("\u1E9Cy",null)))))),null)))))))),(new sc_Pair((new sc_Pair("\u1E9Cw",(new sc_Pair("\u1E9Clessp",(new sc_Pair((new sc_Pair("\u1E9Cremainder",(new sc_Pair("\u1E9Ca",(new sc_Pair("\u1E9Cb",null)))))),(new sc_Pair((new sc_Pair("\u1E9Cmember",(new sc_Pair("\u1E9Ca",(new sc_Pair((new sc_Pair("\u1E9Clength",(new sc_Pair("\u1E9Cb",null)))),null)))))),null)))))))),null))))))))))); BgL_nboyerzd2benchmarkzd2 = function() { var args = null; for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) { args = sc_cons(arguments[sc_tmp], args); } var n; return ((n = ((args === null)?(0):(args.car))), (BgL_setupzd2boyerzd2()), (BgL_runzd2benchmarkzd2(("nboyer"+(sc_number2string(n))), (1), function() { return (BgL_testzd2boyerzd2(n)); }, function(rewrites) { if ((sc_isNumber(rewrites))) switch (n) { case (0): return (rewrites===(95024)); break; case (1): return (rewrites===(591777)); break; case (2): return (rewrites===(1813975)); break; case (3): return (rewrites===(5375678)); break; case (4): return (rewrites===(16445406)); break; case (5): return (rewrites===(51507739)); break; default: return true; break; } else return false; }))); }; BgL_setupzd2boyerzd2 = function() { return true; }; BgL_testzd2boyerzd2 = function() { return true; }; translate_term_nboyer = function(term) { var lst; return (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((translate_term_nboyer((lst.car))), (translate_args_nboyer((lst.cdr)))))))))); }; translate_args_nboyer = function(lst) { var sc_lst_5; var term; return ((lst === null)?null:(new sc_Pair(((term = (lst.car)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))), ((sc_lst_5 = (lst.cdr)), ((sc_lst_5 === null)?null:(new sc_Pair((translate_term_nboyer((sc_lst_5.car))), (translate_args_nboyer((sc_lst_5.cdr)))))))))); }; untranslate_term_nboyer = function(term) { var optrOpnd; var tail1131; var L1127; var falseHead1130; var symbol_record; if (!(term instanceof sc_Pair)) return term; else { (falseHead1130 = (new sc_Pair(null, null))); (L1127 = (term.cdr)); (tail1131 = falseHead1130); while (!(L1127 === null)) { { (tail1131.cdr = (new sc_Pair((untranslate_term_nboyer((L1127.car))), null))); (tail1131 = (tail1131.cdr)); (L1127 = (L1127.cdr)); } } (optrOpnd = (falseHead1130.cdr)); return (new sc_Pair(((symbol_record = (term.car)), (symbol_record[(0)])), optrOpnd)); } }; BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer = function(sym) { var r; var x; return ((x = (sc_assq(sym, BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), ((x!== false)?(x.cdr):((r = [sym, null]), (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = (new sc_Pair((new sc_Pair(sym, r)), BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer))), r))); }; (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null); translate_alist_nboyer = function(alist) { var sc_alist_6; var term; return ((alist === null)?null:(new sc_Pair((new sc_Pair((alist.car.car), ((term = (alist.car.cdr)), (!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr))))))))), ((sc_alist_6 = (alist.cdr)), ((sc_alist_6 === null)?null:(new sc_Pair((new sc_Pair((sc_alist_6.car.car), (translate_term_nboyer((sc_alist_6.car.cdr))))), (translate_alist_nboyer((sc_alist_6.cdr)))))))))); }; apply_subst_nboyer = function(alist, term) { var lst; var temp_temp; return (!(term instanceof sc_Pair)?((temp_temp = (sc_assq(term, alist))), ((temp_temp!== false)?(temp_temp.cdr):term)):(new sc_Pair((term.car), ((lst = (term.cdr)), ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), (apply_subst_lst_nboyer(alist, (lst.cdr)))))))))); }; apply_subst_lst_nboyer = function(alist, lst) { var sc_lst_7; return ((lst === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (lst.car))), ((sc_lst_7 = (lst.cdr)), ((sc_lst_7 === null)?null:(new sc_Pair((apply_subst_nboyer(alist, (sc_lst_7.car))), (apply_subst_lst_nboyer(alist, (sc_lst_7.cdr)))))))))); }; tautologyp_nboyer = function(sc_x_11, true_lst, false_lst) { var tmp1125; var x; var tmp1126; var sc_x_8; var sc_tmp1125_9; var sc_tmp1126_10; var sc_x_11; var true_lst; var false_lst; while (true) { if ((((sc_tmp1126_10 = (is_term_equal_nboyer(sc_x_11, true_term_nboyer))), ((sc_tmp1126_10!== false)?sc_tmp1126_10:(is_term_member_nboyer(sc_x_11, true_lst))))!== false)) return true; else if ((((sc_tmp1125_9 = (is_term_equal_nboyer(sc_x_11, false_term_nboyer))), ((sc_tmp1125_9!== false)?sc_tmp1125_9:(is_term_member_nboyer(sc_x_11, false_lst))))!== false)) return false; else if (!(sc_x_11 instanceof sc_Pair)) return false; else if (((sc_x_11.car)===if_constructor_nboyer)) if ((((sc_x_8 = (sc_x_11.cdr.car)), (tmp1126 = (is_term_equal_nboyer(sc_x_8, true_term_nboyer))), ((tmp1126!== false)?tmp1126:(is_term_member_nboyer(sc_x_8, true_lst))))!== false)) (sc_x_11 = (sc_x_11.cdr.cdr.car)); else if ((((x = (sc_x_11.cdr.car)), (tmp1125 = (is_term_equal_nboyer(x, false_term_nboyer))), ((tmp1125!== false)?tmp1125:(is_term_member_nboyer(x, false_lst))))!== false)) (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car)); else if (((tautologyp_nboyer((sc_x_11.cdr.cdr.car), (new sc_Pair((sc_x_11.cdr.car), true_lst)), false_lst))!== false)) { (false_lst = (new sc_Pair((sc_x_11.cdr.car), false_lst))); (sc_x_11 = (sc_x_11.cdr.cdr.cdr.car)); } else return false; else return false; } }; (if_constructor_nboyer = "\u1E9C*"); (rewrite_count_nboyer = (0)); rewrite_nboyer = function(term) { var term2; var sc_term_12; var lst; var symbol_record; var sc_lst_13; { (++rewrite_count_nboyer); if (!(term instanceof sc_Pair)) return term; else { (sc_term_12 = (new sc_Pair((term.car), ((sc_lst_13 = (term.cdr)), ((sc_lst_13 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_13.car))), (rewrite_args_nboyer((sc_lst_13.cdr)))))))))); (lst = ((symbol_record = (term.car)), (symbol_record[(1)]))); while (true) { if ((lst === null)) return sc_term_12; else if ((((term2 = ((lst.car).cdr.car)), (unify_subst_nboyer = null), (one_way_unify1_nboyer(sc_term_12, term2)))!== false)) return (rewrite_nboyer((apply_subst_nboyer(unify_subst_nboyer, ((lst.car).cdr.cdr.car))))); else (lst = (lst.cdr)); } } } }; rewrite_args_nboyer = function(lst) { var sc_lst_14; return ((lst === null)?null:(new sc_Pair((rewrite_nboyer((lst.car))), ((sc_lst_14 = (lst.cdr)), ((sc_lst_14 === null)?null:(new sc_Pair((rewrite_nboyer((sc_lst_14.car))), (rewrite_args_nboyer((sc_lst_14.cdr)))))))))); }; (unify_subst_nboyer = "\u1E9C*"); one_way_unify1_nboyer = function(term1, term2) { var lst1; var lst2; var temp_temp; if (!(term2 instanceof sc_Pair)) { (temp_temp = (sc_assq(term2, unify_subst_nboyer))); if ((temp_temp!== false)) return (is_term_equal_nboyer(term1, (temp_temp.cdr))); else if ((sc_isNumber(term2))) return (sc_isEqual(term1, term2)); else { (unify_subst_nboyer = (new sc_Pair((new sc_Pair(term2, term1)), unify_subst_nboyer))); return true; } } else if (!(term1 instanceof sc_Pair)) return false; else if (((term1.car)===(term2.car))) { (lst1 = (term1.cdr)); (lst2 = (term2.cdr)); while (true) { if ((lst1 === null)) return (lst2 === null); else if ((lst2 === null)) return false; else if (((one_way_unify1_nboyer((lst1.car), (lst2.car)))!== false)) { (lst1 = (lst1.cdr)); (lst2 = (lst2.cdr)); } else return false; } } else return false; }; (false_term_nboyer = "\u1E9C*"); (true_term_nboyer = "\u1E9C*"); trans_of_implies1_nboyer = function(n) { var sc_n_15; return ((sc_isEqual(n, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (n-(1)), n)), ((sc_n_15 = (n-(1))), ((sc_isEqual(sc_n_15, (1)))?(sc_list("\u1E9Cimplies", (0), (1))):(sc_list("\u1E9Cand", (sc_list("\u1E9Cimplies", (sc_n_15-(1)), sc_n_15)), (trans_of_implies1_nboyer((sc_n_15-(1))))))))))); }; is_term_equal_nboyer = function(x, y) { var lst1; var lst2; var r2; var r1; if ((x instanceof sc_Pair)) if ((y instanceof sc_Pair)) if ((((r1 = (x.car)), (r2 = (y.car)), (r1===r2))!== false)) { (lst1 = (x.cdr)); (lst2 = (y.cdr)); while (true) { if ((lst1 === null)) return (lst2 === null); else if ((lst2 === null)) return false; else if (((is_term_equal_nboyer((lst1.car), (lst2.car)))!== false)) { (lst1 = (lst1.cdr)); (lst2 = (lst2.cdr)); } else return false; } } else return false; else return false; else return (sc_isEqual(x, y)); }; is_term_member_nboyer = function(x, lst) { var x; var lst; while (true) { if ((lst === null)) return false; else if (((is_term_equal_nboyer(x, (lst.car)))!== false)) return true; else (lst = (lst.cdr)); } }; BgL_setupzd2boyerzd2 = function() { var symbol_record; var value; var BgL_sc_symbolzd2record_16zd2; var sym; var sc_sym_17; var term; var lst; var sc_term_18; var sc_term_19; { (BgL_sc_za2symbolzd2recordszd2alistza2_2z00_nboyer = null); (if_constructor_nboyer = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer("\u1E9Cif"))); (false_term_nboyer = ((sc_term_19 = (new sc_Pair("\u1E9Cf",null))), (!(sc_term_19 instanceof sc_Pair)?sc_term_19:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_19.car))), (translate_args_nboyer((sc_term_19.cdr)))))))); (true_term_nboyer = ((sc_term_18 = (new sc_Pair("\u1E9Ct",null))), (!(sc_term_18 instanceof sc_Pair)?sc_term_18:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_18.car))), (translate_args_nboyer((sc_term_18.cdr)))))))); (lst = sc_const_3_nboyer); while (!(lst === null)) { { (term = (lst.car)); if (((term instanceof sc_Pair)&&(((term.car)==="\u1E9Cequal")&&((term.cdr.car) instanceof sc_Pair)))) { (sc_sym_17 = ((term.cdr.car).car)); (value = (new sc_Pair((!(term instanceof sc_Pair)?term:(new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((term.car))), (translate_args_nboyer((term.cdr)))))), ((sym = ((term.cdr.car).car)), (BgL_sc_symbolzd2record_16zd2 = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sym))), (BgL_sc_symbolzd2record_16zd2[(1)]))))); (symbol_record = (BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer(sc_sym_17))); (symbol_record[(1)] = value); } else (sc_error("ADD-LEMMA did not like term: ", term)); (lst = (lst.cdr)); } } return true; } }; BgL_testzd2boyerzd2 = function(n) { var optrOpnd; var term; var sc_n_20; var answer; var sc_term_21; var sc_term_22; { (rewrite_count_nboyer = (0)); (term = sc_const_4_nboyer); (sc_n_20 = n); while (!(sc_n_20=== 0)) { { (term = (sc_list("\u1E9Cor", term, (new sc_Pair("\u1E9Cf",null))))); (--sc_n_20); } } (sc_term_22 = term); if (!(sc_term_22 instanceof sc_Pair)) (optrOpnd = sc_term_22); else (optrOpnd = (new sc_Pair((BgL_sc_symbolzd2ze3symbolzd2record_1ze3_nboyer((sc_term_22.car))), (translate_args_nboyer((sc_term_22.cdr)))))); (sc_term_21 = (apply_subst_nboyer(((const_nboyer === null)?null:(new sc_Pair((new sc_Pair((const_nboyer.car.car), (translate_term_nboyer((const_nboyer.car.cdr))))), (translate_alist_nboyer((const_nboyer.cdr)))))), optrOpnd))); (answer = (tautologyp_nboyer((rewrite_nboyer(sc_term_21)), null, null))); (sc_write(rewrite_count_nboyer)); (sc_display(" rewrites")); (sc_newline()); if ((answer!== false)) return rewrite_count_nboyer; else return false; } }; } /* Exported Variables */ var BgL_parsezd2ze3nbzd2treesze3; var BgL_earleyzd2benchmarkzd2; var BgL_parsezd2ze3parsedzf3zc2; var test; var BgL_parsezd2ze3treesz31; var BgL_makezd2parserzd2; /* End Exports */ var const_earley; { (const_earley = (new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair((new sc_Pair("\u1E9Ca",null)),(new sc_Pair((new sc_Pair("\u1E9Cs",(new sc_Pair("\u1E9Cs",null)))),null)))))),null))); BgL_makezd2parserzd2 = function(grammar, lexer) { var i; var parser_descr; var def_loop; var nb_nts; var names; var steps; var predictors; var enders; var starters; var nts; var sc_names_1; var sc_steps_2; var sc_predictors_3; var sc_enders_4; var sc_starters_5; var nb_confs; var BgL_sc_defzd2loop_6zd2; var BgL_sc_nbzd2nts_7zd2; var sc_nts_8; var BgL_sc_defzd2loop_9zd2; var ind; { ind = function(nt, sc_nts_10) { var i; { (i = ((sc_nts_10.length)-(1))); while (true) { if ((i>=(0))) if ((sc_isEqual((sc_nts_10[i]), nt))) return i; else (--i); else return false; } } }; (sc_nts_8 = ((BgL_sc_defzd2loop_9zd2 = function(defs, sc_nts_11) { var rule_loop; var head; var def; return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, sc_nts_12) { var nt; var l; var sc_nts_13; var rule; if ((rules instanceof sc_Pair)) { (rule = (rules.car)); (l = rule); (sc_nts_13 = sc_nts_12); while ((l instanceof sc_Pair)) { { (nt = (l.car)); (l = (l.cdr)); (sc_nts_13 = (((sc_member(nt, sc_nts_13))!== false)?sc_nts_13:(new sc_Pair(nt, sc_nts_13)))); } } return (rule_loop((rules.cdr), sc_nts_13)); } else return (BgL_sc_defzd2loop_9zd2((defs.cdr), sc_nts_12)); }), (rule_loop((def.cdr), (((sc_member(head, sc_nts_11))!== false)?sc_nts_11:(new sc_Pair(head, sc_nts_11)))))):(sc_list2vector((sc_reverse(sc_nts_11))))); }), (BgL_sc_defzd2loop_9zd2(grammar, null)))); (BgL_sc_nbzd2nts_7zd2 = (sc_nts_8.length)); (nb_confs = (((BgL_sc_defzd2loop_6zd2 = function(defs, BgL_sc_nbzd2confs_14zd2) { var rule_loop; var def; return ((defs instanceof sc_Pair)?((def = (defs.car)), (rule_loop = function(rules, BgL_sc_nbzd2confs_15zd2) { var l; var BgL_sc_nbzd2confs_16zd2; var rule; if ((rules instanceof sc_Pair)) { (rule = (rules.car)); (l = rule); (BgL_sc_nbzd2confs_16zd2 = BgL_sc_nbzd2confs_15zd2); while ((l instanceof sc_Pair)) { { (l = (l.cdr)); (++BgL_sc_nbzd2confs_16zd2); } } return (rule_loop((rules.cdr), (BgL_sc_nbzd2confs_16zd2+(1)))); } else return (BgL_sc_defzd2loop_6zd2((defs.cdr), BgL_sc_nbzd2confs_15zd2)); }), (rule_loop((def.cdr), BgL_sc_nbzd2confs_14zd2))):BgL_sc_nbzd2confs_14zd2); }), (BgL_sc_defzd2loop_6zd2(grammar, (0))))+BgL_sc_nbzd2nts_7zd2)); (sc_starters_5 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); (sc_enders_4 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); (sc_predictors_3 = (sc_makeVector(BgL_sc_nbzd2nts_7zd2, null))); (sc_steps_2 = (sc_makeVector(nb_confs, false))); (sc_names_1 = (sc_makeVector(nb_confs, false))); (nts = sc_nts_8); (starters = sc_starters_5); (enders = sc_enders_4); (predictors = sc_predictors_3); (steps = sc_steps_2); (names = sc_names_1); (nb_nts = (sc_nts_8.length)); (i = (nb_nts-(1))); while ((i>=(0))) { { (sc_steps_2[i] = (i-nb_nts)); (sc_names_1[i] = (sc_list((sc_nts_8[i]), (0)))); (sc_enders_4[i] = (sc_list(i))); (--i); } } def_loop = function(defs, conf) { var rule_loop; var head; var def; return ((defs instanceof sc_Pair)?((def = (defs.car)), (head = (def.car)), (rule_loop = function(rules, conf, rule_num) { var i; var sc_i_17; var nt; var l; var sc_conf_18; var sc_i_19; var rule; if ((rules instanceof sc_Pair)) { (rule = (rules.car)); (names[conf] = (sc_list(head, rule_num))); (sc_i_19 = (ind(head, nts))); (starters[sc_i_19] = (new sc_Pair(conf, (starters[sc_i_19])))); (l = rule); (sc_conf_18 = conf); while ((l instanceof sc_Pair)) { { (nt = (l.car)); (steps[sc_conf_18] = (ind(nt, nts))); (sc_i_17 = (ind(nt, nts))); (predictors[sc_i_17] = (new sc_Pair(sc_conf_18, (predictors[sc_i_17])))); (l = (l.cdr)); (++sc_conf_18); } } (steps[sc_conf_18] = ((ind(head, nts))-nb_nts)); (i = (ind(head, nts))); (enders[i] = (new sc_Pair(sc_conf_18, (enders[i])))); return (rule_loop((rules.cdr), (sc_conf_18+(1)), (rule_num+(1)))); } else return (def_loop((defs.cdr), conf)); }), (rule_loop((def.cdr), conf, (1)))):undefined); }; (def_loop(grammar, (sc_nts_8.length))); (parser_descr = [lexer, sc_nts_8, sc_starters_5, sc_enders_4, sc_predictors_3, sc_steps_2, sc_names_1]); return function(input) { var optrOpnd; var sc_optrOpnd_20; var sc_optrOpnd_21; var sc_optrOpnd_22; var loop1; var BgL_sc_stateza2_23za2; var toks; var BgL_sc_nbzd2nts_24zd2; var sc_steps_25; var sc_enders_26; var state_num; var BgL_sc_statesza2_27za2; var states; var i; var conf; var l; var tok_nts; var sc_i_28; var sc_i_29; var l1; var l2; var tok; var tail1129; var L1125; var goal_enders; var BgL_sc_statesza2_30za2; var BgL_sc_nbzd2nts_31zd2; var BgL_sc_nbzd2confs_32zd2; var nb_toks; var goal_starters; var sc_states_33; var BgL_sc_nbzd2confs_34zd2; var BgL_sc_nbzd2toks_35zd2; var sc_toks_36; var falseHead1128; var sc_names_37; var sc_steps_38; var sc_predictors_39; var sc_enders_40; var sc_starters_41; var sc_nts_42; var lexer; var sc_ind_43; var make_states; var BgL_sc_confzd2setzd2getza2_44za2; var conf_set_merge_new_bang; var conf_set_adjoin; var BgL_sc_confzd2setzd2adjoinza2_45za2; var BgL_sc_confzd2setzd2adjoinza2za2_46z00; var conf_set_union; var forw; var is_parsed; var deriv_trees; var BgL_sc_derivzd2treesza2_47z70; var nb_deriv_trees; var BgL_sc_nbzd2derivzd2treesza2_48za2; { sc_ind_43 = function(nt, sc_nts_49) { var i; { (i = ((sc_nts_49.length)-(1))); while (true) { if ((i>=(0))) if ((sc_isEqual((sc_nts_49[i]), nt))) return i; else (--i); else return false; } } }; make_states = function(BgL_sc_nbzd2toks_50zd2, BgL_sc_nbzd2confs_51zd2) { var v; var i; var sc_states_52; { (sc_states_52 = (sc_makeVector((BgL_sc_nbzd2toks_50zd2+(1)), false))); (i = BgL_sc_nbzd2toks_50zd2); while ((i>=(0))) { { (v = (sc_makeVector((BgL_sc_nbzd2confs_51zd2+(1)), false))); (v[(0)] = (-1)); (sc_states_52[i] = v); (--i); } } return sc_states_52; } }; BgL_sc_confzd2setzd2getza2_44za2 = function(state, BgL_sc_statezd2num_53zd2, sc_conf_54) { var conf_set; var BgL_sc_confzd2set_55zd2; return ((BgL_sc_confzd2set_55zd2 = (state[(sc_conf_54+(1))])), ((BgL_sc_confzd2set_55zd2!== false)?BgL_sc_confzd2set_55zd2:((conf_set = (sc_makeVector((BgL_sc_statezd2num_53zd2+(6)), false))), (conf_set[(1)] = (-3)), (conf_set[(2)] = (-1)), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1)), (state[(sc_conf_54+(1))] = conf_set), conf_set))); }; conf_set_merge_new_bang = function(conf_set) { return ((conf_set[((conf_set[(1)])+(5))] = (conf_set[(4)])), (conf_set[(1)] = (conf_set[(3)])), (conf_set[(3)] = (-1)), (conf_set[(4)] = (-1))); }; conf_set_adjoin = function(state, conf_set, sc_conf_56, i) { var tail; return ((tail = (conf_set[(3)])), (conf_set[(i+(5))] = (-1)), (conf_set[(tail+(5))] = i), (conf_set[(3)] = i), ((tail<(0))?((conf_set[(0)] = (state[(0)])), (state[(0)] = sc_conf_56)):undefined)); }; BgL_sc_confzd2setzd2adjoinza2_45za2 = function(sc_states_57, BgL_sc_statezd2num_58zd2, l, i) { var conf_set; var sc_conf_59; var l1; var state; { (state = (sc_states_57[BgL_sc_statezd2num_58zd2])); (l1 = l); while ((l1 instanceof sc_Pair)) { { (sc_conf_59 = (l1.car)); (conf_set = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_58zd2, sc_conf_59))); if (((conf_set[(i+(5))])=== false)) { (conf_set_adjoin(state, conf_set, sc_conf_59, i)); (l1 = (l1.cdr)); } else (l1 = (l1.cdr)); } } return undefined; } }; BgL_sc_confzd2setzd2adjoinza2za2_46z00 = function(sc_states_60, BgL_sc_statesza2_61za2, BgL_sc_statezd2num_62zd2, sc_conf_63, i) { var BgL_sc_confzd2setza2_64z70; var BgL_sc_stateza2_65za2; var conf_set; var state; return ((state = (sc_states_60[BgL_sc_statezd2num_62zd2])), ((((conf_set = (state[(sc_conf_63+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)?((BgL_sc_stateza2_65za2 = (BgL_sc_statesza2_61za2[BgL_sc_statezd2num_62zd2])), (BgL_sc_confzd2setza2_64z70 = (BgL_sc_confzd2setzd2getza2_44za2(BgL_sc_stateza2_65za2, BgL_sc_statezd2num_62zd2, sc_conf_63))), (((BgL_sc_confzd2setza2_64z70[(i+(5))])=== false)?(conf_set_adjoin(BgL_sc_stateza2_65za2, BgL_sc_confzd2setza2_64z70, sc_conf_63, i)):undefined), true):false)); }; conf_set_union = function(state, conf_set, sc_conf_66, other_set) { var i; { (i = (other_set[(2)])); while ((i>=(0))) { if (((conf_set[(i+(5))])=== false)) { (conf_set_adjoin(state, conf_set, sc_conf_66, i)); (i = (other_set[(i+(5))])); } else (i = (other_set[(i+(5))])); } return undefined; } }; forw = function(sc_states_67, BgL_sc_statezd2num_68zd2, sc_starters_69, sc_enders_70, sc_predictors_71, sc_steps_72, sc_nts_73) { var next_set; var next; var conf_set; var ender; var l; var starter_set; var starter; var sc_l_74; var sc_loop1_75; var head; var BgL_sc_confzd2set_76zd2; var BgL_sc_statezd2num_77zd2; var state; var sc_states_78; var preds; var BgL_sc_confzd2set_79zd2; var step; var sc_conf_80; var BgL_sc_nbzd2nts_81zd2; var sc_state_82; { (sc_state_82 = (sc_states_67[BgL_sc_statezd2num_68zd2])); (BgL_sc_nbzd2nts_81zd2 = (sc_nts_73.length)); while (true) { { (sc_conf_80 = (sc_state_82[(0)])); if ((sc_conf_80>=(0))) { (step = (sc_steps_72[sc_conf_80])); (BgL_sc_confzd2set_79zd2 = (sc_state_82[(sc_conf_80+(1))])); (head = (BgL_sc_confzd2set_79zd2[(4)])); (sc_state_82[(0)] = (BgL_sc_confzd2set_79zd2[(0)])); (conf_set_merge_new_bang(BgL_sc_confzd2set_79zd2)); if ((step>=(0))) { (sc_l_74 = (sc_starters_69[step])); while ((sc_l_74 instanceof sc_Pair)) { { (starter = (sc_l_74.car)); (starter_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, starter))); if (((starter_set[(BgL_sc_statezd2num_68zd2+(5))])=== false)) { (conf_set_adjoin(sc_state_82, starter_set, starter, BgL_sc_statezd2num_68zd2)); (sc_l_74 = (sc_l_74.cdr)); } else (sc_l_74 = (sc_l_74.cdr)); } } (l = (sc_enders_70[step])); while ((l instanceof sc_Pair)) { { (ender = (l.car)); if ((((conf_set = (sc_state_82[(ender+(1))])), ((conf_set!== false)?(conf_set[(BgL_sc_statezd2num_68zd2+(5))]):false))!== false)) { (next = (sc_conf_80+(1))); (next_set = (BgL_sc_confzd2setzd2getza2_44za2(sc_state_82, BgL_sc_statezd2num_68zd2, next))); (conf_set_union(sc_state_82, next_set, next, BgL_sc_confzd2set_79zd2)); (l = (l.cdr)); } else (l = (l.cdr)); } } } else { (preds = (sc_predictors_71[(step+BgL_sc_nbzd2nts_81zd2)])); (sc_states_78 = sc_states_67); (state = sc_state_82); (BgL_sc_statezd2num_77zd2 = BgL_sc_statezd2num_68zd2); (BgL_sc_confzd2set_76zd2 = BgL_sc_confzd2set_79zd2); sc_loop1_75 = function(l) { var sc_state_83; var BgL_sc_nextzd2set_84zd2; var sc_next_85; var pred_set; var i; var pred; if ((l instanceof sc_Pair)) { (pred = (l.car)); (i = head); while ((i>=(0))) { { (pred_set = ((sc_state_83 = (sc_states_78[i])), (sc_state_83[(pred+(1))]))); if ((pred_set!== false)) { (sc_next_85 = (pred+(1))); (BgL_sc_nextzd2set_84zd2 = (BgL_sc_confzd2setzd2getza2_44za2(state, BgL_sc_statezd2num_77zd2, sc_next_85))); (conf_set_union(state, BgL_sc_nextzd2set_84zd2, sc_next_85, pred_set)); } (i = (BgL_sc_confzd2set_76zd2[(i+(5))])); } } return (sc_loop1_75((l.cdr))); } else return undefined; }; (sc_loop1_75(preds)); } } else return undefined; } } } }; is_parsed = function(nt, i, j, sc_nts_86, sc_enders_87, sc_states_88) { var conf_set; var state; var sc_conf_89; var l; var BgL_sc_ntza2_90za2; { (BgL_sc_ntza2_90za2 = (sc_ind_43(nt, sc_nts_86))); if ((BgL_sc_ntza2_90za2!== false)) { (sc_nts_86.length); (l = (sc_enders_87[BgL_sc_ntza2_90za2])); while (true) { if ((l instanceof sc_Pair)) { (sc_conf_89 = (l.car)); if ((((state = (sc_states_88[j])), (conf_set = (state[(sc_conf_89+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) return true; else (l = (l.cdr)); } else return false; } } else return false; } }; deriv_trees = function(sc_conf_91, i, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2) { var sc_loop1_98; var prev; var name; return ((name = (sc_names_94[sc_conf_91])), ((name!== false)?((sc_conf_91=(0))) if (((k>=i)&&(((sc_state_99 = (sc_states_96[k])), (conf_set = (sc_state_99[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))) { (prev_trees = (deriv_trees(prev, i, k, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2))); (ender_trees = (deriv_trees(ender, k, j, sc_enders_92, sc_steps_93, sc_names_94, sc_toks_95, sc_states_96, BgL_sc_nbzd2nts_97zd2))); loop3 = function(l3, l2) { var l4; var sc_l2_100; var ender_tree; if ((l3 instanceof sc_Pair)) { (ender_tree = (sc_list((l3.car)))); (l4 = prev_trees); (sc_l2_100 = l2); while ((l4 instanceof sc_Pair)) { { (sc_l2_100 = (new sc_Pair((sc_append((l4.car), ender_tree)), sc_l2_100))); (l4 = (l4.cdr)); } } return (loop3((l3.cdr), sc_l2_100)); } else return (loop2((ender_set[(k+(5))]), l2)); }; return (loop3(ender_trees, l2)); } else (k = (ender_set[(k+(5))])); else return (sc_loop1_98((l1.cdr), l2)); } }; return (loop2((ender_set[(2)]), l2)); } else (l1 = (l1.cdr)); } else return l2; } }), (sc_loop1_98((sc_enders_92[(sc_steps_93[prev])]), null))))); }; BgL_sc_derivzd2treesza2_47z70 = function(nt, i, j, sc_nts_101, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106) { var conf_set; var state; var sc_conf_107; var l; var trees; var BgL_sc_nbzd2nts_108zd2; var BgL_sc_ntza2_109za2; { (BgL_sc_ntza2_109za2 = (sc_ind_43(nt, sc_nts_101))); if ((BgL_sc_ntza2_109za2!== false)) { (BgL_sc_nbzd2nts_108zd2 = (sc_nts_101.length)); (l = (sc_enders_102[BgL_sc_ntza2_109za2])); (trees = null); while ((l instanceof sc_Pair)) { { (sc_conf_107 = (l.car)); if ((((state = (sc_states_106[j])), (conf_set = (state[(sc_conf_107+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) { (l = (l.cdr)); (trees = (sc_append((deriv_trees(sc_conf_107, i, j, sc_enders_102, sc_steps_103, sc_names_104, sc_toks_105, sc_states_106, BgL_sc_nbzd2nts_108zd2)), trees))); } else (l = (l.cdr)); } } return trees; } else return false; } }; nb_deriv_trees = function(sc_conf_110, i, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2) { var sc_loop1_116; var tmp1124; var prev; return ((prev = (sc_conf_110-(1))), ((((tmp1124 = (sc_conf_110=(0))) { if (((k>=i)&&(((state = (sc_states_114[k])), (conf_set = (state[(prev+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false))) { (nb_prev_trees = (nb_deriv_trees(prev, i, k, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2))); (nb_ender_trees = (nb_deriv_trees(ender, k, j, sc_enders_111, sc_steps_112, sc_toks_113, sc_states_114, BgL_sc_nbzd2nts_115zd2))); (k = (ender_set[(k+(5))])); (n +=(nb_prev_trees*nb_ender_trees)); } else (k = (ender_set[(k+(5))])); } return (sc_loop1_116((l.cdr), n)); } else (l = (l.cdr)); } else return sc_n_118; } }), (sc_loop1_116((sc_enders_111[(sc_steps_112[prev])]), (0)))))); }; BgL_sc_nbzd2derivzd2treesza2_48za2 = function(nt, i, j, sc_nts_119, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123) { var conf_set; var state; var sc_conf_124; var l; var nb_trees; var BgL_sc_nbzd2nts_125zd2; var BgL_sc_ntza2_126za2; { (BgL_sc_ntza2_126za2 = (sc_ind_43(nt, sc_nts_119))); if ((BgL_sc_ntza2_126za2!== false)) { (BgL_sc_nbzd2nts_125zd2 = (sc_nts_119.length)); (l = (sc_enders_120[BgL_sc_ntza2_126za2])); (nb_trees = (0)); while ((l instanceof sc_Pair)) { { (sc_conf_124 = (l.car)); if ((((state = (sc_states_123[j])), (conf_set = (state[(sc_conf_124+(1))])), ((conf_set!== false)?(conf_set[(i+(5))]):false))!== false)) { (l = (l.cdr)); (nb_trees = ((nb_deriv_trees(sc_conf_124, i, j, sc_enders_120, sc_steps_121, sc_toks_122, sc_states_123, BgL_sc_nbzd2nts_125zd2))+nb_trees)); } else (l = (l.cdr)); } } return nb_trees; } else return false; } }; (lexer = (parser_descr[(0)])); (sc_nts_42 = (parser_descr[(1)])); (sc_starters_41 = (parser_descr[(2)])); (sc_enders_40 = (parser_descr[(3)])); (sc_predictors_39 = (parser_descr[(4)])); (sc_steps_38 = (parser_descr[(5)])); (sc_names_37 = (parser_descr[(6)])); (falseHead1128 = (new sc_Pair(null, null))); (L1125 = (lexer(input))); (tail1129 = falseHead1128); while (!(L1125 === null)) { { (tok = (L1125.car)); (l1 = (tok.cdr)); (l2 = null); while ((l1 instanceof sc_Pair)) { { (sc_i_29 = (sc_ind_43((l1.car), sc_nts_42))); if ((sc_i_29!== false)) { (l1 = (l1.cdr)); (l2 = (new sc_Pair(sc_i_29, l2))); } else (l1 = (l1.cdr)); } } (sc_optrOpnd_22 = (new sc_Pair((tok.car), (sc_reverse(l2))))); (sc_optrOpnd_21 = (new sc_Pair(sc_optrOpnd_22, null))); (tail1129.cdr = sc_optrOpnd_21); (tail1129 = (tail1129.cdr)); (L1125 = (L1125.cdr)); } } (sc_optrOpnd_20 = (falseHead1128.cdr)); (sc_toks_36 = (sc_list2vector(sc_optrOpnd_20))); (BgL_sc_nbzd2toks_35zd2 = (sc_toks_36.length)); (BgL_sc_nbzd2confs_34zd2 = (sc_steps_38.length)); (sc_states_33 = (make_states(BgL_sc_nbzd2toks_35zd2, BgL_sc_nbzd2confs_34zd2))); (goal_starters = (sc_starters_41[(0)])); (BgL_sc_confzd2setzd2adjoinza2_45za2(sc_states_33, (0), goal_starters, (0))); (forw(sc_states_33, (0), sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_nts_42)); (sc_i_28 = (0)); while ((sc_i_28=(0))) { { (states = sc_states_33); (BgL_sc_statesza2_27za2 = BgL_sc_statesza2_30za2); (state_num = i); (sc_enders_26 = sc_enders_40); (sc_steps_25 = sc_steps_38); (BgL_sc_nbzd2nts_24zd2 = BgL_sc_nbzd2nts_31zd2); (toks = sc_toks_36); (BgL_sc_stateza2_23za2 = (BgL_sc_statesza2_30za2[i])); loop1 = function() { var sc_loop1_127; var prev; var BgL_sc_statesza2_128za2; var sc_states_129; var j; var i; var sc_i_130; var head; var conf_set; var sc_conf_131; { (sc_conf_131 = (BgL_sc_stateza2_23za2[(0)])); if ((sc_conf_131>=(0))) { (conf_set = (BgL_sc_stateza2_23za2[(sc_conf_131+(1))])); (head = (conf_set[(4)])); (BgL_sc_stateza2_23za2[(0)] = (conf_set[(0)])); (conf_set_merge_new_bang(conf_set)); (sc_i_130 = head); while ((sc_i_130>=(0))) { { (i = sc_i_130); (j = state_num); (sc_states_129 = states); (BgL_sc_statesza2_128za2 = BgL_sc_statesza2_27za2); (prev = (sc_conf_131-(1))); if (((sc_conf_131>=BgL_sc_nbzd2nts_24zd2)&&((sc_steps_25[prev])>=(0)))) { sc_loop1_127 = function(l) { var k; var ender_set; var state; var ender; var l; while (true) { if ((l instanceof sc_Pair)) { (ender = (l.car)); (ender_set = ((state = (sc_states_129[j])), (state[(ender+(1))]))); if ((ender_set!== false)) { (k = (ender_set[(2)])); while ((k>=(0))) { { if ((k>=i)) if (((BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, k, prev, i))!== false)) (BgL_sc_confzd2setzd2adjoinza2za2_46z00(sc_states_129, BgL_sc_statesza2_128za2, j, ender, k)); (k = (ender_set[(k+(5))])); } } return (sc_loop1_127((l.cdr))); } else (l = (l.cdr)); } else return undefined; } }; (sc_loop1_127((sc_enders_26[(sc_steps_25[prev])]))); } (sc_i_130 = (conf_set[(sc_i_130+(5))])); } } return (loop1()); } else return undefined; } }; (loop1()); (--i); } } (optrOpnd = BgL_sc_statesza2_30za2); return [sc_nts_42, sc_starters_41, sc_enders_40, sc_predictors_39, sc_steps_38, sc_names_37, sc_toks_36, optrOpnd, is_parsed, BgL_sc_derivzd2treesza2_47z70, BgL_sc_nbzd2derivzd2treesza2_48za2]; } }; } }; BgL_parsezd2ze3parsedzf3zc2 = function(parse, nt, i, j) { var is_parsed; var states; var enders; var nts; return ((nts = (parse[(0)])), (enders = (parse[(2)])), (states = (parse[(7)])), (is_parsed = (parse[(8)])), (is_parsed(nt, i, j, nts, enders, states))); }; BgL_parsezd2ze3treesz31 = function(parse, nt, i, j) { var BgL_sc_derivzd2treesza2_132z70; var states; var toks; var names; var steps; var enders; var nts; return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (names = (parse[(5)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_derivzd2treesza2_132z70 = (parse[(9)])), (BgL_sc_derivzd2treesza2_132z70(nt, i, j, nts, enders, steps, names, toks, states))); }; BgL_parsezd2ze3nbzd2treesze3 = function(parse, nt, i, j) { var BgL_sc_nbzd2derivzd2treesza2_133za2; var states; var toks; var steps; var enders; var nts; return ((nts = (parse[(0)])), (enders = (parse[(2)])), (steps = (parse[(4)])), (toks = (parse[(6)])), (states = (parse[(7)])), (BgL_sc_nbzd2derivzd2treesza2_133za2 = (parse[(10)])), (BgL_sc_nbzd2derivzd2treesza2_133za2(nt, i, j, nts, enders, steps, toks, states))); }; test = function(k) { var x; var p; return ((p = (BgL_makezd2parserzd2(const_earley, function(l) { var sc_x_134; var tail1134; var L1130; var falseHead1133; { (falseHead1133 = (new sc_Pair(null, null))); (tail1134 = falseHead1133); (L1130 = l); while (!(L1130 === null)) { { (tail1134.cdr = (new sc_Pair(((sc_x_134 = (L1130.car)), (sc_list(sc_x_134, sc_x_134))), null))); (tail1134 = (tail1134.cdr)); (L1130 = (L1130.cdr)); } } return (falseHead1133.cdr); } }))), (x = (p((sc_vector2list((sc_makeVector(k, "\u1E9Ca"))))))), (sc_length((BgL_parsezd2ze3treesz31(x, "\u1E9Cs", (0), k))))); }; BgL_earleyzd2benchmarkzd2 = function() { var args = null; for (var sc_tmp = arguments.length - 1; sc_tmp >= 0; sc_tmp--) { args = sc_cons(arguments[sc_tmp], args); } var k; return ((k = ((args === null)?(7):(args.car))), (BgL_runzd2benchmarkzd2("earley", (1), function() { return (test(k)); }, function(result) { return ((sc_display(result)), (sc_newline()), result == 132); }))); }; } /************* END OF GENERATED CODE *************/ // Invoke this function to run a benchmark. // The first argument is a string identifying the benchmark. // The second argument is the number of times to run the benchmark. // The third argument is a function that runs the benchmark. // The fourth argument is a unary function that warns if the result // returned by the benchmark is incorrect. // // Example: // RunBenchmark("new Array()", // 1, // function () { new Array(1000000); } // function (v) { // return (v instanceof Array) && (v.length == 1000000); // }); SC_DEFAULT_OUT = new sc_GenericOutputPort(function(s) {}); SC_ERROR_OUT = SC_DEFAULT_OUT; function RunBenchmark(name, count, run, warn) { for (var n = 0; n < count; ++n) { result = run(); if (!warn(result)) { throw new Error("Earley or Boyer did incorrect number of rewrites"); } } } var BgL_runzd2benchmarkzd2 = RunBenchmark; v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/navier-stokes.js000066400000000000000000000306221211511573600244600ustar00rootroot00000000000000/** * Copyright 2012 the V8 project authors. All rights reserved. * Copyright 2009 Oliver Hunt * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ var NavierStokes = new BenchmarkSuite('NavierStokes', 1484000, [new Benchmark('NavierStokes', runNavierStokes, setupNavierStokes, tearDownNavierStokes)]); var solver = null; function runNavierStokes() { solver.update(); } function setupNavierStokes() { solver = new FluidField(null); solver.setResolution(128, 128); solver.setIterations(20); solver.setDisplayFunction(function(){}); solver.setUICallback(prepareFrame); solver.reset(); } function tearDownNavierStokes() { solver = null; } function addPoints(field) { var n = 64; for (var i = 1; i <= n; i++) { field.setVelocity(i, i, n, n); field.setDensity(i, i, 5); field.setVelocity(i, n - i, -n, -n); field.setDensity(i, n - i, 20); field.setVelocity(128 - i, n + i, -n, -n); field.setDensity(128 - i, n + i, 30); } } var framesTillAddingPoints = 0; var framesBetweenAddingPoints = 5; function prepareFrame(field) { if (framesTillAddingPoints == 0) { addPoints(field); framesTillAddingPoints = framesBetweenAddingPoints; framesBetweenAddingPoints++; } else { framesTillAddingPoints--; } } // Code from Oliver Hunt (http://nerget.com/fluidSim/pressure.js) starts here. function FluidField(canvas) { function addFields(x, s, dt) { for (var i=0; i Wp5) x = Wp5; var i0 = x | 0; var i1 = i0 + 1; if (y < 0.5) y = 0.5; else if (y > Hp5) y = Hp5; var j0 = y | 0; var j1 = j0 + 1; var s1 = x - i0; var s0 = 1 - s1; var t1 = y - j0; var t0 = 1 - t1; var row1 = j0 * rowSize; var row2 = j1 * rowSize; d[pos] = s0 * (t0 * d0[i0 + row1] + t1 * d0[i0 + row2]) + s1 * (t0 * d0[i1 + row1] + t1 * d0[i1 + row2]); } } set_bnd(b, d); } function project(u, v, p, div) { var h = -0.5 / Math.sqrt(width * height); for (var j = 1 ; j <= height; j++ ) { var row = j * rowSize; var previousRow = (j - 1) * rowSize; var prevValue = row - 1; var currentRow = row; var nextValue = row + 1; var nextRow = (j + 1) * rowSize; for (var i = 1; i <= width; i++ ) { div[++currentRow] = h * (u[++nextValue] - u[++prevValue] + v[++nextRow] - v[++previousRow]); p[currentRow] = 0; } } set_bnd(0, div); set_bnd(0, p); lin_solve(0, p, div, 1, 4 ); var wScale = 0.5 * width; var hScale = 0.5 * height; for (var j = 1; j<= height; j++ ) { var prevPos = j * rowSize - 1; var currentPos = j * rowSize; var nextPos = j * rowSize + 1; var prevRow = (j - 1) * rowSize; var currentRow = j * rowSize; var nextRow = (j + 1) * rowSize; for (var i = 1; i<= width; i++) { u[++currentPos] -= wScale * (p[++nextPos] - p[++prevPos]); v[currentPos] -= hScale * (p[++nextRow] - p[++prevRow]); } } set_bnd(1, u); set_bnd(2, v); } function dens_step(x, x0, u, v, dt) { addFields(x, x0, dt); diffuse(0, x0, x, dt ); advect(0, x, x0, u, v, dt ); } function vel_step(u, v, u0, v0, dt) { addFields(u, u0, dt ); addFields(v, v0, dt ); var temp = u0; u0 = u; u = temp; var temp = v0; v0 = v; v = temp; diffuse2(u,u0,v,v0, dt); project(u, v, u0, v0); var temp = u0; u0 = u; u = temp; var temp = v0; v0 = v; v = temp; advect(1, u, u0, u0, v0, dt); advect(2, v, v0, u0, v0, dt); project(u, v, u0, v0 ); } var uiCallback = function(d,u,v) {}; function Field(dens, u, v) { // Just exposing the fields here rather than using accessors is a measurable win during display (maybe 5%) // but makes the code ugly. this.setDensity = function(x, y, d) { dens[(x + 1) + (y + 1) * rowSize] = d; } this.getDensity = function(x, y) { return dens[(x + 1) + (y + 1) * rowSize]; } this.setVelocity = function(x, y, xv, yv) { u[(x + 1) + (y + 1) * rowSize] = xv; v[(x + 1) + (y + 1) * rowSize] = yv; } this.getXVelocity = function(x, y) { return u[(x + 1) + (y + 1) * rowSize]; } this.getYVelocity = function(x, y) { return v[(x + 1) + (y + 1) * rowSize]; } this.width = function() { return width; } this.height = function() { return height; } } function queryUI(d, u, v) { for (var i = 0; i < size; i++) u[i] = v[i] = d[i] = 0.0; uiCallback(new Field(d, u, v)); } this.update = function () { queryUI(dens_prev, u_prev, v_prev); vel_step(u, v, u_prev, v_prev, dt); dens_step(dens, dens_prev, u, v, dt); displayFunc(new Field(dens, u, v)); } this.setDisplayFunction = function(func) { displayFunc = func; } this.iterations = function() { return iterations; } this.setIterations = function(iters) { if (iters > 0 && iters <= 100) iterations = iters; } this.setUICallback = function(callback) { uiCallback = callback; } var iterations = 10; var visc = 0.5; var dt = 0.1; var dens; var dens_prev; var u; var u_prev; var v; var v_prev; var width; var height; var rowSize; var size; var displayFunc; function reset() { rowSize = width + 2; size = (width+2)*(height+2); dens = new Array(size); dens_prev = new Array(size); u = new Array(size); u_prev = new Array(size); v = new Array(size); v_prev = new Array(size); for (var i = 0; i < size; i++) dens_prev[i] = u_prev[i] = v_prev[i] = dens[i] = u[i] = v[i] = 0; } this.reset = reset; this.setResolution = function (hRes, wRes) { var res = wRes * hRes; if (res > 0 && res < 1000000 && (wRes != width || hRes != height)) { width = wRes; height = hRes; reset(); return true; } return false; } this.setResolution(64, 64); } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/raytrace.js000066400000000000000000000665341211511573600235130ustar00rootroot00000000000000// The ray tracer code in this file is written by Adam Burmister. It // is available in its original form from: // // http://labs.flog.nz.co/raytracer/ // // It has been modified slightly by Google to work as a standalone // benchmark, but the all the computational code remains // untouched. This file also contains a copy of parts of the Prototype // JavaScript framework which is used by the ray tracer. var RayTrace = new BenchmarkSuite('RayTrace', 739989, [ new Benchmark('RayTrace', renderScene) ]); // Variable used to hold a number that can be used to verify that // the scene was ray traced correctly. var checkNumber; // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // The following is a copy of parts of the Prototype JavaScript library: // Prototype JavaScript framework, version 1.5.0 // (c) 2005-2007 Sam Stephenson // // Prototype is freely distributable under the terms of an MIT-style license. // For details, see the Prototype web site: http://prototype.conio.net/ var Class = { create: function() { return function() { this.initialize.apply(this, arguments); } } }; Object.extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } return destination; }; // ------------------------------------------------------------------------ // ------------------------------------------------------------------------ // The rest of this file is the actual ray tracer written by Adam // Burmister. It's a concatenation of the following files: // // flog/color.js // flog/light.js // flog/vector.js // flog/ray.js // flog/scene.js // flog/material/basematerial.js // flog/material/solid.js // flog/material/chessboard.js // flog/shape/baseshape.js // flog/shape/sphere.js // flog/shape/plane.js // flog/intersectioninfo.js // flog/camera.js // flog/background.js // flog/engine.js /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Color = Class.create(); Flog.RayTracer.Color.prototype = { red : 0.0, green : 0.0, blue : 0.0, initialize : function(r, g, b) { if(!r) r = 0.0; if(!g) g = 0.0; if(!b) b = 0.0; this.red = r; this.green = g; this.blue = b; }, add : function(c1, c2){ var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red + c2.red; result.green = c1.green + c2.green; result.blue = c1.blue + c2.blue; return result; }, addScalar: function(c1, s){ var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red + s; result.green = c1.green + s; result.blue = c1.blue + s; result.limit(); return result; }, subtract: function(c1, c2){ var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red - c2.red; result.green = c1.green - c2.green; result.blue = c1.blue - c2.blue; return result; }, multiply : function(c1, c2) { var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red * c2.red; result.green = c1.green * c2.green; result.blue = c1.blue * c2.blue; return result; }, multiplyScalar : function(c1, f) { var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red * f; result.green = c1.green * f; result.blue = c1.blue * f; return result; }, divideFactor : function(c1, f) { var result = new Flog.RayTracer.Color(0,0,0); result.red = c1.red / f; result.green = c1.green / f; result.blue = c1.blue / f; return result; }, limit: function(){ this.red = (this.red > 0.0) ? ( (this.red > 1.0) ? 1.0 : this.red ) : 0.0; this.green = (this.green > 0.0) ? ( (this.green > 1.0) ? 1.0 : this.green ) : 0.0; this.blue = (this.blue > 0.0) ? ( (this.blue > 1.0) ? 1.0 : this.blue ) : 0.0; }, distance : function(color) { var d = Math.abs(this.red - color.red) + Math.abs(this.green - color.green) + Math.abs(this.blue - color.blue); return d; }, blend: function(c1, c2, w){ var result = new Flog.RayTracer.Color(0,0,0); result = Flog.RayTracer.Color.prototype.add( Flog.RayTracer.Color.prototype.multiplyScalar(c1, 1 - w), Flog.RayTracer.Color.prototype.multiplyScalar(c2, w) ); return result; }, brightness : function() { var r = Math.floor(this.red*255); var g = Math.floor(this.green*255); var b = Math.floor(this.blue*255); return (r * 77 + g * 150 + b * 29) >> 8; }, toString : function () { var r = Math.floor(this.red*255); var g = Math.floor(this.green*255); var b = Math.floor(this.blue*255); return "rgb("+ r +","+ g +","+ b +")"; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Light = Class.create(); Flog.RayTracer.Light.prototype = { position: null, color: null, intensity: 10.0, initialize : function(pos, color, intensity) { this.position = pos; this.color = color; this.intensity = (intensity ? intensity : 10.0); }, toString : function () { return 'Light [' + this.position.x + ',' + this.position.y + ',' + this.position.z + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Vector = Class.create(); Flog.RayTracer.Vector.prototype = { x : 0.0, y : 0.0, z : 0.0, initialize : function(x, y, z) { this.x = (x ? x : 0); this.y = (y ? y : 0); this.z = (z ? z : 0); }, copy: function(vector){ this.x = vector.x; this.y = vector.y; this.z = vector.z; }, normalize : function() { var m = this.magnitude(); return new Flog.RayTracer.Vector(this.x / m, this.y / m, this.z / m); }, magnitude : function() { return Math.sqrt((this.x * this.x) + (this.y * this.y) + (this.z * this.z)); }, cross : function(w) { return new Flog.RayTracer.Vector( -this.z * w.y + this.y * w.z, this.z * w.x - this.x * w.z, -this.y * w.x + this.x * w.y); }, dot : function(w) { return this.x * w.x + this.y * w.y + this.z * w.z; }, add : function(v, w) { return new Flog.RayTracer.Vector(w.x + v.x, w.y + v.y, w.z + v.z); }, subtract : function(v, w) { if(!w || !v) throw 'Vectors must be defined [' + v + ',' + w + ']'; return new Flog.RayTracer.Vector(v.x - w.x, v.y - w.y, v.z - w.z); }, multiplyVector : function(v, w) { return new Flog.RayTracer.Vector(v.x * w.x, v.y * w.y, v.z * w.z); }, multiplyScalar : function(v, w) { return new Flog.RayTracer.Vector(v.x * w, v.y * w, v.z * w); }, toString : function () { return 'Vector [' + this.x + ',' + this.y + ',' + this.z + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Ray = Class.create(); Flog.RayTracer.Ray.prototype = { position : null, direction : null, initialize : function(pos, dir) { this.position = pos; this.direction = dir; }, toString : function () { return 'Ray [' + this.position + ',' + this.direction + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Scene = Class.create(); Flog.RayTracer.Scene.prototype = { camera : null, shapes : [], lights : [], background : null, initialize : function() { this.camera = new Flog.RayTracer.Camera( new Flog.RayTracer.Vector(0,0,-5), new Flog.RayTracer.Vector(0,0,1), new Flog.RayTracer.Vector(0,1,0) ); this.shapes = new Array(); this.lights = new Array(); this.background = new Flog.RayTracer.Background(new Flog.RayTracer.Color(0,0,0.5), 0.2); } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; if(typeof(Flog.RayTracer.Material) == 'undefined') Flog.RayTracer.Material = {}; Flog.RayTracer.Material.BaseMaterial = Class.create(); Flog.RayTracer.Material.BaseMaterial.prototype = { gloss: 2.0, // [0...infinity] 0 = matt transparency: 0.0, // 0=opaque reflection: 0.0, // [0...infinity] 0 = no reflection refraction: 0.50, hasTexture: false, initialize : function() { }, getColor: function(u, v){ }, wrapUp: function(t){ t = t % 2.0; if(t < -1) t += 2.0; if(t >= 1) t -= 2.0; return t; }, toString : function () { return 'Material [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Material.Solid = Class.create(); Flog.RayTracer.Material.Solid.prototype = Object.extend( new Flog.RayTracer.Material.BaseMaterial(), { initialize : function(color, reflection, refraction, transparency, gloss) { this.color = color; this.reflection = reflection; this.transparency = transparency; this.gloss = gloss; this.hasTexture = false; }, getColor: function(u, v){ return this.color; }, toString : function () { return 'SolidMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; } } ); /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Material.Chessboard = Class.create(); Flog.RayTracer.Material.Chessboard.prototype = Object.extend( new Flog.RayTracer.Material.BaseMaterial(), { colorEven: null, colorOdd: null, density: 0.5, initialize : function(colorEven, colorOdd, reflection, transparency, gloss, density) { this.colorEven = colorEven; this.colorOdd = colorOdd; this.reflection = reflection; this.transparency = transparency; this.gloss = gloss; this.density = density; this.hasTexture = true; }, getColor: function(u, v){ var t = this.wrapUp(u * this.density) * this.wrapUp(v * this.density); if(t < 0.0) return this.colorEven; else return this.colorOdd; }, toString : function () { return 'ChessMaterial [gloss=' + this.gloss + ', transparency=' + this.transparency + ', hasTexture=' + this.hasTexture +']'; } } ); /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {}; Flog.RayTracer.Shape.Sphere = Class.create(); Flog.RayTracer.Shape.Sphere.prototype = { initialize : function(pos, radius, material) { this.radius = radius; this.position = pos; this.material = material; }, intersect: function(ray){ var info = new Flog.RayTracer.IntersectionInfo(); info.shape = this; var dst = Flog.RayTracer.Vector.prototype.subtract(ray.position, this.position); var B = dst.dot(ray.direction); var C = dst.dot(dst) - (this.radius * this.radius); var D = (B * B) - C; if(D > 0){ // intersection! info.isHit = true; info.distance = (-B) - Math.sqrt(D); info.position = Flog.RayTracer.Vector.prototype.add( ray.position, Flog.RayTracer.Vector.prototype.multiplyScalar( ray.direction, info.distance ) ); info.normal = Flog.RayTracer.Vector.prototype.subtract( info.position, this.position ).normalize(); info.color = this.material.getColor(0,0); } else { info.isHit = false; } return info; }, toString : function () { return 'Sphere [position=' + this.position + ', radius=' + this.radius + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; if(typeof(Flog.RayTracer.Shape) == 'undefined') Flog.RayTracer.Shape = {}; Flog.RayTracer.Shape.Plane = Class.create(); Flog.RayTracer.Shape.Plane.prototype = { d: 0.0, initialize : function(pos, d, material) { this.position = pos; this.d = d; this.material = material; }, intersect: function(ray){ var info = new Flog.RayTracer.IntersectionInfo(); var Vd = this.position.dot(ray.direction); if(Vd == 0) return info; // no intersection var t = -(this.position.dot(ray.position) + this.d) / Vd; if(t <= 0) return info; info.shape = this; info.isHit = true; info.position = Flog.RayTracer.Vector.prototype.add( ray.position, Flog.RayTracer.Vector.prototype.multiplyScalar( ray.direction, t ) ); info.normal = this.position; info.distance = t; if(this.material.hasTexture){ var vU = new Flog.RayTracer.Vector(this.position.y, this.position.z, -this.position.x); var vV = vU.cross(this.position); var u = info.position.dot(vU); var v = info.position.dot(vV); info.color = this.material.getColor(u,v); } else { info.color = this.material.getColor(0,0); } return info; }, toString : function () { return 'Plane [' + this.position + ', d=' + this.d + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.IntersectionInfo = Class.create(); Flog.RayTracer.IntersectionInfo.prototype = { isHit: false, hitCount: 0, shape: null, position: null, normal: null, color: null, distance: null, initialize : function() { this.color = new Flog.RayTracer.Color(0,0,0); }, toString : function () { return 'Intersection [' + this.position + ']'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Camera = Class.create(); Flog.RayTracer.Camera.prototype = { position: null, lookAt: null, equator: null, up: null, screen: null, initialize : function(pos, lookAt, up) { this.position = pos; this.lookAt = lookAt; this.up = up; this.equator = lookAt.normalize().cross(this.up); this.screen = Flog.RayTracer.Vector.prototype.add(this.position, this.lookAt); }, getRay: function(vx, vy){ var pos = Flog.RayTracer.Vector.prototype.subtract( this.screen, Flog.RayTracer.Vector.prototype.subtract( Flog.RayTracer.Vector.prototype.multiplyScalar(this.equator, vx), Flog.RayTracer.Vector.prototype.multiplyScalar(this.up, vy) ) ); pos.y = pos.y * -1; var dir = Flog.RayTracer.Vector.prototype.subtract( pos, this.position ); var ray = new Flog.RayTracer.Ray(pos, dir.normalize()); return ray; }, toString : function () { return 'Ray []'; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Background = Class.create(); Flog.RayTracer.Background.prototype = { color : null, ambience : 0.0, initialize : function(color, ambience) { this.color = color; this.ambience = ambience; } } /* Fake a Flog.* namespace */ if(typeof(Flog) == 'undefined') var Flog = {}; if(typeof(Flog.RayTracer) == 'undefined') Flog.RayTracer = {}; Flog.RayTracer.Engine = Class.create(); Flog.RayTracer.Engine.prototype = { canvas: null, /* 2d context we can render to */ initialize: function(options){ this.options = Object.extend({ canvasHeight: 100, canvasWidth: 100, pixelWidth: 2, pixelHeight: 2, renderDiffuse: false, renderShadows: false, renderHighlights: false, renderReflections: false, rayDepth: 2 }, options || {}); this.options.canvasHeight /= this.options.pixelHeight; this.options.canvasWidth /= this.options.pixelWidth; /* TODO: dynamically include other scripts */ }, setPixel: function(x, y, color){ var pxW, pxH; pxW = this.options.pixelWidth; pxH = this.options.pixelHeight; if (this.canvas) { this.canvas.fillStyle = color.toString(); this.canvas.fillRect (x * pxW, y * pxH, pxW, pxH); } else { if (x === y) { checkNumber += color.brightness(); } // print(x * pxW, y * pxH, pxW, pxH); } }, renderScene: function(scene, canvas){ checkNumber = 0; /* Get canvas */ if (canvas) { this.canvas = canvas.getContext("2d"); } else { this.canvas = null; } var canvasHeight = this.options.canvasHeight; var canvasWidth = this.options.canvasWidth; for(var y=0; y < canvasHeight; y++){ for(var x=0; x < canvasWidth; x++){ var yp = y * 1.0 / canvasHeight * 2 - 1; var xp = x * 1.0 / canvasWidth * 2 - 1; var ray = scene.camera.getRay(xp, yp); var color = this.getPixelColor(ray, scene); this.setPixel(x, y, color); } } if (checkNumber !== 2321) { throw new Error("Scene rendered incorrectly"); } }, getPixelColor: function(ray, scene){ var info = this.testIntersection(ray, scene, null); if(info.isHit){ var color = this.rayTrace(info, ray, scene, 0); return color; } return scene.background.color; }, testIntersection: function(ray, scene, exclude){ var hits = 0; var best = new Flog.RayTracer.IntersectionInfo(); best.distance = 2000; for(var i=0; i= 0 && info.distance < best.distance){ best = info; hits++; } } } best.hitCount = hits; return best; }, getReflectionRay: function(P,N,V){ var c1 = -N.dot(V); var R1 = Flog.RayTracer.Vector.prototype.add( Flog.RayTracer.Vector.prototype.multiplyScalar(N, 2*c1), V ); return new Flog.RayTracer.Ray(P, R1); }, rayTrace: function(info, ray, scene, depth){ // Calc ambient var color = Flog.RayTracer.Color.prototype.multiplyScalar(info.color, scene.background.ambience); var oldColor = color; var shininess = Math.pow(10, info.shape.material.gloss + 1); for(var i=0; i 0.0){ color = Flog.RayTracer.Color.prototype.add( color, Flog.RayTracer.Color.prototype.multiply( info.color, Flog.RayTracer.Color.prototype.multiplyScalar( light.color, L ) ) ); } } // The greater the depth the more accurate the colours, but // this is exponentially (!) expensive if(depth <= this.options.rayDepth){ // calculate reflection ray if(this.options.renderReflections && info.shape.material.reflection > 0) { var reflectionRay = this.getReflectionRay(info.position, info.normal, ray.direction); var refl = this.testIntersection(reflectionRay, scene, info.shape); if (refl.isHit && refl.distance > 0){ refl.color = this.rayTrace(refl, reflectionRay, scene, depth + 1); } else { refl.color = scene.background.color; } color = Flog.RayTracer.Color.prototype.blend( color, refl.color, info.shape.material.reflection ); } // Refraction /* TODO */ } /* Render shadows and highlights */ var shadowInfo = new Flog.RayTracer.IntersectionInfo(); if(this.options.renderShadows){ var shadowRay = new Flog.RayTracer.Ray(info.position, v); shadowInfo = this.testIntersection(shadowRay, scene, info.shape); if(shadowInfo.isHit && shadowInfo.shape != info.shape /*&& shadowInfo.shape.type != 'PLANE'*/){ var vA = Flog.RayTracer.Color.prototype.multiplyScalar(color, 0.5); var dB = (0.5 * Math.pow(shadowInfo.shape.material.transparency, 0.5)); color = Flog.RayTracer.Color.prototype.addScalar(vA,dB); } } // Phong specular highlights if(this.options.renderHighlights && !shadowInfo.isHit && info.shape.material.gloss > 0){ var Lv = Flog.RayTracer.Vector.prototype.subtract( info.shape.position, light.position ).normalize(); var E = Flog.RayTracer.Vector.prototype.subtract( scene.camera.position, info.shape.position ).normalize(); var H = Flog.RayTracer.Vector.prototype.subtract( E, Lv ).normalize(); var glossWeight = Math.pow(Math.max(info.normal.dot(H), 0), shininess); color = Flog.RayTracer.Color.prototype.add( Flog.RayTracer.Color.prototype.multiplyScalar(light.color, glossWeight), color ); } } color.limit(); return color; } }; function renderScene(){ var scene = new Flog.RayTracer.Scene(); scene.camera = new Flog.RayTracer.Camera( new Flog.RayTracer.Vector(0, 0, -15), new Flog.RayTracer.Vector(-0.2, 0, 5), new Flog.RayTracer.Vector(0, 1, 0) ); scene.background = new Flog.RayTracer.Background( new Flog.RayTracer.Color(0.5, 0.5, 0.5), 0.4 ); var sphere = new Flog.RayTracer.Shape.Sphere( new Flog.RayTracer.Vector(-1.5, 1.5, 2), 1.5, new Flog.RayTracer.Material.Solid( new Flog.RayTracer.Color(0,0.5,0.5), 0.3, 0.0, 0.0, 2.0 ) ); var sphere1 = new Flog.RayTracer.Shape.Sphere( new Flog.RayTracer.Vector(1, 0.25, 1), 0.5, new Flog.RayTracer.Material.Solid( new Flog.RayTracer.Color(0.9,0.9,0.9), 0.1, 0.0, 0.0, 1.5 ) ); var plane = new Flog.RayTracer.Shape.Plane( new Flog.RayTracer.Vector(0.1, 0.9, -0.5).normalize(), 1.2, new Flog.RayTracer.Material.Chessboard( new Flog.RayTracer.Color(1,1,1), new Flog.RayTracer.Color(0,0,0), 0.2, 0.0, 1.0, 0.7 ) ); scene.shapes.push(plane); scene.shapes.push(sphere); scene.shapes.push(sphere1); var light = new Flog.RayTracer.Light( new Flog.RayTracer.Vector(5, 10, -1), new Flog.RayTracer.Color(0.8, 0.8, 0.8) ); var light1 = new Flog.RayTracer.Light( new Flog.RayTracer.Vector(-3, 5, -15), new Flog.RayTracer.Color(0.8, 0.8, 0.8), 100 ); scene.lights.push(light); scene.lights.push(light1); var imageWidth = 100; // $F('imageWidth'); var imageHeight = 100; // $F('imageHeight'); var pixelSize = "5,5".split(','); // $F('pixelSize').split(','); var renderDiffuse = true; // $F('renderDiffuse'); var renderShadows = true; // $F('renderShadows'); var renderHighlights = true; // $F('renderHighlights'); var renderReflections = true; // $F('renderReflections'); var rayDepth = 2;//$F('rayDepth'); var raytracer = new Flog.RayTracer.Engine( { canvasWidth: imageWidth, canvasHeight: imageHeight, pixelWidth: pixelSize[0], pixelHeight: pixelSize[1], "renderDiffuse": renderDiffuse, "renderHighlights": renderHighlights, "renderShadows": renderShadows, "renderReflections": renderReflections, "rayDepth": rayDepth } ); raytracer.renderScene(scene, null, 0); } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/regexp.js000066400000000000000000003313021211511573600231570ustar00rootroot00000000000000// Copyright 2010 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Automatically generated on 2009-01-30. Manually updated on 2010-09-17. // This benchmark is generated by loading 50 of the most popular pages // on the web and logging all regexp operations performed. Each // operation is given a weight that is calculated from an estimate of // the popularity of the pages where it occurs and the number of times // it is executed while loading each page. Furthermore the literal // letters in the data are encoded using ROT13 in a way that does not // affect how the regexps match their input. Finally the strings are // scrambled to exercise the regexp engine on different input strings. var RegExp = new BenchmarkSuite('RegExp', 910985, [ new Benchmark("RegExp", RegExpRun, RegExpSetup, RegExpTearDown) ]); var regExpBenchmark = null; function RegExpSetup() { regExpBenchmark = new RegExpBenchmark(); RegExpRun(); // run once to get system initialized } function RegExpRun() { regExpBenchmark.run(); } function RegExpTearDown() { regExpBenchmark = null; } // Returns an array of n different variants of the input string str. // The variants are computed by randomly rotating one random // character. function computeInputVariants(str, n) { var variants = [ str ]; for (var i = 1; i < n; i++) { var pos = Math.floor(Math.random() * str.length); var chr = String.fromCharCode((str.charCodeAt(pos) + Math.floor(Math.random() * 128)) % 128); variants[i] = str.substring(0, pos) + chr + str.substring(pos + 1, str.length); } return variants; } function RegExpBenchmark() { var re0 = /^ba/; var re1 = /(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/; var re2 = /^\s*|\s*$/g; var re3 = /\bQBZPbageby_cynprubyqre\b/; var re4 = /,/; var re5 = /\bQBZPbageby_cynprubyqre\b/g; var re6 = /^[\s\xa0]+|[\s\xa0]+$/g; var re7 = /(\d*)(\D*)/g; var re8 = /=/; var re9 = /(^|\s)lhv\-h(\s|$)/; var str0 = 'Zbmvyyn/5.0 (Jvaqbjf; H; Jvaqbjf AG 5.1; ra-HF) NccyrJroXvg/528.9 (XUGZY, yvxr Trpxb) Puebzr/2.0.157.0 Fnsnev/528.9'; var re10 = /\#/g; var re11 = /\./g; var re12 = /'/g; var re13 = /\?[\w\W]*(sevraqvq|punaaryvq|tebhcvq)=([^\&\?#]*)/i; var str1 = 'Fubpxjnir Synfu 9.0 e115'; var re14 = /\s+/g; var re15 = /^\s*(\S*(\s+\S+)*)\s*$/; var re16 = /(-[a-z])/i; var s0 = computeInputVariants('pyvpx', 6511); var s1 = computeInputVariants('uggc://jjj.snprobbx.pbz/ybtva.cuc', 1844); var s2 = computeInputVariants('QBZPbageby_cynprubyqre', 739); var s3 = computeInputVariants('uggc://jjj.snprobbx.pbz/', 598); var s4 = computeInputVariants('uggc://jjj.snprobbx.pbz/fepu.cuc', 454); var s5 = computeInputVariants('qqqq, ZZZ q, llll', 352); var s6 = computeInputVariants('vachggrkg QBZPbageby_cynprubyqre', 312); var s7 = computeInputVariants('/ZlFcnprUbzrcntr/Vaqrk-FvgrUbzr,10000000', 282); var s8 = computeInputVariants('vachggrkg', 177); var s9 = computeInputVariants('528.9', 170); var s10 = computeInputVariants('528', 170); var s11 = computeInputVariants('VCPhygher=ra-HF', 156); var s12 = computeInputVariants('CersreerqPhygher=ra-HF', 156); var s13 = computeInputVariants('xrlcerff', 144); var s14 = computeInputVariants('521', 139); var s15 = computeInputVariants(str0, 139); var s16 = computeInputVariants('qvi .so_zrah', 137); var s17 = computeInputVariants('qvi.so_zrah', 137); var s18 = computeInputVariants('uvqqra_ryrz', 117); var s19 = computeInputVariants('sevraqfgre_naba=nvq%3Qn6ss9p85n868ro9s059pn854735956o3%26ers%3Q%26df%3Q%26vpgl%3QHF', 95); var s20 = computeInputVariants('uggc://ubzr.zlfcnpr.pbz/vaqrk.psz', 93); var s21 = computeInputVariants(str1, 92); var s22 = computeInputVariants('svefg', 85); var s23 = computeInputVariants('uggc://cebsvyr.zlfcnpr.pbz/vaqrk.psz', 85); var s24 = computeInputVariants('ynfg', 85); var s25 = computeInputVariants('qvfcynl', 85); function runBlock0() { for (var i = 0; i < 6511; i++) { re0.exec(s0[i]); } for (var i = 0; i < 1844; i++) { re1.exec(s1[i]); } for (var i = 0; i < 739; i++) { s2[i].replace(re2, ''); } for (var i = 0; i < 598; i++) { re1.exec(s3[i]); } for (var i = 0; i < 454; i++) { re1.exec(s4[i]); } for (var i = 0; i < 352; i++) { /qqqq|qqq|qq|q|ZZZZ|ZZZ|ZZ|Z|llll|ll|l|uu|u|UU|U|zz|z|ff|f|gg|g|sss|ss|s|mmm|mm|m/g.exec(s5[i]); } for (var i = 0; i < 312; i++) { re3.exec(s6[i]); } for (var i = 0; i < 282; i++) { re4.exec(s7[i]); } for (var i = 0; i < 177; i++) { s8[i].replace(re5, ''); } for (var i = 0; i < 170; i++) { s9[i].replace(re6, ''); re7.exec(s10[i]); } for (var i = 0; i < 156; i++) { re8.exec(s11[i]); re8.exec(s12[i]); } for (var i = 0; i < 144; i++) { re0.exec(s13[i]); } for (var i = 0; i < 139; i++) { s14[i].replace(re6, ''); re7.exec(s14[i]); re9.exec(''); /JroXvg\/(\S+)/.exec(s15[i]); } for (var i = 0; i < 137; i++) { s16[i].replace(re10, ''); s16[i].replace(/\[/g, ''); s17[i].replace(re11, ''); } for (var i = 0; i < 117; i++) { s18[i].replace(re2, ''); } for (var i = 0; i < 95; i++) { /(?:^|;)\s*sevraqfgre_ynat=([^;]*)/.exec(s19[i]); } for (var i = 0; i < 93; i++) { s20[i].replace(re12, ''); re13.exec(s20[i]); } for (var i = 0; i < 92; i++) { s21[i].replace(/([a-zA-Z]|\s)+/, ''); } for (var i = 0; i < 85; i++) { s22[i].replace(re14, ''); s22[i].replace(re15, ''); s23[i].replace(re12, ''); s24[i].replace(re14, ''); s24[i].replace(re15, ''); re16.exec(s25[i]); re13.exec(s23[i]); } } var re17 = /(^|[^\\])\"\\\/Qngr\((-?[0-9]+)\)\\\/\"/g; var str2 = '{"anzr":"","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":gehr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"\xa4","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":gehr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, qq ZZZZ llll UU:zz:ff","YbatQngrCnggrea":"qqqq, qq ZZZZ llll","YbatGvzrCnggrea":"UU:zz:ff","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"ZZ/qq/llll","FubegGvzrCnggrea":"UU:zz","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"llll ZZZZ","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":gehr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}'; var str3 = '{"anzr":"ra-HF","ahzoreSbezng":{"PheeraplQrpvznyQvtvgf":2,"PheeraplQrpvznyFrcnengbe":".","VfErnqBayl":snyfr,"PheeraplTebhcFvmrf":[3],"AhzoreTebhcFvmrf":[3],"CrepragTebhcFvmrf":[3],"PheeraplTebhcFrcnengbe":",","PheeraplFlzoby":"$","AnAFlzoby":"AnA","PheeraplArtngvirCnggrea":0,"AhzoreArtngvirCnggrea":1,"CrepragCbfvgvirCnggrea":0,"CrepragArtngvirCnggrea":0,"ArtngvirVasvavglFlzoby":"-Vasvavgl","ArtngvirFvta":"-","AhzoreQrpvznyQvtvgf":2,"AhzoreQrpvznyFrcnengbe":".","AhzoreTebhcFrcnengbe":",","PheeraplCbfvgvirCnggrea":0,"CbfvgvirVasvavglFlzoby":"Vasvavgl","CbfvgvirFvta":"+","CrepragQrpvznyQvtvgf":2,"CrepragQrpvznyFrcnengbe":".","CrepragTebhcFrcnengbe":",","CrepragFlzoby":"%","CreZvyyrFlzoby":"\u2030","AngvirQvtvgf":["0","1","2","3","4","5","6","7","8","9"],"QvtvgFhofgvghgvba":1},"qngrGvzrSbezng":{"NZQrfvtangbe":"NZ","Pnyraqne":{"ZvaFhccbegrqQngrGvzr":"@-62135568000000@","ZnkFhccbegrqQngrGvzr":"@253402300799999@","NytbevguzGlcr":1,"PnyraqneGlcr":1,"Renf":[1],"GjbQvtvgLrneZnk":2029,"VfErnqBayl":snyfr},"QngrFrcnengbe":"/","SvefgQnlBsJrrx":0,"PnyraqneJrrxEhyr":0,"ShyyQngrGvzrCnggrea":"qqqq, ZZZZ qq, llll u:zz:ff gg","YbatQngrCnggrea":"qqqq, ZZZZ qq, llll","YbatGvzrCnggrea":"u:zz:ff gg","ZbaguQnlCnggrea":"ZZZZ qq","CZQrfvtangbe":"CZ","ESP1123Cnggrea":"qqq, qq ZZZ llll UU\':\'zz\':\'ff \'TZG\'","FubegQngrCnggrea":"Z/q/llll","FubegGvzrCnggrea":"u:zz gg","FbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq\'G\'UU\':\'zz\':\'ff","GvzrFrcnengbe":":","HavirefnyFbegnoyrQngrGvzrCnggrea":"llll\'-\'ZZ\'-\'qq UU\':\'zz\':\'ff\'M\'","LrneZbaguCnggrea":"ZZZZ, llll","NooerivngrqQnlAnzrf":["Fha","Zba","Ghr","Jrq","Guh","Sev","Fng"],"FubegrfgQnlAnzrf":["Fh","Zb","Gh","Jr","Gu","Se","Fn"],"QnlAnzrf":["Fhaqnl","Zbaqnl","Ghrfqnl","Jrqarfqnl","Guhefqnl","Sevqnl","Fngheqnl"],"NooerivngrqZbaguAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""],"VfErnqBayl":snyfr,"AngvirPnyraqneAnzr":"Tertbevna Pnyraqne","NooerivngrqZbaguTravgvirAnzrf":["Wna","Sro","Zne","Nce","Znl","Wha","Why","Nht","Frc","Bpg","Abi","Qrp",""],"ZbaguTravgvirAnzrf":["Wnahnel","Sroehnel","Znepu","Ncevy","Znl","Whar","Whyl","Nhthfg","Frcgrzore","Bpgbore","Abirzore","Qrprzore",""]}}'; var str4 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str5 = 'HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var re18 = /^\s+|\s+$/g; var str6 = 'uggc://jjj.snprobbx.pbz/vaqrk.cuc'; var re19 = /(?:^|\s+)ba(?:\s+|$)/; var re20 = /[+, ]/; var re21 = /ybnqrq|pbzcyrgr/; var str7 = ';;jvaqbj.IjPurpxZbhfrCbfvgvbaNQ_VQ=shapgvba(r){vs(!r)ine r=jvaqbj.rirag;ine c=-1;vs(d1)c=d1.EbyybssCnary;ine bo=IjTrgBow("IjCnayNQ_VQ_"+c);vs(bo&&bo.fglyr.ivfvovyvgl=="ivfvoyr"){ine fns=IjFns?8:0;ine pheK=r.pyvragK+IjBOFpe("U")+fns,pheL=r.pyvragL+IjBOFpe("I")+fns;ine y=IjBOEC(NQ_VQ,bo,"Y"),g=IjBOEC(NQ_VQ,bo,"G");ine e=y+d1.Cnaryf[c].Jvqgu,o=g+d1.Cnaryf[c].Urvtug;vs((pheKe)||(pheLo)){vs(jvaqbj.IjBaEbyybssNQ_VQ)IjBaEbyybssNQ_VQ(c);ryfr IjPybfrNq(NQ_VQ,c,gehr,"");}ryfr erghea;}IjPnapryZbhfrYvfgrareNQ_VQ();};;jvaqbj.IjFrgEbyybssCnaryNQ_VQ=shapgvba(c){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;c=IjTc(NQ_VQ,c);vs(d1&&d1.EbyybssCnary>-1)IjPnapryZbhfrYvfgrareNQ_VQ();vs(d1)d1.EbyybssCnary=c;gel{vs(q.nqqRiragYvfgrare)q.nqqRiragYvfgrare(z,s,snyfr);ryfr vs(q.nggnpuRirag)q.nggnpuRirag("ba"+z,s);}pngpu(r){}};;jvaqbj.IjPnapryZbhfrYvfgrareNQ_VQ=shapgvba(){ine z="zbhfrzbir",q=qbphzrag,s=IjPurpxZbhfrCbfvgvbaNQ_VQ;vs(d1)d1.EbyybssCnary=-1;gel{vs(q.erzbirRiragYvfgrare)q.erzbirRiragYvfgrare(z,s,snyfr);ryfr vs(q.qrgnpuRirag)q.qrgnpuRirag("ba"+z,s);}pngpu(r){}};;d1.IjTc=d2(n,c){ine nq=d1;vs(vfAnA(c)){sbe(ine v=0;v0){vs(nq.FzV.yratgu>0)nq.FzV+="/";nq.FzV+=vh[v];nq.FtZ[nq.FtZ.yratgu]=snyfr;}}};;d1.IjYvzvg0=d2(n,f){ine nq=d1,vh=f.fcyvg("/");sbe(ine v=0;v0){vs(nq.OvC.yratgu>0)nq.OvC+="/";nq.OvC+=vh[v];}}};;d1.IjRVST=d2(n,c){jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]=IjTrgBow("IjCnayNQ_VQ_"+c+"_Bow");vs(jvaqbj["IjCnayNQ_VQ_"+c+"_Bow"]==ahyy)frgGvzrbhg("IjRVST(NQ_VQ,"+c+")",d1.rvsg);};;d1.IjNavzSHC=d2(n,c){ine nq=d1;vs(c>nq.Cnaryf.yratgu)erghea;ine cna=nq.Cnaryf[c],nn=gehr,on=gehr,yn=gehr,en=gehr,cn=nq.Cnaryf[0],sf=nq.ShF,j=cn.Jvqgu,u=cn.Urvtug;vs(j=="100%"){j=sf;en=snyfr;yn=snyfr;}vs(u=="100%"){u=sf;nn=snyfr;on=snyfr;}vs(cn.YnY=="Y")yn=snyfr;vs(cn.YnY=="E")en=snyfr;vs(cn.GnY=="G")nn=snyfr;vs(cn.GnY=="O")on=snyfr;ine k=0,l=0;fjvgpu(nq.NshP%8){pnfr 0:oernx;pnfr 1:vs(nn)l=-sf;oernx;pnfr 2:k=j-sf;oernx;pnfr 3:vs(en)k=j;oernx;pnfr 4:k=j-sf;l=u-sf;oernx;pnfr 5:k=j-sf;vs(on)l=u;oernx;pnfr 6:l=u-sf;oernx;pnfr 7:vs(yn)k=-sf;l=u-sf;oernx;}vs(nq.NshP++ 0)||(nethzragf.yratgu==3&&bG>0))){pyrneGvzrbhg(cay.UgU);cay.UgU=frgGvzrbhg(cay.UvqrNpgvba,(nethzragf.yratgu==3?bG:cay.UvqrGvzrbhgInyhr));}};;d1.IjErfrgGvzrbhg=d2(n,c,bG){c=IjTc(n,c);IjPnapryGvzrbhg(n,c);riny("IjFgnegGvzrbhg(NQ_VQ,c"+(nethzragf.yratgu==3?",bG":"")+")");};;d1.IjErfrgNyyGvzrbhgf=d2(n){sbe(ine c=0;c]/g; var str15 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=44132r503660'; var str16 = 'FrffvbaQQS2=s6r4579npn4rn2135s904r0s75pp1o5334p6s6pospo12696; AFP_zp_dfctwzs-aowb_80=44132r503660; __hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1; __hgzo=144631658.0.10.1231363638; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str17 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231363621014&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231363621014&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=348699119.1231363624&tn_fvq=1231363624&tn_uvq=895511034&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str18 = 'uggc://jjj.yrobapbva.se/yv'; var str19 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669316860113296&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str20 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669316860113296&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var s67 = computeInputVariants('e115', 27); var s68 = computeInputVariants('qvfcynl', 27); var s69 = computeInputVariants('cbfvgvba', 27); var s70 = computeInputVariants('uggc://jjj.zlfcnpr.pbz/', 27); var s71 = computeInputVariants('cntrivrj', 27); var s72 = computeInputVariants('VC=74.125.75.3', 27); var s73 = computeInputVariants('ra', 27); var s74 = computeInputVariants(str10, 27); var s75 = computeInputVariants(str11, 27); var s76 = computeInputVariants(str12, 27); var s77 = computeInputVariants(str17, 27); var s78 = computeInputVariants(str18, 27); function runBlock3() { for (var i = 0; i < 27; i++) { s67[i].replace(/[A-Za-z]/g, ''); } for (var i = 0; i < 23; i++) { s68[i].replace(re27, ''); s69[i].replace(re27, ''); } for (var i = 0; i < 22; i++) { 'unaqyr'.replace(re14, ''); 'unaqyr'.replace(re15, ''); 'yvar'.replace(re14, ''); 'yvar'.replace(re15, ''); 'cnerag puebzr6 fvatyr1 gno'.replace(re14, ''); 'cnerag puebzr6 fvatyr1 gno'.replace(re15, ''); 'fyvqre'.replace(re14, ''); 'fyvqre'.replace(re15, ''); re28.exec(''); } for (var i = 0; i < 21; i++) { s70[i].replace(re12, ''); re13.exec(s70[i]); } for (var i = 0; i < 20; i++) { s71[i].replace(re29, ''); s71[i].replace(re30, ''); re19.exec('ynfg'); re19.exec('ba svefg'); re8.exec(s72[i]); } for (var i = 0; i < 19; i++) { re31.exec(s73[i]); } for (var i = 0; i < 18; i++) { s74[i].split(re32); s75[i].split(re32); s76[i].replace(re33, ''); re8.exec('144631658.0.10.1231363570'); re8.exec('144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.3426875219718084000.1231363570.1231363570.1231363570.1'); re8.exec(str13); re8.exec(str14); re8.exec('__hgzn=144631658.3426875219718084000.1231363570.1231363570.1231363570.1'); re8.exec('__hgzo=144631658.0.10.1231363570'); re8.exec('__hgzm=144631658.1231363570.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(s74[i]); re34.exec(s75[i]); } for (var i = 0; i < 17; i++) { s15[i].match(/zfvr/gi); s15[i].match(/bcren/gi); str15.split(re32); str16.split(re32); 'ohggba'.replace(re14, ''); 'ohggba'.replace(re15, ''); 'puvyq p1 svefg sylbhg pybfrq'.replace(re14, ''); 'puvyq p1 svefg sylbhg pybfrq'.replace(re15, ''); 'pvgvrf'.replace(re14, ''); 'pvgvrf'.replace(re15, ''); 'pybfrq'.replace(re14, ''); 'pybfrq'.replace(re15, ''); 'qry'.replace(re14, ''); 'qry'.replace(re15, ''); 'uqy_zba'.replace(re14, ''); 'uqy_zba'.replace(re15, ''); s77[i].replace(re33, ''); s78[i].replace(/%3P/g, ''); s78[i].replace(/%3R/g, ''); s78[i].replace(/%3q/g, ''); s78[i].replace(re35, ''); 'yvaxyvfg16'.replace(re14, ''); 'yvaxyvfg16'.replace(re15, ''); 'zvahf'.replace(re14, ''); 'zvahf'.replace(re15, ''); 'bcra'.replace(re14, ''); 'bcra'.replace(re15, ''); 'cnerag puebzr5 fvatyr1 ps NU'.replace(re14, ''); 'cnerag puebzr5 fvatyr1 ps NU'.replace(re15, ''); 'cynlre'.replace(re14, ''); 'cynlre'.replace(re15, ''); 'cyhf'.replace(re14, ''); 'cyhf'.replace(re15, ''); 'cb_uqy'.replace(re14, ''); 'cb_uqy'.replace(re15, ''); 'hyJVzt'.replace(re14, ''); 'hyJVzt'.replace(re15, ''); re8.exec('144631658.0.10.1231363638'); re8.exec('144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.965867047679498800.1231363638.1231363638.1231363638.1'); re8.exec('4413268q3660'); re8.exec('4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n'); re8.exec('SbeprqRkcvengvba=633669321699093060'); re8.exec('VC=74.125.75.20'); re8.exec(str19); re8.exec(str20); re8.exec('AFP_zp_tfwsbrg-aowb_80=4413268q3660'); re8.exec('FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n'); re8.exec('__hgzn=144631658.965867047679498800.1231363638.1231363638.1231363638.1'); re8.exec('__hgzo=144631658.0.10.1231363638'); re8.exec('__hgzm=144631658.1231363638.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(str15); re34.exec(str16); } } var re36 = /uers|fep|fryrpgrq/; var re37 = /\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g; var re38 = /^(\w+|\*)$/; var str21 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str22 = 'FrffvbaQQS2=s15q53p9n372sn76npr13o271n4s3p5r29p235746p908p58; __hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1; __hgzo=144631658.0.10.1231367822; __hgzp=144631658; ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str23 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367803797&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367803797&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Szrffntvat.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1192552091.1231367807&tn_fvq=1231367807&tn_uvq=1155446857&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str24 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669358527244818&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str25 = 'ZFPhygher=VC=66.249.85.130&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669358527244818&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str26 = 'hy.ynat-fryrpgbe'; var re39 = /\\/g; var re40 = / /g; var re41 = /\/\xc4\/t/; var re42 = /\/\xd6\/t/; var re43 = /\/\xdc\/t/; var re44 = /\/\xdf\/t/; var re45 = /\/\xe4\/t/; var re46 = /\/\xf6\/t/; var re47 = /\/\xfc\/t/; var re48 = /\W/g; var re49 = /uers|fep|fglyr/; var s79 = computeInputVariants(str21, 16); var s80 = computeInputVariants(str22, 16); var s81 = computeInputVariants(str23, 16); var s82 = computeInputVariants(str26, 16); function runBlock4() { for (var i = 0; i < 16; i++) { ''.replace(/\*/g, ''); /\bnpgvir\b/.exec('npgvir'); /sversbk/i.exec(s15[i]); re36.exec('glcr'); /zfvr/i.exec(s15[i]); /bcren/i.exec(s15[i]); } for (var i = 0; i < 15; i++) { s79[i].split(re32); s80[i].split(re32); 'uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); s81[i].replace(re33, ''); 'yv'.replace(re37, ''); 'yv'.replace(re18, ''); re8.exec('144631658.0.10.1231367822'); re8.exec('144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.4127520630321984500.1231367822.1231367822.1231367822.1'); re8.exec(str24); re8.exec(str25); re8.exec('__hgzn=144631658.4127520630321984500.1231367822.1231367822.1231367822.1'); re8.exec('__hgzo=144631658.0.10.1231367822'); re8.exec('__hgzm=144631658.1231367822.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(s79[i]); re34.exec(s80[i]); /\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)["']?(.*?)["']?)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g.exec(s82[i]); re13.exec('uggc://ohyyrgvaf.zlfcnpr.pbz/vaqrk.psz'); re38.exec('yv'); } for (var i = 0; i < 14; i++) { ''.replace(re18, ''); '9.0 e115'.replace(/(\s+e|\s+o[0-9]+)/, ''); 'Funer guvf tnqtrg'.replace(//g, ''); 'Funer guvf tnqtrg'.replace(re39, ''); 'uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'.replace(re12, ''); 'grnfre'.replace(re40, ''); 'grnfre'.replace(re41, ''); 'grnfre'.replace(re42, ''); 'grnfre'.replace(re43, ''); 'grnfre'.replace(re44, ''); 'grnfre'.replace(re45, ''); 'grnfre'.replace(re46, ''); 'grnfre'.replace(re47, ''); 'grnfre'.replace(re48, ''); re16.exec('znetva-gbc'); re16.exec('cbfvgvba'); re19.exec('gno1'); re9.exec('qz'); re9.exec('qg'); re9.exec('zbqobk'); re9.exec('zbqobkva'); re9.exec('zbqgvgyr'); re13.exec('uggc://cebsvyrrqvg.zlfcnpr.pbz/vaqrk.psz'); re26.exec('/vt/znvytnqtrg'); re49.exec('glcr'); } } var re50 = /(?:^|\s+)fryrpgrq(?:\s+|$)/; var re51 = /\&/g; var re52 = /\+/g; var re53 = /\?/g; var re54 = /\t/g; var re55 = /(\$\{nqiHey\})|(\$nqiHey\b)/g; var re56 = /(\$\{cngu\})|(\$cngu\b)/g; function runBlock5() { for (var i = 0; i < 13; i++) { 'purpx'.replace(re14, ''); 'purpx'.replace(re15, ''); 'pvgl'.replace(re14, ''); 'pvgl'.replace(re15, ''); 'qrpe fyvqrgrkg'.replace(re14, ''); 'qrpe fyvqrgrkg'.replace(re15, ''); 'svefg fryrpgrq'.replace(re14, ''); 'svefg fryrpgrq'.replace(re15, ''); 'uqy_rag'.replace(re14, ''); 'uqy_rag'.replace(re15, ''); 'vape fyvqrgrkg'.replace(re14, ''); 'vape fyvqrgrkg'.replace(re15, ''); 'vachggrkg QBZPbageby_cynprubyqre'.replace(re5, ''); 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re14, ''); 'cnerag puebzr6 fvatyr1 gno fryrpgrq'.replace(re15, ''); 'cb_guz'.replace(re14, ''); 'cb_guz'.replace(re15, ''); 'fhozvg'.replace(re14, ''); 'fhozvg'.replace(re15, ''); re50.exec(''); /NccyrJroXvg\/([^\s]*)/.exec(s15[i]); /XUGZY/.exec(s15[i]); } for (var i = 0; i < 12; i++) { '${cebg}://${ubfg}${cngu}/${dz}'.replace(/(\$\{cebg\})|(\$cebg\b)/g, ''); '1'.replace(re40, ''); '1'.replace(re10, ''); '1'.replace(re51, ''); '1'.replace(re52, ''); '1'.replace(re53, ''); '1'.replace(re39, ''); '1'.replace(re54, ''); '9.0 e115'.replace(/^(.*)\..*$/, ''); '9.0 e115'.replace(/^.*e(.*)$/, ''); ''.replace(re55, ''); ''.replace(re55, ''); s21[i].replace(/^.*\s+(\S+\s+\S+$)/, ''); 'tzk%2Subzrcntr%2Sfgneg%2Sqr%2S'.replace(re30, ''); 'tzk'.replace(re30, ''); 'uggc://${ubfg}${cngu}/${dz}'.replace(/(\$\{ubfg\})|(\$ubfg\b)/g, ''); 'uggc://nqpyvrag.hvzfrei.arg${cngu}/${dz}'.replace(re56, ''); 'uggc://nqpyvrag.hvzfrei.arg/wf.at/${dz}'.replace(/(\$\{dz\})|(\$dz\b)/g, ''); 'frpgvba'.replace(re29, ''); 'frpgvba'.replace(re30, ''); 'fvgr'.replace(re29, ''); 'fvgr'.replace(re30, ''); 'fcrpvny'.replace(re29, ''); 'fcrpvny'.replace(re30, ''); re36.exec('anzr'); /e/.exec('9.0 e115'); } } var re57 = /##yv4##/gi; var re58 = /##yv16##/gi; var re59 = /##yv19##/gi; var str27 = '##yv4##Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##'; var str28 = 'Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.##yv16##Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##'; var str29 = 'Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.##yv19##Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##'; var str30 = 'Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl.##OE## ##OE## ##N##Yrnea zber##/N##'; var str31 = 'Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl. ##N##Yrnea zber##/N##'; var str32 = 'Cbjreshy Zvpebfbsg grpuabybtl urycf svtug fcnz naq vzcebir frphevgl.Trg zber qbar gunaxf gb terngre rnfr naq fcrrq.Ybgf bs fgbentr (5 TO) - zber pbby fghss ba gur jnl. Yrnea zber##/N##'; var str33 = 'Bar Jvaqbjf Yvir VQ trgf lbh vagb Ubgznvy, Zrffratre, Kobk YVIR \u2014 naq bgure cynprf lbh frr #~#argjbexybtb#~#'; var re60 = /(?:^|\s+)bss(?:\s+|$)/; var re61 = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/; var re62 = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; var str34 = '${1}://${2}${3}${4}${5}'; var str35 = ' O=6gnyg0g4znrrn&o=3&f=gc; Q=_lyu=K3bQZGSxnT4lZzD3OS9GNmV3ZGLkAQxRpTyxNmRlZmRmAmNkAQLRqTImqNZjOUEgpTjQnJ5xMKtgoN--; SCF=qy'; var s83 = computeInputVariants(str27, 11); var s84 = computeInputVariants(str28, 11); var s85 = computeInputVariants(str29, 11); var s86 = computeInputVariants(str30, 11); var s87 = computeInputVariants(str31, 11); var s88 = computeInputVariants(str32, 11); var s89 = computeInputVariants(str33, 11); var s90 = computeInputVariants(str34, 11); function runBlock6() { for (var i = 0; i < 11; i++) { s83[i].replace(/##yv0##/gi, ''); s83[i].replace(re57, ''); s84[i].replace(re58, ''); s85[i].replace(re59, ''); s86[i].replace(/##\/o##/gi, ''); s86[i].replace(/##\/v##/gi, ''); s86[i].replace(/##\/h##/gi, ''); s86[i].replace(/##o##/gi, ''); s86[i].replace(/##oe##/gi, ''); s86[i].replace(/##v##/gi, ''); s86[i].replace(/##h##/gi, ''); s87[i].replace(/##n##/gi, ''); s88[i].replace(/##\/n##/gi, ''); s89[i].replace(/#~#argjbexybtb#~#/g, ''); / Zbovyr\//.exec(s15[i]); /##yv1##/gi.exec(s83[i]); /##yv10##/gi.exec(s84[i]); /##yv11##/gi.exec(s84[i]); /##yv12##/gi.exec(s84[i]); /##yv13##/gi.exec(s84[i]); /##yv14##/gi.exec(s84[i]); /##yv15##/gi.exec(s84[i]); re58.exec(s84[i]); /##yv17##/gi.exec(s85[i]); /##yv18##/gi.exec(s85[i]); re59.exec(s85[i]); /##yv2##/gi.exec(s83[i]); /##yv20##/gi.exec(s86[i]); /##yv21##/gi.exec(s86[i]); /##yv22##/gi.exec(s86[i]); /##yv23##/gi.exec(s86[i]); /##yv3##/gi.exec(s83[i]); re57.exec(s83[i]); /##yv5##/gi.exec(s84[i]); /##yv6##/gi.exec(s84[i]); /##yv7##/gi.exec(s84[i]); /##yv8##/gi.exec(s84[i]); /##yv9##/gi.exec(s84[i]); re8.exec('473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29'); re8.exec('SbeprqRkcvengvba=633669325184628362'); re8.exec('FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29'); /AbxvnA[^\/]*/.exec(s15[i]); } for (var i = 0; i < 10; i++) { ' bss'.replace(/(?:^|\s+)bss(?:\s+|$)/g, ''); s90[i].replace(/(\$\{0\})|(\$0\b)/g, ''); s90[i].replace(/(\$\{1\})|(\$1\b)/g, ''); s90[i].replace(/(\$\{pbzcyrgr\})|(\$pbzcyrgr\b)/g, ''); s90[i].replace(/(\$\{sentzrag\})|(\$sentzrag\b)/g, ''); s90[i].replace(/(\$\{ubfgcbeg\})|(\$ubfgcbeg\b)/g, ''); s90[i].replace(re56, ''); s90[i].replace(/(\$\{cebgbpby\})|(\$cebgbpby\b)/g, ''); s90[i].replace(/(\$\{dhrel\})|(\$dhrel\b)/g, ''); 'nqfvmr'.replace(re29, ''); 'nqfvmr'.replace(re30, ''); 'uggc://${2}${3}${4}${5}'.replace(/(\$\{2\})|(\$2\b)/g, ''); 'uggc://wf.hv-cbegny.qr${3}${4}${5}'.replace(/(\$\{3\})|(\$3\b)/g, ''); 'arjf'.replace(re40, ''); 'arjf'.replace(re41, ''); 'arjf'.replace(re42, ''); 'arjf'.replace(re43, ''); 'arjf'.replace(re44, ''); 'arjf'.replace(re45, ''); 'arjf'.replace(re46, ''); 'arjf'.replace(re47, ''); 'arjf'.replace(re48, ''); / PC=i=(\d+)&oe=(.)/.exec(str35); re60.exec(' '); re60.exec(' bss'); re60.exec(''); re19.exec(' '); re19.exec('svefg ba'); re19.exec('ynfg vtaber'); re19.exec('ba'); re9.exec('scnq so '); re9.exec('zrqvgobk'); re9.exec('hsgy'); re9.exec('lhv-h'); /Fnsnev|Xbadhrebe|XUGZY/gi.exec(s15[i]); re61.exec('uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf'); re62.exec('#Ybtva_rznvy'); } } var re63 = /\{0\}/g; var str36 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_tfwsbrg-aowb_80=4413268q3660'; var str37 = 'FrffvbaQQS2=4ss747o77904333q374or84qrr1s9r0nprp8r5q81534o94n; AFP_zp_tfwsbrg-aowb_80=4413268q3660; __hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1; __hgzo=144631658.0.10.1231364074; __hgzp=144631658; ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str38 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231364057761&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364057761&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Ssevraqf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1667363813.1231364061&tn_fvq=1231364061&tn_uvq=1917563877&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str39 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669321699093060&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str40 = 'ZFPhygher=VC=74.125.75.20&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669321699093060&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var s91 = computeInputVariants(str36, 9); var s92 = computeInputVariants(str37, 9); var s93 = computeInputVariants(str38, 9); function runBlock7() { for (var i = 0; i < 9; i++) { '0'.replace(re40, ''); '0'.replace(re10, ''); '0'.replace(re51, ''); '0'.replace(re52, ''); '0'.replace(re53, ''); '0'.replace(re39, ''); '0'.replace(re54, ''); 'Lrf'.replace(re40, ''); 'Lrf'.replace(re10, ''); 'Lrf'.replace(re51, ''); 'Lrf'.replace(re52, ''); 'Lrf'.replace(re53, ''); 'Lrf'.replace(re39, ''); 'Lrf'.replace(re54, ''); } for (var i = 0; i < 8; i++) { 'Pybfr {0}'.replace(re63, ''); 'Bcra {0}'.replace(re63, ''); s91[i].split(re32); s92[i].split(re32); 'puvyq p1 svefg gnournqref'.replace(re14, ''); 'puvyq p1 svefg gnournqref'.replace(re15, ''); 'uqy_fcb'.replace(re14, ''); 'uqy_fcb'.replace(re15, ''); 'uvag'.replace(re14, ''); 'uvag'.replace(re15, ''); s93[i].replace(re33, ''); 'yvfg'.replace(re14, ''); 'yvfg'.replace(re15, ''); 'at_bhgre'.replace(re30, ''); 'cnerag puebzr5 qbhoyr2 NU'.replace(re14, ''); 'cnerag puebzr5 qbhoyr2 NU'.replace(re15, ''); 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re14, ''); 'cnerag puebzr5 dhnq5 ps NU osyvax zbarl'.replace(re15, ''); 'cnerag puebzr6 fvatyr1'.replace(re14, ''); 'cnerag puebzr6 fvatyr1'.replace(re15, ''); 'cb_qrs'.replace(re14, ''); 'cb_qrs'.replace(re15, ''); 'gnopbagrag'.replace(re14, ''); 'gnopbagrag'.replace(re15, ''); 'iv_svefg_gvzr'.replace(re30, ''); /(^|.)(ronl|qri-ehf3.wbg)(|fgberf|zbgbef|yvirnhpgvbaf|jvxv|rkcerff|punggre).(pbz(|.nh|.pa|.ux|.zl|.ft|.oe|.zk)|pb(.hx|.xe|.am)|pn|qr|se|vg|ay|or|ng|pu|vr|va|rf|cy|cu|fr)$/i.exec('cntrf.ronl.pbz'); re8.exec('144631658.0.10.1231364074'); re8.exec('144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.2294274870215848400.1231364074.1231364074.1231364074.1'); re8.exec('4413241q3660'); re8.exec('SbeprqRkcvengvba=633669357391353591'); re8.exec(str39); re8.exec(str40); re8.exec('AFP_zp_kkk-gdzogv_80=4413241q3660'); re8.exec('FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7'); re8.exec('__hgzn=144631658.2294274870215848400.1231364074.1231364074.1231364074.1'); re8.exec('__hgzo=144631658.0.10.1231364074'); re8.exec('__hgzm=144631658.1231364074.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7'); re34.exec(s91[i]); re34.exec(s92[i]); } } var re64 = /\b[a-z]/g; var re65 = /^uggc:\/\//; var re66 = /(?:^|\s+)qvfnoyrq(?:\s+|$)/; var str41 = 'uggc://cebsvyr.zlfcnpr.pbz/Zbqhyrf/Nccyvpngvbaf/Cntrf/Pnainf.nfck'; function runBlock8() { for (var i = 0; i < 7; i++) { s21[i].match(/\d+/g); 'nsgre'.replace(re64, ''); 'orsber'.replace(re64, ''); 'obggbz'.replace(re64, ''); 'ohvygva_jrngure.kzy'.replace(re65, ''); 'ohggba'.replace(re37, ''); 'ohggba'.replace(re18, ''); 'qngrgvzr.kzy'.replace(re65, ''); 'uggc://eff.paa.pbz/eff/paa_gbcfgbevrf.eff'.replace(re65, ''); 'vachg'.replace(re37, ''); 'vachg'.replace(re18, ''); 'vafvqr'.replace(re64, ''); 'cbvagre'.replace(re27, ''); 'cbfvgvba'.replace(/[A-Z]/g, ''); 'gbc'.replace(re27, ''); 'gbc'.replace(re64, ''); 'hy'.replace(re37, ''); 'hy'.replace(re18, ''); str26.replace(re37, ''); str26.replace(re18, ''); 'lbhghor_vtbbtyr/i2/lbhghor.kzy'.replace(re65, ''); 'm-vaqrk'.replace(re27, ''); /#([\w-]+)/.exec(str26); re16.exec('urvtug'); re16.exec('znetvaGbc'); re16.exec('jvqgu'); re19.exec('gno0 svefg ba'); re19.exec('gno0 ba'); re19.exec('gno4 ynfg'); re19.exec('gno4'); re19.exec('gno5'); re19.exec('gno6'); re19.exec('gno7'); re19.exec('gno8'); /NqborNVE\/([^\s]*)/.exec(s15[i]); /NccyrJroXvg\/([^ ]*)/.exec(s15[i]); /XUGZY/gi.exec(s15[i]); /^(?:obql|ugzy)$/i.exec('YV'); re38.exec('ohggba'); re38.exec('vachg'); re38.exec('hy'); re38.exec(str26); /^(\w+|\*)/.exec(str26); /znp|jva|yvahk/i.exec('Jva32'); /eton?\([\d\s,]+\)/.exec('fgngvp'); } for (var i = 0; i < 6; i++) { ''.replace(/\r/g, ''); '/'.replace(re40, ''); '/'.replace(re10, ''); '/'.replace(re51, ''); '/'.replace(re52, ''); '/'.replace(re53, ''); '/'.replace(re39, ''); '/'.replace(re54, ''); 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/{0}?[NDO]&{1}&{2}&[NDR]'.replace(re63, ''); str41.replace(re12, ''); 'uggc://jjj.snprobbx.pbz/fepu.cuc'.replace(re23, ''); 'freivpr'.replace(re40, ''); 'freivpr'.replace(re41, ''); 'freivpr'.replace(re42, ''); 'freivpr'.replace(re43, ''); 'freivpr'.replace(re44, ''); 'freivpr'.replace(re45, ''); 'freivpr'.replace(re46, ''); 'freivpr'.replace(re47, ''); 'freivpr'.replace(re48, ''); /((ZFVR\s+([6-9]|\d\d)\.))/.exec(s15[i]); re66.exec(''); re50.exec('fryrpgrq'); re8.exec('8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn'); re8.exec('SbeprqRkcvengvba=633669340386893867'); re8.exec('VC=74.125.75.17'); re8.exec('FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn'); /Xbadhrebe|Fnsnev|XUGZY/.exec(s15[i]); re13.exec(str41); re49.exec('unfsbphf'); } } var re67 = /zrah_byq/g; var str42 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str43 = 'FrffvbaQQS2=473qq1rs0n2r70q9qo1pq48n021s9468ron90nps048p4p29; __hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1; __hgzo=144631658.0.10.1231364380; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str44 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_vzntrf_wf&qg=1231364373088&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231364373088&punaary=svz_zlfcnpr_hfre-ivrj-pbzzragf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Spbzzrag.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1158737789.1231364375&tn_fvq=1231364375&tn_uvq=415520832&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str45 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669325184628362&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str46 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669325184628362&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var re68 = /^([#.]?)((?:[\w\u0128-\uffff*_-]|\\.)*)/; var re69 = /\{1\}/g; var re70 = /\s+/; var re71 = /(\$\{4\})|(\$4\b)/g; var re72 = /(\$\{5\})|(\$5\b)/g; var re73 = /\{2\}/g; var re74 = /[^+>] [^+>]/; var re75 = /\bucpyv\s*=\s*([^;]*)/i; var re76 = /\bucuvqr\s*=\s*([^;]*)/i; var re77 = /\bucfie\s*=\s*([^;]*)/i; var re78 = /\bhfucjrn\s*=\s*([^;]*)/i; var re79 = /\bmvc\s*=\s*([^;]*)/i; var re80 = /^((?:[\w\u0128-\uffff*_-]|\\.)+)(#)((?:[\w\u0128-\uffff*_-]|\\.)+)/; var re81 = /^([>+~])\s*(\w*)/i; var re82 = /^>\s*((?:[\w\u0128-\uffff*_-]|\\.)+)/; var re83 = /^[\s[]?shapgvba/; var re84 = /v\/g.tvs#(.*)/i; var str47 = '#Zbq-Vasb-Vasb-WninFpevcgUvag'; var str48 = ',n.svryqOgaPnapry'; var str49 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_kkk-gdzogv_80=4413241q3660'; var str50 = 'FrffvbaQQS2=p98s8o9q42nr21or1r61pqorn1n002nsss569635984s6qp7; AFP_zp_kkk-gdzogv_80=4413241q3660; AFP_zp_kkk-aowb_80=4413235p3660; __hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1; __hgzo=144631658.0.10.1231367708; __hgzp=144631658; ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str51 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231367691141&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367691141&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sjjj.zlfcnpr.pbz%2S&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=320757904.1231367694&tn_fvq=1231367694&tn_uvq=1758792003&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str52 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N38%3N42%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=1024k768&p=24&x=L&oj=994&ou=634&uc=A&{2}&[NDR]'; var str53 = 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq qbhoyr2 ps'; var str54 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669357391353591&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str55 = 'ZFPhygher=VC=74.125.75.3&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669357391353591&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str56 = 'ne;ng;nh;or;oe;pn;pu;py;pa;qr;qx;rf;sv;se;to;ux;vq;vr;va;vg;wc;xe;zk;zl;ay;ab;am;cu;cy;cg;eh;fr;ft;gu;ge;gj;mn;'; var str57 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886&GHVQ=1'; var str58 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886'; var str59 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1'; var str60 = 'ZP1=I=3&THVQ=6nnpr9q661804s33nnop45nosqp17q85; zu=ZFSG; PHYGHER=RA-HF; SyvtugTebhcVq=97; SyvtugVq=OnfrCntr; ucfie=Z:5|S:5|G:5|R:5|Q:oyh|J:S; ucpyv=J.U|Y.|F.|E.|H.Y|P.|U.; hfucjrn=jp:HFPN0746; ZHVQ=Q783SN9O14054831N4869R51P0SO8886; mvc=m:94043|yn:37.4154|yb:-122.0585|p:HF'; var str61 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/29/4RQP4969777N048NPS4RRR3PO2S7S.wct'; var str62 = 'uggc://gx2.fgp.f-zfa.pbz/oe/uc/11/ra-hf/pff/v/g.tvs#uggc://gx2.fgo.f-zfa.pbz/v/OQ/63NP9O94NS5OQP1249Q9S1ROP7NS3.wct'; var str63 = 'zbmvyyn/5.0 (jvaqbjf; h; jvaqbjf ag 5.1; ra-hf) nccyrjroxvg/528.9 (xugzy, yvxr trpxb) puebzr/2.0.157.0 fnsnev/528.9'; var s94 = computeInputVariants(str42, 5); var s95 = computeInputVariants(str43, 5); var s96 = computeInputVariants(str44, 5); var s97 = computeInputVariants(str47, 5); var s98 = computeInputVariants(str48, 5); var s99 = computeInputVariants(str49, 5); var s100 = computeInputVariants(str50, 5); var s101 = computeInputVariants(str51, 5); var s102 = computeInputVariants(str52, 5); var s103 = computeInputVariants(str53, 5); function runBlock9() { for (var i = 0; i < 5; i++) { s94[i].split(re32); s95[i].split(re32); 'svz_zlfcnpr_hfre-ivrj-pbzzragf,svz_zlfcnpr_havgrq-fgngrf'.split(re20); s96[i].replace(re33, ''); 'zrah_arj zrah_arj_gbttyr zrah_gbttyr'.replace(re67, ''); 'zrah_byq zrah_byq_gbttyr zrah_gbttyr'.replace(re67, ''); re8.exec('102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98'); re8.exec('144631658.0.10.1231364380'); re8.exec('144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.3931862196947939300.1231364380.1231364380.1231364380.1'); re8.exec('441326q33660'); re8.exec('SbeprqRkcvengvba=633669341278771470'); re8.exec(str45); re8.exec(str46); re8.exec('AFP_zp_dfctwzssrwh-aowb_80=441326q33660'); re8.exec('FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98'); re8.exec('__hgzn=144631658.3931862196947939300.1231364380.1231364380.1231364380.1'); re8.exec('__hgzo=144631658.0.10.1231364380'); re8.exec('__hgzm=144631658.1231364380.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); } for (var i = 0; i < 4; i++) { ' yvfg1'.replace(re14, ''); ' yvfg1'.replace(re15, ''); ' yvfg2'.replace(re14, ''); ' yvfg2'.replace(re15, ''); ' frneputebhc1'.replace(re14, ''); ' frneputebhc1'.replace(re15, ''); s97[i].replace(re68, ''); s97[i].replace(re18, ''); ''.replace(/&/g, ''); ''.replace(re35, ''); '(..-{0})(\|(\d+)|)'.replace(re63, ''); s98[i].replace(re18, ''); '//vzt.jro.qr/vij/FC/${cngu}/${anzr}/${inyhr}?gf=${abj}'.replace(re56, ''); '//vzt.jro.qr/vij/FC/tzk_uc/${anzr}/${inyhr}?gf=${abj}'.replace(/(\$\{anzr\})|(\$anzr\b)/g, ''); 'Jvaqbjf Yvir Ubgznvy{1}'.replace(re69, ''); '{0}{1}'.replace(re63, ''); '{1}'.replace(re69, ''); '{1}'.replace(re63, ''); 'Vzntrf'.replace(re15, ''); 'ZFA'.replace(re15, ''); 'Zncf'.replace(re15, ''); 'Zbq-Vasb-Vasb-WninFpevcgUvag'.replace(re39, ''); 'Arjf'.replace(re15, ''); s99[i].split(re32); s100[i].split(re32); 'Ivqrb'.replace(re15, ''); 'Jro'.replace(re15, ''); 'n'.replace(re39, ''); 'nwnkFgneg'.split(re70); 'nwnkFgbc'.split(re70); 'ovaq'.replace(re14, ''); 'ovaq'.replace(re15, ''); 'oevatf lbh zber. Zber fcnpr (5TO), zber frphevgl, fgvyy serr.'.replace(re63, ''); 'puvyq p1 svefg qrpx'.replace(re14, ''); 'puvyq p1 svefg qrpx'.replace(re15, ''); 'puvyq p1 svefg qbhoyr2'.replace(re14, ''); 'puvyq p1 svefg qbhoyr2'.replace(re15, ''); 'puvyq p2 ynfg'.replace(re14, ''); 'puvyq p2 ynfg'.replace(re15, ''); 'puvyq p2'.replace(re14, ''); 'puvyq p2'.replace(re15, ''); 'puvyq p3'.replace(re14, ''); 'puvyq p3'.replace(re15, ''); 'puvyq p4 ynfg'.replace(re14, ''); 'puvyq p4 ynfg'.replace(re15, ''); 'pbclevtug'.replace(re14, ''); 'pbclevtug'.replace(re15, ''); 'qZFAZR_1'.replace(re14, ''); 'qZFAZR_1'.replace(re15, ''); 'qbhoyr2 ps'.replace(re14, ''); 'qbhoyr2 ps'.replace(re15, ''); 'qbhoyr2'.replace(re14, ''); 'qbhoyr2'.replace(re15, ''); 'uqy_arj'.replace(re14, ''); 'uqy_arj'.replace(re15, ''); 'uc_fubccvatobk'.replace(re30, ''); 'ugzy%2Rvq'.replace(re29, ''); 'ugzy%2Rvq'.replace(re30, ''); s101[i].replace(re33, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${4}${5}'.replace(re71, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/cebgbglcr.wf${5}'.replace(re72, ''); s102[i].replace(re73, ''); 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55332979829981?[NDO]&{1}&{2}&[NDR]'.replace(re69, ''); 'vztZFSG'.replace(re14, ''); 'vztZFSG'.replace(re15, ''); 'zfasbbg1 ps'.replace(re14, ''); 'zfasbbg1 ps'.replace(re15, ''); s103[i].replace(re14, ''); s103[i].replace(re15, ''); 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re14, ''); 'cnerag puebzr6 fvatyr1 gno fryrpgrq ovaq'.replace(re15, ''); 'cevznel'.replace(re14, ''); 'cevznel'.replace(re15, ''); 'erpgnatyr'.replace(re30, ''); 'frpbaqnel'.replace(re14, ''); 'frpbaqnel'.replace(re15, ''); 'haybnq'.split(re70); '{0}{1}1'.replace(re63, ''); '|{1}1'.replace(re69, ''); /(..-HF)(\|(\d+)|)/i.exec('xb-xe,ra-va,gu-gu'); re4.exec('/ZlFcnprNccf/NccPnainf,45000012'); re8.exec('144631658.0.10.1231367708'); re8.exec('144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.2770915348920628700.1231367708.1231367708.1231367708.1'); re8.exec('4413235p3660'); re8.exec('441327q73660'); re8.exec('9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473'); re8.exec('SbeprqRkcvengvba=633669350559478880'); re8.exec(str54); re8.exec(str55); re8.exec('AFP_zp_dfctwzs-aowb_80=441327q73660'); re8.exec('AFP_zp_kkk-aowb_80=4413235p3660'); re8.exec('FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473'); re8.exec('__hgzn=144631658.2770915348920628700.1231367708.1231367708.1231367708.1'); re8.exec('__hgzo=144631658.0.10.1231367708'); re8.exec('__hgzm=144631658.1231367708.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(s99[i]); re34.exec(s100[i]); /ZFVR\s+5[.]01/.exec(s15[i]); /HF(?=;)/i.exec(str56); re74.exec(s97[i]); re28.exec('svefg npgvir svefgNpgvir'); re28.exec('ynfg'); /\bp:(..)/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF'); re75.exec(str57); re75.exec(str58); re76.exec(str57); re76.exec(str58); re77.exec(str57); re77.exec(str58); /\bhfucce\s*=\s*([^;]*)/i.exec(str59); re78.exec(str57); re78.exec(str58); /\bjci\s*=\s*([^;]*)/i.exec(str59); re79.exec(str58); re79.exec(str60); re79.exec(str59); /\|p:([a-z]{2})/i.exec('m:94043|yn:37.4154|yb:-122.0585|p:HF|ue:1'); re80.exec(s97[i]); re61.exec('cebgbglcr.wf'); re68.exec(s97[i]); re81.exec(s97[i]); re82.exec(s97[i]); /^Fubpxjnir Synfu (\d)/.exec(s21[i]); /^Fubpxjnir Synfu (\d+)/.exec(s21[i]); re83.exec('[bowrpg tybony]'); re62.exec(s97[i]); re84.exec(str61); re84.exec(str62); /jroxvg/.exec(str63); } } var re85 = /eaq_zbqobkva/; var str64 = '1231365729213'; var str65 = '74.125.75.3-1057165600.29978900'; var str66 = '74.125.75.3-1057165600.29978900.1231365730214'; var str67 = 'Frnepu%20Zvpebfbsg.pbz'; var str68 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str69 = 'FrffvbaQQS2=8sqq78r9n442851q565599o401385sp3s04r92rnn7o19ssn; __hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1; __hgzo=144631658.0.10.1231365779; __hgzp=144631658; ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str70 = 'I=3%26THVQ=757q3ss871q44o7o805n8113n5p72q52'; var str71 = 'I=3&THVQ=757q3ss871q44o7o805n8113n5p72q52'; var str72 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365765292&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365765292&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Sohyyrgvaf.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1579793869.1231365768&tn_fvq=1231365768&tn_uvq=2056210897&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str73 = 'frnepu.zvpebfbsg.pbz'; var str74 = 'frnepu.zvpebfbsg.pbz/'; var str75 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669340386893867&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str76 = 'ZFPhygher=VC=74.125.75.17&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669340386893867&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; function runBlock10() { for (var i = 0; i < 3; i++) { '%3Szxg=ra-HF'.replace(re39, ''); '-8'.replace(re40, ''); '-8'.replace(re10, ''); '-8'.replace(re51, ''); '-8'.replace(re52, ''); '-8'.replace(re53, ''); '-8'.replace(re39, ''); '-8'.replace(re54, ''); '1.5'.replace(re40, ''); '1.5'.replace(re10, ''); '1.5'.replace(re51, ''); '1.5'.replace(re52, ''); '1.5'.replace(re53, ''); '1.5'.replace(re39, ''); '1.5'.replace(re54, ''); '1024k768'.replace(re40, ''); '1024k768'.replace(re10, ''); '1024k768'.replace(re51, ''); '1024k768'.replace(re52, ''); '1024k768'.replace(re53, ''); '1024k768'.replace(re39, ''); '1024k768'.replace(re54, ''); str64.replace(re40, ''); str64.replace(re10, ''); str64.replace(re51, ''); str64.replace(re52, ''); str64.replace(re53, ''); str64.replace(re39, ''); str64.replace(re54, ''); '14'.replace(re40, ''); '14'.replace(re10, ''); '14'.replace(re51, ''); '14'.replace(re52, ''); '14'.replace(re53, ''); '14'.replace(re39, ''); '14'.replace(re54, ''); '24'.replace(re40, ''); '24'.replace(re10, ''); '24'.replace(re51, ''); '24'.replace(re52, ''); '24'.replace(re53, ''); '24'.replace(re39, ''); '24'.replace(re54, ''); str65.replace(re40, ''); str65.replace(re10, ''); str65.replace(re51, ''); str65.replace(re52, ''); str65.replace(re53, ''); str65.replace(re39, ''); str65.replace(re54, ''); str66.replace(re40, ''); str66.replace(re10, ''); str66.replace(re51, ''); str66.replace(re52, ''); str66.replace(re53, ''); str66.replace(re39, ''); str66.replace(re54, ''); '9.0'.replace(re40, ''); '9.0'.replace(re10, ''); '9.0'.replace(re51, ''); '9.0'.replace(re52, ''); '9.0'.replace(re53, ''); '9.0'.replace(re39, ''); '9.0'.replace(re54, ''); '994k634'.replace(re40, ''); '994k634'.replace(re10, ''); '994k634'.replace(re51, ''); '994k634'.replace(re52, ''); '994k634'.replace(re53, ''); '994k634'.replace(re39, ''); '994k634'.replace(re54, ''); '?zxg=ra-HF'.replace(re40, ''); '?zxg=ra-HF'.replace(re10, ''); '?zxg=ra-HF'.replace(re51, ''); '?zxg=ra-HF'.replace(re52, ''); '?zxg=ra-HF'.replace(re53, ''); '?zxg=ra-HF'.replace(re54, ''); 'PAA.pbz'.replace(re25, ''); 'PAA.pbz'.replace(re12, ''); 'PAA.pbz'.replace(re39, ''); 'Qngr & Gvzr'.replace(re25, ''); 'Qngr & Gvzr'.replace(re12, ''); 'Qngr & Gvzr'.replace(re39, ''); 'Frnepu Zvpebfbsg.pbz'.replace(re40, ''); 'Frnepu Zvpebfbsg.pbz'.replace(re54, ''); str67.replace(re10, ''); str67.replace(re51, ''); str67.replace(re52, ''); str67.replace(re53, ''); str67.replace(re39, ''); str68.split(re32); str69.split(re32); str70.replace(re52, ''); str70.replace(re53, ''); str70.replace(re39, ''); str71.replace(re40, ''); str71.replace(re10, ''); str71.replace(re51, ''); str71.replace(re54, ''); 'Jrngure'.replace(re25, ''); 'Jrngure'.replace(re12, ''); 'Jrngure'.replace(re39, ''); 'LbhGhor'.replace(re25, ''); 'LbhGhor'.replace(re12, ''); 'LbhGhor'.replace(re39, ''); str72.replace(re33, ''); 'erzbgr_vsenzr_1'.replace(/^erzbgr_vsenzr_/, ''); str73.replace(re40, ''); str73.replace(re10, ''); str73.replace(re51, ''); str73.replace(re52, ''); str73.replace(re53, ''); str73.replace(re39, ''); str73.replace(re54, ''); str74.replace(re40, ''); str74.replace(re10, ''); str74.replace(re51, ''); str74.replace(re52, ''); str74.replace(re53, ''); str74.replace(re39, ''); str74.replace(re54, ''); 'lhv-h'.replace(/\-/g, ''); re9.exec('p'); re9.exec('qz p'); re9.exec('zbqynory'); re9.exec('lhv-h svefg'); re8.exec('144631658.0.10.1231365779'); re8.exec('144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.1877536177953918500.1231365779.1231365779.1231365779.1'); re8.exec(str75); re8.exec(str76); re8.exec('__hgzn=144631658.1877536177953918500.1231365779.1231365779.1231365779.1'); re8.exec('__hgzo=144631658.0.10.1231365779'); re8.exec('__hgzm=144631658.1231365779.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(str68); re34.exec(str69); /^$/.exec(''); re31.exec('qr'); /^znk\d+$/.exec(''); /^zva\d+$/.exec(''); /^erfgber$/.exec(''); re85.exec('zbqobkva zbqobk_abcnqqvat '); re85.exec('zbqgvgyr'); re85.exec('eaq_zbqobkva '); re85.exec('eaq_zbqgvgyr '); /frpgvba\d+_pbagragf/.exec('obggbz_ani'); } } var re86 = /;\s*/; var re87 = /(\$\{inyhr\})|(\$inyhr\b)/g; var re88 = /(\$\{abj\})|(\$abj\b)/g; var re89 = /\s+$/; var re90 = /^\s+/; var re91 = /(\\\"|\x00-|\x1f|\x7f-|\x9f|\u00ad|\u0600-|\u0604|\u070f|\u17b4|\u17b5|\u200c-|\u200f|\u2028-|\u202f|\u2060-|\u206f|\ufeff|\ufff0-|\uffff)/g; var re92 = /^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/; var re93 = /^([:.#]*)((?:[\w\u0128-\uffff*_-]|\\.)+)/; var re94 = /^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/; var str77 = '#fubhgobk .pybfr'; var str78 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzssrwh-aowb_80=441326q33660'; var str79 = 'FrffvbaQQS2=102n9o0o9pq60132qn0337rr867p75953502q2s27s2s5r98; AFP_zp_dfctwzssrwh-aowb_80=441326q33660; __hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1; __hgzo=144631658.0.10.1231365869; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str80 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R=; AFP_zp_dfctwzs-aowb_80=441327q73660'; var str81 = 'FrffvbaQQS2=9995p6rp12rrnr893334ro7nq70o7p64p69rqn844prs1473; AFP_zp_dfctwzs-aowb_80=441327q73660; __hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar); __hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1; __hgzo=144631658.0.10.1231367054; __hgzp=144631658; ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str82 = '[glcr=fhozvg]'; var str83 = 'n.svryqOga,n.svryqOgaPnapry'; var str84 = 'n.svryqOgaPnapry'; var str85 = 'oyvpxchaxg'; var str86 = 'qvi.bow-nppbeqvba qg'; var str87 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_nccf_wf&qg=1231367052227&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231367052227&punaary=svz_zlfcnpr_nccf-pnainf%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyr.zlfcnpr.pbz%2SZbqhyrf%2SNccyvpngvbaf%2SCntrf%2SPnainf.nfck&nq_glcr=grkg&rvq=6083027&rn=0&sez=1&tn_ivq=716357910.1231367056&tn_fvq=1231367056&tn_uvq=1387206491&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str88 = 'uggc://tbbtyrnqf.t.qbhoyrpyvpx.arg/cntrnq/nqf?pyvrag=pn-svz_zlfcnpr_zlfcnpr-ubzrcntr_wf&qg=1231365851658&uy=ra&nqfnsr=uvtu&br=hgs8&ahz_nqf=4&bhgchg=wf&nqgrfg=bss&pbeeryngbe=1231365851658&punaary=svz_zlfcnpr_ubzrcntr_abgybttrqva%2Psvz_zlfcnpr_aba_HTP%2Psvz_zlfcnpr_havgrq-fgngrf&hey=uggc%3N%2S%2Scebsvyrrqvg.zlfcnpr.pbz%2Svaqrk.psz&nq_glcr=grkg&rvq=6083027&rn=0&sez=0&tn_ivq=1979828129.1231365855&tn_fvq=1231365855&tn_uvq=2085229649&synfu=9.0.115&h_u=768&h_j=1024&h_nu=738&h_nj=1024&h_pq=24&h_gm=-480&h_uvf=2&h_wnin=gehr&h_acyht=7&h_azvzr=22'; var str89 = 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&aqu=1&g=7%2S0%2S2009%2014%3N12%3N47%203%20480&af=zfacbegny&cntrAnzr=HF%20UCZFSGJ&t=uggc%3N%2S%2Sjjj.zfa.pbz%2S&f=0k0&p=43835816&x=A&oj=994&ou=634&uc=A&{2}&[NDR]'; var str90 = 'zrgn[anzr=nwnkHey]'; var str91 = 'anpuevpugra'; var str92 = 'b oS={\'oT\':1.1};x $8n(B){z(B!=o9)};x $S(B){O(!$8n(B))z A;O(B.4L)z\'T\';b S=7t B;O(S==\'2P\'&&B.p4){23(B.7f){12 1:z\'T\';12 3:z/\S/.2g(B.8M)?\'ox\':\'oh\'}}O(S==\'2P\'||S==\'x\'){23(B.nE){12 2V:z\'1O\';12 7I:z\'5a\';12 18:z\'4B\'}O(7t B.I==\'4F\'){O(B.3u)z\'pG\';O(B.8e)z\'1p\'}}z S};x $2p(){b 4E={};Z(b v=0;v<1p.I;v++){Z(b X 1o 1p[v]){b nc=1p[v][X];b 6E=4E[X];O(6E&&$S(nc)==\'2P\'&&$S(6E)==\'2P\')4E[X]=$2p(6E,nc);17 4E[X]=nc}}z 4E};b $E=7p.E=x(){b 1d=1p;O(!1d[1])1d=[p,1d[0]];Z(b X 1o 1d[1])1d[0][X]=1d[1][X];z 1d[0]};b $4D=7p.pJ=x(){Z(b v=0,y=1p.I;v-1:p.3F(2R)>-1},nX:x(){z p.3y(/([.*+?^${}()|[\]\/\\])/t,\'\\$1\')}});2V.E({5V:x(1O){O(p.I<3)z A;O(p.I==4&&p[3]==0&&!1O)z\'p5\';b 3P=[];Z(b v=0;v<3;v++){b 52=(p[v]-0).4h(16);3P.1x((52.I==1)?\'0\'+52:52)}z 1O?3P:\'#\'+3P.2u(\'\')},5U:x(1O){O(p.I!=3)z A;b 1i=[];Z(b v=0;v<3;v++){1i.1x(5K((p[v].I==1)?p[v]+p[v]:p[v],16))}z 1O?1i:\'1i(\'+1i.2u(\',\')+\')\'}});7F.E({3n:x(P){b J=p;P=$2p({\'L\':J,\'V\':A,\'1p\':1S,\'2x\':A,\'4s\':A,\'6W\':A},P);O($2O(P.1p)&&$S(P.1p)!=\'1O\')P.1p=[P.1p];z x(V){b 1d;O(P.V){V=V||H.V;1d=[(P.V===1r)?V:Y P.V(V)];O(P.1p)1d.E(P.1p)}17 1d=P.1p||1p;b 3C=x(){z J.3H($5S(P'; var str93 = 'hagreunyghat'; var str94 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669341278771470&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str95 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&Pbhagel=IIZ%3Q&SbeprqRkcvengvba=633669350559478880&gvzrMbar=-8&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R%3Q'; var str96 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669341278771470&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str97 = 'ZFPhygher=VC=74.125.75.1&VCPhygher=ra-HF&CersreerqPhygher=ra-HF&CersreerqPhygherCraqvat=&Pbhagel=IIZ=&SbeprqRkcvengvba=633669350559478880&gvzrMbar=0&HFEYBP=DKWyLHAiMTH9AwHjWxAcqUx9GJ91oaEunJ4tIzyyqlMQo3IhqUW5D29xMG1IHlMQo3IhqUW5GzSgMG1Iozy0MJDtH3EuqTImWxEgLHAiMTH9BQN3WxkuqTy0qJEyCGZ3YwDkBGVzGT9hM2y0qJEyCF0kZwVhZQH3APMDo3A0LJkQo2EyCGx0ZQDmWyWyM2yiox5uoJH9D0R='; var str98 = 'shapgvba (){Cuk.Nccyvpngvba.Frghc.Pber();Cuk.Nccyvpngvba.Frghc.Nwnk();Cuk.Nccyvpngvba.Frghc.Synfu();Cuk.Nccyvpngvba.Frghc.Zbqhyrf()}'; function runBlock11() { for (var i = 0; i < 2; i++) { ' .pybfr'.replace(re18, ''); ' n.svryqOgaPnapry'.replace(re18, ''); ' qg'.replace(re18, ''); str77.replace(re68, ''); str77.replace(re18, ''); ''.replace(re39, ''); ''.replace(/^/, ''); ''.split(re86); '*'.replace(re39, ''); '*'.replace(re68, ''); '*'.replace(re18, ''); '.pybfr'.replace(re68, ''); '.pybfr'.replace(re18, ''); '//vzt.jro.qr/vij/FC/tzk_uc/fperra/${inyhr}?gf=${abj}'.replace(re87, ''); '//vzt.jro.qr/vij/FC/tzk_uc/fperra/1024?gf=${abj}'.replace(re88, ''); '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/${inyhr}?gf=${abj}'.replace(re87, ''); '//vzt.jro.qr/vij/FC/tzk_uc/jvafvmr/992/608?gf=${abj}'.replace(re88, ''); '300k120'.replace(re30, ''); '300k250'.replace(re30, ''); '310k120'.replace(re30, ''); '310k170'.replace(re30, ''); '310k250'.replace(re30, ''); '9.0 e115'.replace(/^.*\.(.*)\s.*$/, ''); 'Nppbeqvba'.replace(re2, ''); 'Nxghryy\x0a'.replace(re89, ''); 'Nxghryy\x0a'.replace(re90, ''); 'Nccyvpngvba'.replace(re2, ''); 'Oyvpxchaxg\x0a'.replace(re89, ''); 'Oyvpxchaxg\x0a'.replace(re90, ''); 'Svanamra\x0a'.replace(re89, ''); 'Svanamra\x0a'.replace(re90, ''); 'Tnzrf\x0a'.replace(re89, ''); 'Tnzrf\x0a'.replace(re90, ''); 'Ubebfxbc\x0a'.replace(re89, ''); 'Ubebfxbc\x0a'.replace(re90, ''); 'Xvab\x0a'.replace(re89, ''); 'Xvab\x0a'.replace(re90, ''); 'Zbqhyrf'.replace(re2, ''); 'Zhfvx\x0a'.replace(re89, ''); 'Zhfvx\x0a'.replace(re90, ''); 'Anpuevpugra\x0a'.replace(re89, ''); 'Anpuevpugra\x0a'.replace(re90, ''); 'Cuk'.replace(re2, ''); 'ErdhrfgSvavfu'.split(re70); 'ErdhrfgSvavfu.NWNK.Cuk'.split(re70); 'Ebhgr\x0a'.replace(re89, ''); 'Ebhgr\x0a'.replace(re90, ''); str78.split(re32); str79.split(re32); str80.split(re32); str81.split(re32); 'Fcbeg\x0a'.replace(re89, ''); 'Fcbeg\x0a'.replace(re90, ''); 'GI-Fcbg\x0a'.replace(re89, ''); 'GI-Fcbg\x0a'.replace(re90, ''); 'Gbhe\x0a'.replace(re89, ''); 'Gbhe\x0a'.replace(re90, ''); 'Hagreunyghat\x0a'.replace(re89, ''); 'Hagreunyghat\x0a'.replace(re90, ''); 'Ivqrb\x0a'.replace(re89, ''); 'Ivqrb\x0a'.replace(re90, ''); 'Jrggre\x0a'.replace(re89, ''); 'Jrggre\x0a'.replace(re90, ''); str82.replace(re68, ''); str82.replace(re18, ''); str83.replace(re68, ''); str83.replace(re18, ''); str84.replace(re68, ''); str84.replace(re18, ''); 'nqiFreivprObk'.replace(re30, ''); 'nqiFubccvatObk'.replace(re30, ''); 'nwnk'.replace(re39, ''); 'nxghryy'.replace(re40, ''); 'nxghryy'.replace(re41, ''); 'nxghryy'.replace(re42, ''); 'nxghryy'.replace(re43, ''); 'nxghryy'.replace(re44, ''); 'nxghryy'.replace(re45, ''); 'nxghryy'.replace(re46, ''); 'nxghryy'.replace(re47, ''); 'nxghryy'.replace(re48, ''); str85.replace(re40, ''); str85.replace(re41, ''); str85.replace(re42, ''); str85.replace(re43, ''); str85.replace(re44, ''); str85.replace(re45, ''); str85.replace(re46, ''); str85.replace(re47, ''); str85.replace(re48, ''); 'pngrtbel'.replace(re29, ''); 'pngrtbel'.replace(re30, ''); 'pybfr'.replace(re39, ''); 'qvi'.replace(re39, ''); str86.replace(re68, ''); str86.replace(re18, ''); 'qg'.replace(re39, ''); 'qg'.replace(re68, ''); 'qg'.replace(re18, ''); 'rzorq'.replace(re39, ''); 'rzorq'.replace(re68, ''); 'rzorq'.replace(re18, ''); 'svryqOga'.replace(re39, ''); 'svryqOgaPnapry'.replace(re39, ''); 'svz_zlfcnpr_nccf-pnainf,svz_zlfcnpr_havgrq-fgngrf'.split(re20); 'svanamra'.replace(re40, ''); 'svanamra'.replace(re41, ''); 'svanamra'.replace(re42, ''); 'svanamra'.replace(re43, ''); 'svanamra'.replace(re44, ''); 'svanamra'.replace(re45, ''); 'svanamra'.replace(re46, ''); 'svanamra'.replace(re47, ''); 'svanamra'.replace(re48, ''); 'sbphf'.split(re70); 'sbphf.gno sbphfva.gno'.split(re70); 'sbphfva'.split(re70); 'sbez'.replace(re39, ''); 'sbez.nwnk'.replace(re68, ''); 'sbez.nwnk'.replace(re18, ''); 'tnzrf'.replace(re40, ''); 'tnzrf'.replace(re41, ''); 'tnzrf'.replace(re42, ''); 'tnzrf'.replace(re43, ''); 'tnzrf'.replace(re44, ''); 'tnzrf'.replace(re45, ''); 'tnzrf'.replace(re46, ''); 'tnzrf'.replace(re47, ''); 'tnzrf'.replace(re48, ''); 'ubzrcntr'.replace(re30, ''); 'ubebfxbc'.replace(re40, ''); 'ubebfxbc'.replace(re41, ''); 'ubebfxbc'.replace(re42, ''); 'ubebfxbc'.replace(re43, ''); 'ubebfxbc'.replace(re44, ''); 'ubebfxbc'.replace(re45, ''); 'ubebfxbc'.replace(re46, ''); 'ubebfxbc'.replace(re47, ''); 'ubebfxbc'.replace(re48, ''); 'uc_cebzbobk_ugzy%2Puc_cebzbobk_vzt'.replace(re30, ''); 'uc_erpgnatyr'.replace(re30, ''); str87.replace(re33, ''); str88.replace(re33, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${4}${5}'.replace(re71, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf${5}'.replace(re72, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${4}${5}'.replace(re71, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/qlaYvo.wf${5}'.replace(re72, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${4}${5}'.replace(re71, ''); 'uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/rssrpgYvo.wf${5}'.replace(re72, ''); str89.replace(re73, ''); 'uggc://zfacbegny.112.2b7.arg/o/ff/zfacbegnyubzr/1/U.7-cqi-2/f55023338617756?[NDO]&{1}&{2}&[NDR]'.replace(re69, ''); str6.replace(re23, ''); 'xvab'.replace(re40, ''); 'xvab'.replace(re41, ''); 'xvab'.replace(re42, ''); 'xvab'.replace(re43, ''); 'xvab'.replace(re44, ''); 'xvab'.replace(re45, ''); 'xvab'.replace(re46, ''); 'xvab'.replace(re47, ''); 'xvab'.replace(re48, ''); 'ybnq'.split(re70); 'zrqvnzbqgno lhv-anifrg lhv-anifrg-gbc'.replace(re18, ''); 'zrgn'.replace(re39, ''); str90.replace(re68, ''); str90.replace(re18, ''); 'zbhfrzbir'.split(re70); 'zbhfrzbir.gno'.split(re70); str63.replace(/^.*jroxvg\/(\d+(\.\d+)?).*$/, ''); 'zhfvx'.replace(re40, ''); 'zhfvx'.replace(re41, ''); 'zhfvx'.replace(re42, ''); 'zhfvx'.replace(re43, ''); 'zhfvx'.replace(re44, ''); 'zhfvx'.replace(re45, ''); 'zhfvx'.replace(re46, ''); 'zhfvx'.replace(re47, ''); 'zhfvx'.replace(re48, ''); 'zlfcnpr_nccf_pnainf'.replace(re52, ''); str91.replace(re40, ''); str91.replace(re41, ''); str91.replace(re42, ''); str91.replace(re43, ''); str91.replace(re44, ''); str91.replace(re45, ''); str91.replace(re46, ''); str91.replace(re47, ''); str91.replace(re48, ''); 'anzr'.replace(re39, ''); str92.replace(/\b\w+\b/g, ''); 'bow-nppbeqvba'.replace(re39, ''); 'bowrpg'.replace(re39, ''); 'bowrpg'.replace(re68, ''); 'bowrpg'.replace(re18, ''); 'cnenzf%2Rfglyrf'.replace(re29, ''); 'cnenzf%2Rfglyrf'.replace(re30, ''); 'cbchc'.replace(re30, ''); 'ebhgr'.replace(re40, ''); 'ebhgr'.replace(re41, ''); 'ebhgr'.replace(re42, ''); 'ebhgr'.replace(re43, ''); 'ebhgr'.replace(re44, ''); 'ebhgr'.replace(re45, ''); 'ebhgr'.replace(re46, ''); 'ebhgr'.replace(re47, ''); 'ebhgr'.replace(re48, ''); 'freivprobk_uc'.replace(re30, ''); 'fubccvatobk_uc'.replace(re30, ''); 'fubhgobk'.replace(re39, ''); 'fcbeg'.replace(re40, ''); 'fcbeg'.replace(re41, ''); 'fcbeg'.replace(re42, ''); 'fcbeg'.replace(re43, ''); 'fcbeg'.replace(re44, ''); 'fcbeg'.replace(re45, ''); 'fcbeg'.replace(re46, ''); 'fcbeg'.replace(re47, ''); 'fcbeg'.replace(re48, ''); 'gbhe'.replace(re40, ''); 'gbhe'.replace(re41, ''); 'gbhe'.replace(re42, ''); 'gbhe'.replace(re43, ''); 'gbhe'.replace(re44, ''); 'gbhe'.replace(re45, ''); 'gbhe'.replace(re46, ''); 'gbhe'.replace(re47, ''); 'gbhe'.replace(re48, ''); 'gi-fcbg'.replace(re40, ''); 'gi-fcbg'.replace(re41, ''); 'gi-fcbg'.replace(re42, ''); 'gi-fcbg'.replace(re43, ''); 'gi-fcbg'.replace(re44, ''); 'gi-fcbg'.replace(re45, ''); 'gi-fcbg'.replace(re46, ''); 'gi-fcbg'.replace(re47, ''); 'gi-fcbg'.replace(re48, ''); 'glcr'.replace(re39, ''); 'haqrsvarq'.replace(/\//g, ''); str93.replace(re40, ''); str93.replace(re41, ''); str93.replace(re42, ''); str93.replace(re43, ''); str93.replace(re44, ''); str93.replace(re45, ''); str93.replace(re46, ''); str93.replace(re47, ''); str93.replace(re48, ''); 'ivqrb'.replace(re40, ''); 'ivqrb'.replace(re41, ''); 'ivqrb'.replace(re42, ''); 'ivqrb'.replace(re43, ''); 'ivqrb'.replace(re44, ''); 'ivqrb'.replace(re45, ''); 'ivqrb'.replace(re46, ''); 'ivqrb'.replace(re47, ''); 'ivqrb'.replace(re48, ''); 'ivfvgf=1'.split(re86); 'jrggre'.replace(re40, ''); 'jrggre'.replace(re41, ''); 'jrggre'.replace(re42, ''); 'jrggre'.replace(re43, ''); 'jrggre'.replace(re44, ''); 'jrggre'.replace(re45, ''); 'jrggre'.replace(re46, ''); 'jrggre'.replace(re47, ''); 'jrggre'.replace(re48, ''); /#[a-z0-9]+$/i.exec('uggc://jjj.fpuhryreim.arg/Qrsnhyg'); re66.exec('fryrpgrq'); /(?:^|\s+)lhv-ani(?:\s+|$)/.exec('sff lhv-ani'); /(?:^|\s+)lhv-anifrg(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg'); /(?:^|\s+)lhv-anifrg-gbc(?:\s+|$)/.exec('zrqvnzbqgno lhv-anifrg'); re91.exec('GnoThvq'); re91.exec('thvq'); /(pbzcngvoyr|jroxvg)/.exec(str63); /.+(?:ei|vg|en|vr)[\/: ]([\d.]+)/.exec(str63); re8.exec('144631658.0.10.1231365869'); re8.exec('144631658.0.10.1231367054'); re8.exec('144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('144631658.1670816052019209000.1231365869.1231365869.1231365869.1'); re8.exec('144631658.1796080716621419500.1231367054.1231367054.1231367054.1'); re8.exec(str94); re8.exec(str95); re8.exec(str96); re8.exec(str97); re8.exec('__hgzn=144631658.1670816052019209000.1231365869.1231365869.1231365869.1'); re8.exec('__hgzn=144631658.1796080716621419500.1231367054.1231367054.1231367054.1'); re8.exec('__hgzo=144631658.0.10.1231365869'); re8.exec('__hgzo=144631658.0.10.1231367054'); re8.exec('__hgzm=144631658.1231365869.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re8.exec('__hgzm=144631658.1231367054.1.1.hgzpfe=(qverpg)|hgzppa=(qverpg)|hgzpzq=(abar)'); re34.exec(str78); re34.exec(str79); re34.exec(str81); re74.exec(str77); re74.exec('*'); re74.exec(str82); re74.exec(str83); re74.exec(str86); re74.exec('rzorq'); re74.exec('sbez.nwnk'); re74.exec(str90); re74.exec('bowrpg'); /\/onfr.wf(\?.+)?$/.exec('/uggc://wf.hv-cbegny.qr/tzk/ubzr/wf/20080602/onfr.wf'); re28.exec('uvag ynfgUvag ynfg'); re75.exec(''); re76.exec(''); re77.exec(''); re78.exec(''); re80.exec(str77); re80.exec('*'); re80.exec('.pybfr'); re80.exec(str82); re80.exec(str83); re80.exec(str84); re80.exec(str86); re80.exec('qg'); re80.exec('rzorq'); re80.exec('sbez.nwnk'); re80.exec(str90); re80.exec('bowrpg'); re61.exec('qlaYvo.wf'); re61.exec('rssrpgYvo.wf'); re61.exec('uggc://jjj.tzk.arg/qr/?fgnghf=uvajrvf'); re92.exec(' .pybfr'); re92.exec(' n.svryqOgaPnapry'); re92.exec(' qg'); re92.exec(str48); re92.exec('.nwnk'); re92.exec('.svryqOga,n.svryqOgaPnapry'); re92.exec('.svryqOgaPnapry'); re92.exec('.bow-nppbeqvba qg'); re68.exec(str77); re68.exec('*'); re68.exec('.pybfr'); re68.exec(str82); re68.exec(str83); re68.exec(str84); re68.exec(str86); re68.exec('qg'); re68.exec('rzorq'); re68.exec('sbez.nwnk'); re68.exec(str90); re68.exec('bowrpg'); re93.exec(' .pybfr'); re93.exec(' n.svryqOgaPnapry'); re93.exec(' qg'); re93.exec(str48); re93.exec('.nwnk'); re93.exec('.svryqOga,n.svryqOgaPnapry'); re93.exec('.svryqOgaPnapry'); re93.exec('.bow-nppbeqvba qg'); re81.exec(str77); re81.exec('*'); re81.exec(str48); re81.exec('.pybfr'); re81.exec(str82); re81.exec(str83); re81.exec(str84); re81.exec(str86); re81.exec('qg'); re81.exec('rzorq'); re81.exec('sbez.nwnk'); re81.exec(str90); re81.exec('bowrpg'); re94.exec(' .pybfr'); re94.exec(' n.svryqOgaPnapry'); re94.exec(' qg'); re94.exec(str48); re94.exec('.nwnk'); re94.exec('.svryqOga,n.svryqOgaPnapry'); re94.exec('.svryqOgaPnapry'); re94.exec('.bow-nppbeqvba qg'); re94.exec('[anzr=nwnkHey]'); re94.exec(str82); re31.exec('rf'); re31.exec('wn'); re82.exec(str77); re82.exec('*'); re82.exec(str48); re82.exec('.pybfr'); re82.exec(str82); re82.exec(str83); re82.exec(str84); re82.exec(str86); re82.exec('qg'); re82.exec('rzorq'); re82.exec('sbez.nwnk'); re82.exec(str90); re82.exec('bowrpg'); re83.exec(str98); re83.exec('shapgvba sbphf() { [angvir pbqr] }'); re62.exec('#Ybtva'); re62.exec('#Ybtva_cnffjbeq'); re62.exec(str77); re62.exec('#fubhgobkWf'); re62.exec('#fubhgobkWfReebe'); re62.exec('#fubhgobkWfFhpprff'); re62.exec('*'); re62.exec(str82); re62.exec(str83); re62.exec(str86); re62.exec('rzorq'); re62.exec('sbez.nwnk'); re62.exec(str90); re62.exec('bowrpg'); re49.exec('pbagrag'); re24.exec(str6); /xbadhrebe/.exec(str63); /znp/.exec('jva32'); /zbmvyyn/.exec(str63); /zfvr/.exec(str63); /ag\s5\.1/.exec(str63); /bcren/.exec(str63); /fnsnev/.exec(str63); /jva/.exec('jva32'); /jvaqbjf/.exec(str63); } } function run() { for (var i = 0; i < 5; i++) { runBlock0(); runBlock1(); runBlock2(); runBlock3(); runBlock4(); runBlock5(); runBlock6(); runBlock7(); runBlock8(); runBlock9(); runBlock10(); runBlock11(); } } this.run = run; } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/revisions.html000066400000000000000000000100561211511573600242360ustar00rootroot00000000000000 V8 Benchmark Suite Revisions

V8 Benchmark Suite Revisions

The V8 benchmark suite is changed from time to time as we fix bugs or expand the scope of the benchmarks. Here is a list of revisions, with a description of the changes made. Note that benchmark results are not comparable unless both results are run with the same revision of the benchmark suite.

Version 7 (link)

This version includes the new Navier-Stokes benchmark, a 2D differential equation solver that stresses arithmetic computations on double arrays.

Version 6 (link)

Removed dead code from the RayTrace benchmark and fixed a couple of typos in the DeltaBlue implementation. Changed the Splay benchmark to avoid converting the same numeric key to a string over and over again and to avoid inserting and removing the same element repeatedly thus increasing pressure on the memory subsystem. Changed the RegExp benchmark to exercise the regular expression engine on different input strings.

Furthermore, the benchmark runner was changed to run the benchmarks for at least a few times to stabilize the reported numbers on slower machines.

Version 5 (link)

Removed duplicate line in random seed code, and changed the name of the Object.prototype.inherits function in the DeltaBlue benchmark to inheritsFrom to avoid name clashes when running in Chromium with extensions enabled.

Version 4 (link)

The Splay benchmark is a newcomer in version 4. It manipulates a splay tree by adding and removing data nodes, thus exercising the memory management subsystem of the JavaScript engine.

Furthermore, all the unused parts of the Prototype library were removed from the RayTrace benchmark. This does not affect the running of the benchmark.

Version 3 (link)

Version 3 adds a new benchmark, RegExp. The RegExp benchmark is generated by loading 50 of the most popular pages on the web and logging all regexp operations performed. Each operation is given a weight that is calculated from an estimate of the popularity of the pages where it occurs and the number of times it is executed while loading each page. Finally the literal letters in the data are encoded using ROT13 in a way that does not affect how the regexps match their input.

Version 2 (link)

For version 2 the Crypto benchmark was fixed. Previously, the decryption stage was given plaintext as input, which resulted in an error. Now, the decryption stage is given the output of the encryption stage as input. The result is checked against the original plaintext. For this to give the correct results the crypto objects are reset for each iteration of the benchmark. In addition, the size of the plain text has been increased a little and the use of Math.random() and new Date() to build an RNG pool has been removed.

Other benchmarks were fixed to do elementary verification of the results of their calculations. This is to avoid accidentally obtaining scores that are the result of an incorrect JavaScript engine optimization.

Version 1 (link)

Initial release.

v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/richards.js000066400000000000000000000366401211511573600234730ustar00rootroot00000000000000// Copyright 2006-2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This is a JavaScript implementation of the Richards // benchmark from: // // http://www.cl.cam.ac.uk/~mr10/Bench.html // // The benchmark was originally implemented in BCPL by // Martin Richards. var Richards = new BenchmarkSuite('Richards', 35302, [ new Benchmark("Richards", runRichards) ]); /** * The Richards benchmark simulates the task dispatcher of an * operating system. **/ function runRichards() { var scheduler = new Scheduler(); scheduler.addIdleTask(ID_IDLE, 0, null, COUNT); var queue = new Packet(null, ID_WORKER, KIND_WORK); queue = new Packet(queue, ID_WORKER, KIND_WORK); scheduler.addWorkerTask(ID_WORKER, 1000, queue); queue = new Packet(null, ID_DEVICE_A, KIND_DEVICE); queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE); queue = new Packet(queue, ID_DEVICE_A, KIND_DEVICE); scheduler.addHandlerTask(ID_HANDLER_A, 2000, queue); queue = new Packet(null, ID_DEVICE_B, KIND_DEVICE); queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE); queue = new Packet(queue, ID_DEVICE_B, KIND_DEVICE); scheduler.addHandlerTask(ID_HANDLER_B, 3000, queue); scheduler.addDeviceTask(ID_DEVICE_A, 4000, null); scheduler.addDeviceTask(ID_DEVICE_B, 5000, null); scheduler.schedule(); if (scheduler.queueCount != EXPECTED_QUEUE_COUNT || scheduler.holdCount != EXPECTED_HOLD_COUNT) { var msg = "Error during execution: queueCount = " + scheduler.queueCount + ", holdCount = " + scheduler.holdCount + "."; throw new Error(msg); } } var COUNT = 1000; /** * These two constants specify how many times a packet is queued and * how many times a task is put on hold in a correct run of richards. * They don't have any meaning a such but are characteristic of a * correct run so if the actual queue or hold count is different from * the expected there must be a bug in the implementation. **/ var EXPECTED_QUEUE_COUNT = 2322; var EXPECTED_HOLD_COUNT = 928; /** * A scheduler can be used to schedule a set of tasks based on their relative * priorities. Scheduling is done by maintaining a list of task control blocks * which holds tasks and the data queue they are processing. * @constructor */ function Scheduler() { this.queueCount = 0; this.holdCount = 0; this.blocks = new Array(NUMBER_OF_IDS); this.list = null; this.currentTcb = null; this.currentId = null; } var ID_IDLE = 0; var ID_WORKER = 1; var ID_HANDLER_A = 2; var ID_HANDLER_B = 3; var ID_DEVICE_A = 4; var ID_DEVICE_B = 5; var NUMBER_OF_IDS = 6; var KIND_DEVICE = 0; var KIND_WORK = 1; /** * Add an idle task to this scheduler. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task * @param {int} count the number of times to schedule the task */ Scheduler.prototype.addIdleTask = function (id, priority, queue, count) { this.addRunningTask(id, priority, queue, new IdleTask(this, 1, count)); }; /** * Add a work task to this scheduler. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task */ Scheduler.prototype.addWorkerTask = function (id, priority, queue) { this.addTask(id, priority, queue, new WorkerTask(this, ID_HANDLER_A, 0)); }; /** * Add a handler task to this scheduler. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task */ Scheduler.prototype.addHandlerTask = function (id, priority, queue) { this.addTask(id, priority, queue, new HandlerTask(this)); }; /** * Add a handler task to this scheduler. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task */ Scheduler.prototype.addDeviceTask = function (id, priority, queue) { this.addTask(id, priority, queue, new DeviceTask(this)) }; /** * Add the specified task and mark it as running. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task * @param {Task} task the task to add */ Scheduler.prototype.addRunningTask = function (id, priority, queue, task) { this.addTask(id, priority, queue, task); this.currentTcb.setRunning(); }; /** * Add the specified task to this scheduler. * @param {int} id the identity of the task * @param {int} priority the task's priority * @param {Packet} queue the queue of work to be processed by the task * @param {Task} task the task to add */ Scheduler.prototype.addTask = function (id, priority, queue, task) { this.currentTcb = new TaskControlBlock(this.list, id, priority, queue, task); this.list = this.currentTcb; this.blocks[id] = this.currentTcb; }; /** * Execute the tasks managed by this scheduler. */ Scheduler.prototype.schedule = function () { this.currentTcb = this.list; while (this.currentTcb != null) { if (this.currentTcb.isHeldOrSuspended()) { this.currentTcb = this.currentTcb.link; } else { this.currentId = this.currentTcb.id; this.currentTcb = this.currentTcb.run(); } } }; /** * Release a task that is currently blocked and return the next block to run. * @param {int} id the id of the task to suspend */ Scheduler.prototype.release = function (id) { var tcb = this.blocks[id]; if (tcb == null) return tcb; tcb.markAsNotHeld(); if (tcb.priority > this.currentTcb.priority) { return tcb; } else { return this.currentTcb; } }; /** * Block the currently executing task and return the next task control block * to run. The blocked task will not be made runnable until it is explicitly * released, even if new work is added to it. */ Scheduler.prototype.holdCurrent = function () { this.holdCount++; this.currentTcb.markAsHeld(); return this.currentTcb.link; }; /** * Suspend the currently executing task and return the next task control block * to run. If new work is added to the suspended task it will be made runnable. */ Scheduler.prototype.suspendCurrent = function () { this.currentTcb.markAsSuspended(); return this.currentTcb; }; /** * Add the specified packet to the end of the worklist used by the task * associated with the packet and make the task runnable if it is currently * suspended. * @param {Packet} packet the packet to add */ Scheduler.prototype.queue = function (packet) { var t = this.blocks[packet.id]; if (t == null) return t; this.queueCount++; packet.link = null; packet.id = this.currentId; return t.checkPriorityAdd(this.currentTcb, packet); }; /** * A task control block manages a task and the queue of work packages associated * with it. * @param {TaskControlBlock} link the preceding block in the linked block list * @param {int} id the id of this block * @param {int} priority the priority of this block * @param {Packet} queue the queue of packages to be processed by the task * @param {Task} task the task * @constructor */ function TaskControlBlock(link, id, priority, queue, task) { this.link = link; this.id = id; this.priority = priority; this.queue = queue; this.task = task; if (queue == null) { this.state = STATE_SUSPENDED; } else { this.state = STATE_SUSPENDED_RUNNABLE; } } /** * The task is running and is currently scheduled. */ var STATE_RUNNING = 0; /** * The task has packets left to process. */ var STATE_RUNNABLE = 1; /** * The task is not currently running. The task is not blocked as such and may * be started by the scheduler. */ var STATE_SUSPENDED = 2; /** * The task is blocked and cannot be run until it is explicitly released. */ var STATE_HELD = 4; var STATE_SUSPENDED_RUNNABLE = STATE_SUSPENDED | STATE_RUNNABLE; var STATE_NOT_HELD = ~STATE_HELD; TaskControlBlock.prototype.setRunning = function () { this.state = STATE_RUNNING; }; TaskControlBlock.prototype.markAsNotHeld = function () { this.state = this.state & STATE_NOT_HELD; }; TaskControlBlock.prototype.markAsHeld = function () { this.state = this.state | STATE_HELD; }; TaskControlBlock.prototype.isHeldOrSuspended = function () { return (this.state & STATE_HELD) != 0 || (this.state == STATE_SUSPENDED); }; TaskControlBlock.prototype.markAsSuspended = function () { this.state = this.state | STATE_SUSPENDED; }; TaskControlBlock.prototype.markAsRunnable = function () { this.state = this.state | STATE_RUNNABLE; }; /** * Runs this task, if it is ready to be run, and returns the next task to run. */ TaskControlBlock.prototype.run = function () { var packet; if (this.state == STATE_SUSPENDED_RUNNABLE) { packet = this.queue; this.queue = packet.link; if (this.queue == null) { this.state = STATE_RUNNING; } else { this.state = STATE_RUNNABLE; } } else { packet = null; } return this.task.run(packet); }; /** * Adds a packet to the worklist of this block's task, marks this as runnable if * necessary, and returns the next runnable object to run (the one * with the highest priority). */ TaskControlBlock.prototype.checkPriorityAdd = function (task, packet) { if (this.queue == null) { this.queue = packet; this.markAsRunnable(); if (this.priority > task.priority) return this; } else { this.queue = packet.addTo(this.queue); } return task; }; TaskControlBlock.prototype.toString = function () { return "tcb { " + this.task + "@" + this.state + " }"; }; /** * An idle task doesn't do any work itself but cycles control between the two * device tasks. * @param {Scheduler} scheduler the scheduler that manages this task * @param {int} v1 a seed value that controls how the device tasks are scheduled * @param {int} count the number of times this task should be scheduled * @constructor */ function IdleTask(scheduler, v1, count) { this.scheduler = scheduler; this.v1 = v1; this.count = count; } IdleTask.prototype.run = function (packet) { this.count--; if (this.count == 0) return this.scheduler.holdCurrent(); if ((this.v1 & 1) == 0) { this.v1 = this.v1 >> 1; return this.scheduler.release(ID_DEVICE_A); } else { this.v1 = (this.v1 >> 1) ^ 0xD008; return this.scheduler.release(ID_DEVICE_B); } }; IdleTask.prototype.toString = function () { return "IdleTask" }; /** * A task that suspends itself after each time it has been run to simulate * waiting for data from an external device. * @param {Scheduler} scheduler the scheduler that manages this task * @constructor */ function DeviceTask(scheduler) { this.scheduler = scheduler; this.v1 = null; } DeviceTask.prototype.run = function (packet) { if (packet == null) { if (this.v1 == null) return this.scheduler.suspendCurrent(); var v = this.v1; this.v1 = null; return this.scheduler.queue(v); } else { this.v1 = packet; return this.scheduler.holdCurrent(); } }; DeviceTask.prototype.toString = function () { return "DeviceTask"; }; /** * A task that manipulates work packets. * @param {Scheduler} scheduler the scheduler that manages this task * @param {int} v1 a seed used to specify how work packets are manipulated * @param {int} v2 another seed used to specify how work packets are manipulated * @constructor */ function WorkerTask(scheduler, v1, v2) { this.scheduler = scheduler; this.v1 = v1; this.v2 = v2; } WorkerTask.prototype.run = function (packet) { if (packet == null) { return this.scheduler.suspendCurrent(); } else { if (this.v1 == ID_HANDLER_A) { this.v1 = ID_HANDLER_B; } else { this.v1 = ID_HANDLER_A; } packet.id = this.v1; packet.a1 = 0; for (var i = 0; i < DATA_SIZE; i++) { this.v2++; if (this.v2 > 26) this.v2 = 1; packet.a2[i] = this.v2; } return this.scheduler.queue(packet); } }; WorkerTask.prototype.toString = function () { return "WorkerTask"; }; /** * A task that manipulates work packets and then suspends itself. * @param {Scheduler} scheduler the scheduler that manages this task * @constructor */ function HandlerTask(scheduler) { this.scheduler = scheduler; this.v1 = null; this.v2 = null; } HandlerTask.prototype.run = function (packet) { if (packet != null) { if (packet.kind == KIND_WORK) { this.v1 = packet.addTo(this.v1); } else { this.v2 = packet.addTo(this.v2); } } if (this.v1 != null) { var count = this.v1.a1; var v; if (count < DATA_SIZE) { if (this.v2 != null) { v = this.v2; this.v2 = this.v2.link; v.a1 = this.v1.a2[count]; this.v1.a1 = count + 1; return this.scheduler.queue(v); } } else { v = this.v1; this.v1 = this.v1.link; return this.scheduler.queue(v); } } return this.scheduler.suspendCurrent(); }; HandlerTask.prototype.toString = function () { return "HandlerTask"; }; /* --- * * P a c k e t * --- */ var DATA_SIZE = 4; /** * A simple package of data that is manipulated by the tasks. The exact layout * of the payload data carried by a packet is not importaint, and neither is the * nature of the work performed on packets by the tasks. * * Besides carrying data, packets form linked lists and are hence used both as * data and worklists. * @param {Packet} link the tail of the linked list of packets * @param {int} id an ID for this packet * @param {int} kind the type of this packet * @constructor */ function Packet(link, id, kind) { this.link = link; this.id = id; this.kind = kind; this.a1 = 0; this.a2 = new Array(DATA_SIZE); } /** * Add this packet to the end of a worklist, and return the worklist. * @param {Packet} queue the worklist to add this packet to */ Packet.prototype.addTo = function (queue) { this.link = null; if (queue == null) return this; var peek, next = queue; while ((peek = next.link) != null) next = peek; next.link = this; return queue; }; Packet.prototype.toString = function () { return "Packet"; }; v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/run.html000066400000000000000000000125561211511573600230300ustar00rootroot00000000000000 V8 Benchmark Suite

V8 Benchmark Suite - version ?

Warning! This is not the latest version of the V8 benchmark suite. Consider running the latest version.
This page contains a suite of pure JavaScript benchmarks that we have used to tune V8. The final score is computed as the geometric mean of the individual results to make it independent of the running times of the individual benchmarks and of a reference system (score 100). Scores are not comparable across benchmark suite versions and higher scores means better performance: Bigger is better!
  • Richards
    OS kernel simulation benchmark, originally written in BCPL by Martin Richards (539 lines).
  • DeltaBlue
    One-way constraint solver, originally written in Smalltalk by John Maloney and Mario Wolczko (880 lines).
  • Crypto
    Encryption and decryption benchmark based on code by Tom Wu (1698 lines).
  • RayTrace
    Ray tracer benchmark based on code by Adam Burmister (904 lines).
  • EarleyBoyer
    Classic Scheme benchmarks, translated to JavaScript by Florian Loitsch's Scheme2Js compiler (4684 lines).
  • RegExp
    Regular expression benchmark generated by extracting regular expression operations from 50 of the most popular web pages (1761 lines).
  • Splay
    Data manipulation benchmark that deals with splay trees and exercises the automatic memory management subsystem (394 lines).
  • NavierStokes
    Solves NavierStokes equations in 2D, heavily manipulating double precision arrays. Based on Oliver Hunt's code (387 lines).

Note that benchmark results are not comparable unless both results are run with the same revision of the benchmark suite. We will be making revisions from time to time in order to fix bugs or expand the scope of the benchmark suite. For previous revisions and the change log see the revisions page.

Starting...
v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/run.js000066400000000000000000000043401211511573600224700ustar00rootroot00000000000000// Copyright 2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. load('base.js'); load('richards.js'); load('deltablue.js'); load('crypto.js'); load('raytrace.js'); load('earley-boyer.js'); load('regexp.js'); load('splay.js'); load('navier-stokes.js'); var success = true; function PrintResult(name, result) { print(name + ': ' + result); } function PrintError(name, error) { PrintResult(name, error); success = false; } function PrintScore(score) { if (success) { print('----'); print('Score (version ' + BenchmarkSuite.version + '): ' + score); } } BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, NotifyError: PrintError, NotifyScore: PrintScore }); v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/spinning-balls/000077500000000000000000000000001211511573600242455ustar00rootroot00000000000000v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/spinning-balls/index.html000066400000000000000000000003301211511573600262360ustar00rootroot00000000000000 v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/spinning-balls/splay-tree.js000066400000000000000000000213031211511573600266670ustar00rootroot00000000000000// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** * Constructs a Splay tree. A splay tree is a self-balancing binary * search tree with the additional property that recently accessed * elements are quick to access again. It performs basic operations * such as insertion, look-up and removal in O(log(n)) amortized time. * * @constructor */ function SplayTree() { }; /** * Pointer to the root node of the tree. * * @type {SplayTree.Node} * @private */ SplayTree.prototype.root_ = null; /** * @return {boolean} Whether the tree is empty. */ SplayTree.prototype.isEmpty = function() { return !this.root_; }; /** * Inserts a node into the tree with the specified key and value if * the tree does not already contain a node with the specified key. If * the value is inserted, it becomes the root of the tree. * * @param {number} key Key to insert into the tree. * @param {*} value Value to insert into the tree. */ SplayTree.prototype.insert = function(key, value) { if (this.isEmpty()) { this.root_ = new SplayTree.Node(key, value); return; } // Splay on the key to move the last node on the search path for // the key to the root of the tree. this.splay_(key); if (this.root_.key == key) { return; } var node = new SplayTree.Node(key, value); if (key > this.root_.key) { node.left = this.root_; node.right = this.root_.right; this.root_.right = null; } else { node.right = this.root_; node.left = this.root_.left; this.root_.left = null; } this.root_ = node; }; /** * Removes a node with the specified key from the tree if the tree * contains a node with this key. The removed node is returned. If the * key is not found, an exception is thrown. * * @param {number} key Key to find and remove from the tree. * @return {SplayTree.Node} The removed node. */ SplayTree.prototype.remove = function(key) { if (this.isEmpty()) { throw Error('Key not found: ' + key); } this.splay_(key); if (this.root_.key != key) { throw Error('Key not found: ' + key); } var removed = this.root_; if (!this.root_.left) { this.root_ = this.root_.right; } else { var right = this.root_.right; this.root_ = this.root_.left; // Splay to make sure that the new root has an empty right child. this.splay_(key); // Insert the original right child as the right child of the new // root. this.root_.right = right; } return removed; }; /** * Returns the node having the specified key or null if the tree doesn't contain * a node with the specified key. * * @param {number} key Key to find in the tree. * @return {SplayTree.Node} Node having the specified key. */ SplayTree.prototype.find = function(key) { if (this.isEmpty()) { return null; } this.splay_(key); return this.root_.key == key ? this.root_ : null; }; /** * @return {SplayTree.Node} Node having the maximum key value. */ SplayTree.prototype.findMax = function(opt_startNode) { if (this.isEmpty()) { return null; } var current = opt_startNode || this.root_; while (current.right) { current = current.right; } return current; }; /** * @return {SplayTree.Node} Node having the maximum key value that * is less than the specified key value. */ SplayTree.prototype.findGreatestLessThan = function(key) { if (this.isEmpty()) { return null; } // Splay on the key to move the node with the given key or the last // node on the search path to the top of the tree. this.splay_(key); // Now the result is either the root node or the greatest node in // the left subtree. if (this.root_.key < key) { return this.root_; } else if (this.root_.left) { return this.findMax(this.root_.left); } else { return null; } }; /** * @return {Array<*>} An array containing all the keys of tree's nodes. */ SplayTree.prototype.exportKeys = function() { var result = []; if (!this.isEmpty()) { this.root_.traverse_(function(node) { result.push(node.key); }); } return result; }; /** * Perform the splay operation for the given key. Moves the node with * the given key to the top of the tree. If no node has the given * key, the last node on the search path is moved to the top of the * tree. This is the simplified top-down splaying algorithm from: * "Self-adjusting Binary Search Trees" by Sleator and Tarjan * * @param {number} key Key to splay the tree on. * @private */ SplayTree.prototype.splay_ = function(key) { if (this.isEmpty()) { return; } // Create a dummy node. The use of the dummy node is a bit // counter-intuitive: The right child of the dummy node will hold // the L tree of the algorithm. The left child of the dummy node // will hold the R tree of the algorithm. Using a dummy node, left // and right will always be nodes and we avoid special cases. var dummy, left, right; dummy = left = right = new SplayTree.Node(null, null); var current = this.root_; while (true) { if (key < current.key) { if (!current.left) { break; } if (key < current.left.key) { // Rotate right. var tmp = current.left; current.left = tmp.right; tmp.right = current; current = tmp; if (!current.left) { break; } } // Link right. right.left = current; right = current; current = current.left; } else if (key > current.key) { if (!current.right) { break; } if (key > current.right.key) { // Rotate left. var tmp = current.right; current.right = tmp.left; tmp.left = current; current = tmp; if (!current.right) { break; } } // Link left. left.right = current; left = current; current = current.right; } else { break; } } // Assemble. left.right = current.left; right.left = current.right; current.left = dummy.right; current.right = dummy.left; this.root_ = current; }; /** * Constructs a Splay tree node. * * @param {number} key Key. * @param {*} value Value. */ SplayTree.Node = function(key, value) { this.key = key; this.value = value; }; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.left = null; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.right = null; /** * Performs an ordered traversal of the subtree starting at * this SplayTree.Node. * * @param {function(SplayTree.Node)} f Visitor function. * @private */ SplayTree.Node.prototype.traverse_ = function(f) { var current = this; while (current) { var left = current.left; if (left) left.traverse_(f); f(current); current = current.right; } }; SplayTree.prototype.traverseBreadthFirst = function (f) { if (f(this.root_.value)) return; var stack = [this.root_]; var length = 1; while (length > 0) { var new_stack = new Array(stack.length * 2); var new_length = 0; for (var i = 0; i < length; i++) { var n = stack[i]; var l = n.left; var r = n.right; if (l) { if (f(l.value)) return; new_stack[new_length++] = l; } if (r) { if (f(r.value)) return; new_stack[new_length++] = r; } } stack = new_stack; length = new_length; } }; v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/spinning-balls/v.js000066400000000000000000000311511211511573600250510ustar00rootroot00000000000000// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** * This function provides requestAnimationFrame in a cross browser way. * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ */ if ( !window.requestAnimationFrame ) { window.requestAnimationFrame = ( function() { return window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback, element) { window.setTimeout( callback, 1000 / 60 ); }; } )(); } var kNPoints = 8000; var kNModifications = 20; var kNVisiblePoints = 200; var kDecaySpeed = 20; var kPointRadius = 4; var kInitialLifeForce = 100; var livePoints = void 0; var dyingPoints = void 0; var scene = void 0; var renderingStartTime = void 0; var scene = void 0; var pausePlot = void 0; var splayTree = void 0; var numberOfFrames = 0; var sumOfSquaredPauses = 0; var benchmarkStartTime = void 0; var benchmarkTimeLimit = void 0; var autoScale = void 0; var pauseDistribution = []; function Point(x, y, z, payload) { this.x = x; this.y = y; this.z = z; this.next = null; this.prev = null; this.payload = payload; this.lifeForce = kInitialLifeForce; } Point.prototype.color = function () { return "rgba(0, 0, 0, " + (this.lifeForce / kInitialLifeForce) + ")"; }; Point.prototype.decay = function () { this.lifeForce -= kDecaySpeed; return this.lifeForce <= 0; }; function PointsList() { this.head = null; this.count = 0; } PointsList.prototype.add = function (point) { if (this.head !== null) this.head.prev = point; point.next = this.head; this.head = point; this.count++; } PointsList.prototype.remove = function (point) { if (point.next !== null) { point.next.prev = point.prev; } if (point.prev !== null) { point.prev.next = point.next; } else { this.head = point.next; } this.count--; } function GeneratePayloadTree(depth, tag) { if (depth == 0) { return { array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], string : 'String for key ' + tag + ' in leaf node' }; } else { return { left: GeneratePayloadTree(depth - 1, tag), right: GeneratePayloadTree(depth - 1, tag) }; } } // To make the benchmark results predictable, we replace Math.random // with a 100% deterministic alternative. Math.random = (function() { var seed = 49734321; return function() { // Robert Jenkins' 32 bit integer hash function. seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff; seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff; seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff; seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff; seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff; seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff; return (seed & 0xfffffff) / 0x10000000; }; })(); function GenerateKey() { // The benchmark framework guarantees that Math.random is // deterministic; see base.js. return Math.random(); } function CreateNewPoint() { // Insert new node with a unique key. var key; do { key = GenerateKey(); } while (splayTree.find(key) != null); var point = new Point(Math.random() * 40 - 20, Math.random() * 40 - 20, Math.random() * 40 - 20, GeneratePayloadTree(5, "" + key)); livePoints.add(point); splayTree.insert(key, point); return key; } function ModifyPointsSet() { if (livePoints.count < kNPoints) { for (var i = 0; i < kNModifications; i++) { CreateNewPoint(); } } else if (kNModifications === 20) { kNModifications = 80; kDecay = 30; } for (var i = 0; i < kNModifications; i++) { var key = CreateNewPoint(); var greatest = splayTree.findGreatestLessThan(key); if (greatest == null) { var point = splayTree.remove(key).value; } else { var point = splayTree.remove(greatest.key).value; } livePoints.remove(point); point.payload = null; dyingPoints.add(point); } } function PausePlot(width, height, size, scale) { var canvas = document.createElement("canvas"); canvas.width = this.width = width; canvas.height = this.height = height; document.body.appendChild(canvas); this.ctx = canvas.getContext('2d'); if (typeof scale !== "number") { this.autoScale = true; this.maxPause = 0; } else { this.autoScale = false; this.maxPause = scale; } this.size = size; // Initialize cyclic buffer for pauses. this.pauses = new Array(this.size); this.start = this.size; this.idx = 0; } PausePlot.prototype.addPause = function (p) { if (this.idx === this.size) { this.idx = 0; } if (this.idx === this.start) { this.start++; } if (this.start === this.size) { this.start = 0; } this.pauses[this.idx++] = p; }; PausePlot.prototype.iteratePauses = function (f) { if (this.start < this.idx) { for (var i = this.start; i < this.idx; i++) { f.call(this, i - this.start, this.pauses[i]); } } else { for (var i = this.start; i < this.size; i++) { f.call(this, i - this.start, this.pauses[i]); } var offs = this.size - this.start; for (var i = 0; i < this.idx; i++) { f.call(this, i + offs, this.pauses[i]); } } }; PausePlot.prototype.draw = function () { var first = null; if (this.autoScale) { this.iteratePauses(function (i, v) { if (first === null) { first = v; } this.maxPause = Math.max(v, this.maxPause); }); } var dx = this.width / this.size; var dy = this.height / this.maxPause; this.ctx.save(); this.ctx.clearRect(0, 0, this.width, this.height); this.ctx.beginPath(); this.ctx.moveTo(1, dy * this.pauses[this.start]); var p = first; this.iteratePauses(function (i, v) { var delta = v - p; var x = 1 + dx * i; var y = dy * v; this.ctx.lineTo(x, y); if (delta > 2 * (p / 3)) { this.ctx.font = "bold 12px sans-serif"; this.ctx.textBaseline = "bottom"; this.ctx.fillText(v + "ms", x + 2, y); } p = v; }); this.ctx.strokeStyle = "black"; this.ctx.stroke(); this.ctx.restore(); } function Scene(width, height) { var canvas = document.createElement("canvas"); canvas.width = width; canvas.height = height; document.body.appendChild(canvas); this.ctx = canvas.getContext('2d'); this.width = canvas.width; this.height = canvas.height; // Projection configuration. this.x0 = canvas.width / 2; this.y0 = canvas.height / 2; this.z0 = 100; this.f = 1000; // Focal length. // Camera is rotating around y-axis. this.angle = 0; } Scene.prototype.drawPoint = function (x, y, z, color) { // Rotate the camera around y-axis. var rx = x * Math.cos(this.angle) - z * Math.sin(this.angle); var ry = y; var rz = x * Math.sin(this.angle) + z * Math.cos(this.angle); // Perform perspective projection. var px = (this.f * rx) / (rz - this.z0) + this.x0; var py = (this.f * ry) / (rz - this.z0) + this.y0; this.ctx.save(); this.ctx.fillStyle = color this.ctx.beginPath(); this.ctx.arc(px, py, kPointRadius, 0, 2 * Math.PI, true); this.ctx.fill(); this.ctx.restore(); }; Scene.prototype.drawDyingPoints = function () { var point_next = null; for (var point = dyingPoints.head; point !== null; point = point_next) { // Rotate the scene around y-axis. scene.drawPoint(point.x, point.y, point.z, point.color()); point_next = point.next; // Decay the current point and remove it from the list // if it's life-force ran out. if (point.decay()) { dyingPoints.remove(point); } } }; Scene.prototype.draw = function () { this.ctx.save(); this.ctx.clearRect(0, 0, this.width, this.height); this.drawDyingPoints(); this.ctx.restore(); this.angle += Math.PI / 90.0; }; function updateStats(pause) { numberOfFrames++; if (pause > 20) { sumOfSquaredPauses += (pause - 20) * (pause - 20); } pauseDistribution[Math.floor(pause / 10)] |= 0; pauseDistribution[Math.floor(pause / 10)]++; } function renderStats() { var msg = document.createElement("p"); msg.innerHTML = "Score " + Math.round(numberOfFrames * 1000 / sumOfSquaredPauses); var table = document.createElement("table"); table.align = "center"; for (var i = 0; i < pauseDistribution.length; i++) { if (pauseDistribution[i] > 0) { var row = document.createElement("tr"); var time = document.createElement("td"); var count = document.createElement("td"); time.innerHTML = i*10 + "-" + (i+1)*10 + "ms"; count.innerHTML = " => " + pauseDistribution[i]; row.appendChild(time); row.appendChild(count); table.appendChild(row); } } div.appendChild(msg); div.appendChild(table); } function render() { if (typeof renderingStartTime === 'undefined') { renderingStartTime = Date.now(); benchmarkStartTime = renderingStartTime; } ModifyPointsSet(); scene.draw(); var renderingEndTime = Date.now(); var pause = renderingEndTime - renderingStartTime; pausePlot.addPause(pause); renderingStartTime = renderingEndTime; pausePlot.draw(); updateStats(pause); div.innerHTML = livePoints.count + "/" + dyingPoints.count + " " + pause + "(max = " + pausePlot.maxPause + ") ms " + numberOfFrames + " frames"; if (renderingEndTime < benchmarkStartTime + benchmarkTimeLimit) { // Schedule next frame. requestAnimationFrame(render); } else { renderStats(); } } function Form() { function create(tag) { return document.createElement(tag); } function text(value) { return document.createTextNode(value); } this.form = create("form"); this.form.setAttribute("action", "javascript:start()"); var table = create("table"); table.setAttribute("style", "margin-left: auto; margin-right: auto;"); function col(a) { var td = create("td"); td.appendChild(a); return td; } function row(a, b) { var tr = create("tr"); tr.appendChild(col(a)); tr.appendChild(col(b)); return tr; } this.timelimit = create("input"); this.timelimit.setAttribute("value", "60"); table.appendChild(row(text("Time limit in seconds"), this.timelimit)); this.autoscale = create("input"); this.autoscale.setAttribute("type", "checkbox"); this.autoscale.setAttribute("checked", "true"); table.appendChild(row(text("Autoscale pauses plot"), this.autoscale)); var button = create("input"); button.setAttribute("type", "submit"); button.setAttribute("value", "Start"); this.form.appendChild(table); this.form.appendChild(button); document.body.appendChild(this.form); } Form.prototype.remove = function () { document.body.removeChild(this.form); }; function init() { livePoints = new PointsList; dyingPoints = new PointsList; splayTree = new SplayTree(); scene = new Scene(640, 480); div = document.createElement("div"); document.body.appendChild(div); pausePlot = new PausePlot(480, autoScale ? 240 : 500, 160, autoScale ? void 0 : 500); } function start() { benchmarkTimeLimit = form.timelimit.value * 1000; autoScale = form.autoscale.checked; form.remove(); init(); render(); } var form = new Form(); v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/splay.js000066400000000000000000000247721211511573600230270ustar00rootroot00000000000000// Copyright 2009 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // This benchmark is based on a JavaScript log processing module used // by the V8 profiler to generate execution time profiles for runs of // JavaScript applications, and it effectively measures how fast the // JavaScript engine is at allocating nodes and reclaiming the memory // used for old nodes. Because of the way splay trees work, the engine // also has to deal with a lot of changes to the large tree object // graph. var Splay = new BenchmarkSuite('Splay', 81491, [ new Benchmark("Splay", SplayRun, SplaySetup, SplayTearDown) ]); // Configuration. var kSplayTreeSize = 8000; var kSplayTreeModifications = 80; var kSplayTreePayloadDepth = 5; var splayTree = null; function GeneratePayloadTree(depth, tag) { if (depth == 0) { return { array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], string : 'String for key ' + tag + ' in leaf node' }; } else { return { left: GeneratePayloadTree(depth - 1, tag), right: GeneratePayloadTree(depth - 1, tag) }; } } function GenerateKey() { // The benchmark framework guarantees that Math.random is // deterministic; see base.js. return Math.random(); } function InsertNewNode() { // Insert new node with a unique key. var key; do { key = GenerateKey(); } while (splayTree.find(key) != null); var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key)); splayTree.insert(key, payload); return key; } function SplaySetup() { splayTree = new SplayTree(); for (var i = 0; i < kSplayTreeSize; i++) InsertNewNode(); } function SplayTearDown() { // Allow the garbage collector to reclaim the memory // used by the splay tree no matter how we exit the // tear down function. var keys = splayTree.exportKeys(); splayTree = null; // Verify that the splay tree has the right size. var length = keys.length; if (length != kSplayTreeSize) { throw new Error("Splay tree has wrong size"); } // Verify that the splay tree has sorted, unique keys. for (var i = 0; i < length - 1; i++) { if (keys[i] >= keys[i + 1]) { throw new Error("Splay tree not sorted"); } } } function SplayRun() { // Replace a few nodes in the splay tree. for (var i = 0; i < kSplayTreeModifications; i++) { var key = InsertNewNode(); var greatest = splayTree.findGreatestLessThan(key); if (greatest == null) splayTree.remove(key); else splayTree.remove(greatest.key); } } /** * Constructs a Splay tree. A splay tree is a self-balancing binary * search tree with the additional property that recently accessed * elements are quick to access again. It performs basic operations * such as insertion, look-up and removal in O(log(n)) amortized time. * * @constructor */ function SplayTree() { }; /** * Pointer to the root node of the tree. * * @type {SplayTree.Node} * @private */ SplayTree.prototype.root_ = null; /** * @return {boolean} Whether the tree is empty. */ SplayTree.prototype.isEmpty = function() { return !this.root_; }; /** * Inserts a node into the tree with the specified key and value if * the tree does not already contain a node with the specified key. If * the value is inserted, it becomes the root of the tree. * * @param {number} key Key to insert into the tree. * @param {*} value Value to insert into the tree. */ SplayTree.prototype.insert = function(key, value) { if (this.isEmpty()) { this.root_ = new SplayTree.Node(key, value); return; } // Splay on the key to move the last node on the search path for // the key to the root of the tree. this.splay_(key); if (this.root_.key == key) { return; } var node = new SplayTree.Node(key, value); if (key > this.root_.key) { node.left = this.root_; node.right = this.root_.right; this.root_.right = null; } else { node.right = this.root_; node.left = this.root_.left; this.root_.left = null; } this.root_ = node; }; /** * Removes a node with the specified key from the tree if the tree * contains a node with this key. The removed node is returned. If the * key is not found, an exception is thrown. * * @param {number} key Key to find and remove from the tree. * @return {SplayTree.Node} The removed node. */ SplayTree.prototype.remove = function(key) { if (this.isEmpty()) { throw Error('Key not found: ' + key); } this.splay_(key); if (this.root_.key != key) { throw Error('Key not found: ' + key); } var removed = this.root_; if (!this.root_.left) { this.root_ = this.root_.right; } else { var right = this.root_.right; this.root_ = this.root_.left; // Splay to make sure that the new root has an empty right child. this.splay_(key); // Insert the original right child as the right child of the new // root. this.root_.right = right; } return removed; }; /** * Returns the node having the specified key or null if the tree doesn't contain * a node with the specified key. * * @param {number} key Key to find in the tree. * @return {SplayTree.Node} Node having the specified key. */ SplayTree.prototype.find = function(key) { if (this.isEmpty()) { return null; } this.splay_(key); return this.root_.key == key ? this.root_ : null; }; /** * @return {SplayTree.Node} Node having the maximum key value. */ SplayTree.prototype.findMax = function(opt_startNode) { if (this.isEmpty()) { return null; } var current = opt_startNode || this.root_; while (current.right) { current = current.right; } return current; }; /** * @return {SplayTree.Node} Node having the maximum key value that * is less than the specified key value. */ SplayTree.prototype.findGreatestLessThan = function(key) { if (this.isEmpty()) { return null; } // Splay on the key to move the node with the given key or the last // node on the search path to the top of the tree. this.splay_(key); // Now the result is either the root node or the greatest node in // the left subtree. if (this.root_.key < key) { return this.root_; } else if (this.root_.left) { return this.findMax(this.root_.left); } else { return null; } }; /** * @return {Array<*>} An array containing all the keys of tree's nodes. */ SplayTree.prototype.exportKeys = function() { var result = []; if (!this.isEmpty()) { this.root_.traverse_(function(node) { result.push(node.key); }); } return result; }; /** * Perform the splay operation for the given key. Moves the node with * the given key to the top of the tree. If no node has the given * key, the last node on the search path is moved to the top of the * tree. This is the simplified top-down splaying algorithm from: * "Self-adjusting Binary Search Trees" by Sleator and Tarjan * * @param {number} key Key to splay the tree on. * @private */ SplayTree.prototype.splay_ = function(key) { if (this.isEmpty()) { return; } // Create a dummy node. The use of the dummy node is a bit // counter-intuitive: The right child of the dummy node will hold // the L tree of the algorithm. The left child of the dummy node // will hold the R tree of the algorithm. Using a dummy node, left // and right will always be nodes and we avoid special cases. var dummy, left, right; dummy = left = right = new SplayTree.Node(null, null); var current = this.root_; while (true) { if (key < current.key) { if (!current.left) { break; } if (key < current.left.key) { // Rotate right. var tmp = current.left; current.left = tmp.right; tmp.right = current; current = tmp; if (!current.left) { break; } } // Link right. right.left = current; right = current; current = current.left; } else if (key > current.key) { if (!current.right) { break; } if (key > current.right.key) { // Rotate left. var tmp = current.right; current.right = tmp.left; tmp.left = current; current = tmp; if (!current.right) { break; } } // Link left. left.right = current; left = current; current = current.right; } else { break; } } // Assemble. left.right = current.left; right.left = current.right; current.left = dummy.right; current.right = dummy.left; this.root_ = current; }; /** * Constructs a Splay tree node. * * @param {number} key Key. * @param {*} value Value. */ SplayTree.Node = function(key, value) { this.key = key; this.value = value; }; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.left = null; /** * @type {SplayTree.Node} */ SplayTree.Node.prototype.right = null; /** * Performs an ordered traversal of the subtree starting at * this SplayTree.Node. * * @param {function(SplayTree.Node)} f Visitor function. * @private */ SplayTree.Node.prototype.traverse_ = function(f) { var current = this; while (current) { var left = current.left; if (left) left.traverse_(f); f(current); current = current.right; } }; v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/style.css000066400000000000000000000022171211511573600232010ustar00rootroot00000000000000hr { border: 1px solid; border-color: #36C; margin: 1em 0; } h1, h2, h3, h4 { margin: 0; margin-bottom: 0; } h1 { font-size: 154%; height: 1.2em; } li { margin: .3em 0 1em 0; } body { font-family: Helvetica,Arial,sans-serif; color: #000; background-color: #fff; } div.title { background-color: rgb(229, 236, 249); border-top: 1px solid rgb(51, 102, 204); text-align: center; padding-top: 0.2em; padding-bottom: 0.2em; margin-bottom: 20px; } div.subtitle { border-bottom: 1px solid rgb(51, 102, 204); margin-top: 2em; } td.contents { text-align: left; } div.run { margin: 20px; width: 300px; height: 300px; float: right; background-color: rgb(229, 236, 249); background-image: url(v8-logo.png); background-position: center center; background-repeat: no-repeat; border: 1px solid rgb(51, 102, 204); } div.warning { background: #ffffd9; border: 1px solid #d2d26a; display: none; margin: 1em 0 2em; padding: 8px; text-align: center; } #status { text-align: center; margin-top: 50px; font-size: 120%; font-weight: bold; } #results { text-align: left; margin: 30px 0 0 90px; } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/benchmarks/v8-logo.png000066400000000000000000000573451211511573600233440ustar00rootroot00000000000000‰PNG  IHDR÷Ø7vu°bKGDÿÿÿ ½§“ pHYs  šœtIMEØ  %û IDATxÚí½ÙvãÊ®, f&;¹æ>ÿÿçí<Ý]–ÈìxiÊ–lI–Ëâk¬YU¶2Ñæÿþ¿y¡çõ¼ž×?w¹ç-øw¯eYhYjšfõ÷õŸŸ×Ó¸Ÿ×0æ£oÓ4+C~õÓ¸Ÿ×1äœ3圩iÊ9Ó²,dŒ!c ‘üÿóz÷ózðôšˆÄ˜—e¡”Ò**·mû&Z?¯§q?¯¼rΔR¢¦i(ÆHKÎDMC´,S$gµ]GÖZJ)ÉÏ/ËBÖZŠ1QÛ¶äÜóQ?ûy=DÝŒhø¿1DMC½ÈÏ3Q´, ïWQ<7 ÍóTR÷ÔS3Žd­}Þà§q?¯{Gèœ3…hQ¶Ö–È"ÙÆÒ|àÞ<Óô§qÿ„KbŒq¥›¦!c-í÷¯òó>x1j×¶«zƬi¤z¨ãRƒÔüò{Þ§ëú#ÒÞ4‚§<õýðŒâOã~̘RcÖÆTÀ² ¿, ãNÒl]ƒëדì³Cˆôu¤¾‡ak|aÉ™Z×Rä{äœ#kì“·þ4îǼ¼÷d­£ä“¼bmÅÅè­µd¥aÅÐP7ë4uY–UÿŒÓÑF c†£¸GCTúÝâP¬¥®ïÉϳ0éº_ª-ËBÓ4 µwžg™Ð3ƈ“ÿ*gáiÜgÚÈ=g f圩mÛÕa>ö¡œu´Û½ˆáâÁ aÔ-g0ÈK >Ÿ6è{²Ã¼÷ÅÑ¡ßm u]'Ž ÑÜ+iÿ’¡Bìç¢m[97:ó°Cö&- …Xþ¾uíª¤ß3ËùÆ¡Qé‚°²ðàæ”È3ÔYG¦1Ô<- ‘Ô9G9ç‹À1¡~ªÖšNãu*Oð0x/tWÜ+|ž#ÍÓ´Rzù©F § ~?pzbŒÔ¶-ÅÈ:G)Ær?¬¥Ì•g Õ:'ì?<·i:È}ìÚŽ2Ó;&iÇq«ëŸä–ãáÁpC2óLËB¤Ø_`Ž…$"Õ^»®yâzƈÐ2ÓF‚žø=&çLóZ¼:òßãšçùø9c. Äc©©©‘ù:®À E•3MÓŸgJ9Q×õÂÔÓtZ]ºÔy}¯ê{¢£1FÀO¤²Ú™CNJŸ…EiÌåœiö39ë¨ï6ÌnÅØÊNbŒ‚1 m†8œÁ%%YÓ4ÔC @)Qʉæi*i9§ð¿6rkôéUŠ‘RNÔPC ±gmLÖà(…VD áø3T¼¶~0H1/‰>š ‚?#ÕÅÐé÷½žFv·ñˆ¨d*üù¬-¸>—ž3¯[mÚp0ì‚Èo¥KGÊ ÃrÖ­öBÉ€©SWMБqT«š?ϪTjŒ¡i:HkRÑn÷R^'72,£M}–B,ìCÜ“˜3u]/Îï«Ïï?Åc[õõõ/u]/NìÚÙÜÃj@„Á¨Q' i­•a ¤Öš:º°HŽ º†>DZ Šh£®£\ ’Ýë¡ÇŠûÃc媾ï%òÕß¡.-œsôú÷¯K]ׯZbÚq:×®Rˇél=³¨Yrùˆ×4ÌÁËølNÂÛ¯ñ•¾ëÑmÙˆQx ~Wÿ>X†u„¾æ5M“Hee&á=¯mÜî£4›ç4"8}?”>,·!ZeXˆB˲ÈÖ)ö9Xk€>Xúõµ>ø½1ýœsÅùy_-g2òr"çZ$Ù%þyÐCªI׫†S^c ¥˜ƒÀ½tÎQÇÆ]ŠÈ3 ÃgW×–º\XÕ÷x½e8G²#ZV´_82¢2·B‘–ÀT[ÊǶ£U¥DÓ4´{y¹ù³lÛ–2·\µ³¹_ࡌmDiíѵ°Ÿ1† ÷(AðÐd ˜Ô8Ç$Šª=&„àwê‚Ãå°#i7Ê|6ÔxlLl(’«ú–ˆÈϳ|GÑŽ k;2UzŠ{DãçŠ9 @”F›PÓ€CŠd#†i¥qܽےÔmLˆNÆt][×¾iEi¼äVÙ—e–_ˆ%h!j–†3%¯ùžßš–ëÞ1´¾cV©6úŽ-&l¥Ò%Õîg¢ŠÂYÜ‹îyª­·ª¡YЈÅÕA%¢¨Õ¨úm. Ûñ8g^25t42¤‰¸—š\³…TÕ¡7MC3·…Ä ™Lb•ïa”–Û©H瀺ÝûyE82!ËJ2ïÕÒÈnõl÷¯¯bàMÓPßpíš-Æo‹Ü`=„â§1†,×:@±µJ œn1‰?¬ú¡èÚ©¾~}ªZ>è;0XD[HBqäÈUHGÑlÖ2_P^ØÒ_Åb¤ï)¥BFQÝ­ï¾U Ö(ø%Xƒ^ž°*y2Q ;êSÙ€Ô™çi¥Œƒ¬“V¥ø0úÕ×â‘çÚ%?‹ŽÎ²,D¶LÎ~¦nY¨¯úä?ʸ—e¡yžÅ¨½d¯¬û¬#Ôé¶ööøß©ºWÓEë1IDèïžhÒ“dH5:,h7ÿ¹m;á}÷ÃPäæYÒp´ûŒµ´4 y_"s×õCñ¼ÇWXf[SsuÄ«Û\ýºVvAÏmÊŽÉD[‡]ÿît8e8²SkŒ¡¾ësÐ@žœ v µSG¶p*C€CA+ÎÏ3µ]wöy±ÊûR ï)©òäÇ¥å1FaëÕ> ZCÖÞ‡F?L€ïÈzk‡Ž>÷lMSã£E¤€`¢ïQéhË“j2°Âit‰Ø¾´§xŠ #3äJ¯íV‹j1 ÍÔºvóÖ|v™ÉŽ4ÖvӲ̤¸îÃ0Š|sÍù×­I=ê¼:mÝÔ]£tc,‘Ö”"Á€ïl4€ÆNAÊnéÄ9oWFò]}wx#UΊ}¦Qü:ªÕ¥Óô=¢–>MÓÐûÈÖZZ"t½ŒÎ@6Œ0X#îïjãТ %Þjäpë»JŠÊ¥EmèÀHjÙ"Ü'he,tD͇~X—•S¸%;P(¸ û3Ž#ä„«¯„/𼯊Þ÷}!ëäL!øO)§º¯F5‰LÁ¯¢Ì¢†=j/XR¾‰b ”sÿ0ýh€' if¥êt»´HH†+pHðÀu3ÅV±ãÞ&uõ{ܺ¶Ö3ÌQ³5 †RA“eô} !”™db•TÅP#W:¡/|©QéîÁ{ÎNëçܳœRõ¾ê,¬îÒà½Àb»&¸6#˜öÖÝϸ–”Ô¤ âÎ:Ñœo+íèx ¦HÞû“”==W}+ª¤€€~U-íÓPCÔ¬Óã¶m¥vFOXËý ZÁ©Õ‰:e½¥“C:9M‡7䙦iȲÃÚúø¾Y‘o0UV¾_y¦`B¦H——¶h¡){êù$䞈ŽÎ÷3X…æNèUPºLs®ë:š§Iį‰ôl‡é@‡Ãž¬s –|Ù¸©Û ôÞî(c ãH¯¯ Ù_n‡êZýMíu‘rkFQßõ«†Ú!ê,ìt8”ËR¹ˆxš+ ml9jµ‘[e#zZ ‘sw+ åH‹ïeȱ– Ÿo«fPÇž§.ùÌY•3[^«¸Â¡ã¸õ>š?¨}ü.¦Åô\‚^\çåçYJ©yšdlõZc›ziæ‰"z}ý+ÁñfÆ]eÀ0\ÛÒrfê~y9xeR›1ñÐàí._jàú3jíqà!¢…ÑÓeYˆr¦Ì̺žÛ#Z*H·ŠRJö¯eªIé}AJùÔàÊ- ;Æ(QVäx­‰$çÑ;l±º+r¢aWÄ#ÜO0ã®Aì€aÅ‹ž*{ðÞºt½Í)Éó9Õ*E9Q 2è–¬æeègµ%>óãHÍ8Jiö™òã¤:G}×Ó4—ÌÄÏóÙX̧Œ[«SpÂMvgŽBòU¨–|sq ÐC…A½ýÈõ—^)z0“J£ù9—ô²èp÷«TD D,tLßZ×’%NÙ€î5V¯!""•6ö«èüQ‰¥ÕC…Âí)hQˆ¯:)íPd0„½~]”ÐFÃ395¶ª)°˜äâ¶rºpLåz3­¶a¨ÈÜ€ ë,Ì{/#«×@χq¤˜¢dP!œ·Ý}&*臌ÕZ+¤•K†Öõ‡ÌjzI’"غaPßÐF ï ƒ…Q‹N˜Òã’¶ /j.´ub¢ž¡Wñ:×ò?ß—{NðÝkî:ȉ?¢…‰îåZÄ Þ'~­Ï®UdèÁXë9q¶vœµ!â,Å–ž¼š]¿mÙ9G‰ñà B–·Ž œ¼ÆiåÀ]‰s£÷EóÜZ\OÆñ˜F¸PYg{MVH:"·<»¬U4ñ@!X|X åã´z\ü…A ,CRzvb-c V Úßí¯'˜P?ëƒÿ°ƒÞ;fë±cûÖߥ˕΂Je5‰'ç," 5 ¤L4F€®„QĘ[s°N6@4B‰t~Õ¾¾þœè¿ÿù?‚kGn¡#B®‡kÕ[€C[3Q“áã¿SJ²¡cG%œEó¤FhŽºU3ƒlÂj¢ˆ`õLT¹'Viôä˜LéÎÄGŸ ÷)²è äŒÎi®ÑŠ«²”’8–²Ì¯NhžiÀK˜pJDĘeY¨Q™÷\yŒç„à7M“›¾r!0EH„ÅøfuÑ—Œ Öóî#"Z.׺D§š#µ<@5x¼'¯t©õ„¨z˜uz„á „ðáS”qJ´{†?£¼ï½w,k0Ä "Å=—ƒ¨6O“|7ìǺÇ0Š&ê謣ކRoKÕ­9t&ôr½Fø;‡‰ÀXÓøôÓ§i¢þ {ÌÛ®“®ÚÈï9ewé‚Ýso:â×vÓ ‘Þä¡¥z‘6Ý7ÆHŠÙµÇ/Œ‘=½°Ê_T+ŽÀùiÿ«ßß¾²Ve=×(1 y¢¾ëE†èÖ†]§á¶ àr*C«Ûžõó, @Úµ@½«´­ªû‰ö ŸgšçùËlÌ®+\|Ï´\O<ó[ƒhó4ÉMïÚë§tµä°î›¢E£uØ–f9®aµFjäaF«ôº¡®—â5ÔHö±%å{¯KÏ„9p©çÇþ«‰¥{è9Â[‹CÖRY:²vW󴠎РxXEÝ­¥o1S} ¯3\ÈIe¥ÈúY'‰@JD«á¥a7_×ûÂÒ²âåj@SÛ/6ìëM’:Zcã¾6F`Sã‘ZXAQëšÜ{/Ÿ]Ro¸ÇìpC¥ÝÓ* Ýï¸DèY¨‡/½¿ÈJü< -¸u­´{´ÃÔ­¿k£àYIî÷¯+Ü¢˜õ4™vÚ€ë,ê4ñÞ«#³Ø‚ºÏ‡ý~sUð¹¥…¥uç #?eÜ`£i}'ÙµjKÜ+záŸî­CC¬ëJÿµN5èa;YcKÄ;’[Æñ¡"€€H9K9ª«,l¨4»4§ÒÆ)'ik‹ŒÓ;­1X~•YƒFæÎuL‘¬±+Ç¢9øXJ€àa˜áø‘¼ð£^˜ËÆùj0ÒÏ8íÕY¡÷9ûg·¬øÑ;°/L]ëÖE ¶Èn.L©Dig¹¡•ºã°ß³Œíp’’XœC‘Ñ9I$mäT4Ç™¥žÃìgšgÙâàýqUŽNyyÐ{)=ʨn~öСœÀóƒã¯6@É@êXkÉVR?Ͱõ}íºŽÚ¢Ú¶pÙqi9[³åò’©µ¼¸ac|ú,㬭cU˶ûxH]sÎëž,¶OöCã4‡Y{%+†!Ùà¥Ô½L‰ØÝQ¥£”¢ŠúnúÅÑoP­:LÓaSd¢¡…ÕA!iìÞÙz¿Véž_º¨5ª½Æwk€hžgA“ñÞþ\¾R¢;’uIÕ–ØÏ¤çÂñàaO×ÜH±´f–UdúSÞµ¦ ךÓNÍל6Cƒ½h¤–øR û‰í%Z­«{¿z+É#‚0§@¨® Ã(Ix÷݇û¯>J#§õç´Ö jc$Ï î!’ˆ1W|ÝþÂ(,@ŸÏ­¿Øä¾²Q¦O´!ëóœ–D ?‹ú¹Ÿ–ce*RÛ%gjÎ0b8Y]3â0A¤ ~V0dÍQx^o¯¶mi:hVö¥ïÛ%Ñ;ç,LÁû7ÀåÇÆé+–¸f>¨c§i’É,(4¨P;°–ø+mš&¡Nêzý_öðý0¬6—ܪm'BʨSŒ«ú[Öë‘g®8ù×Á±kl]ßå­‰—+Þ9Ï ÷\Ó{Ï6î…'£ÄS,Y˜Sï"™‘¶‘ê×j]*bR‡èÑ>°ËrÎ4ô÷p½¿#zã{&¢ÕdÚµ Ò@ºm‰¬ †®ùûyÉ«…ƒÏtûsÑ{çZ fèWŸã Q‚¤»¸¦Eä¬[Õf[¿ƒÙV (,Š]¦W«¢‡ˆ1PËCz3&Rûs¹¹úçjVOíõÞóŠâcqÁÌ“k¥»zy¼ÔÏœ‚ûy¦ÿýßÿï­°1Ôÿ‚Ìé^Ùî£nbfã£ç¬—LFÕ:=Û¸õ°êÝÔHuÔ^–… ô6 |!8 p½ñÚ™õ¢Àv¶ðؑڃƒ¬¶ØoZÊÙ†Aªé#t=x¯ÕL5Y5O½µ´—¸¸¶ß¿˜”hÜí®fຖGO1Ê/žµöË3Ï‹NbDu·çœa²<ä¡3ñ~äf¡:ý¤þ>¡T:OSiQµ…Ï¬×¶ÔÆ „•¨P)ÇÝN¶ »~{M2g-×PlÅ3}FíÛ³ÎZë àœ£Ä6c¤C‘ß:㹺SéÀ½©ʧˆîø7LÕiªžß῜Vzá¢)-jëì]åu´Ño¥ÈuM®'δü“–;ÒJ/R/1`¦‘zýš5Ps Tq֑ϞˢI}ÍÁ—šì Y?«§‘_ï’‘X¬rÂóg^…ÏÙë\¬Å}TBAkcå-TYœkН [O¥œVê˜ßž™¬‚ôR·ÄSÖ7SGù­õ´õçÖÀXÝs¯ ¹îHÔR¹HÉ€s`w³Öö®1“k\è÷_{õoÖØú*ûÄÙÀ]…§|„™œmܨK½÷¢¸S$›ðÀsÎ+ÖV£êR½òí•i:9´L8Xð*,ø ÿR„xo¹\PŸƒ+¼¼ü„ooªC~ï-+ÿ"Ú-ûày«Í²,t8ì%ƒñj6emÜ—8V÷Q¤Ò‘Eötå´ÒQÖh%«£4¸‹øB9àzkf¾H ›#[íœ&þo¿ þ UŽZ,!W¾Ö{>ÛbŸ7né±-AÒªëzÑÈÛrÎZîû’çùnÇ<«‘CÔ—Qí F I3¿jQÄRO‰àºÅåçYúáõæg„øør½ÐQï\§õ×v’Ú‰?¯Ë.½? 1ŽØ‘©Ì§¢r=qã&MΠf5HR ýv%¦ AH"A H{Í¡ÍK¦ååHû|ΟW·yç± ß,Yð­~m^çf!š¦I´± 6•“èn=gÈ_Œ“|¢`d3/Y¢8öqéýÕz‚ ºãúgõT‘^H‡žvÃZÛOšãy† C>\dž¦¹E;äkÜÛ§aŸÿ|pÎEž¼ ï‹À!/Ü ¢D¿Žî¢\\F}Tci1C£–ÕÑm¡Ž§À°•¤¡F€ÍlËì, ªoxßµž×dž½rÂ*eÆpŽÌÍóë³^¾ýs!"‰Ô‘'"»¾§aW ½#@ó©¨ýٖ懱c™ZCËÒzÜLmi•´B„WÒ‹ø‚dR»¾¿aEîO¼¶îÚcép̘4]tÉ™¢jQ>Ëžë¦Ýšùˆ%“†1ªncÅp^2-ù8Øtj›ìWñÇÆ­ömª>( ¿Ð²Ðç% V"ͲîÚ¶Œ”ÛVT?ða-6Wòˆè³Ö¾Î% }©¿½÷+{ “@5æÒ|JÌ<¹ôjêyšÊêxjš†:çÎvŽšnJD²+Íž ÃùêzýêÆ 0  +´Ö’QÛ5Á‹†®˜ôZíq44)‘{k¬¤%µÏZûõwð¾ˆ;øY–•6 €à$Ÿ«ŒÀÿ‹®õõ o…äϬ8Öµzb§ˆVò{£¶_½·ZUÛ¶äýL -2Ú A…¡dÞtâé$ÓYÃKD% ñIO4ÉâiÔ·¹¬-“CŽÁ©)ÙT¬º—Dˆ¶m˸é<_}@å».d2ØwŽ6¶Ñ~•[ß4 Mó$;ðN•4z&ã«“‘Z—sŽv»%Ô!„ǪðÇNmý!›¦‘Þ·iJ_»ëºO3ož×yѲXó<­4å²RjEÖu)å·í::öä½ÿ´žÛ£5;±|!å²JFý•ö!6æÄxÜfû‘C¼ÖJ¦³,K÷àÚj™úáp(Óa®)Ü~èõõ¯l œM6%|‚/û¼.LÏC(Ôá%“†â Ÿ¢¨ó.y"ÆQÍ¥ÿ¤«MR^`¹%:{­Ï9ƹ†F0kÛnÓpum~Œè¬§ùž´-R´Æj8ôœ[.e9§ã¦ îÔ4O=ì_Zì¡¡†b,ëk`ÄÞÏBa×ÿÜ^ô択ú=…5®aÐÀ…¼/ƒKÃ0ÊY¾6† ”j+È©{ kàŒáËÎýtŠûŠ:©›c´¼°êkãï~r*÷“®¾ïÉ7GsbÍZK)xô;g›ãè¯ð£^š£c‡Ô4 õÃíöϘ›ýQ—Ïž ­ÀŽ®ùYÎ2îS+r´|°SLD$­2="¨ÕFŸÈûEoc E^, 2,hÎãxñ¼v`=¯G½ô’I|Öõ]O¶wg‹c|é30¹6€UÖ[QNóîÆ­§‹Ä ñ‰Êû×Ë Õó’©aÏoØÔùˆàšŸgéwÑŒ#Ísr@6¥÷¦½wYSžë£I/ïíý,g{±{d @ÝAú±'¦¿n.¸Â·VÝÚg¥SHHÃ=éë(þ¼î½Û¶=’XºnÕjÞ,oÿˆà"ºpyyˆgªÁ(cŒ°(_^þHt¾·H`V›LRºönQûCã®EùÏÙµÝɉŠFÔóú‡šmð^ðÇÝi:ˆ»q|ïy»¶¥4—´÷;²1ÝÞ=mXk,í^^¾ˆ)®–EžÒ+87Sº †òÑ͆H´YK)Ѹ{y¶¾¾ñÂXâá°§%,‚ÌBÏ+xO™ÛgHåßks!êã€ÞóÙb‰EÊIØ“ÖXr®•Y…ï4ìišŽ#ÏÌùßr€Ðƒ¿ÅlÅYÜr½z÷½qA½º¦iêÚŽB G=µºýyÝßÀSìDêÇ1Gºíº2Á)6ÚEïµ¹t©uÔ\ï€ ¼ÄÂYG!Qûy”à±TË8Æqwò>b€êÚàÞÙwHê©TM#âÎ9 ËB™……W›ÓÓ¸ =Æ‘bŒt8ìËØ"óûÑ*’ö§»hmí›¦Ùæ¶óжÏç ,²ž†‡jÇyïišG½ÁÜ}Ìwßê³_„–cmÎ/¼Þt‰Òzösì㸌ð¦H4M4îvÒΜç¹ÔÑœšËˆâÆ3wÖ­ÔH®Z³2ß깦á…jÇ£]È*ùXçŠt÷ ãFù6á.9瑎µD=É?Ï‚Ö)È–€ÀWD~Ûõžž4pçÊH®ÒŲkxòË*þùƒ­Œ†«¥åÒB‚‚.-B[ÆTÖ£?ˆ›œ<–]‹C~@MôÊ7<4|iCÌr0:Ûþ.Së06JDrpVóá¼™S“-îA6ø©—Œ'*=ÇÀ!#}à^ìa¿Ð÷?0C;®R±Å\ÁGàÛ9Q{³~›ÆÈRÈ[ É·¸Dz©i¨a¾ú0 ›N`É™ì » îR¯Ô4 }à€h½.€ "çÚ¶4M9P)F ]âtK" Ïyøï!ÿj™Úú¯Œ^`‚c´ÎÑж4Ïs‘1†ÆÝަÃáØ"ã{,Ûeب›¦¡E¥ß[Ë?ól4á¯e©ßïF½/ŽÚÕœ{Vmà{_î’‡€ïgÊ9Ó8îÞ¤Ï+Y]Dz×Òr–L®ÒÙÛ Hñ™ñ³C?þøYè•Ï~^•§[÷C—°·‹Ï2n¨«ð ¦!â(¬Vh1Tz}]×É:䘈x=/œàÁö}_ê+ké°-ªœ–ëhU‘þ(oÙࢠˆDκµx%§{~.²XÀ,Lc(.QZJ]T¤--™"©fU§8èõaçY@ÐSãÀgÄh(>·½@\ð§DmbQ-ùüÑù¼õù=»Ï5±x–Eø Ë-!]Ïĵ4œs”xûEQàì$Ô‡áà8ô²z0«þEãF*]Œ{/iµ1AFôÖ3ôóxAÁCðoÄï[6Úœ’`'p¨øŒ@·SJ”+Çþ[¸(OtëÖªÖä(mÔ±Ç1nV1¨f`ÍVŸyÊ ô—$*”Tü‡; ²ÛSžÖeCÔ*=×ìüã†÷.’·‡"Ãïî>ô]¿yPg]4Ç­$´ ›zN–9rïu¿G«—Òáêû¾8E;Å¿ãµp¨kRËo¹¤]!à[g3÷Ìf.H\EXöÒiƒß§Ð9Qšu]O -²JH¿Æ{ýëa¤w …zõÞóÄ—^XC ¼dºê’ǵ-um÷!¢,)·u‚ÔkEk{ëç1t8ì %²¤u3O“L†ÕÙAägYK)áýóÈBºýÕºöäÖ·5î7¦iV›E¶Ú!¨•­±²0ÐYGs:¢º‰ 15póæƒ*9ÞeY$ð~¦”“€JxØ0^¹ê?+‡©A³ÝËËÙÒ™§£0‰ô‘à=V9Íó$“JXVgž‹ºmjÞ[²è/Ï]´qŸrì÷ÑVÎùl/൮ô§µ!·Ž—ü©$}%ðÀ‡ û½!ó3ûù"žfM9î—#­œ¹†}4°l¿-è7Z¬p…®£ÝËúóç?zùóçì Yc(ÀûÏAãxÔW8ÉÖý“Sµè®ýräFc­èÓÕÆ{öÐi9jìFé“k0hQä¨MZçˆçÜ4†³PæÈ}n½†m àðê(…m¡¢ÄB(û´xW¹vLÒ;6F–ô]ú™ñûXöq-uõÞïê¶¢©èÁøoq[ÝŒß~A\6®°ÚJýµMÜ›YyYZÎÿÓ©8Pݤ¢‡çþ+¼È.0Fi‘‰¸Ý¼ê·ž“AøàÅ#¦”„–™ˆ¾-=OŒ.ç”äÁ×÷d”¾ëEêöÓÏ9:öÔ6­Úìò¾°aÓ4"©”bzƒpCç;å‚‘€äò4lzk†fÛ¶'yäßµ6ëòÈ?çL†AŸÀ„5Ñ¿N¹lm”Á¹¶-zÎJUr?%Új--«©2€>–õ{5ˆ5ùÓe¢¬sŽú~¸õ²´¬†’òO“€pé1Cðrδ¨MÀHʨav>{m° `ãÙ¾{^¿áL^¹·<8”2#­Û<}×S^T\õùˆ ™¥iš2òÇŽá½°B±=£Y¨ïj¨L•t7ùûì!Ã÷çéÈÌÂFHþÎÈl^^þHærMCéûž2g.–Žë€Þë@ˆÈïC+ÓšR3Ê.uvÔ§¸ã¿Ñà¡H³ä\v×s—¢m»“ g¡[ß8æK¹+¤päÀªOËå]Ÿ§IFݰ‰¡íX‰“÷7}T'"­ÌK–¾®8bd¾â5ßâ{ïÉÏsÑûf¤Zø\ »¶¥q÷Bÿó?ÿGˆ ·0¡ž4:Õ¦„CŽ)®æ^¢ÄÑŠ8Ï«ÊÒR"Ï;ÏñÌÛSÄ•©û&½·‹Œ[YtGc1ˆr¦^AäÁ$ë:™êûaU³‘êG.í˜ÆgÅ!§Ü—^:xí×FH½÷ôúú·ì¦æ,Ÿù÷ fîv/40óèmTß¹~Nõs$"Á-tý¸TÔÕš`£A¢ßˆ#3Õ÷ø=§ýŽ»Ô¸[×¾I£—e¡¶m ’…p!}ÊžÀ ‡ƒ 1Ð9É4Xo"´d©ßKû¦½êÞh¤VÁû£Aã»ÑšÃ]jڞ܉mŽ7óÒ•ŠM=£½‰¡¨9Š‘<“bLcVQû™’¿·åî¾ÏκÍ!ィoܘÅ%l?Å©ç/iSØW<ùe#2oöüˆàŒtpjÒŒRD*jŒ¡ü±à\£Æ|4Ößê– ~Y€}ÝÆùêç"#—ŒØ¿§òqj‘@N‰Ü0J´µµ3ûm:>^Ͳ»¶Ý\‘àïœ[¿¸Ø¢Lj¾ø"ÀrgÖtnÛ–¬±)%|X|þ£~`f§é–ò5bŠEŒ=ë9»Í6#×VXWª,Roô–iY¨‰ÔßÕ_·•c±åëO@¡Jq¥Qc£¸[é7£ç2¥h 5,æxŠ[ðÝ| ó™/‡té±PÙÓëm†Ú¤X€mÏmãçtÚ~ŽƒÁA†±(§ªa†ØZ[ß ›-æy5¨l4Ê®Ö9zyù#Ü÷ïºPãkG àìMtf­¯­zÏUÛn9†ßÜ[•=ÎÉ c}OôÚ£ï¼W泇 ‘B«u¸¶•ú·–tçéØ S=iˆ í 1|ˆt£¶Åz¢¤êk¨€¸ Ò!A¿½§<Íó$(¸®¯Œ»—B}ùó©Ôÿ€”æHÍ7Ï4ñ\¶N!ÛcÖÑØª-#5Ptª¿vd|ôÈ­¥Å¢’~Ö¥œ&m}×uq¸iÛV4¦‰Öû¿Œ1Ôuý ÌÂÜ;Õ/!mW=a- ð^„m¨wÛvåýè8ÐÀï£^7^ ¬,üî·¤áMC»Ý‹(¡\r¼jj9*¨uxïÏfè½û~9SB–±,Ôw]¡À²9d¯Vƒ ŠëlY>03@z§ô“ [ŸÁ]*¾øÖøì1nÝGÕ"ìPû^øP`"-–”(3mÏZK ‡ÿ© R½8¢žJ‰Ðq»M÷žOÖN)±\Ó±× Ô]y×÷ÔuýÙ@^;x/ulʉLÃBõKyíépmÞÏ”R/Ä’­̲8Fˆ8`Þ’»@ÕÉ’´Í„gÔ\…5Ú~‹M”uºÿ¨)?œô4dž¨( ÕÃ6 ƒ¬ßý]>å^Z¸l]l[¡Ö-"6‹Š‹2°Ü†a\a÷Hɵøå£^`"bð j6uÙre·5neÔEÔ C`åRÜRÒLš°‚ÈÖPá<×+¨»·"ö0éVZ}ø€Ô뛟Oz:$=•C¥Jjú,#à[ÑJ;, 0êñWíÑe룵”)‹ƒÄhlñø‹,|(½ÿW²ÆÒ¸ÛmXZ_ÎZ+ Q1fࢨ¦(ièùµ§îp¯]ô[Qó’©1…Ó0OS) M'ÒÞà|<‚£útZ®S žaj à 2>È"akcΙše¡®ïi¿•úuðÖ«QHH'k‰åº~ OTXYš²JtÜBÚv]ùlÖ¾[¯¬jªÝÃ~OyÉå@´Ÿÿ5¬>Ìκ•È¿³®´ScŒ´Øåý©çbX %€Åà½Ü[tLc(7Y9–,ÃÖûÀ™]Û°u÷å‘/8gZH¨Ó¸ß)¥•Æû£8ªÏ·’9Ö*¤ˆ\¨¹u„]Mo-E·¹gPMÜW°ªhYr¦LœA2Ù©¹c¶_"uÕR·Ò,œÑ’©m»³ö^‰†›ÒŸžçY>[ZŽ=d¤Öœ‘žª… ¡ªb£¥™__ÿñD×)cÐ÷°ë:Z8‚Ô›?!\©d®ÔaNm˸vûS„P*õà üâ¨ýh¸Á—]LmÀ8`å=u RŒ4ó²:ý€qàÑ‹]Õ3œö` »ã6Z^JöÕ®i©Ë­&¤»ø_ÑøȨºú£ýM‹«ÈŠÉ%éosìïãNæ¡¡ëÝv/ŽoWH+œ–ûA zÉ™|ðb‘ƒöÕ}9•UiÕÉ&hYÉ=ž ³ÌCØê_ëàœú)ütY·Ë÷Qe`ã)c–÷‡7?¹æ®½-&æ±µaj‚‹@*5nâž´DQk¥^×ÝÞûc´[òjIJAûýëJ¯mႱBßA´~ô%¢ù2¢Õ;«è™ÊÔ²¾x’l!„@Äí(çJ¦§ƒ4ºQc„]׋ºkVm´yž7VÃyïó‹$±æG;'•[÷âÔ^öÏÊ£Õ¦¤pÌüý­sDÁ¯?Űᵪ¬Ö¨·{>ÒõéÈ­jC,{·ÎɡִT-Úoh#ƒTZí€nš†¦é°ÒÈnXqµfVÁy ƒ¨¸QÆßvuMÿi``Þ§ïúÕgö¼¢‚ƒyÉ4 #·©z‰¸V9<Ç *ÆeRdMÓÐ0Œo¢,¶¹PÓÐPI—Eá$¯¾vÆzŽ;ó.ô-ŒáZµq½Ôâ'¤ä¦RÒìÌEIœq šÏz´:=×Ĉ1l‰ð5ŠxBJ|AO!ié%?ϲYD§ù3÷¨ñÔé•RgÛueío?#ì+h¦Þž‚ˆÜ°ÚkL%UÇ ÃPêk%€¨7“j’оŸÀ ·±ˆˆ†a\iØA,`Á÷gsÊ5w_Ó&ëu½uÔ¾lT›òÑ™×VùS,XÅ.¦ürÍ-û£R\{»ÆP¢´Š6e,´Ì;Ëzšœ)*ÔTˆ( uºoJ™s¦ýþu% ¤#ôÍÛ+©aÔ‡KdÍŽ=‚W¨ó‰(z;…ìSk‹Ö¿¼(»®ÁµHƦ«t|åTNDæ7eÖ5îßõœjo‰X®¸ä)QÓvù}>}Ú»¾/ + 1Þ<d“%gJèes}gMÑ!OÌðAj+)“+œsRw“Nû!«d†Z×JKåµ.œ@Ÿš3“®í¤6üúþfÓU%Š+Ébõ naƒ] ≺6«>»¦Qâ~Ð`É™ÜP`½æ‘I+ºDÙ’*ÆH-²È~vÿŽqkŽy=ض­EÞ¨¦²1t}/Ñת)¯„v×™Qí”I%¦ø†¦ª—Ñ‘<˜kzÔZfqýýE‡Œ[Zçb½#;3ñ7Œ£L¦EWrTÓ<Óvõ9ßsfµj,±B¸Q5¥ô®ºçg°šz³è£hÀ3Nez…¥v(zTGe®êíTß´&(Ô‘œˆ¨¹™Pß$…Úb,XCo’Vr] "‹uŽº¾¿Y\Pz ÀCI0O™ ?VNÊ9áÌÓD³Ú䉚œˆ„c Ãá Žç½õ5@yAãÕÏ´Ô)¿æ}Ô(ó£FmˆCn-d¼Ä‰2úˆ×§#w­È¡#´VA1ê…èÖ÷= ãH~ž‹A0¹D÷¾3«ˆîv/”b¤Þ Œ_mÅŠ"«˜q·òêú;›Æðþ¾4ZIDAT™bð}tDàÛ¥è„ù6‰È…ìr¬½þ9%šS¢q·-ù­yìÚ£Ûá¡èTÙp̙£ÖÜ(O9ŸRZ”öxªLóéȽµÊ'P8Õ黀\Ü#ÖÚgãnWxÝÖJQïᜣq·#c Céÿº¶•ôûÖ†ë¸Ç1NÔªú^4zå ÷·c´Ý(EU(Ùj+¢<¨w¤oÄ4V—K¥ëôýZ‘û½øQ"wdÇxê dõùÁHü§ÒrçœP$ÑŠBÄE=¥{Üúð#Ò€.ŠHb ÒNl¿\8u×õ.ÒJ§(·VA:’k“2â Ÿ‘$/"è“0,©ûD>xš±ª‰¶UK·h¤@°·PìtÅúXoßxDãƳ¤iã>> ÿdͭɋҳÖJ]Ú(”FiQϼW,©:í$9‡½1¨u¶•ˆìœÚè’³Ôa×þéÈ º¥æX»¢ñiEOÑ¢Œë–µµ€ÁgéûžB4M‰ÎDé©4Þ£v­ †Ü÷Ê„‚ø-F©ëþ¨6±hÐYHí˜ê¶Ø5ó-L໣ö{ÙN`í9á0›ÔöÚ P#*¤´f‡½x=m”ú¡6TD ÁæÂÐd--~Y/2à´"ÄpÕˆ-RÀ)­Æ8Š-<ã ÖR^çÚ²Š‡ŽsÝÁûÕ·k?l¡‰R!·`×”?–œ)ÇHs3ËõZäPË(åJ-gë°KàŠË;¬çi¢Ì[páùÛ*¦©ŒtưΆ¸ßm@+í&‘û 0R­€»^õS\QSzcêÈ4åg0B©¹åˆZ×0œ¤bxeÍîBY‘§,Ä”à=u}á¥ÿU2;h…ä*³¸jýÄ-2(cˆxú-çL g=9%"üLÕÖªn•²7M³ŒÀý‘greG…rbž&iw>DЕӬ`ðX:0qç´f×¶Ûû2Z®‡ ´˜}ê”Lö‰1ÓÌÙÒ+tÖ í”W×=eïg©Ó? Ê‹©èbaKÈ)|°µD“V Õ‹%Êa%oZ¹Eº©çŠ­µ"ÕT&ÖôwZ–E¸êúïO‘0ðoax(q ¹|7¸¦“À¢C`‚`eˆaµn·{yhÃþ: ¦Ç-ÕûGi0h£XØõ=Yce¨Äp}Ùp=èTô(eÓ þ pR¢k+4R,R‚ «—b¹!H*1„²¶ØºUº«÷GÝ,ÍrnŰΠ¿\´@ ¢¸oàÿ× ¶«”]EWZÞÎÂ_3 ¶Ü ùnB ôê¡ëg­•EÓá@¯¯¥üÁ0ÐO†ú’q—ɦvÐè¥\õ‘“›3õ]_Òñe¡…Žº\˜SîûþM -ÑXcÑ‚÷”INzina -'™ˆâ£kŽWФ£¨S[½FwËX®uõ}/¥„þ…Õ8l½•uE9Uÿ­‡]NM·pTÚaß;z ?? Á“s-õÃ@ã®ÈbÍó\6¹úY‚Î…{à:ûz5wÕÇF]2rÄ•¿¯dŒ»¾/iO,žò•þ=ºJÓ2#ÒØÕ…h ²2åd/ºá­Þ:OYãè°]¥¦9%zýû¿¢ŠÚv]ùœ •†»uîÃ]g_Mi‡a…´,Ô¶¥tû¥yV•f5f[+ÖžRu¹U„½um{÷Õ;0jH>÷ý )ö<Ïe›+8ªå©H??z:~•È­õĤÀ=ÓE&<¸Žç™1ËŒEõ)%©¿5ظ^Õ#„Ôìëë_87zqmK#+žÄ„G<¡U¿/Œg'¶.Z$z;µùC£ÿµpˆAÐe¬ß­Ó’]Š—:É‹£¤7í»ž¦yZ9S|ŸaVÔØ­Õ½µó‹¼íó–ý[•‚Zw{Ëh­îwß÷ä½§ýþU2ŸÖµRwÿ䥇_6n­p ÃŽ1”Z–#9˜NšÅ¦çe=§Xƒ“ÖðvŽ’Œš¦°,!I³b ×׿+yâSaQ¤­42Œ#{ö (éRI!Çd\Dàd¾r‘6ŸKΑÝ_<1Öv]i3B¾Ù2làÓ47¿äõVJ ÄÕ-¡{ÔÁAð\oÑz‘Cf6ê½lÓ4Ñá°_É\CØã§o3ý22 AE“eYȶŽ\NÇi/Ì}³!aI=ÒoØ”F¦»®“}Zó<­@Ó4äÈI]Ø2òT/ÅHÃ8¾‰†šª¹Ð²ÌÀ°¦Ø¶V#eM)QëZÙ¨’—L¶9Ê/}œœ™»ŽLâ£×!L‡CqX¡¸Äcy„vå²Ð²qNq¼…Ht'D;ÕA&º–ð†“@æÑ“ƒÀ,|(À¤uŽÆq÷¢ ßjÜÎ9òX¯#ýÞõfCº¶{#]ƒ¨"h³"l ? Ébü tM¤1œJaFÛ3á„ÎÊ‹Óa¼Ú“£Gì4R5Ú f6“ì&G€ø;Ãx@´µ–èÜ4ÝZ+%¢7ÒlH"¯ØUbRÎB~/T£²×ŠØ²ˆ‘•KQWãÜ¥%"ѯÿIõôÍ5I—©ÙL3!—„TüÔ¢DK<`=HҨé·s4«S³Ú‘…ˆuY\Ga™â¢æ²%jÔ®ídôï§Û7À´¬³¥~NXGíäNe [Wà÷rêsjÀ ÏBsöu5 ã£Â³»gZªÕw¾BN=ù®ïiGÙ@óú÷oÙìÊÑz÷ò‡þûïj™À÷&² -×5r/FhIMËèå<ÏÔõ,‹è¯['h¥À`§ÃA.=+b”,$,u[r.Úãº-uhÓ”è¼AëmØ}ݨI¸sjÁàýúsqf°œÙ_®×/µ¼É¤^/NUϜӺõ(eÇ;ûÑo ®5_TF-›[½à"S[­÷ûW¡‹*îÍnj܈"ý£j9‰àËr$®œØ )3Ù{æóêØ÷Ãj u8Zl²ÿš(–bù6pB¯M·Å¶² ¡¶ëadHù‰6¦€3Œ6¿wH5-tÅàšï\òH q/¶¶›jÃ9ÅLÃÏQs—Ì{{ïÉû2ÇG¥±ö{šçIÞ£”aÝ?mØW1îSgÝjA ˆÑŸñà¢}€êHIaƒLj‰(K8Ú 'ZNç g]‹>Ô‡ªþüš;_À½þ¯h¨*KÑhô{÷ÍsÔÖ­³‰õ×Ú3Fõi‘â‹qTl´¦ZyS÷±ñY¾ki@Û¤:„ð!W`QÔXMˆ†A:‡ýž‡ýj࣡F"ö¿~]¥æ†Çשž®G-ËæáYOE%ˆêö_¬/B™_ š9ÕÕ¢¹®+²ÃF!¦úPÇÑ Ý¸Û½ÙÆŽT[QÞ3pDikmè@¥U‘õÜ~9ÚxCÔ5´Î¢´>˜z¦6©¢­ÞûBÆô^í{“Ô€OÏ -"ù~ÿZÒpÕŒµ´Û½ˆÆÜo¸®bܦŠ:rè¿ËK>9â§G%³Þ£¥Eû›#0‡H à u;4ÐSNe·Š–)ÃO Q†sÚr:Î9©Ë_^þ¬´Ý`È‚â#3ÙØ²u߬µ² ]Ív»=®v§Ñ‹ë.Å›^9×ï¸PÞ¼§šx¨"0êEÓˆ<k9k»ì;׬¹kf˜¬ ⯹Ìïµw4"­IZ×\„Œzª€IŠjúc~õ9½Å*Ä}+*6LÌ)¬¥qý=Æ •Ec=Üÿ^ŠÎ½íÝËK‘Dþ„溞™M4|?U_'µÃ-¥´ª­ÁáïºïÛ !œ÷ì «ŸgÉÀPw#‹’ñ]œSžÙ¿Ô¿¾«q‘Û )æEyC?Èá;ÕâÑcˆVËøÒq¸ß+é9$œB\·à™ ?xžý®ÿ]ÿì÷fD½6ÔÛÓá@]×Ñ8îÞè°×Æc¤épø°v•Ÿ«ëºOÒü¥@Ôª6ËÆn°­yû^qå!s‚¬C†:&ƒ÷4û™¼V*‹öxGãn÷+ ûjÆ­J 'HÛE­¬1Íy;ŒÑ³Õ‘Pω‹¼/_ó´Ð+yÚŽž:º¡~«Åô.iÓ«†q\ ä”È4f¥·QÇtF¿[§àŸ¢¨ûþ+i%5ˆ£·k»Uß^䥾Ѹ5[0±Ø#TgsÇÖ&—W!”½í˜c@¾Û½Ð¸ÁP|÷'Òò¾ï¹ ÑbèQŸûš hX…Cþýõ®-¬¬™ëk´¿„bºL Ü;'½ËŒ)‚bÖ•½_³d0"DoiÉ/{Κ-™÷¬WAª€Þ¶Â ¼­¿SìO/´ˆØoÎØKÓ4…ÄF n?„4ÆqGÿý÷?BJùí×UŸ¢^ÿ£Á1Ô¦ñþ0Íg~µn‹a¯ŸgYÂxLS·¾¬µò³Dć!¬2 …³NÖó€ÑVZ2³^ÁÛ1eQ æÕ=dâ-¥Ÿýty² ;WIiä¼´œŽÀ"²’ïŽt)%š¦Ã*kÃ3C‰ƒ¬œ¢ÁXóÀÛL~´q×kh£jWéZðÜHo ×k~ÁXš¡ª«0†º;ñ Þ׳ ¢ÈÏ•ÜV!%ßBYÑÓœmªúÈÄd›sé¤×HkkV½yµF•:¢ßû:êãyéLÓa%$±Ò¸[xã!eúøcR~¤qƒÖiK1R^"ëÌ’5çzV©FMc¤O‰Ô}â:ýÖH»>ÀmÛ õ¹^6ˆ¤œÞeŒ1ôçÏÂc—•¸ÚÈ9Êû›k…`ª‰*šWŽg¡EbŒ‚.ßÛ¨5\ÔmÙ™ã(+Œ±¾É/}ܽПÿþ£qÿInø—Ëå«×|zz ÑÁZ²ÉŠ´Ñ%$½&X4¯çéM© æÐ_Çñ-8CÅXçy¦žÇ -G™üâìB³ß çöÞ¡qÌ^;(Œ°ÂÔÆ0ÒnÉŒ’ªÎ6ÆPâ\×äš5{“;BGòg91dø¹ö{Ù+GD+aÈ®í~- þ-ÆMTVî@1´Ìy/R{“¿\±T·Ètv€è³ÐQÛ|Q`Œ6¾œ-y‘,µº>01äÃqÌ%Q `ÿúWÞŸO§Áó<­ÜbwxëÚ•ˆ?phDÜ«Þ<ì[8Rp óè2Í1mT«´ZcE„‚8“/üyÝѸëÔÞšßüÙŒ@¯øYñ»ãñ€¤üvØ©{c¤£ ÿú Ž Ÿ/Þh‚s5 g€>œžÓ>LšýL㸻¢‹¬@ƒfh;j½mpôì¼^xk”H05tƒ+òŠ)€{ÖgñÛ¶{¦ßßUsË‹6kÛ8­s4±æø¥µü* î{!œXS"9ZgIÍGã½rkZlÍPËÌÎú,¨T¨²íÔâö“Þ”‚±Îœ3öû‹õÖ¶®È2EFq `ع2ált¹s¯ú„Éê¸ÎGv5O“Ôÿè>„Xº\x÷7ÖÜ– YÏ<ëõ™®óI;еÌÀŠ Œ-ËBãn÷†%«v³Ê4 Þʯ‰ šŸ¹†a bÕQq Rd Ç×öå¿}³j±]±‰H$•u†„n~Nl´VÛuÔEkà-Zý¥p¼8¿˜â±´bCâ•IÃð» )Qs󕵞yÖò»—êTë”Þ;¥Dã8J¿SG®úµ­s’ÂÕ5y¤2Œ¼Q·_âÜÚ®“í¥ø¾C?¬€aÕ±òkd™§šëýžQËòÕö’ð’WB zÞ’*áÇ[DDmÔy)Y–Sƒã‚D5¾—uŽú®/ÜÞÇõŒÖ`Üh]%?‹D¬÷^&r@î7Þ^\sÖŠXíÓ²‹–ö=õ»Ú8pའEÏË9G»Ý‹èwÍ~–l¢þ<" ÍË9gêú~5úŠ.N«ƒ÷ÇåDÔÐqjÊiåœÐ6’}ÞFé—«™økFíÀßE«ÔöÝ 3ðó4¦¡RŒŒœ·ÌÝïY™çiÔdÜš· P ѴýIJæ YU{±ZE …ó˜¦cj,ÑÛØ‚ˆë•?J‚(ç|‹î=Çç3Ö–}Þ0>–n»Nà5m1¶yž$ÍμßËY'N¢ “6Æ \—ZÂ:'NÏ#í>k®ÕR‚Aë]eèUÃèE£œ%„‡½`]ßS×õ‚Ø? ûÁŒIžyÀH{Áù–ˆ”Ò§Ò_Áj6–N×GKDe´§N™Q>è´TV¸rІãy«©L²…@‹[Dð1/Yˆ5!†Â c°0¥D*7P£–-)±ü™Ž$Do"9 …hú&桯qa%²¬!rN^­¯i:ÈwôÁ“þx¯£?þ»Ë–“§q_\뇡¨Omì„ð1MòÁ“kÛOE ìËF´lÛŽ¦é ‡¼ë:üÃ&‘š"ªçÌû~ä\·°¾zÐ7Ë- ‘u%¢+LÂ4FjRép×âøÌ–ÁäjW™hÙ)`"ýEá}MÙÕÓt­’Fy¢3LìÁ°ÇÝËʹ>¯7î¶mËR5ìÔXM‰}e\-”#ò~^má4ÆP£D#­'ÓµTè˜!H¤¼–£ÓßÛóŸóRÔO­÷a7<¶˜R*z`ü™ ù„(yfk,kŽä–k¶ÆŠ±ƒÍ'¨¹â%RC0CÖó ÃQ3œh¥âS¤%.²ûÚXK}ׯX…Ïë7ÒDì=†‡Ž1Êî°Ï¦ÿ]߯öLYkéÏŸÿh¿•ùrDë…FPÔ"†@°Çq¤Ô¶’ú^;’he×®ë¥NFTN1’S¸À¢Ô@›¦¡Æ ©…±ÕØlˆšã^¶F9+Lɉ&:(f(˜ÆÒES.òY²|Bk¤Óñó€i|¤umÑ~{^?Ô¸‘#é³+Qiöó—Rs*à"$j·:GÊèƒ'Sg¢–=ðjžö†RCx],x/sëAjSMD6^c„nÛuE 0„@;µyšŽK y{°‰ÚÑÊyi}‹[à©“ÒŽÇë:Ïe„HH§£Ä“µ–œu¢y÷¼~ qÇ‹ @Îäƒï{O õìôŸA%ï½DÄTGu_[ÿLQ¶›¸; Q@Î{#û´=sð­©ÖóÒ² .¢övÖÑBkô”ÒÊy L‰çµÖ)ƒp² ¼OVh½÷sé` †‡B°Åå7 þ“Æ õRíÁñ÷[ÛH>ÏíÓ¢GL•Q#½Ô;«@ç¼Ç$(²™ûÁjÏÓ´Z¥¼§€z™‘æœ3QÎÔ÷ƒüþC =ný>[ÒkdXŽÃÔ‚Hó1øQF}Q{Ä_¬±2R{­NÄóúæ´\ Çë¿ïÚ® Q0Uó³-DsHÚc:jðÁìº^úÌñO)ÝM²GSDklAvn«½j½¥DÍVV„Ô9Cðôaè é©.ÉnX¬âpØ Á¯É-Vó>¯o4n=´¦ÖÞ ß;OÓ—ŒûÜšzçÄí2eõ2q]sð [×RT@àw\Ú`눧 [ëŠk£z/׊41‘Ei&q™¥¥Æ 2 IáSõÏë1î¶mÑF{ Ú0{S!…¯¤çgBjw–þ} èD…I"Èì‹n×îåå!à{§þ·J qH´¦£À"$…µ„l„“sYÕ3ŽÏ(ýŒ›ˆ$›çiEïl™dS¤ýþõÍrƒk_ZЩֳ¨‰Å}}ý+ª­ó<ËúŸŸz-¨#/h±PEih­‚£ Ù àÁ±qÜѸÛ=­êQÿ=Þ¤ï{ég®¨‘¬C †Ö5f›Ï‰Ú¦šR#µ{  OÛ¶ÂuÒó>¯ïíÿÒ=¨êðÕò¾7ZAï4úžà½t;Ц{ö/Ü8$­kŸ5c õWk]?¬U@Á°òÁ].%ß3Œcæð³ŠþÓÝPôkGízÚ ÷Á´ÖÄ!3ã,_R°ÿ¬•\Ïë·&døyÒ‰Þ v8ì¥&¿…sqm[Äì72Qè3j¤Ÿ0ò{©—\;bãþÏ<à”£¯2¢ÉÝ ü,)5&adÏõÓ°½q y…ç›oeíê8îdÔûùê‡=ÛBYVƬ -Í"ŽÏç}Y@:'ÀŸDÄ€p6Ȇ-{¬VáÖwÏ9ÓbŠs‡qµðáyýòšÆÓ÷½¬á‰jЍ¬#Žûµ7ò]ã`÷•­ ‘s­ÐAë«ååZÊ(ÅXÓý€(žR¢Ã~/,1œ´GñAlxÑÆ¤SãïÚîiØÏÈý¾‘Cµ4(X×u2b å°\­ýúá°—¨‹¨¾ï{5´1¦Pgç†&ƒpÖQJñáµ³±m sJ”¹^†–Ðoc”™lˆZ`Õ’Ö={^Oã> ¬µ0Á°ä „±E¨©@ñò«\$u±p^íoÏx|ƘŽÒ¼1Š<Äñ¨ šŸgᤧ¥ÍçTR€Â¹ŒË†°º/]×_å<¯_¹»®"BºÖñ& ÔyX;îvŸ>\‰%sñÞ«ÕÆPÃç(¶{BQ¤aÁ|öG2öÈeöÓaËÀ*¡²ûúp”Èb¹£[óž×?fÜ©†q¤ýþ•|( MëZw¥Wê½'ïgŠ1Ê~±ÏôP­±°`Q-œÏn´KérÎábŒ2jŒ…—¤ÄÏ¡gve{x^Oã>ïyŸ2Ü-¯¯4îvŠD1•k ÔÆxÑÖ6"¬”®]‘Q.é¯[kE› ÙGëœôÑ¿«.…¬QJIXÚ¶{3˜YddFØPñYW?ûËWËÑÄSÖÜÆ@–—å! ¾¾þ¥eYèpØÓËËŸ³##œFÊIyŒ;b¦X£òõDÕG€´˜"MÓ¡|vc‰†á[{¿)%¡ùgW”YY¦CѰ[0"Êí¯g þ4î›yu&ʼ§"çA i¬¥œÒ›4S“2Ð׆d®uŽ:uÀÑÎI1R^2µös㈫µì÷¯"ÄXTgvR‡ßÏpÎQŠŽ sj)©ÃaO~žÉXKSFŸ‘úiÜ7=”Xµëƒ—¿÷¬nºL%âì÷¯"éb ˶G´p ÊycZ–"9Äž(pV‡ù+r?mÛÒËË©]‰ŽRC¹»ïšY½²Gk§Ctaš¼§qÜIkëy=û.ÑÛCÓápÔÖŽ‘BðÔ÷OmùiäpØÓ svn co http://src.chromium.org/svn/trunk/deps/third_party/cygwin@66844 third_party/cygwin To run GYP Python is required and it is recommended to use the same version as is used by the Chromium project. This can also be checked out from the Chromium repository. From the root of the V8 project do the following: > svn co http://src.chromium.org/svn/trunk/tools/third_party/python_26@89111 third_party/python_26 Now generate Visual Studio solution and project files for the ia32 architecture: > third_party\python_26\python build/gyp_v8 Now open build\All.sln in Visual Studio. v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/build/all.gyp000066400000000000000000000006531211511573600216040ustar00rootroot00000000000000# Copyright 2011 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'All', 'type': 'none', 'dependencies': [ '../preparser/preparser.gyp:*', '../samples/samples.gyp:*', '../src/d8.gyp:d8', '../test/cctest/cctest.gyp:*', ], } ] } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/build/android.gypi000066400000000000000000000213611211511573600226240ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Definitions for building standalone V8 binaries to run on Android. # This is mostly excerpted from: # http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi { 'variables': { # Location of Android NDK. 'variables': { 'android_ndk_root%': '&1 | grep -q "^Target: mips" && echo "yes" || echo "no")', }, 'conditions': [ ['mipscompiler=="yes"', { 'target_conditions': [ ['_toolset=="target"', { 'cflags': ['-EL'], 'ldflags': ['-EL'], 'conditions': [ [ 'v8_use_mips_abi_hardfloat=="true"', { 'cflags': ['-mhard-float'], 'ldflags': ['-mhard-float'], }, { 'cflags': ['-msoft-float'], 'ldflags': ['-msoft-float'], }], ['mips_arch_variant=="mips32r2"', { 'cflags': ['-mips32r2', '-Wa,-mips32r2'], }], ['mips_arch_variant=="loongson"', { 'cflags': ['-mips3', '-Wa,-mips3'], }, { 'cflags': ['-mips32', '-Wa,-mips32'], }], ], }], ], }], [ 'v8_can_use_fpu_instructions=="true"', { 'defines': [ 'CAN_USE_FPU_INSTRUCTIONS', ], }], [ 'v8_use_mips_abi_hardfloat=="true"', { 'defines': [ '__mips_hard_float=1', 'CAN_USE_FPU_INSTRUCTIONS', ], }, { 'defines': [ '__mips_soft_float=1' ], }], ['mips_arch_variant=="mips32r2"', { 'defines': ['_MIPS_ARCH_MIPS32R2',], }], ['mips_arch_variant=="loongson"', { 'defines': ['_MIPS_ARCH_LOONGSON',], }], ], }], # v8_target_arch=="mipsel" ['v8_target_arch=="x64"', { 'defines': [ 'V8_TARGET_ARCH_X64', ], 'xcode_settings': { 'ARCHS': [ 'x86_64' ], }, 'msvs_settings': { 'VCLinkerTool': { 'StackReserveSize': '2097152', }, }, 'msvs_configuration_platform': 'x64', }], # v8_target_arch=="x64" ['v8_use_liveobjectlist=="true"', { 'defines': [ 'ENABLE_DEBUGGER_SUPPORT', 'INSPECTOR', 'OBJECT_PRINT', 'LIVEOBJECTLIST', ], }], ['v8_compress_startup_data=="bz2"', { 'defines': [ 'COMPRESS_STARTUP_DATA_BZ2', ], }], ['OS=="win"', { 'defines': [ 'WIN32', ], 'msvs_configuration_attributes': { 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'CharacterSet': '1', }, }], ['OS=="win" and v8_enable_prof==1', { 'msvs_settings': { 'VCLinkerTool': { 'GenerateMapFile': 'true', }, }, }], ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ or OS=="netbsd"', { 'conditions': [ [ 'v8_no_strict_aliasing==1', { 'cflags': [ '-fno-strict-aliasing' ], }], ], # conditions }], ['OS=="solaris"', { 'defines': [ '__C99FEATURES__=1' ], # isinf() etc. }], ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \ or OS=="netbsd" or OS=="mac" or OS=="android") and \ (v8_target_arch=="arm" or v8_target_arch=="ia32" or \ v8_target_arch=="mipsel")', { # Check whether the host compiler and target compiler support the # '-m32' option and set it if so. 'target_conditions': [ ['_toolset=="host"', { 'variables': { 'm32flag': ' /dev/null 2>&1) && echo "-m32" || true)', }, 'cflags': [ '<(m32flag)' ], 'ldflags': [ '<(m32flag)' ], 'xcode_settings': { 'ARCHS': [ 'i386' ], }, }], ['_toolset=="target"', { 'variables': { 'm32flag': ' /dev/null 2>&1) && echo "-m32" || true)', 'clang%': 0, }, 'conditions': [ ['OS!="android" or clang==1', { 'cflags': [ '<(m32flag)' ], 'ldflags': [ '<(m32flag)' ], }], ], 'xcode_settings': { 'ARCHS': [ 'i386' ], }, }], ], }], ['OS=="freebsd" or OS=="openbsd"', { 'cflags': [ '-I/usr/local/include' ], }], ['OS=="netbsd"', { 'cflags': [ '-I/usr/pkg/include' ], }], ], # conditions 'configurations': { 'Debug': { 'defines': [ 'DEBUG', 'ENABLE_DISASSEMBLER', 'V8_ENABLE_CHECKS', 'OBJECT_PRINT', 'VERIFY_HEAP', ], 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '0', 'conditions': [ ['OS=="win" and component=="shared_library"', { 'RuntimeLibrary': '3', # /MDd }, { 'RuntimeLibrary': '1', # /MTd }], ], }, 'VCLinkerTool': { 'LinkIncremental': '2', }, }, 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd"', { 'cflags': [ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Woverloaded-virtual' ], }], ['OS=="android"', { 'variables': { 'android_full_debug%': 1, }, 'conditions': [ ['android_full_debug==0', { # Disable full debug if we want a faster v8 in a debug build. # TODO(2304): pass DISABLE_DEBUG_ASSERT instead of hiding DEBUG. 'defines!': [ 'DEBUG', ], }], ], }], ], }, # Debug 'Release': { 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="netbsd" \ or OS=="android"', { 'cflags!': [ '-O2', '-Os', ], 'cflags': [ '-fdata-sections', '-ffunction-sections', '-O3', ], 'conditions': [ [ 'gcc_version==44 and clang==0', { 'cflags': [ # Avoid crashes with gcc 4.4 in the v8 test suite. '-fno-tree-vrp', ], }], ], }], ['OS=="mac"', { 'xcode_settings': { 'GCC_OPTIMIZATION_LEVEL': '3', # -O3 # -fstrict-aliasing. Mainline gcc # enables this at -O2 and above, # but Apple gcc does not unless it # is specified explicitly. 'GCC_STRICT_ALIASING': 'YES', }, }], # OS=="mac" ['OS=="win"', { 'msvs_settings': { 'VCCLCompilerTool': { 'Optimization': '2', 'InlineFunctionExpansion': '2', 'EnableIntrinsicFunctions': 'true', 'FavorSizeOrSpeed': '0', 'StringPooling': 'true', 'conditions': [ ['OS=="win" and component=="shared_library"', { 'RuntimeLibrary': '2', #/MD }, { 'RuntimeLibrary': '0', #/MT }], ['v8_target_arch=="x64"', { # TODO(2207): remove this option once the bug is fixed. 'WholeProgramOptimization': 'true', }], ], }, 'VCLinkerTool': { 'LinkIncremental': '1', 'OptimizeReferences': '2', 'EnableCOMDATFolding': '2', }, }, }], # OS=="win" ], # conditions }, # Release }, # configurations }, # target_defaults } v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/build/gyp_v8000077500000000000000000000135321211511573600214550ustar00rootroot00000000000000#!/usr/bin/python # # Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # This script is wrapper for V8 that adds some support for how GYP # is invoked by V8 beyond what can be done in the gclient hooks. import glob import os import shlex import sys script_dir = os.path.dirname(__file__) v8_root = os.path.normpath(os.path.join(script_dir, os.pardir)) if __name__ == '__main__': os.chdir(v8_root) script_dir = os.path.dirname(__file__) v8_root = '.' sys.path.insert(0, os.path.join(v8_root, 'tools')) import utils sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) import gyp def apply_gyp_environment(file_path=None): """ Reads in a *.gyp_env file and applies the valid keys to os.environ. """ if not file_path or not os.path.exists(file_path): return file_contents = open(file_path).read() try: file_data = eval(file_contents, {'__builtins__': None}, None) except SyntaxError, e: e.filename = os.path.abspath(file_path) raise supported_vars = ( 'V8_GYP_FILE', 'V8_GYP_SYNTAX_CHECK', 'GYP_DEFINES', 'GYP_GENERATOR_FLAGS', 'GYP_GENERATOR_OUTPUT', ) for var in supported_vars: val = file_data.get(var) if val: if var in os.environ: print 'INFO: Environment value for "%s" overrides value in %s.' % ( var, os.path.abspath(file_path) ) else: os.environ[var] = val def additional_include_files(args=[]): """ Returns a list of additional (.gypi) files to include, without duplicating ones that are already specified on the command line. """ # Determine the include files specified on the command line. # This doesn't cover all the different option formats you can use, # but it's mainly intended to avoid duplicating flags on the automatic # makefile regeneration which only uses this format. specified_includes = set() for arg in args: if arg.startswith('-I') and len(arg) > 2: specified_includes.add(os.path.realpath(arg[2:])) result = [] def AddInclude(path): if os.path.realpath(path) not in specified_includes: result.append(path) # Always include standalone.gypi AddInclude(os.path.join(v8_root, 'build', 'standalone.gypi')) # Optionally add supplemental .gypi files if present. supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi')) for supplement in supplements: AddInclude(supplement) return result def run_gyp(args): rc = gyp.main(args) if rc != 0: print 'Error running GYP' sys.exit(rc) if __name__ == '__main__': args = sys.argv[1:] if 'SKIP_V8_GYP_ENV' not in os.environ: # Update the environment based on v8.gyp_env gyp_env_path = os.path.join(os.path.dirname(v8_root), 'v8.gyp_env') apply_gyp_environment(gyp_env_path) # This could give false positives since it doesn't actually do real option # parsing. Oh well. gyp_file_specified = False for arg in args: if arg.endswith('.gyp'): gyp_file_specified = True break # If we didn't get a file, check an env var, and then fall back to # assuming 'all.gyp' from the same directory as the script. if not gyp_file_specified: gyp_file = os.environ.get('V8_GYP_FILE') if gyp_file: # Note that V8_GYP_FILE values can't have backslashes as # path separators even on Windows due to the use of shlex.split(). args.extend(shlex.split(gyp_file)) else: # Note that this must not start with "./" or things break. # So we rely on having done os.chdir(v8_root) above and use the # relative path. args.append(os.path.join('build', 'all.gyp')) args.extend(['-I' + i for i in additional_include_files(args)]) # There shouldn't be a circular dependency relationship between .gyp files args.append('--no-circular-check') # Set the GYP DEPTH variable to the root of the V8 project. args.append('--depth=' + v8_root) # If V8_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check # to enfore syntax checking. syntax_check = os.environ.get('V8_GYP_SYNTAX_CHECK') if syntax_check and int(syntax_check): args.append('--check') print 'Updating projects from gyp files...' sys.stdout.flush() # Generate for the architectures supported on the given platform. gyp_args = list(args) if utils.GuessOS() == 'linux': gyp_args.append('--generator-output=out') run_gyp(gyp_args) v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/build/standalone.gypi000066400000000000000000000201621211511573600233320ustar00rootroot00000000000000# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above # copyright notice, this list of conditions and the following # disclaimer in the documentation and/or other materials provided # with the distribution. # * Neither the name of Google Inc. nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Definitions to be used when building stand-alone V8 binaries. { 'variables': { 'library%': 'static_library', 'component%': 'static_library', 'visibility%': 'hidden', 'msvs_multi_core_compile%': '1', 'mac_deployment_target%': '10.5', 'variables': { 'variables': { 'variables': { 'conditions': [ ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \ OS=="netbsd" or OS=="mac"', { # This handles the Unix platforms we generally deal with. # Anything else gets passed through, which probably won't work # very well; such hosts should pass an explicit target_arch # to gyp. 'host_arch%': '= 4) && defined(V8_SHARED) #define EXPORT __attribute__ ((visibility("default"))) #else // defined(__GNUC__) && (__GNUC__ >= 4) #define EXPORT #endif // defined(__GNUC__) && (__GNUC__ >= 4) #endif // _WIN32 /** * Debugger support for the V8 JavaScript engine. */ namespace v8 { // Debug events which can occur in the V8 JavaScript engine. enum DebugEvent { Break = 1, Exception = 2, NewFunction = 3, BeforeCompile = 4, AfterCompile = 5, ScriptCollected = 6, BreakForCommand = 7 }; class EXPORT Debug { public: /** * A client object passed to the v8 debugger whose ownership will be taken by * it. v8 is always responsible for deleting the object. */ class ClientData { public: virtual ~ClientData() {} }; /** * A message object passed to the debug message handler. */ class Message { public: /** * Check type of message. */ virtual bool IsEvent() const = 0; virtual bool IsResponse() const = 0; virtual DebugEvent GetEvent() const = 0; /** * Indicate whether this is a response to a continue command which will * start the VM running after this is processed. */ virtual bool WillStartRunning() const = 0; /** * Access to execution state and event data. Don't store these cross * callbacks as their content becomes invalid. These objects are from the * debugger event that started the debug message loop. */ virtual Handle GetExecutionState() const = 0; virtual Handle GetEventData() const = 0; /** * Get the debugger protocol JSON. */ virtual Handle GetJSON() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ virtual Handle GetEventContext() const = 0; /** * Client data passed with the corresponding request if any. This is the * client_data data value passed into Debug::SendCommand along with the * request that led to the message or NULL if the message is an event. The * debugger takes ownership of the data and will delete it even if there is * no message handler. */ virtual ClientData* GetClientData() const = 0; virtual ~Message() {} }; /** * An event details object passed to the debug event listener. */ class EventDetails { public: /** * Event type. */ virtual DebugEvent GetEvent() const = 0; /** * Access to execution state and event data of the debug event. Don't store * these cross callbacks as their content becomes invalid. */ virtual Handle GetExecutionState() const = 0; virtual Handle GetEventData() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ virtual Handle GetEventContext() const = 0; /** * Client data passed with the corresponding callback when it was * registered. */ virtual Handle GetCallbackData() const = 0; /** * Client data passed to DebugBreakForCommand function. The * debugger takes ownership of the data and will delete it even if * there is no message handler. */ virtual ClientData* GetClientData() const = 0; virtual ~EventDetails() {} }; /** * Debug event callback function. * * \param event the type of the debug event that triggered the callback * (enum DebugEvent) * \param exec_state execution state (JavaScript object) * \param event_data event specific data (JavaScript object) * \param data value passed by the user to SetDebugEventListener */ typedef void (*EventCallback)(DebugEvent event, Handle exec_state, Handle event_data, Handle data); /** * Debug event callback function. * * \param event_details object providing information about the debug event * * A EventCallback2 does not take possession of the event data, * and must not rely on the data persisting after the handler returns. */ typedef void (*EventCallback2)(const EventDetails& event_details); /** * Debug message callback function. * * \param message the debug message handler message object * \param length length of the message * \param client_data the data value passed when registering the message handler * A MessageHandler does not take possession of the message string, * and must not rely on the data persisting after the handler returns. * * This message handler is deprecated. Use MessageHandler2 instead. */ typedef void (*MessageHandler)(const uint16_t* message, int length, ClientData* client_data); /** * Debug message callback function. * * \param message the debug message handler message object * * A MessageHandler does not take possession of the message data, * and must not rely on the data persisting after the handler returns. */ typedef void (*MessageHandler2)(const Message& message); /** * Debug host dispatch callback function. */ typedef void (*HostDispatchHandler)(); /** * Callback function for the host to ensure debug messages are processed. */ typedef void (*DebugMessageDispatchHandler)(); // Set a C debug event listener. static bool SetDebugEventListener(EventCallback that, Handle data = Handle()); static bool SetDebugEventListener2(EventCallback2 that, Handle data = Handle()); // Set a JavaScript debug event listener. static bool SetDebugEventListener(v8::Handle that, Handle data = Handle()); // Schedule a debugger break to happen when JavaScript code is run // in the given isolate. If no isolate is provided the default // isolate is used. static void DebugBreak(Isolate* isolate = NULL); // Remove scheduled debugger break in given isolate if it has not // happened yet. If no isolate is provided the default isolate is // used. static void CancelDebugBreak(Isolate* isolate = NULL); // Break execution of JavaScript in the given isolate (this method // can be invoked from a non-VM thread) for further client command // execution on a VM thread. Client data is then passed in // EventDetails to EventCallback at the moment when the VM actually // stops. If no isolate is provided the default isolate is used. static void DebugBreakForCommand(ClientData* data = NULL, Isolate* isolate = NULL); // Message based interface. The message protocol is JSON. NOTE the message // handler thread is not supported any more parameter must be false. static void SetMessageHandler(MessageHandler handler, bool message_handler_thread = false); static void SetMessageHandler2(MessageHandler2 handler); // If no isolate is provided the default isolate is // used. static void SendCommand(const uint16_t* command, int length, ClientData* client_data = NULL, Isolate* isolate = NULL); // Dispatch interface. static void SetHostDispatchHandler(HostDispatchHandler handler, int period = 100); /** * Register a callback function to be called when a debug message has been * received and is ready to be processed. For the debug messages to be * processed V8 needs to be entered, and in certain embedding scenarios this * callback can be used to make sure V8 is entered for the debug message to * be processed. Note that debug messages will only be processed if there is * a V8 break. This can happen automatically by using the option * --debugger-auto-break. * \param provide_locker requires that V8 acquires v8::Locker for you before * calling handler */ static void SetDebugMessageDispatchHandler( DebugMessageDispatchHandler handler, bool provide_locker = false); /** * Run a JavaScript function in the debugger. * \param fun the function to call * \param data passed as second argument to the function * With this call the debugger is entered and the function specified is called * with the execution state as the first argument. This makes it possible to * get access to information otherwise not available during normal JavaScript * execution e.g. details on stack frames. Receiver of the function call will * be the debugger context global object, however this is a subject to change. * The following example shows a JavaScript function which when passed to * v8::Debug::Call will return the current line of JavaScript execution. * * \code * function frame_source_line(exec_state) { * return exec_state.frame(0).sourceLine(); * } * \endcode */ static Local Call(v8::Handle fun, Handle data = Handle()); /** * Returns a mirror object for the given object. */ static Local GetMirror(v8::Handle obj); /** * Enable the V8 builtin debug agent. The debugger agent will listen on the * supplied TCP/IP port for remote debugger connection. * \param name the name of the embedding application * \param port the TCP/IP port to listen on * \param wait_for_connection whether V8 should pause on a first statement * allowing remote debugger to connect before anything interesting happened */ static bool EnableAgent(const char* name, int port, bool wait_for_connection = false); /** * Disable the V8 builtin debug agent. The TCP/IP connection will be closed. */ static void DisableAgent(); /** * Makes V8 process all pending debug messages. * * From V8 point of view all debug messages come asynchronously (e.g. from * remote debugger) but they all must be handled synchronously: V8 cannot * do 2 things at one time so normal script execution must be interrupted * for a while. * * Generally when message arrives V8 may be in one of 3 states: * 1. V8 is running script; V8 will automatically interrupt and process all * pending messages (however auto_break flag should be enabled); * 2. V8 is suspended on debug breakpoint; in this state V8 is dedicated * to reading and processing debug messages; * 3. V8 is not running at all or has called some long-working C++ function; * by default it means that processing of all debug messages will be deferred * until V8 gets control again; however, embedding application may improve * this by manually calling this method. * * It makes sense to call this method whenever a new debug message arrived and * V8 is not already running. Method v8::Debug::SetDebugMessageDispatchHandler * should help with the former condition. * * Technically this method in many senses is equivalent to executing empty * script: * 1. It does nothing except for processing all pending debug messages. * 2. It should be invoked with the same precautions and from the same context * as V8 script would be invoked from, because: * a. with "evaluate" command it can do whatever normal script can do, * including all native calls; * b. no other thread should call V8 while this method is running * (v8::Locker may be used here). * * "Evaluate" debug command behavior currently is not specified in scope * of this method. */ static void ProcessDebugMessages(); /** * Debugger is running in its own context which is entered while debugger * messages are being dispatched. This is an explicit getter for this * debugger context. Note that the content of the debugger context is subject * to change. */ static Local GetDebugContext(); /** * Enable/disable LiveEdit functionality for the given Isolate * (default Isolate if not provided). V8 will abort if LiveEdit is * unexpectedly used. LiveEdit is enabled by default. */ static void SetLiveEditEnabled(bool enable, Isolate* isolate = NULL); }; } // namespace v8 #undef EXPORT #endif // V8_V8_DEBUG_H_ v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/include/v8-preparser.h000066400000000000000000000107571211511573600233540ustar00rootroot00000000000000// Copyright 2011 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef PREPARSER_H #define PREPARSER_H #include "v8stdint.h" #ifdef _WIN32 // Setup for Windows DLL export/import. When building the V8 DLL the // BUILDING_V8_SHARED needs to be defined. When building a program which uses // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 // static library or building a program which uses the V8 static library neither // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ build configuration to ensure that at most one of these is set #endif #ifdef BUILDING_V8_SHARED #define V8EXPORT __declspec(dllexport) #elif USING_V8_SHARED #define V8EXPORT __declspec(dllimport) #else #define V8EXPORT #endif // BUILDING_V8_SHARED #else // _WIN32 // Setup for Linux shared library export. There is no need to distinguish // between building or using the V8 shared library, but we should not // export symbols when we are building a static library. #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED) #define V8EXPORT __attribute__ ((visibility("default"))) #else #define V8EXPORT #endif #endif // _WIN32 namespace v8 { // The result of preparsing is either a stack overflow error, or an opaque // blob of data that can be passed back into the parser. class V8EXPORT PreParserData { public: PreParserData(size_t size, const uint8_t* data) : data_(data), size_(size) { } // Create a PreParserData value where stack_overflow reports true. static PreParserData StackOverflow() { return PreParserData(0, NULL); } // Whether the pre-parser stopped due to a stack overflow. // If this is the case, size() and data() should not be used. bool stack_overflow() { return size_ == 0u; } // The size of the data in bytes. size_t size() const { return size_; } // Pointer to the data. const uint8_t* data() const { return data_; } private: const uint8_t* const data_; const size_t size_; }; // Interface for a stream of Unicode characters. class V8EXPORT UnicodeInputStream { // NOLINT - Thinks V8EXPORT is class name. public: virtual ~UnicodeInputStream(); // Returns the next Unicode code-point in the input, or a negative value when // there is no more input in the stream. virtual int32_t Next() = 0; }; // Preparse a JavaScript program. The source code is provided as a // UnicodeInputStream. The max_stack_size limits the amount of stack // space that the preparser is allowed to use. If the preparser uses // more stack space than the limit provided, the result's stack_overflow() // method will return true. Otherwise the result contains preparser // data that can be used by the V8 parser to speed up parsing. PreParserData V8EXPORT Preparse(UnicodeInputStream* input, size_t max_stack_size); } // namespace v8. #endif // PREPARSER_H v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/include/v8-profiler.h000066400000000000000000000443061211511573600231700ustar00rootroot00000000000000// Copyright 2010 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef V8_V8_PROFILER_H_ #define V8_V8_PROFILER_H_ #include "v8.h" #ifdef _WIN32 // Setup for Windows DLL export/import. See v8.h in this directory for // information on how to build/use V8 as a DLL. #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ build configuration to ensure that at most one of these is set #endif #ifdef BUILDING_V8_SHARED #define V8EXPORT __declspec(dllexport) #elif USING_V8_SHARED #define V8EXPORT __declspec(dllimport) #else #define V8EXPORT #endif #else // _WIN32 // Setup for Linux shared library export. See v8.h in this directory for // information on how to build/use V8 as shared library. #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED) #define V8EXPORT __attribute__ ((visibility("default"))) #else #define V8EXPORT #endif #endif // _WIN32 /** * Profiler support for the V8 JavaScript engine. */ namespace v8 { typedef uint32_t SnapshotObjectId; /** * CpuProfileNode represents a node in a call graph. */ class V8EXPORT CpuProfileNode { public: /** Returns function name (empty string for anonymous functions.) */ Handle GetFunctionName() const; /** Returns resource name for script from where the function originates. */ Handle GetScriptResourceName() const; /** * Returns the number, 1-based, of the line where the function originates. * kNoLineNumberInfo if no line number information is available. */ int GetLineNumber() const; /** * Returns total (self + children) execution time of the function, * in milliseconds, estimated by samples count. */ double GetTotalTime() const; /** * Returns self execution time of the function, in milliseconds, * estimated by samples count. */ double GetSelfTime() const; /** Returns the count of samples where function exists. */ double GetTotalSamplesCount() const; /** Returns the count of samples where function was currently executing. */ double GetSelfSamplesCount() const; /** Returns function entry UID. */ unsigned GetCallUid() const; /** Returns child nodes count of the node. */ int GetChildrenCount() const; /** Retrieves a child node by index. */ const CpuProfileNode* GetChild(int index) const; static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; }; /** * CpuProfile contains a CPU profile in a form of two call trees: * - top-down (from main() down to functions that do all the work); * - bottom-up call graph (in backward direction). */ class V8EXPORT CpuProfile { public: /** Returns CPU profile UID (assigned by the profiler.) */ unsigned GetUid() const; /** Returns CPU profile title. */ Handle GetTitle() const; /** Returns the root node of the bottom up call tree. */ const CpuProfileNode* GetBottomUpRoot() const; /** Returns the root node of the top down call tree. */ const CpuProfileNode* GetTopDownRoot() const; /** * Deletes the profile and removes it from CpuProfiler's list. * All pointers to nodes previously returned become invalid. * Profiles with the same uid but obtained using different * security token are not deleted, but become inaccessible * using FindProfile method. It is embedder's responsibility * to call Delete on these profiles. */ void Delete(); }; /** * Interface for controlling CPU profiling. */ class V8EXPORT CpuProfiler { public: /** * A note on security tokens usage. As scripts from different * origins can run inside a single V8 instance, it is possible to * have functions from different security contexts intermixed in a * single CPU profile. To avoid exposing function names belonging to * other contexts, filtering by security token is performed while * obtaining profiling results. */ /** * Returns the number of profiles collected (doesn't include * profiles that are being collected at the moment of call.) */ static int GetProfilesCount(); /** Returns a profile by index. */ static const CpuProfile* GetProfile( int index, Handle security_token = Handle()); /** Returns a profile by uid. */ static const CpuProfile* FindProfile( unsigned uid, Handle security_token = Handle()); /** * Starts collecting CPU profile. Title may be an empty string. It * is allowed to have several profiles being collected at * once. Attempts to start collecting several profiles with the same * title are silently ignored. While collecting a profile, functions * from all security contexts are included in it. The token-based * filtering is only performed when querying for a profile. */ static void StartProfiling(Handle title); /** * Stops collecting CPU profile with a given title and returns it. * If the title given is empty, finishes the last profile started. */ static const CpuProfile* StopProfiling( Handle title, Handle security_token = Handle()); /** * Deletes all existing profiles, also cancelling all profiling * activity. All previously returned pointers to profiles and their * contents become invalid after this call. */ static void DeleteAllProfiles(); }; class HeapGraphNode; /** * HeapSnapshotEdge represents a directed connection between heap * graph nodes: from retainers to retained nodes. */ class V8EXPORT HeapGraphEdge { public: enum Type { kContextVariable = 0, // A variable from a function context. kElement = 1, // An element of an array. kProperty = 2, // A named object property. kInternal = 3, // A link that can't be accessed from JS, // thus, its name isn't a real property name // (e.g. parts of a ConsString). kHidden = 4, // A link that is needed for proper sizes // calculation, but may be hidden from user. kShortcut = 5, // A link that must not be followed during // sizes calculation. kWeak = 6 // A weak reference (ignored by the GC). }; /** Returns edge type (see HeapGraphEdge::Type). */ Type GetType() const; /** * Returns edge name. This can be a variable name, an element index, or * a property name. */ Handle GetName() const; /** Returns origin node. */ const HeapGraphNode* GetFromNode() const; /** Returns destination node. */ const HeapGraphNode* GetToNode() const; }; /** * HeapGraphNode represents a node in a heap graph. */ class V8EXPORT HeapGraphNode { public: enum Type { kHidden = 0, // Hidden node, may be filtered when shown to user. kArray = 1, // An array of elements. kString = 2, // A string. kObject = 3, // A JS object (except for arrays and strings). kCode = 4, // Compiled code. kClosure = 5, // Function closure. kRegExp = 6, // RegExp. kHeapNumber = 7, // Number stored in the heap. kNative = 8, // Native object (not from V8 heap). kSynthetic = 9 // Synthetic object, usualy used for grouping // snapshot items together. }; /** Returns node type (see HeapGraphNode::Type). */ Type GetType() const; /** * Returns node name. Depending on node's type this can be the name * of the constructor (for objects), the name of the function (for * closures), string value, or an empty string (for compiled code). */ Handle GetName() const; /** * Returns node id. For the same heap object, the id remains the same * across all snapshots. */ SnapshotObjectId GetId() const; /** Returns node's own size, in bytes. */ int GetSelfSize() const; /** Returns child nodes count of the node. */ int GetChildrenCount() const; /** Retrieves a child by index. */ const HeapGraphEdge* GetChild(int index) const; /** * Finds and returns a value from the heap corresponding to this node, * if the value is still reachable. */ Handle GetHeapValue() const; }; /** * HeapSnapshots record the state of the JS heap at some moment. */ class V8EXPORT HeapSnapshot { public: enum Type { kFull = 0 // Heap snapshot with all instances and references. }; enum SerializationFormat { kJSON = 0 // See format description near 'Serialize' method. }; /** Returns heap snapshot type. */ Type GetType() const; /** Returns heap snapshot UID (assigned by the profiler.) */ unsigned GetUid() const; /** Returns heap snapshot title. */ Handle GetTitle() const; /** Returns the root node of the heap graph. */ const HeapGraphNode* GetRoot() const; /** Returns a node by its id. */ const HeapGraphNode* GetNodeById(SnapshotObjectId id) const; /** Returns total nodes count in the snapshot. */ int GetNodesCount() const; /** Returns a node by index. */ const HeapGraphNode* GetNode(int index) const; /** Returns a max seen JS object Id. */ SnapshotObjectId GetMaxSnapshotJSObjectId() const; /** * Deletes the snapshot and removes it from HeapProfiler's list. * All pointers to nodes, edges and paths previously returned become * invalid. */ void Delete(); /** * Prepare a serialized representation of the snapshot. The result * is written into the stream provided in chunks of specified size. * The total length of the serialized snapshot is unknown in * advance, it can be roughly equal to JS heap size (that means, * it can be really big - tens of megabytes). * * For the JSON format, heap contents are represented as an object * with the following structure: * * { * snapshot: { * title: "...", * uid: nnn, * meta: { meta-info }, * node_count: nnn, * edge_count: nnn * }, * nodes: [nodes array], * edges: [edges array], * strings: [strings array] * } * * Nodes reference strings, other nodes, and edges by their indexes * in corresponding arrays. */ void Serialize(OutputStream* stream, SerializationFormat format) const; }; class RetainedObjectInfo; /** * Interface for controlling heap profiling. */ class V8EXPORT HeapProfiler { public: /** * Callback function invoked for obtaining RetainedObjectInfo for * the given JavaScript wrapper object. It is prohibited to enter V8 * while the callback is running: only getters on the handle and * GetPointerFromInternalField on the objects are allowed. */ typedef RetainedObjectInfo* (*WrapperInfoCallback) (uint16_t class_id, Handle wrapper); /** Returns the number of snapshots taken. */ static int GetSnapshotsCount(); /** Returns a snapshot by index. */ static const HeapSnapshot* GetSnapshot(int index); /** Returns a profile by uid. */ static const HeapSnapshot* FindSnapshot(unsigned uid); /** * Returns SnapshotObjectId for a heap object referenced by |value| if * it has been seen by the heap profiler, kUnknownObjectId otherwise. */ static SnapshotObjectId GetSnapshotObjectId(Handle value); /** * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return * it in case heap profiler cannot find id for the object passed as * parameter. HeapSnapshot::GetNodeById will always return NULL for such id. */ static const SnapshotObjectId kUnknownObjectId = 0; /** * Takes a heap snapshot and returns it. Title may be an empty string. * See HeapSnapshot::Type for types description. */ static const HeapSnapshot* TakeSnapshot( Handle title, HeapSnapshot::Type type = HeapSnapshot::kFull, ActivityControl* control = NULL); /** * Starts tracking of heap objects population statistics. After calling * this method, all heap objects relocations done by the garbage collector * are being registered. */ static void StartHeapObjectsTracking(); /** * Adds a new time interval entry to the aggregated statistics array. The * time interval entry contains information on the current heap objects * population size. The method also updates aggregated statistics and * reports updates for all previous time intervals via the OutputStream * object. Updates on each time interval are provided as a stream of the * HeapStatsUpdate structure instances. * The return value of the function is the last seen heap object Id. * * StartHeapObjectsTracking must be called before the first call to this * method. */ static SnapshotObjectId PushHeapObjectsStats(OutputStream* stream); /** * Stops tracking of heap objects population statistics, cleans up all * collected data. StartHeapObjectsTracking must be called again prior to * calling PushHeapObjectsStats next time. */ static void StopHeapObjectsTracking(); /** * Deletes all snapshots taken. All previously returned pointers to * snapshots and their contents become invalid after this call. */ static void DeleteAllSnapshots(); /** Binds a callback to embedder's class ID. */ static void DefineWrapperClass( uint16_t class_id, WrapperInfoCallback callback); /** * Default value of persistent handle class ID. Must not be used to * define a class. Can be used to reset a class of a persistent * handle. */ static const uint16_t kPersistentHandleNoClassId = 0; /** Returns the number of currently existing persistent handles. */ static int GetPersistentHandleCount(); /** Returns memory used for profiler internal data and snapshots. */ static size_t GetMemorySizeUsedByProfiler(); }; /** * Interface for providing information about embedder's objects * held by global handles. This information is reported in two ways: * * 1. When calling AddObjectGroup, an embedder may pass * RetainedObjectInfo instance describing the group. To collect * this information while taking a heap snapshot, V8 calls GC * prologue and epilogue callbacks. * * 2. When a heap snapshot is collected, V8 additionally * requests RetainedObjectInfos for persistent handles that * were not previously reported via AddObjectGroup. * * Thus, if an embedder wants to provide information about native * objects for heap snapshots, he can do it in a GC prologue * handler, and / or by assigning wrapper class ids in the following way: * * 1. Bind a callback to class id by calling DefineWrapperClass. * 2. Call SetWrapperClassId on certain persistent handles. * * V8 takes ownership of RetainedObjectInfo instances passed to it and * keeps them alive only during snapshot collection. Afterwards, they * are freed by calling the Dispose class function. */ class V8EXPORT RetainedObjectInfo { // NOLINT public: /** Called by V8 when it no longer needs an instance. */ virtual void Dispose() = 0; /** Returns whether two instances are equivalent. */ virtual bool IsEquivalent(RetainedObjectInfo* other) = 0; /** * Returns hash value for the instance. Equivalent instances * must have the same hash value. */ virtual intptr_t GetHash() = 0; /** * Returns human-readable label. It must be a null-terminated UTF-8 * encoded string. V8 copies its contents during a call to GetLabel. */ virtual const char* GetLabel() = 0; /** * Returns human-readable group label. It must be a null-terminated UTF-8 * encoded string. V8 copies its contents during a call to GetGroupLabel. * Heap snapshot generator will collect all the group names, create * top level entries with these names and attach the objects to the * corresponding top level group objects. There is a default * implementation which is required because embedders don't have their * own implementation yet. */ virtual const char* GetGroupLabel() { return GetLabel(); } /** * Returns element count in case if a global handle retains * a subgraph by holding one of its nodes. */ virtual intptr_t GetElementCount() { return -1; } /** Returns embedder's object size in bytes. */ virtual intptr_t GetSizeInBytes() { return -1; } protected: RetainedObjectInfo() {} virtual ~RetainedObjectInfo() {} private: RetainedObjectInfo(const RetainedObjectInfo&); RetainedObjectInfo& operator=(const RetainedObjectInfo&); }; /** * A struct for exporting HeapStats data from V8, using "push" model. * See HeapProfiler::PushHeapObjectsStats. */ struct HeapStatsUpdate { HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size) : index(index), count(count), size(size) { } uint32_t index; // Index of the time interval that was changed. uint32_t count; // New value of count field for the interval with this index. uint32_t size; // New value of size field for the interval with this index. }; } // namespace v8 #undef V8EXPORT #endif // V8_V8_PROFILER_H_ v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/include/v8-testing.h000066400000000000000000000064301211511573600230170ustar00rootroot00000000000000// Copyright 2010 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #ifndef V8_V8_TEST_H_ #define V8_V8_TEST_H_ #include "v8.h" #ifdef _WIN32 // Setup for Windows DLL export/import. See v8.h in this directory for // information on how to build/use V8 as a DLL. #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ build configuration to ensure that at most one of these is set #endif #ifdef BUILDING_V8_SHARED #define V8EXPORT __declspec(dllexport) #elif USING_V8_SHARED #define V8EXPORT __declspec(dllimport) #else #define V8EXPORT #endif #else // _WIN32 // Setup for Linux shared library export. See v8.h in this directory for // information on how to build/use V8 as shared library. #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED) #define V8EXPORT __attribute__ ((visibility("default"))) #else #define V8EXPORT #endif #endif // _WIN32 /** * Testing support for the V8 JavaScript engine. */ namespace v8 { class V8EXPORT Testing { public: enum StressType { kStressTypeOpt, kStressTypeDeopt }; /** * Set the type of stressing to do. The default if not set is kStressTypeOpt. */ static void SetStressRunType(StressType type); /** * Get the number of runs of a given test that is required to get the full * stress coverage. */ static int GetStressRuns(); /** * Indicate the number of the run which is about to start. The value of run * should be between 0 and one less than the result from GetStressRuns() */ static void PrepareStressRun(int run); /** * Force deoptimization of all functions. */ static void DeoptimizeAll(); }; } // namespace v8 #undef V8EXPORT #endif // V8_V8_TEST_H_ v8-6b10fef46edfb4dc2a7aed389d75574c40a14243/include/v8.h000066400000000000000000004464011211511573600213520ustar00rootroot00000000000000// Copyright 2012 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** \mainpage V8 API Reference Guide * * V8 is Google's open source JavaScript engine. * * This set of documents provides reference material generated from the * V8 header file, include/v8.h. * * For other documentation see http://code.google.com/apis/v8/ */ #ifndef V8_H_ #define V8_H_ #include "v8stdint.h" #ifdef _WIN32 // Setup for Windows DLL export/import. When building the V8 DLL the // BUILDING_V8_SHARED needs to be defined. When building a program which uses // the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8 // static library or building a program which uses the V8 static library neither // BUILDING_V8_SHARED nor USING_V8_SHARED should be defined. #if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED) #error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\ build configuration to ensure that at most one of these is set #endif #ifdef BUILDING_V8_SHARED #define V8EXPORT __declspec(dllexport) #elif USING_V8_SHARED #define V8EXPORT __declspec(dllimport) #else #define V8EXPORT #endif // BUILDING_V8_SHARED #else // _WIN32 // Setup for Linux shared library export. #if defined(__GNUC__) && ((__GNUC__ >= 4) || \ (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(V8_SHARED) #ifdef BUILDING_V8_SHARED #define V8EXPORT __attribute__ ((visibility("default"))) #else #define V8EXPORT #endif #else #define V8EXPORT #endif #endif // _WIN32 /** * The v8 JavaScript engine. */ namespace v8 { class Context; class String; class StringObject; class Value; class Utils; class Number; class NumberObject; class Object; class Array; class Int32; class Uint32; class External; class Primitive; class Boolean; class BooleanObject; class Integer; class Function; class Date; class ImplementationUtilities; class Signature; class AccessorSignature; template class Handle; template class Local; template class Persistent; class FunctionTemplate; class ObjectTemplate; class Data; class AccessorInfo; class StackTrace; class StackFrame; class Isolate; namespace internal { class Arguments; class Object; class Heap; class HeapObject; class Isolate; } // --- Weak Handles --- /** * A weak reference callback function. * * This callback should either explicitly invoke Dispose on |object| if * V8 wrapper is not needed anymore, or 'revive' it by invocation of MakeWeak. * * \param object the weak global object to be reclaimed by the garbage collector * \param parameter the value passed in when making the weak global object */ typedef void (*WeakReferenceCallback)(Persistent object, void* parameter); // --- Handles --- #define TYPE_CHECK(T, S) \ while (false) { \ *(static_cast(0)) = static_cast(0); \ } /** * An object reference managed by the v8 garbage collector. * * All objects returned from v8 have to be tracked by the garbage * collector so that it knows that the objects are still alive. Also, * because the garbage collector may move objects, it is unsafe to * point directly to an object. Instead, all objects are stored in * handles which are known by the garbage collector and updated * whenever an object moves. Handles should always be passed by value * (except in cases like out-parameters) and they should never be * allocated on the heap. * * There are two types of handles: local and persistent handles. * Local handles are light-weight and transient and typically used in * local operations. They are managed by HandleScopes. Persistent * handles can be used when storing objects across several independent * operations and have to be explicitly deallocated when they're no * longer used. * * It is safe to extract the object stored in the handle by * dereferencing the handle (for instance, to extract the Object* from * a Handle); the value will still be governed by a handle * behind the scenes and the same rules apply to these values as to * their handles. */ template class Handle { public: /** * Creates an empty handle. */ inline Handle() : val_(0) {} /** * Creates a new handle for the specified value. */ inline explicit Handle(T* val) : val_(val) {} /** * Creates a handle for the contents of the specified handle. This * constructor allows you to pass handles as arguments by value and * to assign between handles. However, if you try to assign between * incompatible handles, for instance from a Handle to a * Handle it will cause a compile-time error. Assigning * between compatible handles, for instance assigning a * Handle to a variable declared as Handle, is legal * because String is a subclass of Value. */ template inline Handle(Handle that) : val_(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible * handles. For example, converting from a Handle to a * Handle. */ TYPE_CHECK(T, S); } /** * Returns true if the handle is empty. */ inline bool IsEmpty() const { return val_ == 0; } /** * Sets the handle to be empty. IsEmpty() will then return true. */ inline void Clear() { val_ = 0; } inline T* operator->() const { return val_; } inline T* operator*() const { return val_; } /** * Checks whether two handles are the same. * Returns true if both are empty, or if the objects * to which they refer are identical. * The handles' references are not checked. */ template inline bool operator==(Handle that) const { internal::Object** a = reinterpret_cast(**this); internal::Object** b = reinterpret_cast(*that); if (a == 0) return b == 0; if (b == 0) return false; return *a == *b; } /** * Checks whether two handles are different. * Returns true if only one of the handles is empty, or if * the objects to which they refer are different. * The handles' references are not checked. */ template inline bool operator!=(Handle that) const { return !operator==(that); } template static inline Handle Cast(Handle that) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. if (that.IsEmpty()) return Handle(); #endif return Handle(T::Cast(*that)); } template inline Handle As() { return Handle::Cast(*this); } private: T* val_; }; /** * A light-weight stack-allocated object handle. All operations * that return objects from within v8 return them in local handles. They * are created within HandleScopes, and all local handles allocated within a * handle scope are destroyed when the handle scope is destroyed. Hence it * is not necessary to explicitly deallocate local handles. */ template class Local : public Handle { public: inline Local(); template inline Local(Local that) : Handle(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible * handles. For example, converting from a Handle to a * Handle. */ TYPE_CHECK(T, S); } template inline Local(S* that) : Handle(that) { } template static inline Local Cast(Local that) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. if (that.IsEmpty()) return Local(); #endif return Local(T::Cast(*that)); } template inline Local As() { return Local::Cast(*this); } /** Create a local handle for the content of another handle. * The referee is kept alive by the local handle even when * the original handle is destroyed/disposed. */ inline static Local New(Handle that); }; /** * An object reference that is independent of any handle scope. Where * a Local handle only lives as long as the HandleScope in which it was * allocated, a Persistent handle remains valid until it is explicitly * disposed. * * A persistent handle contains a reference to a storage cell within * the v8 engine which holds an object value and which is updated by * the garbage collector whenever the object is moved. A new storage * cell can be created using Persistent::New and existing handles can * be disposed using Persistent::Dispose. Since persistent handles * are passed by value you may have many persistent handle objects * that point to the same storage cell. For instance, if you pass a * persistent handle as an argument to a function you will not get two * different storage cells but rather two references to the same * storage cell. */ template class Persistent : public Handle { public: /** * Creates an empty persistent handle that doesn't point to any * storage cell. */ inline Persistent(); /** * Creates a persistent handle for the same storage cell as the * specified handle. This constructor allows you to pass persistent * handles as arguments by value and to assign between persistent * handles. However, attempting to assign between incompatible * persistent handles, for instance from a Persistent to a * Persistent will cause a compile-time error. Assigning * between compatible persistent handles, for instance assigning a * Persistent to a variable declared as Persistent, * is allowed as String is a subclass of Value. */ template inline Persistent(Persistent that) : Handle(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible * handles. For example, converting from a Handle to a * Handle. */ TYPE_CHECK(T, S); } template inline Persistent(S* that) : Handle(that) { } /** * "Casts" a plain handle which is known to be a persistent handle * to a persistent handle. */ template explicit inline Persistent(Handle that) : Handle(*that) { } template static inline Persistent Cast(Persistent that) { #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. if (that.IsEmpty()) return Persistent(); #endif return Persistent(T::Cast(*that)); } template inline Persistent As() { return Persistent::Cast(*this); } /** * Creates a new persistent handle for an existing local or * persistent handle. */ inline static Persistent New(Handle that); /** * Releases the storage cell referenced by this persistent handle. * Does not remove the reference to the cell from any handles. * This handle's reference, and any other references to the storage * cell remain and IsEmpty will still return false. */ inline void Dispose(); /** * Make the reference to this object weak. When only weak handles * refer to the object, the garbage collector will perform a * callback to the given V8::WeakReferenceCallback function, passing * it the object reference and the given parameters. */ inline void MakeWeak(void* parameters, WeakReferenceCallback callback); /** Clears the weak reference to this object. */ inline void ClearWeak(); /** * Marks the reference to this object independent. Garbage collector * is free to ignore any object groups containing this object. * Weak callback for an independent handle should not * assume that it will be preceded by a global GC prologue callback * or followed by a global GC epilogue callback. */ inline void MarkIndependent(); /** Returns true if this handle was previously marked as independent. */ inline bool IsIndependent() const; /** Checks if the handle holds the only reference to an object. */ inline bool IsNearDeath() const; /** Returns true if the handle's reference is weak. */ inline bool IsWeak() const; /** * Assigns a wrapper class ID to the handle. See RetainedObjectInfo * interface description in v8-profiler.h for details. */ inline void SetWrapperClassId(uint16_t class_id); /** * Returns the class ID previously assigned to this handle or 0 if no class * ID was previously assigned. */ inline uint16_t WrapperClassId() const; private: friend class ImplementationUtilities; friend class ObjectTemplate; }; /** * A stack-allocated class that governs a number of local handles. * After a handle scope has been created, all local handles will be * allocated within that handle scope until either the handle scope is * deleted or another handle scope is created. If there is already a * handle scope and a new one is created, all allocations will take * place in the new handle scope until it is deleted. After that, * new handles will again be allocated in the original handle scope. * * After the handle scope of a local handle has been deleted the * garbage collector will no longer track the object stored in the * handle and may deallocate it. The behavior of accessing a handle * for which the handle scope has been deleted is undefined. */ class V8EXPORT HandleScope { public: HandleScope(); ~HandleScope(); /** * Closes the handle scope and returns the value as a handle in the * previous scope, which is the new current scope after the call. */ template Local Close(Handle value); /** * Counts the number of allocated handles. */ static int NumberOfHandles(); /** * Creates a new handle with the given value. */ static internal::Object** CreateHandle(internal::Object* value); // Faster version, uses HeapObject to obtain the current Isolate. static internal::Object** CreateHandle(internal::HeapObject* value); private: // Make it impossible to create heap-allocated or illegal handle // scopes by disallowing certain operations. HandleScope(const HandleScope&); void operator=(const HandleScope&); void* operator new(size_t size); void operator delete(void*, size_t); // This Data class is accessible internally as HandleScopeData through a // typedef in the ImplementationUtilities class. class V8EXPORT Data { public: internal::Object** next; internal::Object** limit; int level; inline void Initialize() { next = limit = NULL; level = 0; } }; void Leave(); internal::Isolate* isolate_; internal::Object** prev_next_; internal::Object** prev_limit_; // Allow for the active closing of HandleScopes which allows to pass a handle // from the HandleScope being closed to the next top most HandleScope. bool is_closed_; internal::Object** RawClose(internal::Object** value); friend class ImplementationUtilities; }; // --- Special objects --- /** * The superclass of values and API object templates. */ class V8EXPORT Data { private: Data(); }; /** * Pre-compilation data that can be associated with a script. This * data can be calculated for a script in advance of actually * compiling it, and can be stored between compilations. When script * data is given to the compile method compilation will be faster. */ class V8EXPORT ScriptData { // NOLINT public: virtual ~ScriptData() { } /** * Pre-compiles the specified script (context-independent). * * \param input Pointer to UTF-8 script source code. * \param length Length of UTF-8 script source code. */ static ScriptData* PreCompile(const char* input, int length); /** * Pre-compiles the specified script (context-independent). * * NOTE: Pre-compilation using this method cannot happen on another thread * without using Lockers. * * \param source Script source code. */ static ScriptData* PreCompile(Handle source); /** * Load previous pre-compilation data. * * \param data Pointer to data returned by a call to Data() of a previous * ScriptData. Ownership is not transferred. * \param length Length of data. */ static ScriptData* New(const char* data, int length); /** * Returns the length of Data(). */ virtual int Length() = 0; /** * Returns a serialized representation of this ScriptData that can later be * passed to New(). NOTE: Serialized data is platform-dependent. */ virtual const char* Data() = 0; /** * Returns true if the source code could not be parsed. */ virtual bool HasError() = 0; }; /** * The origin, within a file, of a script. */ class ScriptOrigin { public: inline ScriptOrigin( Handle resource_name, Handle resource_line_offset = Handle(), Handle resource_column_offset = Handle()) : resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset) { } inline Handle ResourceName() const; inline Handle ResourceLineOffset() const; inline Handle ResourceColumnOffset() const; private: Handle resource_name_; Handle resource_line_offset_; Handle resource_column_offset_; }; /** * A compiled JavaScript script. */ class V8EXPORT Script { public: /** * Compiles the specified script (context-independent). * * \param source Script source code. * \param origin Script origin, owned by caller, no references are kept * when New() returns * \param pre_data Pre-parsing data, as obtained by ScriptData::PreCompile() * using pre_data speeds compilation if it's done multiple times. * Owned by caller, no references are kept when New() returns. * \param script_data Arbitrary data associated with script. Using * this has same effect as calling SetData(), but allows data to be * available to compile event handlers. * \return Compiled script object (context independent; when run it * will use the currently entered context). */ static Local