Author: [EMAIL PROTECTED]
Date: Mon Sep  8 02:26:02 2008
New Revision: 199

Removed:
    changes/[EMAIL PROTECTED]/fix-no-snapshot-tests/
Modified:
    branches/bleeding_edge/src/snapshot.h
    branches/bleeding_edge/test/cctest/test-api.cc
    branches/bleeding_edge/test/cctest/test-mark-compact.cc
    branches/bleeding_edge/test/cctest/test-serialize.cc
    branches/bleeding_edge/test/mjsunit/debug-script.js

Log:
Fix issues with running some of our tests with an embedded
snapshot. Changed the debug-script.js test to ignore the
exact number of extension scripts.


Modified: branches/bleeding_edge/src/snapshot.h
==============================================================================
--- branches/bleeding_edge/src/snapshot.h       (original)
+++ branches/bleeding_edge/src/snapshot.h       Mon Sep  8 02:26:02 2008
@@ -37,8 +37,8 @@
    // could be found.
    static bool Initialize(const char* snapshot_file = NULL);

-  // Disable the use of the internal snapshot.
-  static void DisableInternal() { size_ = 0; }
+  // Returns whether or not the snapshot is enabled.
+  static bool IsEnabled() { return size_ != 0; }

    // Write snapshot to the given file. Returns true if snapshot was written
    // successfully.

Modified: branches/bleeding_edge/test/cctest/test-api.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-api.cc      (original)
+++ branches/bleeding_edge/test/cctest/test-api.cc      Mon Sep  8 02:26:02 2008
@@ -1429,7 +1429,7 @@
  // that come after them so they cannot run in parallel.
  DISABLED_TEST(OutOfMemory) {
    // It's not possible to read a snapshot into a heap with different  
dimensions.
-  v8::internal::Snapshot::DisableInternal();
+  if (v8::internal::Snapshot::IsEnabled()) return;
    // Set heap limits.
    static const int K = 1024;
    v8::ResourceConstraints constraints;
@@ -1470,7 +1470,7 @@

  DISABLED_TEST(OutOfMemoryNested) {
    // It's not possible to read a snapshot into a heap with different  
dimensions.
-  v8::internal::Snapshot::DisableInternal();
+  if (v8::internal::Snapshot::IsEnabled()) return;
    // Set heap limits.
    static const int K = 1024;
    v8::ResourceConstraints constraints;
@@ -1499,7 +1499,7 @@

  TEST(HugeConsStringOutOfMemory) {
    // It's not possible to read a snapshot into a heap with different  
dimensions.
-  v8::internal::Snapshot::DisableInternal();
+  if (v8::internal::Snapshot::IsEnabled()) return;
    v8::HandleScope scope;
    LocalContext context;
    // Set heap limits.
@@ -4716,6 +4716,8 @@
    // Regression test for issues 1139850 and 1174891.

    v8::internal::V8::Initialize(NULL);
+  if (v8::internal::Snapshot::IsEnabled()) return;
+
    EnsureNoSurvivingGlobalObjects();

    for (int i = 0; i < 5; i++) {
@@ -4757,6 +4759,7 @@

  THREADED_TEST(CheckForCrossContextObjectLiterals) {
    v8::internal::V8::Initialize(NULL);
+  if (v8::internal::Snapshot::IsEnabled()) return;

    const int nof = 2;
    const char* sources[nof] = {

Modified: branches/bleeding_edge/test/cctest/test-mark-compact.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-mark-compact.cc     (original)
+++ branches/bleeding_edge/test/cctest/test-mark-compact.cc     Mon Sep  8  
02:26:02 2008
@@ -78,12 +78,12 @@
  TEST(Promotion) {
    // Test the situation that some objects in new space are promoted to the
    // old space
+  if (Snapshot::IsEnabled()) return;

    // Ensure that we get a compacting collection so that objects are  
promoted
    // from new space.
    FLAG_gc_global = true;
    FLAG_always_compact = true;
-  Snapshot::DisableInternal();
    Heap::ConfigureHeap(2*256*KB, 4*MB);

    InitializeVM();
@@ -110,7 +110,7 @@


  TEST(NoPromotion) {
-  Snapshot::DisableInternal();
+  if (Snapshot::IsEnabled()) return;
    Heap::ConfigureHeap(2*256*KB, 4*MB);

    // Test the situation that some objects in new space are promoted to

Modified: branches/bleeding_edge/test/cctest/test-serialize.cc
==============================================================================
--- branches/bleeding_edge/test/cctest/test-serialize.cc        (original)
+++ branches/bleeding_edge/test/cctest/test-serialize.cc        Mon Sep  8  
02:26:02 2008
@@ -191,14 +191,14 @@
  // bootstrapped heap.
  // (Smoke test.)
  TEST(Serialize) {
-  Snapshot::DisableInternal();
+  if (Snapshot::IsEnabled()) return;
    Serialize();
  }


  // Test that the heap isn't destroyed after a serialization.
  TEST(SerializeNondestructive) {
-  Snapshot::DisableInternal();
+  if (Snapshot::IsEnabled()) return;
    StatsTable::SetCounterFunction(counter_function);
    v8::HandleScope scope;
    v8::Persistent<v8::Context> env = v8::Context::New();

Modified: branches/bleeding_edge/test/mjsunit/debug-script.js
==============================================================================
--- branches/bleeding_edge/test/mjsunit/debug-script.js (original)
+++ branches/bleeding_edge/test/mjsunit/debug-script.js Mon Sep  8 02:26:02  
2008
@@ -53,9 +53,8 @@
    }
  }

-// This has to be updated if the number of native and extension scripts  
change.
+// This has to be updated if the number of native scripts change.
  assertEquals(12, native_count);
-assertEquals(1, extension_count);
  assertEquals(2, normal_count);  // This script and mjsunit.js.

  // Test a builtins script.
@@ -75,8 +74,10 @@

  // Test an extension script.
  var extension_gc_script = Debug.findScript('v8/gc');
-assertEquals('v8/gc', extension_gc_script.name);
-assertEquals(Debug.ScriptType.Extension, extension_gc_script.type);
+if (extension_gc_script) {
+  assertEquals('v8/gc', extension_gc_script.name);
+  assertEquals(Debug.ScriptType.Extension, extension_gc_script.type);
+}

  // Test a normal script.
  var mjsunit_js_script = Debug.findScript(/mjsunit.js/);

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to