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

Unified Diff: src/objects.h

Issue 2065453002: [module] Track script "module code" status Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Extend compilation cache to recognize module code Created 4 years, 6 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/compiler.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index a7aabe23e0f856b18734e09f3fe4f40c7b4b508d..1d81c8452c08de860451339f04eb834e4d90d8a0 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6456,6 +6456,11 @@ class Script: public Struct {
inline v8::ScriptOriginOptions origin_options();
inline void set_origin_options(ScriptOriginOptions origin_options);
+ // [is_module]: determines whether the script is an ES2015 module. Encoded in
+ // the 'flags' field.
+ inline bool is_module();
+ inline void set_is_module(bool value);
+
DECLARE_CAST(Script)
// If script source is an external string, check that the underlying
@@ -6553,6 +6558,7 @@ class Script: public Struct {
static const int kOriginOptionsSize = 3;
static const int kOriginOptionsMask = ((1 << kOriginOptionsSize) - 1)
<< kOriginOptionsShift;
+ static const int kIsModuleBit = kOriginOptionsShift + kOriginOptionsSize;
DISALLOW_IMPLICIT_CONSTRUCTORS(Script);
};
@@ -8105,16 +8111,18 @@ class CompilationCacheTable: public HashTable<CompilationCacheTable,
HashTableKey*> {
public:
// Find cached value for a string key, otherwise return null.
- Handle<Object> Lookup(
- Handle<String> src, Handle<Context> context, LanguageMode language_mode);
+ Handle<Object> Lookup(Handle<String> src, Handle<Context> context,
+ LanguageMode language_mode, bool is_module);
Handle<Object> LookupEval(
Handle<String> src, Handle<SharedFunctionInfo> shared,
LanguageMode language_mode, int scope_position);
Handle<Object> LookupRegExp(Handle<String> source, JSRegExp::Flags flags);
- static Handle<CompilationCacheTable> Put(
- Handle<CompilationCacheTable> cache, Handle<String> src,
- Handle<Context> context, LanguageMode language_mode,
- Handle<Object> value);
+ static Handle<CompilationCacheTable> Put(Handle<CompilationCacheTable> cache,
+ Handle<String> src,
+ Handle<Context> context,
+ LanguageMode language_mode,
+ bool is_module,
+ Handle<Object> value);
static Handle<CompilationCacheTable> PutEval(
Handle<CompilationCacheTable> cache, Handle<String> src,
Handle<SharedFunctionInfo> context, Handle<SharedFunctionInfo> value,
« no previous file with comments | « src/compiler.cc ('k') | src/objects.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698