v8/src/vector-slot-pair.h
Benedikt Meurer 4491072507 [turbofan] Fix RedundancyElimination and add more test coverage.
Make the RedundancyElimination handle all simplified operators that are
listed in the SIMPLIFIED_CHECKED_OP_LIST, and fix a couple of bugs and
oversights in the code. This also adds a lot of test coverage for all
the cases that we care about in RedundancyElimination (with respect to
Check/Checked simplified operators).

Bug: v8:8015
Change-Id: I57d29113389841b09abcd013313bf5dd1c67735f
Reviewed-on: https://chromium-review.googlesource.com/1233655
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56032}
2018-09-19 13:08:12 +00:00

52 lines
1.5 KiB
C++

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_VECTOR_SLOT_PAIR_H_
#define V8_VECTOR_SLOT_PAIR_H_
#include "src/globals.h"
#include "src/handles.h"
#include "src/utils.h"
namespace v8 {
namespace internal {
class FeedbackVector;
// Defines a pair of {FeedbackVector} and {FeedbackSlot}, which
// is used to access the type feedback for a certain {Node}.
class V8_EXPORT_PRIVATE VectorSlotPair {
public:
VectorSlotPair();
VectorSlotPair(Handle<FeedbackVector> vector, FeedbackSlot slot,
InlineCacheState ic_state)
: vector_(vector), slot_(slot), ic_state_(ic_state) {}
bool IsValid() const { return !vector_.is_null() && !slot_.IsInvalid(); }
Handle<FeedbackVector> vector() const { return vector_; }
FeedbackSlot slot() const { return slot_; }
InlineCacheState ic_state() const { return ic_state_; }
int index() const;
private:
Handle<FeedbackVector> vector_;
FeedbackSlot slot_;
InlineCacheState ic_state_ = UNINITIALIZED;
};
bool operator==(VectorSlotPair const&, VectorSlotPair const&);
bool operator!=(VectorSlotPair const&, VectorSlotPair const&);
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
VectorSlotPair const&);
size_t hash_value(VectorSlotPair const&);
} // namespace internal
} // namespace v8
#endif // V8_VECTOR_SLOT_PAIR_H_