Chromium Code Reviews| Index: src/ic.cc |
| diff --git a/src/ic.cc b/src/ic.cc |
| index 08df2261fded944933ef595d3b325924cc1300ab..014d67b5811cf286904e0df7b693ab1b36ea88ca 100644 |
| --- a/src/ic.cc |
| +++ b/src/ic.cc |
| @@ -2329,7 +2329,8 @@ BinaryOpIC::State::State(ExtraICState extra_ic_state) { |
| 1 << FixedRightArgValueField::decode(extra_ic_state)); |
| left_kind_ = LeftKindField::decode(extra_ic_state); |
| if (fixed_right_arg_.has_value) { |
| - right_kind_ = Smi::IsValid(fixed_right_arg_.value) ? SMI : INT32; |
| + ASSERT(Smi::IsValid(fixed_right_arg_.value)); |
|
mvstanton
2013/12/03 10:34:12
How are you sure that fixed_right_arg will have a
Benedikt Meurer
2013/12/03 10:36:39
Because we have only 4 bits to encode the log2 of
|
| + right_kind_ = SMI; |
| } else { |
| right_kind_ = RightKindField::decode(extra_ic_state); |
| } |
| @@ -2582,6 +2583,17 @@ void BinaryOpIC::State::GenerateAheadOfTime( |
| } |
| +Handle<Type> BinaryOpIC::State::GetRightType(Isolate* isolate) const { |
| + if (fixed_right_arg_.has_value) { |
| + Handle<Smi> value = handle(Smi::FromInt(fixed_right_arg_.value), isolate); |
| + Handle<Type> type = handle(Type::Constant(value, isolate), isolate); |
| + ASSERT(type->Is(KindToType(right_kind_, isolate))); |
| + return type; |
| + } |
| + return KindToType(right_kind_, isolate); |
| +} |
| + |
| + |
| Handle<Type> BinaryOpIC::State::GetResultType(Isolate* isolate) const { |
| Kind result_kind = result_kind_; |
| if (HasSideEffects()) { |