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

Side by Side Diff: src/hydrogen.cc

Issue 935393002: Constant-fold strings in HGraphBuilder::BuildBinaryOperation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 10481 matching lines...) Expand 10 before | Expand all | Expand 10 after
10492 if (left->IsConstant() && 10492 if (left->IsConstant() &&
10493 HConstant::cast(left)->HasStringValue() && 10493 HConstant::cast(left)->HasStringValue() &&
10494 HConstant::cast(left)->StringValue()->length() == 0) { 10494 HConstant::cast(left)->StringValue()->length() == 0) {
10495 return right; 10495 return right;
10496 } 10496 }
10497 if (right->IsConstant() && 10497 if (right->IsConstant() &&
10498 HConstant::cast(right)->HasStringValue() && 10498 HConstant::cast(right)->HasStringValue() &&
10499 HConstant::cast(right)->StringValue()->length() == 0) { 10499 HConstant::cast(right)->StringValue()->length() == 0) {
10500 return left; 10500 return left;
10501 } 10501 }
10502 if (left->IsConstant() && HConstant::cast(left)->HasStringValue() &&
Vyacheslav Egorov (Google) 2015/02/19 15:14:10 Maybe have Handle<String> left_string = left->Is
10503 right->IsConstant() && HConstant::cast(right)->HasStringValue()) {
10504 return AddUncasted<HStringAdd>(
10505 left, right, allocation_mode.GetPretenureMode(),
10506 STRING_ADD_CHECK_NONE, allocation_mode.feedback_site());
10507 }
10502 10508
10503 // Register the dependent code with the allocation site. 10509 // Register the dependent code with the allocation site.
10504 if (!allocation_mode.feedback_site().is_null()) { 10510 if (!allocation_mode.feedback_site().is_null()) {
10505 DCHECK(!graph()->info()->IsStub()); 10511 DCHECK(!graph()->info()->IsStub());
10506 Handle<AllocationSite> site(allocation_mode.feedback_site()); 10512 Handle<AllocationSite> site(allocation_mode.feedback_site());
10507 AllocationSite::RegisterForDeoptOnTenureChange(site, top_info()); 10513 AllocationSite::RegisterForDeoptOnTenureChange(site, top_info());
10508 } 10514 }
10509 10515
10510 // Inline the string addition into the stub when creating allocation 10516 // Inline the string addition into the stub when creating allocation
10511 // mementos to gather allocation site feedback, or if we can statically 10517 // mementos to gather allocation site feedback, or if we can statically
(...skipping 2922 matching lines...) Expand 10 before | Expand all | Expand 10 after
13434 if (ShouldProduceTraceOutput()) { 13440 if (ShouldProduceTraceOutput()) {
13435 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13441 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13436 } 13442 }
13437 13443
13438 #ifdef DEBUG 13444 #ifdef DEBUG
13439 graph_->Verify(false); // No full verify. 13445 graph_->Verify(false); // No full verify.
13440 #endif 13446 #endif
13441 } 13447 }
13442 13448
13443 } } // namespace v8::internal 13449 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698