Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 975463002: Implement subclassing Arrays. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: typo + test rename Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 4644 matching lines...) Expand 10 before | Expand all | Expand 10 after
4655 4655
4656 __ cmp(edx, edi); 4656 __ cmp(edx, edi);
4657 __ j(not_equal, &subclassing); 4657 __ j(not_equal, &subclassing);
4658 4658
4659 Label no_info; 4659 Label no_info;
4660 // If the feedback vector is the undefined value call an array constructor 4660 // If the feedback vector is the undefined value call an array constructor
4661 // that doesn't use AllocationSites. 4661 // that doesn't use AllocationSites.
4662 __ cmp(ebx, isolate()->factory()->undefined_value()); 4662 __ cmp(ebx, isolate()->factory()->undefined_value());
4663 __ j(equal, &no_info); 4663 __ j(equal, &no_info);
4664 4664
4665 __ cmp(edx, edi);
4666 __ j(not_equal, &subclassing);
4667
4668 // Only look at the lower 16 bits of the transition info. 4665 // Only look at the lower 16 bits of the transition info.
4669 __ mov(edx, FieldOperand(ebx, AllocationSite::kTransitionInfoOffset)); 4666 __ mov(edx, FieldOperand(ebx, AllocationSite::kTransitionInfoOffset));
4670 __ SmiUntag(edx); 4667 __ SmiUntag(edx);
4671 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); 4668 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
4672 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask)); 4669 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask));
4673 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); 4670 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);
4674 4671
4675 __ bind(&no_info); 4672 __ bind(&no_info);
4676 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); 4673 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES);
4677 4674
4678 __ bind(&subclassing); 4675 __ bind(&subclassing);
4679 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); 4676 __ pop(ecx); // return address.
4677 __ push(edi);
4678 __ push(edx);
4679 __ add(eax, Immediate(2));
mvstanton 2015/03/02 16:46:18 A comment about the add would be good, or maybe an
4680 __ push(ecx);
4681 __ JumpToExternalReference(
4682 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate()));
4680 } 4683 }
4681 4684
4682 4685
4683 void InternalArrayConstructorStub::GenerateCase( 4686 void InternalArrayConstructorStub::GenerateCase(
4684 MacroAssembler* masm, ElementsKind kind) { 4687 MacroAssembler* masm, ElementsKind kind) {
4685 Label not_zero_case, not_one_case; 4688 Label not_zero_case, not_one_case;
4686 Label normal_sequence; 4689 Label normal_sequence;
4687 4690
4688 __ test(eax, eax); 4691 __ test(eax, eax);
4689 __ j(not_zero, &not_zero_case); 4692 __ j(not_zero, &not_zero_case);
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
5151 ApiParameterOperand(2), kStackSpace, nullptr, 5154 ApiParameterOperand(2), kStackSpace, nullptr,
5152 Operand(ebp, 7 * kPointerSize), NULL); 5155 Operand(ebp, 7 * kPointerSize), NULL);
5153 } 5156 }
5154 5157
5155 5158
5156 #undef __ 5159 #undef __
5157 5160
5158 } } // namespace v8::internal 5161 } } // namespace v8::internal
5159 5162
5160 #endif // V8_TARGET_ARCH_IA32 5163 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698