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

Unified Diff: src/type-info.cc

Issue 7060010: Merge bleeding edge into the GC branch up to 7948. The asserts (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
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/type-info.h ('k') | src/unbound-queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
===================================================================
--- src/type-info.cc (revision 7948)
+++ src/type-info.cc (working copy)
@@ -82,7 +82,8 @@
if (map_or_code->IsMap()) return true;
if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code));
- return code->kind() == Code::KEYED_EXTERNAL_ARRAY_LOAD_IC &&
+ return code->is_keyed_load_stub() &&
+ code->ic_state() == MONOMORPHIC &&
code->FindFirstMap() != NULL;
}
return false;
@@ -94,8 +95,8 @@
if (map_or_code->IsMap()) return true;
if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code));
- return code->kind() == Code::KEYED_EXTERNAL_ARRAY_STORE_IC &&
- code->FindFirstMap() != NULL;
+ return code->is_keyed_store_stub() &&
+ code->ic_state() == MONOMORPHIC;
}
return false;
}
@@ -113,7 +114,9 @@
Handle<HeapObject>::cast(GetInfo(expr->id())));
if (map_or_code->IsCode()) {
Handle<Code> code(Code::cast(*map_or_code));
- return Handle<Map>(code->FindFirstMap());
+ Map* first_map = code->FindFirstMap();
+ ASSERT(first_map != NULL);
+ return Handle<Map>(first_map);
}
return Handle<Map>(Map::cast(*map_or_code));
}
@@ -229,6 +232,9 @@
return TypeInfo::Smi();
case CompareIC::HEAP_NUMBERS:
return TypeInfo::Number();
+ case CompareIC::SYMBOLS:
+ case CompareIC::STRINGS:
+ return TypeInfo::String();
case CompareIC::OBJECTS:
// TODO(kasperl): We really need a type for JS objects here.
return TypeInfo::NonPrimitive();
@@ -239,8 +245,18 @@
}
+bool TypeFeedbackOracle::IsSymbolCompare(CompareOperation* expr) {
+ Handle<Object> object = GetInfo(expr->id());
+ if (!object->IsCode()) return false;
+ Handle<Code> code = Handle<Code>::cast(object);
+ if (!code->is_compare_ic_stub()) return false;
+ CompareIC::State state = static_cast<CompareIC::State>(code->compare_state());
+ return state == CompareIC::SYMBOLS;
+}
+
+
TypeInfo TypeFeedbackOracle::UnaryType(UnaryOperation* expr) {
- Handle<Object> object = GetInfo(expr->position());
+ Handle<Object> object = GetInfo(expr->id());
TypeInfo unknown = TypeInfo::Unknown();
if (!object->IsCode()) return unknown;
Handle<Code> code = Handle<Code>::cast(object);
@@ -428,11 +444,12 @@
Code::Kind kind = target->kind();
if (kind == Code::TYPE_RECORDING_BINARY_OP_IC ||
+ kind == Code::TYPE_RECORDING_UNARY_OP_IC ||
kind == Code::COMPARE_IC) {
SetInfo(id, target);
} else if (state == MONOMORPHIC) {
- if (kind == Code::KEYED_EXTERNAL_ARRAY_LOAD_IC ||
- kind == Code::KEYED_EXTERNAL_ARRAY_STORE_IC) {
+ if (kind == Code::KEYED_LOAD_IC ||
+ kind == Code::KEYED_STORE_IC) {
SetInfo(id, target);
} else if (kind != Code::CALL_IC ||
target->check_type() == RECEIVER_MAP_CHECK) {
« no previous file with comments | « src/type-info.h ('k') | src/unbound-queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698