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

Unified Diff: src/ic.cc

Issue 7063017: Rename TypeRecording...Stub into ...Stub. (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/log.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 8025)
+++ src/ic.cc (working copy)
@@ -306,8 +306,8 @@
return KeyedStoreIC::Clear(address, target);
case Code::CALL_IC: return CallIC::Clear(address, target);
case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target);
- case Code::TYPE_RECORDING_UNARY_OP_IC:
- case Code::TYPE_RECORDING_BINARY_OP_IC:
+ case Code::UNARY_OP_IC:
+ case Code::BINARY_OP_IC:
case Code::COMPARE_IC:
// Clearing these is tricky and does not
// make any performance difference.
@@ -2157,12 +2157,12 @@
}
-void TRUnaryOpIC::patch(Code* code) {
+void UnaryOpIC::patch(Code* code) {
set_target(code);
}
-const char* TRUnaryOpIC::GetName(TypeInfo type_info) {
+const char* UnaryOpIC::GetName(TypeInfo type_info) {
switch (type_info) {
case UNINITIALIZED: return "Uninitialized";
case SMI: return "Smi";
@@ -2173,7 +2173,7 @@
}
-TRUnaryOpIC::State TRUnaryOpIC::ToState(TypeInfo type_info) {
+UnaryOpIC::State UnaryOpIC::ToState(TypeInfo type_info) {
switch (type_info) {
case UNINITIALIZED:
return ::v8::internal::UNINITIALIZED;
@@ -2187,7 +2187,7 @@
return ::v8::internal::UNINITIALIZED;
}
-TRUnaryOpIC::TypeInfo TRUnaryOpIC::GetTypeInfo(Handle<Object> operand) {
+UnaryOpIC::TypeInfo UnaryOpIC::GetTypeInfo(Handle<Object> operand) {
::v8::internal::TypeInfo operand_type =
::v8::internal::TypeInfo::TypeFromValue(operand);
if (operand_type.IsSmi()) {
@@ -2200,34 +2200,34 @@
}
-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:
+UnaryOpIC::TypeInfo UnaryOpIC::ComputeNewType(
+ UnaryOpIC::TypeInfo current_type,
+ UnaryOpIC::TypeInfo previous_type) {
+ switch (previous_type) {
+ case UnaryOpIC::UNINITIALIZED:
+ return current_type;
+ case UnaryOpIC::SMI:
+ return (current_type == UnaryOpIC::GENERIC)
+ ? UnaryOpIC::GENERIC
+ : UnaryOpIC::HEAP_NUMBER;
+ case UnaryOpIC::HEAP_NUMBER:
+ return UnaryOpIC::GENERIC;
+ case UnaryOpIC::GENERIC:
// We should never do patching if we are in GENERIC state.
UNREACHABLE();
- return TRUnaryOpIC::GENERIC;
+ return UnaryOpIC::GENERIC;
}
UNREACHABLE();
- return TRUnaryOpIC::GENERIC;
+ return UnaryOpIC::GENERIC;
}
-void TRBinaryOpIC::patch(Code* code) {
+void BinaryOpIC::patch(Code* code) {
set_target(code);
}
-const char* TRBinaryOpIC::GetName(TypeInfo type_info) {
+const char* BinaryOpIC::GetName(TypeInfo type_info) {
switch (type_info) {
case UNINITIALIZED: return "Uninitialized";
case SMI: return "SMI";
@@ -2242,7 +2242,7 @@
}
-TRBinaryOpIC::State TRBinaryOpIC::ToState(TypeInfo type_info) {
+BinaryOpIC::State BinaryOpIC::ToState(TypeInfo type_info) {
switch (type_info) {
case UNINITIALIZED:
return ::v8::internal::UNINITIALIZED;
@@ -2261,8 +2261,8 @@
}
-TRBinaryOpIC::TypeInfo TRBinaryOpIC::JoinTypes(TRBinaryOpIC::TypeInfo x,
- TRBinaryOpIC::TypeInfo y) {
+BinaryOpIC::TypeInfo BinaryOpIC::JoinTypes(BinaryOpIC::TypeInfo x,
+ BinaryOpIC::TypeInfo y) {
if (x == UNINITIALIZED) return y;
if (y == UNINITIALIZED) return x;
if (x == y) return x;
@@ -2276,8 +2276,8 @@
}
-TRBinaryOpIC::TypeInfo TRBinaryOpIC::GetTypeInfo(Handle<Object> left,
- Handle<Object> right) {
+BinaryOpIC::TypeInfo BinaryOpIC::GetTypeInfo(Handle<Object> left,
+ Handle<Object> right) {
::v8::internal::TypeInfo left_type =
::v8::internal::TypeInfo::TypeFromValue(left);
::v8::internal::TypeInfo right_type =
@@ -2315,32 +2315,31 @@
// defined in code-stubs-<arch>.cc
// Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
-Handle<Code> GetTypeRecordingUnaryOpStub(int key,
- TRUnaryOpIC::TypeInfo type_info);
+Handle<Code> GetUnaryOpStub(int key, UnaryOpIC::TypeInfo type_info);
-RUNTIME_FUNCTION(MaybeObject*, TypeRecordingUnaryOp_Patch) {
+RUNTIME_FUNCTION(MaybeObject*, UnaryOp_Patch) {
ASSERT(args.length() == 4);
HandleScope scope(isolate);
Handle<Object> operand = args.at<Object>(0);
int key = Smi::cast(args[1])->value();
Token::Value op = static_cast<Token::Value>(Smi::cast(args[2])->value());
- TRUnaryOpIC::TypeInfo previous_type =
- static_cast<TRUnaryOpIC::TypeInfo>(Smi::cast(args[3])->value());
+ UnaryOpIC::TypeInfo previous_type =
+ static_cast<UnaryOpIC::TypeInfo>(Smi::cast(args[3])->value());
- TRUnaryOpIC::TypeInfo type = TRUnaryOpIC::GetTypeInfo(operand);
- type = TRUnaryOpIC::ComputeNewType(type, previous_type);
+ UnaryOpIC::TypeInfo type = UnaryOpIC::GetTypeInfo(operand);
+ type = UnaryOpIC::ComputeNewType(type, previous_type);
- Handle<Code> code = GetTypeRecordingUnaryOpStub(key, type);
+ Handle<Code> code = GetUnaryOpStub(key, type);
if (!code.is_null()) {
if (FLAG_trace_ic) {
- PrintF("[TypeRecordingUnaryOpIC (%s->%s)#%s]\n",
- TRUnaryOpIC::GetName(previous_type),
- TRUnaryOpIC::GetName(type),
+ PrintF("[UnaryOpIC (%s->%s)#%s]\n",
+ UnaryOpIC::GetName(previous_type),
+ UnaryOpIC::GetName(type),
Token::Name(op));
}
- TRUnaryOpIC ic(isolate);
+ UnaryOpIC ic(isolate);
ic.patch(*code);
}
@@ -2371,12 +2370,12 @@
// defined in code-stubs-<arch>.cc
// Only needed to remove dependency of ic.cc on code-stubs-<arch>.h.
-Handle<Code> GetTypeRecordingBinaryOpStub(int key,
- TRBinaryOpIC::TypeInfo type_info,
- TRBinaryOpIC::TypeInfo result_type);
+Handle<Code> GetBinaryOpStub(int key,
+ BinaryOpIC::TypeInfo type_info,
+ BinaryOpIC::TypeInfo result_type);
-RUNTIME_FUNCTION(MaybeObject*, TypeRecordingBinaryOp_Patch) {
+RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) {
ASSERT(args.length() == 5);
HandleScope scope(isolate);
@@ -2384,17 +2383,17 @@
Handle<Object> right = args.at<Object>(1);
int key = Smi::cast(args[2])->value();
Token::Value op = static_cast<Token::Value>(Smi::cast(args[3])->value());
- TRBinaryOpIC::TypeInfo previous_type =
- static_cast<TRBinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
+ BinaryOpIC::TypeInfo previous_type =
+ static_cast<BinaryOpIC::TypeInfo>(Smi::cast(args[4])->value());
- TRBinaryOpIC::TypeInfo type = TRBinaryOpIC::GetTypeInfo(left, right);
- type = TRBinaryOpIC::JoinTypes(type, previous_type);
- TRBinaryOpIC::TypeInfo result_type = TRBinaryOpIC::UNINITIALIZED;
- if ((type == TRBinaryOpIC::STRING || type == TRBinaryOpIC::BOTH_STRING) &&
+ BinaryOpIC::TypeInfo type = BinaryOpIC::GetTypeInfo(left, right);
+ type = BinaryOpIC::JoinTypes(type, previous_type);
+ BinaryOpIC::TypeInfo result_type = BinaryOpIC::UNINITIALIZED;
+ if ((type == BinaryOpIC::STRING || type == BinaryOpIC::BOTH_STRING) &&
op != Token::ADD) {
- type = TRBinaryOpIC::GENERIC;
+ type = BinaryOpIC::GENERIC;
}
- if (type == TRBinaryOpIC::SMI && previous_type == TRBinaryOpIC::SMI) {
+ if (type == BinaryOpIC::SMI && previous_type == BinaryOpIC::SMI) {
if (op == Token::DIV ||
op == Token::MUL ||
op == Token::SHR ||
@@ -2403,31 +2402,31 @@
// That is the only way to get here from the Smi stub.
// With 32-bit Smis, all overflows give heap numbers, but with
// 31-bit Smis, most operations overflow to int32 results.
- result_type = TRBinaryOpIC::HEAP_NUMBER;
+ result_type = BinaryOpIC::HEAP_NUMBER;
} else {
// Other operations on SMIs that overflow yield int32s.
- result_type = TRBinaryOpIC::INT32;
+ result_type = BinaryOpIC::INT32;
}
}
- if (type == TRBinaryOpIC::INT32 && previous_type == TRBinaryOpIC::INT32) {
+ if (type == BinaryOpIC::INT32 && previous_type == BinaryOpIC::INT32) {
// We must be here because an operation on two INT32 types overflowed.
- result_type = TRBinaryOpIC::HEAP_NUMBER;
+ result_type = BinaryOpIC::HEAP_NUMBER;
}
- Handle<Code> code = GetTypeRecordingBinaryOpStub(key, type, result_type);
+ Handle<Code> code = GetBinaryOpStub(key, type, result_type);
if (!code.is_null()) {
if (FLAG_trace_ic) {
- PrintF("[TypeRecordingBinaryOpIC (%s->(%s->%s))#%s]\n",
- TRBinaryOpIC::GetName(previous_type),
- TRBinaryOpIC::GetName(type),
- TRBinaryOpIC::GetName(result_type),
+ PrintF("[BinaryOpIC (%s->(%s->%s))#%s]\n",
+ BinaryOpIC::GetName(previous_type),
+ BinaryOpIC::GetName(type),
+ BinaryOpIC::GetName(result_type),
Token::Name(op));
}
- TRBinaryOpIC ic(isolate);
+ BinaryOpIC ic(isolate);
ic.patch(*code);
// Activate inlined smi code.
- if (previous_type == TRBinaryOpIC::UNINITIALIZED) {
+ if (previous_type == BinaryOpIC::UNINITIALIZED) {
PatchInlinedSmiCode(ic.address());
}
}
« no previous file with comments | « src/ic.h ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698