Index: src/ast.cc |
diff --git a/src/ast.cc b/src/ast.cc |
index da86a1162d7bc726ab7c4ec5f8f94ff11ca7f26d..566bcd2ce6f92e9ddfcfacb53853e37094f3cb42 100644 |
--- a/src/ast.cc |
+++ b/src/ast.cc |
@@ -590,12 +590,28 @@ bool FunctionDeclaration::IsInlineable() const { |
// TODO(rossberg): all RecordTypeFeedback functions should disappear |
// once we use the common type field in the AST consistently. |
- |
void Expression::RecordToBooleanTypeFeedback(TypeFeedbackOracle* oracle) { |
to_boolean_types_ = oracle->ToBooleanTypes(test_id()); |
} |
+Call::CallType Call::GetCallType(Isolate* isolate) const { |
+ VariableProxy* proxy = expression()->AsVariableProxy(); |
+ if (proxy != NULL) { |
+ if (proxy->var()->is_possibly_eval(isolate)) { |
+ return POSSIBLY_EVAL_CALL; |
+ } else if (proxy->var()->IsUnallocated()) { |
+ return GLOBAL_CALL; |
+ } else if (proxy->var()->IsLookupSlot()) { |
+ return LOOKUP_SLOT_CALL; |
+ } |
+ } |
+ |
+ Property* property = expression()->AsProperty(); |
+ return property != NULL ? PROPERTY_CALL : OTHER_CALL; |
+} |
+ |
+ |
bool Call::ComputeTarget(Handle<Map> type, Handle<String> name) { |
// If there is an interceptor, we can't compute the target for a direct call. |
if (type->has_named_interceptor()) return false; |