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

Unified Diff: src/compiler.cc

Issue 1952623002: [compiler] Remove is_native and is_eval accessors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/compiler/ast-graph-builder.cc » ('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 de539bc146bce27cf1fab641d6736611eccb37f9..052e7430d282a1e2af1ef83ea2b74ce97a18672a 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -50,9 +50,6 @@ namespace internal {
PARSE_INFO_GETTER(Handle<Script>, script)
-PARSE_INFO_GETTER(bool, is_eval)
-PARSE_INFO_GETTER(bool, is_native)
-PARSE_INFO_GETTER(bool, is_module)
PARSE_INFO_GETTER(FunctionLiteral*, literal)
PARSE_INFO_GETTER_WITH_DEFAULT(Scope*, scope, nullptr)
PARSE_INFO_GETTER_WITH_DEFAULT(Handle<Context>, context,
@@ -268,8 +265,15 @@ StackFrame::Type CompilationInfo::GetOutputStackFrameType() const {
}
}
+int CompilationInfo::GetDeclareGlobalsFlags() const {
+ DCHECK(DeclareGlobalsLanguageMode::is_valid(parse_info()->language_mode()));
+ return DeclareGlobalsEvalFlag::encode(parse_info()->is_eval()) |
+ DeclareGlobalsNativeFlag::encode(parse_info()->is_native()) |
+ DeclareGlobalsLanguageMode::encode(parse_info()->language_mode());
+}
+
bool CompilationInfo::ExpectsJSReceiverAsReceiver() {
- return is_sloppy(parse_info()->language_mode()) && !is_native();
+ return is_sloppy(parse_info()->language_mode()) && !parse_info()->is_native();
}
#if DEBUG
@@ -1086,17 +1090,17 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
// Measure how long it takes to do the compilation; only take the
// rest of the function into account to avoid overlap with the
// parsing statistics.
- HistogramTimer* rate = info->is_eval()
- ? info->isolate()->counters()->compile_eval()
- : info->isolate()->counters()->compile();
+ HistogramTimer* rate = parse_info->is_eval()
+ ? info->isolate()->counters()->compile_eval()
+ : info->isolate()->counters()->compile();
HistogramTimerScope timer(rate);
- TRACE_EVENT0("v8", info->is_eval() ? "V8.CompileEval" : "V8.Compile");
+ TRACE_EVENT0("v8", parse_info->is_eval() ? "V8.CompileEval" : "V8.Compile");
// Allocate a shared function info object.
DCHECK_EQ(RelocInfo::kNoPosition, lit->function_token_position());
result = NewSharedFunctionInfoForLiteral(isolate, lit, script);
result->set_is_toplevel(true);
- if (info->is_eval()) {
+ if (parse_info->is_eval()) {
// Eval scripts cannot be (re-)compiled without context.
result->set_allows_lazy_compilation_without_context(false);
}
@@ -1117,9 +1121,10 @@ Handle<SharedFunctionInfo> CompileToplevel(CompilationInfo* info) {
script->name()->IsString()
? Handle<String>(String::cast(script->name()))
: isolate->factory()->empty_string();
- Logger::LogEventsAndTags log_tag = info->is_eval()
- ? Logger::EVAL_TAG
- : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script);
+ Logger::LogEventsAndTags log_tag =
+ parse_info->is_eval()
+ ? Logger::EVAL_TAG
+ : Logger::ToNativeByScript(Logger::SCRIPT_TAG, *script);
PROFILE(isolate, CodeCreateEvent(log_tag, result->abstract_code(), *result,
*script_name));
« no previous file with comments | « src/compiler.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698