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

Side by Side Diff: src/mips/lithium-codegen-mips.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/mips/code-stubs-mips.cc ('k') | src/x64/code-stubs-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 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 3958 matching lines...) Expand 10 before | Expand all | Expand 10 after
3969 ASSERT(ToRegister(instr->constructor()).is(a1)); 3969 ASSERT(ToRegister(instr->constructor()).is(a1));
3970 ASSERT(ToRegister(instr->result()).is(v0)); 3970 ASSERT(ToRegister(instr->result()).is(v0));
3971 3971
3972 __ li(a0, Operand(instr->arity())); 3972 __ li(a0, Operand(instr->arity()));
3973 __ li(a2, Operand(instr->hydrogen()->property_cell())); 3973 __ li(a2, Operand(instr->hydrogen()->property_cell()));
3974 ElementsKind kind = instr->hydrogen()->elements_kind(); 3974 ElementsKind kind = instr->hydrogen()->elements_kind();
3975 AllocationSiteOverrideMode override_mode = 3975 AllocationSiteOverrideMode override_mode =
3976 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 3976 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
3977 ? DISABLE_ALLOCATION_SITES 3977 ? DISABLE_ALLOCATION_SITES
3978 : DONT_OVERRIDE; 3978 : DONT_OVERRIDE;
3979 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
3980 3979
3981 if (instr->arity() == 0) { 3980 if (instr->arity() == 0) {
3982 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode); 3981 ArrayNoArgumentConstructorStub stub(kind, override_mode);
3983 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3982 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3984 } else if (instr->arity() == 1) { 3983 } else if (instr->arity() == 1) {
3985 Label done; 3984 Label done;
3986 if (IsFastPackedElementsKind(kind)) { 3985 if (IsFastPackedElementsKind(kind)) {
3987 Label packed_case; 3986 Label packed_case;
3988 // We might need a change here, 3987 // We might need a change here,
3989 // look at the first argument. 3988 // look at the first argument.
3990 __ lw(t1, MemOperand(sp, 0)); 3989 __ lw(t1, MemOperand(sp, 0));
3991 __ Branch(&packed_case, eq, t1, Operand(zero_reg)); 3990 __ Branch(&packed_case, eq, t1, Operand(zero_reg));
3992 3991
3993 ElementsKind holey_kind = GetHoleyElementsKind(kind); 3992 ElementsKind holey_kind = GetHoleyElementsKind(kind);
3994 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode, 3993 ArraySingleArgumentConstructorStub stub(holey_kind, override_mode);
3995 override_mode);
3996 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 3994 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
3997 __ jmp(&done); 3995 __ jmp(&done);
3998 __ bind(&packed_case); 3996 __ bind(&packed_case);
3999 } 3997 }
4000 3998
4001 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode); 3999 ArraySingleArgumentConstructorStub stub(kind, override_mode);
4002 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4000 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4003 __ bind(&done); 4001 __ bind(&done);
4004 } else { 4002 } else {
4005 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); 4003 ArrayNArgumentsConstructorStub stub(kind, override_mode);
4006 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4004 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4007 } 4005 }
4008 } 4006 }
4009 4007
4010 4008
4011 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4009 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4012 CallRuntime(instr->function(), instr->arity(), instr); 4010 CallRuntime(instr->function(), instr->arity(), instr);
4013 } 4011 }
4014 4012
4015 4013
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after
5808 __ Subu(scratch, result, scratch); 5806 __ Subu(scratch, result, scratch);
5809 __ lw(result, FieldMemOperand(scratch, 5807 __ lw(result, FieldMemOperand(scratch,
5810 FixedArray::kHeaderSize - kPointerSize)); 5808 FixedArray::kHeaderSize - kPointerSize));
5811 __ bind(&done); 5809 __ bind(&done);
5812 } 5810 }
5813 5811
5814 5812
5815 #undef __ 5813 #undef __
5816 5814
5817 } } // namespace v8::internal 5815 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/x64/code-stubs-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698