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

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

Issue 18191007: MIPS: Hydrogen array constructor cleanup and improvements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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/mips/code-stubs-mips.cc ('k') | src/mips/lithium-mips.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 4031 matching lines...) Expand 10 before | Expand all | Expand 10 after
4042 } 4042 }
4043 4043
4044 4044
4045 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4045 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4046 ASSERT(ToRegister(instr->constructor()).is(a1)); 4046 ASSERT(ToRegister(instr->constructor()).is(a1));
4047 ASSERT(ToRegister(instr->result()).is(v0)); 4047 ASSERT(ToRegister(instr->result()).is(v0));
4048 4048
4049 __ li(a0, Operand(instr->arity())); 4049 __ li(a0, Operand(instr->arity()));
4050 __ li(a2, Operand(instr->hydrogen()->property_cell())); 4050 __ li(a2, Operand(instr->hydrogen()->property_cell()));
4051 ElementsKind kind = instr->hydrogen()->elements_kind(); 4051 ElementsKind kind = instr->hydrogen()->elements_kind();
4052 bool disable_allocation_sites = 4052 AllocationSiteOverrideMode override_mode =
4053 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); 4053 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE)
4054 ? DISABLE_ALLOCATION_SITES
4055 : DONT_OVERRIDE;
4056 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
4054 4057
4055 if (instr->arity() == 0) { 4058 if (instr->arity() == 0) {
4056 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); 4059 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode);
4057 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4060 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4058 } else if (instr->arity() == 1) { 4061 } else if (instr->arity() == 1) {
4059 Label done; 4062 Label done;
4060 if (IsFastPackedElementsKind(kind)) { 4063 if (IsFastPackedElementsKind(kind)) {
4061 Label packed_case; 4064 Label packed_case;
4062 // We might need a change here, 4065 // We might need a change here,
4063 // look at the first argument. 4066 // look at the first argument.
4064 __ lw(t1, MemOperand(sp, 0)); 4067 __ lw(t1, MemOperand(sp, 0));
4065 __ Branch(&packed_case, eq, t1, Operand(zero_reg)); 4068 __ Branch(&packed_case, eq, t1, Operand(zero_reg));
4066 4069
4067 ElementsKind holey_kind = GetHoleyElementsKind(kind); 4070 ElementsKind holey_kind = GetHoleyElementsKind(kind);
4068 ArraySingleArgumentConstructorStub stub(holey_kind, 4071 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode,
4069 disable_allocation_sites); 4072 override_mode);
4070 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4073 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4071 __ jmp(&done); 4074 __ jmp(&done);
4072 __ bind(&packed_case); 4075 __ bind(&packed_case);
4073 } 4076 }
4074 4077
4075 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); 4078 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode);
4076 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4079 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4077 __ bind(&done); 4080 __ bind(&done);
4078 } else { 4081 } else {
4079 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); 4082 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode);
4080 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4083 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4081 } 4084 }
4082 } 4085 }
4083 4086
4084 4087
4085 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4088 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4086 CallRuntime(instr->function(), instr->arity(), instr); 4089 CallRuntime(instr->function(), instr->arity(), instr);
4087 } 4090 }
4088 4091
4089 4092
(...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after
5904 __ Subu(scratch, result, scratch); 5907 __ Subu(scratch, result, scratch);
5905 __ lw(result, FieldMemOperand(scratch, 5908 __ lw(result, FieldMemOperand(scratch,
5906 FixedArray::kHeaderSize - kPointerSize)); 5909 FixedArray::kHeaderSize - kPointerSize));
5907 __ bind(&done); 5910 __ bind(&done);
5908 } 5911 }
5909 5912
5910 5913
5911 #undef __ 5914 #undef __
5912 5915
5913 } } // namespace v8::internal 5916 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.cc ('k') | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698