Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Imported Upstream version 3.6.4

  • Loading branch information...
commit 46aa30b8777f27498d6a6ba2a6104603b202e27c 1 parent e2b4141
@ept authored
Showing with 18,068 additions and 20,757 deletions.
  1. +7 −2 .gitignore
  2. +8 −1 AUTHORS
  3. +727 −0 ChangeLog
  4. +182 −0 Makefile
  5. +549 −190 SConstruct
  6. +1 −1  benchmarks/crypto.js
  7. +25 −25 benchmarks/earley-boyer.js
  8. +3 −3 benchmarks/regexp.js
  9. +51 −10 build/README.txt
  10. +4 −3 build/all.gyp
  11. +6 −2 build/armu.gypi
  12. +259 −40 build/common.gypi
  13. +32 −4 build/gyp_v8
  14. +196 −0 build/standalone.gypi
  15. +28 −17 include/v8-debug.h
  16. +7 −6 include/v8-preparser.h
  17. +132 −56 include/v8-profiler.h
  18. +5 −0 include/v8-testing.h
  19. +630 −266 include/v8.h
  20. +38 −0 preparser/SConscript
  21. +290 −117 preparser/preparser-process.cc
  22. +42 −0 preparser/preparser.gyp
  23. +2 −2 samples/SConscript
  24. +5 −3 samples/process.cc
  25. +11 −9 samples/samples.gyp
  26. +83 −95 samples/shell.cc
  27. +85 −38 src/SConscript
  28. +147 −252 src/accessors.cc
  29. +2 −0  src/accessors.h
  30. +11 −8 src/{x64/codegen-x64-inl.h → allocation-inl.h}
  31. +0 −82 src/allocation.cc
  32. +9 −42 src/allocation.h
  33. +2,248 −1,354 src/api.cc
  34. +91 −29 src/api.h
  35. +15 −3 src/apinatives.js
  36. +0 −7 src/apiutils.h
  37. +25 −3 src/arguments.h
  38. +10 −9 src/arm/assembler-arm-inl.h
  39. +302 −397 src/arm/assembler-arm.cc
  40. +203 −73 src/arm/assembler-arm.h
  41. +168 −101 src/arm/builtins-arm.cc
  42. +2,004 −2,120 src/arm/code-stubs-arm.cc
  43. +283 −337 src/arm/code-stubs-arm.h
  44. +2 −7,358 src/arm/codegen-arm.cc
  45. +4 −510 src/arm/codegen-arm.h
  46. +15 −9 src/arm/constants-arm.h
  47. +33 −60 src/arm/cpu-arm.cc
  48. +8 −6 src/arm/debug-arm.cc
  49. +98 −29 src/arm/deoptimizer-arm.cc
  50. +107 −40 src/arm/disasm-arm.cc
  51. +10 −6 src/arm/frames-arm.h
  52. +896 −898 src/arm/full-codegen-arm.cc
  53. +320 −493 src/arm/ic-arm.cc
  54. +0 −174 src/arm/jump-target-arm.cc
  55. +446 −300 src/arm/lithium-arm.cc
  56. +416 −267 src/arm/lithium-arm.h
  57. +1,516 −835 src/arm/lithium-codegen-arm.cc
  58. +41 −11 src/arm/lithium-codegen-arm.h
  59. +3 −3 src/arm/lithium-gap-resolver-arm.cc
  60. +0 −1  src/arm/lithium-gap-resolver-arm.h
  61. +803 −226 src/arm/macro-assembler-arm.cc
  62. +191 −52 src/arm/macro-assembler-arm.h
  63. +47 −28 src/arm/regexp-macro-assembler-arm.cc
  64. +6 −1 src/arm/regexp-macro-assembler-arm.h
  65. +407 −148 src/arm/simulator-arm.cc
  66. +58 −29 src/arm/simulator-arm.h
  67. +1,086 −733 src/arm/stub-cache-arm.cc
  68. +0 −843 src/arm/virtual-frame-arm.cc
  69. +0 −520 src/arm/virtual-frame-arm.h
  70. +204 −54 src/array.js
  71. +422 −182 src/assembler.cc
  72. +206 −132 src/assembler.h
  73. +42 −28 src/ast-inl.h
  74. +284 −173 src/ast.cc
  75. +384 −412 src/ast.h
  76. +2 −0  src/atomicops.h
  77. +169 −0 src/atomicops_internals_mips_gcc.h
  78. +10 −3 src/atomicops_internals_x86_gcc.cc
  79. +3 −3 src/atomicops_internals_x86_gcc.h
  80. +5 −2 src/bignum-dtoa.cc
  81. +3 −4 src/bignum.cc
  82. +1 −0  src/bignum.h
  83. +797 −451 src/bootstrapper.cc
  84. +97 −26 src/bootstrapper.h
Sorry, we could not display the entire diff because too many files (966) changed.
View
9 .gitignore
@@ -1,17 +1,18 @@
*.a
*.exe
+*.idb
*.lib
*.log
*.map
*.mk
*.ncb
+*.pdb
*.pyc
*.scons*
+*.so
*.suo
*.user
*.xcodeproj
-*.idb
-*.pdb
#*#
*~
.cpplint-cache
@@ -19,13 +20,17 @@ d8
d8_g
shell
shell_g
+/build/gyp
/obj/
+/out/
/test/es5conform/data/
/test/mozilla/data/
/test/sputnik/sputniktests/
+/test/test262/data/
/tools/oom_dump/oom_dump
/tools/oom_dump/oom_dump.o
/tools/visual_studio/Debug
/tools/visual_studio/Release
/xcodebuild/
TAGS
+*.Makefile
View
9 AUTHORS
@@ -7,7 +7,9 @@ Google Inc.
Sigma Designs Inc.
ARM Ltd.
Hewlett-Packard Development Company, LP
+Igalia, S.L.
+Akinori MUSHA <knu@FreeBSD.org>
Alexander Botero-Lowry <alexbl@FreeBSD.org>
Alexander Karpinsky <homm86@gmail.com>
Alexandre Vassalotti <avassalotti@gmail.com>
@@ -19,22 +21,27 @@ Daniel Andersson <kodandersson@gmail.com>
Daniel James <dnljms@gmail.com>
Dineel D Sule <dsule@codeaurora.org>
Erich Ocean <erich.ocean@me.com>
+Fedor Indutny <fedor@indutny.com>
Jan de Mooij <jandemooij@gmail.com>
Jay Freeman <saurik@saurik.com>
Joel Stanley <joel.stan@gmail.com>
John Jozwiak <jjozwiak@codeaurora.org>
Kun Zhang <zhangk@codeaurora.org>
-Matt Hanselman <mjhanselman@gmail.com>
Martyn Capewell <martyn.capewell@arm.com>
+Matt Hanselman <mjhanselman@gmail.com>
+Maxim Mossienko <maxim.mossienko@gmail.com>
Michael Smith <mike@w3.org>
Mike Gilbert <floppymaster@gmail.com>
Paolo Giarrusso <p.giarrusso@gmail.com>
Patrick Gansterer <paroga@paroga.com>
+Peter Varga <pvarga@inf.u-szeged.hu>
Rafal Krypa <rafal@krypa.net>
Rene Rebe <rene@exactcode.de>
+Robert Mustacchi <rm@fingolfin.org>
Rodolph Perfetta <rodolph.perfetta@arm.com>
Ryan Dahl <coldredlemur@gmail.com>
Sanjoy Das <sanjoy@playingwithpointers.com>
Subrato K De <subratokde@codeaurora.org>
Vlad Burlik <vladbph@gmail.com>
+Yuqiang Xian <yuqiang.xian@intel.com>
Zaheer Ahmad <zahmad@codeaurora.org>
View
727 ChangeLog
@@ -1,3 +1,727 @@
+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 <plind44@gmail.com>.
+
+ 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.
@@ -2564,3 +3288,6 @@
Initial export.
+# Local Variables:
+# mode:text
+# End:
View
182 Makefile
@@ -0,0 +1,182 @@
+# 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.
+
+
+# Variable default definitions. Override them by exporting them in your shell.
+CXX ?= "g++" # For distcc: export CXX="distcc g++"
+LINK ?= "g++"
+OUTDIR ?= out
+TESTJOBS ?= -j16
+GYPFLAGS ?=
+
+# 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
+# snapshot=off
+ifeq ($(snapshot), off)
+ GYPFLAGS += -Dv8_use_snapshot='false'
+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_vfp_instructions=false
+else
+ GYPFLAGS += -Dv8_can_use_vfp_instructions=true
+endif
+# soname_version=1.2.3
+ifdef soname_version
+ GYPFLAGS += -Dsoname_version=$(soname_version)
+endif
+
+# ----------------- available targets: --------------------
+# - "dependencies": pulls in external dependencies (currently: GYP)
+# - any arch listed in ARCHES (see below)
+# - any mode listed in MODES
+# - every combination <arch>.<mode>, e.g. "ia32.release"
+# - any of the above with .check appended, e.g. "ia32.release.check"
+# - default (no target specified): build all ARCHES and MODES
+# - "check": build all targets and run all tests
+# - "<arch>.clean" for any <arch> 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
+MODES = release debug
+
+# 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)))
+# Generates corresponding test targets, e.g. "ia32.release.check".
+CHECKS = $(addsuffix .check,$(BUILDS))
+# File where previously used GYPFLAGS are stored.
+ENVFILE = $(OUTDIR)/environment
+
+.PHONY: all check clean dependencies $(ENVFILE).new \
+ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \
+ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES))
+
+# Target definitions. "all" is the default.
+all: $(MODES)
+
+# Compile targets. MODES and ARCHES are convenience targets.
+.SECONDEXPANSION:
+$(MODES): $(addsuffix .$$@,$(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)/$@"
+
+# Test targets.
+check: all
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR)
+
+$(addsuffix .check,$(MODES)): $$(basename $$@)
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --mode=$(basename $@)
+
+$(addsuffix .check,$(ARCHES)): $$(basename $$@)
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch=$(basename $@)
+
+$(CHECKS): $$(basename $$@)
+ @tools/test-wrapper-gypbuild.py $(TESTJOBS) --outdir=$(OUTDIR) \
+ --arch-and-mode=$(basename $@)
+
+# Clean targets. You can clean each architecture individually, or everything.
+$(addsuffix .clean,$(ARCHES)):
+ rm -f $(OUTDIR)/Makefile-$(basename $@)
+ rm -rf $(OUTDIR)/$(basename $@).release
+ rm -rf $(OUTDIR)/$(basename $@).debug
+ find $(OUTDIR) -regex '.*\(host\|target\)-$(basename $@)\.mk' -delete
+
+clean: $(addsuffix .clean,$(ARCHES))
+
+# GYP file generation targets.
+$(OUTDIR)/Makefile-ia32: $(GYPFILES) $(ENVFILE)
+ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
+ -Ibuild/standalone.gypi --depth=. -Dtarget_arch=ia32 \
+ -S-ia32 $(GYPFLAGS)
+
+$(OUTDIR)/Makefile-x64: $(GYPFILES) $(ENVFILE)
+ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
+ -Ibuild/standalone.gypi --depth=. -Dtarget_arch=x64 \
+ -S-x64 $(GYPFLAGS)
+
+$(OUTDIR)/Makefile-arm: $(GYPFILES) $(ENVFILE)
+ build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \
+ -Ibuild/standalone.gypi --depth=. -Ibuild/armu.gypi \
+ -S-arm $(GYPFLAGS)
+
+# 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;
+
+# Dependencies.
+dependencies:
+ svn checkout --force http://gyp.googlecode.com/svn/trunk build/gyp \
+ --revision 1026
View
739 SConstruct
@@ -1,4 +1,4 @@
-# Copyright 2010 the V8 project authors. All rights reserved.
+# 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:
@@ -27,6 +27,7 @@
import platform
import re
+import subprocess
import sys
import os
from os.path import join, dirname, abspath
@@ -35,13 +36,6 @@ root_dir = dirname(File('SConstruct').rfile().abspath)
sys.path.insert(0, join(root_dir, 'tools'))
import js2c, utils
-# ANDROID_TOP is the top of the Android checkout, fetched from the environment
-# variable 'TOP'. You will also need to set the CXX, CC, AR and RANLIB
-# environment variables to the cross-compiling tools.
-ANDROID_TOP = os.environ.get('TOP')
-if ANDROID_TOP is None:
- ANDROID_TOP=""
-
# 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.
@@ -57,50 +51,6 @@ else:
GCC_EXTRA_CCFLAGS = []
GCC_DTOA_EXTRA_CCFLAGS = []
-ANDROID_FLAGS = ['-march=armv7-a',
- '-mtune=cortex-a8',
- '-mfloat-abi=softfp',
- '-mfpu=vfp',
- '-fpic',
- '-mthumb-interwork',
- '-funwind-tables',
- '-fstack-protector',
- '-fno-short-enums',
- '-fmessage-length=0',
- '-finline-functions',
- '-fno-inline-functions-called-once',
- '-fgcse-after-reload',
- '-frerun-cse-after-loop',
- '-frename-registers',
- '-fomit-frame-pointer',
- '-finline-limit=64',
- '-DCAN_USE_VFP_INSTRUCTIONS=1',
- '-DCAN_USE_ARMV7_INSTRUCTIONS=1',
- '-DCAN_USE_UNALIGNED_ACCESSES=1',
- '-MD']
-
-ANDROID_INCLUDES = [ANDROID_TOP + '/bionic/libc/arch-arm/include',
- ANDROID_TOP + '/bionic/libc/include',
- ANDROID_TOP + '/bionic/libstdc++/include',
- ANDROID_TOP + '/bionic/libc/kernel/common',
- ANDROID_TOP + '/bionic/libc/kernel/arch-arm',
- ANDROID_TOP + '/bionic/libm/include',
- ANDROID_TOP + '/bionic/libm/include/arch/arm',
- ANDROID_TOP + '/bionic/libthread_db/include',
- ANDROID_TOP + '/frameworks/base/include',
- ANDROID_TOP + '/system/core/include']
-
-ANDROID_LINKFLAGS = ['-nostdlib',
- '-Bdynamic',
- '-Wl,-T,' + ANDROID_TOP + '/build/core/armelf.x',
- '-Wl,-dynamic-linker,/system/bin/linker',
- '-Wl,--gc-sections',
- '-Wl,-z,nocopyreloc',
- '-Wl,-rpath-link=' + ANDROID_TOP + '/out/target/product/generic/obj/lib',
- ANDROID_TOP + '/out/target/product/generic/obj/lib/crtbegin_dynamic.o',
- ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a',
- ANDROID_TOP + '/out/target/product/generic/obj/lib/crtend_android.o'];
-
LIBRARY_FLAGS = {
'all': {
'CPPPATH': [join(root_dir, 'src')],
@@ -110,24 +60,18 @@ LIBRARY_FLAGS = {
'mode:debug': {
'CPPDEFINES': ['V8_ENABLE_CHECKS', 'OBJECT_PRINT']
},
- 'vmstate:on': {
- 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING'],
- },
'objectprint:on': {
'CPPDEFINES': ['OBJECT_PRINT'],
},
- 'protectheap:on': {
- 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_HEAP_PROTECTION'],
- },
- 'profilingsupport:on': {
- 'CPPDEFINES': ['ENABLE_VMSTATE_TRACKING', 'ENABLE_LOGGING_AND_PROFILING'],
- },
'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'],
@@ -136,26 +80,22 @@ LIBRARY_FLAGS = {
'gcc': {
'all': {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
- 'CXXFLAGS': ['$CCFLAGS', '-fno-rtti', '-fno-exceptions'],
+ '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'],
- 'os:android': {
- 'CCFLAGS': ['-mthumb']
- }
},
'mode:release': {
'CCFLAGS': ['-O3', '-fomit-frame-pointer', '-fdata-sections',
'-ffunction-sections'],
- 'os:android': {
- 'CCFLAGS': ['-mthumb', '-Os'],
- 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
- }
},
'os:linux': {
'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS,
@@ -174,6 +114,7 @@ LIBRARY_FLAGS = {
'CPPPATH' : ['/usr/local/include'],
'LIBPATH' : ['/usr/local/lib'],
'CCFLAGS': ['-ansi'],
+ 'LIBS': ['execinfo']
},
'os:openbsd': {
'CPPPATH' : ['/usr/local/include'],
@@ -192,14 +133,6 @@ LIBRARY_FLAGS = {
'CCFLAGS': ['-DWIN32'],
'CXXFLAGS': ['-DWIN32'],
},
- 'os:android': {
- 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
- '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
- 'CCFLAGS': ANDROID_FLAGS,
- 'WARNINGFLAGS': ['-Wall', '-Wno-unused', '-Werror=return-type',
- '-Wstrict-aliasing=2'],
- 'CPPPATH': ANDROID_INCLUDES,
- },
'arch:ia32': {
'CPPDEFINES': ['V8_TARGET_ARCH_IA32'],
'CCFLAGS': ['-m32'],
@@ -212,6 +145,30 @@ LIBRARY_FLAGS = {
},
'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': {
@@ -220,14 +177,40 @@ LIBRARY_FLAGS = {
},
'arch:mips': {
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
+ 'mips_arch_variant:mips32r2': {
+ 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
+ },
'simulator:none': {
- 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
- 'LDFLAGS': ['-EL']
+ 'CCFLAGS': ['-EL'],
+ 'LINKFLAGS': ['-EL'],
+ 'mips_arch_variant:mips32r2': {
+ 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
+ },
+ 'mips_arch_variant:mips32r1': {
+ 'CCFLAGS': ['-mips32', '-Wa,-mips32']
+ },
+ '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'],
+ },
+ 'mipsabi:hardfloat': {
+ 'CPPDEFINES': ['__mips_hard_float=1'],
+ }
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
@@ -236,12 +219,15 @@ LIBRARY_FLAGS = {
},
'gdbjit:on': {
'CPPDEFINES': ['ENABLE_GDB_JIT_INTERFACE']
+ },
+ 'compress_startup_data:bz2': {
+ 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2']
}
},
'msvc': {
'all': {
'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
- 'CXXFLAGS': ['$CCFLAGS', '/GR-', '/Gy'],
+ 'CXXFLAGS': ['/GR-', '/Gy'],
'CPPDEFINES': ['WIN32'],
'LINKFLAGS': ['/INCREMENTAL:NO', '/NXCOMPAT', '/IGNORE:4221'],
'CCPDBFLAGS': ['/Zi']
@@ -321,6 +307,11 @@ V8_EXTRA_FLAGS = {
'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']
}
@@ -341,6 +332,9 @@ V8_EXTRA_FLAGS = {
},
'arch:mips': {
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
+ 'mips_arch_variant:mips32r2': {
+ 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
+ },
},
'disassembler:on': {
'CPPDEFINES': ['ENABLE_DISASSEMBLER']
@@ -370,6 +364,11 @@ MKSNAPSHOT_EXTRA_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32'],
},
+ 'compress_startup_data:bz2': {
+ 'os:linux': {
+ 'LIBS': ['bz2']
+ }
+ },
},
'msvc': {
'all': {
@@ -398,13 +397,20 @@ DTOA_EXTRA_FLAGS = {
CCTEST_EXTRA_FLAGS = {
'all': {
'CPPPATH': [join(root_dir, 'src')],
+ 'library:shared': {
+ 'CPPDEFINES': ['USING_V8_SHARED']
+ },
},
'gcc': {
'all': {
- 'LIBPATH': [abspath('.')]
+ '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'],
@@ -422,19 +428,6 @@ CCTEST_EXTRA_FLAGS = {
'os:win32': {
'LIBS': ['winmm', 'ws2_32']
},
- 'os:android': {
- 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
- '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
- 'CCFLAGS': ANDROID_FLAGS,
- 'CPPPATH': ANDROID_INCLUDES,
- 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
- ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
- 'LINKFLAGS': ANDROID_LINKFLAGS,
- 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
- 'mode:release': {
- 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
- }
- },
'arch:arm': {
'LINKFLAGS': ARM_LINK_FLAGS
},
@@ -444,15 +437,12 @@ CCTEST_EXTRA_FLAGS = {
'CPPDEFINES': ['_HAS_EXCEPTIONS=0'],
'LIBS': ['winmm', 'ws2_32']
},
- 'library:shared': {
- 'CPPDEFINES': ['USING_V8_SHARED']
- },
'arch:ia32': {
'CPPDEFINES': ['V8_TARGET_ARCH_IA32']
},
'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
- 'LINKFLAGS': ['/STACK:2091752']
+ 'LINKFLAGS': ['/STACK:2097152']
},
}
}
@@ -461,11 +451,16 @@ CCTEST_EXTRA_FLAGS = {
SAMPLE_FLAGS = {
'all': {
'CPPPATH': [join(abspath('.'), 'include')],
+ 'library:shared': {
+ 'CPPDEFINES': ['USING_V8_SHARED']
+ },
},
'gcc': {
'all': {
- 'LIBPATH': ['.'],
- 'CCFLAGS': ['-fno-rtti', '-fno-exceptions']
+ 'LIBPATH': ['.'],
+ 'CCFLAGS': ['$DIALECTFLAGS', '$WARNINGFLAGS'],
+ 'CXXFLAGS': ['-fno-rtti', '-fno-exceptions'],
+ 'LINKFLAGS': ['$CCFLAGS'],
},
'os:linux': {
'LIBS': ['pthread'],
@@ -474,36 +469,47 @@ SAMPLE_FLAGS = {
'LIBS': ['pthread'],
},
'os:freebsd': {
- 'LIBPATH' : ['/usr/local/lib'],
- 'LIBS': ['execinfo', 'pthread']
+ 'LIBPATH' : ['/usr/local/lib'],
+ 'LIBS': ['execinfo', 'pthread']
},
'os:solaris': {
- 'LIBPATH' : ['/usr/local/lib'],
- 'LIBS': ['m', 'pthread', 'socket', 'nsl', 'rt'],
- 'LINKFLAGS': ['-mt']
+ # 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']
+ 'LIBPATH' : ['/usr/local/lib'],
+ 'LIBS': ['execinfo', 'pthread']
},
'os:win32': {
'LIBS': ['winmm', 'ws2_32']
},
- 'os:android': {
- 'CPPDEFINES': ['ANDROID', '__ARM_ARCH_5__', '__ARM_ARCH_5T__',
- '__ARM_ARCH_5E__', '__ARM_ARCH_5TE__'],
- 'CCFLAGS': ANDROID_FLAGS,
- 'CPPPATH': ANDROID_INCLUDES,
- 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
- ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
- 'LINKFLAGS': ANDROID_LINKFLAGS,
- 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
- 'mode:release': {
- 'CPPDEFINES': ['SK_RELEASE', 'NDEBUG']
- }
- },
'arch:arm': {
- 'LINKFLAGS': ARM_LINK_FLAGS
+ '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'],
@@ -515,10 +521,29 @@ SAMPLE_FLAGS = {
},
'arch:mips': {
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
+ 'mips_arch_variant:mips32r2': {
+ 'CPPDEFINES': ['_MIPS_ARCH_MIPS32R2']
+ },
'simulator:none': {
- 'CCFLAGS': ['-EL', '-mips32r2', '-Wa,-mips32r2', '-fno-inline'],
+ 'CCFLAGS': ['-EL'],
'LINKFLAGS': ['-EL'],
- 'LDFLAGS': ['-EL']
+ 'mips_arch_variant:mips32r2': {
+ 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
+ },
+ 'mips_arch_variant:mips32r1': {
+ 'CCFLAGS': ['-mips32', '-Wa,-mips32']
+ },
+ 'library:static': {
+ 'LINKFLAGS': ['-static', '-static-libgcc']
+ },
+ 'mipsabi:softfloat': {
+ 'CCFLAGS': ['-msoft-float'],
+ 'LINKFLAGS': ['-msoft-float']
+ },
+ 'mipsabi:hardfloat': {
+ 'CCFLAGS': ['-mhard-float'],
+ 'LINKFLAGS': ['-mhard-float']
+ }
}
},
'simulator:arm': {
@@ -536,6 +561,12 @@ SAMPLE_FLAGS = {
'CCFLAGS': ['-g', '-O0'],
'CPPDEFINES': ['DEBUG']
},
+ 'compress_startup_data:bz2': {
+ 'CPPDEFINES': ['COMPRESS_STARTUP_DATA_BZ2'],
+ 'os:linux': {
+ 'LIBS': ['bz2']
+ }
+ },
},
'msvc': {
'all': {
@@ -548,9 +579,161 @@ SAMPLE_FLAGS = {
'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(abspath('.'), 'include'), join(abspath('.'), 'src')],
'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']
+ },
+ 'simulator:none': {
+ 'CCFLAGS': ['-EL'],
+ 'LINKFLAGS': ['-EL'],
+ 'mips_arch_variant:mips32r2': {
+ 'CCFLAGS': ['-mips32r2', '-Wa,-mips32r2']
+ },
+ 'mips_arch_variant:mips32r1': {
+ 'CCFLAGS': ['-mips32', '-Wa,-mips32']
+ },
+ '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']
},
@@ -577,12 +760,12 @@ SAMPLE_FLAGS = {
}
},
'arch:ia32': {
- 'CPPDEFINES': ['V8_TARGET_ARCH_IA32'],
+ 'CPPDEFINES': ['V8_TARGET_ARCH_IA32', 'WIN32'],
'LINKFLAGS': ['/MACHINE:X86']
},
'arch:x64': {
- 'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
- 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2091752']
+ 'CPPDEFINES': ['V8_TARGET_ARCH_X64', 'WIN32'],
+ 'LINKFLAGS': ['/MACHINE:X64', '/STACK:2097152']
},
'mode:debug': {
'CCFLAGS': ['/Od'],
@@ -600,7 +783,19 @@ SAMPLE_FLAGS = {
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']
},
@@ -620,22 +815,73 @@ D8_FLAGS = {
'os:openbsd': {
'LIBS': ['pthread'],
},
- 'os:android': {
- 'LIBPATH': [ANDROID_TOP + '/out/target/product/generic/obj/lib',
- ANDROID_TOP + '/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0/interwork'],
- 'LINKFLAGS': ANDROID_LINKFLAGS,
- 'LIBS': ['log', 'c', 'stdc++', 'm', 'gcc'],
- },
'os:win32': {
'LIBS': ['winmm', 'ws2_32'],
},
'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']
+ }
}
}
}
@@ -652,8 +898,16 @@ def Abort(message):
sys.exit(1)
-def GuessToolchain(os):
- tools = Environment()['TOOLS']
+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:
@@ -662,7 +916,9 @@ def GuessToolchain(os):
return None
-def GuessVisibility(os, toolchain):
+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'
@@ -672,28 +928,41 @@ def GuessVisibility(os, toolchain):
return 'hidden'
-OS_GUESS = utils.GuessOS()
-TOOLCHAIN_GUESS = GuessToolchain(OS_GUESS)
-ARCH_GUESS = utils.GuessArchitecture()
-VISIBILITY_GUESS = GuessVisibility(OS_GUESS, TOOLCHAIN_GUESS)
+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'
-SIMPLE_OPTIONS = {
- 'toolchain': {
- 'values': ['gcc', 'msvc'],
- 'default': TOOLCHAIN_GUESS,
- 'help': 'the toolchain to use (%s)' % TOOLCHAIN_GUESS
+PLATFORM_OPTIONS = {
+ 'arch': {
+ 'values': ['arm', 'ia32', 'x64', 'mips'],
+ 'guess': GuessArch,
+ 'help': 'the architecture to build for'
},
'os': {
- 'values': ['freebsd', 'linux', 'macos', 'win32', 'android', 'openbsd', 'solaris', 'cygwin'],
- 'default': OS_GUESS,
- 'help': 'the os to build for (%s)' % OS_GUESS
- },
- 'arch': {
- 'values':['arm', 'ia32', 'x64', 'mips'],
- 'default': ARCH_GUESS,
- 'help': 'the architecture to build for (%s)' % ARCH_GUESS
+ 'values': ['freebsd', 'linux', 'macos', 'win32', 'openbsd', 'solaris', 'cygwin'],
+ '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',
@@ -719,21 +988,11 @@ SIMPLE_OPTIONS = {
'default': 'static',
'help': 'the type of library to produce'
},
- 'vmstate': {
- 'values': ['on', 'off'],
- 'default': 'off',
- 'help': 'enable VM state tracking'
- },
'objectprint': {
'values': ['on', 'off'],
'default': 'off',
'help': 'enable object printing'
},
- 'protectheap': {
- 'values': ['on', 'off'],
- 'default': 'off',
- 'help': 'enable heap protection'
- },
'profilingsupport': {
'values': ['on', 'off'],
'default': 'on',
@@ -784,6 +1043,12 @@ SIMPLE_OPTIONS = {
'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',
@@ -801,16 +1066,63 @@ SIMPLE_OPTIONS = {
},
'visibility': {
'values': ['default', 'hidden'],
- 'default': VISIBILITY_GUESS,
- 'help': 'shared library symbol visibility (%s)' % VISIBILITY_GUESS
+ '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'],
+ '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]'
+ },
+
}
+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()
@@ -819,12 +1131,23 @@ def GetOptions():
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,...)', '')
- for (name, option) in SIMPLE_OPTIONS.iteritems():
- help = '%s (%s)' % (name, ", ".join(option['values']))
- result.Add(name, help, option.get('default'))
+ 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+(.*)")
@@ -890,8 +1213,8 @@ def VerifyOptions(env):
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' 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 target.")
+ 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':
@@ -904,8 +1227,10 @@ def VerifyOptions(env):
print env['arch']
print env['simulator']
Abort("Option unalignedaccesses only supported for the ARM architecture.")
- for (name, option) in SIMPLE_OPTIONS.iteritems():
- if (not option.get('default')) and (name not in ARGUMENTS):
+ 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)
@@ -926,6 +1251,7 @@ class BuildContext(object):
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
@@ -1004,11 +1330,8 @@ def PostprocessOptions(options, os):
if 'msvcltcg' in ARGUMENTS:
print "Warning: forcing msvcltcg on as it is required for pgo (%s)" % options['pgo']
options['msvcltcg'] = 'on'
- if options['arch'] == 'mips':
- if ('regexp' in ARGUMENTS) and options['regexp'] == 'native':
- # Print a warning if native regexp is specified for mips
- print "Warning: forcing regexp to interpreted for mips"
- options['regexp'] = 'interpreted'
+ 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
@@ -1033,9 +1356,9 @@ def ParseEnvOverrides(arg, imports):
return overrides
-def BuildSpecific(env, mode, env_overrides):
+def BuildSpecific(env, mode, env_overrides, tools):
options = {'mode': mode}
- for option in SIMPLE_OPTIONS:
+ for option in ALL_OPTIONS:
options[option] = env[option]
PostprocessOptions(options, env['os'])
@@ -1055,6 +1378,7 @@ def BuildSpecific(env, mode, env_overrides):
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 = {
@@ -1063,13 +1387,15 @@ def BuildSpecific(env, mode, env_overrides):
'dtoa': dtoa_flags,
'cctest': cctest_flags,
'sample': sample_flags,
- 'd8': d8_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.
@@ -1083,10 +1409,12 @@ def BuildSpecific(env, mode, env_overrides):
env['SONAME'] = soname
# Build the object files by invoking SCons recursively.
- (object_files, shell_files, mksnapshot) = env.SConscript(
+ 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',
+ exports='context tools d8_env',
duplicate=False
)
@@ -1098,29 +1426,40 @@ def BuildSpecific(env, mode, env_overrides):
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)
- d8_env = Environment()
- d8_env.Replace(**context.flags['d8'])
context.ApplyEnvOverrides(d8_env)
- shell = d8_env.Program('d8' + suffix, object_files + shell_files)
+ 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()
+ 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',
+ exports='sample context tools',
duplicate=False
)
sample_name = sample + suffix
@@ -1133,17 +1472,34 @@ def BuildSpecific(env, mode, env_overrides):
cctest_program = cctest_env.SConscript(
join('test', 'cctest', 'SConscript'),
build_dir=join('obj', 'test', target_id),
- exports='context object_files',
+ 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)