Commit 0389c28d authored by titzer's avatar titzer Committed by Commit bot

Move this_has_uses from ParseInfo back into CompilationInfo and renumber CompilationInfo flags.

R=svenpanne@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1028973002

Cr-Commit-Position: refs/heads/master@{#27369}
parent ec9f0a53
...@@ -62,7 +62,6 @@ PARSE_INFO_GETTER(Handle<Script>, script) ...@@ -62,7 +62,6 @@ PARSE_INFO_GETTER(Handle<Script>, script)
PARSE_INFO_GETTER(bool, is_eval) PARSE_INFO_GETTER(bool, is_eval)
PARSE_INFO_GETTER(bool, is_native) PARSE_INFO_GETTER(bool, is_native)
PARSE_INFO_GETTER(bool, is_module) PARSE_INFO_GETTER(bool, is_module)
PARSE_INFO_GETTER(bool, this_has_uses)
PARSE_INFO_GETTER(LanguageMode, language_mode) PARSE_INFO_GETTER(LanguageMode, language_mode)
PARSE_INFO_GETTER_WITH_DEFAULT(Handle<JSFunction>, closure, PARSE_INFO_GETTER_WITH_DEFAULT(Handle<JSFunction>, closure,
Handle<JSFunction>::null()) Handle<JSFunction>::null())
...@@ -459,8 +458,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { ...@@ -459,8 +458,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() {
: new (info()->zone()) HOptimizedGraphBuilder(info()); : new (info()->zone()) HOptimizedGraphBuilder(info());
Timer t(this, &time_taken_to_create_graph_); Timer t(this, &time_taken_to_create_graph_);
// TODO(titzer): ParseInfo::this_has_uses is only used by Crankshaft. Move. info()->SetThisHasUses(false);
info()->parse_info()->set_this_has_uses(false);
graph_ = graph_builder_->CreateGraph(); graph_ = graph_builder_->CreateGraph();
if (isolate()->has_pending_exception()) { if (isolate()->has_pending_exception()) {
......
...@@ -110,21 +110,22 @@ class CompilationInfo { ...@@ -110,21 +110,22 @@ class CompilationInfo {
// Various configuration flags for a compilation, as well as some properties // Various configuration flags for a compilation, as well as some properties
// of the compiled code produced by a compilation. // of the compiled code produced by a compilation.
enum Flag { enum Flag {
kDeferredCalling = 1 << 7, kDeferredCalling = 1 << 0,
kNonDeferredCalling = 1 << 8, kNonDeferredCalling = 1 << 1,
kSavesCallerDoubles = 1 << 9, kSavesCallerDoubles = 1 << 2,
kRequiresFrame = 1 << 10, kRequiresFrame = 1 << 3,
kMustNotHaveEagerFrame = 1 << 11, kThisHasUses = 1 << 4,
kDeoptimizationSupport = 1 << 12, kMustNotHaveEagerFrame = 1 << 5,
kDebug = 1 << 13, kDeoptimizationSupport = 1 << 6,
kCompilingForDebugging = 1 << 14, kDebug = 1 << 7,
kSerializing = 1 << 16, kCompilingForDebugging = 1 << 8,
kContextSpecializing = 1 << 17, kSerializing = 1 << 9,
kInliningEnabled = 1 << 18, kContextSpecializing = 1 << 10,
kTypingEnabled = 1 << 19, kInliningEnabled = 1 << 11,
kDisableFutureOptimization = 1 << 20, kTypingEnabled = 1 << 12,
kSplittingEnabled = 1 << 23, kDisableFutureOptimization = 1 << 13,
kBuiltinInliningEnabled = 1 << 24 kSplittingEnabled = 1 << 14,
kBuiltinInliningEnabled = 1 << 15
}; };
explicit CompilationInfo(ParseInfo* parse_info); explicit CompilationInfo(ParseInfo* parse_info);
...@@ -140,7 +141,6 @@ class CompilationInfo { ...@@ -140,7 +141,6 @@ class CompilationInfo {
bool is_eval() const; bool is_eval() const;
bool is_native() const; bool is_native() const;
bool is_module() const; bool is_module() const;
bool this_has_uses() const;
LanguageMode language_mode() const; LanguageMode language_mode() const;
Handle<JSFunction> closure() const; Handle<JSFunction> closure() const;
FunctionLiteral* function() const; FunctionLiteral* function() const;
...@@ -192,6 +192,10 @@ class CompilationInfo { ...@@ -192,6 +192,10 @@ class CompilationInfo {
bool requires_frame() const { return GetFlag(kRequiresFrame); } bool requires_frame() const { return GetFlag(kRequiresFrame); }
void SetThisHasUses(bool val) { SetFlag(kThisHasUses, val); }
bool this_has_uses() const { return GetFlag(kThisHasUses); }
void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); } void MarkMustNotHaveEagerFrame() { SetFlag(kMustNotHaveEagerFrame); }
bool GetMustNotHaveEagerFrame() const { bool GetMustNotHaveEagerFrame() const {
......
...@@ -5291,7 +5291,7 @@ HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) { ...@@ -5291,7 +5291,7 @@ HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) {
void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) { void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
if (expr->is_this()) { if (expr->is_this()) {
current_info()->parse_info()->set_this_has_uses(true); current_info()->SetThisHasUses(true);
} }
DCHECK(!HasStackOverflow()); DCHECK(!HasStackOverflow());
......
...@@ -64,7 +64,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared) ...@@ -64,7 +64,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
isolate_ = shared->GetIsolate(); isolate_ = shared->GetIsolate();
set_lazy(); set_lazy();
set_this_has_uses();
set_hash_seed(isolate_->heap()->HashSeed()); set_hash_seed(isolate_->heap()->HashSeed());
set_stack_limit(isolate_->stack_guard()->real_climit()); set_stack_limit(isolate_->stack_guard()->real_climit());
set_unicode_cache(isolate_->unicode_cache()); set_unicode_cache(isolate_->unicode_cache());
...@@ -82,7 +81,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared) ...@@ -82,7 +81,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) { ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
isolate_ = script->GetIsolate(); isolate_ = script->GetIsolate();
set_this_has_uses();
set_hash_seed(isolate_->heap()->HashSeed()); set_hash_seed(isolate_->heap()->HashSeed());
set_stack_limit(isolate_->stack_guard()->real_climit()); set_stack_limit(isolate_->stack_guard()->real_climit());
set_unicode_cache(isolate_->unicode_cache()); set_unicode_cache(isolate_->unicode_cache());
......
...@@ -56,7 +56,6 @@ class ParseInfo { ...@@ -56,7 +56,6 @@ class ParseInfo {
FLAG_ACCESSOR(kNative, is_native, set_native) FLAG_ACCESSOR(kNative, is_native, set_native)
FLAG_ACCESSOR(kModule, is_module, set_module) FLAG_ACCESSOR(kModule, is_module, set_module)
FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing) FLAG_ACCESSOR(kAllowLazyParsing, allow_lazy_parsing, set_allow_lazy_parsing)
FLAG_ACCESSOR(kThisHasUses, this_has_uses, set_this_has_uses)
FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned, FLAG_ACCESSOR(kAstValueFactoryOwned, ast_value_factory_owned,
set_ast_value_factory_owned) set_ast_value_factory_owned)
...@@ -170,8 +169,7 @@ class ParseInfo { ...@@ -170,8 +169,7 @@ class ParseInfo {
kModule = 1 << 8, kModule = 1 << 8,
kAllowLazyParsing = 1 << 9, kAllowLazyParsing = 1 << 9,
// ---------- Output flags -------------------------- // ---------- Output flags --------------------------
kThisHasUses = 1 << 10, kAstValueFactoryOwned = 1 << 10
kAstValueFactoryOwned = 1 << 11
}; };
//------------- Inputs to parsing and scope analysis ----------------------- //------------- Inputs to parsing and scope analysis -----------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment