| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_CODE_ASSEMBLER_H_ | 5 #ifndef V8_COMPILER_CODE_ASSEMBLER_H_ |
| 6 #define V8_COMPILER_CODE_ASSEMBLER_H_ | 6 #define V8_COMPILER_CODE_ASSEMBLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 // Clients of this interface shouldn't depend on lots of compiler internals. | 10 // Clients of this interface shouldn't depend on lots of compiler internals. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 bool Is64() const; | 160 bool Is64() const; |
| 161 bool IsFloat64RoundUpSupported() const; | 161 bool IsFloat64RoundUpSupported() const; |
| 162 bool IsFloat64RoundDownSupported() const; | 162 bool IsFloat64RoundDownSupported() const; |
| 163 bool IsFloat64RoundTruncateSupported() const; | 163 bool IsFloat64RoundTruncateSupported() const; |
| 164 | 164 |
| 165 class Label; | 165 class Label; |
| 166 class Variable { | 166 class Variable { |
| 167 public: | 167 public: |
| 168 explicit Variable(CodeAssembler* assembler, MachineRepresentation rep); | 168 explicit Variable(CodeAssembler* assembler, MachineRepresentation rep); |
| 169 ~Variable(); |
| 169 void Bind(Node* value); | 170 void Bind(Node* value); |
| 170 Node* value() const; | 171 Node* value() const; |
| 171 MachineRepresentation rep() const; | 172 MachineRepresentation rep() const; |
| 172 bool IsBound() const; | 173 bool IsBound() const; |
| 173 | 174 |
| 174 private: | 175 private: |
| 175 friend class CodeAssembler; | 176 friend class CodeAssembler; |
| 176 class Impl; | 177 class Impl; |
| 177 Impl* impl_; | 178 Impl* impl_; |
| 179 CodeAssembler* assembler_; |
| 178 }; | 180 }; |
| 179 | 181 |
| 180 enum AllocationFlag : uint8_t { | 182 enum AllocationFlag : uint8_t { |
| 181 kNone = 0, | 183 kNone = 0, |
| 182 kDoubleAlignment = 1, | 184 kDoubleAlignment = 1, |
| 183 kPretenured = 1 << 1 | 185 kPretenured = 1 << 1 |
| 184 }; | 186 }; |
| 185 | 187 |
| 186 typedef base::Flags<AllocationFlag> AllocationFlags; | 188 typedef base::Flags<AllocationFlag> AllocationFlags; |
| 187 | 189 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 CodeAssembler(Isolate* isolate, Zone* zone, CallDescriptor* call_descriptor, | 357 CodeAssembler(Isolate* isolate, Zone* zone, CallDescriptor* call_descriptor, |
| 356 Code::Flags flags, const char* name); | 358 Code::Flags flags, const char* name); |
| 357 | 359 |
| 358 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 360 Node* CallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
| 359 Node* TailCallN(CallDescriptor* descriptor, Node* code_target, Node** args); | 361 Node* TailCallN(CallDescriptor* descriptor, Node* code_target, Node** args); |
| 360 | 362 |
| 361 base::SmartPointer<RawMachineAssembler> raw_assembler_; | 363 base::SmartPointer<RawMachineAssembler> raw_assembler_; |
| 362 Code::Flags flags_; | 364 Code::Flags flags_; |
| 363 const char* name_; | 365 const char* name_; |
| 364 bool code_generated_; | 366 bool code_generated_; |
| 365 ZoneVector<Variable::Impl*> variables_; | 367 ZoneSet<Variable::Impl*> variables_; |
| 366 | 368 |
| 367 DISALLOW_COPY_AND_ASSIGN(CodeAssembler); | 369 DISALLOW_COPY_AND_ASSIGN(CodeAssembler); |
| 368 }; | 370 }; |
| 369 | 371 |
| 370 DEFINE_OPERATORS_FOR_FLAGS(CodeAssembler::AllocationFlags); | 372 DEFINE_OPERATORS_FOR_FLAGS(CodeAssembler::AllocationFlags); |
| 371 | 373 |
| 372 class CodeAssembler::Label { | 374 class CodeAssembler::Label { |
| 373 public: | 375 public: |
| 374 enum Type { kDeferred, kNonDeferred }; | 376 enum Type { kDeferred, kNonDeferred }; |
| 375 | 377 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 401 // Map of variables to the list of value nodes that have been added from each | 403 // Map of variables to the list of value nodes that have been added from each |
| 402 // merge path in their order of merging. | 404 // merge path in their order of merging. |
| 403 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; | 405 std::map<Variable::Impl*, std::vector<Node*>> variable_merges_; |
| 404 }; | 406 }; |
| 405 | 407 |
| 406 } // namespace compiler | 408 } // namespace compiler |
| 407 } // namespace internal | 409 } // namespace internal |
| 408 } // namespace v8 | 410 } // namespace v8 |
| 409 | 411 |
| 410 #endif // V8_COMPILER_CODE_ASSEMBLER_H_ | 412 #endif // V8_COMPILER_CODE_ASSEMBLER_H_ |
| OLD | NEW |