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

Unified Diff: src/compiler.cc

Issue 4135004: Separate JSON parsing from the JavaScript parser. (Closed)
Patch Set: Rename GetSymbol. Move ZoneScope. Created 10 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/compiler.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 6cc09713d61191b3c9f5f826fd14b62fd6b0a398..1674ca810633ac8f628bf84950175d7c53a7133f 100755
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -152,10 +152,8 @@ static Handle<SharedFunctionInfo> MakeFunctionInfo(CompilationInfo* info) {
script->set_context_data((*i::Top::global_context())->data());
#ifdef ENABLE_DEBUGGER_SUPPORT
- if (info->is_eval() || info->is_json()) {
- Script::CompilationType compilation_type = info->is_json()
- ? Script::COMPILATION_TYPE_JSON
- : Script::COMPILATION_TYPE_EVAL;
+ if (info->is_eval()) {
+ Script::CompilationType compilation_type = Script::COMPILATION_TYPE_EVAL;
script->set_compilation_type(Smi::FromInt(compilation_type));
// For eval scripts add information on the function from which eval was
// called.
@@ -323,13 +321,7 @@ Handle<SharedFunctionInfo> Compiler::Compile(Handle<String> source,
Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
Handle<Context> context,
- bool is_global,
- ValidationState validate) {
- // Note that if validation is required then no path through this function
- // is allowed to return a value without validating that the input is legal
- // json.
- bool is_json = (validate == VALIDATE_JSON);
-
+ bool is_global) {
int source_length = source->length();
Counters::total_eval_size.Increment(source_length);
Counters::total_compile_size.Increment(source_length);
@@ -338,13 +330,9 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
VMState state(COMPILER);
// Do a lookup in the compilation cache; if the entry is not there, invoke
- // the compiler and add the result to the cache. If we're evaluating json
- // we bypass the cache since we can't be sure a potential value in the
- // cache has been validated.
+ // the compiler and add the result to the cache.
Handle<SharedFunctionInfo> result;
- if (!is_json) {
- result = CompilationCache::LookupEval(source, context, is_global);
- }
+ result = CompilationCache::LookupEval(source, context, is_global);
if (result.is_null()) {
// Create a script object describing the script to be compiled.
@@ -352,12 +340,9 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
CompilationInfo info(script);
info.MarkAsEval();
if (is_global) info.MarkAsGlobal();
- if (is_json) info.MarkAsJson();
info.SetCallingContext(context);
result = MakeFunctionInfo(&info);
- if (!result.is_null() && !is_json) {
- // For json it's unlikely that we'll ever see exactly the same string
- // again so we don't use the compilation cache.
+ if (!result.is_null()) {
CompilationCache::PutEval(source, context, is_global, result);
}
}
« no previous file with comments | « src/compiler.h ('k') | src/debug-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698