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_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "code-stubs.h" | 9 #include "code-stubs.h" |
10 #include "codegen.h" | 10 #include "codegen.h" |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 Handle<FixedArrayBase> constant_elements_values( | 1729 Handle<FixedArrayBase> constant_elements_values( |
1730 FixedArrayBase::cast(constant_elements->get(1))); | 1730 FixedArrayBase::cast(constant_elements->get(1))); |
1731 | 1731 |
1732 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1732 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1733 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { | 1733 if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { |
1734 // If the only customer of allocation sites is transitioning, then | 1734 // If the only customer of allocation sites is transitioning, then |
1735 // we can turn it off if we don't have anywhere else to transition to. | 1735 // we can turn it off if we don't have anywhere else to transition to. |
1736 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1736 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1737 } | 1737 } |
1738 | 1738 |
1739 if (expr->depth() > 1) { | 1739 if (expr->depth() > 1 || length > JSObject::kInitialMaxFastElementArray) { |
1740 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1740 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1741 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1741 __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1742 __ push(Immediate(Smi::FromInt(expr->literal_index()))); | 1742 __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
1743 __ push(Immediate(constant_elements)); | 1743 __ push(Immediate(constant_elements)); |
1744 __ push(Immediate(Smi::FromInt(flags))); | 1744 __ push(Immediate(Smi::FromInt(flags))); |
1745 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1745 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1746 } else { | 1746 } else { |
1747 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 1747 __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
1748 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); | 1748 __ mov(eax, FieldOperand(ebx, JSFunction::kLiteralsOffset)); |
1749 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); | 1749 __ mov(ebx, Immediate(Smi::FromInt(expr->literal_index()))); |
(...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4796 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), | 4796 ASSERT_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), |
4797 Assembler::target_address_at(call_target_address, | 4797 Assembler::target_address_at(call_target_address, |
4798 unoptimized_code)); | 4798 unoptimized_code)); |
4799 return OSR_AFTER_STACK_CHECK; | 4799 return OSR_AFTER_STACK_CHECK; |
4800 } | 4800 } |
4801 | 4801 |
4802 | 4802 |
4803 } } // namespace v8::internal | 4803 } } // namespace v8::internal |
4804 | 4804 |
4805 #endif // V8_TARGET_ARCH_X87 | 4805 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |