Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: src/code-stubs.cc

Issue 27011002: Handle string + number in hydrogen. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 right->ToInt32(&value) && can_encode_arg_value(value) && 562 right->ToInt32(&value) && can_encode_arg_value(value) &&
563 (left_state_ == SMI || left_state_ == INT32) && 563 (left_state_ == SMI || left_state_ == INT32) &&
564 (result_state_ == NONE || !fixed_right_arg_.has_value); 564 (result_state_ == NONE || !fixed_right_arg_.has_value);
565 565
566 fixed_right_arg_ = Maybe<int32_t>(new_has_fixed_right_arg, value); 566 fixed_right_arg_ = Maybe<int32_t>(new_has_fixed_right_arg, value);
567 567
568 if (result.has_value) UpdateStatus(result.value, &result_state_); 568 if (result.has_value) UpdateStatus(result.value, &result_state_);
569 569
570 State max_input = Max(left_state_, right_state_); 570 State max_input = Max(left_state_, right_state_);
571 571
572 // TODO(olivf) Instead of doing this normalization we should have a Hydrogen 572 if (!has_int_result() && op_ != Token::SHR &&
573 // version of the LookupNumberStringCache to avoid a converting StringAddStub. 573 max_input <= NUMBER && max_input > result_state_) {
574 if (left_state_ == STRING && right_state_ < STRING) {
575 right_state_ = GENERIC;
576 } else if (right_state_ == STRING && left_state_ < STRING) {
577 left_state_ = GENERIC;
578 } else if (!has_int_result() && op_ != Token::SHR &&
579 max_input <= NUMBER && max_input > result_state_) {
580 result_state_ = max_input; 574 result_state_ = max_input;
581 } 575 }
582 576
583 ASSERT(result_state_ <= (has_int_result() ? INT32 : NUMBER) || 577 ASSERT(result_state_ <= (has_int_result() ? INT32 : NUMBER) ||
584 op_ == Token::ADD); 578 op_ == Token::ADD);
585 579
586 if (old_state == GetExtraICState()) { 580 if (old_state == GetExtraICState()) {
587 // Tagged operations can lead to non-truncating HChanges 581 // Tagged operations can lead to non-truncating HChanges
588 if (left->IsUndefined()) { 582 if (left->IsUndefined()) {
589 left_state_ = GENERIC; 583 left_state_ = GENERIC;
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 InstallDescriptor(isolate, &stub3); 1153 InstallDescriptor(isolate, &stub3);
1160 } 1154 }
1161 1155
1162 InternalArrayConstructorStub::InternalArrayConstructorStub( 1156 InternalArrayConstructorStub::InternalArrayConstructorStub(
1163 Isolate* isolate) { 1157 Isolate* isolate) {
1164 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); 1158 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate);
1165 } 1159 }
1166 1160
1167 1161
1168 } } // namespace v8::internal 1162 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698