OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 | 1589 |
1590 expr->BuildConstantProperties(isolate()); | 1590 expr->BuildConstantProperties(isolate()); |
1591 Handle<FixedArray> constant_properties = expr->constant_properties(); | 1591 Handle<FixedArray> constant_properties = expr->constant_properties(); |
1592 int flags = expr->fast_elements() | 1592 int flags = expr->fast_elements() |
1593 ? ObjectLiteral::kFastElements | 1593 ? ObjectLiteral::kFastElements |
1594 : ObjectLiteral::kNoFlags; | 1594 : ObjectLiteral::kNoFlags; |
1595 flags |= expr->has_function() | 1595 flags |= expr->has_function() |
1596 ? ObjectLiteral::kHasFunction | 1596 ? ObjectLiteral::kHasFunction |
1597 : ObjectLiteral::kNoFlags; | 1597 : ObjectLiteral::kNoFlags; |
1598 int properties_count = constant_properties->length() / 2; | 1598 int properties_count = constant_properties->length() / 2; |
1599 if (expr->may_store_doubles() || expr->depth() > 1 || Serializer::enabled() || | 1599 if (expr->may_store_doubles() || expr->depth() > 1 || |
| 1600 Serializer::enabled(isolate()) || |
1600 flags != ObjectLiteral::kFastElements || | 1601 flags != ObjectLiteral::kFastElements || |
1601 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { | 1602 properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
1602 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1603 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1603 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); | 1604 __ push(FieldOperand(edi, JSFunction::kLiteralsOffset)); |
1604 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1605 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1605 __ push(Immediate(constant_properties)); | 1606 __ push(Immediate(constant_properties)); |
1606 __ push(Immediate(Smi::FromInt(flags))); | 1607 __ push(Immediate(Smi::FromInt(flags))); |
1607 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); | 1608 __ CallRuntime(Runtime::kHiddenCreateObjectLiteral, 4); |
1608 } else { | 1609 } else { |
1609 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1610 __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1744 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1745 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1745 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1746 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1746 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1747 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
1747 __ mov(ecx, Immediate(constant_elements)); | 1748 __ mov(ecx, Immediate(constant_elements)); |
1748 FastCloneShallowArrayStub stub( | 1749 FastCloneShallowArrayStub stub( |
1749 isolate(), | 1750 isolate(), |
1750 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, | 1751 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
1751 allocation_site_mode, | 1752 allocation_site_mode, |
1752 length); | 1753 length); |
1753 __ CallStub(&stub); | 1754 __ CallStub(&stub); |
1754 } else if (expr->depth() > 1 || Serializer::enabled() || | 1755 } else if (expr->depth() > 1 || Serializer::enabled(isolate()) || |
1755 length > FastCloneShallowArrayStub::kMaximumClonedLength) { | 1756 length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
1756 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1757 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1757 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1758 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1758 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1759 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1759 __ push(Immediate(constant_elements)); | 1760 __ push(Immediate(constant_elements)); |
1760 __ push(Immediate(Smi::FromInt(flags))); | 1761 __ push(Immediate(Smi::FromInt(flags))); |
1761 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1762 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1762 } else { | 1763 } else { |
1763 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1764 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
1764 FLAG_smi_only_arrays); | 1765 FLAG_smi_only_arrays); |
(...skipping 3135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4900 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4901 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4901 Assembler::target_address_at(call_target_address, | 4902 Assembler::target_address_at(call_target_address, |
4902 unoptimized_code)); | 4903 unoptimized_code)); |
4903 return OSR_AFTER_STACK_CHECK; | 4904 return OSR_AFTER_STACK_CHECK; |
4904 } | 4905 } |
4905 | 4906 |
4906 | 4907 |
4907 } } // namespace v8::internal | 4908 } } // namespace v8::internal |
4908 | 4909 |
4909 #endif // V8_TARGET_ARCH_IA32 | 4910 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |