Reviewers: Benedikt Meurer,

Message:
I'm wondering if I missed anything else.

Description:
Make helper functions compatible with larger ToBooleanStub types.

I missed some functions that need to change.

LOG=N
BUG=v8:4124

Please review this at https://codereview.chromium.org/1199413009/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -9 lines):
  M src/ast.h
  M src/objects.h
  M src/objects-inl.h
  M src/type-info.h
  M src/type-info.cc


Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 61a6ea936963bab05811fc36f53a4ca58bc6f308..4c65c7f3b83bd4cce6b6a406619a898c3ccd6477 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -379,7 +379,7 @@ class Expression : public AstNode {

   // TODO(rossberg): this should move to its own AST node eventually.
   virtual void RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle);
-  byte to_boolean_types() const {
+  uint16_t to_boolean_types() const {
     return ToBooleanTypesField::decode(bit_field_);
   }

@@ -395,7 +395,7 @@ class Expression : public AstNode {
         bounds_(Bounds::Unbounded(zone)),
         bit_field_(0) {}
   static int parent_num_ids() { return 0; }
-  void set_to_boolean_types(byte types) {
+  void set_to_boolean_types(uint16_t types) {
     bit_field_ = ToBooleanTypesField::update(bit_field_, types);
   }

@@ -409,7 +409,7 @@ class Expression : public AstNode {

   int base_id_;
   Bounds bounds_;
-  class ToBooleanTypesField : public BitField16<byte, 0, 8> {};
+  class ToBooleanTypesField : public BitField16<uint16_t, 0, 9> {};
   uint16_t bit_field_;
   // Ends with 16-bit field; deriving classes in turn begin with
   // 16-bit fields for optimum packing efficiency.
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 819cc46e3ed03ae23f44dc0eadb6f531d2e67d2b..7c871816be769ad331cff1afe61d4882773e4444 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -4683,9 +4683,7 @@ bool Code::back_edges_patched_for_osr() {
 }


-byte Code::to_boolean_state() {
-  return extra_ic_state();
-}
+uint16_t Code::to_boolean_state() { return extra_ic_state(); }


 bool Code::has_function_cache() {
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 6695f3f0fba62ed73cfa700160d3fdb2f053a916..a5277c11f5eb0c3ba88191cb85282cf487f7d15c 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5081,7 +5081,7 @@ class Code: public HeapObject {
   inline bool back_edges_patched_for_osr();

// [to_boolean_foo]: For kind TO_BOOLEAN_IC tells what state the stub is in.
-  inline byte to_boolean_state();
+  inline uint16_t to_boolean_state();

   // [has_function_cache]: For kind STUB tells whether there is a function
   // cache is passed to the stub.
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index f8bfea8f187a934e95c09e74408d961f1ecc9c15..ba983d63a88a7004ef20fbdf8bd2120e7645c2d5 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -430,7 +430,7 @@ void TypeFeedbackOracle::CollectReceiverTypes(T* obj, SmallMapList* types) {
 }


-byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
+uint16_t TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) {
   Handle<Object> object = GetInfo(id);
return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0;
 }
Index: src/type-info.h
diff --git a/src/type-info.h b/src/type-info.h
index 58a40cf34b56a501dbb4c323aeac9f856f7d9c7d..965fca30109aeb3b8db8c892f88d0608f9c7a830 100644
--- a/src/type-info.h
+++ b/src/type-info.h
@@ -78,7 +78,7 @@ class TypeFeedbackOracle: public ZoneObject {
// TODO(1571) We can't use ToBooleanStub::Types as the return value because
   // of various cycles in our headers. Death to tons of implementations in
   // headers!! :-P
-  byte ToBooleanTypes(TypeFeedbackId id);
+  uint16_t ToBooleanTypes(TypeFeedbackId id);

   // Get type information for arithmetic operations and compares.
   void BinaryType(TypeFeedbackId id,


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