Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/code-stubs.h

Issue 7484022: Do not explicitly record undetectable objects in the ToBoolean stub. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
===================================================================
--- src/code-stubs.h (revision 8716)
+++ src/code-stubs.h (working copy)
@@ -905,7 +905,6 @@
BOOLEAN,
NULL_TYPE,
SMI,
- UNDETECTABLE,
SPEC_OBJECT,
STRING,
HEAP_NUMBER,
@@ -913,21 +912,25 @@
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(int bits) : set_(bits) {}
+ 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); }
- int ToInt() const { return set_.ToIntegral(); }
+ byte ToByte() const { return set_.ToIntegral(); }
void Print(StringStream* stream);
void TraceTransition(Types to);
bool Record(Handle<Object> object);
private:
- EnumSet<Type> set_;
+ EnumSet<Type, byte> set_;
};
explicit ToBooleanStub(Register tos, Types types = Types())
@@ -939,8 +942,12 @@
private:
Major MajorKey() { return ToBoolean; }
- int MinorKey() { return (tos_.code() << NUMBER_OF_TYPES) | types_.ToInt(); }
+ 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,
Handle<Object> value,
« no previous file with comments | « no previous file | src/code-stubs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698