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 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5350 __ mov(result, Operand(Smi::FromInt(0))); | 5350 __ mov(result, Operand(Smi::FromInt(0))); |
5351 | 5351 |
5352 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); | 5352 PushSafepointRegistersScope scope(this, Safepoint::kWithRegisters); |
5353 if (instr->size()->IsRegister()) { | 5353 if (instr->size()->IsRegister()) { |
5354 Register size = ToRegister(instr->size()); | 5354 Register size = ToRegister(instr->size()); |
5355 ASSERT(!size.is(result)); | 5355 ASSERT(!size.is(result)); |
5356 __ SmiTag(size); | 5356 __ SmiTag(size); |
5357 __ push(size); | 5357 __ push(size); |
5358 } else { | 5358 } else { |
5359 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5359 int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); |
5360 __ Push(Smi::FromInt(size)); | 5360 if (size >= 0 && size <= Smi::kMaxValue) { |
| 5361 __ Push(Smi::FromInt(size)); |
| 5362 } else { |
| 5363 // We should never get here at runtime => abort |
| 5364 __ stop("invalid allocation size"); |
| 5365 return; |
| 5366 } |
5361 } | 5367 } |
5362 | 5368 |
5363 int flags = AllocateDoubleAlignFlag::encode( | 5369 int flags = AllocateDoubleAlignFlag::encode( |
5364 instr->hydrogen()->MustAllocateDoubleAligned()); | 5370 instr->hydrogen()->MustAllocateDoubleAligned()); |
5365 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { | 5371 if (instr->hydrogen()->IsOldPointerSpaceAllocation()) { |
5366 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation()); | 5372 ASSERT(!instr->hydrogen()->IsOldDataSpaceAllocation()); |
5367 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); | 5373 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
5368 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); | 5374 flags = AllocateTargetSpace::update(flags, OLD_POINTER_SPACE); |
5369 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { | 5375 } else if (instr->hydrogen()->IsOldDataSpaceAllocation()) { |
5370 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); | 5376 ASSERT(!instr->hydrogen()->IsNewSpaceAllocation()); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5843 __ ldr(result, FieldMemOperand(scratch, | 5849 __ ldr(result, FieldMemOperand(scratch, |
5844 FixedArray::kHeaderSize - kPointerSize)); | 5850 FixedArray::kHeaderSize - kPointerSize)); |
5845 __ bind(deferred->exit()); | 5851 __ bind(deferred->exit()); |
5846 __ bind(&done); | 5852 __ bind(&done); |
5847 } | 5853 } |
5848 | 5854 |
5849 | 5855 |
5850 #undef __ | 5856 #undef __ |
5851 | 5857 |
5852 } } // namespace v8::internal | 5858 } } // namespace v8::internal |
OLD | NEW |