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

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

Issue 17091002: Hydrogen array constructor cleanup and improvements (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nit Created 7 years, 5 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/x64/code-stubs-x64.cc ('k') | src/x64/lithium-x64.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 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 3859 matching lines...) Expand 10 before | Expand all | Expand 10 after
3870 } 3870 }
3871 3871
3872 3872
3873 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 3873 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
3874 ASSERT(ToRegister(instr->constructor()).is(rdi)); 3874 ASSERT(ToRegister(instr->constructor()).is(rdi));
3875 ASSERT(ToRegister(instr->result()).is(rax)); 3875 ASSERT(ToRegister(instr->result()).is(rax));
3876 3876
3877 __ Set(rax, instr->arity()); 3877 __ Set(rax, instr->arity());
3878 __ Move(rbx, instr->hydrogen()->property_cell()); 3878 __ Move(rbx, instr->hydrogen()->property_cell());
3879 ElementsKind kind = instr->hydrogen()->elements_kind(); 3879 ElementsKind kind = instr->hydrogen()->elements_kind();
3880 bool disable_allocation_sites = 3880 AllocationSiteOverrideMode override_mode =
3881 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); 3881 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE)
3882 ? DISABLE_ALLOCATION_SITES
3883 : DONT_OVERRIDE;
3884 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
3882 3885
3883 if (instr->arity() == 0) { 3886 if (instr->arity() == 0) {
3884 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); 3887 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode);
3885 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3888 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3886 } else if (instr->arity() == 1) { 3889 } else if (instr->arity() == 1) {
3887 Label done; 3890 Label done;
3888 if (IsFastPackedElementsKind(kind)) { 3891 if (IsFastPackedElementsKind(kind)) {
3889 Label packed_case; 3892 Label packed_case;
3890 // We might need a change here 3893 // We might need a change here
3891 // look at the first argument 3894 // look at the first argument
3892 __ movq(rcx, Operand(rsp, 0)); 3895 __ movq(rcx, Operand(rsp, 0));
3893 __ testq(rcx, rcx); 3896 __ testq(rcx, rcx);
3894 __ j(zero, &packed_case); 3897 __ j(zero, &packed_case);
3895 3898
3896 ElementsKind holey_kind = GetHoleyElementsKind(kind); 3899 ElementsKind holey_kind = GetHoleyElementsKind(kind);
3897 ArraySingleArgumentConstructorStub stub(holey_kind, 3900 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode,
3898 disable_allocation_sites); 3901 override_mode);
3899 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3902 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3900 __ jmp(&done); 3903 __ jmp(&done);
3901 __ bind(&packed_case); 3904 __ bind(&packed_case);
3902 } 3905 }
3903 3906
3904 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); 3907 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode);
3905 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3908 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3906 __ bind(&done); 3909 __ bind(&done);
3907 } else { 3910 } else {
3908 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); 3911 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode);
3909 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3912 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3910 } 3913 }
3911 } 3914 }
3912 3915
3913 3916
3914 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 3917 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
3915 CallRuntime(instr->function(), instr->arity(), instr); 3918 CallRuntime(instr->function(), instr->arity(), instr);
3916 } 3919 }
3917 3920
3918 3921
(...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after
5650 FixedArray::kHeaderSize - kPointerSize)); 5653 FixedArray::kHeaderSize - kPointerSize));
5651 __ bind(&done); 5654 __ bind(&done);
5652 } 5655 }
5653 5656
5654 5657
5655 #undef __ 5658 #undef __
5656 5659
5657 } } // namespace v8::internal 5660 } } // namespace v8::internal
5658 5661
5659 #endif // V8_TARGET_ARCH_X64 5662 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698