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

Unified Diff: src/compilation-cache.h

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. Created 3 years, 10 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/code-stub-assembler.cc ('k') | src/compilation-cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-cache.h
diff --git a/src/compilation-cache.h b/src/compilation-cache.h
index 8b0426974c99cb918750e25584f9bb934aa08e90..d1c35046d5c547a6129dd4271d97f9e00c659111 100644
--- a/src/compilation-cache.h
+++ b/src/compilation-cache.h
@@ -76,17 +76,16 @@ class CompilationSubCache {
// Sub-cache for scripts.
class CompilationCacheScript : public CompilationSubCache {
public:
- CompilationCacheScript(Isolate* isolate, int generations);
+ explicit CompilationCacheScript(Isolate* isolate);
- Handle<SharedFunctionInfo> Lookup(Handle<String> source, Handle<Object> name,
- int line_offset, int column_offset,
- ScriptOriginOptions resource_options,
- Handle<Context> context,
- LanguageMode language_mode);
- void Put(Handle<String> source,
- Handle<Context> context,
- LanguageMode language_mode,
- Handle<SharedFunctionInfo> function_info);
+ InfoVectorPair Lookup(Handle<String> source, Handle<Object> name,
+ int line_offset, int column_offset,
+ ScriptOriginOptions resource_options,
+ Handle<Context> context, LanguageMode language_mode);
+
+ void Put(Handle<String> source, Handle<Context> context,
+ LanguageMode language_mode, Handle<SharedFunctionInfo> function_info,
+ Handle<Cell> literals);
private:
bool HasOrigin(Handle<SharedFunctionInfo> function_info, Handle<Object> name,
@@ -111,16 +110,18 @@ class CompilationCacheScript : public CompilationSubCache {
// 4. The start position of the calling scope.
class CompilationCacheEval: public CompilationSubCache {
public:
- CompilationCacheEval(Isolate* isolate, int generations)
- : CompilationSubCache(isolate, generations) { }
+ explicit CompilationCacheEval(Isolate* isolate)
+ : CompilationSubCache(isolate, 1) {}
- MaybeHandle<SharedFunctionInfo> Lookup(Handle<String> source,
- Handle<SharedFunctionInfo> outer_info,
- LanguageMode language_mode,
- int scope_position);
+ InfoVectorPair Lookup(Handle<String> source,
+ Handle<SharedFunctionInfo> outer_info,
+ Handle<Context> native_context,
+ LanguageMode language_mode, int scope_position);
void Put(Handle<String> source, Handle<SharedFunctionInfo> outer_info,
- Handle<SharedFunctionInfo> function_info, int scope_position);
+ Handle<SharedFunctionInfo> function_info,
+ Handle<Context> native_context, Handle<Cell> literals,
+ int scope_position);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheEval);
@@ -142,7 +143,6 @@ class CompilationCacheRegExp: public CompilationSubCache {
DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheRegExp);
};
-
// The compilation cache keeps shared function infos for compiled
// scripts and evals. The shared function infos are looked up using
// the source string as the key. For regular expressions the
@@ -152,17 +152,19 @@ class CompilationCache {
// Finds the script shared function info for a source
// string. Returns an empty handle if the cache doesn't contain a
// script for the given source string with the right origin.
- MaybeHandle<SharedFunctionInfo> LookupScript(
- Handle<String> source, Handle<Object> name, int line_offset,
- int column_offset, ScriptOriginOptions resource_options,
- Handle<Context> context, LanguageMode language_mode);
+ InfoVectorPair LookupScript(Handle<String> source, Handle<Object> name,
+ int line_offset, int column_offset,
+ ScriptOriginOptions resource_options,
+ Handle<Context> context,
+ LanguageMode language_mode);
// Finds the shared function info for a source string for eval in a
// given context. Returns an empty handle if the cache doesn't
// contain a script for the given source string.
- MaybeHandle<SharedFunctionInfo> LookupEval(
- Handle<String> source, Handle<SharedFunctionInfo> outer_info,
- Handle<Context> context, LanguageMode language_mode, int scope_position);
+ InfoVectorPair LookupEval(Handle<String> source,
+ Handle<SharedFunctionInfo> outer_info,
+ Handle<Context> context, LanguageMode language_mode,
+ int scope_position);
// Returns the regexp data associated with the given regexp if it
// is in cache, otherwise an empty handle.
@@ -171,16 +173,17 @@ class CompilationCache {
// Associate the (source, kind) pair to the shared function
// info. This may overwrite an existing mapping.
- void PutScript(Handle<String> source,
- Handle<Context> context,
+ void PutScript(Handle<String> source, Handle<Context> context,
LanguageMode language_mode,
- Handle<SharedFunctionInfo> function_info);
+ Handle<SharedFunctionInfo> function_info,
+ Handle<Cell> literals);
// Associate the (source, context->closure()->shared(), kind) triple
// with the shared function info. This may overwrite an existing mapping.
void PutEval(Handle<String> source, Handle<SharedFunctionInfo> outer_info,
Handle<Context> context,
- Handle<SharedFunctionInfo> function_info, int scope_position);
+ Handle<SharedFunctionInfo> function_info, Handle<Cell> literals,
+ int scope_position);
// Associate the (source, flags) pair to the given regexp data.
// This may overwrite an existing mapping.
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/compilation-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698