Index: src/type-info.cc |
diff --git a/src/type-info.cc b/src/type-info.cc |
index 4ad66f85573e78786bb0716be81550146bdd627a..587d4ade0a3eaa36105321efcae26b8228bbfcf3 100644 |
--- a/src/type-info.cc |
+++ b/src/type-info.cc |
@@ -142,6 +142,23 @@ bool TypeFeedbackOracle::CallIsMonomorphic(FeedbackVectorICSlot slot) { |
} |
+bool TypeFeedbackOracle::CallIsBuiltinWithMinusZeroResult( |
+ FeedbackVectorICSlot slot) { |
+ Handle<Object> value = GetInfo(slot); |
+ if (!value->IsJSFunction()) return false; |
+ Handle<JSFunction> maybe_round(Handle<JSFunction>::cast(value)); |
+ SmartArrayPointer<char> n = maybe_round->shared()->DebugName()->ToCString(); |
mvstanton
2015/05/04 09:41:22
You don't need n here.
danno
2015/05/04 14:31:56
Done.
|
+ if (!maybe_round->shared()->HasBuiltinFunctionId()) return false; |
+ if (maybe_round->shared()->builtin_function_id() != kMathRound && |
+ maybe_round->shared()->builtin_function_id() != kMathFloor && |
+ maybe_round->shared()->builtin_function_id() != kMathCeil) { |
+ return false; |
+ } |
+ return feedback_vector_->get(feedback_vector_->GetIndex(slot) + 1) == |
+ Smi::FromInt(CallICStub::kHasReturnedMinusZeroSentinel); |
+} |
+ |
+ |
bool TypeFeedbackOracle::CallNewIsMonomorphic(FeedbackVectorSlot slot) { |
Handle<Object> info = GetInfo(slot); |
return FLAG_pretenuring_call_new |