| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 return H##type::cast(hydrogen_value()); \ | 205 return H##type::cast(hydrogen_value()); \ |
| 206 } | 206 } |
| 207 | 207 |
| 208 | 208 |
| 209 class LInstruction : public ZoneObject { | 209 class LInstruction : public ZoneObject { |
| 210 public: | 210 public: |
| 211 LInstruction() | 211 LInstruction() |
| 212 : environment_(NULL), | 212 : environment_(NULL), |
| 213 hydrogen_value_(NULL), | 213 hydrogen_value_(NULL), |
| 214 bit_field_(IsCallBits::encode(false)) { | 214 bit_field_(IsCallBits::encode(false)) { |
| 215 set_position(RelocInfo::kNoPosition); | |
| 216 } | 215 } |
| 217 | 216 |
| 218 virtual ~LInstruction() {} | 217 virtual ~LInstruction() {} |
| 219 | 218 |
| 220 virtual void CompileToNative(LCodeGen* generator) = 0; | 219 virtual void CompileToNative(LCodeGen* generator) = 0; |
| 221 virtual const char* Mnemonic() const = 0; | 220 virtual const char* Mnemonic() const = 0; |
| 222 virtual void PrintTo(StringStream* stream); | 221 virtual void PrintTo(StringStream* stream); |
| 223 virtual void PrintDataTo(StringStream* stream); | 222 virtual void PrintDataTo(StringStream* stream); |
| 224 virtual void PrintOutputOperandTo(StringStream* stream); | 223 virtual void PrintOutputOperandTo(StringStream* stream); |
| 225 | 224 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 246 virtual bool IsControl() const { return false; } | 245 virtual bool IsControl() const { return false; } |
| 247 | 246 |
| 248 void set_environment(LEnvironment* env) { environment_ = env; } | 247 void set_environment(LEnvironment* env) { environment_ = env; } |
| 249 LEnvironment* environment() const { return environment_; } | 248 LEnvironment* environment() const { return environment_; } |
| 250 bool HasEnvironment() const { return environment_ != NULL; } | 249 bool HasEnvironment() const { return environment_ != NULL; } |
| 251 | 250 |
| 252 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 251 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
| 253 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 252 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
| 254 bool HasPointerMap() const { return pointer_map_.is_set(); } | 253 bool HasPointerMap() const { return pointer_map_.is_set(); } |
| 255 | 254 |
| 256 // The 31 bits PositionBits is used to store the int position value. And the | |
| 257 // position value may be RelocInfo::kNoPosition (-1). The accessor always | |
| 258 // +1/-1 so that the encoded value of position in bit_field_ is always >= 0 | |
| 259 // and can fit into the 31 bits PositionBits. | |
| 260 void set_position(int pos) { | |
| 261 bit_field_ = PositionBits::update(bit_field_, pos + 1); | |
| 262 } | |
| 263 int position() { return PositionBits::decode(bit_field_) - 1; } | |
| 264 | |
| 265 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 255 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
| 266 HValue* hydrogen_value() const { return hydrogen_value_; } | 256 HValue* hydrogen_value() const { return hydrogen_value_; } |
| 267 | 257 |
| 268 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 258 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
| 269 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 259 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
| 270 | 260 |
| 271 // Interface to the register allocator and iterators. | 261 // Interface to the register allocator and iterators. |
| 272 bool ClobbersTemps() const { return IsCall(); } | 262 bool ClobbersTemps() const { return IsCall(); } |
| 273 bool ClobbersRegisters() const { return IsCall(); } | 263 bool ClobbersRegisters() const { return IsCall(); } |
| 274 virtual bool ClobbersDoubleRegisters() const { return IsCall(); } | 264 virtual bool ClobbersDoubleRegisters() const { return IsCall(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 294 // Iterator support. | 284 // Iterator support. |
| 295 friend class InputIterator; | 285 friend class InputIterator; |
| 296 virtual int InputCount() = 0; | 286 virtual int InputCount() = 0; |
| 297 virtual LOperand* InputAt(int i) = 0; | 287 virtual LOperand* InputAt(int i) = 0; |
| 298 | 288 |
| 299 friend class TempIterator; | 289 friend class TempIterator; |
| 300 virtual int TempCount() = 0; | 290 virtual int TempCount() = 0; |
| 301 virtual LOperand* TempAt(int i) = 0; | 291 virtual LOperand* TempAt(int i) = 0; |
| 302 | 292 |
| 303 class IsCallBits: public BitField<bool, 0, 1> {}; | 293 class IsCallBits: public BitField<bool, 0, 1> {}; |
| 304 class PositionBits: public BitField<int, 1, 31> {}; | |
| 305 | 294 |
| 306 LEnvironment* environment_; | 295 LEnvironment* environment_; |
| 307 SetOncePointer<LPointerMap> pointer_map_; | 296 SetOncePointer<LPointerMap> pointer_map_; |
| 308 HValue* hydrogen_value_; | 297 HValue* hydrogen_value_; |
| 309 int bit_field_; | 298 int bit_field_; |
| 310 }; | 299 }; |
| 311 | 300 |
| 312 | 301 |
| 313 // R = number of result operands (0 or 1). | 302 // R = number of result operands (0 or 1). |
| 314 // I = number of input operands. | 303 // I = number of input operands. |
| (...skipping 2229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2544 : chunk_(NULL), | 2533 : chunk_(NULL), |
| 2545 info_(info), | 2534 info_(info), |
| 2546 graph_(graph), | 2535 graph_(graph), |
| 2547 zone_(graph->zone()), | 2536 zone_(graph->zone()), |
| 2548 status_(UNUSED), | 2537 status_(UNUSED), |
| 2549 current_instruction_(NULL), | 2538 current_instruction_(NULL), |
| 2550 current_block_(NULL), | 2539 current_block_(NULL), |
| 2551 next_block_(NULL), | 2540 next_block_(NULL), |
| 2552 argument_count_(0), | 2541 argument_count_(0), |
| 2553 allocator_(allocator), | 2542 allocator_(allocator), |
| 2554 position_(RelocInfo::kNoPosition), | |
| 2555 instruction_pending_deoptimization_environment_(NULL), | 2543 instruction_pending_deoptimization_environment_(NULL), |
| 2556 pending_deoptimization_ast_id_(BailoutId::None()) { } | 2544 pending_deoptimization_ast_id_(BailoutId::None()) { } |
| 2557 | 2545 |
| 2558 // Build the sequence for the graph. | 2546 // Build the sequence for the graph. |
| 2559 LPlatformChunk* Build(); | 2547 LPlatformChunk* Build(); |
| 2560 | 2548 |
| 2561 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); | 2549 LInstruction* CheckElideControlInstruction(HControlInstruction* instr); |
| 2562 | 2550 |
| 2563 // Declare methods that deal with the individual node types. | 2551 // Declare methods that deal with the individual node types. |
| 2564 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2552 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2697 LPlatformChunk* chunk_; | 2685 LPlatformChunk* chunk_; |
| 2698 CompilationInfo* info_; | 2686 CompilationInfo* info_; |
| 2699 HGraph* const graph_; | 2687 HGraph* const graph_; |
| 2700 Zone* zone_; | 2688 Zone* zone_; |
| 2701 Status status_; | 2689 Status status_; |
| 2702 HInstruction* current_instruction_; | 2690 HInstruction* current_instruction_; |
| 2703 HBasicBlock* current_block_; | 2691 HBasicBlock* current_block_; |
| 2704 HBasicBlock* next_block_; | 2692 HBasicBlock* next_block_; |
| 2705 int argument_count_; | 2693 int argument_count_; |
| 2706 LAllocator* allocator_; | 2694 LAllocator* allocator_; |
| 2707 int position_; | |
| 2708 LInstruction* instruction_pending_deoptimization_environment_; | 2695 LInstruction* instruction_pending_deoptimization_environment_; |
| 2709 BailoutId pending_deoptimization_ast_id_; | 2696 BailoutId pending_deoptimization_ast_id_; |
| 2710 | 2697 |
| 2711 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2698 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2712 }; | 2699 }; |
| 2713 | 2700 |
| 2714 #undef DECLARE_HYDROGEN_ACCESSOR | 2701 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2715 #undef DECLARE_CONCRETE_INSTRUCTION | 2702 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2716 | 2703 |
| 2717 } } // namespace v8::int | 2704 } } // namespace v8::int |
| 2718 | 2705 |
| 2719 #endif // V8_X64_LITHIUM_X64_H_ | 2706 #endif // V8_X64_LITHIUM_X64_H_ |
| OLD | NEW |