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 5591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5602 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); | 5602 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
5603 // Load the map's "bit field 2". We only need the first byte, | 5603 // Load the map's "bit field 2". We only need the first byte, |
5604 // but the following masking takes care of that anyway. | 5604 // but the following masking takes care of that anyway. |
5605 __ mov(ebx, FieldOperand(ebx, Map::kBitField2Offset)); | 5605 __ mov(ebx, FieldOperand(ebx, Map::kBitField2Offset)); |
5606 // Retrieve elements_kind from bit field 2. | 5606 // Retrieve elements_kind from bit field 2. |
5607 __ and_(ebx, Map::kElementsKindMask); | 5607 __ and_(ebx, Map::kElementsKindMask); |
5608 __ cmp(ebx, boilerplate_elements_kind << Map::kElementsKindShift); | 5608 __ cmp(ebx, boilerplate_elements_kind << Map::kElementsKindShift); |
5609 DeoptimizeIf(not_equal, instr->environment()); | 5609 DeoptimizeIf(not_equal, instr->environment()); |
5610 } | 5610 } |
5611 | 5611 |
5612 // Set up the parameters to the stub/runtime call. | 5612 // Set up the parameters to the stub/runtime call and pick the right |
5613 __ PushHeapObject(literals); | 5613 // runtime function or stub to call. Boilerplate already exists, |
5614 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); | 5614 // constant elements are never accessed, pass an empty fixed array. |
5615 // Boilerplate already exists, constant elements are never accessed. | |
5616 // Pass an empty fixed array. | |
5617 __ push(Immediate(isolate()->factory()->empty_fixed_array())); | |
5618 | |
5619 // Pick the right runtime function or stub to call. | |
5620 int length = instr->hydrogen()->length(); | 5615 int length = instr->hydrogen()->length(); |
5621 if (instr->hydrogen()->IsCopyOnWrite()) { | 5616 if (instr->hydrogen()->IsCopyOnWrite()) { |
5622 ASSERT(instr->hydrogen()->depth() == 1); | 5617 ASSERT(instr->hydrogen()->depth() == 1); |
| 5618 __ LoadHeapObject(eax, literals); |
| 5619 __ mov(ebx, Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 5620 __ mov(ecx, Immediate(isolate()->factory()->empty_fixed_array())); |
5623 FastCloneShallowArrayStub::Mode mode = | 5621 FastCloneShallowArrayStub::Mode mode = |
5624 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; | 5622 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; |
5625 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length); | 5623 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length); |
5626 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5624 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5627 } else if (instr->hydrogen()->depth() > 1) { | 5625 } else if (instr->hydrogen()->depth() > 1) { |
| 5626 __ PushHeapObject(literals); |
| 5627 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 5628 __ push(Immediate(isolate()->factory()->empty_fixed_array())); |
5628 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); | 5629 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); |
5629 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 5630 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 5631 __ PushHeapObject(literals); |
| 5632 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 5633 __ push(Immediate(isolate()->factory()->empty_fixed_array())); |
5630 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); | 5634 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); |
5631 } else { | 5635 } else { |
| 5636 __ LoadHeapObject(eax, literals); |
| 5637 __ mov(ebx, Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); |
| 5638 __ mov(ecx, Immediate(isolate()->factory()->empty_fixed_array())); |
5632 FastCloneShallowArrayStub::Mode mode = | 5639 FastCloneShallowArrayStub::Mode mode = |
5633 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS | 5640 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS |
5634 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS | 5641 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS |
5635 : FastCloneShallowArrayStub::CLONE_ELEMENTS; | 5642 : FastCloneShallowArrayStub::CLONE_ELEMENTS; |
5636 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); | 5643 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); |
5637 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); | 5644 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); |
5638 } | 5645 } |
5639 } | 5646 } |
5640 | 5647 |
5641 | 5648 |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6286 FixedArray::kHeaderSize - kPointerSize)); | 6293 FixedArray::kHeaderSize - kPointerSize)); |
6287 __ bind(&done); | 6294 __ bind(&done); |
6288 } | 6295 } |
6289 | 6296 |
6290 | 6297 |
6291 #undef __ | 6298 #undef __ |
6292 | 6299 |
6293 } } // namespace v8::internal | 6300 } } // namespace v8::internal |
6294 | 6301 |
6295 #endif // V8_TARGET_ARCH_IA32 | 6302 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |