| 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 5193 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5204   Register result = ToRegister(instr->result()); | 5204   Register result = ToRegister(instr->result()); | 
| 5205   Register scratch = ToRegister(instr->temp1()); | 5205   Register scratch = ToRegister(instr->temp1()); | 
| 5206   Register scratch2 = ToRegister(instr->temp2()); | 5206   Register scratch2 = ToRegister(instr->temp2()); | 
| 5207 | 5207 | 
| 5208   // Allocate memory for the object. | 5208   // Allocate memory for the object. | 
| 5209   AllocationFlags flags = TAG_OBJECT; | 5209   AllocationFlags flags = TAG_OBJECT; | 
| 5210   if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 5210   if (instr->hydrogen()->MustAllocateDoubleAligned()) { | 
| 5211     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 5211     flags = static_cast<AllocationFlags>(flags | DOUBLE_ALIGNMENT); | 
| 5212   } | 5212   } | 
| 5213   if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5213   if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 
|  | 5214     ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); | 
| 5214     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 5215     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_POINTER_SPACE); | 
|  | 5216   } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { | 
|  | 5217     flags = static_cast<AllocationFlags>(flags | PRETENURE_OLD_DATA_SPACE); | 
| 5215   } | 5218   } | 
| 5216   if (instr->size()->IsConstantOperand()) { | 5219   if (instr->size()->IsConstantOperand()) { | 
| 5217     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5220     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 
| 5218     __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 5221     __ Allocate(size, result, scratch, scratch2, deferred->entry(), flags); | 
| 5219   } else { | 5222   } else { | 
| 5220     Register size = ToRegister(instr->size()); | 5223     Register size = ToRegister(instr->size()); | 
| 5221     __ Allocate(size, | 5224     __ Allocate(size, | 
| 5222                 result, | 5225                 result, | 
| 5223                 scratch, | 5226                 scratch, | 
| 5224                 scratch2, | 5227                 scratch2, | 
| (...skipping 18 matching lines...) Expand all  Loading... | 
| 5243     Register size = ToRegister(instr->size()); | 5246     Register size = ToRegister(instr->size()); | 
| 5244     ASSERT(!size.is(result)); | 5247     ASSERT(!size.is(result)); | 
| 5245     __ SmiTag(size); | 5248     __ SmiTag(size); | 
| 5246     __ push(size); | 5249     __ push(size); | 
| 5247   } else { | 5250   } else { | 
| 5248     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 5251     int32_t size = ToInteger32(LConstantOperand::cast(instr->size())); | 
| 5249     __ Push(Smi::FromInt(size)); | 5252     __ Push(Smi::FromInt(size)); | 
| 5250   } | 5253   } | 
| 5251 | 5254 | 
| 5252   if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 5255   if (instr->hydrogen()->CanAllocateInOldPointerSpace()) { | 
| 5253     CallRuntimeFromDeferred( | 5256     ASSERT(!instr->hydrogen()->CanAllocateInOldDataSpace()); | 
| 5254         Runtime::kAllocateInOldPointerSpace, 1, instr); | 5257     CallRuntimeFromDeferred(Runtime::kAllocateInOldPointerSpace, 1, instr); | 
|  | 5258   } else if (instr->hydrogen()->CanAllocateInOldDataSpace()) { | 
|  | 5259     CallRuntimeFromDeferred(Runtime::kAllocateInOldDataSpace, 1, instr); | 
| 5255   } else { | 5260   } else { | 
| 5256     CallRuntimeFromDeferred( | 5261     CallRuntimeFromDeferred(Runtime::kAllocateInNewSpace, 1, instr); | 
| 5257         Runtime::kAllocateInNewSpace, 1, instr); |  | 
| 5258   } | 5262   } | 
| 5259   __ StoreToSafepointRegisterSlot(v0, result); | 5263   __ StoreToSafepointRegisterSlot(v0, result); | 
| 5260 } | 5264 } | 
| 5261 | 5265 | 
| 5262 | 5266 | 
| 5263 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 5267 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 
| 5264   ASSERT(ToRegister(instr->value()).is(a0)); | 5268   ASSERT(ToRegister(instr->value()).is(a0)); | 
| 5265   ASSERT(ToRegister(instr->result()).is(v0)); | 5269   ASSERT(ToRegister(instr->result()).is(v0)); | 
| 5266   __ push(a0); | 5270   __ push(a0); | 
| 5267   CallRuntime(Runtime::kToFastProperties, 1, instr); | 5271   CallRuntime(Runtime::kToFastProperties, 1, instr); | 
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5738   __ Subu(scratch, result, scratch); | 5742   __ Subu(scratch, result, scratch); | 
| 5739   __ lw(result, FieldMemOperand(scratch, | 5743   __ lw(result, FieldMemOperand(scratch, | 
| 5740                                 FixedArray::kHeaderSize - kPointerSize)); | 5744                                 FixedArray::kHeaderSize - kPointerSize)); | 
| 5741   __ bind(&done); | 5745   __ bind(&done); | 
| 5742 } | 5746 } | 
| 5743 | 5747 | 
| 5744 | 5748 | 
| 5745 #undef __ | 5749 #undef __ | 
| 5746 | 5750 | 
| 5747 } }  // namespace v8::internal | 5751 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|