OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 390 matching lines...) Loading... |
401 int gap_instructions_size_; | 401 int gap_instructions_size_; |
402 }; | 402 }; |
403 | 403 |
404 | 404 |
405 class LDeoptimize: public LTemplateInstruction<0, 0, 0> { | 405 class LDeoptimize: public LTemplateInstruction<0, 0, 0> { |
406 public: | 406 public: |
407 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 407 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
408 }; | 408 }; |
409 | 409 |
410 | 410 |
411 class LLabel: public LGap { | 411 class LLabel: public LTemplateInstruction<0, 0, 0> { |
412 public: | 412 public: |
413 explicit LLabel(HBasicBlock* block) | 413 explicit LLabel(HBasicBlock* block) |
414 : LGap(block), replacement_(NULL) { } | 414 : block_(block), replacement_(NULL) { } |
415 | 415 |
416 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 416 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
417 | 417 |
418 virtual void PrintDataTo(StringStream* stream); | 418 virtual void PrintDataTo(StringStream* stream); |
419 | 419 |
420 int block_id() const { return block()->block_id(); } | 420 int block_id() const { return block_->block_id(); } |
421 bool is_loop_header() const { return block()->IsLoopHeader(); } | 421 bool is_loop_header() const { return block_->IsLoopHeader(); } |
422 Label* label() { return &label_; } | 422 Label* label() { return &label_; } |
423 LLabel* replacement() const { return replacement_; } | 423 LLabel* replacement() const { return replacement_; } |
424 void set_replacement(LLabel* label) { replacement_ = label; } | 424 void set_replacement(LLabel* label) { replacement_ = label; } |
425 bool HasReplacement() const { return replacement_ != NULL; } | 425 bool HasReplacement() const { return replacement_ != NULL; } |
426 | 426 |
427 private: | 427 private: |
428 Label label_; | 428 Label label_; |
| 429 HBasicBlock* block_; |
429 LLabel* replacement_; | 430 LLabel* replacement_; |
430 }; | 431 }; |
431 | 432 |
432 | 433 |
433 class LParameter: public LTemplateInstruction<1, 0, 0> { | 434 class LParameter: public LTemplateInstruction<1, 0, 0> { |
434 public: | 435 public: |
435 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 436 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
436 }; | 437 }; |
437 | 438 |
438 | 439 |
(...skipping 1558 matching lines...) Loading... |
1997 LGap* GetGapAt(int index) const; | 1998 LGap* GetGapAt(int index) const; |
1998 bool IsGapAt(int index) const; | 1999 bool IsGapAt(int index) const; |
1999 int NearestGapPos(int index) const; | 2000 int NearestGapPos(int index) const; |
2000 void MarkEmptyBlocks(); | 2001 void MarkEmptyBlocks(); |
2001 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } | 2002 const ZoneList<LPointerMap*>* pointer_maps() const { return &pointer_maps_; } |
2002 LLabel* GetLabel(int block_id) const { | 2003 LLabel* GetLabel(int block_id) const { |
2003 HBasicBlock* block = graph_->blocks()->at(block_id); | 2004 HBasicBlock* block = graph_->blocks()->at(block_id); |
2004 int first_instruction = block->first_instruction_index(); | 2005 int first_instruction = block->first_instruction_index(); |
2005 return LLabel::cast(instructions_[first_instruction]); | 2006 return LLabel::cast(instructions_[first_instruction]); |
2006 } | 2007 } |
| 2008 LGap* GetFirstGap(HBasicBlock* block) const { |
| 2009 int first_instruction = block->first_instruction_index(); |
| 2010 return LGap::cast(instructions_[first_instruction + 1]); |
| 2011 } |
2007 int LookupDestination(int block_id) const { | 2012 int LookupDestination(int block_id) const { |
2008 LLabel* cur = GetLabel(block_id); | 2013 LLabel* cur = GetLabel(block_id); |
2009 while (cur->replacement() != NULL) { | 2014 while (cur->replacement() != NULL) { |
2010 cur = cur->replacement(); | 2015 cur = cur->replacement(); |
2011 } | 2016 } |
2012 return cur->block_id(); | 2017 return cur->block_id(); |
2013 } | 2018 } |
2014 Label* GetAssemblyLabel(int block_id) const { | 2019 Label* GetAssemblyLabel(int block_id) const { |
2015 LLabel* label = GetLabel(block_id); | 2020 LLabel* label = GetLabel(block_id); |
2016 ASSERT(!label->HasReplacement()); | 2021 ASSERT(!label->HasReplacement()); |
(...skipping 173 matching lines...) Loading... |
2190 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2195 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2191 }; | 2196 }; |
2192 | 2197 |
2193 #undef DECLARE_HYDROGEN_ACCESSOR | 2198 #undef DECLARE_HYDROGEN_ACCESSOR |
2194 #undef DECLARE_INSTRUCTION | 2199 #undef DECLARE_INSTRUCTION |
2195 #undef DECLARE_CONCRETE_INSTRUCTION | 2200 #undef DECLARE_CONCRETE_INSTRUCTION |
2196 | 2201 |
2197 } } // namespace v8::int | 2202 } } // namespace v8::int |
2198 | 2203 |
2199 #endif // V8_X64_LITHIUM_X64_H_ | 2204 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |