OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 right->ToInt32(&value) && can_encode_arg_value(value) && | 561 right->ToInt32(&value) && can_encode_arg_value(value) && |
562 (left_state_ == SMI || left_state_ == INT32) && | 562 (left_state_ == SMI || left_state_ == INT32) && |
563 (result_state_ == NONE || !fixed_right_arg_.has_value); | 563 (result_state_ == NONE || !fixed_right_arg_.has_value); |
564 | 564 |
565 fixed_right_arg_ = Maybe<int32_t>(new_has_fixed_right_arg, value); | 565 fixed_right_arg_ = Maybe<int32_t>(new_has_fixed_right_arg, value); |
566 | 566 |
567 if (result.has_value) UpdateStatus(result.value, &result_state_); | 567 if (result.has_value) UpdateStatus(result.value, &result_state_); |
568 | 568 |
569 State max_input = Max(left_state_, right_state_); | 569 State max_input = Max(left_state_, right_state_); |
570 | 570 |
571 // Avoid unnecessary Representation changes. | 571 // TODO(olivf) Instead of doing this normalization we should have a Hydrogen |
| 572 // version of the LookupNumberStringCache to avoid a converting StringAddStub. |
572 if (left_state_ == STRING && right_state_ < STRING) { | 573 if (left_state_ == STRING && right_state_ < STRING) { |
573 right_state_ = GENERIC; | 574 right_state_ = GENERIC; |
574 } else if (right_state_ == STRING && left_state_ < STRING) { | 575 } else if (right_state_ == STRING && left_state_ < STRING) { |
575 left_state_ = GENERIC; | 576 left_state_ = GENERIC; |
576 } else if ((right_state_ == GENERIC && left_state_ != STRING) || | |
577 (left_state_ == GENERIC && right_state_ != STRING)) { | |
578 left_state_ = right_state_ = GENERIC; | |
579 } else if (!has_int_result() && op_ != Token::SHR && | 577 } else if (!has_int_result() && op_ != Token::SHR && |
580 max_input <= NUMBER && max_input > result_state_) { | 578 max_input <= NUMBER && max_input > result_state_) { |
581 result_state_ = max_input; | 579 result_state_ = max_input; |
582 } | 580 } |
583 | 581 |
584 ASSERT(result_state_ <= (has_int_result() ? INT32 : NUMBER) || | 582 ASSERT(result_state_ <= (has_int_result() ? INT32 : NUMBER) || |
585 op_ == Token::ADD); | 583 op_ == Token::ADD); |
586 | 584 |
587 if (old_state == GetExtraICState()) { | 585 if (old_state == GetExtraICState()) { |
588 // Since the fpu is to precise, we might bail out on numbers which | 586 // Since the fpu is to precise, we might bail out on numbers which |
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 InstallDescriptor(isolate, &stub3); | 1151 InstallDescriptor(isolate, &stub3); |
1154 } | 1152 } |
1155 | 1153 |
1156 InternalArrayConstructorStub::InternalArrayConstructorStub( | 1154 InternalArrayConstructorStub::InternalArrayConstructorStub( |
1157 Isolate* isolate) { | 1155 Isolate* isolate) { |
1158 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 1156 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
1159 } | 1157 } |
1160 | 1158 |
1161 | 1159 |
1162 } } // namespace v8::internal | 1160 } } // namespace v8::internal |
OLD | NEW |