Index: src/ic.h |
diff --git a/src/ic.h b/src/ic.h |
index fa7ed6dbc1381f60aee70703a65d34566179dfba..2fb769e5f3f28a894c6ca740f3ba7afd4079d129 100644 |
--- a/src/ic.h |
+++ b/src/ic.h |
@@ -853,10 +853,26 @@ class BinaryOpIC: public IC { |
right_kind_ > SMI && right_kind_ <= NUMBER)); |
} |
+ // Returns true if the IC _can_ create allocation mementos. |
+ bool CanCreateAllocationMementos() const { |
mvstanton
2013/12/11 08:15:29
Change Can to Could, because Should and Could are
Benedikt Meurer
2013/12/11 12:17:46
Done.
|
+ if (left_kind_ == STRING || right_kind_ == STRING) { |
+ ASSERT_EQ(Token::ADD, op_); |
+ return true; |
+ } |
+ return false; |
+ } |
+ |
+ // Returns true if the IC _should_ create allocation mementos. |
+ bool ShouldCreateAllocationMementos() const { |
+ return FLAG_allocation_site_pretenuring && CanCreateAllocationMementos(); |
+ } |
+ |
bool HasSideEffects() const { |
return Max(left_kind_, right_kind_) == GENERIC; |
} |
+ // Returns true if the IC should enable the inline smi code (i.e. if either |
+ // parameter may be a smi). |
bool UseInlinedSmiCode() const { |
return KindMaybeSmi(left_kind_) || KindMaybeSmi(right_kind_); |
} |
@@ -918,8 +934,9 @@ class BinaryOpIC: public IC { |
static Builtins::JavaScript TokenToJSBuiltin(Token::Value op); |
- MUST_USE_RESULT MaybeObject* Transition(Handle<Object> left, |
- Handle<Object> right); |
+ MaybeObject* Transition(Handle<AllocationSite> allocation_site, |
+ Handle<Object> left, |
+ Handle<Object> right) V8_WARN_UNUSED_RESULT; |
}; |
@@ -1028,6 +1045,7 @@ DECLARE_RUNTIME_FUNCTION(MaybeObject*, StoreIC_MissFromStubFailure); |
DECLARE_RUNTIME_FUNCTION(MaybeObject*, KeyedCallIC_MissFromStubFailure); |
DECLARE_RUNTIME_FUNCTION(MaybeObject*, ElementsTransitionAndStoreIC_Miss); |
DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_Miss); |
+DECLARE_RUNTIME_FUNCTION(MaybeObject*, BinaryOpIC_MissWithAllocationSite); |
DECLARE_RUNTIME_FUNCTION(MaybeObject*, CompareNilIC_Miss); |
DECLARE_RUNTIME_FUNCTION(MaybeObject*, ToBooleanIC_Miss); |