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

Unified Diff: src/compiler/simplified-operator.h

Issue 2431563002: [turbofan] Track multiple maps for LoadElimination. (Closed)
Patch Set: REBASE. Address comment. Created 3 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/compiler/load-elimination.cc ('k') | src/compiler/simplified-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator.h
diff --git a/src/compiler/simplified-operator.h b/src/compiler/simplified-operator.h
index 77bea1137f7910b989f1e98f925a97571fe216cd..b5ede379755a120ef9b6555a578ccc43aa95afe9 100644
--- a/src/compiler/simplified-operator.h
+++ b/src/compiler/simplified-operator.h
@@ -14,6 +14,7 @@
#include "src/handles.h"
#include "src/machine-type.h"
#include "src/objects.h"
+#include "src/zone/zone-handle-set.h"
namespace v8 {
namespace internal {
@@ -143,6 +144,27 @@ std::ostream& operator<<(std::ostream&, CheckForMinusZeroMode);
CheckForMinusZeroMode CheckMinusZeroModeOf(const Operator*) WARN_UNUSED_RESULT;
+// A descriptor for map checks.
+class CheckMapsParameters final {
+ public:
+ explicit CheckMapsParameters(ZoneHandleSet<Map> const& maps) : maps_(maps) {}
+
+ ZoneHandleSet<Map> const& maps() const { return maps_; }
+
+ private:
+ ZoneHandleSet<Map> const maps_;
+};
+
+bool operator==(CheckMapsParameters const&, CheckMapsParameters const&);
+bool operator!=(CheckMapsParameters const&, CheckMapsParameters const&);
+
+size_t hash_value(CheckMapsParameters const&);
+
+std::ostream& operator<<(std::ostream&, CheckMapsParameters const&);
+
+CheckMapsParameters const& CheckMapsParametersOf(Operator const*)
+ WARN_UNUSED_RESULT;
+
// A descriptor for growing elements backing stores.
enum class GrowFastElementsFlag : uint8_t {
kNone = 0u,
@@ -160,16 +182,35 @@ GrowFastElementsFlags GrowFastElementsFlagsOf(const Operator*)
WARN_UNUSED_RESULT;
// A descriptor for elements kind transitions.
-enum class ElementsTransition : uint8_t {
- kFastTransition, // simple transition, just updating the map.
- kSlowTransition // full transition, round-trip to the runtime.
+class ElementsTransition final {
+ public:
+ enum Mode : uint8_t {
+ kFastTransition, // simple transition, just updating the map.
+ kSlowTransition // full transition, round-trip to the runtime.
+ };
+
+ ElementsTransition(Mode mode, Handle<Map> source, Handle<Map> target)
+ : mode_(mode), source_(source), target_(target) {}
+
+ Mode mode() const { return mode_; }
+ Handle<Map> source() const { return source_; }
+ Handle<Map> target() const { return target_; }
+
+ private:
+ Mode const mode_;
+ Handle<Map> const source_;
+ Handle<Map> const target_;
};
+bool operator==(ElementsTransition const&, ElementsTransition const&);
+bool operator!=(ElementsTransition const&, ElementsTransition const&);
+
size_t hash_value(ElementsTransition);
std::ostream& operator<<(std::ostream&, ElementsTransition);
-ElementsTransition ElementsTransitionOf(const Operator* op) WARN_UNUSED_RESULT;
+ElementsTransition const& ElementsTransitionOf(const Operator* op)
+ WARN_UNUSED_RESULT;
// A hint for speculative number operations.
enum class NumberOperationHint : uint8_t {
@@ -322,7 +363,7 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
const Operator* CheckIf();
const Operator* CheckBounds();
- const Operator* CheckMaps(int map_input_count);
+ const Operator* CheckMaps(ZoneHandleSet<Map>);
const Operator* CheckHeapObject();
const Operator* CheckInternalizedString();
« no previous file with comments | « src/compiler/load-elimination.cc ('k') | src/compiler/simplified-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698