| OLD | NEW | 
|   1 // Copyright 2014 the V8 project authors. All rights reserved. |   1 // Copyright 2014 the V8 project authors. All rights reserved. | 
|   2 // Use of this source code is governed by a BSD-style license that can be |   2 // Use of this source code is governed by a BSD-style license that can be | 
|   3 // found in the LICENSE file. |   3 // found in the LICENSE file. | 
|   4  |   4  | 
|   5 #ifndef V8_COMPILER_SIMPLIFIED_LOWERING_H_ |   5 #ifndef V8_COMPILER_SIMPLIFIED_LOWERING_H_ | 
|   6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_ |   6 #define V8_COMPILER_SIMPLIFIED_LOWERING_H_ | 
|   7  |   7  | 
 |   8 #include "src/base/flags.h" | 
|   8 #include "src/compiler/js-graph.h" |   9 #include "src/compiler/js-graph.h" | 
|   9 #include "src/compiler/machine-operator.h" |  10 #include "src/compiler/machine-operator.h" | 
|  10 #include "src/compiler/node.h" |  11 #include "src/compiler/node.h" | 
|  11 #include "src/compiler/simplified-operator.h" |  12 #include "src/compiler/simplified-operator.h" | 
|  12  |  13  | 
|  13 namespace v8 { |  14 namespace v8 { | 
|  14 namespace internal { |  15 namespace internal { | 
|  15  |  16  | 
|  16 // Forward declarations. |  17 // Forward declarations. | 
|  17 class TypeCache; |  18 class TypeCache; | 
|  18  |  19  | 
|  19  |  20  | 
|  20 namespace compiler { |  21 namespace compiler { | 
|  21  |  22  | 
|  22 // Forward declarations. |  23 // Forward declarations. | 
|  23 class RepresentationChanger; |  24 class RepresentationChanger; | 
|  24 class RepresentationSelector; |  25 class RepresentationSelector; | 
|  25 class SourcePositionTable; |  26 class SourcePositionTable; | 
|  26  |  27  | 
|  27 class SimplifiedLowering final { |  28 class SimplifiedLowering final { | 
|  28  public: |  29  public: | 
 |  30   enum Flag { kNoFlag = 0u, kTypeFeedbackEnabled = 1u << 0 }; | 
 |  31   typedef base::Flags<Flag> Flags; | 
|  29   SimplifiedLowering(JSGraph* jsgraph, Zone* zone, |  32   SimplifiedLowering(JSGraph* jsgraph, Zone* zone, | 
|  30                      SourcePositionTable* source_positions); |  33                      SourcePositionTable* source_positions, | 
 |  34                      Flags flags = kNoFlag); | 
|  31   ~SimplifiedLowering() {} |  35   ~SimplifiedLowering() {} | 
|  32  |  36  | 
|  33   void LowerAllNodes(); |  37   void LowerAllNodes(); | 
|  34  |  38  | 
|  35   void DoJSToNumberTruncatesToFloat64(Node* node, |  39   void DoJSToNumberTruncatesToFloat64(Node* node, | 
|  36                                       RepresentationSelector* selector); |  40                                       RepresentationSelector* selector); | 
|  37   void DoJSToNumberTruncatesToWord32(Node* node, |  41   void DoJSToNumberTruncatesToWord32(Node* node, | 
|  38                                      RepresentationSelector* selector); |  42                                      RepresentationSelector* selector); | 
|  39   // TODO(turbofan): The representation can be removed once the result of the |  43   // TODO(turbofan): The representation can be removed once the result of the | 
|  40   // representation analysis is stored in the node bounds. |  44   // representation analysis is stored in the node bounds. | 
|  41   void DoLoadBuffer(Node* node, MachineRepresentation rep, |  45   void DoLoadBuffer(Node* node, MachineRepresentation rep, | 
|  42                     RepresentationChanger* changer); |  46                     RepresentationChanger* changer); | 
|  43   void DoStoreBuffer(Node* node); |  47   void DoStoreBuffer(Node* node); | 
|  44   void DoShift(Node* node, Operator const* op, Type* rhs_type); |  48   void DoShift(Node* node, Operator const* op, Type* rhs_type); | 
|  45  |  49  | 
 |  50   Flags flags() const { return flags_; } | 
 |  51  | 
|  46  private: |  52  private: | 
|  47   JSGraph* const jsgraph_; |  53   JSGraph* const jsgraph_; | 
|  48   Zone* const zone_; |  54   Zone* const zone_; | 
|  49   TypeCache const& type_cache_; |  55   TypeCache const& type_cache_; | 
|  50   SetOncePointer<Node> to_number_code_; |  56   SetOncePointer<Node> to_number_code_; | 
|  51   SetOncePointer<Operator const> to_number_operator_; |  57   SetOncePointer<Operator const> to_number_operator_; | 
 |  58   Flags flags_; | 
|  52  |  59  | 
|  53   // TODO(danno): SimplifiedLowering shouldn't know anything about the source |  60   // TODO(danno): SimplifiedLowering shouldn't know anything about the source | 
|  54   // positions table, but must for now since there currently is no other way to |  61   // positions table, but must for now since there currently is no other way to | 
|  55   // pass down source position information to nodes created during |  62   // pass down source position information to nodes created during | 
|  56   // lowering. Once this phase becomes a vanilla reducer, it should get source |  63   // lowering. Once this phase becomes a vanilla reducer, it should get source | 
|  57   // position information via the SourcePositionWrapper like all other reducers. |  64   // position information via the SourcePositionWrapper like all other reducers. | 
|  58   SourcePositionTable* source_positions_; |  65   SourcePositionTable* source_positions_; | 
|  59  |  66  | 
|  60   Node* Float64Ceil(Node* const node); |  67   Node* Float64Ceil(Node* const node); | 
|  61   Node* Float64Floor(Node* const node); |  68   Node* Float64Floor(Node* const node); | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
|  78   CommonOperatorBuilder* common() { return jsgraph()->common(); } |  85   CommonOperatorBuilder* common() { return jsgraph()->common(); } | 
|  79   MachineOperatorBuilder* machine() { return jsgraph()->machine(); } |  86   MachineOperatorBuilder* machine() { return jsgraph()->machine(); } | 
|  80   SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } |  87   SimplifiedOperatorBuilder* simplified() { return jsgraph()->simplified(); } | 
|  81 }; |  88 }; | 
|  82  |  89  | 
|  83 }  // namespace compiler |  90 }  // namespace compiler | 
|  84 }  // namespace internal |  91 }  // namespace internal | 
|  85 }  // namespace v8 |  92 }  // namespace v8 | 
|  86  |  93  | 
|  87 #endif  // V8_COMPILER_SIMPLIFIED_LOWERING_H_ |  94 #endif  // V8_COMPILER_SIMPLIFIED_LOWERING_H_ | 
| OLD | NEW |