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

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

Issue 128683002: Array constructor can be simplified by loading context from JSFunction. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Simple ports. Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('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 // 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 5534 matching lines...) Expand 10 before | Expand all | Expand 10 after
5545 5545
5546 // Also pop pc to get Ret(0). 5546 // Also pop pc to get Ret(0).
5547 __ ldm(ia_w, sp, kSavedRegs | pc.bit()); 5547 __ ldm(ia_w, sp, kSavedRegs | pc.bit());
5548 } 5548 }
5549 5549
5550 5550
5551 template<class T> 5551 template<class T>
5552 static void CreateArrayDispatch(MacroAssembler* masm, 5552 static void CreateArrayDispatch(MacroAssembler* masm,
5553 AllocationSiteOverrideMode mode) { 5553 AllocationSiteOverrideMode mode) {
5554 if (mode == DISABLE_ALLOCATION_SITES) { 5554 if (mode == DISABLE_ALLOCATION_SITES) {
5555 T stub(GetInitialFastElementsKind(), 5555 T stub(GetInitialFastElementsKind(), mode);
5556 CONTEXT_CHECK_REQUIRED,
5557 mode);
5558 __ TailCallStub(&stub); 5556 __ TailCallStub(&stub);
5559 } else if (mode == DONT_OVERRIDE) { 5557 } else if (mode == DONT_OVERRIDE) {
5560 int last_index = GetSequenceIndexFromFastElementsKind( 5558 int last_index = GetSequenceIndexFromFastElementsKind(
5561 TERMINAL_FAST_ELEMENTS_KIND); 5559 TERMINAL_FAST_ELEMENTS_KIND);
5562 for (int i = 0; i <= last_index; ++i) { 5560 for (int i = 0; i <= last_index; ++i) {
5563 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5561 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5564 __ cmp(r3, Operand(kind)); 5562 __ cmp(r3, Operand(kind));
5565 T stub(kind); 5563 T stub(kind);
5566 __ TailCallStub(&stub, eq); 5564 __ TailCallStub(&stub, eq);
5567 } 5565 }
(...skipping 30 matching lines...) Expand all
5598 // look at the first argument 5596 // look at the first argument
5599 __ ldr(r5, MemOperand(sp, 0)); 5597 __ ldr(r5, MemOperand(sp, 0));
5600 __ cmp(r5, Operand::Zero()); 5598 __ cmp(r5, Operand::Zero());
5601 __ b(eq, &normal_sequence); 5599 __ b(eq, &normal_sequence);
5602 5600
5603 if (mode == DISABLE_ALLOCATION_SITES) { 5601 if (mode == DISABLE_ALLOCATION_SITES) {
5604 ElementsKind initial = GetInitialFastElementsKind(); 5602 ElementsKind initial = GetInitialFastElementsKind();
5605 ElementsKind holey_initial = GetHoleyElementsKind(initial); 5603 ElementsKind holey_initial = GetHoleyElementsKind(initial);
5606 5604
5607 ArraySingleArgumentConstructorStub stub_holey(holey_initial, 5605 ArraySingleArgumentConstructorStub stub_holey(holey_initial,
5608 CONTEXT_CHECK_REQUIRED,
5609 DISABLE_ALLOCATION_SITES); 5606 DISABLE_ALLOCATION_SITES);
5610 __ TailCallStub(&stub_holey); 5607 __ TailCallStub(&stub_holey);
5611 5608
5612 __ bind(&normal_sequence); 5609 __ bind(&normal_sequence);
5613 ArraySingleArgumentConstructorStub stub(initial, 5610 ArraySingleArgumentConstructorStub stub(initial,
5614 CONTEXT_CHECK_REQUIRED,
5615 DISABLE_ALLOCATION_SITES); 5611 DISABLE_ALLOCATION_SITES);
5616 __ TailCallStub(&stub); 5612 __ TailCallStub(&stub);
5617 } else if (mode == DONT_OVERRIDE) { 5613 } else if (mode == DONT_OVERRIDE) {
5618 // We are going to create a holey array, but our kind is non-holey. 5614 // We are going to create a holey array, but our kind is non-holey.
5619 // Fix kind and retry (only if we have an allocation site in the cell). 5615 // Fix kind and retry (only if we have an allocation site in the cell).
5620 __ add(r3, r3, Operand(1)); 5616 __ add(r3, r3, Operand(1));
5621 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset)); 5617 __ ldr(r5, FieldMemOperand(r2, Cell::kValueOffset));
5622 5618
5623 if (FLAG_debug_code) { 5619 if (FLAG_debug_code) {
5624 __ ldr(r5, FieldMemOperand(r5, 0)); 5620 __ ldr(r5, FieldMemOperand(r5, 0));
(...skipping 30 matching lines...) Expand all
5655 5651
5656 template<class T> 5652 template<class T>
5657 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) { 5653 static void ArrayConstructorStubAheadOfTimeHelper(Isolate* isolate) {
5658 int to_index = GetSequenceIndexFromFastElementsKind( 5654 int to_index = GetSequenceIndexFromFastElementsKind(
5659 TERMINAL_FAST_ELEMENTS_KIND); 5655 TERMINAL_FAST_ELEMENTS_KIND);
5660 for (int i = 0; i <= to_index; ++i) { 5656 for (int i = 0; i <= to_index; ++i) {
5661 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i); 5657 ElementsKind kind = GetFastElementsKindFromSequenceIndex(i);
5662 T stub(kind); 5658 T stub(kind);
5663 stub.GetCode(isolate); 5659 stub.GetCode(isolate);
5664 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) { 5660 if (AllocationSite::GetMode(kind) != DONT_TRACK_ALLOCATION_SITE) {
5665 T stub1(kind, CONTEXT_CHECK_REQUIRED, DISABLE_ALLOCATION_SITES); 5661 T stub1(kind, DISABLE_ALLOCATION_SITES);
5666 stub1.GetCode(isolate); 5662 stub1.GetCode(isolate);
5667 } 5663 }
5668 } 5664 }
5669 } 5665 }
5670 5666
5671 5667
5672 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) { 5668 void ArrayConstructorStubBase::GenerateStubsAheadOfTime(Isolate* isolate) {
5673 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>( 5669 ArrayConstructorStubAheadOfTimeHelper<ArrayNoArgumentConstructorStub>(
5674 isolate); 5670 isolate);
5675 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>( 5671 ArrayConstructorStubAheadOfTimeHelper<ArraySingleArgumentConstructorStub>(
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
5849 __ bind(&fast_elements_case); 5845 __ bind(&fast_elements_case);
5850 GenerateCase(masm, FAST_ELEMENTS); 5846 GenerateCase(masm, FAST_ELEMENTS);
5851 } 5847 }
5852 5848
5853 5849
5854 #undef __ 5850 #undef __
5855 5851
5856 } } // namespace v8::internal 5852 } } // namespace v8::internal
5857 5853
5858 #endif // V8_TARGET_ARCH_ARM 5854 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/lithium-codegen-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698