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

Side by Side Diff: src/x64/lithium-codegen-x64.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 | « src/x64/code-stubs-x64.cc ('k') | no next file » | 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 3856 matching lines...) Expand 10 before | Expand all | Expand 10 after
3867 ASSERT(ToRegister(instr->constructor()).is(rdi)); 3867 ASSERT(ToRegister(instr->constructor()).is(rdi));
3868 ASSERT(ToRegister(instr->result()).is(rax)); 3868 ASSERT(ToRegister(instr->result()).is(rax));
3869 3869
3870 __ Set(rax, instr->arity()); 3870 __ Set(rax, instr->arity());
3871 __ Move(rbx, instr->hydrogen()->property_cell()); 3871 __ Move(rbx, instr->hydrogen()->property_cell());
3872 ElementsKind kind = instr->hydrogen()->elements_kind(); 3872 ElementsKind kind = instr->hydrogen()->elements_kind();
3873 AllocationSiteOverrideMode override_mode = 3873 AllocationSiteOverrideMode override_mode =
3874 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 3874 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
3875 ? DISABLE_ALLOCATION_SITES 3875 ? DISABLE_ALLOCATION_SITES
3876 : DONT_OVERRIDE; 3876 : DONT_OVERRIDE;
3877 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
3878 3877
3879 if (instr->arity() == 0) { 3878 if (instr->arity() == 0) {
3880 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode); 3879 ArrayNoArgumentConstructorStub stub(kind, override_mode);
3881 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3880 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3882 } else if (instr->arity() == 1) { 3881 } else if (instr->arity() == 1) {
3883 Label done; 3882 Label done;
3884 if (IsFastPackedElementsKind(kind)) { 3883 if (IsFastPackedElementsKind(kind)) {
3885 Label packed_case; 3884 Label packed_case;
3886 // We might need a change here 3885 // We might need a change here
3887 // look at the first argument 3886 // look at the first argument
3888 __ movq(rcx, Operand(rsp, 0)); 3887 __ movq(rcx, Operand(rsp, 0));
3889 __ testq(rcx, rcx); 3888 __ testq(rcx, rcx);
3890 __ j(zero, &packed_case, Label::kNear); 3889 __ j(zero, &packed_case, Label::kNear);
3891 3890
3892 ElementsKind holey_kind = GetHoleyElementsKind(kind); 3891 ElementsKind holey_kind = GetHoleyElementsKind(kind);
3893 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode, 3892 ArraySingleArgumentConstructorStub stub(holey_kind, override_mode);
3894 override_mode);
3895 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3893 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3896 __ jmp(&done, Label::kNear); 3894 __ jmp(&done, Label::kNear);
3897 __ bind(&packed_case); 3895 __ bind(&packed_case);
3898 } 3896 }
3899 3897
3900 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode); 3898 ArraySingleArgumentConstructorStub stub(kind, override_mode);
3901 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3899 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3902 __ bind(&done); 3900 __ bind(&done);
3903 } else { 3901 } else {
3904 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); 3902 ArrayNArgumentsConstructorStub stub(kind, override_mode);
3905 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3903 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3906 } 3904 }
3907 } 3905 }
3908 3906
3909 3907
3910 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 3908 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
3911 ASSERT(ToRegister(instr->context()).is(rsi)); 3909 ASSERT(ToRegister(instr->context()).is(rsi));
3912 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); 3910 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles());
3913 } 3911 }
3914 3912
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
5631 FixedArray::kHeaderSize - kPointerSize)); 5629 FixedArray::kHeaderSize - kPointerSize));
5632 __ bind(&done); 5630 __ bind(&done);
5633 } 5631 }
5634 5632
5635 5633
5636 #undef __ 5634 #undef __
5637 5635
5638 } } // namespace v8::internal 5636 } } // namespace v8::internal
5639 5637
5640 #endif // V8_TARGET_ARCH_X64 5638 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698