Reviewers: titzer,

Description:
Move CompilationInfo::this_has_uses to HGraph::this_has_uses.

[email protected]

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

Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-compiler-12

Affected files (+26, -32 lines):
  M src/arm/lithium-codegen-arm.cc
  M src/arm64/lithium-codegen-arm64.cc
  M src/compiler.h
  M src/compiler.cc
  M src/hydrogen.h
  M src/hydrogen.cc
  M src/ia32/lithium-codegen-ia32.cc
  M src/mips/lithium-codegen-mips.cc
  M src/mips64/lithium-codegen-mips64.cc
  M src/ppc/lithium-codegen-ppc.cc
  M src/x64/lithium-codegen-x64.cc
  M src/x87/lithium-codegen-x87.cc


Index: src/arm/lithium-codegen-arm.cc
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc
index f2d50575731e08fc7a576963cbda5a03c272fb45..202631837d98ae32c860065e37c6db6d793c2219 100644
--- a/src/arm/lithium-codegen-arm.cc
+++ b/src/arm/lithium-codegen-arm.cc
@@ -120,7 +120,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
Index: src/arm64/lithium-codegen-arm64.cc
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc index 3f7644962907b33b4a1f341b146e9cad3398e932..47aeed9ff5cbe8b1e2ad685d0537fd010ec89c97 100644
--- a/src/arm64/lithium-codegen-arm64.cc
+++ b/src/arm64/lithium-codegen-arm64.cc
@@ -663,7 +663,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
       int receiver_offset = info_->scope()->num_parameters() * kXRegSize;
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 9d27783964eb54f87c33ffcde98745ba8c04457a..3f7eb40f19d864974e62be9cf559c2e0c8df3de8 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -475,7 +475,6 @@ OptimizedCompileJob::Status OptimizedCompileJob::CreateGraph() { : new (info()->zone()) HOptimizedGraphBuilder(info());

   Timer t(this, &time_taken_to_create_graph_);
-  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 18c1327c8eefd5f388a33983cb194f041fd62f93..3660dc987431f0ef048c1be29cff770edfc195d4 100644
--- a/src/compiler.h
+++ b/src/compiler.h
@@ -114,18 +114,17 @@ class CompilationInfo {
     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
+    kMustNotHaveEagerFrame = 1 << 4,
+    kDeoptimizationSupport = 1 << 5,
+    kDebug = 1 << 6,
+    kCompilingForDebugging = 1 << 7,
+    kSerializing = 1 << 8,
+    kContextSpecializing = 1 << 9,
+    kInliningEnabled = 1 << 10,
+    kTypingEnabled = 1 << 11,
+    kDisableFutureOptimization = 1 << 12,
+    kSplittingEnabled = 1 << 13,
+    kBuiltinInliningEnabled = 1 << 14
   };

   explicit CompilationInfo(ParseInfo* parse_info);
@@ -192,10 +191,6 @@ 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 5d9d81e01f03de53dd6849c7358f3e7e6b29e570..d9e22c15aca9e9e7c239bd8d205fb2f921a60a7d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3438,6 +3438,7 @@ HGraph::HGraph(CompilationInfo* info)
       info_(info),
       zone_(info->zone()),
       is_recursive_(false),
+      this_has_uses_(false),
       use_optimistic_licm_(false),
       depends_on_empty_array_proto_elements_(false),
       type_change_checksum_(0),
@@ -5291,7 +5292,7 @@ HValue* HOptimizedGraphBuilder::BuildContextChainWalk(Variable* var) {

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

   DCHECK(!HasStackOverflow());
Index: src/hydrogen.h
diff --git a/src/hydrogen.h b/src/hydrogen.h
index b253d600c30ed416fd238aca08725d35156ad2e1..f1a6aa1509f04078860bb38ee37e7d3f6da17304 100644
--- a/src/hydrogen.h
+++ b/src/hydrogen.h
@@ -407,13 +407,11 @@ class HGraph FINAL : public ZoneObject {
     use_optimistic_licm_ = value;
   }

-  void MarkRecursive() {
-    is_recursive_ = true;
-  }
+  void MarkRecursive() { is_recursive_ = true; }
+  bool is_recursive() const { return is_recursive_; }

-  bool is_recursive() const {
-    return is_recursive_;
-  }
+  void MarkThisHasUses() { this_has_uses_ = true; }
+  bool this_has_uses() const { return this_has_uses_; }

   void MarkDependsOnEmptyArrayProtoElements() {
     // Add map dependency if not already added.
@@ -499,6 +497,7 @@ class HGraph FINAL : public ZoneObject {
   Zone* zone_;

   bool is_recursive_;
+  bool this_has_uses_;
   bool use_optimistic_licm_;
   bool depends_on_empty_array_proto_elements_;
   int type_change_checksum_;
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc index 8dde18d2535aef1413fa3f26349d2fa69f264fbc..f0cd7b0008aedcc985eaf1a8bb224a3374f8cc9b 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -141,7 +141,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
       // +1 for return address.
Index: src/mips/lithium-codegen-mips.cc
diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc index 5feb681c18f72f61568330050a015324498e6124..d7b35118881cadf57ac526338cec70d0b3387fd0 100644
--- a/src/mips/lithium-codegen-mips.cc
+++ b/src/mips/lithium-codegen-mips.cc
@@ -143,7 +143,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
Index: src/mips64/lithium-codegen-mips64.cc
diff --git a/src/mips64/lithium-codegen-mips64.cc b/src/mips64/lithium-codegen-mips64.cc index 94eab87ea100b21fca8d733003b2625c6fb81fa5..3b19379e807d29716076595b99d0c1e676236cc5 100644
--- a/src/mips64/lithium-codegen-mips64.cc
+++ b/src/mips64/lithium-codegen-mips64.cc
@@ -118,7 +118,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
Index: src/ppc/lithium-codegen-ppc.cc
diff --git a/src/ppc/lithium-codegen-ppc.cc b/src/ppc/lithium-codegen-ppc.cc
index 9af13ae23525989c6194b0905028e8aa135d6656..81a3ffb2849c87c084f85c7f2fd61fe52a7c24c7 100644
--- a/src/ppc/lithium-codegen-ppc.cc
+++ b/src/ppc/lithium-codegen-ppc.cc
@@ -118,7 +118,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index d1683e6ae7ab9685d64c9801a78891f2f56a2cb1..bfbadebf2df823508b0e92d21a28b91111cab721 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -129,7 +129,7 @@ bool LCodeGen::GeneratePrologue() {

// Sloppy mode functions need to replace the receiver with the global proxy
     // when called as functions (without an explicit receiver object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
       StackArgumentsAccessor args(rsp, scope()->num_parameters());
Index: src/x87/lithium-codegen-x87.cc
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc
index 4467d2e6ce0591a384036ff35ead45731ea88bb4..5a44e6e734e4c688678e6c76e77a06b0b13f0283 100644
--- a/src/x87/lithium-codegen-x87.cc
+++ b/src/x87/lithium-codegen-x87.cc
@@ -110,7 +110,7 @@ bool LCodeGen::GeneratePrologue() {
// Sloppy mode functions and builtins need to replace the receiver with the
     // global proxy when called as functions (without an explicit receiver
     // object).
-    if (info_->this_has_uses() && is_sloppy(info_->language_mode()) &&
+    if (graph()->this_has_uses() && is_sloppy(info_->language_mode()) &&
         !info_->is_native()) {
       Label ok;
       // +1 for return address.


--
--
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