Revision: 23482
Author:   [email protected]
Date:     Thu Aug 28 09:24:16 2014 UTC
Log:      Version 3.29.25 (based on bleeding_edge revision r23481)

Performance and stability improvements on all platforms.
https://code.google.com/p/v8/source/detail?r=23482

Modified:
 /trunk/ChangeLog
 /trunk/src/code-stubs-hydrogen.cc
 /trunk/src/code-stubs.cc
 /trunk/src/code-stubs.h
 /trunk/src/compiler/ast-graph-builder.cc
 /trunk/src/compiler/generic-algorithm.h
 /trunk/src/compiler/js-generic-lowering.cc
 /trunk/src/compiler/js-operator.h
 /trunk/src/compiler/pipeline.cc
 /trunk/src/compiler.h
 /trunk/src/hydrogen.cc
 /trunk/src/objects.cc
 /trunk/src/ostreams.cc
 /trunk/src/ostreams.h
 /trunk/src/version.cc
 /trunk/test/cctest/compiler/function-tester.h
 /trunk/test/cctest/compiler/test-run-inlining.cc
 /trunk/test/cctest/compiler/test-run-jscalls.cc
 /trunk/test/cctest/test-utils.cc

=======================================
--- /trunk/ChangeLog    Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/ChangeLog    Thu Aug 28 09:24:16 2014 UTC
@@ -1,3 +1,8 @@
+2014-08-28: Version 3.29.25
+
+        Performance and stability improvements on all platforms.
+
+
 2014-08-28: Version 3.29.24

         Tweaks to generate XP-compatible .exes (Chromium issue 407517).
=======================================
--- /trunk/src/code-stubs-hydrogen.cc   Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/code-stubs-hydrogen.cc   Thu Aug 28 09:24:16 2014 UTC
@@ -1063,7 +1063,7 @@
   HValue* true_value = NULL;
   HValue* false_value = NULL;

-  switch (stub->GetMode()) {
+  switch (stub->mode()) {
     case ToBooleanStub::RESULT_AS_SMI:
       true_value = graph()->GetConstant1();
       false_value = graph()->GetConstant0();
@@ -1079,7 +1079,7 @@
   }

   IfBuilder if_true(this);
-  if_true.If<HBranch>(GetParameter(0), stub->GetTypes());
+  if_true.If<HBranch>(GetParameter(0), stub->types());
   if_true.Then();
   if_true.Return(true_value);
   if_true.Else();
=======================================
--- /trunk/src/code-stubs.cc    Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/code-stubs.cc    Thu Aug 28 09:24:16 2014 UTC
@@ -810,15 +810,17 @@


 bool ToBooleanStub::UpdateStatus(Handle<Object> object) {
-  Types old_types(types_);
-  bool to_boolean_value = types_.UpdateStatus(object);
-  TraceTransition(old_types, types_);
+  Types new_types = types();
+  Types old_types = new_types;
+  bool to_boolean_value = new_types.UpdateStatus(object);
+  TraceTransition(old_types, new_types);
+ set_sub_minor_key(TypesBits::update(sub_minor_key(), new_types.ToByte()));
   return to_boolean_value;
 }


 void ToBooleanStub::PrintState(OStream& os) const {  // NOLINT
-  os << types_;
+  os << types();
 }


=======================================
--- /trunk/src/code-stubs.h     Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/code-stubs.h     Thu Aug 28 09:24:16 2014 UTC
@@ -644,9 +644,9 @@
  public:
   static const int kMaximumSlots = 64;

-  FastNewContextStub(Isolate* isolate, int slots)
-      : HydrogenCodeStub(isolate), slots_(slots) {
-    DCHECK(slots_ > 0 && slots_ <= kMaximumSlots);
+ FastNewContextStub(Isolate* isolate, int slots) : HydrogenCodeStub(isolate) {
+    DCHECK(slots > 0 && slots <= kMaximumSlots);
+    set_sub_minor_key(SlotsBits::encode(slots));
   }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;
@@ -656,16 +656,17 @@

   static void InstallDescriptors(Isolate* isolate);

-  int slots() const { return slots_; }
-
-  virtual Major MajorKey() const V8_OVERRIDE { return FastNewContext; }
-  virtual int NotMissMinorKey() const V8_OVERRIDE { return slots_; }
+  int slots() const { return SlotsBits::decode(sub_minor_key()); }

   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kFunction = 0;

  private:
-  int slots_;
+  virtual Major MajorKey() const V8_OVERRIDE { return FastNewContext; }
+
+  class SlotsBits : public BitField<int, 0, 8> {};
+
+  DISALLOW_COPY_AND_ASSIGN(FastNewContextStub);
 };


@@ -673,11 +674,12 @@
  public:
   FastCloneShallowArrayStub(Isolate* isolate,
                             AllocationSiteMode allocation_site_mode)
-      : HydrogenCodeStub(isolate),
-      allocation_site_mode_(allocation_site_mode) {}
+      : HydrogenCodeStub(isolate) {
+ set_sub_minor_key(AllocationSiteModeBits::encode(allocation_site_mode));
+  }

   AllocationSiteMode allocation_site_mode() const {
-    return allocation_site_mode_;
+    return AllocationSiteModeBits::decode(sub_minor_key());
   }

   virtual Handle<Code> GenerateCode();
@@ -688,14 +690,11 @@
   static void InstallDescriptors(Isolate* isolate);

  private:
-  AllocationSiteMode allocation_site_mode_;
+ virtual Major MajorKey() const V8_OVERRIDE { return FastCloneShallowArray; }

class AllocationSiteModeBits: public BitField<AllocationSiteMode, 0, 1> {};
-  // Ensure data fits within available bits.
- virtual Major MajorKey() const V8_OVERRIDE { return FastCloneShallowArray; }
-  int NotMissMinorKey() const {
-    return AllocationSiteModeBits::encode(allocation_site_mode_);
-  }
+
+  DISALLOW_COPY_AND_ASSIGN(FastCloneShallowArrayStub);
 };


@@ -705,12 +704,13 @@
   static const int kMaximumClonedProperties = 6;

   FastCloneShallowObjectStub(Isolate* isolate, int length)
-      : HydrogenCodeStub(isolate), length_(length) {
-    DCHECK_GE(length_, 0);
-    DCHECK_LE(length_, kMaximumClonedProperties);
+      : HydrogenCodeStub(isolate) {
+    DCHECK_GE(length, 0);
+    DCHECK_LE(length, kMaximumClonedProperties);
+    set_sub_minor_key(LengthBits::encode(length));
   }

-  int length() const { return length_; }
+  int length() const { return LengthBits::decode(sub_minor_key()); }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;

@@ -718,10 +718,9 @@
       CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;

  private:
-  int length_;
-
virtual Major MajorKey() const V8_OVERRIDE { return FastCloneShallowObject; }
-  int NotMissMinorKey() const { return length_; }
+
+  class LengthBits : public BitField<int, 0, 4> {};

   DISALLOW_COPY_AND_ASSIGN(FastCloneShallowObjectStub);
 };
@@ -1302,19 +1301,19 @@

 class StringAddStub V8_FINAL : public HydrogenCodeStub {
  public:
-  StringAddStub(Isolate* isolate,
-                StringAddFlags flags,
+  StringAddStub(Isolate* isolate, StringAddFlags flags,
                 PretenureFlag pretenure_flag)
-      : HydrogenCodeStub(isolate),
-        bit_field_(StringAddFlagsBits::encode(flags) |
-                   PretenureFlagBits::encode(pretenure_flag)) {}
+      : HydrogenCodeStub(isolate) {
+    set_sub_minor_key(StringAddFlagsBits::encode(flags) |
+                      PretenureFlagBits::encode(pretenure_flag));
+  }

   StringAddFlags flags() const {
-    return StringAddFlagsBits::decode(bit_field_);
+    return StringAddFlagsBits::decode(sub_minor_key());
   }

   PretenureFlag pretenure_flag() const {
-    return PretenureFlagBits::decode(bit_field_);
+    return PretenureFlagBits::decode(sub_minor_key());
   }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;
@@ -1329,12 +1328,10 @@
   static const int kRight = 1;

  private:
+  virtual Major MajorKey() const V8_OVERRIDE { return StringAdd; }
+
   class StringAddFlagsBits: public BitField<StringAddFlags, 0, 2> {};
   class PretenureFlagBits: public BitField<PretenureFlag, 2, 1> {};
-  uint32_t bit_field_;
-
-  virtual Major MajorKey() const V8_OVERRIDE { return StringAdd; }
-  virtual int NotMissMinorKey() const V8_OVERRIDE { return bit_field_; }

   virtual void PrintBaseName(OStream& os) const V8_OVERRIDE;  // NOLINT

@@ -2110,16 +2107,14 @@
   LoadFastElementStub(Isolate* isolate, bool is_js_array,
                       ElementsKind elements_kind)
       : HydrogenCodeStub(isolate) {
-    bit_field_ = ElementsKindBits::encode(elements_kind) |
-        IsJSArrayBits::encode(is_js_array);
+    set_sub_minor_key(ElementsKindBits::encode(elements_kind) |
+                      IsJSArrayBits::encode(is_js_array));
   }

-  bool is_js_array() const {
-    return IsJSArrayBits::decode(bit_field_);
-  }
+ bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); }

   ElementsKind elements_kind() const {
-    return ElementsKindBits::decode(bit_field_);
+    return ElementsKindBits::decode(sub_minor_key());
   }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;
@@ -2130,12 +2125,10 @@
       CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;

  private:
+  virtual Major MajorKey() const V8_OVERRIDE { return LoadElement; }
+
   class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
   class IsJSArrayBits: public BitField<bool, 8, 1> {};
-  uint32_t bit_field_;
-
-  virtual Major MajorKey() const V8_OVERRIDE { return LoadElement; }
-  int NotMissMinorKey() const { return bit_field_; }

   DISALLOW_COPY_AND_ASSIGN(LoadFastElementStub);
 };
@@ -2146,21 +2139,19 @@
   StoreFastElementStub(Isolate* isolate, bool is_js_array,
ElementsKind elements_kind, KeyedAccessStoreMode mode)
       : HydrogenCodeStub(isolate) {
-    bit_field_ = ElementsKindBits::encode(elements_kind) |
-        IsJSArrayBits::encode(is_js_array) |
-        StoreModeBits::encode(mode);
+    set_sub_minor_key(ElementsKindBits::encode(elements_kind) |
+                      IsJSArrayBits::encode(is_js_array) |
+                      StoreModeBits::encode(mode));
   }

-  bool is_js_array() const {
-    return IsJSArrayBits::decode(bit_field_);
-  }
+ bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); }

   ElementsKind elements_kind() const {
-    return ElementsKindBits::decode(bit_field_);
+    return ElementsKindBits::decode(sub_minor_key());
   }

   KeyedAccessStoreMode store_mode() const {
-    return StoreModeBits::decode(bit_field_);
+    return StoreModeBits::decode(sub_minor_key());
   }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;
@@ -2169,13 +2160,11 @@
       CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;

  private:
+  virtual Major MajorKey() const V8_OVERRIDE { return StoreElement; }
+
   class ElementsKindBits: public BitField<ElementsKind,      0, 8> {};
   class StoreModeBits: public BitField<KeyedAccessStoreMode, 8, 4> {};
   class IsJSArrayBits: public BitField<bool,                12, 1> {};
-  uint32_t bit_field_;
-
-  virtual Major MajorKey() const V8_OVERRIDE { return StoreElement; }
-  int NotMissMinorKey() const { return bit_field_; }

   DISALLOW_COPY_AND_ASSIGN(StoreFastElementStub);
 };
@@ -2187,22 +2176,18 @@
                              ElementsKind from_kind,
                              ElementsKind to_kind,
bool is_js_array) : HydrogenCodeStub(isolate) {
-    bit_field_ = FromKindBits::encode(from_kind) |
-                 ToKindBits::encode(to_kind) |
-                 IsJSArrayBits::encode(is_js_array);
+    set_sub_minor_key(FromKindBits::encode(from_kind) |
+                      ToKindBits::encode(to_kind) |
+                      IsJSArrayBits::encode(is_js_array));
   }

   ElementsKind from_kind() const {
-    return FromKindBits::decode(bit_field_);
+    return FromKindBits::decode(sub_minor_key());
   }

-  ElementsKind to_kind() const {
-    return ToKindBits::decode(bit_field_);
-  }
+ ElementsKind to_kind() const { return ToKindBits::decode(sub_minor_key()); }

-  bool is_js_array() const {
-    return IsJSArrayBits::decode(bit_field_);
-  }
+ bool is_js_array() const { return IsJSArrayBits::decode(sub_minor_key()); }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;

@@ -2210,13 +2195,11 @@
       CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;

  private:
+ virtual Major MajorKey() const V8_OVERRIDE { return TransitionElementsKind; }
+
   class FromKindBits: public BitField<ElementsKind, 8, 8> {};
   class ToKindBits: public BitField<ElementsKind, 0, 8> {};
   class IsJSArrayBits: public BitField<bool, 16, 1> {};
-  uint32_t bit_field_;
-
- virtual Major MajorKey() const V8_OVERRIDE { return TransitionElementsKind; }
-  int NotMissMinorKey() const { return bit_field_; }

   DISALLOW_COPY_AND_ASSIGN(TransitionElementsKindStub);
 };
@@ -2233,16 +2216,16 @@
     // for an ElementsKind and the desired usage of the stub.
     DCHECK(override_mode != DISABLE_ALLOCATION_SITES ||
            AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE);
-    bit_field_ = ElementsKindBits::encode(kind) |
-        AllocationSiteOverrideModeBits::encode(override_mode);
+    set_sub_minor_key(ElementsKindBits::encode(kind) |
+ AllocationSiteOverrideModeBits::encode(override_mode));
   }

   ElementsKind elements_kind() const {
-    return ElementsKindBits::decode(bit_field_);
+    return ElementsKindBits::decode(sub_minor_key());
   }

   AllocationSiteOverrideMode override_mode() const {
-    return AllocationSiteOverrideModeBits::decode(bit_field_);
+    return AllocationSiteOverrideModeBits::decode(sub_minor_key());
   }

   static void GenerateStubsAheadOfTime(Isolate* isolate);
@@ -2256,15 +2239,12 @@
   OStream& BasePrintName(OStream& os, const char* name) const;  // NOLINT

  private:
-  int NotMissMinorKey() const { return bit_field_; }
-
   // Ensure data fits within available bits.
   STATIC_ASSERT(LAST_ALLOCATION_SITE_OVERRIDE_MODE == 1);

   class ElementsKindBits: public BitField<ElementsKind, 0, 8> {};
   class AllocationSiteOverrideModeBits: public
       BitField<AllocationSiteOverrideMode, 8, 1> {};  // NOLINT
-  uint32_t bit_field_;

   DISALLOW_COPY_AND_ASSIGN(ArrayConstructorStubBase);
 };
@@ -2355,7 +2335,7 @@
  public:
   InternalArrayConstructorStubBase(Isolate* isolate, ElementsKind kind)
       : HydrogenCodeStub(isolate) {
-    kind_ = kind;
+    set_sub_minor_key(ElementsKindBits::encode(kind));
   }

   static void GenerateStubsAheadOfTime(Isolate* isolate);
@@ -2364,12 +2344,12 @@
   // Parameters accessed via CodeStubGraphBuilder::GetParameter()
   static const int kConstructor = 0;

-  ElementsKind elements_kind() const { return kind_; }
+  ElementsKind elements_kind() const {
+    return ElementsKindBits::decode(sub_minor_key());
+  }

  private:
-  int NotMissMinorKey() const { return kind_; }
-
-  ElementsKind kind_;
+  class ElementsKindBits : public BitField<ElementsKind, 0, 8> {};

   DISALLOW_COPY_AND_ASSIGN(InternalArrayConstructorStubBase);
 };
@@ -2498,15 +2478,20 @@
   };

   ToBooleanStub(Isolate* isolate, ResultMode mode, Types types = Types())
-      : HydrogenCodeStub(isolate), types_(types), mode_(mode) {}
+      : HydrogenCodeStub(isolate) {
+    set_sub_minor_key(TypesBits::encode(types.ToByte()) |
+                      ResultModeBits::encode(mode));
+  }
+
   ToBooleanStub(Isolate* isolate, ExtraICState state)
-      : HydrogenCodeStub(isolate),
-        types_(static_cast<byte>(state)),
-        mode_(RESULT_AS_SMI) {}
+      : HydrogenCodeStub(isolate) {
+    set_sub_minor_key(TypesBits::encode(static_cast<byte>(state)) |
+                      ResultModeBits::encode(RESULT_AS_SMI));
+  }

   bool UpdateStatus(Handle<Object> object);
-  Types GetTypes() { return types_; }
-  ResultMode GetMode() { return mode_; }
+  Types types() const { return Types(TypesBits::decode(sub_minor_key())); }
+ ResultMode mode() const { return ResultModeBits::decode(sub_minor_key()); }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;
   virtual void InitializeInterfaceDescriptor(
@@ -2527,10 +2512,10 @@
     return ToBooleanStub(isolate, UNINITIALIZED).GetCode();
   }

- virtual ExtraICState GetExtraICState() const { return types_.ToIntegral(); } + virtual ExtraICState GetExtraICState() const { return types().ToIntegral(); }

   virtual InlineCacheState GetICState() const {
-    if (types_.IsEmpty()) {
+    if (types().IsEmpty()) {
       return ::v8::internal::UNINITIALIZED;
     } else {
       return MONOMORPHIC;
@@ -2538,19 +2523,17 @@
   }

  private:
-  class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {};
- class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {};
-
   virtual Major MajorKey() const V8_OVERRIDE { return ToBoolean; }
-  int NotMissMinorKey() const {
- return TypesBits::encode(types_.ToByte()) | ResultModeBits::encode(mode_);
+
+  ToBooleanStub(Isolate* isolate, InitializationState init_state)
+      : HydrogenCodeStub(isolate, init_state) {
+    set_sub_minor_key(ResultModeBits::encode(RESULT_AS_SMI));
   }

-  ToBooleanStub(Isolate* isolate, InitializationState init_state)
-      : HydrogenCodeStub(isolate, init_state), mode_(RESULT_AS_SMI) {}
+  class TypesBits : public BitField<byte, 0, NUMBER_OF_TYPES> {};
+ class ResultModeBits : public BitField<ResultMode, NUMBER_OF_TYPES, 2> {};

-  Types types_;
-  ResultMode mode_;
+  DISALLOW_COPY_AND_ASSIGN(ToBooleanStub);
 };


@@ -2559,21 +2542,21 @@

 class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
  public:
-  ElementsTransitionAndStoreStub(Isolate* isolate,
-                                 ElementsKind from_kind,
-                                 ElementsKind to_kind,
-                                 bool is_jsarray,
+  ElementsTransitionAndStoreStub(Isolate* isolate, ElementsKind from_kind,
+                                 ElementsKind to_kind, bool is_jsarray,
                                  KeyedAccessStoreMode store_mode)
-      : HydrogenCodeStub(isolate),
-        from_kind_(from_kind),
-        to_kind_(to_kind),
-        is_jsarray_(is_jsarray),
-        store_mode_(store_mode) {}
+      : HydrogenCodeStub(isolate) {
+ set_sub_minor_key(FromBits::encode(from_kind) | ToBits::encode(to_kind) |
+                      IsJSArrayBits::encode(is_jsarray) |
+                      StoreModeBits::encode(store_mode));
+  }

-  ElementsKind from_kind() const { return from_kind_; }
-  ElementsKind to_kind() const { return to_kind_; }
-  bool is_jsarray() const { return is_jsarray_; }
-  KeyedAccessStoreMode store_mode() const { return store_mode_; }
+ ElementsKind from_kind() const { return FromBits::decode(sub_minor_key()); }
+  ElementsKind to_kind() const { return ToBits::decode(sub_minor_key()); }
+ bool is_jsarray() const { return IsJSArrayBits::decode(sub_minor_key()); }
+  KeyedAccessStoreMode store_mode() const {
+    return StoreModeBits::decode(sub_minor_key());
+  }

   virtual Handle<Code> GenerateCode() V8_OVERRIDE;

@@ -2601,25 +2584,14 @@
   }

  private:
-  class FromBits:      public BitField<ElementsKind,          0, 8> {};
-  class ToBits:        public BitField<ElementsKind,          8, 8> {};
-  class IsJSArrayBits: public BitField<bool,                 16, 1> {};
-  class StoreModeBits: public BitField<KeyedAccessStoreMode, 17, 4> {};
-
   virtual Major MajorKey() const V8_OVERRIDE {
     return ElementsTransitionAndStore;
   }
-  int NotMissMinorKey() const {
-    return FromBits::encode(from_kind_) |
-        ToBits::encode(to_kind_) |
-        IsJSArrayBits::encode(is_jsarray_) |
-        StoreModeBits::encode(store_mode_);
-  }

-  ElementsKind from_kind_;
-  ElementsKind to_kind_;
-  bool is_jsarray_;
-  KeyedAccessStoreMode store_mode_;
+  class FromBits : public BitField<ElementsKind, 0, 8> {};
+  class ToBits : public BitField<ElementsKind, 8, 8> {};
+  class IsJSArrayBits : public BitField<bool, 16, 1> {};
+  class StoreModeBits : public BitField<KeyedAccessStoreMode, 17, 4> {};

   DISALLOW_COPY_AND_ASSIGN(ElementsTransitionAndStoreStub);
 };
=======================================
--- /trunk/src/compiler/ast-graph-builder.cc    Mon Aug 25 19:57:56 2014 UTC
+++ /trunk/src/compiler/ast-graph-builder.cc    Thu Aug 28 09:24:16 2014 UTC
@@ -898,8 +898,8 @@
             VisitForValue(property->value());
             Node* value = environment()->Pop();
             PrintableUnique<Name> name = MakeUnique(key->AsPropertyName());
-            Node* store =
-                NewNode(javascript()->StoreNamed(name), literal, value);
+ Node* store = NewNode(javascript()->StoreNamed(strict_mode(), name),
+                                  literal, value);
             PrepareFrameState(store, key->id());
           } else {
             VisitForEffect(property->value());
@@ -992,7 +992,8 @@
     VisitForValue(subexpr);
     Node* value = environment()->Pop();
     Node* index = jsgraph()->Constant(i);
- Node* store = NewNode(javascript()->StoreProperty(), literal, index, value); + Node* store = NewNode(javascript()->StoreProperty(strict_mode()), literal,
+                          index, value);
     PrepareFrameState(store, expr->GetIdForElement(i));
   }

@@ -1023,7 +1024,8 @@
       value = environment()->Pop();
       PrintableUnique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
-      Node* store = NewNode(javascript()->StoreNamed(name), object, value);
+      Node* store =
+ NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
       // TODO(jarin) Fill in the correct bailout id.
       PrepareFrameState(store, BailoutId::None());
       break;
@@ -1035,7 +1037,8 @@
       Node* key = environment()->Pop();
       Node* object = environment()->Pop();
       value = environment()->Pop();
- Node* store = NewNode(javascript()->StoreProperty(), object, key, value); + Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
+                            key, value);
       // TODO(jarin) Fill in the correct bailout id.
       PrepareFrameState(store, BailoutId::None());
       break;
@@ -1116,14 +1119,16 @@
       Node* object = environment()->Pop();
       PrintableUnique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
-      Node* store = NewNode(javascript()->StoreNamed(name), object, value);
+      Node* store =
+ NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
       PrepareFrameState(store, expr->AssignmentId());
       break;
     }
     case KEYED_PROPERTY: {
       Node* key = environment()->Pop();
       Node* object = environment()->Pop();
- Node* store = NewNode(javascript()->StoreProperty(), object, key, value); + Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
+                            key, value);
       PrepareFrameState(store, expr->AssignmentId());
       break;
     }
@@ -1421,14 +1426,16 @@
       Node* object = environment()->Pop();
       PrintableUnique<Name> name =
           MakeUnique(property->key()->AsLiteral()->AsPropertyName());
-      Node* store = NewNode(javascript()->StoreNamed(name), object, value);
+      Node* store =
+ NewNode(javascript()->StoreNamed(strict_mode(), name), object, value);
       PrepareFrameState(store, expr->AssignmentId());
       break;
     }
     case KEYED_PROPERTY: {
       Node* key = environment()->Pop();
       Node* object = environment()->Pop();
- Node* store = NewNode(javascript()->StoreProperty(), object, key, value); + Node* store = NewNode(javascript()->StoreProperty(strict_mode()), object,
+                            key, value);
       PrepareFrameState(store, expr->AssignmentId());
       break;
     }
@@ -1531,7 +1538,7 @@
for (int i = 0; i < globals()->length(); ++i) data->set(i, *globals()->at(i));
   int encoded_flags = DeclareGlobalsEvalFlag::encode(info()->is_eval()) |
DeclareGlobalsNativeFlag::encode(info()->is_native()) | - DeclareGlobalsStrictMode::encode(info()->strict_mode());
+                      DeclareGlobalsStrictMode::encode(strict_mode());
   Node* flags = jsgraph()->Constant(encoded_flags);
   Node* pairs = jsgraph()->Constant(data);
   Operator* op = javascript()->Runtime(Runtime::kDeclareGlobals, 3);
@@ -1838,7 +1845,7 @@
       // Global var, const, or let variable.
       Node* global = BuildLoadGlobalObject();
       PrintableUnique<Name> name = MakeUnique(variable->name());
-      Operator* op = javascript()->StoreNamed(name);
+      Operator* op = javascript()->StoreNamed(strict_mode(), name);
       Node* store = NewNode(op, global, value);
       PrepareFrameState(store, bailout_id);
       return store;
=======================================
--- /trunk/src/compiler/generic-algorithm.h     Thu Aug 28 00:05:02 2014 UTC
+++ /trunk/src/compiler/generic-algorithm.h     Thu Aug 28 09:24:16 2014 UTC
@@ -43,7 +43,7 @@
     typedef typename Traits::Node Node;
     typedef typename Traits::Iterator Iterator;
     typedef std::pair<Iterator, Iterator> NodeState;
-    typedef std::stack<NodeState, ZoneDeque<NodeState>> NodeStateStack;
+    typedef std::stack<NodeState, ZoneDeque<NodeState> > NodeStateStack;
     NodeStateStack stack((ZoneDeque<NodeState>(zone)));
     BoolVector visited(Traits::max_id(graph), false, zone);
     Node* current = *root_begin;
=======================================
--- /trunk/src/compiler/js-generic-lowering.cc  Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/compiler/js-generic-lowering.cc  Thu Aug 28 09:24:16 2014 UTC
@@ -422,9 +422,7 @@


 Node* JSGenericLowering::LowerJSStoreProperty(Node* node) {
-  // TODO(mstarzinger): The strict_mode needs to be carried along in the
-  // operator so that graphs are fully compositional for inlining.
-  StrictMode strict_mode = info()->strict_mode();
+  StrictMode strict_mode = OpParameter<StrictMode>(node);
   KeyedStoreICStubShim stub(isolate(), strict_mode);
   ReplaceWithICStubCall(node, &stub);
   return node;
@@ -432,12 +430,9 @@


 Node* JSGenericLowering::LowerJSStoreNamed(Node* node) {
-  PrintableUnique<Name> key = OpParameter<PrintableUnique<Name> >(node);
-  // TODO(mstarzinger): The strict_mode needs to be carried along in the
-  // operator so that graphs are fully compositional for inlining.
-  StrictMode strict_mode = info()->strict_mode();
-  StoreICStubShim stub(isolate(), strict_mode);
-  PatchInsertInput(node, 1, jsgraph()->HeapConstant(key));
+  StoreNamedParameters params = OpParameter<StoreNamedParameters>(node);
+  StoreICStubShim stub(isolate(), params.strict_mode);
+  PatchInsertInput(node, 1, jsgraph()->HeapConstant(params.name));
   ReplaceWithICStubCall(node, &stub);
   return node;
 }
=======================================
--- /trunk/src/compiler/js-operator.h   Tue Aug 12 06:42:13 2014 UTC
+++ /trunk/src/compiler/js-operator.h   Thu Aug 28 09:24:16 2014 UTC
@@ -51,6 +51,13 @@
   CallFunctionFlags flags;
 };

+// Defines the property being stored to an object by a named store. This is
+// used as a parameter by JSStoreNamed operators.
+struct StoreNamedParameters {
+  StrictMode strict_mode;
+  PrintableUnique<Name> name;
+};
+
// Interface for building JavaScript-level operators, e.g. directly from the // AST. Most operators have no parameters, thus can be globally shared for all
 // graphs.
@@ -124,11 +131,16 @@
         1, 1);
   }

-  Operator* StoreProperty() { NOPROPS(JSStoreProperty, 3, 0); }
-  Operator* StoreNamed(PrintableUnique<Name> name) {
- OP1(JSStoreNamed, PrintableUnique<Name>, name, Operator::kNoProperties, 2,
+  Operator* StoreProperty(StrictMode strict_mode) {
+ OP1(JSStoreProperty, StrictMode, strict_mode, Operator::kNoProperties, 3,
         0);
   }
+
+ Operator* StoreNamed(StrictMode strict_mode, PrintableUnique<Name> name) {
+    StoreNamedParameters parameters = {strict_mode, name};
+ OP1(JSStoreNamed, StoreNamedParameters, parameters, Operator::kNoProperties,
+        2, 0);
+  }

   Operator* DeleteProperty(StrictMode strict_mode) {
OP1(JSDeleteProperty, StrictMode, strict_mode, Operator::kNoProperties, 2,
=======================================
--- /trunk/src/compiler/pipeline.cc     Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/compiler/pipeline.cc     Thu Aug 28 09:24:16 2014 UTC
@@ -200,7 +200,7 @@
     VerifyAndPrintGraph(&graph, "Context specialized");
   }

-  if (FLAG_turbo_inlining) {
+  if (info()->is_inlining_enabled()) {
     SourcePositionTable::Scope pos(&source_positions,
                                    SourcePosition::Unknown());
     JSInliner inliner(info(), &jsgraph);
=======================================
--- /trunk/src/compiler.h       Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/compiler.h       Thu Aug 28 09:24:16 2014 UTC
@@ -80,7 +80,8 @@
     kCompilingForDebugging = 1 << 13,
     kParseRestriction = 1 << 14,
     kSerializing = 1 << 15,
-    kContextSpecializing = 1 << 16
+    kContextSpecializing = 1 << 16,
+    kInliningEnabled = 1 << 17
   };

   CompilationInfo(Handle<JSFunction> closure, Zone* zone);
@@ -185,6 +186,10 @@
   void MarkAsContextSpecializing() { SetFlag(kContextSpecializing); }

bool is_context_specializing() const { return GetFlag(kContextSpecializing); }
+
+  void MarkAsInliningEnabled() { SetFlag(kInliningEnabled); }
+
+  bool is_inlining_enabled() const { return GetFlag(kInliningEnabled); }

   bool IsCodePreAgingActive() const {
     return FLAG_optimize_for_size && FLAG_age_code && !will_serialize() &&
=======================================
--- /trunk/src/hydrogen.cc      Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/hydrogen.cc      Thu Aug 28 09:24:16 2014 UTC
@@ -3500,7 +3500,7 @@
               shared->end_position() - shared->start_position() + 1;
           for (int i = 0; i < source_len; i++) {
             if (stream.HasMore()) {
-              os << AsUC16(stream.GetNext());
+              os << AsReversiblyEscapedUC16(stream.GetNext());
             }
           }
         }
=======================================
--- /trunk/src/objects.cc       Wed Aug 27 00:06:40 2014 UTC
+++ /trunk/src/objects.cc       Thu Aug 28 09:24:16 2014 UTC
@@ -10923,7 +10923,10 @@

   os << "Instructions (size = " << instruction_size() << ")\n";
   // TODO(svenpanne) The Disassembler should use streams, too!
-  Disassembler::Decode(stdout, this);
+  {
+    CodeTracer::Scope trace_scope(GetIsolate()->GetCodeTracer());
+    Disassembler::Decode(trace_scope.file(), this);
+  }
   os << "\n";

   if (kind() == FUNCTION) {
=======================================
--- /trunk/src/ostreams.cc      Mon Jul 14 00:04:59 2014 UTC
+++ /trunk/src/ostreams.cc      Thu Aug 28 09:24:16 2014 UTC
@@ -161,6 +161,16 @@
   if (f_) fflush(f_);
   return *this;
 }
+
+
+OStream& operator<<(OStream& os, const AsReversiblyEscapedUC16& c) {
+  char buf[10];
+ const char* format = (0x20 <= c.value && c.value <= 0x7F) && (c.value != 0x52)
+                           ? "%c"
+                           : (c.value <= 0xff) ? "\\x%02x" : "\\u%04x";
+  snprintf(buf, sizeof(buf), format, c.value);
+  return os << buf;
+}


 OStream& operator<<(OStream& os, const AsUC16& c) {
=======================================
--- /trunk/src/ostreams.h       Tue Jul  8 00:05:42 2014 UTC
+++ /trunk/src/ostreams.h       Thu Aug 28 09:24:16 2014 UTC
@@ -117,13 +117,26 @@
 };


-// A wrapper to disambiguate uint16_t and uc16.
+// Wrappers to disambiguate uint16_t and uc16.
 struct AsUC16 {
   explicit AsUC16(uint16_t v) : value(v) {}
   uint16_t value;
 };


+struct AsReversiblyEscapedUC16 {
+  explicit AsReversiblyEscapedUC16(uint16_t v) : value(v) {}
+  uint16_t value;
+};
+
+
+// Writes the given character to the output escaping everything outside
+// of printable ASCII range. Additionally escapes '\' making escaping
+// reversible.
+OStream& operator<<(OStream& os, const AsReversiblyEscapedUC16& c);
+
+// Writes the given character to the output escaping everything outside
+// of printable ASCII range.
 OStream& operator<<(OStream& os, const AsUC16& c);
 } }  // namespace v8::internal

=======================================
--- /trunk/src/version.cc       Thu Aug 28 07:03:22 2014 UTC
+++ /trunk/src/version.cc       Thu Aug 28 09:24:16 2014 UTC
@@ -34,7 +34,7 @@
 // system so their names cannot be changed without changing the scripts.
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     29
-#define BUILD_NUMBER      24
+#define BUILD_NUMBER      25
 #define PATCH_LEVEL       0
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
=======================================
--- /trunk/test/cctest/compiler/function-tester.h Wed Aug 27 00:06:40 2014 UTC +++ /trunk/test/cctest/compiler/function-tester.h Thu Aug 28 09:24:16 2014 UTC
@@ -26,12 +26,14 @@

 class FunctionTester : public InitializedHandleScope {
  public:
-  explicit FunctionTester(const char* source, bool context_specialization =
- FLAG_context_specialization)
+  explicit FunctionTester(const char* source, uint32_t flags = 0)
       : isolate(main_isolate()),
         function((FLAG_allow_natives_syntax = true, NewFunction(source))),
-        context_specialization_(context_specialization) {
+        flags_(flags) {
     Compile(function);
+ const uint32_t supported_flags = CompilationInfo::kContextSpecializing |
+                                     CompilationInfo::kInliningEnabled;
+    CHECK_EQ(0, flags_ & ~supported_flags);
   }

   Isolate* isolate;
@@ -45,7 +47,12 @@
     StrictMode strict_mode = info.function()->strict_mode();
     info.SetStrictMode(strict_mode);
     info.SetOptimizing(BailoutId::None(), Handle<Code>(function->code()));
-    if (context_specialization_) info.MarkAsContextSpecializing();
+    if (flags_ & CompilationInfo::kContextSpecializing) {
+      info.MarkAsContextSpecializing();
+    }
+    if (flags_ & CompilationInfo::kInliningEnabled) {
+      info.MarkAsInliningEnabled();
+    }
     CHECK(Rewriter::Rewrite(&info));
     CHECK(Scope::Analyze(&info));
     CHECK_NE(NULL, info.scope());
@@ -193,7 +200,7 @@
Handle<Object> false_value() { return isolate->factory()->false_value(); }

  private:
-  bool context_specialization_;
+  uint32_t flags_;
 };
 }
 }
=======================================
--- /trunk/test/cctest/compiler/test-run-inlining.cc Mon Aug 25 19:57:56 2014 UTC +++ /trunk/test/cctest/compiler/test-run-inlining.cc Thu Aug 28 09:24:16 2014 UTC
@@ -36,13 +36,13 @@


 TEST(SimpleInlining) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function(){"
       "function foo(s) { AssertStackDepth(1); return s; };"
       "function bar(s, t) { return foo(s); };"
-      "return bar;})();");
+      "return bar;})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(1), T.Val(1), T.Val(2));
@@ -50,14 +50,14 @@


 TEST(SimpleInliningContext) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "function foo(s) { AssertStackDepth(1); var x = 12; return s + x; };"
       "function bar(s, t) { return foo(s); };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(13), T.Val(1), T.Val(2));
@@ -65,15 +65,15 @@


 TEST(CaptureContext) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "var f = (function () {"
       "var x = 42;"
       "function bar(s) { return x + s; };"
       "return (function (s) { return bar(s); });"
       "})();"
-      "(function (s) { return f(s)})");
+      "(function (s) { return f(s)})",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(42 + 12), T.Val(12), T.undefined());
@@ -83,14 +83,14 @@
 // TODO(sigurds) For now we do not inline any native functions. If we do at
 // some point, change this test.
 TEST(DontInlineEval) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "var x = 42;"
       "(function () {"
       "function bar(s, t) { return eval(\"AssertStackDepth(2); x\") };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(42), T.Val("x"), T.undefined());
@@ -98,14 +98,14 @@


 TEST(InlineOmitArguments) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "var x = 42;"
       "function bar(s, t, u, v) { AssertStackDepth(1); return x + s; };"
       "return (function (s,t) { return bar(s); });"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(42 + 12), T.Val(12), T.undefined());
@@ -113,15 +113,15 @@


 TEST(InlineSurplusArguments) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "var x = 42;"
       "function foo(s) { AssertStackDepth(1); return x + s; };"
       "function bar(s,t) { return foo(s,t,13); };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(42 + 12), T.Val(12), T.undefined());
@@ -129,14 +129,14 @@


 TEST(InlineTwice) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "var x = 42;"
       "function bar(s) { AssertStackDepth(1); return x + s; };"
       "return (function (s,t) { return bar(s) + bar(t); });"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(2 * 42 + 12 + 4), T.Val(12), T.Val(4));
@@ -144,15 +144,15 @@


 TEST(InlineTwiceDependent) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "var x = 42;"
       "function foo(s) { AssertStackDepth(1); return x + s; };"
       "function bar(s,t) { return foo(foo(s)); };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(42 + 42 + 12), T.Val(12), T.Val(4));
@@ -160,15 +160,15 @@


 TEST(InlineTwiceDependentDiamond) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "function foo(s) { if (true) {"
       "                  return 12 } else { return 13; } };"
       "function bar(s,t) { return foo(foo(1)); };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(12), T.undefined(), T.undefined());
@@ -176,8 +176,6 @@


 TEST(InlineTwiceDependentDiamondReal) {
-  FLAG_context_specialization = true;
-  FLAG_turbo_inlining = true;
   FunctionTester T(
       "(function () {"
       "var x = 41;"
@@ -185,7 +183,9 @@
       "                  return x - s } else { return x + s; } };"
       "function bar(s,t) { return foo(foo(s)); };"
       "return bar;"
-      "})();");
+      "})();",
+      CompilationInfo::kInliningEnabled |
+          CompilationInfo::kContextSpecializing);

   InstallAssertStackDepthHelper(CcTest::isolate());
   T.CheckCall(T.Val(-11), T.Val(11), T.Val(4));
=======================================
--- /trunk/test/cctest/compiler/test-run-jscalls.cc Sun Aug 24 11:34:17 2014 UTC +++ /trunk/test/cctest/compiler/test-run-jscalls.cc Thu Aug 28 09:24:16 2014 UTC
@@ -255,7 +255,7 @@
       "})()";

   // Disable context specialization.
-  FunctionTester T(script, false);
+  FunctionTester T(script);
   v8::Local<v8::Context> context = v8::Context::New(CcTest::isolate());
   v8::Context::Scope scope(context);
   v8::Local<v8::Value> value = CompileRun(script);
@@ -276,7 +276,7 @@
       "})()";

   // Disable context specialization.
-  FunctionTester T(script, false);
+  FunctionTester T(script);
   v8::Local<v8::Context> context = v8::Context::New(CcTest::isolate());
   v8::Context::Scope scope(context);
   v8::Local<v8::Value> value = CompileRun(script);
=======================================
--- /trunk/test/cctest/test-utils.cc    Fri Aug  8 15:46:17 2014 UTC
+++ /trunk/test/cctest/test-utils.cc    Thu Aug 28 09:24:16 2014 UTC
@@ -223,7 +223,7 @@


// TODO(svenpanne) Unconditionally test this when our infrastructure is fixed.
-#if !V8_CC_MSVC && !V8_OS_NACL
+#if !V8_OS_NACL
 TEST(CPlusPlus11Features) {
   struct S {
     bool x;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to