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

Unified Diff: src/compiler/typer.cc

Issue 2196653002: [turbofan] Introduce a dedicated CheckMaps simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@TurboFan_JSNativeContextSpecialization_NonElementKeyedAccess
Patch Set: Created 4 years, 5 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
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index c2544a30704d145bbe5dac245a0a5d3c36b8f2ce..42bd3042a09cb1831c6ad10d0a44447bf3ac309c 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -6,7 +6,6 @@
#include "src/base/flags.h"
#include "src/bootstrapper.h"
-#include "src/compilation-dependencies.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/graph-reducer.h"
#include "src/compiler/js-operator.h"
@@ -31,12 +30,9 @@ class Typer::Decorator final : public GraphDecorator {
Typer* const typer_;
};
-Typer::Typer(Isolate* isolate, Graph* graph, Flags flags,
- CompilationDependencies* dependencies)
+Typer::Typer(Isolate* isolate, Graph* graph)
: isolate_(isolate),
graph_(graph),
- flags_(flags),
- dependencies_(dependencies),
decorator_(nullptr),
cache_(TypeCache::Get()),
operation_typer_(isolate, zone()) {
@@ -222,10 +218,6 @@ class Typer::Visitor : public Reducer {
Zone* zone() { return typer_->zone(); }
Isolate* isolate() { return typer_->isolate(); }
Graph* graph() { return typer_->graph(); }
- Typer::Flags flags() const { return typer_->flags(); }
- CompilationDependencies* dependencies() const {
- return typer_->dependencies();
- }
void SetWeakened(NodeId node_id) { weakened_nodes_.insert(node_id); }
bool IsWeakened(NodeId node_id) {
@@ -1897,6 +1889,11 @@ Type* Typer::Visitor::TypeCheckBounds(Node* node) {
return Type::Unsigned31();
}
+Type* Typer::Visitor::TypeCheckMaps(Node* node) {
+ UNREACHABLE();
+ return nullptr;
+}
+
Type* Typer::Visitor::TypeCheckNumber(Node* node) {
Type* arg = Operand(node, 0);
return Type::Intersect(arg, Type::Number(), zone());
@@ -1947,57 +1944,10 @@ Type* Typer::Visitor::TypeCheckTaggedHole(Node* node) {
Type* Typer::Visitor::TypeAllocate(Node* node) { return Type::TaggedPointer(); }
-
-namespace {
-
-MaybeHandle<Map> GetStableMapFromObjectType(Type* object_type) {
- if (object_type->IsConstant() &&
- object_type->AsConstant()->Value()->IsHeapObject()) {
- Handle<Map> object_map(
- Handle<HeapObject>::cast(object_type->AsConstant()->Value())->map());
- if (object_map->is_stable()) return object_map;
- } else if (object_type->IsClass()) {
- Handle<Map> object_map = object_type->AsClass()->Map();
- if (object_map->is_stable()) return object_map;
- }
- return MaybeHandle<Map>();
-}
-
-} // namespace
-
-
Type* Typer::Visitor::TypeLoadField(Node* node) {
- FieldAccess const& access = FieldAccessOf(node->op());
- if (access.base_is_tagged == kTaggedBase &&
- access.offset == HeapObject::kMapOffset) {
- // The type of LoadField[Map](o) is Constant(map) if map is stable and
- // either
- // (a) o has type Constant(object) and map == object->map, or
- // (b) o has type Class(map),
- // and either
- // (1) map cannot transition further, or
- // (2) deoptimization is enabled and we can add a code dependency on the
- // stability of map (to guard the Constant type information).
- Type* const object = Operand(node, 0);
- if (object->Is(Type::None())) return Type::None();
- Handle<Map> object_map;
- if (GetStableMapFromObjectType(object).ToHandle(&object_map)) {
- if (object_map->CanTransition()) {
- if (flags() & kDeoptimizationEnabled) {
- dependencies()->AssumeMapStable(object_map);
- } else {
- return access.type;
- }
- }
- Type* object_map_type = Type::Constant(object_map, zone());
- DCHECK(object_map_type->Is(access.type));
- return object_map_type;
- }
- }
- return access.type;
+ return FieldAccessOf(node->op()).type;
}
-
Type* Typer::Visitor::TypeLoadBuffer(Node* node) {
// TODO(bmeurer): This typing is not yet correct. Since we can still access
// out of bounds, the type in the general case has to include Undefined.

Powered by Google App Engine
This is Rietveld 408576698