| 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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1744 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1); | 1744 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1); |
| 1745 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1745 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1746 __ movq(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 1746 __ movq(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
| 1747 __ Move(rbx, Smi::FromInt(expr->literal_index())); | 1747 __ Move(rbx, Smi::FromInt(expr->literal_index())); |
| 1748 __ Move(rcx, constant_elements); | 1748 __ Move(rcx, constant_elements); |
| 1749 FastCloneShallowArrayStub stub( | 1749 FastCloneShallowArrayStub stub( |
| 1750 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1750 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
| 1751 DONT_TRACK_ALLOCATION_SITE, | 1751 DONT_TRACK_ALLOCATION_SITE, |
| 1752 length); | 1752 length); |
| 1753 __ CallStub(&stub); | 1753 __ CallStub(&stub); |
| 1754 } else if (expr->depth() > 1) { | 1754 } else if (expr->depth() > 1 || |
| 1755 Serializer::enabled() || |
| 1756 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
| 1755 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1757 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 1756 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 1758 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
| 1757 __ Push(Smi::FromInt(expr->literal_index())); | 1759 __ Push(Smi::FromInt(expr->literal_index())); |
| 1758 __ Push(constant_elements); | 1760 __ Push(constant_elements); |
| 1759 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1761 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
| 1760 } else if (Serializer::enabled() || | |
| 1761 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | |
| 1762 __ movq(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | |
| 1763 __ push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | |
| 1764 __ Push(Smi::FromInt(expr->literal_index())); | |
| 1765 __ Push(constant_elements); | |
| 1766 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | |
| 1767 } else { | 1762 } else { |
| 1768 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1763 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
| 1769 FLAG_smi_only_arrays); | 1764 FLAG_smi_only_arrays); |
| 1770 FastCloneShallowArrayStub::Mode mode = | 1765 FastCloneShallowArrayStub::Mode mode = |
| 1771 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1766 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
| 1772 AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites | 1767 AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites |
| 1773 ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; | 1768 ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; |
| 1774 | 1769 |
| 1775 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot | 1770 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot |
| 1776 // change, so it's possible to specialize the stub in advance. | 1771 // change, so it's possible to specialize the stub in advance. |
| (...skipping 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4944 | 4939 |
| 4945 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4940 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
| 4946 Assembler::target_address_at(call_target_address)); | 4941 Assembler::target_address_at(call_target_address)); |
| 4947 return OSR_AFTER_STACK_CHECK; | 4942 return OSR_AFTER_STACK_CHECK; |
| 4948 } | 4943 } |
| 4949 | 4944 |
| 4950 | 4945 |
| 4951 } } // namespace v8::internal | 4946 } } // namespace v8::internal |
| 4952 | 4947 |
| 4953 #endif // V8_TARGET_ARCH_X64 | 4948 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |