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

Unified Diff: src/ic.cc

Issue 7037025: Fix handling of -0 in the unary-op IC and avoid repeated patching/transitions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 7 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 | « src/ic.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic.cc
===================================================================
--- src/ic.cc (revision 7936)
+++ src/ic.cc (working copy)
@@ -2200,9 +2200,23 @@
}
-TRUnaryOpIC::TypeInfo TRUnaryOpIC::JoinTypes(TRUnaryOpIC::TypeInfo x,
- TRUnaryOpIC::TypeInfo y) {
- return x >= y ? x : y;
+TRUnaryOpIC::TypeInfo TRUnaryOpIC::ComputeNewType(
+ TRUnaryOpIC::TypeInfo type,
+ TRUnaryOpIC::TypeInfo previous) {
+ switch (previous) {
+ case TRUnaryOpIC::UNINITIALIZED:
+ return type;
+ case TRUnaryOpIC::SMI:
+ return (type == TRUnaryOpIC::GENERIC)
+ ? TRUnaryOpIC::GENERIC
+ : TRUnaryOpIC::HEAP_NUMBER;
+ case TRUnaryOpIC::HEAP_NUMBER:
+ return TRUnaryOpIC::GENERIC;
+ case TRUnaryOpIC::GENERIC:
+ // We should never do patching if we are in GENERIC state.
+ UNREACHABLE();
+ return TRUnaryOpIC::GENERIC;
+ }
}
@@ -2314,7 +2328,7 @@
static_cast<TRUnaryOpIC::TypeInfo>(Smi::cast(args[3])->value());
TRUnaryOpIC::TypeInfo type = TRUnaryOpIC::GetTypeInfo(operand);
- type = TRUnaryOpIC::JoinTypes(type, previous_type);
+ type = TRUnaryOpIC::ComputeNewType(type, previous_type);
Handle<Code> code = GetTypeRecordingUnaryOpStub(key, type);
if (!code.is_null()) {
« no previous file with comments | « src/ic.h ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698