Commit aabb7fed authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

[ast] Remove dead AST code after Crankshaft deletion

Tbr: jkummerow@chromium.org
Bug: v8:6408
Change-Id: I23c420c5b88bcee06e381f27eb7fe59976d3bba6
Reviewed-on: https://chromium-review.googlesource.com/644716
Commit-Queue: Adam Klein <adamk@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47752}
parent 61540407
......@@ -1936,7 +1936,6 @@ v8_source_set("v8_base") {
"src/setup-isolate.h",
"src/signature.h",
"src/simulator.h",
"src/small-pointer-list.h",
"src/snapshot/builtin-deserializer.cc",
"src/snapshot/builtin-deserializer.h",
"src/snapshot/builtin-serializer.cc",
......
......@@ -19,7 +19,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
bool collect_type_profile = false)
: zone_(zone),
eager_literals_(eager_literals),
next_id_(BailoutId::FirstUsable().ToInt()),
suspend_count_(0),
properties_(zone),
language_mode_(SLOPPY),
......@@ -49,12 +48,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
void VisitArguments(ZoneList<Expression*>* arguments);
void VisitLiteralProperty(LiteralProperty* property);
int ReserveId() {
int tmp = next_id_;
next_id_ += 1;
return tmp;
}
void DisableOptimization(BailoutReason reason) {
dont_optimize_reason_ = reason;
}
......@@ -84,7 +77,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
Zone* zone_;
Compiler::EagerInnerFunctionLiterals* eager_literals_;
int next_id_;
int suspend_count_;
AstProperties properties_;
LanguageMode language_mode_;
......@@ -265,7 +257,6 @@ void AstNumberingVisitor::VisitWithStatement(WithStatement* node) {
void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
node->set_osr_id(ReserveId());
node->set_first_suspend_id(suspend_count_);
Visit(node->body());
Visit(node->cond());
......@@ -274,7 +265,6 @@ void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) {
void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) {
node->set_osr_id(ReserveId());
node->set_first_suspend_id(suspend_count_);
Visit(node->cond());
Visit(node->body());
......@@ -360,7 +350,6 @@ void AstNumberingVisitor::VisitImportCallExpression(
}
void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
node->set_osr_id(ReserveId());
Visit(node->enumerable()); // Not part of loop.
node->set_first_suspend_id(suspend_count_);
Visit(node->each());
......@@ -371,7 +360,6 @@ void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) {
void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) {
node->set_osr_id(ReserveId());
Visit(node->assign_iterator()); // Not part of loop.
node->set_first_suspend_id(suspend_count_);
Visit(node->next_result());
......@@ -409,7 +397,6 @@ void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) {
void AstNumberingVisitor::VisitForStatement(ForStatement* node) {
node->set_osr_id(ReserveId());
if (node->init() != NULL) Visit(node->init()); // Not part of loop.
node->set_first_suspend_id(suspend_count_);
if (node->cond() != NULL) Visit(node->cond());
......
......@@ -255,9 +255,7 @@ void ForInStatement::AssignFeedbackSlots(FeedbackVectorSpec* spec,
Assignment::Assignment(NodeType node_type, Token::Value op, Expression* target,
Expression* value, int pos)
: Expression(pos, node_type), target_(target), value_(value) {
bit_field_ |= IsUninitializedField::encode(false) |
KeyTypeField::encode(ELEMENT) |
StoreModeField::encode(STANDARD_STORE) | TokenField::encode(op);
bit_field_ |= TokenField::encode(op);
}
void Assignment::AssignFeedbackSlots(FeedbackVectorSpec* spec,
......@@ -957,61 +955,6 @@ bool CompareOperation::IsLiteralCompareNull(Expression** expr) {
// ----------------------------------------------------------------------------
// Recording of type feedback
Handle<Map> SmallMapList::at(int i) const { return Handle<Map>(list_.at(i)); }
SmallMapList* Expression::GetReceiverTypes() {
switch (node_type()) {
#define NODE_LIST(V) \
PROPERTY_NODE_LIST(V) \
V(Call)
#define GENERATE_CASE(Node) \
case k##Node: \
return static_cast<Node*>(this)->GetReceiverTypes();
NODE_LIST(GENERATE_CASE)
#undef NODE_LIST
#undef GENERATE_CASE
default:
UNREACHABLE();
}
}
KeyedAccessStoreMode Expression::GetStoreMode() const {
switch (node_type()) {
#define GENERATE_CASE(Node) \
case k##Node: \
return static_cast<const Node*>(this)->GetStoreMode();
PROPERTY_NODE_LIST(GENERATE_CASE)
#undef GENERATE_CASE
default:
UNREACHABLE();
}
}
IcCheckType Expression::GetKeyType() const {
switch (node_type()) {
#define GENERATE_CASE(Node) \
case k##Node: \
return static_cast<const Node*>(this)->GetKeyType();
PROPERTY_NODE_LIST(GENERATE_CASE)
#undef GENERATE_CASE
default:
UNREACHABLE();
}
}
bool Expression::IsMonomorphic() const {
switch (node_type()) {
#define GENERATE_CASE(Node) \
case k##Node: \
return static_cast<const Node*>(this)->IsMonomorphic();
PROPERTY_NODE_LIST(GENERATE_CASE)
CALL_NODE_LIST(GENERATE_CASE)
#undef GENERATE_CASE
default:
UNREACHABLE();
}
}
void Call::AssignFeedbackSlots(FeedbackVectorSpec* spec,
LanguageMode language_mode, FunctionKind kind,
FeedbackSlotCache* cache) {
......
This diff is collapsed.
......@@ -10,8 +10,6 @@
namespace v8 {
namespace internal {
class SmallMapList;
// The stub cache is used for megamorphic property accesses.
// It maps (map, name, type) to property access handlers. The cache does not
// need explicit invalidation when a prototype chain is modified, since the
......
// Copyright 2011 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_SMALL_POINTER_LIST_H_
#define V8_SMALL_POINTER_LIST_H_
#include "src/base/logging.h"
#include "src/globals.h"
#include "src/zone/zone.h"
namespace v8 {
namespace internal {
// SmallPointerList is a list optimized for storing no or just a
// single value. When more values are given it falls back to ZoneList.
//
// The interface tries to be as close to List from list.h as possible.
template <typename T>
class SmallPointerList {
public:
SmallPointerList() : data_(kEmptyTag) {}
SmallPointerList(int capacity, Zone* zone) : data_(kEmptyTag) {
Reserve(capacity, zone);
}
void Reserve(int capacity, Zone* zone) {
if (capacity < 2) return;
if ((data_ & kTagMask) == kListTag) {
if (list()->capacity() >= capacity) return;
int old_length = list()->length();
list()->AddBlock(NULL, capacity - list()->capacity(), zone);
list()->Rewind(old_length);
return;
}
PointerList* list = new(zone) PointerList(capacity, zone);
if ((data_ & kTagMask) == kSingletonTag) {
list->Add(single_value(), zone);
}
DCHECK(IsAligned(reinterpret_cast<intptr_t>(list), kPointerAlignment));
data_ = reinterpret_cast<intptr_t>(list) | kListTag;
}
void Clear() {
data_ = kEmptyTag;
}
void Sort() {
if ((data_ & kTagMask) == kListTag) {
list()->Sort(compare_value);
}
}
bool is_empty() const { return length() == 0; }
int length() const {
if ((data_ & kTagMask) == kEmptyTag) return 0;
if ((data_ & kTagMask) == kSingletonTag) return 1;
return list()->length();
}
void Add(T* pointer, Zone* zone) {
DCHECK(IsAligned(reinterpret_cast<intptr_t>(pointer), kPointerAlignment));
if ((data_ & kTagMask) == kEmptyTag) {
data_ = reinterpret_cast<intptr_t>(pointer) | kSingletonTag;
return;
}
if ((data_ & kTagMask) == kSingletonTag) {
PointerList* list = new(zone) PointerList(2, zone);
list->Add(single_value(), zone);
list->Add(pointer, zone);
DCHECK(IsAligned(reinterpret_cast<intptr_t>(list), kPointerAlignment));
data_ = reinterpret_cast<intptr_t>(list) | kListTag;
return;
}
list()->Add(pointer, zone);
}
// Note: returns T* and not T*& (unlike List from list.h).
// This makes the implementation simpler and more const correct.
T* at(int i) const {
DCHECK((data_ & kTagMask) != kEmptyTag);
if ((data_ & kTagMask) == kSingletonTag) {
DCHECK(i == 0);
return single_value();
}
return list()->at(i);
}
// See the note above.
T* operator[](int i) const { return at(i); }
// Remove the given element from the list (if present).
void RemoveElement(T* pointer) {
if ((data_ & kTagMask) == kEmptyTag) return;
if ((data_ & kTagMask) == kSingletonTag) {
if (pointer == single_value()) {
data_ = kEmptyTag;
}
return;
}
list()->RemoveElement(pointer);
}
T* RemoveLast() {
DCHECK((data_ & kTagMask) != kEmptyTag);
if ((data_ & kTagMask) == kSingletonTag) {
T* result = single_value();
data_ = kEmptyTag;
return result;
}
return list()->RemoveLast();
}
void Rewind(int pos) {
if ((data_ & kTagMask) == kEmptyTag) {
DCHECK(pos == 0);
return;
}
if ((data_ & kTagMask) == kSingletonTag) {
DCHECK(pos == 0 || pos == 1);
if (pos == 0) {
data_ = kEmptyTag;
}
return;
}
list()->Rewind(pos);
}
int CountOccurrences(T* pointer, int start, int end) const {
if ((data_ & kTagMask) == kEmptyTag) return 0;
if ((data_ & kTagMask) == kSingletonTag) {
if (start == 0 && end >= 0) {
return (single_value() == pointer) ? 1 : 0;
}
return 0;
}
return list()->CountOccurrences(pointer, start, end);
}
private:
typedef ZoneList<T*> PointerList;
static int compare_value(T* const* a, T* const* b) {
return Compare<T>(**a, **b);
}
static const intptr_t kEmptyTag = 1;
static const intptr_t kSingletonTag = 0;
static const intptr_t kListTag = 2;
static const intptr_t kTagMask = 3;
static const intptr_t kValueMask = ~kTagMask;
STATIC_ASSERT(kTagMask + 1 <= kPointerAlignment);
T* single_value() const {
DCHECK((data_ & kTagMask) == kSingletonTag);
STATIC_ASSERT(kSingletonTag == 0);
return reinterpret_cast<T*>(data_);
}
PointerList* list() const {
DCHECK((data_ & kTagMask) == kListTag);
return reinterpret_cast<PointerList*>(data_ & kValueMask);
}
intptr_t data_;
DISALLOW_COPY_AND_ASSIGN(SmallPointerList);
};
} // namespace internal
} // namespace v8
#endif // V8_SMALL_POINTER_LIST_H_
......@@ -1330,7 +1330,6 @@
'setup-isolate.h',
'signature.h',
'simulator.h',
'small-pointer-list.h',
'snapshot/builtin-deserializer.cc',
'snapshot/builtin-deserializer.h',
'snapshot/builtin-serializer.cc',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment