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 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 | 1650 |
1651 expr->BuildConstantProperties(isolate()); | 1651 expr->BuildConstantProperties(isolate()); |
1652 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1652 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1653 int flags = expr->fast_elements() | 1653 int flags = expr->fast_elements() |
1654 ? ObjectLiteral::kFastElements | 1654 ? ObjectLiteral::kFastElements |
1655 : ObjectLiteral::kNoFlags; | 1655 : ObjectLiteral::kNoFlags; |
1656 flags |= expr->has_function() | 1656 flags |= expr->has_function() |
1657 ? ObjectLiteral::kHasFunction | 1657 ? ObjectLiteral::kHasFunction |
1658 : ObjectLiteral::kNoFlags; | 1658 : ObjectLiteral::kNoFlags; |
1659 int properties_count = constant_properties->length() / 2; | 1659 int properties_count = constant_properties->length() / 2; |
1660 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || | 1660 if (expr->may_store_doubles() || expr->depth() > 1 || |
1661 flags != ObjectLiteral::kFastElements || | 1661 Serializer::enabled(isolate()) || flags != ObjectLiteral::kFastElements || |
1662 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1662 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1663 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1663 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1664 __ Push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1664 __ Push(FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
1665 __ Push(Smi::FromInt(expr->literal_index())); | 1665 __ Push(Smi::FromInt(expr->literal_index())); |
1666 __ Push(constant_properties); | 1666 __ Push(constant_properties); |
1667 __ Push(Smi::FromInt(flags)); | 1667 __ Push(Smi::FromInt(flags)); |
1668 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); | 1668 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); |
1669 } else { | 1669 } else { |
1670 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1670 __ movp(rdi, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1671 __ movp(rax, FieldOperand(rdi, JSFunction::kLiteralsOffset)); | 1671 __ movp(rax, FieldOperand(rdi, JSFunction::kLiteralsOffset)); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 __ movp(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1805 __ movp(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1806 __ movp(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 1806 __ movp(rax, FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
1807 __ Move(rbx, Smi::FromInt(expr->literal_index())); | 1807 __ Move(rbx, Smi::FromInt(expr->literal_index())); |
1808 __ Move(rcx, constant_elements); | 1808 __ Move(rcx, constant_elements); |
1809 FastCloneShallowArrayStub stub( | 1809 FastCloneShallowArrayStub stub( |
1810 isolate(), | 1810 isolate(), |
1811 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1811 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
1812 allocation_site_mode, | 1812 allocation_site_mode, |
1813 length); | 1813 length); |
1814 __ CallStub(&stub); | 1814 __ CallStub(&stub); |
1815 } else if (expr->depth() > 1 || Serializer::enabled() || | 1815 } else if (expr->depth() > 1 || Serializer::enabled(isolate()) || |
1816 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1816 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
1817 __ movp(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 1817 __ movp(rbx, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
1818 __ Push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); | 1818 __ Push(FieldOperand(rbx, JSFunction::kLiteralsOffset)); |
1819 __ Push(Smi::FromInt(expr->literal_index())); | 1819 __ Push(Smi::FromInt(expr->literal_index())); |
1820 __ Push(constant_elements); | 1820 __ Push(constant_elements); |
1821 __ Push(Smi::FromInt(flags)); | 1821 __ Push(Smi::FromInt(flags)); |
1822 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1822 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1823 } else { | 1823 } else { |
1824 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1824 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1825 FLAG_smi_only_arrays); | 1825 FLAG_smi_only_arrays); |
(...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4928 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4928 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4929 Assembler::target_address_at(call_target_address, | 4929 Assembler::target_address_at(call_target_address, |
4930 unoptimized_code)); | 4930 unoptimized_code)); |
4931 return OSR_AFTER_STACK_CHECK; | 4931 return OSR_AFTER_STACK_CHECK; |
4932 } | 4932 } |
4933 | 4933 |
4934 | 4934 |
4935 } } // namespace v8::internal | 4935 } } // namespace v8::internal |
4936 | 4936 |
4937 #endif // V8_TARGET_ARCH_X64 | 4937 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |