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 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1721 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1); | 1721 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1); |
1722 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1722 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1723 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1723 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1724 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1724 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
1725 __ mov(ecx, Immediate(constant_elements)); | 1725 __ mov(ecx, Immediate(constant_elements)); |
1726 FastCloneShallowArrayStub stub( | 1726 FastCloneShallowArrayStub stub( |
1727 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1727 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
1728 DONT_TRACK_ALLOCATION_SITE, | 1728 DONT_TRACK_ALLOCATION_SITE, |
1729 length); | 1729 length); |
1730 __ CallStub(&stub); | 1730 __ CallStub(&stub); |
1731 } else if (expr->depth() > 1) { | 1731 } else if (expr->depth() > 1 || |
| 1732 Serializer::enabled() || |
| 1733 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
1732 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1734 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1733 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1735 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1734 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1736 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1735 __ push(Immediate(constant_elements)); | 1737 __ push(Immediate(constant_elements)); |
1736 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1738 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
1737 } else if (Serializer::enabled() || | |
1738 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | |
1739 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
1740 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); | |
1741 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | |
1742 __ push(Immediate(constant_elements)); | |
1743 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | |
1744 } else { | 1739 } else { |
1745 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1740 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1746 FLAG_smi_only_arrays); | 1741 FLAG_smi_only_arrays); |
1747 FastCloneShallowArrayStub::Mode mode = | 1742 FastCloneShallowArrayStub::Mode mode = |
1748 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1743 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
1749 AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites | 1744 AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites |
1750 ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; | 1745 ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; |
1751 | 1746 |
1752 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot | 1747 // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot |
1753 // change, so it's possible to specialize the stub in advance. | 1748 // change, so it's possible to specialize the stub in advance. |
(...skipping 3203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4957 | 4952 |
4958 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4953 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4959 Assembler::target_address_at(call_target_address)); | 4954 Assembler::target_address_at(call_target_address)); |
4960 return OSR_AFTER_STACK_CHECK; | 4955 return OSR_AFTER_STACK_CHECK; |
4961 } | 4956 } |
4962 | 4957 |
4963 | 4958 |
4964 } } // namespace v8::internal | 4959 } } // namespace v8::internal |
4965 | 4960 |
4966 #endif // V8_TARGET_ARCH_IA32 | 4961 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |