[turbofan] Materialize all from non-writable roots from root array.
R=jarin@chromium.org Review URL: https://codereview.chromium.org/1175113005 Cr-Commit-Position: refs/heads/master@{#28942}
This commit is contained in:
parent
896b7d7ee5
commit
d9e009f900
@ -221,7 +221,16 @@ bool CodeGenerator::IsMaterializableFromFrame(Handle<HeapObject> object,
|
||||
bool CodeGenerator::IsMaterializableFromRoot(
|
||||
Handle<HeapObject> object, Heap::RootListIndex* index_return) {
|
||||
if (linkage()->GetIncomingDescriptor()->IsJSFunctionCall()) {
|
||||
return isolate()->heap()->GetRootListIndex(object, index_return);
|
||||
// Check if {object} is one of the non-smi roots that cannot be written
|
||||
// after initialization.
|
||||
for (int i = 0; i < Heap::kSmiRootsStart; ++i) {
|
||||
Heap::RootListIndex const index = static_cast<Heap::RootListIndex>(i);
|
||||
if (!Heap::RootCanBeWrittenAfterInitialization(index) &&
|
||||
*object == isolate()->heap()->root(index)) {
|
||||
*index_return = index;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -4920,20 +4920,6 @@ bool Heap::RootIsImmortalImmovable(int root_index) {
|
||||
}
|
||||
|
||||
|
||||
bool Heap::GetRootListIndex(Handle<HeapObject> object,
|
||||
Heap::RootListIndex* index_return) {
|
||||
Object* ptr = *object;
|
||||
#define IMMORTAL_IMMOVABLE_ROOT(Name) \
|
||||
if (ptr == roots_[Heap::k##Name##RootIndex]) { \
|
||||
*index_return = k##Name##RootIndex; \
|
||||
return true; \
|
||||
}
|
||||
IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT)
|
||||
#undef IMMORTAL_IMMOVABLE_ROOT
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef VERIFY_HEAP
|
||||
void Heap::Verify() {
|
||||
CHECK(HasBeenSetUp());
|
||||
|
@ -1211,10 +1211,6 @@ class Heap {
|
||||
kSmiRootsStart = kStringTableRootIndex + 1
|
||||
};
|
||||
|
||||
// Get the root list index for {object} if such a root list index exists.
|
||||
bool GetRootListIndex(Handle<HeapObject> object,
|
||||
Heap::RootListIndex* index_return);
|
||||
|
||||
Object* root(RootListIndex index) { return roots_[index]; }
|
||||
|
||||
STATIC_ASSERT(kUndefinedValueRootIndex ==
|
||||
|
Loading…
Reference in New Issue
Block a user