Index: src/compilation-cache.cc |
diff --git a/src/compilation-cache.cc b/src/compilation-cache.cc |
index 28e833a4933e1457a5f08ac8132338aef82c7938..05f7ffc9ff79d4740d9d89f4e46d4d1403edbccf 100644 |
--- a/src/compilation-cache.cc |
+++ b/src/compilation-cache.cc |
@@ -27,6 +27,7 @@ |
#include "v8.h" |
+#include "assembler.h" |
#include "compilation-cache.h" |
#include "serialize.h" |
@@ -250,7 +251,8 @@ void CompilationCacheScript::Put(Handle<String> source, |
Handle<SharedFunctionInfo> CompilationCacheEval::Lookup( |
Handle<String> source, |
Handle<Context> context, |
- StrictModeFlag strict_mode) { |
+ StrictModeFlag strict_mode, |
+ int scope_position) { |
// Make sure not to leak the table into the surrounding handle |
// scope. Otherwise, we risk keeping old tables around even after |
// having cleared the cache. |
@@ -259,7 +261,8 @@ Handle<SharedFunctionInfo> CompilationCacheEval::Lookup( |
{ HandleScope scope(isolate()); |
for (generation = 0; generation < generations(); generation++) { |
Handle<CompilationCacheTable> table = GetTable(generation); |
- result = table->LookupEval(*source, *context, strict_mode); |
+ result = table->LookupEval( |
+ *source, *context, strict_mode, scope_position); |
if (result->IsSharedFunctionInfo()) { |
break; |
} |
@@ -269,7 +272,7 @@ Handle<SharedFunctionInfo> CompilationCacheEval::Lookup( |
Handle<SharedFunctionInfo> |
function_info(SharedFunctionInfo::cast(result), isolate()); |
if (generation != 0) { |
- Put(source, context, function_info); |
+ Put(source, context, function_info, scope_position); |
} |
isolate()->counters()->compilation_cache_hits()->Increment(); |
return function_info; |
@@ -283,27 +286,31 @@ Handle<SharedFunctionInfo> CompilationCacheEval::Lookup( |
MaybeObject* CompilationCacheEval::TryTablePut( |
Handle<String> source, |
Handle<Context> context, |
- Handle<SharedFunctionInfo> function_info) { |
+ Handle<SharedFunctionInfo> function_info, |
+ int scope_position) { |
Handle<CompilationCacheTable> table = GetFirstTable(); |
- return table->PutEval(*source, *context, *function_info); |
+ return table->PutEval(*source, *context, *function_info, scope_position); |
} |
Handle<CompilationCacheTable> CompilationCacheEval::TablePut( |
Handle<String> source, |
Handle<Context> context, |
- Handle<SharedFunctionInfo> function_info) { |
+ Handle<SharedFunctionInfo> function_info, |
+ int scope_position) { |
CALL_HEAP_FUNCTION(isolate(), |
- TryTablePut(source, context, function_info), |
+ TryTablePut( |
+ source, context, function_info, scope_position), |
CompilationCacheTable); |
} |
void CompilationCacheEval::Put(Handle<String> source, |
Handle<Context> context, |
- Handle<SharedFunctionInfo> function_info) { |
+ Handle<SharedFunctionInfo> function_info, |
+ int scope_position) { |
HandleScope scope(isolate()); |
- SetFirstTable(TablePut(source, context, function_info)); |
+ SetFirstTable(TablePut(source, context, function_info, scope_position)); |
} |
@@ -389,16 +396,19 @@ Handle<SharedFunctionInfo> CompilationCache::LookupEval( |
Handle<String> source, |
Handle<Context> context, |
bool is_global, |
- StrictModeFlag strict_mode) { |
+ StrictModeFlag strict_mode, |
+ int scope_position) { |
if (!IsEnabled()) { |
return Handle<SharedFunctionInfo>::null(); |
} |
Handle<SharedFunctionInfo> result; |
if (is_global) { |
- result = eval_global_.Lookup(source, context, strict_mode); |
+ result = eval_global_.Lookup(source, context, strict_mode, scope_position); |
} else { |
- result = eval_contextual_.Lookup(source, context, strict_mode); |
+ ASSERT(scope_position != RelocInfo::kNoPosition); |
+ result = eval_contextual_.Lookup( |
+ source, context, strict_mode, scope_position); |
} |
return result; |
} |
@@ -427,16 +437,18 @@ void CompilationCache::PutScript(Handle<String> source, |
void CompilationCache::PutEval(Handle<String> source, |
Handle<Context> context, |
bool is_global, |
- Handle<SharedFunctionInfo> function_info) { |
+ Handle<SharedFunctionInfo> function_info, |
+ int scope_position) { |
if (!IsEnabled()) { |
return; |
} |
HandleScope scope(isolate()); |
if (is_global) { |
- eval_global_.Put(source, context, function_info); |
+ eval_global_.Put(source, context, function_info, scope_position); |
} else { |
- eval_contextual_.Put(source, context, function_info); |
+ ASSERT(scope_position != RelocInfo::kNoPosition); |
+ eval_contextual_.Put(source, context, function_info, scope_position); |
} |
} |