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.


git-svn-id: http://v8.googlecode.com/svn/trunk@60 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/compiler.cc b/src/compiler.cc
index 4869b30..7d2e661 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -48,28 +48,6 @@
 #endif
 
 
-// Helper class to keep track of compilation nesting and to do proper
-// cleanups of generated ASTs.
-class CompilationTracker BASE_EMBEDDED {
- public:
-  CompilationTracker() {
-    ++nesting_;
-  }
-
-  ~CompilationTracker() {
-    // If we're leaving the top-level compilation, we must make sure
-    // to get rid of all generated ASTs.
-    if (--nesting_ == 0) Zone::DeleteAll();
-  }
-
- private:
-  static int nesting_;
-};
-
-
-int CompilationTracker::nesting_ = 0;
-
-
 static Handle<Code> MakeCode(FunctionLiteral* literal,
                              Handle<Script> script,
                              bool is_eval) {
@@ -108,7 +86,7 @@
                                        Handle<Script> script,
                                        v8::Extension* extension,
                                        ScriptDataImpl* pre_data) {
-  CompilationTracker tracker;
+  ZoneScope zone_scope(DELETE_ON_EXIT);
 
   // Make sure we have an initial stack limit.
   StackGuard guard;
@@ -158,6 +136,7 @@
   Handle<JSFunction> fun =
       Factory::NewFunctionBoilerplate(lit->name(),
                                       lit->materialized_literal_count(),
+                                      lit->contains_array_literal(),
                                       code);
 
   CodeGenerator::SetFunctionInfo(fun, lit->scope()->num_parameters(),
@@ -231,7 +210,7 @@
 
 
 bool Compiler::CompileLazy(Handle<SharedFunctionInfo> shared) {
-  CompilationTracker tracker;
+  ZoneScope zone_scope(DELETE_ON_EXIT);
 
   // The VM is in the COMPILER state until exiting this function.
   VMState state(COMPILER);