OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 5062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5073 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5073 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5074 } | 5074 } |
5075 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5075 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5076 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5076 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5077 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5077 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5078 } | 5078 } |
5079 | 5079 |
5080 if (instr->hydrogen()->IsAllocationFoldingDominator()) { | 5080 if (instr->hydrogen()->IsAllocationFoldingDominator()) { |
5081 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); | 5081 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDING_DOMINATOR); |
5082 } | 5082 } |
5083 | 5083 DCHECK(!instr->hydrogen()->IsAllocationFolded()); |
5084 if (instr->hydrogen()->IsAllocationFolded()) { | |
5085 flags = static_cast<AllocationFlags>(flags | ALLOCATION_FOLDED); | |
5086 } | |
5087 | 5084 |
5088 if (instr->size()->IsConstantOperand()) { | 5085 if (instr->size()->IsConstantOperand()) { |
5089 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5086 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5090 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5087 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5091 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5088 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5092 } else { | 5089 } else { |
5093 Register size = ToRegister(instr->size()); | 5090 Register size = ToRegister(instr->size()); |
5094 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5091 __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); |
5095 } | 5092 } |
5096 | 5093 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5168 Register top_address = scratch0(); | 5165 Register top_address = scratch0(); |
5169 __ Subu(v0, v0, Operand(kHeapObjectTag)); | 5166 __ Subu(v0, v0, Operand(kHeapObjectTag)); |
5170 __ li(top_address, Operand(allocation_top)); | 5167 __ li(top_address, Operand(allocation_top)); |
5171 __ sw(v0, MemOperand(top_address)); | 5168 __ sw(v0, MemOperand(top_address)); |
5172 __ Addu(v0, v0, Operand(kHeapObjectTag)); | 5169 __ Addu(v0, v0, Operand(kHeapObjectTag)); |
5173 } | 5170 } |
5174 } | 5171 } |
5175 | 5172 |
5176 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { | 5173 void LCodeGen::DoFastAllocate(LFastAllocate* instr) { |
5177 DCHECK(instr->hydrogen()->IsAllocationFolded()); | 5174 DCHECK(instr->hydrogen()->IsAllocationFolded()); |
| 5175 DCHECK(!instr->hydrogen()->IsAllocationFoldingDominator()); |
5178 Register result = ToRegister(instr->result()); | 5176 Register result = ToRegister(instr->result()); |
5179 Register scratch1 = ToRegister(instr->temp1()); | 5177 Register scratch1 = ToRegister(instr->temp1()); |
5180 Register scratch2 = ToRegister(instr->temp2()); | 5178 Register scratch2 = ToRegister(instr->temp2()); |
5181 | 5179 |
5182 AllocationFlags flags = NO_ALLOCATION_FLAGS; | 5180 AllocationFlags flags = ALLOCATION_FOLDED; |
5183 if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5181 if (instr->hydrogen()->MustAllocateDoubleAligned()) { |
5184 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5182 flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); |
5185 } | 5183 } |
5186 if (instr->hydrogen()->IsOldSpaceAllocation()) { | 5184 if (instr->hydrogen()->IsOldSpaceAllocation()) { |
5187 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); | 5185 DCHECK(!instr->hydrogen()->IsNewSpaceAllocation()); |
5188 flags = static_cast<AllocationFlags>(flags | PRETENURE); | 5186 flags = static_cast<AllocationFlags>(flags | PRETENURE); |
5189 } | 5187 } |
5190 if (!instr->hydrogen()->IsAllocationFoldingDominator()) { | 5188 if (instr->size()->IsConstantOperand()) { |
5191 if (instr->size()->IsConstantOperand()) { | 5189 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5192 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5190 CHECK(size <= Page::kMaxRegularHeapObjectSize); |
5193 CHECK(size <= Page::kMaxRegularHeapObjectSize); | 5191 __ FastAllocate(size, result, scratch1, scratch2, flags); |
5194 __ FastAllocate(size, result, scratch1, scratch2, flags); | 5192 } else { |
5195 } else { | 5193 Register size = ToRegister(instr->size()); |
5196 Register size = ToRegister(instr->size()); | 5194 __ FastAllocate(size, result, scratch1, scratch2, flags); |
5197 __ FastAllocate(size, result, scratch1, scratch2, flags); | |
5198 } | |
5199 } | 5195 } |
5200 } | 5196 } |
5201 | 5197 |
5202 | 5198 |
5203 void LCodeGen::DoTypeof(LTypeof* instr) { | 5199 void LCodeGen::DoTypeof(LTypeof* instr) { |
5204 DCHECK(ToRegister(instr->value()).is(a3)); | 5200 DCHECK(ToRegister(instr->value()).is(a3)); |
5205 DCHECK(ToRegister(instr->result()).is(v0)); | 5201 DCHECK(ToRegister(instr->result()).is(v0)); |
5206 Label end, do_call; | 5202 Label end, do_call; |
5207 Register value_register = ToRegister(instr->value()); | 5203 Register value_register = ToRegister(instr->value()); |
5208 __ JumpIfNotSmi(value_register, &do_call); | 5204 __ JumpIfNotSmi(value_register, &do_call); |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5584 __ lw(result, FieldMemOperand(scratch, | 5580 __ lw(result, FieldMemOperand(scratch, |
5585 FixedArray::kHeaderSize - kPointerSize)); | 5581 FixedArray::kHeaderSize - kPointerSize)); |
5586 __ bind(deferred->exit()); | 5582 __ bind(deferred->exit()); |
5587 __ bind(&done); | 5583 __ bind(&done); |
5588 } | 5584 } |
5589 | 5585 |
5590 #undef __ | 5586 #undef __ |
5591 | 5587 |
5592 } // namespace internal | 5588 } // namespace internal |
5593 } // namespace v8 | 5589 } // namespace v8 |
OLD | NEW |