[vm] Delete obsolete await_token_positions_ from Code object and flow graph.

Change-Id: I80fff049c8d0b45ec7276b1d0ae71f492ad97b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106564
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
This commit is contained in:
Régis Crelier 2019-06-19 23:38:02 +00:00 committed by commit-bot@chromium.org
parent 2b56c2c58a
commit 4403c58640
10 changed files with 2 additions and 67 deletions

View file

@ -1397,7 +1397,6 @@ class CodeSerializationCluster : public SerializationCluster {
s->Push(code->ptr()->deopt_info_array_);
s->Push(code->ptr()->static_calls_target_table_);
}
NOT_IN_PRODUCT(s->Push(code->ptr()->await_token_positions_));
NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_));
}
@ -1459,7 +1458,6 @@ class CodeSerializationCluster : public SerializationCluster {
WriteField(code, deopt_info_array_);
WriteField(code, static_calls_target_table_);
}
NOT_IN_PRODUCT(WriteField(code, await_token_positions_));
NOT_IN_PRODUCT(WriteField(code, return_address_metadata_));
s->Write<int32_t>(code->ptr()->state_bits_);
@ -1574,8 +1572,6 @@ class CodeDeserializationCluster : public DeserializationCluster {
#endif // !DART_PRECOMPILED_RUNTIME
#if !defined(PRODUCT)
code->ptr()->await_token_positions_ =
reinterpret_cast<RawArray*>(d->ReadRef());
code->ptr()->return_address_metadata_ = d->ReadRef();
code->ptr()->var_descriptors_ = LocalVarDescriptors::null();
code->ptr()->comments_ = Array::null();

View file

@ -55,7 +55,6 @@ FlowGraph::FlowGraph(const ParsedFunction& parsed_function,
loop_hierarchy_(nullptr),
loop_invariant_loads_(nullptr),
deferred_prefixes_(parsed_function.deferred_prefixes()),
await_token_positions_(nullptr),
captured_parameters_(new (zone()) BitVector(zone(), variable_count())),
inlining_id_(-1),
should_print_(FlowGraphPrinter::ShouldPrint(parsed_function.function())) {

View file

@ -366,15 +366,6 @@ class FlowGraph : public ZoneAllocated {
// Merge instructions (only per basic-block).
void TryOptimizePatterns();
ZoneGrowableArray<TokenPosition>* await_token_positions() const {
return await_token_positions_;
}
void set_await_token_positions(
ZoneGrowableArray<TokenPosition>* await_token_positions) {
await_token_positions_ = await_token_positions;
}
// Replaces uses that are dominated by dom of 'def' with 'other'.
// Note: uses that occur at instruction dom itself are not dominated by it.
static void RenameDominatedUses(Definition* def,
@ -535,7 +526,6 @@ class FlowGraph : public ZoneAllocated {
ZoneGrowableArray<BitVector*>* loop_invariant_loads_;
ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
ZoneGrowableArray<TokenPosition>* await_token_positions_;
DirectChainedHashMap<ConstantPoolTrait> constant_instr_pool_;
BitVector* captured_parameters_;

View file

@ -389,30 +389,6 @@ RawCode* CompileParsedFunctionHelper::FinalizeCompilation(
/*stats=*/nullptr));
code.set_is_optimized(optimized());
code.set_owner(function);
#if !defined(PRODUCT)
ZoneGrowableArray<TokenPosition>* await_token_positions =
flow_graph->await_token_positions();
if (await_token_positions != NULL) {
Smi& token_pos_value = Smi::Handle(zone);
if (await_token_positions->length() > 0) {
const Array& await_to_token_map = Array::Handle(
zone, Array::New(await_token_positions->length(), Heap::kOld));
ASSERT(!await_to_token_map.IsNull());
for (intptr_t i = 0; i < await_token_positions->length(); i++) {
TokenPosition token_pos = await_token_positions->At(i).FromSynthetic();
if (!token_pos.IsReal()) {
// Some async machinary uses sentinel values. Map them to
// no source position.
token_pos_value = Smi::New(TokenPosition::kNoSourcePos);
} else {
token_pos_value = Smi::New(token_pos.value());
}
await_to_token_map.SetAt(i, token_pos_value);
}
code.set_await_token_positions(await_to_token_map);
}
}
#endif // !defined(PRODUCT)
if (!function.IsOptimizable()) {
// A function with huge unoptimized code can become non-optimizable

View file

@ -960,10 +960,9 @@ void ActivationFrame::ExtractTokenPositionFromAsyncClosure() {
// This should only be called on frames that aren't active on the stack.
ASSERT(fp() == 0);
ASSERT(script.kind() == RawScript::kKernelTag);
const Array& await_to_token_map =
Array::Handle(zone, script.kind() == RawScript::kKernelTag
? script.yield_positions()
: code_.await_token_positions());
Array::Handle(zone, script.yield_positions());
if (await_to_token_map.IsNull()) {
// No mapping.
return;

View file

@ -15215,14 +15215,6 @@ void Code::DumpSourcePositions() const {
reader.DumpSourcePositions(PayloadStart());
}
RawArray* Code::await_token_positions() const {
#if defined(PRODUCT)
return Array::null();
#else
return raw_ptr()->await_token_positions_;
#endif
}
void Bytecode::Disassemble(DisassemblyFormatter* formatter) const {
#if !defined(PRODUCT) || defined(FORCE_INCLUDE_DISASSEMBLER)
#if !defined(DART_PRECOMPILED_RUNTIME)

View file

@ -5120,9 +5120,6 @@ class Code : public Object {
StorePointer(&raw_ptr()->code_source_map_, code_source_map.raw());
}
RawArray* await_token_positions() const;
void set_await_token_positions(const Array& await_token_positions) const;
// Used during reloading (see object_reload.cc). Calls Reset on all ICDatas
// that are embedded inside the Code or ObjecPool objects.
void ResetICDatas(Zone* zone) const;

View file

@ -860,12 +860,6 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
PrintJSONInlineIntervals(&jsobj);
}
void Code::set_await_token_positions(const Array& await_token_positions) const {
#if !defined(DART_PRECOMPILED_RUNTIME)
StorePointer(&raw_ptr()->await_token_positions_, await_token_positions.raw());
#endif
}
void Bytecode::PrintJSONImpl(JSONStream* stream, bool ref) const {
// N.B. This is polymorphic with Code.

View file

@ -631,13 +631,6 @@ void ProgramVisitor::DedupLists() {
list_ = DedupList(list_);
code_.set_deopt_info_array(list_);
}
#ifndef PRODUCT
list_ = code_.await_token_positions();
if (!list_.IsNull()) {
list_ = DedupList(list_);
code_.set_await_token_positions(list_);
}
#endif // !PRODUCT
list_ = code_.static_calls_target_table();
if (!list_.IsNull()) {
list_ = DedupList(list_);

View file

@ -1322,7 +1322,6 @@ class RawCode : public RawObject {
NOT_IN_PRECOMPILED(RawArray* deopt_info_array_);
// (code-offset, function, code) triples.
NOT_IN_PRECOMPILED(RawArray* static_calls_target_table_);
NOT_IN_PRODUCT(RawArray* await_token_positions_);
// If return_address_metadata_ is a Smi, it is the offset to the prologue.
// Else, return_address_metadata_ is null.
NOT_IN_PRODUCT(RawObject* return_address_metadata_);