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

Unified Diff: src/objects.cc

Issue 678843004: Use shared function info for eval cache key. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 81eec5e3df5cf87ec111ee876bc222f5881f2c63..424bbb59bd85cea17c67e3eba1a332e75f1d1b32 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -14849,13 +14849,13 @@ Handle<Object> CompilationCacheTable::Lookup(Handle<String> src,
}
-Handle<Object> CompilationCacheTable::LookupEval(Handle<String> src,
- Handle<Context> context,
- StrictMode strict_mode,
- int scope_position) {
+Handle<Object> CompilationCacheTable::LookupEval(
+ Handle<String> src, Handle<SharedFunctionInfo> outer_info,
+ StrictMode strict_mode, int scope_position) {
Isolate* isolate = GetIsolate();
- Handle<SharedFunctionInfo> shared(context->closure()->shared());
- StringSharedKey key(src, shared, strict_mode, scope_position);
+ // Cache key is the tuple (source, outer shared function info, scope position)
+ // to unambiguously identify the context chain the cached eval code assumes.
+ StringSharedKey key(src, outer_info, strict_mode, scope_position);
int entry = FindEntry(&key);
if (entry == kNotFound) return isolate->factory()->undefined_value();
return Handle<Object>(get(EntryToIndex(entry) + 1), isolate);
@@ -14892,11 +14892,10 @@ Handle<CompilationCacheTable> CompilationCacheTable::Put(
Handle<CompilationCacheTable> CompilationCacheTable::PutEval(
Handle<CompilationCacheTable> cache, Handle<String> src,
- Handle<Context> context, Handle<SharedFunctionInfo> value,
+ Handle<SharedFunctionInfo> outer_info, Handle<SharedFunctionInfo> value,
int scope_position) {
Isolate* isolate = cache->GetIsolate();
- Handle<SharedFunctionInfo> shared(context->closure()->shared());
- StringSharedKey key(src, shared, value->strict_mode(), scope_position);
+ StringSharedKey key(src, outer_info, value->strict_mode(), scope_position);
cache = EnsureCapacity(cache, 1, &key);
Handle<Object> k = key.AsHandle(isolate);
int entry = cache->FindInsertionEntry(key.Hash());
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698