Reviewers: Sven Panne,

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

[email protected]
BUG=

Please review this at https://codereview.chromium.org/1028973002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+23, -25 lines):
  M src/compiler.h
  M src/compiler.cc
  M src/hydrogen.cc
  M src/parser.h
  M src/parser.cc


Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 96edf2d3b92478545674cb920dc2e4dde18ee9da..4f0ddd997694faef7b3cf689a1c577f3daa88bed 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -62,7 +62,6 @@ 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(bool, this_has_uses)
 PARSE_INFO_GETTER(LanguageMode, language_mode)
 PARSE_INFO_GETTER_WITH_DEFAULT(Handle<JSFunction>, closure,
                                Handle<JSFunction>::null())
@@ -459,8 +458,7 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { : new (info()->zone()) HOptimizedGraphBuilder(info());

   Timer t(this, &time_taken_to_create_graph_);
- // TODO(titzer): ParseInfo::this_has_uses is only used by Crankshaft. Move.
-  info()->parse_info()->set_this_has_uses(false);
+  info()->SetThisHasUses(false);
   graph_ = graph_builder_->CreateGraph();

   if (isolate()->has_pending_exception()) {
Index: src/compiler.h
diff --git a/src/compiler.h b/src/compiler.h
index e58562664732af04b5fb4fa589440ec30b5482bc..4ff7d96f6cae40c61b915a13c362a81d596574c9 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -110,21 +110,22 @@ class CompilationInfo {
// Various configuration flags for a compilation, as well as some properties
   // of the compiled code produced by a compilation.
   enum Flag {
-    kDeferredCalling = 1 << 7,
-    kNonDeferredCalling = 1 << 8,
-    kSavesCallerDoubles = 1 << 9,
-    kRequiresFrame = 1 << 10,
-    kMustNotHaveEagerFrame = 1 << 11,
-    kDeoptimizationSupport = 1 << 12,
-    kDebug = 1 << 13,
-    kCompilingForDebugging = 1 << 14,
-    kSerializing = 1 << 16,
-    kContextSpecializing = 1 << 17,
-    kInliningEnabled = 1 << 18,
-    kTypingEnabled = 1 << 19,
-    kDisableFutureOptimization = 1 << 20,
-    kSplittingEnabled = 1 << 23,
-    kBuiltinInliningEnabled = 1 << 24
+    kDeferredCalling = 1 << 0,
+    kNonDeferredCalling = 1 << 1,
+    kSavesCallerDoubles = 1 << 2,
+    kRequiresFrame = 1 << 3,
+    kThisHasUses = 1 << 4,
+    kMustNotHaveEagerFrame = 1 << 5,
+    kDeoptimizationSupport = 1 << 6,
+    kDebug = 1 << 7,
+    kCompilingForDebugging = 1 << 8,
+    kSerializing = 1 << 9,
+    kContextSpecializing = 1 << 10,
+    kInliningEnabled = 1 << 11,
+    kTypingEnabled = 1 << 12,
+    kDisableFutureOptimization = 1 << 13,
+    kSplittingEnabled = 1 << 14,
+    kBuiltinInliningEnabled = 1 << 15
   };

   explicit CompilationInfo(ParseInfo* parse_info);
@@ -140,7 +141,6 @@ class CompilationInfo {
   bool is_eval() const;
   bool is_native() const;
   bool is_module() const;
-  bool this_has_uses() const;
   LanguageMode language_mode() const;
   Handle<JSFunction> closure() const;
   FunctionLiteral* function() const;
@@ -192,6 +192,10 @@ class CompilationInfo {

   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); }

   bool GetMustNotHaveEagerFrame() const {
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 6f349b79c4a1eac2e3b9ec332f49d63bd93071e7..5d9d81e01f03de53dd6849c7358f3e7e6b29e570 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -5291,7 +5291,7 @@ HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) {

 void HOptimizedGraphBuilder::VisitVariableProxy(VariableProxy* expr) {
   if (expr->is_this()) {
-    current_info()->parse_info()->set_this_has_uses(true);
+    current_info()->SetThisHasUses(true);
   }

   DCHECK(!HasStackOverflow());
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index f24f7107d8fd444235349dcc2601166dcc8ebbdc..03ce38081418f76c14aaedcc9f69f21b99e6c9ac 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -64,7 +64,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
   isolate_ = shared->GetIsolate();

   set_lazy();
-  set_this_has_uses();
   set_hash_seed(isolate_->heap()->HashSeed());
   set_stack_limit(isolate_->stack_guard()->real_climit());
   set_unicode_cache(isolate_->unicode_cache());
@@ -82,7 +81,6 @@ ParseInfo::ParseInfo(Zone* zone, Handle<SharedFunctionInfo> shared)
 ParseInfo::ParseInfo(Zone* zone, Handle<Script> script) : ParseInfo(zone) {
   isolate_ = script->GetIsolate();

-  set_this_has_uses();
   set_hash_seed(isolate_->heap()->HashSeed());
   set_stack_limit(isolate_->stack_guard()->real_climit());
   set_unicode_cache(isolate_->unicode_cache());
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index e085b26f86c054f81aec593954191d4ba8abc473..d93faaf0e1d8cfc8434b35f891eec1aeed16f2b6 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -56,7 +56,6 @@ class ParseInfo {
   FLAG_ACCESSOR(kNative, is_native, set_native)
   FLAG_ACCESSOR(kModule, is_module, set_module)
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,
                 set_ast_value_factory_owned)

@@ -170,8 +169,7 @@ class ParseInfo {
     kModule = 1 << 8,
     kAllowLazyParsing = 1 << 9,
     // ---------- Output flags --------------------------
-    kThisHasUses = 1 << 10,
-    kAstValueFactoryOwned = 1 << 11
+    kAstValueFactoryOwned = 1 << 10
   };

//------------- Inputs to parsing and scope analysis -----------------------


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to