Revision: 18019
Author:   [email protected]
Date:     Fri Nov 22 14:19:17 2013 UTC
Log:      Merged r17599 into 3.21 branch.

Do not add values to HGraph in Lithium.

BUG=298269
[email protected]

Review URL: https://chromiumcodereview.appspot.com/82553010
http://code.google.com/p/v8/source/detail?r=18019

Modified:
 /branches/3.21/src/hydrogen.cc
 /branches/3.21/src/hydrogen.h
 /branches/3.21/src/lithium.cc
 /branches/3.21/src/version.cc

=======================================
--- /branches/3.21/src/hydrogen.cc      Mon Oct 28 09:18:18 2013 UTC
+++ /branches/3.21/src/hydrogen.cc      Fri Nov 22 14:19:17 2013 UTC
@@ -671,6 +671,21 @@

 #undef DEFINE_GET_CONSTANT

+#define DEFINE_IS_CONSTANT(Name, name) \ +bool HGraph::IsConstant##Name(HConstant* constant) { \ + return constant_##name##_.is_set() && constant == constant_##name##_.get(); \
+}
+DEFINE_IS_CONSTANT(Undefined, undefined)
+DEFINE_IS_CONSTANT(0, 0)
+DEFINE_IS_CONSTANT(1, 1)
+DEFINE_IS_CONSTANT(Minus1, minus1)
+DEFINE_IS_CONSTANT(True, true)
+DEFINE_IS_CONSTANT(False, false)
+DEFINE_IS_CONSTANT(Hole, the_hole)
+DEFINE_IS_CONSTANT(Null, null)
+
+#undef DEFINE_IS_CONSTANT
+

 HConstant* HGraph::GetInvalidContext() {
   return GetConstant(&constant_invalid_context_, 0xFFFFC0C7);
@@ -678,14 +693,14 @@


 bool HGraph::IsStandardConstant(HConstant* constant) {
-  if (constant == GetConstantUndefined()) return true;
-  if (constant == GetConstant0()) return true;
-  if (constant == GetConstant1()) return true;
-  if (constant == GetConstantMinus1()) return true;
-  if (constant == GetConstantTrue()) return true;
-  if (constant == GetConstantFalse()) return true;
-  if (constant == GetConstantHole()) return true;
-  if (constant == GetConstantNull()) return true;
+  if (IsConstantUndefined(constant)) return true;
+  if (IsConstant0(constant)) return true;
+  if (IsConstant1(constant)) return true;
+  if (IsConstantMinus1(constant)) return true;
+  if (IsConstantTrue(constant)) return true;
+  if (IsConstantFalse(constant)) return true;
+  if (IsConstantHole(constant)) return true;
+  if (IsConstantNull(constant)) return true;
   return false;
 }

@@ -2113,7 +2128,8 @@
       depends_on_empty_array_proto_elements_(false),
       type_change_checksum_(0),
       maximum_environment_size_(0),
-      no_side_effects_scope_count_(0) {
+      no_side_effects_scope_count_(0),
+      disallow_adding_new_values_(false) {
   if (info->IsStub()) {
     HydrogenCodeStub* stub = info->code_stub();
     CodeStubInterfaceDescriptor* descriptor =
=======================================
--- /branches/3.21/src/hydrogen.h       Wed Sep 18 15:29:06 2013 UTC
+++ /branches/3.21/src/hydrogen.h       Fri Nov 22 14:19:17 2013 UTC
@@ -333,9 +333,9 @@
   void CollectPhis();

   void set_undefined_constant(HConstant* constant) {
-    undefined_constant_.set(constant);
+    constant_undefined_.set(constant);
   }
- HConstant* GetConstantUndefined() const { return undefined_constant_.get(); } + HConstant* GetConstantUndefined() const { return constant_undefined_.get(); }
   HConstant* GetConstant0();
   HConstant* GetConstant1();
   HConstant* GetConstantMinus1();
@@ -345,6 +345,14 @@
   HConstant* GetConstantNull();
   HConstant* GetInvalidContext();

+  bool IsConstantUndefined(HConstant* constant);
+  bool IsConstant0(HConstant* constant);
+  bool IsConstant1(HConstant* constant);
+  bool IsConstantMinus1(HConstant* constant);
+  bool IsConstantTrue(HConstant* constant);
+  bool IsConstantFalse(HConstant* constant);
+  bool IsConstantHole(HConstant* constant);
+  bool IsConstantNull(HConstant* constant);
   bool IsStandardConstant(HConstant* constant);

   HBasicBlock* CreateBasicBlock();
@@ -359,6 +367,7 @@
   int GetMaximumValueID() const { return values_.length(); }
   int GetNextBlockID() { return next_block_id_++; }
   int GetNextValueID(HValue* value) {
+    ASSERT(!disallow_adding_new_values_);
     values_.Add(value, zone());
     return values_.length() - 1;
   }
@@ -366,6 +375,9 @@
     if (id >= 0 && id < values_.length()) return values_[id];
     return NULL;
   }
+  void DisallowAddingNewValues() {
+    disallow_adding_new_values_ = true;
+  }

   bool Optimize(BailoutReason* bailout_reason);

@@ -477,7 +489,7 @@
   ZoneList<HValue*> values_;
   ZoneList<HPhi*>* phi_list_;
   ZoneList<HInstruction*>* uint32_instructions_;
-  SetOncePointer<HConstant> undefined_constant_;
+  SetOncePointer<HConstant> constant_undefined_;
   SetOncePointer<HConstant> constant_0_;
   SetOncePointer<HConstant> constant_1_;
   SetOncePointer<HConstant> constant_minus1_;
@@ -500,6 +512,7 @@
   int type_change_checksum_;
   int maximum_environment_size_;
   int no_side_effects_scope_count_;
+  bool disallow_adding_new_values_;

   DISALLOW_COPY_AND_ASSIGN(HGraph);
 };
=======================================
--- /branches/3.21/src/lithium.cc       Thu Nov 21 10:28:12 2013 UTC
+++ /branches/3.21/src/lithium.cc       Fri Nov 22 14:19:17 2013 UTC
@@ -392,6 +392,7 @@
 LChunk* LChunk::NewChunk(HGraph* graph) {
   DisallowHandleAllocation no_handles;
   DisallowHeapAllocation no_gc;
+  graph->DisallowAddingNewValues();
   int values = graph->GetMaximumValueID();
   CompilationInfo* info = graph->info();
   if (values > LUnallocated::kMaxVirtualRegisters) {
=======================================
--- /branches/3.21/src/version.cc       Thu Nov 21 15:06:14 2013 UTC
+++ /branches/3.21/src/version.cc       Fri Nov 22 14:19:17 2013 UTC
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     21
 #define BUILD_NUMBER      18
-#define PATCH_LEVEL       12
+#define PATCH_LEVEL       13
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

--
--
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/groups/opt_out.

Reply via email to