Commit a1986533 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Comment] Add a comment to CompilationCacheTable::Lookup/PutScript.

Change-Id: Ia5fa003e8a3bc205ea0384bea9ebb3f6532a1771
Reviewed-on: https://chromium-review.googlesource.com/1163619Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54938}
parent a2679e52
......@@ -17670,6 +17670,10 @@ FeedbackCell* SearchLiteralsMap(CompilationCacheTable* cache, int cache_entry,
MaybeHandle<SharedFunctionInfo> CompilationCacheTable::LookupScript(
Handle<String> src, Handle<Context> native_context,
LanguageMode language_mode) {
// We use the empty function SFI as part of the key. Although the
// empty_function is native context dependent, the SFI is de-duped on
// snapshot builds by the PartialSnapshotCache, and so this does not prevent
// reuse of scripts in the compilation cache across native contexts.
Handle<SharedFunctionInfo> shared(native_context->empty_function()->shared(),
native_context->GetIsolate());
StringSharedKey key(src, shared, language_mode, kNoSourcePosition);
......@@ -17732,6 +17736,10 @@ Handle<CompilationCacheTable> CompilationCacheTable::PutScript(
Handle<Context> native_context, LanguageMode language_mode,
Handle<SharedFunctionInfo> value) {
Isolate* isolate = native_context->GetIsolate();
// We use the empty function SFI as part of the key. Although the
// empty_function is native context dependent, the SFI is de-duped on
// snapshot builds by the PartialSnapshotCache, and so this does not prevent
// reuse of scripts in the compilation cache across native contexts.
Handle<SharedFunctionInfo> shared(native_context->empty_function()->shared(),
isolate);
StringSharedKey key(src, shared, language_mode, kNoSourcePosition);
......
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