Revision: 24393
Author:   [email protected]
Date:     Thu Oct  2 11:52:54 2014 UTC
Log:      Squeeze the layout of expression nodes a bit.

Again 112MB less peak memory usage in the bug mentioned below. :-)
Routed all writes to to_boolean_types_ through its setter on the way.

BUG=417697
LOG=y
[email protected]

Review URL: https://codereview.chromium.org/615423006
https://code.google.com/p/v8/source/detail?r=24393

Modified:
 /branches/bleeding_edge/src/ast.cc
 /branches/bleeding_edge/src/ast.h
 /branches/bleeding_edge/src/parser.cc

=======================================
--- /branches/bleeding_edge/src/ast.cc  Tue Sep 30 10:29:32 2014 UTC
+++ /branches/bleeding_edge/src/ast.cc  Thu Oct  2 11:52:54 2014 UTC
@@ -560,7 +560,7 @@
 // once we use the common type field in the AST consistently.

 void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) {
-  to_boolean_types_ = oracle->ToBooleanTypes(test_id());
+  set_to_boolean_types(oracle->ToBooleanTypes(test_id()));
 }


=======================================
--- /branches/bleeding_edge/src/ast.h   Thu Oct  2 09:38:28 2014 UTC
+++ /branches/bleeding_edge/src/ast.h   Thu Oct  2 11:52:54 2014 UTC
@@ -363,9 +363,12 @@
   void set_bounds(Bounds bounds) { bounds_ = bounds; }

   // Whether the expression is parenthesized
- unsigned parenthesization_level() const { return parenthesization_level_; }
-  bool is_parenthesized() const { return parenthesization_level_ > 0; }
-  void increase_parenthesization_level() { ++parenthesization_level_; }
+  bool is_parenthesized() const { return is_parenthesized_; }
+  bool is_multi_parenthesized() const { return is_multi_parenthesized_; }
+  void increase_parenthesization_level() {
+    is_multi_parenthesized_ = is_parenthesized_;
+    is_parenthesized_ = true;
+  }

   // Type feedback information for assignments and properties.
   virtual bool IsMonomorphic() {
@@ -391,16 +394,18 @@
  protected:
   Expression(Zone* zone, int pos, IdGen* id_gen)
       : AstNode(pos),
+        is_parenthesized_(false),
+        is_multi_parenthesized_(false),
         bounds_(Bounds::Unbounded(zone)),
-        parenthesization_level_(0),
         id_(id_gen->GetNextId()),
         test_id_(id_gen->GetNextId()) {}
   void set_to_boolean_types(byte types) { to_boolean_types_ = types; }

  private:
+  byte to_boolean_types_;
+  bool is_parenthesized_ : 1;
+  bool is_multi_parenthesized_ : 1;
   Bounds bounds_;
-  byte to_boolean_types_;
-  unsigned parenthesization_level_;

   const BailoutId id_;
   const TypeFeedbackId test_id_;
=======================================
--- /branches/bleeding_edge/src/parser.cc       Wed Oct  1 16:54:42 2014 UTC
+++ /branches/bleeding_edge/src/parser.cc       Thu Oct  2 11:52:54 2014 UTC
@@ -3381,7 +3381,7 @@

   // Too many parentheses around expression:
   //   (( ... )) => ...
-  if (expression->parenthesization_level() > 1) return false;
+  if (expression->is_multi_parenthesized()) return false;

   // Case for a single parameter:
   //   (foo) => ...

--
--
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