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

Unified Diff: src/ic.h

Issue 6879081: Added type recording for unary minus and unary bitwise negation. Note that the (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Incorporated Florian's suggested changes Created 9 years, 8 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
Index: src/ic.h
===================================================================
--- src/ic.h (revision 7683)
+++ src/ic.h (working copy)
@@ -53,6 +53,7 @@
ICU(LoadPropertyWithInterceptorForCall) \
ICU(KeyedLoadPropertyWithInterceptor) \
ICU(StoreInterceptorProperty) \
+ ICU(TypeRecordingUnaryOp_Patch) \
ICU(TypeRecordingBinaryOp_Patch) \
ICU(CompareIC_Miss)
//
@@ -529,6 +530,32 @@
};
+class TRUnaryOpIC: public IC {
+ public:
+
+ // sorted: increasingly more unspecific (ignoring UNINITIALIZED)
+ // TODO(svenpanne) Using enums+switch is an antipattern, use a class instead.
+ enum TypeInfo {
+ UNINITIALIZED,
+ SMI,
+ HEAP_NUMBER,
+ GENERIC
+ };
+
+ explicit TRUnaryOpIC(Isolate* isolate) : IC(NO_EXTRA_FRAME, isolate) { }
+
+ void patch(Code* code);
+
+ static const char* GetName(TypeInfo type_info);
+
+ static State ToState(TypeInfo type_info);
+
+ static TypeInfo GetTypeInfo(Handle<Object> operand);
+
+ static TypeInfo JoinTypes(TypeInfo x, TypeInfo y);
+};
+
+
// Type Recording BinaryOpIC, that records the types of the inputs and outputs.
class TRBinaryOpIC: public IC {
public:

Powered by Google App Engine
This is Rietveld 408576698