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

Unified Diff: src/hydrogen-instructions.h

Issue 122463004: Revert "Fix compilation with C++11." and "Allocation site support for monomorphic StringAdds in Bin… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 12 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 a32a418606a058f5368a29d0ca0782a2400136e6..086f9a1a4cea430882d2b3b8d74938ce23581386 100644
--- a/src/hydrogen-instructions.h
+++ b/src/hydrogen-instructions.h
@@ -6992,55 +6992,45 @@ class HStringAdd V8_FINAL : public HBinaryOperation {
HValue* context,
HValue* left,
HValue* right,
- PretenureFlag pretenure_flag = NOT_TENURED,
- StringAddFlags flags = STRING_ADD_CHECK_BOTH,
- Handle<AllocationSite> allocation_site =
- Handle<AllocationSite>::null());
+ StringAddFlags flags = STRING_ADD_CHECK_NONE);
StringAddFlags flags() const { return flags_; }
- PretenureFlag pretenure_flag() const { return pretenure_flag_; }
virtual Representation RequiredInputRepresentation(int index) V8_OVERRIDE {
return Representation::Tagged();
}
- virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE;
-
DECLARE_CONCRETE_INSTRUCTION(StringAdd)
protected:
- virtual bool DataEquals(HValue* other) V8_OVERRIDE {
- return flags_ == HStringAdd::cast(other)->flags_ &&
- pretenure_flag_ == HStringAdd::cast(other)->pretenure_flag_;
- }
+ virtual bool DataEquals(HValue* other) V8_OVERRIDE { return true; }
private:
- HStringAdd(HValue* context,
- HValue* left,
- HValue* right,
- PretenureFlag pretenure_flag,
- StringAddFlags flags,
- Handle<AllocationSite> allocation_site)
- : HBinaryOperation(context, left, right, HType::String()),
- flags_(flags), pretenure_flag_(pretenure_flag) {
+ HStringAdd(HValue* context, HValue* left, HValue* right, StringAddFlags flags)
+ : HBinaryOperation(context, left, right, HType::String()), flags_(flags) {
set_representation(Representation::Tagged());
- SetFlag(kUseGVN);
- SetGVNFlag(kDependsOnMaps);
- SetGVNFlag(kChangesNewSpacePromotion);
- if (FLAG_trace_pretenuring) {
- PrintF("HStringAdd with AllocationSite %p %s\n",
- allocation_site.is_null()
- ? static_cast<void*>(NULL)
- : static_cast<void*>(*allocation_site),
- pretenure_flag == TENURED ? "tenured" : "not tenured");
+ if (MightHaveSideEffects()) {
+ SetAllSideEffects();
+ } else {
+ SetFlag(kUseGVN);
+ SetGVNFlag(kDependsOnMaps);
+ SetGVNFlag(kChangesNewSpacePromotion);
}
}
+ bool MightHaveSideEffects() const {
+ return flags_ != STRING_ADD_CHECK_NONE &&
+ (left()->ToStringCanBeObserved() || right()->ToStringCanBeObserved());
+ }
+
// No side-effects except possible allocation:
- virtual bool IsDeletable() const V8_OVERRIDE { return true; }
+ // NOTE: this instruction does not call ToString() on its inputs, when flags_
+ // is set to STRING_ADD_CHECK_NONE.
+ virtual bool IsDeletable() const V8_OVERRIDE {
+ return !MightHaveSideEffects();
+ }
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