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

Side by Side Diff: src/compiler.cc

Issue 653603002: Try to fix cross-script global scope (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compilation-cache.cc ('k') | src/contexts.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/compiler.h" 7 #include "src/compiler.h"
8 8
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 CompilationCache* compilation_cache = isolate->compilation_cache(); 891 CompilationCache* compilation_cache = isolate->compilation_cache();
892 MaybeHandle<SharedFunctionInfo> maybe_shared_info = 892 MaybeHandle<SharedFunctionInfo> maybe_shared_info =
893 compilation_cache->LookupEval(source, context, strict_mode, 893 compilation_cache->LookupEval(source, context, strict_mode,
894 scope_position); 894 scope_position);
895 Handle<SharedFunctionInfo> shared_info; 895 Handle<SharedFunctionInfo> shared_info;
896 896
897 if (!maybe_shared_info.ToHandle(&shared_info)) { 897 if (!maybe_shared_info.ToHandle(&shared_info)) {
898 Handle<Script> script = isolate->factory()->NewScript(source); 898 Handle<Script> script = isolate->factory()->NewScript(source);
899 CompilationInfoWithZone info(script); 899 CompilationInfoWithZone info(script);
900 info.MarkAsEval(); 900 info.MarkAsEval();
901 if (context->IsNativeContext()) info.MarkAsGlobal(); 901 if (context->IsNativeContext() || context->IsGlobalContext()) {
902 info.MarkAsGlobal();
903 }
902 info.SetStrictMode(strict_mode); 904 info.SetStrictMode(strict_mode);
903 info.SetParseRestriction(restriction); 905 info.SetParseRestriction(restriction);
904 info.SetContext(context); 906 info.SetContext(context);
905 907
906 Debug::RecordEvalCaller(script); 908 Debug::RecordEvalCaller(script);
907 909
908 shared_info = CompileToplevel(&info); 910 shared_info = CompileToplevel(&info);
909 911
910 if (shared_info.is_null()) { 912 if (shared_info.is_null()) {
911 return MaybeHandle<JSFunction>(); 913 return MaybeHandle<JSFunction>();
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 AllowHandleDereference allow_deref; 1338 AllowHandleDereference allow_deref;
1337 bool tracing_on = info()->IsStub() 1339 bool tracing_on = info()->IsStub()
1338 ? FLAG_trace_hydrogen_stubs 1340 ? FLAG_trace_hydrogen_stubs
1339 : (FLAG_trace_hydrogen && 1341 : (FLAG_trace_hydrogen &&
1340 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); 1342 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter));
1341 return (tracing_on && 1343 return (tracing_on &&
1342 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); 1344 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL);
1343 } 1345 }
1344 1346
1345 } } // namespace v8::internal 1347 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compilation-cache.cc ('k') | src/contexts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698