Upgrade to V8 3.5
Merge V8 3.5.10.24
Simple merge required updates to makefiles only.
Bug: 5688872
Change-Id: I0acdb9a1a53919d84e9a7525308e8371739d2f06
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 17c245c..89e99a8 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -900,14 +900,66 @@
class ToBooleanStub: public CodeStub {
public:
- explicit ToBooleanStub(Register tos) : tos_(tos) { }
+ enum Type {
+ UNDEFINED,
+ BOOLEAN,
+ NULL_TYPE,
+ SMI,
+ SPEC_OBJECT,
+ STRING,
+ HEAP_NUMBER,
+ NUMBER_OF_TYPES
+ };
+
+ // At most 8 different types can be distinguished, because the Code object
+ // only has room for a single byte to hold a set of these types. :-P
+ STATIC_ASSERT(NUMBER_OF_TYPES <= 8);
+
+ class Types {
+ public:
+ Types() {}
+ explicit Types(byte bits) : set_(bits) {}
+
+ bool IsEmpty() const { return set_.IsEmpty(); }
+ bool Contains(Type type) const { return set_.Contains(type); }
+ void Add(Type type) { set_.Add(type); }
+ byte ToByte() const { return set_.ToIntegral(); }
+ void Print(StringStream* stream) const;
+ void TraceTransition(Types to) const;
+ bool Record(Handle<Object> object);
+ bool NeedsMap() const;
+ bool CanBeUndetectable() const;
+
+ private:
+ EnumSet<Type, byte> set_;
+ };
+
+ static Types no_types() { return Types(); }
+ static Types all_types() { return Types((1 << NUMBER_OF_TYPES) - 1); }
+
+ explicit ToBooleanStub(Register tos, Types types = Types())
+ : tos_(tos), types_(types) { }
void Generate(MacroAssembler* masm);
+ virtual int GetCodeKind() { return Code::TO_BOOLEAN_IC; }
+ virtual void PrintName(StringStream* stream);
private:
- Register tos_;
Major MajorKey() { return ToBoolean; }
- int MinorKey() { return tos_.code(); }
+ int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | types_.ToByte(); }
+
+ virtual void FinishCode(Code* code) {
+ code->set_to_boolean_state(types_.ToByte());
+ }
+
+ void CheckOddball(MacroAssembler* masm,
+ Type type,
+ Heap::RootListIndex value,
+ bool result);
+ void GenerateTypeTransition(MacroAssembler* masm);
+
+ Register tos_;
+ Types types_;
};
} } // namespace v8::internal