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

Unified Diff: runtime/vm/assembler_arm64.cc

Issue 1175523002: Object pool with support for untagged entries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_arm64.cc
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 91b29621ada63ae4c9429e7196c0d6c595eecedc..2d800fc5c8b6835068470d53f3936e708573ae85 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -35,29 +35,29 @@ Assembler::Assembler(bool use_far_branches)
// These objects and labels need to be accessible through every pool-pointer
// at the same index.
intptr_t index =
- object_pool_.AddObject(Object::null_object(), kNotPatchable);
+ object_pool_wrapper_.AddObject(Object::null_object());
ASSERT(index == 0);
- index = object_pool_.AddObject(Bool::True(), kNotPatchable);
+ index = object_pool_wrapper_.AddObject(Bool::True());
ASSERT(index == 1);
- index = object_pool_.AddObject(Bool::False(), kNotPatchable);
+ index = object_pool_wrapper_.AddObject(Bool::False());
ASSERT(index == 2);
const Smi& vacant = Smi::Handle(Smi::New(0xfa >> kSmiTagShift));
StubCode* stub_code = Isolate::Current()->stub_code();
if (stub_code->UpdateStoreBuffer_entry() != NULL) {
- object_pool_.AddExternalLabel(
+ object_pool_wrapper_.AddExternalLabel(
&stub_code->UpdateStoreBufferLabel(), kNotPatchable);
} else {
- object_pool_.AddObject(vacant, kNotPatchable);
+ object_pool_wrapper_.AddObject(vacant);
}
if (stub_code->CallToRuntime_entry() != NULL) {
- object_pool_.AddExternalLabel(
+ object_pool_wrapper_.AddExternalLabel(
&stub_code->CallToRuntimeLabel(), kNotPatchable);
} else {
- object_pool_.AddObject(vacant, kNotPatchable);
+ object_pool_wrapper_.AddObject(vacant);
}
}
}
@@ -390,8 +390,7 @@ void Assembler::LoadWordFromPoolOffsetFixed(Register dst, Register pp,
intptr_t Assembler::FindImmediate(int64_t imm) {
ASSERT(Isolate::Current() != Dart::vm_isolate());
- const Smi& smi = Smi::Handle(reinterpret_cast<RawSmi*>(imm));
- return object_pool_.FindObject(smi, kNotPatchable);
+ return object_pool_wrapper_.FindImmediate(imm);
}
@@ -441,8 +440,8 @@ void Assembler::LoadExternalLabel(Register dst,
Register pp) {
const int64_t target = static_cast<int64_t>(label->address());
if (CanLoadImmediateFromPool(target, pp)) {
- const int32_t offset =
- Array::element_offset(object_pool_.FindExternalLabel(label, patchable));
+ const int32_t offset = ObjectPool::element_offset(
+ object_pool_wrapper_.FindExternalLabel(label, patchable));
LoadWordFromPoolOffset(dst, pp, offset);
} else {
LoadImmediate(dst, target, kNoPP);
@@ -454,8 +453,8 @@ void Assembler::LoadExternalLabelFixed(Register dst,
const ExternalLabel* label,
Patchability patchable,
Register pp) {
- const int32_t offset =
- Array::element_offset(object_pool_.FindExternalLabel(label, patchable));
+ const int32_t offset = ObjectPool::element_offset(
+ object_pool_wrapper_.FindExternalLabel(label, patchable));
LoadWordFromPoolOffsetFixed(dst, pp, offset);
}
@@ -468,7 +467,7 @@ void Assembler::LoadIsolate(Register dst, Register pp) {
void Assembler::LoadObject(Register dst, const Object& object, Register pp) {
if (CanLoadObjectFromPool(object)) {
const int32_t offset =
- Array::element_offset(object_pool_.FindObject(object, kNotPatchable));
+ ObjectPool::element_offset(object_pool_wrapper_.FindObject(object));
LoadWordFromPoolOffset(dst, pp, offset);
} else {
ASSERT((Isolate::Current() == Dart::vm_isolate()) ||
@@ -495,7 +494,7 @@ void Assembler::LoadDecodableImmediate(Register reg, int64_t imm, Register pp) {
allow_constant_pool()) {
int64_t val_smi_tag = imm & kSmiTagMask;
imm &= ~kSmiTagMask; // Mask off the tag bits.
- const int32_t offset = Array::element_offset(FindImmediate(imm));
+ const int32_t offset = ObjectPool::element_offset(FindImmediate(imm));
LoadWordFromPoolOffset(reg, pp, offset);
if (val_smi_tag != 0) {
// Add back the tag bits.
@@ -531,7 +530,7 @@ void Assembler::LoadImmediate(Register reg, int64_t imm, Register pp) {
// Save the bits that must be masked-off for the SmiTag
int64_t val_smi_tag = imm & kSmiTagMask;
imm &= ~kSmiTagMask; // Mask off the tag bits.
- const int32_t offset = Array::element_offset(FindImmediate(imm));
+ const int32_t offset = ObjectPool::element_offset(FindImmediate(imm));
LoadWordFromPoolOffset(reg, pp, offset);
if (val_smi_tag != 0) {
// Add back the tag bits.
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698