OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/bits.h" |
10 #include "src/codegen.h" | 11 #include "src/codegen.h" |
11 #include "src/conversions.h" | 12 #include "src/conversions.h" |
12 #include "src/execution.h" | 13 #include "src/execution.h" |
13 #include "src/ic/call-optimization.h" | 14 #include "src/ic/call-optimization.h" |
14 #include "src/ic/handler-compiler.h" | 15 #include "src/ic/handler-compiler.h" |
15 #include "src/ic/ic-inl.h" | 16 #include "src/ic/ic-inl.h" |
16 #include "src/ic/ic-compiler.h" | 17 #include "src/ic/ic-compiler.h" |
17 #include "src/ic/stub-cache.h" | 18 #include "src/ic/stub-cache.h" |
18 #include "src/prototype.h" | 19 #include "src/prototype.h" |
19 #include "src/runtime.h" | 20 #include "src/runtime.h" |
(...skipping 2429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2449 void BinaryOpIC::State::Update(Handle<Object> left, Handle<Object> right, | 2450 void BinaryOpIC::State::Update(Handle<Object> left, Handle<Object> right, |
2450 Handle<Object> result) { | 2451 Handle<Object> result) { |
2451 ExtraICState old_extra_ic_state = GetExtraICState(); | 2452 ExtraICState old_extra_ic_state = GetExtraICState(); |
2452 | 2453 |
2453 left_kind_ = UpdateKind(left, left_kind_); | 2454 left_kind_ = UpdateKind(left, left_kind_); |
2454 right_kind_ = UpdateKind(right, right_kind_); | 2455 right_kind_ = UpdateKind(right, right_kind_); |
2455 | 2456 |
2456 int32_t fixed_right_arg_value = 0; | 2457 int32_t fixed_right_arg_value = 0; |
2457 bool has_fixed_right_arg = | 2458 bool has_fixed_right_arg = |
2458 op_ == Token::MOD && right->ToInt32(&fixed_right_arg_value) && | 2459 op_ == Token::MOD && right->ToInt32(&fixed_right_arg_value) && |
2459 fixed_right_arg_value > 0 && IsPowerOf2(fixed_right_arg_value) && | 2460 fixed_right_arg_value > 0 && |
| 2461 base::bits::IsPowerOfTwo32(fixed_right_arg_value) && |
2460 FixedRightArgValueField::is_valid(WhichPowerOf2(fixed_right_arg_value)) && | 2462 FixedRightArgValueField::is_valid(WhichPowerOf2(fixed_right_arg_value)) && |
2461 (left_kind_ == SMI || left_kind_ == INT32) && | 2463 (left_kind_ == SMI || left_kind_ == INT32) && |
2462 (result_kind_ == NONE || !fixed_right_arg_.has_value); | 2464 (result_kind_ == NONE || !fixed_right_arg_.has_value); |
2463 fixed_right_arg_ = Maybe<int32_t>(has_fixed_right_arg, fixed_right_arg_value); | 2465 fixed_right_arg_ = Maybe<int32_t>(has_fixed_right_arg, fixed_right_arg_value); |
2464 | 2466 |
2465 result_kind_ = UpdateKind(result, result_kind_); | 2467 result_kind_ = UpdateKind(result, result_kind_); |
2466 | 2468 |
2467 if (!Token::IsTruncatingBinaryOp(op_)) { | 2469 if (!Token::IsTruncatingBinaryOp(op_)) { |
2468 Kind input_kind = Max(left_kind_, right_kind_); | 2470 Kind input_kind = Max(left_kind_, right_kind_); |
2469 if (result_kind_ < input_kind && input_kind <= NUMBER) { | 2471 if (result_kind_ < input_kind && input_kind <= NUMBER) { |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3196 static const Address IC_utilities[] = { | 3198 static const Address IC_utilities[] = { |
3197 #define ADDR(name) FUNCTION_ADDR(name), | 3199 #define ADDR(name) FUNCTION_ADDR(name), |
3198 IC_UTIL_LIST(ADDR) NULL | 3200 IC_UTIL_LIST(ADDR) NULL |
3199 #undef ADDR | 3201 #undef ADDR |
3200 }; | 3202 }; |
3201 | 3203 |
3202 | 3204 |
3203 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } | 3205 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } |
3204 } | 3206 } |
3205 } // namespace v8::internal | 3207 } // namespace v8::internal |
OLD | NEW |