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

Unified Diff: src/compilation-cache.cc

Issue 1135343005: Revert of [V8] Added Script::is_opaque flag for embedders (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/compilation-cache.h ('k') | src/compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-cache.cc
diff --git a/src/compilation-cache.cc b/src/compilation-cache.cc
index 7b2d6d5c354cbcaef03be03a15d6c213a61010e3..f2cb4c9000efc32fa530776584c440ceedd5fe46 100644
--- a/src/compilation-cache.cc
+++ b/src/compilation-cache.cc
@@ -113,7 +113,8 @@
bool CompilationCacheScript::HasOrigin(Handle<SharedFunctionInfo> function_info,
Handle<Object> name, int line_offset,
int column_offset,
- ScriptOriginOptions resource_options) {
+ bool is_embedder_debug_script,
+ bool is_shared_cross_origin) {
Handle<Script> script =
Handle<Script>(Script::cast(function_info->script()), isolate());
// If the script name isn't set, the boilerplate script should have
@@ -126,9 +127,12 @@
if (column_offset != script->column_offset()->value()) return false;
// Check that both names are strings. If not, no match.
if (!name->IsString() || !script->name()->IsString()) return false;
- // Are the origin_options same?
- if (resource_options.Flags() != script->origin_options().Flags())
+ // Were both scripts tagged by the embedder as being internal script?
+ if (is_embedder_debug_script != script->is_embedder_debug_script()) {
return false;
+ }
+ // Were both scripts tagged by the embedder as being shared cross-origin?
+ if (is_shared_cross_origin != script->is_shared_cross_origin()) return false;
// Compare the two name strings for equality.
return String::Equals(Handle<String>::cast(name),
Handle<String>(String::cast(script->name())));
@@ -141,8 +145,9 @@
// won't.
Handle<SharedFunctionInfo> CompilationCacheScript::Lookup(
Handle<String> source, Handle<Object> name, int line_offset,
- int column_offset, ScriptOriginOptions resource_options,
- Handle<Context> context, LanguageMode language_mode) {
+ int column_offset, bool is_embedder_debug_script,
+ bool is_shared_cross_origin, Handle<Context> context,
+ LanguageMode language_mode) {
Object* result = NULL;
int generation;
@@ -158,7 +163,7 @@
// Break when we've found a suitable shared function info that
// matches the origin.
if (HasOrigin(function_info, name, line_offset, column_offset,
- resource_options)) {
+ is_embedder_debug_script, is_shared_cross_origin)) {
result = *function_info;
break;
}
@@ -172,8 +177,8 @@
if (result != NULL) {
Handle<SharedFunctionInfo> shared(SharedFunctionInfo::cast(result),
isolate());
- DCHECK(
- HasOrigin(shared, name, line_offset, column_offset, resource_options));
+ DCHECK(HasOrigin(shared, name, line_offset, column_offset,
+ is_embedder_debug_script, is_shared_cross_origin));
// If the script was found in a later generation, we promote it to
// the first generation to let it survive longer in the cache.
if (generation != 0) Put(source, context, language_mode, shared);
@@ -287,12 +292,14 @@
MaybeHandle<SharedFunctionInfo> CompilationCache::LookupScript(
Handle<String> source, Handle<Object> name, int line_offset,
- int column_offset, ScriptOriginOptions resource_options,
- Handle<Context> context, LanguageMode language_mode) {
+ int column_offset, bool is_embedder_debug_script,
+ bool is_shared_cross_origin, Handle<Context> context,
+ LanguageMode language_mode) {
if (!IsEnabled()) return MaybeHandle<SharedFunctionInfo>();
return script_.Lookup(source, name, line_offset, column_offset,
- resource_options, context, language_mode);
+ is_embedder_debug_script, is_shared_cross_origin,
+ context, language_mode);
}
« no previous file with comments | « src/compilation-cache.h ('k') | src/compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698