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 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 : ObjectLiteral::kNoFlags; | 1598 : ObjectLiteral::kNoFlags; |
1599 flags |= expr->has_function() | 1599 flags |= expr->has_function() |
1600 ? ObjectLiteral::kHasFunction | 1600 ? ObjectLiteral::kHasFunction |
1601 : ObjectLiteral::kNoFlags; | 1601 : ObjectLiteral::kNoFlags; |
1602 __ li(a0, Operand(Smi::FromInt(flags))); | 1602 __ li(a0, Operand(Smi::FromInt(flags))); |
1603 __ Push(a3, a2, a1, a0); | 1603 __ Push(a3, a2, a1, a0); |
1604 int properties_count = constant_properties->length() / 2; | 1604 int properties_count = constant_properties->length() / 2; |
1605 if (expr->depth() > 1) { | 1605 if (expr->depth() > 1) { |
1606 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1606 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1607 } else if (flags != ObjectLiteral::kFastElements || | 1607 } else if (flags != ObjectLiteral::kFastElements || |
1608 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1608 properties_count > |
| 1609 FastCloneShallowObjectStub::MaximumClonedProperties()) { |
1609 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | 1610 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); |
1610 } else { | 1611 } else { |
1611 FastCloneShallowObjectStub stub(properties_count); | 1612 FastCloneShallowObjectStub stub(properties_count); |
1612 __ CallStub(&stub); | 1613 __ CallStub(&stub); |
1613 } | 1614 } |
1614 | 1615 |
1615 // If result_saved is true the result is on top of the stack. If | 1616 // If result_saved is true the result is on top of the stack. If |
1616 // result_saved is false the result is in v0. | 1617 // result_saved is false the result is in v0. |
1617 bool result_saved = false; | 1618 bool result_saved = false; |
1618 | 1619 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1732 __ Push(a3, a2, a1); | 1733 __ Push(a3, a2, a1); |
1733 if (has_fast_elements && constant_elements_values->map() == | 1734 if (has_fast_elements && constant_elements_values->map() == |
1734 isolate()->heap()->fixed_cow_array_map()) { | 1735 isolate()->heap()->fixed_cow_array_map()) { |
1735 FastCloneShallowArrayStub stub( | 1736 FastCloneShallowArrayStub stub( |
1736 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length); | 1737 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, length); |
1737 __ CallStub(&stub); | 1738 __ CallStub(&stub); |
1738 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), | 1739 __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), |
1739 1, a1, a2); | 1740 1, a1, a2); |
1740 } else if (expr->depth() > 1) { | 1741 } else if (expr->depth() > 1) { |
1741 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); | 1742 __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
1742 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1743 } else if (length > FastCloneShallowArrayStub::MaximumClonedLength()) { |
1743 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); | 1744 __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
1744 } else { | 1745 } else { |
1745 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1746 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1746 FLAG_smi_only_arrays); | 1747 FLAG_smi_only_arrays); |
1747 FastCloneShallowArrayStub::Mode mode = has_fast_elements | 1748 FastCloneShallowArrayStub::Mode mode = has_fast_elements |
1748 ? FastCloneShallowArrayStub::CLONE_ELEMENTS | 1749 ? FastCloneShallowArrayStub::CLONE_ELEMENTS |
1749 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | 1750 : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
1750 FastCloneShallowArrayStub stub(mode, length); | 1751 FastCloneShallowArrayStub stub(mode, length); |
1751 __ CallStub(&stub); | 1752 __ CallStub(&stub); |
1752 } | 1753 } |
(...skipping 2865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 *context_length = 0; | 4619 *context_length = 0; |
4619 return previous_; | 4620 return previous_; |
4620 } | 4621 } |
4621 | 4622 |
4622 | 4623 |
4623 #undef __ | 4624 #undef __ |
4624 | 4625 |
4625 } } // namespace v8::internal | 4626 } } // namespace v8::internal |
4626 | 4627 |
4627 #endif // V8_TARGET_ARCH_MIPS | 4628 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |