Revert "[vm] Defer object pools." and
"[vm] Defer object pool entries in instructions bare mode." This reverts commit0bf8d38b3dand commit63d17b0ad8. Reason for revert : Performance regression, please see https://github.com/flutter/flutter/issues/73794 TEST=(none it is a revert). Change-Id: I828734f00c55d5095f632b154d7f4ab27a184baf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181542 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
e586c931f7
commit
27deca1457
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "split_literals_deferred.dart" deferred as lib;
|
||||
|
||||
class Box {
|
||||
final contents;
|
||||
const Box(this.contents);
|
||||
String toString() => "Box($contents)";
|
||||
}
|
||||
|
||||
main() async {
|
||||
print("Root literal!");
|
||||
print(const <String>["Root literal in a list!"]);
|
||||
print(const <String, String>{"key": "Root literal in a map!"});
|
||||
print(const Box("Root literal in a box!"));
|
||||
|
||||
await lib.loadLibrary();
|
||||
lib.foo();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "split_literals.dart";
|
||||
|
||||
void foo() {
|
||||
print("Deferred literal!");
|
||||
print(const <String>["Deferred literal in a list!"]);
|
||||
print(const <String, String>{"key": "Deferred literal in a map!"});
|
||||
print(const Box("Deferred literal in a box!"));
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "dart:convert";
|
||||
import "dart:io";
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
import "package:path/path.dart" as path;
|
||||
|
||||
import "use_flag_test_helper.dart";
|
||||
|
||||
main(List<String> args) async {
|
||||
if (!isAOTRuntime) {
|
||||
return; // Running in JIT: AOT binaries not available.
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
return; // SDK tree not available on the test device.
|
||||
}
|
||||
|
||||
// These are the tools we need to be available to run on a given platform:
|
||||
if (!File(platformDill).existsSync()) {
|
||||
throw "Cannot run test as $platformDill does not exist";
|
||||
}
|
||||
if (!await testExecutable(genSnapshot)) {
|
||||
throw "Cannot run test as $genSnapshot not available";
|
||||
}
|
||||
|
||||
sanitizedPartitioning(manifest) {
|
||||
// Filter core libraries, relativize URIs, and sort to make the results less
|
||||
// sensitive to compiler or test harness changes.
|
||||
print(manifest);
|
||||
var units = <List<String>>[];
|
||||
for (var unit in manifest['loadingUnits']) {
|
||||
var uris = <String>[];
|
||||
for (var uri in unit['libraries']) {
|
||||
if (uri.startsWith("dart:")) continue;
|
||||
uris.add(Uri.parse(uri).pathSegments.last);
|
||||
}
|
||||
uris.sort((a, b) => a.compareTo(b));
|
||||
units.add(uris);
|
||||
}
|
||||
units.sort((a, b) => a.first.compareTo(b.first));
|
||||
print(units);
|
||||
return units;
|
||||
}
|
||||
|
||||
await withTempDir("split-literals-test", (String tempDir) async {
|
||||
final source =
|
||||
path.join(sdkDir, "runtime/tests/vm/dart_2/split_literals.dart");
|
||||
final dill = path.join(tempDir, "split_literals.dart.dill");
|
||||
final snapshot = path.join(tempDir, "split_literals.so");
|
||||
final manifest = path.join(tempDir, "split_literals.txt");
|
||||
final deferredSnapshot = snapshot + "-2.part.so";
|
||||
|
||||
// Compile source to kernel.
|
||||
await run(genKernel, <String>[
|
||||
"--aot",
|
||||
"--platform=$platformDill",
|
||||
"-o",
|
||||
dill,
|
||||
source,
|
||||
]);
|
||||
|
||||
// Compile kernel to ELF.
|
||||
await run(genSnapshot, <String>[
|
||||
"--use_bare_instructions=false", //# object: ok
|
||||
"--use_bare_instructions=true", //# bare: ok
|
||||
"--snapshot-kind=app-aot-elf",
|
||||
"--elf=$snapshot",
|
||||
"--loading-unit-manifest=$manifest",
|
||||
dill,
|
||||
]);
|
||||
var manifestContent = jsonDecode(await new File(manifest).readAsString());
|
||||
Expect.equals(2, manifestContent["loadingUnits"].length);
|
||||
// Note package:expect doesn't do deep equals on collections.
|
||||
Expect.equals(
|
||||
"[[split_literals.dart],"
|
||||
" [split_literals_deferred.dart]]",
|
||||
sanitizedPartitioning(manifestContent).toString());
|
||||
Expect.isTrue(await new File(deferredSnapshot).exists());
|
||||
|
||||
bool containsSubsequence(haystack, needle) {
|
||||
outer:
|
||||
for (var i = 0, n = haystack.length - needle.length; i < n; i++) {
|
||||
for (var j = 0; j < needle.length; j++) {
|
||||
if (haystack[i + j] != needle.codeUnitAt(j)) continue outer;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var unit_1 = await new File(snapshot).readAsBytes();
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a list!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a map!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a box!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a list!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a map!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a box!"));
|
||||
|
||||
var unit_2 = await new File(deferredSnapshot).readAsBytes();
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a list!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a map!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a box!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a list!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a map!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a box!"));
|
||||
});
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "split_literals_deferred.dart" deferred as lib;
|
||||
|
||||
class Box {
|
||||
final contents;
|
||||
const Box(this.contents);
|
||||
String toString() => "Box($contents)";
|
||||
}
|
||||
|
||||
main() async {
|
||||
print("Root literal!");
|
||||
print(const <String>["Root literal in a list!"]);
|
||||
print(const <String, String>{"key": "Root literal in a map!"});
|
||||
print(const Box("Root literal in a box!"));
|
||||
|
||||
await lib.loadLibrary();
|
||||
lib.foo();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "split_literals.dart";
|
||||
|
||||
void foo() {
|
||||
print("Deferred literal!");
|
||||
print(const <String>["Deferred literal in a list!"]);
|
||||
print(const <String, String>{"key": "Deferred literal in a map!"});
|
||||
print(const Box("Deferred literal in a box!"));
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import "dart:convert";
|
||||
import "dart:io";
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
import "package:path/path.dart" as path;
|
||||
|
||||
import "use_flag_test_helper.dart";
|
||||
|
||||
main(List<String> args) async {
|
||||
if (!isAOTRuntime) {
|
||||
return; // Running in JIT: AOT binaries not available.
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
return; // SDK tree not available on the test device.
|
||||
}
|
||||
|
||||
// These are the tools we need to be available to run on a given platform:
|
||||
if (!File(platformDill).existsSync()) {
|
||||
throw "Cannot run test as $platformDill does not exist";
|
||||
}
|
||||
if (!await testExecutable(genSnapshot)) {
|
||||
throw "Cannot run test as $genSnapshot not available";
|
||||
}
|
||||
|
||||
sanitizedPartitioning(manifest) {
|
||||
// Filter core libraries, relativize URIs, and sort to make the results less
|
||||
// sensitive to compiler or test harness changes.
|
||||
print(manifest);
|
||||
var units = <List<String>>[];
|
||||
for (var unit in manifest['loadingUnits']) {
|
||||
var uris = <String>[];
|
||||
for (var uri in unit['libraries']) {
|
||||
if (uri.startsWith("dart:")) continue;
|
||||
uris.add(Uri.parse(uri).pathSegments.last);
|
||||
}
|
||||
uris.sort((a, b) => a.compareTo(b));
|
||||
units.add(uris);
|
||||
}
|
||||
units.sort((a, b) => a.first.compareTo(b.first));
|
||||
print(units);
|
||||
return units;
|
||||
}
|
||||
|
||||
await withTempDir("split-literals-test", (String tempDir) async {
|
||||
final source =
|
||||
path.join(sdkDir, "runtime/tests/vm/dart_2/split_literals.dart");
|
||||
final dill = path.join(tempDir, "split_literals.dart.dill");
|
||||
final snapshot = path.join(tempDir, "split_literals.so");
|
||||
final manifest = path.join(tempDir, "split_literals.txt");
|
||||
final deferredSnapshot = snapshot + "-2.part.so";
|
||||
|
||||
// Compile source to kernel.
|
||||
await run(genKernel, <String>[
|
||||
"--aot",
|
||||
"--platform=$platformDill",
|
||||
"-o",
|
||||
dill,
|
||||
source,
|
||||
]);
|
||||
|
||||
// Compile kernel to ELF.
|
||||
await run(genSnapshot, <String>[
|
||||
"--use_bare_instructions=false", //# object: ok
|
||||
"--use_bare_instructions=true", //# bare: ok
|
||||
"--snapshot-kind=app-aot-elf",
|
||||
"--elf=$snapshot",
|
||||
"--loading-unit-manifest=$manifest",
|
||||
dill,
|
||||
]);
|
||||
var manifestContent = jsonDecode(await new File(manifest).readAsString());
|
||||
Expect.equals(2, manifestContent["loadingUnits"].length);
|
||||
// Note package:expect doesn't do deep equals on collections.
|
||||
Expect.equals(
|
||||
"[[split_literals.dart],"
|
||||
" [split_literals_deferred.dart]]",
|
||||
sanitizedPartitioning(manifestContent).toString());
|
||||
Expect.isTrue(await new File(deferredSnapshot).exists());
|
||||
|
||||
bool containsSubsequence(haystack, needle) {
|
||||
outer:
|
||||
for (var i = 0, n = haystack.length - needle.length; i < n; i++) {
|
||||
for (var j = 0; j < needle.length; j++) {
|
||||
if (haystack[i + j] != needle.codeUnitAt(j)) continue outer;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
var unit_1 = await new File(snapshot).readAsBytes();
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a list!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a map!"));
|
||||
Expect.isTrue(containsSubsequence(unit_1, "Root literal in a box!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a list!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a map!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_1, "Deferred literal in a box!"));
|
||||
|
||||
var unit_2 = await new File(deferredSnapshot).readAsBytes();
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a list!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a map!"));
|
||||
Expect.isTrue(!containsSubsequence(unit_2, "Root literal in a box!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a list!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a map!"));
|
||||
Expect.isTrue(containsSubsequence(unit_2, "Deferred literal in a box!"));
|
||||
});
|
||||
}
|
||||
+272
-507
File diff suppressed because it is too large
Load Diff
@@ -116,20 +116,16 @@ class DeserializationCluster : public ZoneAllocated {
|
||||
|
||||
// Allocate memory for all objects in the cluster and write their addresses
|
||||
// into the ref array. Do not touch this memory.
|
||||
virtual void ReadAlloc(Deserializer* deserializer, bool stamp_canonical) = 0;
|
||||
virtual void ReadAlloc(Deserializer* deserializer, bool is_canonical) = 0;
|
||||
|
||||
// Initialize the cluster's objects. Do not touch the memory of other objects.
|
||||
virtual void ReadFill(Deserializer* deserializer, bool stamp_canonical) = 0;
|
||||
virtual void ReadFill(Deserializer* deserializer, bool is_canonical) = 0;
|
||||
|
||||
// Complete any action that requires the full graph to be deserialized, such
|
||||
// as rehashing.
|
||||
virtual void PostLoad(Deserializer* deserializer,
|
||||
const Array& refs,
|
||||
bool canonicalize) {
|
||||
if (canonicalize) {
|
||||
FATAL1("%s needs canonicalization but doesn't define PostLoad", name());
|
||||
}
|
||||
}
|
||||
bool is_canonical) {}
|
||||
|
||||
const char* name() const { return name_; }
|
||||
|
||||
@@ -351,7 +347,7 @@ class Serializer : public ThreadStackResource {
|
||||
Write<int32_t>(cid);
|
||||
}
|
||||
|
||||
void PrepareInstructions();
|
||||
void PrepareInstructions(GrowableArray<CodePtr>* codes);
|
||||
void WriteInstructions(InstructionsPtr instr,
|
||||
uint32_t unchecked_offset,
|
||||
CodePtr code,
|
||||
@@ -384,7 +380,6 @@ class Serializer : public ThreadStackResource {
|
||||
void set_loading_units(GrowableArray<LoadingUnitSerializationData*>* units) {
|
||||
loading_units_ = units;
|
||||
}
|
||||
intptr_t current_loading_unit_id() { return current_loading_unit_id_; }
|
||||
void set_current_loading_unit_id(intptr_t id) {
|
||||
current_loading_unit_id_ = id;
|
||||
}
|
||||
@@ -419,13 +414,6 @@ class Serializer : public ThreadStackResource {
|
||||
FATAL("Missing ref");
|
||||
}
|
||||
|
||||
bool HasRef(ObjectPtr object) const {
|
||||
return heap_->GetObjectId(object) != kUnreachableReference;
|
||||
}
|
||||
bool IsWritten(ObjectPtr object) const {
|
||||
return heap_->GetObjectId(object) > num_base_objects_;
|
||||
}
|
||||
|
||||
private:
|
||||
const char* ReadOnlyObjectType(intptr_t cid);
|
||||
|
||||
@@ -585,8 +573,6 @@ class Deserializer : public ThreadStackResource {
|
||||
|
||||
uword ReadWordWith32BitReads() { return stream_.ReadWordWith32BitReads(); }
|
||||
|
||||
intptr_t position() const { return stream_.Position(); }
|
||||
void set_position(intptr_t p) { stream_.SetPosition(p); }
|
||||
const uint8_t* CurrentBufferAddress() const {
|
||||
return stream_.AddressOfCurrentPosition();
|
||||
}
|
||||
|
||||
@@ -71,15 +71,8 @@ void CodeRelocator::Relocate(bool is_vm_isolate) {
|
||||
// We're guaranteed to have all calls resolved, since
|
||||
// * backwards calls are resolved eagerly
|
||||
// * forward calls are resolved once the target is written
|
||||
if (!all_unresolved_calls_.IsEmpty()) {
|
||||
for (auto call : all_unresolved_calls_) {
|
||||
OS::PrintErr("Unresolved call to %s from %s\n",
|
||||
Object::Handle(call->callee).ToCString(),
|
||||
Object::Handle(call->caller).ToCString());
|
||||
}
|
||||
}
|
||||
RELEASE_ASSERT(all_unresolved_calls_.IsEmpty());
|
||||
RELEASE_ASSERT(unresolved_calls_by_destination_.IsEmpty());
|
||||
ASSERT(all_unresolved_calls_.IsEmpty());
|
||||
ASSERT(unresolved_calls_by_destination_.IsEmpty());
|
||||
|
||||
// Any trampolines we created must be patched with the right offsets.
|
||||
auto it = trampolines_by_destination_.GetIterator();
|
||||
|
||||
@@ -86,7 +86,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 8;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 4;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
48;
|
||||
52;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
88;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 44;
|
||||
@@ -611,7 +611,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 16;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 8;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
96;
|
||||
104;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
164;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 88;
|
||||
@@ -1140,7 +1140,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 8;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 4;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
48;
|
||||
52;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
88;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 44;
|
||||
@@ -1662,7 +1662,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 16;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 8;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
96;
|
||||
104;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
164;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 88;
|
||||
@@ -2194,7 +2194,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 8;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 4;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
48;
|
||||
52;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
88;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 44;
|
||||
@@ -2713,7 +2713,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 16;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 8;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
96;
|
||||
104;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
164;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 88;
|
||||
@@ -3236,7 +3236,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 8;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 4;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
48;
|
||||
52;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
88;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 44;
|
||||
@@ -3752,7 +3752,7 @@ static constexpr dart::compiler::target::word Array_length_offset = 16;
|
||||
static constexpr dart::compiler::target::word Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word Array_type_arguments_offset = 8;
|
||||
static constexpr dart::compiler::target::word Class_declaration_type_offset =
|
||||
96;
|
||||
104;
|
||||
static constexpr dart::compiler::target::word Class_num_type_arguments_offset =
|
||||
164;
|
||||
static constexpr dart::compiler::target::word Class_super_type_offset = 88;
|
||||
@@ -4280,7 +4280,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
4;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 48;
|
||||
AOT_Class_declaration_type_offset = 52;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 88;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 44;
|
||||
@@ -4864,7 +4864,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
8;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 96;
|
||||
AOT_Class_declaration_type_offset = 104;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 164;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 88;
|
||||
@@ -5454,7 +5454,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
8;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 96;
|
||||
AOT_Class_declaration_type_offset = 104;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 164;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 88;
|
||||
@@ -6043,7 +6043,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
4;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 48;
|
||||
AOT_Class_declaration_type_offset = 52;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 88;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 44;
|
||||
@@ -6620,7 +6620,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
8;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 96;
|
||||
AOT_Class_declaration_type_offset = 104;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 164;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 88;
|
||||
@@ -7203,7 +7203,7 @@ static constexpr dart::compiler::target::word AOT_Array_tags_offset = 0;
|
||||
static constexpr dart::compiler::target::word AOT_Array_type_arguments_offset =
|
||||
8;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_declaration_type_offset = 96;
|
||||
AOT_Class_declaration_type_offset = 104;
|
||||
static constexpr dart::compiler::target::word
|
||||
AOT_Class_num_type_arguments_offset = 164;
|
||||
static constexpr dart::compiler::target::word AOT_Class_super_type_offset = 88;
|
||||
|
||||
@@ -20,8 +20,16 @@ void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
|
||||
const Type& type,
|
||||
const Class& type_class) {
|
||||
BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
|
||||
__ Branch(compiler::Address(
|
||||
THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
if (!compiler::IsSameObject(
|
||||
compiler::NullObject(),
|
||||
compiler::CastHandle<Object>(slow_type_test_stub))) {
|
||||
__ GenerateUnRelocatedPcRelativeTailCall();
|
||||
unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
|
||||
__ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
|
||||
} else {
|
||||
__ Branch(compiler::Address(
|
||||
THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
@@ -20,11 +20,19 @@ void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
|
||||
const Type& type,
|
||||
const Class& type_class) {
|
||||
BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
|
||||
__ ldr(
|
||||
TMP,
|
||||
compiler::Address(
|
||||
THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
__ br(TMP);
|
||||
if (!compiler::IsSameObject(
|
||||
compiler::NullObject(),
|
||||
compiler::CastHandle<Object>(slow_type_test_stub))) {
|
||||
__ GenerateUnRelocatedPcRelativeTailCall();
|
||||
unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
|
||||
__ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
|
||||
} else {
|
||||
__ ldr(TMP,
|
||||
compiler::Address(
|
||||
THR,
|
||||
compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
__ br(TMP);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
@@ -20,8 +20,16 @@ void TypeTestingStubGenerator::BuildOptimizedTypeTestStub(
|
||||
const Type& type,
|
||||
const Class& type_class) {
|
||||
BuildOptimizedTypeTestStubFastCases(assembler, hi, type, type_class);
|
||||
__ jmp(compiler::Address(
|
||||
THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
if (!compiler::IsSameObject(
|
||||
compiler::NullObject(),
|
||||
compiler::CastHandle<Object>(slow_type_test_stub))) {
|
||||
__ GenerateUnRelocatedPcRelativeTailCall();
|
||||
unresolved_calls->Add(new compiler::UnresolvedPcRelativeCall(
|
||||
__ CodeSize(), slow_type_test_stub, /*is_tail_call=*/true));
|
||||
} else {
|
||||
__ jmp(compiler::Address(
|
||||
THR, compiler::target::Thread::slow_type_test_entry_point_offset()));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
@@ -20212,11 +20212,9 @@ AbstractTypePtr Type::Canonicalize(Thread* thread, TrailPtr trail) const {
|
||||
}
|
||||
}
|
||||
ASSERT(this->Equals(type));
|
||||
// TODO(rmacnak): Revisit immediately returning type after to changes to
|
||||
// recanonicalization on load for literal splitting.
|
||||
if (type.IsCanonical()) {
|
||||
return type.ptr();
|
||||
}
|
||||
ASSERT(type.IsCanonical());
|
||||
ASSERT(type.IsOld());
|
||||
return type.ptr();
|
||||
}
|
||||
|
||||
Type& type = Type::Handle(zone);
|
||||
|
||||
@@ -1371,15 +1371,9 @@ class AssignLoadingUnitsCodeVisitor : public CodeVisitor {
|
||||
MergeAssignment(obj_, id);
|
||||
obj_ = code.compressed_stackmaps();
|
||||
MergeAssignment(obj_, id);
|
||||
if (!FLAG_use_bare_instructions) {
|
||||
obj_ = code.object_pool();
|
||||
MergeAssignment(obj_, id);
|
||||
}
|
||||
}
|
||||
|
||||
void MergeAssignment(const Object& obj, intptr_t id) {
|
||||
if (obj.IsNull()) return;
|
||||
|
||||
intptr_t old_id = heap_->GetLoadingUnit(obj_.ptr());
|
||||
if (old_id == WeakTable::kNoValue) {
|
||||
heap_->SetLoadingUnit(obj_.ptr(), id);
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
// * Target architecture
|
||||
// * DART_PRECOMPILED_RUNTIME (i.e, AOT vs. JIT)
|
||||
//
|
||||
// That is, fields in UntaggedObject and its subclasses should only be included or
|
||||
// excluded conditionally based on these factors. Otherwise, the generated
|
||||
// That is, fields in UntaggedObject and its subclasses should only be included
|
||||
// or excluded conditionally based on these factors. Otherwise, the generated
|
||||
// offsets can be wrong (which should be caught by offset checking in dart.cc).
|
||||
//
|
||||
// TODO(dartbug.com/43646): Add DART_PRECOMPILER as another axis.
|
||||
@@ -819,6 +819,8 @@ class UntaggedClass : public UntaggedObject {
|
||||
POINTER_FIELD(LibraryPtr, library)
|
||||
POINTER_FIELD(TypeArgumentsPtr, type_parameters) // Array of TypeParameter.
|
||||
POINTER_FIELD(AbstractTypePtr, super_type)
|
||||
POINTER_FIELD(ArrayPtr,
|
||||
constants) // Canonicalized const instances of this class.
|
||||
POINTER_FIELD(TypePtr, declaration_type) // Declaration type for this class.
|
||||
POINTER_FIELD(ArrayPtr,
|
||||
invocation_dispatcher_cache) // Cache for dispatcher functions.
|
||||
@@ -828,9 +830,7 @@ class UntaggedClass : public UntaggedObject {
|
||||
direct_implementors) // Array of Class.
|
||||
POINTER_FIELD(GrowableObjectArrayPtr, direct_subclasses) // Array of Class.
|
||||
POINTER_FIELD(ArrayPtr, dependent_code) // CHA optimized codes.
|
||||
POINTER_FIELD(ArrayPtr,
|
||||
constants) // Canonicalized const instances of this class.
|
||||
VISIT_TO(ObjectPtr, constants)
|
||||
VISIT_TO(ObjectPtr, dependent_code)
|
||||
ObjectPtr* to_snapshot(Snapshot::Kind kind) {
|
||||
switch (kind) {
|
||||
case Snapshot::kFullAOT:
|
||||
@@ -1642,8 +1642,6 @@ class UntaggedObjectPool : public UntaggedObject {
|
||||
|
||||
friend class Object;
|
||||
friend class CodeSerializationCluster;
|
||||
friend class UnitSerializationRoots;
|
||||
friend class UnitDeserializationRoots;
|
||||
};
|
||||
|
||||
class UntaggedInstructions : public UntaggedObject {
|
||||
|
||||
Reference in New Issue
Block a user