Commit f846e7df authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[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/506190Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45333}
parent 1345de0b
...@@ -299,12 +299,9 @@ bool CodeGenerator::IsMaterializableFromRoot( ...@@ -299,12 +299,9 @@ bool CodeGenerator::IsMaterializableFromRoot(
const CallDescriptor* incoming_descriptor = const CallDescriptor* incoming_descriptor =
linkage()->GetIncomingDescriptor(); linkage()->GetIncomingDescriptor();
if (incoming_descriptor->flags() & CallDescriptor::kCanUseRoots) { if (incoming_descriptor->flags() & CallDescriptor::kCanUseRoots) {
RootIndexMap map(isolate()); Heap* heap = isolate()->heap();
int root_index = map.Lookup(*object); return heap->IsRootHandle(object, index_return) &&
if (root_index != RootIndexMap::kInvalidRootIndex) { heap->RootCanBeTreatedAsConstant(*index_return);
*index_return = static_cast<Heap::RootListIndex>(root_index);
return true;
}
} }
return false; return false;
} }
......
...@@ -237,14 +237,14 @@ KNOWN_MAPS = { ...@@ -237,14 +237,14 @@ KNOWN_MAPS = {
0x03e31: (188, "ExternalMap"), 0x03e31: (188, "ExternalMap"),
0x03e89: (106, "NativeSourceStringMap"), 0x03e89: (106, "NativeSourceStringMap"),
0x03ee1: (152, "InterceptorInfoMap"), 0x03ee1: (152, "InterceptorInfoMap"),
0x03f39: (204, "JSPromiseCapabilityMap"), 0x03f39: (156, "AllocationMementoMap"),
0x03f91: (149, "AccessorInfoMap"), 0x03f91: (204, "JSPromiseCapabilityMap"),
0x03fe9: (150, "AccessorPairMap"), 0x03fe9: (149, "AccessorInfoMap"),
0x04041: (151, "AccessCheckInfoMap"), 0x04041: (150, "AccessorPairMap"),
0x04099: (153, "FunctionTemplateInfoMap"), 0x04099: (151, "AccessCheckInfoMap"),
0x040f1: (154, "ObjectTemplateInfoMap"), 0x040f1: (153, "FunctionTemplateInfoMap"),
0x04149: (155, "AllocationSiteMap"), 0x04149: (154, "ObjectTemplateInfoMap"),
0x041a1: (156, "AllocationMementoMap"), 0x041a1: (155, "AllocationSiteMap"),
0x041f9: (158, "AliasedArgumentsEntryMap"), 0x041f9: (158, "AliasedArgumentsEntryMap"),
0x04251: (159, "PromiseResolveThenableJobInfoMap"), 0x04251: (159, "PromiseResolveThenableJobInfoMap"),
0x042a9: (160, "PromiseReactionJobInfoMap"), 0x042a9: (160, "PromiseReactionJobInfoMap"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment