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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 Comment cmnt(masm_, "[ ObjectLiteral"); | 1579 Comment cmnt(masm_, "[ ObjectLiteral"); |
1580 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1580 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1581 int flags = expr->fast_elements() | 1581 int flags = expr->fast_elements() |
1582 ? ObjectLiteral::kFastElements | 1582 ? ObjectLiteral::kFastElements |
1583 : ObjectLiteral::kNoFlags; | 1583 : ObjectLiteral::kNoFlags; |
1584 flags |= expr->has_function() | 1584 flags |= expr->has_function() |
1585 ? ObjectLiteral::kHasFunction | 1585 ? ObjectLiteral::kHasFunction |
1586 : ObjectLiteral::kNoFlags; | 1586 : ObjectLiteral::kNoFlags; |
1587 int properties_count = constant_properties->length() / 2; | 1587 int properties_count = constant_properties->length() / 2; |
1588 if ((FLAG_track_double_fields && expr->may_store_doubles()) || | 1588 if ((FLAG_track_double_fields && expr->may_store_doubles()) || |
1589 expr->depth() > 1) { | 1589 expr->depth() > 1 || Serializer::enabled() || |
| 1590 flags != ObjectLiteral::kFastElements || |
| 1591 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1590 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1592 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1591 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1593 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1592 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1594 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1593 __ push(Immediate(constant_properties)); | 1595 __ push(Immediate(constant_properties)); |
1594 __ push(Immediate(Smi::FromInt(flags))); | 1596 __ push(Immediate(Smi::FromInt(flags))); |
1595 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); | 1597 __ CallRuntime(Runtime::kCreateObjectLiteral, 4); |
1596 } else if (Serializer::enabled() || flags != ObjectLiteral::kFastElements || | |
1597 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | |
1598 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | |
1599 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | |
1600 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | |
1601 __ push(Immediate(constant_properties)); | |
1602 __ push(Immediate(Smi::FromInt(flags))); | |
1603 __ CallRuntime(Runtime::kCreateObjectLiteralShallow, 4); | |
1604 } else { | 1598 } else { |
1605 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1599 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1606 __ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1600 __ mov(eax, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1607 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1601 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
1608 __ mov(ecx, Immediate(constant_properties)); | 1602 __ mov(ecx, Immediate(constant_properties)); |
1609 __ mov(edx, Immediate(Smi::FromInt(flags))); | 1603 __ mov(edx, Immediate(Smi::FromInt(flags))); |
1610 FastCloneShallowObjectStub stub(properties_count); | 1604 FastCloneShallowObjectStub stub(properties_count); |
1611 __ CallStub(&stub); | 1605 __ CallStub(&stub); |
1612 } | 1606 } |
1613 | 1607 |
(...skipping 3279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4893 *stack_depth = 0; | 4887 *stack_depth = 0; |
4894 *context_length = 0; | 4888 *context_length = 0; |
4895 return previous_; | 4889 return previous_; |
4896 } | 4890 } |
4897 | 4891 |
4898 #undef __ | 4892 #undef __ |
4899 | 4893 |
4900 } } // namespace v8::internal | 4894 } } // namespace v8::internal |
4901 | 4895 |
4902 #endif // V8_TARGET_ARCH_IA32 | 4896 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |