Revision: 10840
Author:   [email protected]
Date:     Mon Feb 27 03:46:55 2012
Log:      Version 3.9.11

Make 'module' a context-sensitive keyword (V8 issue 1957).
http://code.google.com/p/v8/source/detail?r=10840

Modified:
 /trunk/ChangeLog
 /trunk/src/arm/full-codegen-arm.cc
 /trunk/src/compiler.cc
 /trunk/src/debug.cc
 /trunk/src/flag-definitions.h
 /trunk/src/full-codegen.cc
 /trunk/src/full-codegen.h
 /trunk/src/heap.h
 /trunk/src/hydrogen.cc
 /trunk/src/ia32/full-codegen-ia32.cc
 /trunk/src/ic.cc
 /trunk/src/mips/full-codegen-mips.cc
 /trunk/src/objects-inl.h
 /trunk/src/objects.h
 /trunk/src/parser.cc
 /trunk/src/profile-generator.cc
 /trunk/src/scanner.cc
 /trunk/src/token.h
 /trunk/src/version.cc
 /trunk/src/x64/full-codegen-x64.cc
 /trunk/test/cctest/test-heap-profiler.cc
 /trunk/test/mjsunit/harmony/module-parsing.js
 /trunk/test/test262/test262.status

=======================================
--- /trunk/ChangeLog    Fri Feb 24 06:41:46 2012
+++ /trunk/ChangeLog    Mon Feb 27 03:46:55 2012
@@ -1,3 +1,8 @@
+2012-02-27: Version 3.9.11
+
+        Make 'module' a context-sensitive keyword (V8 issue 1957).
+
+
 2012-02-24: Version 3.9.10

         Fixed V8 issues 1322, 1772 and 1969.
=======================================
--- /trunk/src/arm/full-codegen-arm.cc  Thu Feb 23 00:45:21 2012
+++ /trunk/src/arm/full-codegen-arm.cc  Mon Feb 27 03:46:55 2012
@@ -109,6 +109,11 @@
 };


+int FullCodeGenerator::self_optimization_header_size() {
+  return 24;
+}
+
+
 // Generate code for a JS function.  On entry to the function the receiver
 // and arguments have been pushed on the stack left to right.  The actual
 // argument count matches the formal parameter count expected by the
@@ -130,13 +135,6 @@
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");

-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    __ stop("stop-at");
-  }
-#endif
-
   // We can optionally optimize based on counters rather than statistical
   // sampling.
   if (info->ShouldSelfOptimize()) {
@@ -144,6 +142,7 @@
       PrintF("[adding self-optimization header to %s]\n",
              *info->function()->debug_name()->ToCString());
     }
+    has_self_optimization_header_ = true;
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
         Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
     JSGlobalPropertyCell* cell;
@@ -155,8 +154,16 @@
       Handle<Code> compile_stub(
           isolate()->builtins()->builtin(Builtins::kLazyRecompile));
       __ Jump(compile_stub, RelocInfo::CODE_TARGET, eq);
+      ASSERT(masm_->pc_offset() == self_optimization_header_size());
     }
   }
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ stop("stop-at");
+  }
+#endif

   // Strict mode functions and builtins need to replace the receiver
   // with undefined when called as functions (without an explicit
=======================================
--- /trunk/src/compiler.cc      Tue Feb 21 02:08:21 2012
+++ /trunk/src/compiler.cc      Mon Feb 27 03:46:55 2012
@@ -118,6 +118,7 @@
       FLAG_crankshaft &&
       !Serializer::enabled() &&
       !function()->flags()->Contains(kDontSelfOptimize) &&
+      !function()->flags()->Contains(kDontOptimize) &&
       (shared_info().is_null() || !shared_info()->optimization_disabled());
 }

=======================================
--- /trunk/src/debug.cc Mon Feb  6 02:12:55 2012
+++ /trunk/src/debug.cc Mon Feb 27 03:46:55 2012
@@ -37,6 +37,7 @@
 #include "debug.h"
 #include "deoptimizer.h"
 #include "execution.h"
+#include "full-codegen.h"
 #include "global-handles.h"
 #include "ic.h"
 #include "ic-inl.h"
@@ -1752,7 +1753,6 @@
     ASSERT(new_code->has_debug_break_slots());
     ASSERT(current_code->is_compiled_optimizable() ==
            new_code->is_compiled_optimizable());
- ASSERT(current_code->instruction_size() <= new_code->instruction_size());
   }
 #endif
   return result;
@@ -1830,6 +1830,13 @@
       // break slots.
       debug_break_slot_count++;
     }
+    if (frame_code->has_self_optimization_header() &&
+        !new_code->has_self_optimization_header()) {
+      delta -= FullCodeGenerator::self_optimization_header_size();
+    } else {
+      ASSERT(frame_code->has_self_optimization_header() ==
+             new_code->has_self_optimization_header());
+    }
     int debug_break_slot_bytes =
         debug_break_slot_count * Assembler::kDebugBreakSlotLength;
     if (FLAG_trace_deopt) {
=======================================
--- /trunk/src/flag-definitions.h       Thu Feb 23 00:45:21 2012
+++ /trunk/src/flag-definitions.h       Mon Feb 27 03:46:55 2012
@@ -169,6 +169,9 @@
 DEFINE_bool(optimize_closures, true, "optimize closures")
 DEFINE_int(loop_weight, 1, "loop weight for representation inference")

+DEFINE_bool(optimize_for_in, false,
+            "optimize functions containing for-in loops")
+
 // Experimental profiler changes.
DEFINE_bool(experimental_profiler, false, "enable all profiler experiments")
 DEFINE_bool(watch_ic_patching, false, "profiler considers IC stability")
=======================================
--- /trunk/src/full-codegen.cc  Tue Feb 21 02:08:21 2012
+++ /trunk/src/full-codegen.cc  Mon Feb 27 03:46:55 2012
@@ -302,6 +302,7 @@
   Code::Flags flags = Code::ComputeFlags(Code::FUNCTION);
   Handle<Code> code = CodeGenerator::MakeCodeEpilogue(&masm, flags, info);
   code->set_optimizable(info->IsOptimizable());
+  code->set_self_optimization_header(cgen.has_self_optimization_header_);
   cgen.PopulateDeoptimizationData(code);
   cgen.PopulateTypeFeedbackInfo(code);
   cgen.PopulateTypeFeedbackCells(code);
@@ -365,6 +366,7 @@
 void FullCodeGenerator::PopulateTypeFeedbackInfo(Handle<Code> code) {
Handle<TypeFeedbackInfo> info = isolate()->factory()->NewTypeFeedbackInfo();
   info->set_ic_total_count(ic_total_count_);
+  ASSERT(!isolate()->heap()->InNewSpace(*info));
   code->set_type_feedback_info(*info);
 }

=======================================
--- /trunk/src/full-codegen.h   Thu Feb 23 00:45:21 2012
+++ /trunk/src/full-codegen.h   Mon Feb 27 03:46:55 2012
@@ -90,10 +90,15 @@
         stack_checks_(2),  // There's always at least one.
         type_feedback_cells_(info->HasDeoptimizationSupport()
                              ? info->function()->ast_node_count() : 0),
-        ic_total_count_(0) { }
+        ic_total_count_(0),
+        has_self_optimization_header_(false) { }

   static bool MakeCode(CompilationInfo* info);

+  // Returns the platform-specific size in bytes of the self-optimization
+  // header.
+  static int self_optimization_header_size();
+
   // Encode state and pc-offset as a BitField<type, start, size>.
   // Only use 30 bits because we encode the result as a smi.
   class StateField : public BitField<State, 0, 1> { };
@@ -786,6 +791,7 @@
   ZoneList<BailoutEntry> stack_checks_;
   ZoneList<TypeFeedbackCellEntry> type_feedback_cells_;
   int ic_total_count_;
+  bool has_self_optimization_header_;
   Handle<FixedArray> handler_table_;
   Handle<JSGlobalPropertyCell> profiling_counter_;

=======================================
--- /trunk/src/heap.h   Fri Feb 24 06:41:46 2012
+++ /trunk/src/heap.h   Mon Feb 27 03:46:55 2012
@@ -177,6 +177,7 @@
   V(eval_symbol, "eval")                                                 \
   V(function_symbol, "function")                                         \
   V(length_symbol, "length")                                             \
+  V(module_symbol, "module")                                             \
   V(name_symbol, "name")                                                 \
   V(native_symbol, "native")                                             \
   V(null_symbol, "null")                                                 \
=======================================
--- /trunk/src/hydrogen.cc      Fri Feb 24 06:41:46 2012
+++ /trunk/src/hydrogen.cc      Mon Feb 27 03:46:55 2012
@@ -3242,6 +3242,10 @@
   ASSERT(current_block() != NULL);
   ASSERT(current_block()->HasPredecessor());

+  if (!FLAG_optimize_for_in) {
+    return Bailout("ForInStatement optimization is disabled");
+  }
+
   if (!stmt->each()->IsVariableProxy() ||
       !stmt->each()->AsVariableProxy()->var()->IsStackLocal()) {
     return Bailout("ForInStatement with non-local each variable");
=======================================
--- /trunk/src/ia32/full-codegen-ia32.cc        Thu Feb 23 00:45:21 2012
+++ /trunk/src/ia32/full-codegen-ia32.cc        Mon Feb 27 03:46:55 2012
@@ -100,6 +100,11 @@
 };


+int FullCodeGenerator::self_optimization_header_size() {
+  return 13;
+}
+
+
 // Generate code for a JS function.  On entry to the function the receiver
 // and arguments have been pushed on the stack left to right, with the
 // return address on top of them.  The actual argument count matches the
@@ -122,13 +127,6 @@
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");

-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    __ int3();
-  }
-#endif
-
   // We can optionally optimize based on counters rather than statistical
   // sampling.
   if (info->ShouldSelfOptimize()) {
@@ -136,6 +134,7 @@
       PrintF("[adding self-optimization header to %s]\n",
              *info->function()->debug_name()->ToCString());
     }
+    has_self_optimization_header_ = true;
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
         Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
     JSGlobalPropertyCell* cell;
@@ -146,8 +145,16 @@
           isolate()->builtins()->builtin(Builtins::kLazyRecompile));
       STATIC_ASSERT(kSmiTag == 0);
       __ j(zero, compile_stub);
+      ASSERT(masm_->pc_offset() == self_optimization_header_size());
     }
   }
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ int3();
+  }
+#endif

   // Strict mode functions and builtins need to replace the receiver
   // with undefined when called as functions (without an explicit
@@ -335,7 +342,15 @@
       int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target);
       weight = Min(127, Max(1, distance / 100));
     }
- __ sub(Operand::Cell(profiling_counter_), Immediate(Smi::FromInt(weight)));
+    if (Serializer::enabled()) {
+      __ mov(ebx, Immediate(profiling_counter_));
+      __ sub(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+             Immediate(Smi::FromInt(weight)));
+    } else {
+      // This version is slightly faster, but not snapshot safe.
+      __ sub(Operand::Cell(profiling_counter_),
+             Immediate(Smi::FromInt(weight)));
+    }
     __ j(positive, &ok, Label::kNear);
     InterruptStub stub;
     __ CallStub(&stub);
@@ -365,8 +380,14 @@

   if (FLAG_count_based_interrupts) {
     // Reset the countdown.
-    __ mov(Operand::Cell(profiling_counter_),
-           Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+    if (Serializer::enabled()) {
+      __ mov(ebx, Immediate(profiling_counter_));
+      __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+             Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+    } else {
+      __ mov(Operand::Cell(profiling_counter_),
+             Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+    }
   }

   __ bind(&ok);
@@ -396,8 +417,15 @@
         int distance = masm_->pc_offset();
         weight = Min(127, Max(1, distance / 100));
       }
-      __ sub(Operand::Cell(profiling_counter_),
-             Immediate(Smi::FromInt(weight)));
+      if (Serializer::enabled()) {
+        __ mov(ebx, Immediate(profiling_counter_));
+        __ sub(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+               Immediate(Smi::FromInt(weight)));
+      } else {
+        // This version is slightly faster, but not snapshot safe.
+        __ sub(Operand::Cell(profiling_counter_),
+               Immediate(Smi::FromInt(weight)));
+      }
       Label ok;
       __ j(positive, &ok, Label::kNear);
       __ push(eax);
@@ -405,8 +433,14 @@
       __ CallStub(&stub);
       __ pop(eax);
       // Reset the countdown.
-      __ mov(Operand::Cell(profiling_counter_),
-             Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+      if (Serializer::enabled()) {
+        __ mov(ebx, Immediate(profiling_counter_));
+        __ mov(FieldOperand(ebx, JSGlobalPropertyCell::kValueOffset),
+               Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+      } else {
+        __ mov(Operand::Cell(profiling_counter_),
+               Immediate(Smi::FromInt(FLAG_interrupt_budget)));
+      }
       __ bind(&ok);
     }
 #ifdef DEBUG
=======================================
--- /trunk/src/ic.cc    Fri Feb 24 06:41:46 2012
+++ /trunk/src/ic.cc    Mon Feb 27 03:46:55 2012
@@ -315,10 +315,13 @@
       if (delta != 0) {
         Code* host = target->GetHeap()->isolate()->
             inner_pointer_to_code_cache()->GetCacheEntry(address)->code;
-        TypeFeedbackInfo* info =
-            TypeFeedbackInfo::cast(host->type_feedback_info());
-        info->set_ic_with_typeinfo_count(
-            info->ic_with_typeinfo_count() + delta);
+        // Not all Code objects have TypeFeedbackInfo.
+        if (host->type_feedback_info()->IsTypeFeedbackInfo()) {
+          TypeFeedbackInfo* info =
+              TypeFeedbackInfo::cast(host->type_feedback_info());
+          info->set_ic_with_typeinfo_count(
+              info->ic_with_typeinfo_count() + delta);
+        }
       }
     }
   }
=======================================
--- /trunk/src/mips/full-codegen-mips.cc        Thu Feb 23 00:45:21 2012
+++ /trunk/src/mips/full-codegen-mips.cc        Mon Feb 27 03:46:55 2012
@@ -119,6 +119,11 @@
 };


+int FullCodeGenerator::self_optimization_header_size() {
+  return 0;  // TODO(jkummerow): determine correct value.
+}
+
+
 // Generate code for a JS function.  On entry to the function the receiver
 // and arguments have been pushed on the stack left to right.  The actual
 // argument count matches the formal parameter count expected by the
@@ -140,13 +145,6 @@
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");

-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    __ stop("stop-at");
-  }
-#endif
-
   // We can optionally optimize based on counters rather than statistical
   // sampling.
   if (info->ShouldSelfOptimize()) {
@@ -154,6 +152,7 @@
       PrintF("[adding self-optimization header to %s]\n",
              *info->function()->debug_name()->ToCString());
     }
+    has_self_optimization_header_ = true;
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
         Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
     JSGlobalPropertyCell* cell;
@@ -165,8 +164,16 @@
       Handle<Code> compile_stub(
           isolate()->builtins()->builtin(Builtins::kLazyRecompile));
__ Jump(compile_stub, RelocInfo::CODE_TARGET, eq, a3, Operand(zero_reg));
+      ASSERT(masm_->pc_offset() == self_optimization_header_size());
     }
   }
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ stop("stop-at");
+  }
+#endif

   // Strict mode functions and builtins need to replace the receiver
   // with undefined when called as functions (without an explicit
=======================================
--- /trunk/src/objects-inl.h    Fri Feb 24 06:41:46 2012
+++ /trunk/src/objects-inl.h    Mon Feb 27 03:46:55 2012
@@ -3087,6 +3087,21 @@
   flags = FullCodeFlagsIsCompiledOptimizable::update(flags, value);
   WRITE_BYTE_FIELD(this, kFullCodeFlags, flags);
 }
+
+
+bool Code::has_self_optimization_header() {
+  ASSERT(kind() == FUNCTION);
+  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
+  return FullCodeFlagsHasSelfOptimizationHeader::decode(flags);
+}
+
+
+void Code::set_self_optimization_header(bool value) {
+  ASSERT(kind() == FUNCTION);
+  byte flags = READ_BYTE_FIELD(this, kFullCodeFlags);
+  flags = FullCodeFlagsHasSelfOptimizationHeader::update(flags, value);
+  WRITE_BYTE_FIELD(this, kFullCodeFlags, flags);
+}


 int Code::allow_osr_at_loop_nesting_level() {
=======================================
--- /trunk/src/objects.h        Fri Feb 24 06:41:46 2012
+++ /trunk/src/objects.h        Mon Feb 27 03:46:55 2012
@@ -4207,6 +4207,11 @@
   inline bool is_compiled_optimizable();
   inline void set_compiled_optimizable(bool value);

+  // [has_self_optimization_header]: For FUNCTION kind, tells if it has
+  // a self-optimization header.
+  inline bool has_self_optimization_header();
+  inline void set_self_optimization_header(bool value);
+
   // [allow_osr_at_loop_nesting_level]: For FUNCTION kind, tells for
   // how long the function has been marked for OSR and therefore which
   // level of loop nesting we are willing to do on-stack replacement
@@ -4426,6 +4431,7 @@
       public BitField<bool, 0, 1> {};  // NOLINT
class FullCodeFlagsHasDebugBreakSlotsField: public BitField<bool, 1, 1> {};
   class FullCodeFlagsIsCompiledOptimizable: public BitField<bool, 2, 1> {};
+ class FullCodeFlagsHasSelfOptimizationHeader: public BitField<bool, 3, 1> {};

   static const int kBinaryOpReturnTypeOffset = kBinaryOpTypeOffset + 1;

=======================================
--- /trunk/src/parser.cc        Tue Feb 21 02:08:21 2012
+++ /trunk/src/parser.cc        Mon Feb 27 03:46:55 2012
@@ -1188,14 +1188,28 @@
     case Token::LET:
     case Token::CONST:
       return ParseVariableStatement(kModuleElement, ok);
-    case Token::MODULE:
-      return ParseModuleDeclaration(ok);
     case Token::IMPORT:
       return ParseImportDeclaration(ok);
     case Token::EXPORT:
       return ParseExportDeclaration(ok);
-    default:
-      return ParseStatement(labels, ok);
+    default: {
+      Statement* stmt = ParseStatement(labels, CHECK_OK);
+      // Handle 'module' as a context-sensitive keyword.
+      if (FLAG_harmony_modules &&
+          peek() == Token::IDENTIFIER &&
+          !scanner().HasAnyLineTerminatorBeforeNext() &&
+          stmt != NULL) {
+        ExpressionStatement* estmt = stmt->AsExpressionStatement();
+        if (estmt != NULL &&
+            estmt->expression()->AsVariableProxy() != NULL &&
+            estmt->expression()->AsVariableProxy()->name()->Equals(
+                isolate()->heap()->module_symbol()) &&
+            !scanner().literal_contains_escapes()) {
+          return ParseModuleDeclaration(ok);
+        }
+      }
+      return stmt;
+    }
   }
 }

@@ -1206,7 +1220,6 @@

   // Create new block with one expected declaration.
   Block* block = factory()->NewBlock(NULL, 1, true);
-  Expect(Token::MODULE, CHECK_OK);
   Handle<String> name = ParseIdentifier(CHECK_OK);
   // top_scope_->AddDeclaration(
   //     factory()->NewModuleDeclaration(proxy, module, top_scope_));
@@ -2172,8 +2185,17 @@
     return ParseNativeDeclaration(ok);
   }

-  // Parsed expression statement.
-  ExpectSemicolon(CHECK_OK);
+ // Parsed expression statement, or the context-sensitive 'module' keyword.
+  // Only expect semicolon in the former case.
+  if (!FLAG_harmony_modules ||
+      peek() != Token::IDENTIFIER ||
+      scanner().HasAnyLineTerminatorBeforeNext() ||
+      expr->AsVariableProxy() == NULL ||
+      !expr->AsVariableProxy()->name()->Equals(
+          isolate()->heap()->module_symbol()) ||
+      scanner().literal_contains_escapes()) {
+    ExpectSemicolon(CHECK_OK);
+  }
   return factory()->NewExpressionStatement(expr);
 }

=======================================
--- /trunk/src/profile-generator.cc     Fri Feb 24 06:41:46 2012
+++ /trunk/src/profile-generator.cc     Mon Feb 27 03:46:55 2012
@@ -3166,7 +3166,7 @@
   debug_heap->Verify();
 #endif

-  SetProgressTotal(4);  // 2 passes + dominators + sizes.
+  SetProgressTotal(2);  // 2 passes.

 #ifdef DEBUG
   debug_heap->Verify();
@@ -3303,10 +3303,9 @@
     affected[children[i].to()->ordered_index()] = true;
   }

-  int changed = 1;
-  const int base_progress_counter = progress_counter_;
-  while (changed != 0) {
-    changed = 0;
+  bool changed = true;
+  while (changed) {
+    changed = false;
     for (int i = root_index - 1; i >= 0; --i) {
       // If dominator of the entry has already been set to root,
       // then it can't propagate any further.
@@ -3330,17 +3329,13 @@
       if (new_idom_index != kNoDominator
           && dominators->at(i) != new_idom_index) {
         (*dominators)[i] = new_idom_index;
-        ++changed;
+        changed = true;
         Vector<HeapGraphEdge> children = entries[i]->children();
         for (int j = 0; j < children.length(); ++j) {
           affected[children[j].to()->ordered_index()] = true;
         }
       }
     }
-    int remaining = entries_length - changed;
-    ASSERT(remaining >= 0);
-    progress_counter_ = base_progress_counter + remaining;
-    if (!ProgressReport(true)) return false;
   }
   return true;
 }
@@ -3364,21 +3359,19 @@
   // As for the dominators tree we only know parent nodes, not
   // children, to sum up total sizes we "bubble" node's self size
   // adding it to all of its parents.
-  for (int i = 0; i < snapshot_->entries()->length(); ++i) {
-    HeapEntry* entry = snapshot_->entries()->at(i);
+  List<HeapEntry*>& entries = *snapshot_->entries();
+  for (int i = 0; i < entries.length(); ++i) {
+    HeapEntry* entry = entries[i];
     entry->set_retained_size(entry->self_size());
   }
-  for (int i = 0;
-       i < snapshot_->entries()->length();
-       ++i, ProgressStep()) {
-    HeapEntry* entry = snapshot_->entries()->at(i);
+  for (int i = 0; i < entries.length(); ++i) {
+    HeapEntry* entry = entries[i];
     int entry_size = entry->self_size();
     for (HeapEntry* dominator = entry->dominator();
          dominator != entry;
          entry = dominator, dominator = entry->dominator()) {
       dominator->add_retained_size(entry_size);
     }
-    if (!ProgressReport()) return false;
   }
   return true;
 }
=======================================
--- /trunk/src/scanner.cc       Thu Feb  9 05:53:47 2012
+++ /trunk/src/scanner.cc       Mon Feb 27 03:46:55 2012
@@ -850,9 +850,6 @@
   KEYWORD_GROUP('l')                                                \
   KEYWORD("let", harmony_scoping                                    \
                  ? Token::LET : Token::FUTURE_STRICT_RESERVED_WORD) \
-  KEYWORD_GROUP('m')                                                \
-  KEYWORD("module", harmony_modules                                 \
-                    ? Token::MODULE : Token::IDENTIFIER)            \
   KEYWORD_GROUP('n')                                                \
   KEYWORD("new", Token::NEW)                                        \
   KEYWORD("null", Token::NULL_LITERAL)                              \
=======================================
--- /trunk/src/token.h  Thu Feb  9 05:53:47 2012
+++ /trunk/src/token.h  Mon Feb 27 03:46:55 2012
@@ -173,7 +173,6 @@
   K(EXPORT, "export", 0)                                                \
   K(IMPORT, "import", 0)                                                \
   K(LET, "let", 0)                                                      \
-  K(MODULE, "module", 0)                                                \
                                                                         \
   /* Illegal token - not able to scan. */                               \
   T(ILLEGAL, "ILLEGAL", 0)                                              \
=======================================
--- /trunk/src/version.cc       Fri Feb 24 06:41:46 2012
+++ /trunk/src/version.cc       Mon Feb 27 03:46:55 2012
@@ -34,7 +34,7 @@
 // cannot be changed without changing the SCons build script.
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     9
-#define BUILD_NUMBER      10
+#define BUILD_NUMBER      11
 #define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
=======================================
--- /trunk/src/x64/full-codegen-x64.cc  Thu Feb 23 00:45:21 2012
+++ /trunk/src/x64/full-codegen-x64.cc  Mon Feb 27 03:46:55 2012
@@ -100,6 +100,11 @@
 };


+int FullCodeGenerator::self_optimization_header_size() {
+  return 20;
+}
+
+
 // Generate code for a JS function.  On entry to the function the receiver
 // and arguments have been pushed on the stack left to right, with the
 // return address on top of them.  The actual argument count matches the
@@ -120,13 +125,6 @@
   SetFunctionPosition(function());
   Comment cmnt(masm_, "[ function compiled by full code generator");

-#ifdef DEBUG
-  if (strlen(FLAG_stop_at) > 0 &&
-      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
-    __ int3();
-  }
-#endif
-
   // We can optionally optimize based on counters rather than statistical
   // sampling.
   if (info->ShouldSelfOptimize()) {
@@ -134,6 +132,7 @@
       PrintF("[adding self-optimization header to %s]\n",
              *info->function()->debug_name()->ToCString());
     }
+    has_self_optimization_header_ = true;
MaybeObject* maybe_cell = isolate()->heap()->AllocateJSGlobalPropertyCell(
         Smi::FromInt(Compiler::kCallsUntilPrimitiveOpt));
     JSGlobalPropertyCell* cell;
@@ -145,8 +144,16 @@
       Handle<Code> compile_stub(
           isolate()->builtins()->builtin(Builtins::kLazyRecompile));
       __ j(zero, compile_stub, RelocInfo::CODE_TARGET);
+      ASSERT(masm_->pc_offset() == self_optimization_header_size());
     }
   }
+
+#ifdef DEBUG
+  if (strlen(FLAG_stop_at) > 0 &&
+      info->function()->name()->IsEqualTo(CStrVector(FLAG_stop_at))) {
+    __ int3();
+  }
+#endif

   // Strict mode functions and builtins need to replace the receiver
   // with undefined when called as functions (without an explicit
=======================================
--- /trunk/test/cctest/test-heap-profiler.cc    Tue Feb 14 03:46:07 2012
+++ /trunk/test/cctest/test-heap-profiler.cc    Mon Feb 27 03:46:55 2012
@@ -677,7 +677,7 @@
   LocalContext env;

   const int snapshots_count = v8::HeapProfiler::GetSnapshotsCount();
-  TestActivityControl aborting_control(3);
+  TestActivityControl aborting_control(1);
   const v8::HeapSnapshot* no_snapshot =
       v8::HeapProfiler::TakeSnapshot(v8_str("abort"),
                                      v8::HeapSnapshot::kFull,
=======================================
--- /trunk/test/mjsunit/harmony/module-parsing.js       Tue Feb 21 02:08:21 2012
+++ /trunk/test/mjsunit/harmony/module-parsing.js       Mon Feb 27 03:46:55 2012
@@ -63,18 +63,28 @@

 // Check that ASI does not interfere.

-module
-X
+module X
 {
 let x
 }

-module
-Y
+module Y
 =
 X

-module
-Z
+module Z
 at
 "file://local"
+
+
+// Check that 'module' still works as an identifier.
+
+var module
+module = {}
+module["a"] = 6
+function module() {}
+function f(module) { return module }
+try {} catch (module) {}
+
+module
+v = 20
=======================================
--- /trunk/test/test262/test262.status  Fri Feb 24 06:41:46 2012
+++ /trunk/test/test262/test262.status  Mon Feb 27 03:46:55 2012
@@ -55,11 +55,6 @@
 S15.8.2.18_A7: PASS || FAIL_OK
 S15.8.2.13_A23: PASS || FAIL_OK

-# We are silent in some regexp cases where the spec wants us to give
-# errors, for compatibility.
-S15.10.2.11_A1_T2: FAIL
-S15.10.2.11_A1_T3: FAIL
-
 # We are more lenient in which string character escapes we allow than
 # the spec (7.8.4 p. 19) wants us to be.  This is for compatibility.
 S7.8.4_A6.1_T4: FAIL_OK

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to