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 3748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3759 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); | 3759 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
3760 } | 3760 } |
3761 return; | 3761 return; |
3762 } | 3762 } |
3763 | 3763 |
3764 HAllocate* dominator_allocate_instr = HAllocate::cast(dominator); | 3764 HAllocate* dominator_allocate_instr = HAllocate::cast(dominator); |
3765 HValue* dominator_size = dominator_allocate_instr->size(); | 3765 HValue* dominator_size = dominator_allocate_instr->size(); |
3766 HValue* current_size = size(); | 3766 HValue* current_size = size(); |
3767 // We can just fold allocations that are guaranteed in new space. | 3767 // We can just fold allocations that are guaranteed in new space. |
3768 // TODO(hpayer): Add support for non-constant allocation in dominator. | 3768 // TODO(hpayer): Add support for non-constant allocation in dominator. |
3769 if (!GuaranteedInNewSpace() || !current_size->IsInteger32Constant() || | 3769 if (!AllocateInNewSpace() || !current_size->IsInteger32Constant() || |
3770 !dominator_allocate_instr->GuaranteedInNewSpace() || | 3770 !dominator_allocate_instr->AllocateInNewSpace() || |
3771 !dominator_size->IsInteger32Constant()) { | 3771 !dominator_size->IsInteger32Constant()) { |
3772 if (FLAG_trace_allocation_folding) { | 3772 if (FLAG_trace_allocation_folding) { |
3773 PrintF("#%d (%s) cannot fold into #%d (%s)\n", | 3773 PrintF("#%d (%s) cannot fold into #%d (%s)\n", |
3774 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); | 3774 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
3775 } | 3775 } |
3776 return; | 3776 return; |
3777 } | 3777 } |
3778 | 3778 |
3779 // First update the size of the dominator allocate instruction. | 3779 // First update the size of the dominator allocate instruction. |
3780 int32_t dominator_size_constant = | 3780 int32_t dominator_size_constant = |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3823 DeleteAndReplaceWith(dominated_allocate_instr); | 3823 DeleteAndReplaceWith(dominated_allocate_instr); |
3824 if (FLAG_trace_allocation_folding) { | 3824 if (FLAG_trace_allocation_folding) { |
3825 PrintF("#%d (%s) folded into #%d (%s)\n", | 3825 PrintF("#%d (%s) folded into #%d (%s)\n", |
3826 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); | 3826 id(), Mnemonic(), dominator->id(), dominator->Mnemonic()); |
3827 } | 3827 } |
3828 } | 3828 } |
3829 | 3829 |
3830 | 3830 |
3831 void HAllocate::PrintDataTo(StringStream* stream) { | 3831 void HAllocate::PrintDataTo(StringStream* stream) { |
3832 size()->PrintNameTo(stream); | 3832 size()->PrintNameTo(stream); |
3833 if (!GuaranteedInNewSpace()) stream->Add(" (pretenure)"); | 3833 if (!AllocateInNewSpace()) stream->Add(" (pretenure)"); |
3834 } | 3834 } |
3835 | 3835 |
3836 | 3836 |
3837 HType HRegExpLiteral::CalculateInferredType() { | 3837 HType HRegExpLiteral::CalculateInferredType() { |
3838 return HType::JSObject(); | 3838 return HType::JSObject(); |
3839 } | 3839 } |
3840 | 3840 |
3841 | 3841 |
3842 HType HFunctionLiteral::CalculateInferredType() { | 3842 HType HFunctionLiteral::CalculateInferredType() { |
3843 return HType::JSObject(); | 3843 return HType::JSObject(); |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4570 break; | 4570 break; |
4571 case kExternalMemory: | 4571 case kExternalMemory: |
4572 stream->Add("[external-memory]"); | 4572 stream->Add("[external-memory]"); |
4573 break; | 4573 break; |
4574 } | 4574 } |
4575 | 4575 |
4576 stream->Add("@%d", offset()); | 4576 stream->Add("@%d", offset()); |
4577 } | 4577 } |
4578 | 4578 |
4579 } } // namespace v8::internal | 4579 } } // namespace v8::internal |
OLD | NEW |