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

Unified Diff: src/compiler.cc

Issue 8344082: Replace boolean indications of strict mode by an enum value. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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/full-codegen.h » ('j') | src/parser.cc » ('J')
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 7f04aaeb9b5185e765a91f953c5ddaa9bf4488c0..acc6e8491ffd9af1f3ffb688b83c978e6f770b2c 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -558,7 +558,7 @@ Handle<SharedFunctionInfo> Compiler::CompileEval(Handle<String> source,
CompilationInfo info(script);
info.MarkAsEval();
if (is_global) info.MarkAsGlobal();
- if (strict_mode == kStrictMode) info.MarkAsStrictMode();
+ info.SetStrictModeFlag(strict_mode);
info.SetCallingContext(context);
result = MakeFunctionInfo(&info);
if (!result.is_null()) {
@@ -597,10 +597,9 @@ bool Compiler::CompileLazy(CompilationInfo* info) {
HistogramTimerScope timer(isolate->counters()->compile_lazy());
// After parsing we know function's strict mode. Remember it.
- if (info->function()->strict_mode()) {
- shared->set_strict_mode(true);
- info->MarkAsStrictMode();
- }
+ StrictModeFlag strict_mode = info->function()->strict_mode_flag();
+ info->SetStrictModeFlag(strict_mode);
+ shared->set_strict_mode_flag(strict_mode);
Yang 2011/10/20 14:18:59 This is not quite equivalent, I guess. The old ver
Steven 2011/10/21 13:59:00 Testing again if the parsed function literal is in
// Compile the code.
if (!MakeCode(info)) {
@@ -680,7 +679,7 @@ Handle<SharedFunctionInfo> Compiler::BuildFunctionInfo(FunctionLiteral* literal,
CompilationInfo info(script);
info.SetFunction(literal);
info.SetScope(literal->scope());
- if (literal->scope()->is_strict_mode()) info.MarkAsStrictMode();
+ info.SetStrictModeFlag(literal->scope()->strict_mode_flag());
LiveEditFunctionTracker live_edit_tracker(info.isolate(), literal);
// Determine if the function can be lazily compiled. This is necessary to
@@ -746,7 +745,7 @@ void Compiler::SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
lit->has_only_simple_this_property_assignments(),
*lit->this_property_assignments());
function_info->set_allows_lazy_compilation(lit->AllowsLazyCompilation());
- function_info->set_strict_mode(lit->strict_mode());
+ function_info->set_strict_mode_flag(lit->strict_mode_flag());
function_info->set_uses_arguments(lit->scope()->arguments() != NULL);
function_info->set_has_duplicate_parameters(lit->has_duplicate_parameters());
}
« no previous file with comments | « src/compiler.h ('k') | src/full-codegen.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698