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

Unified Diff: src/type-info.cc

Issue 18465003: Fix default type feedback returned from the oracle (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added comments Created 7 years, 6 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/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-info.cc
diff --git a/src/type-info.cc b/src/type-info.cc
index ae5bf9719dc62524ba6aee564265b281aa57b8a0..83eb9c45b49932755bcc998d3e4d821828b556da 100644
--- a/src/type-info.cc
+++ b/src/type-info.cc
@@ -356,9 +356,12 @@ void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
Handle<Type>* left_type,
Handle<Type>* right_type,
Handle<Type>* combined_type) {
- *left_type = *right_type = *combined_type = handle(Type::Any(), isolate_);
Handle<Object> info = GetInfo(id);
- if (!info->IsCode()) return;
+ if (!info->IsCode()) {
+ // For some comparisons we don't have ICs, e.g. LiteralCompareTypeof.
+ *left_type = *right_type = *combined_type = handle(Type::None(), isolate_);
+ return;
+ }
Handle<Code> code = Handle<Code>::cast(info);
Handle<Map> map;
@@ -387,7 +390,9 @@ void TypeFeedbackOracle::CompareType(TypeFeedbackId id,
Handle<Type> TypeFeedbackOracle::UnaryType(TypeFeedbackId id) {
Handle<Object> object = GetInfo(id);
- if (!object->IsCode()) return handle(Type::Any(), isolate());
+ if (!object->IsCode()) {
+ return handle(Type::None(), isolate());
+ }
Handle<Code> code = Handle<Code>::cast(object);
ASSERT(code->is_unary_op_stub());
return UnaryOpIC::TypeInfoToType(
@@ -401,10 +406,13 @@ void TypeFeedbackOracle::BinaryType(TypeFeedbackId id,
Handle<Type>* result,
Maybe<int>* fixed_right_arg) {
Handle<Object> object = GetInfo(id);
- *left = *right = *result = handle(Type::Any(), isolate_);
- if (!object->IsCode()) return;
+ if (!object->IsCode()) {
+ // For some binary ops we don't have ICs, e.g. Token::COMMA.
+ *left = *right = *result = handle(Type::None(), isolate_);
+ return;
+ }
Handle<Code> code = Handle<Code>::cast(object);
- if (!code->is_binary_op_stub()) return;
+ ASSERT(code->is_binary_op_stub());
int minor_key = code->stub_info();
BinaryOpIC::StubInfoToType(minor_key, left, right, result, isolate());
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698