Reviewers: danno, Yang, paul.l..., gergely.kis.imgtec, akos.palfi.imgtec, dusmil.imgtec,

Description:
MIPS: Refactor bailout reasons and disable optimization in more cases.

Port r24161 (008f335)

BUG=

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+6, -74 lines):
  M src/mips/lithium-mips.h
  M src/mips/lithium-mips.cc
  M src/mips64/lithium-mips64.h
  M src/mips64/lithium-mips64.cc


Index: src/mips/lithium-mips.cc
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc
index 904ffa56dddcf390f0a1dbf9cf0382c242e8d055..1757d929f758c1f19abbacfc289b9c1ff34613ff 100644
--- a/src/mips/lithium-mips.cc
+++ b/src/mips/lithium-mips.cc
@@ -430,12 +430,6 @@ LPlatformChunk* LChunkBuilder::Build() {
 }


-void LChunkBuilder::Abort(BailoutReason reason) {
-  info()->set_bailout_reason(reason);
-  status_ = ABORTED;
-}
-
-
 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
   return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER,
                                   Register::ToAllocationIndex(reg));
@@ -2425,7 +2419,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   } else {
     spill_index = env_index - instr->environment()->first_local_index();
     if (spill_index > LUnallocated::kMaxFixedSlotIndex) {
-      Abort(kTooManySpillSlotsNeededForOSR);
+      Retry(kTooManySpillSlotsNeededForOSR);
       spill_index = 0;
     }
   }
Index: src/mips/lithium-mips.h
diff --git a/src/mips/lithium-mips.h b/src/mips/lithium-mips.h
index 3f18a17927053ddb65466a15ff9a02659782ba6f..36e5b57c74fa4c500fb06f07226fb6eeaa112f9c 100644
--- a/src/mips/lithium-mips.h
+++ b/src/mips/lithium-mips.h
@@ -2718,17 +2718,11 @@ class LPlatformChunk FINAL : public LChunk {
 class LChunkBuilder FINAL : public LChunkBuilderBase {
  public:
LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
-      : LChunkBuilderBase(graph->zone()),
-        chunk_(NULL),
-        info_(info),
-        graph_(graph),
-        status_(UNUSED),
+      : LChunkBuilderBase(info, graph),
         current_instruction_(NULL),
         current_block_(NULL),
         next_block_(NULL),
-        allocator_(allocator) { }
-
-  Isolate* isolate() const { return graph_->isolate(); }
+        allocator_(allocator) {}

   // Build the sequence for the graph.
   LPlatformChunk* Build();
@@ -2762,24 +2756,6 @@ class LChunkBuilder FINAL : public LChunkBuilderBase {
   LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);

  private:
-  enum Status {
-    UNUSED,
-    BUILDING,
-    DONE,
-    ABORTED
-  };
-
-  LPlatformChunk* chunk() const { return chunk_; }
-  CompilationInfo* info() const { return info_; }
-  HGraph* graph() const { return graph_; }
-
-  bool is_unused() const { return status_ == UNUSED; }
-  bool is_building() const { return status_ == BUILDING; }
-  bool is_done() const { return status_ == DONE; }
-  bool is_aborted() const { return status_ == ABORTED; }
-
-  void Abort(BailoutReason reason);
-
   // Methods for getting operands for Use / Define / Temp.
   LUnallocated* ToUnallocated(Register reg);
   LUnallocated* ToUnallocated(DoubleRegister reg);
@@ -2865,10 +2841,6 @@ class LChunkBuilder FINAL : public LChunkBuilderBase {
   LInstruction* DoArithmeticT(Token::Value op,
                               HBinaryOperation* instr);

-  LPlatformChunk* chunk_;
-  CompilationInfo* info_;
-  HGraph* const graph_;
-  Status status_;
   HInstruction* current_instruction_;
   HBasicBlock* current_block_;
   HBasicBlock* next_block_;
Index: src/mips64/lithium-mips64.cc
diff --git a/src/mips64/lithium-mips64.cc b/src/mips64/lithium-mips64.cc
index 214748cf862558908b1cda13b458a3962f6ab3b7..48926117bbe65a9be7e10bd13c164b8b508e254f 100644
--- a/src/mips64/lithium-mips64.cc
+++ b/src/mips64/lithium-mips64.cc
@@ -430,12 +430,6 @@ LPlatformChunk* LChunkBuilder::Build() {
 }


-void LChunkBuilder::Abort(BailoutReason reason) {
-  info()->set_bailout_reason(reason);
-  status_ = ABORTED;
-}
-
-
 LUnallocated* LChunkBuilder::ToUnallocated(Register reg) {
   return new(zone()) LUnallocated(LUnallocated::FIXED_REGISTER,
                                   Register::ToAllocationIndex(reg));
@@ -2425,7 +2419,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   } else {
     spill_index = env_index - instr->environment()->first_local_index();
     if (spill_index > LUnallocated::kMaxFixedSlotIndex) {
-      Abort(kTooManySpillSlotsNeededForOSR);
+      Retry(kTooManySpillSlotsNeededForOSR);
       spill_index = 0;
     }
   }
Index: src/mips64/lithium-mips64.h
diff --git a/src/mips64/lithium-mips64.h b/src/mips64/lithium-mips64.h
index 464cfa95ad7aaa1ece79c786e538231f5fc49186..c6257a4cdcfde5b7d2e492cc77d22224f90abece 100644
--- a/src/mips64/lithium-mips64.h
+++ b/src/mips64/lithium-mips64.h
@@ -2702,17 +2702,11 @@ class LPlatformChunk FINAL : public LChunk {
 class LChunkBuilder FINAL : public LChunkBuilderBase {
  public:
LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
-      : LChunkBuilderBase(graph->zone()),
-        chunk_(NULL),
-        info_(info),
-        graph_(graph),
-        status_(UNUSED),
+      : LChunkBuilderBase(info, graph),
         current_instruction_(NULL),
         current_block_(NULL),
         next_block_(NULL),
-        allocator_(allocator) { }
-
-  Isolate* isolate() const { return graph_->isolate(); }
+        allocator_(allocator) {}

   // Build the sequence for the graph.
   LPlatformChunk* Build();
@@ -2746,24 +2740,6 @@ class LChunkBuilder FINAL : public LChunkBuilderBase {
   LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr);

  private:
-  enum Status {
-    UNUSED,
-    BUILDING,
-    DONE,
-    ABORTED
-  };
-
-  LPlatformChunk* chunk() const { return chunk_; }
-  CompilationInfo* info() const { return info_; }
-  HGraph* graph() const { return graph_; }
-
-  bool is_unused() const { return status_ == UNUSED; }
-  bool is_building() const { return status_ == BUILDING; }
-  bool is_done() const { return status_ == DONE; }
-  bool is_aborted() const { return status_ == ABORTED; }
-
-  void Abort(BailoutReason reason);
-
   // Methods for getting operands for Use / Define / Temp.
   LUnallocated* ToUnallocated(Register reg);
   LUnallocated* ToUnallocated(DoubleRegister reg);
@@ -2849,10 +2825,6 @@ class LChunkBuilder FINAL : public LChunkBuilderBase {
   LInstruction* DoArithmeticT(Token::Value op,
                               HBinaryOperation* instr);

-  LPlatformChunk* chunk_;
-  CompilationInfo* info_;
-  HGraph* const graph_;
-  Status status_;
   HInstruction* current_instruction_;
   HBasicBlock* current_block_;
   HBasicBlock* next_block_;


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