Reviewers: Weiliang, Yang,

Message:
weiliang.
PTAL
thanks

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

port r24161.

original commit message:
  Refactor bailout reasons and disable optimization in more cases.

BUG=

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

SVN Base: https://chromium.googlesource.com/external/v8.git@bleeding_edge

Affected files (+4, -37 lines):
  M src/x87/lithium-x87.h
  M src/x87/lithium-x87.cc
  M src/x87/macro-assembler-x87.h


Index: src/x87/lithium-x87.cc
diff --git a/src/x87/lithium-x87.cc b/src/x87/lithium-x87.cc
index 993f5adf27e032d8ed065e29df62da058a13ca8f..f46aef9294ebf0fe1ab5db946ebf8cf8b114560d 100644
--- a/src/x87/lithium-x87.cc
+++ b/src/x87/lithium-x87.cc
@@ -472,12 +472,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));
@@ -2534,7 +2528,7 @@ LInstruction* LChunkBuilder::DoUnknownOSRValue(HUnknownOSRValue* instr) {
   } else {
     spill_index = env_index - instr->environment()->first_local_index();
     if (spill_index > LUnallocated::kMaxFixedSlotIndex) {
-      Abort(kNotEnoughSpillSlotsForOsr);
+      Retry(kNotEnoughSpillSlotsForOsr);
       spill_index = 0;
     }
     if (spill_index == 0) {
Index: src/x87/lithium-x87.h
diff --git a/src/x87/lithium-x87.h b/src/x87/lithium-x87.h
index e5cced2ba36ed138fd7b689228d69f7ae5dae25c..cf0e7b2d92c0ef9f3886e08754ea3274bfb4a4ca 100644
--- a/src/x87/lithium-x87.h
+++ b/src/x87/lithium-x87.h
@@ -2760,17 +2760,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();
@@ -2800,24 +2794,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(X87Register reg);
@@ -2911,10 +2887,6 @@ class LChunkBuilder FINAL : public LChunkBuilderBase {

   LOperand* GetStoreKeyedValueOperand(HStoreKeyed* instr);

-  LPlatformChunk* chunk_;
-  CompilationInfo* info_;
-  HGraph* const graph_;
-  Status status_;
   HInstruction* current_instruction_;
   HBasicBlock* current_block_;
   HBasicBlock* next_block_;
Index: src/x87/macro-assembler-x87.h
diff --git a/src/x87/macro-assembler-x87.h b/src/x87/macro-assembler-x87.h
index a45ebb7f4b0e5c4cec997981f3054c23ecaa9d62..ed0b7c17455191742e9c2d029a5b82e414d83ac0 100644
--- a/src/x87/macro-assembler-x87.h
+++ b/src/x87/macro-assembler-x87.h
@@ -6,6 +6,7 @@
 #define V8_X87_MACRO_ASSEMBLER_X87_H_

 #include "src/assembler.h"
+#include "src/bailout-reason.h"
 #include "src/frames.h"
 #include "src/globals.h"



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