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

Side by Side Diff: src/x64/lithium-codegen-x64.cc

Issue 16341004: Fix for bug 245480. Calling new Array(a) with a single argument could (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed an unnecessary function Created 7 years, 6 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 | « src/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-crbug-245480.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 3905 matching lines...) Expand 10 before | Expand all | Expand 10 after
3916 __ Set(rax, instr->arity()); 3916 __ Set(rax, instr->arity());
3917 __ Move(rbx, instr->hydrogen()->property_cell()); 3917 __ Move(rbx, instr->hydrogen()->property_cell());
3918 ElementsKind kind = instr->hydrogen()->elements_kind(); 3918 ElementsKind kind = instr->hydrogen()->elements_kind();
3919 bool disable_allocation_sites = 3919 bool disable_allocation_sites =
3920 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); 3920 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE);
3921 3921
3922 if (instr->arity() == 0) { 3922 if (instr->arity() == 0) {
3923 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); 3923 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites);
3924 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3924 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3925 } else if (instr->arity() == 1) { 3925 } else if (instr->arity() == 1) {
3926 Label done;
3927 if (IsFastPackedElementsKind(kind)) {
3928 Label packed_case;
3929 // We might need a change here
3930 // look at the first argument
3931 __ movq(rcx, Operand(rsp, 0));
3932 __ testq(rcx, rcx);
3933 __ j(zero, &packed_case);
3934
3935 ElementsKind holey_kind = GetHoleyElementsKind(kind);
3936 ArraySingleArgumentConstructorStub stub(holey_kind,
3937 disable_allocation_sites);
3938 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3939 __ jmp(&done);
3940 __ bind(&packed_case);
3941 }
3942
3926 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); 3943 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites);
3927 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3944 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3945 __ bind(&done);
3928 } else { 3946 } else {
3929 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); 3947 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites);
3930 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3948 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3931 } 3949 }
3932 } 3950 }
3933 3951
3934 3952
3935 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 3953 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
3936 CallRuntime(instr->function(), instr->arity(), instr); 3954 CallRuntime(instr->function(), instr->arity(), instr);
3937 } 3955 }
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
5586 FixedArray::kHeaderSize - kPointerSize)); 5604 FixedArray::kHeaderSize - kPointerSize));
5587 __ bind(&done); 5605 __ bind(&done);
5588 } 5606 }
5589 5607
5590 5608
5591 #undef __ 5609 #undef __
5592 5610
5593 } } // namespace v8::internal 5611 } } // namespace v8::internal
5594 5612
5595 #endif // V8_TARGET_ARCH_X64 5613 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | test/mjsunit/regress/regress-crbug-245480.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698