| 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 4780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4791 // Pick the right runtime function or stub to call. | 4791 // Pick the right runtime function or stub to call. |
| 4792 int length = instr->hydrogen()->length(); | 4792 int length = instr->hydrogen()->length(); |
| 4793 if (instr->hydrogen()->IsCopyOnWrite()) { | 4793 if (instr->hydrogen()->IsCopyOnWrite()) { |
| 4794 ASSERT(instr->hydrogen()->depth() == 1); | 4794 ASSERT(instr->hydrogen()->depth() == 1); |
| 4795 FastCloneShallowArrayStub::Mode mode = | 4795 FastCloneShallowArrayStub::Mode mode = |
| 4796 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; | 4796 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; |
| 4797 FastCloneShallowArrayStub stub(mode, length); | 4797 FastCloneShallowArrayStub stub(mode, length); |
| 4798 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4798 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4799 } else if (instr->hydrogen()->depth() > 1) { | 4799 } else if (instr->hydrogen()->depth() > 1) { |
| 4800 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); | 4800 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); |
| 4801 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 4801 } else if (length > FastCloneShallowArrayStub::MaximumClonedLength()) { |
| 4802 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); | 4802 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
| 4803 } else { | 4803 } else { |
| 4804 FastCloneShallowArrayStub::Mode mode = | 4804 FastCloneShallowArrayStub::Mode mode = |
| 4805 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 4805 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
| 4806 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 4806 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
| 4807 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 4807 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
| 4808 FastCloneShallowArrayStub stub(mode, length); | 4808 FastCloneShallowArrayStub stub(mode, length); |
| 4809 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4809 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4810 } | 4810 } |
| 4811 } | 4811 } |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4969 ? ObjectLiteral::kFastElements | 4969 ? ObjectLiteral::kFastElements |
| 4970 : ObjectLiteral::kNoFlags; | 4970 : ObjectLiteral::kNoFlags; |
| 4971 __ li(a1, Operand(Smi::FromInt(flags))); | 4971 __ li(a1, Operand(Smi::FromInt(flags))); |
| 4972 __ Push(t0, a3, a2, a1); | 4972 __ Push(t0, a3, a2, a1); |
| 4973 | 4973 |
| 4974 // Pick the right runtime function or stub to call. | 4974 // Pick the right runtime function or stub to call. |
| 4975 int properties_count = constant_properties->length() / 2; | 4975 int properties_count = constant_properties->length() / 2; |
| 4976 if (instr->hydrogen()->depth() > 1) { | 4976 if (instr->hydrogen()->depth() > 1) { |
| 4977 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); | 4977 CallRuntime(Runtime::kCreateObjectLiteral, 4, instr); |
| 4978 } else if (flags != ObjectLiteral::kFastElements || | 4978 } else if (flags != ObjectLiteral::kFastElements || |
| 4979 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 4979 properties_count > |
| 4980 FastCloneShallowObjectStub::MaximumClonedProperties()) { |
| 4980 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); | 4981 CallRuntime(Runtime::kCreateObjectLiteralShallow, 4, instr); |
| 4981 } else { | 4982 } else { |
| 4982 FastCloneShallowObjectStub stub(properties_count); | 4983 FastCloneShallowObjectStub stub(properties_count); |
| 4983 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); | 4984 CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
| 4984 } | 4985 } |
| 4985 } | 4986 } |
| 4986 | 4987 |
| 4987 | 4988 |
| 4988 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { | 4989 void LCodeGen::DoToFastProperties(LToFastProperties* instr) { |
| 4989 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); | 4990 ASSERT(ToRegister(instr->InputAt(0)).is(a0)); |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5450 __ Subu(scratch, result, scratch); | 5451 __ Subu(scratch, result, scratch); |
| 5451 __ lw(result, FieldMemOperand(scratch, | 5452 __ lw(result, FieldMemOperand(scratch, |
| 5452 FixedArray::kHeaderSize - kPointerSize)); | 5453 FixedArray::kHeaderSize - kPointerSize)); |
| 5453 __ bind(&done); | 5454 __ bind(&done); |
| 5454 } | 5455 } |
| 5455 | 5456 |
| 5456 | 5457 |
| 5457 #undef __ | 5458 #undef __ |
| 5458 | 5459 |
| 5459 } } // namespace v8::internal | 5460 } } // namespace v8::internal |
| OLD | NEW |