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

Unified Diff: src/hydrogen-instructions.h

Issue 1339053002: [crankshaft] Re-add fast-case for string add left/right. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Real fix for HStringAdd Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.h
diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h
index a59cd2f050f2606649b3788bd8b1d8eba27a9014..be03186144f37b8bbd99d7b33873f01402d5fd57 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -7348,8 +7348,7 @@ class HStringAdd final : public HBinaryOperation {
public:
static HInstruction* New(
Isolate* isolate, Zone* zone, HValue* context, HValue* left,
- HValue* right, Strength strength = Strength::WEAK,
- PretenureFlag pretenure_flag = NOT_TENURED,
+ HValue* right, PretenureFlag pretenure_flag = NOT_TENURED,
StringAddFlags flags = STRING_ADD_CHECK_BOTH,
Handle<AllocationSite> allocation_site = Handle<AllocationSite>::null());
@@ -7371,16 +7370,21 @@ class HStringAdd final : public HBinaryOperation {
}
private:
- HStringAdd(HValue* context, HValue* left, HValue* right, Strength strength,
+ HStringAdd(HValue* context, HValue* left, HValue* right,
PretenureFlag pretenure_flag, StringAddFlags flags,
Handle<AllocationSite> allocation_site)
- : HBinaryOperation(context, left, right, strength, HType::String()),
+ : HBinaryOperation(context, left, right, Strength::WEAK, HType::String()),
flags_(flags),
pretenure_flag_(pretenure_flag) {
set_representation(Representation::Tagged());
- SetFlag(kUseGVN);
+ if ((flags & STRING_ADD_CONVERT) == STRING_ADD_CONVERT) {
+ SetAllSideEffects();
+ ClearFlag(kUseGVN);
+ } else {
+ SetChangesFlag(kNewSpacePromotion);
+ SetFlag(kUseGVN);
+ }
SetDependsOnFlag(kMaps);
- SetChangesFlag(kNewSpacePromotion);
if (FLAG_trace_pretenuring) {
PrintF("HStringAdd with AllocationSite %p %s\n",
allocation_site.is_null()
@@ -7390,8 +7394,9 @@ class HStringAdd final : public HBinaryOperation {
}
}
- // No side-effects except possible allocation:
- bool IsDeletable() const override { return true; }
+ bool IsDeletable() const final {
+ return (flags_ & STRING_ADD_CONVERT) != STRING_ADD_CONVERT;
+ }
const StringAddFlags flags_;
const PretenureFlag pretenure_flag_;
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-instructions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698