| 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 5745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5756 __ inc(edx); | 5756 __ inc(edx); |
| 5757 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); | 5757 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); |
| 5758 if (FLAG_debug_code) { | 5758 if (FLAG_debug_code) { |
| 5759 Handle<Map> allocation_site_map = | 5759 Handle<Map> allocation_site_map = |
| 5760 masm->isolate()->factory()->allocation_site_map(); | 5760 masm->isolate()->factory()->allocation_site_map(); |
| 5761 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); | 5761 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); |
| 5762 __ Assert(equal, kExpectedAllocationSiteInCell); | 5762 __ Assert(equal, kExpectedAllocationSiteInCell); |
| 5763 } | 5763 } |
| 5764 | 5764 |
| 5765 // Save the resulting elements kind in type info | 5765 // Save the resulting elements kind in type info |
| 5766 __ SmiTag(edx); | 5766 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 5767 __ mov(FieldOperand(ecx, AllocationSite::kTransitionInfoOffset), edx); | 5767 __ add(FieldOperand(ecx, AllocationSite::kTransitionInfoOffset), |
| 5768 __ SmiUntag(edx); | 5768 Immediate(Smi::FromInt(kFastElementsKindPackedToHoley))); |
| 5769 | 5769 |
| 5770 __ bind(&normal_sequence); | 5770 __ bind(&normal_sequence); |
| 5771 int last_index = GetSequenceIndexFromFastElementsKind( | 5771 int last_index = GetSequenceIndexFromFastElementsKind( |
| 5772 TERMINAL_FAST_ELEMENTS_KIND); | 5772 TERMINAL_FAST_ELEMENTS_KIND); |
| 5773 for (int i = 0; i <= last_index; ++i) { | 5773 for (int i = 0; i <= last_index; ++i) { |
| 5774 Label next; | 5774 Label next; |
| 5775 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); | 5775 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); |
| 5776 __ cmp(edx, kind); | 5776 __ cmp(edx, kind); |
| 5777 __ j(not_equal, &next); | 5777 __ j(not_equal, &next); |
| 5778 ArraySingleArgumentConstructorStub stub(kind); | 5778 ArraySingleArgumentConstructorStub stub(kind); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5899 Label no_info; | 5899 Label no_info; |
| 5900 // If the type cell is undefined, or contains anything other than an | 5900 // If the type cell is undefined, or contains anything other than an |
| 5901 // AllocationSite, call an array constructor that doesn't use AllocationSites. | 5901 // AllocationSite, call an array constructor that doesn't use AllocationSites. |
| 5902 __ cmp(ebx, Immediate(undefined_sentinel)); | 5902 __ cmp(ebx, Immediate(undefined_sentinel)); |
| 5903 __ j(equal, &no_info); | 5903 __ j(equal, &no_info); |
| 5904 __ mov(edx, FieldOperand(ebx, Cell::kValueOffset)); | 5904 __ mov(edx, FieldOperand(ebx, Cell::kValueOffset)); |
| 5905 __ cmp(FieldOperand(edx, 0), Immediate( | 5905 __ cmp(FieldOperand(edx, 0), Immediate( |
| 5906 masm->isolate()->factory()->allocation_site_map())); | 5906 masm->isolate()->factory()->allocation_site_map())); |
| 5907 __ j(not_equal, &no_info); | 5907 __ j(not_equal, &no_info); |
| 5908 | 5908 |
| 5909 // Only look at the lower 16 bits of the transition info. |
| 5909 __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset)); | 5910 __ mov(edx, FieldOperand(edx, AllocationSite::kTransitionInfoOffset)); |
| 5910 __ SmiUntag(edx); | 5911 __ SmiUntag(edx); |
| 5912 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 5913 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask)); |
| 5911 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 5914 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 5912 | 5915 |
| 5913 __ bind(&no_info); | 5916 __ bind(&no_info); |
| 5914 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 5917 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 5915 } | 5918 } |
| 5916 | 5919 |
| 5917 | 5920 |
| 5918 void InternalArrayConstructorStub::GenerateCase( | 5921 void InternalArrayConstructorStub::GenerateCase( |
| 5919 MacroAssembler* masm, ElementsKind kind) { | 5922 MacroAssembler* masm, ElementsKind kind) { |
| 5920 Label not_zero_case, not_one_case; | 5923 Label not_zero_case, not_one_case; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6001 __ bind(&fast_elements_case); | 6004 __ bind(&fast_elements_case); |
| 6002 GenerateCase(masm, FAST_ELEMENTS); | 6005 GenerateCase(masm, FAST_ELEMENTS); |
| 6003 } | 6006 } |
| 6004 | 6007 |
| 6005 | 6008 |
| 6006 #undef __ | 6009 #undef __ |
| 6007 | 6010 |
| 6008 } } // namespace v8::internal | 6011 } } // namespace v8::internal |
| 6009 | 6012 |
| 6010 #endif // V8_TARGET_ARCH_IA32 | 6013 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |