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

Side by Side Diff: src/debug.cc

Issue 6694024: Use NativesFlag to allow/disallow natives syntax during compilation. (Closed)
Patch Set: Created 9 years, 9 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
« no previous file with comments | « src/compiler.cc ('k') | src/parser.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 if (index == -1) { 757 if (index == -1) {
758 return false; 758 return false;
759 } 759 }
760 760
761 // Find source and name for the requested script. 761 // Find source and name for the requested script.
762 Handle<String> source_code = Bootstrapper::NativesSourceLookup(index); 762 Handle<String> source_code = Bootstrapper::NativesSourceLookup(index);
763 Vector<const char> name = Natives::GetScriptName(index); 763 Vector<const char> name = Natives::GetScriptName(index);
764 Handle<String> script_name = Factory::NewStringFromAscii(name); 764 Handle<String> script_name = Factory::NewStringFromAscii(name);
765 765
766 // Compile the script. 766 // Compile the script.
767 bool allow_natives_syntax = FLAG_allow_natives_syntax;
768 FLAG_allow_natives_syntax = true;
769 Handle<SharedFunctionInfo> function_info; 767 Handle<SharedFunctionInfo> function_info;
770 function_info = Compiler::Compile(source_code, 768 function_info = Compiler::Compile(source_code,
771 script_name, 769 script_name,
772 0, 0, NULL, NULL, 770 0, 0, NULL, NULL,
773 Handle<String>::null(), 771 Handle<String>::null(),
774 NATIVES_CODE); 772 NATIVES_CODE);
775 FLAG_allow_natives_syntax = allow_natives_syntax;
776 773
777 // Silently ignore stack overflows during compilation. 774 // Silently ignore stack overflows during compilation.
778 if (function_info.is_null()) { 775 if (function_info.is_null()) {
779 ASSERT(Top::has_pending_exception()); 776 ASSERT(Top::has_pending_exception());
780 Top::clear_pending_exception(); 777 Top::clear_pending_exception();
781 return false; 778 return false;
782 } 779 }
783 780
784 // Execute the shared function in the debugger context. 781 // Execute the shared function in the debugger context.
785 Handle<Context> context = Top::global_context(); 782 Handle<Context> context = Top::global_context();
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
3079 { 3076 {
3080 Locker locker; 3077 Locker locker;
3081 Debugger::CallMessageDispatchHandler(); 3078 Debugger::CallMessageDispatchHandler();
3082 } 3079 }
3083 } 3080 }
3084 } 3081 }
3085 3082
3086 #endif // ENABLE_DEBUGGER_SUPPORT 3083 #endif // ENABLE_DEBUGGER_SUPPORT
3087 3084
3088 } } // namespace v8::internal 3085 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698