[compiler] Make root detection thread-safe.

... by only looking at the handle.

This is in preparation for running code generation off the main thread.

Bug: v8:6048
Change-Id: I19b105c13278a2821a0b2395033e54abf5552a43
Reviewed-on: https://chromium-review.googlesource.com/506190
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45333}
This commit is contained in:
Georg Neis 2017-05-16 12:40:47 +02:00 committed by Commit Bot
parent 1345de0b1e
commit f846e7df71
2 changed files with 11 additions and 14 deletions

View File

@ -299,12 +299,9 @@ bool CodeGenerator::IsMaterializableFromRoot(
const CallDescriptor* incoming_descriptor =
linkage()->GetIncomingDescriptor();
if (incoming_descriptor->flags() & CallDescriptor::kCanUseRoots) {
RootIndexMap map(isolate());
int root_index = map.Lookup(*object);
if (root_index != RootIndexMap::kInvalidRootIndex) {
*index_return = static_cast<Heap::RootListIndex>(root_index);
return true;
}
Heap* heap = isolate()->heap();
return heap->IsRootHandle(object, index_return) &&
heap->RootCanBeTreatedAsConstant(*index_return);
}
return false;
}

View File

@ -237,14 +237,14 @@ KNOWN_MAPS = {
0x03e31: (188, "ExternalMap"),
0x03e89: (106, "NativeSourceStringMap"),
0x03ee1: (152, "InterceptorInfoMap"),
0x03f39: (204, "JSPromiseCapabilityMap"),
0x03f91: (149, "AccessorInfoMap"),
0x03fe9: (150, "AccessorPairMap"),
0x04041: (151, "AccessCheckInfoMap"),
0x04099: (153, "FunctionTemplateInfoMap"),
0x040f1: (154, "ObjectTemplateInfoMap"),
0x04149: (155, "AllocationSiteMap"),
0x041a1: (156, "AllocationMementoMap"),
0x03f39: (156, "AllocationMementoMap"),
0x03f91: (204, "JSPromiseCapabilityMap"),
0x03fe9: (149, "AccessorInfoMap"),
0x04041: (150, "AccessorPairMap"),
0x04099: (151, "AccessCheckInfoMap"),
0x040f1: (153, "FunctionTemplateInfoMap"),
0x04149: (154, "ObjectTemplateInfoMap"),
0x041a1: (155, "AllocationSiteMap"),
0x041f9: (158, "AliasedArgumentsEntryMap"),
0x04251: (159, "PromiseResolveThenableJobInfoMap"),
0x042a9: (160, "PromiseReactionJobInfoMap"),