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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-ia32.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 4157 matching lines...) Expand 10 before | Expand all | Expand 10 after
4168 4168
4169 4169
4170 void LCodeGen::DoCallNewArray(LCallNewArray* instr) { 4170 void LCodeGen::DoCallNewArray(LCallNewArray* instr) {
4171 ASSERT(ToRegister(instr->context()).is(esi)); 4171 ASSERT(ToRegister(instr->context()).is(esi));
4172 ASSERT(ToRegister(instr->constructor()).is(edi)); 4172 ASSERT(ToRegister(instr->constructor()).is(edi));
4173 ASSERT(ToRegister(instr->result()).is(eax)); 4173 ASSERT(ToRegister(instr->result()).is(eax));
4174 4174
4175 __ Set(eax, Immediate(instr->arity())); 4175 __ Set(eax, Immediate(instr->arity()));
4176 __ mov(ebx, instr->hydrogen()->property_cell()); 4176 __ mov(ebx, instr->hydrogen()->property_cell());
4177 ElementsKind kind = instr->hydrogen()->elements_kind(); 4177 ElementsKind kind = instr->hydrogen()->elements_kind();
4178 bool disable_allocation_sites = 4178 AllocationSiteOverrideMode override_mode =
4179 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE); 4179 (AllocationSiteInfo::GetMode(kind) == TRACK_ALLOCATION_SITE)
4180 ? DISABLE_ALLOCATION_SITES
4181 : DONT_OVERRIDE;
4182 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
4180 4183
4181 if (instr->arity() == 0) { 4184 if (instr->arity() == 0) {
4182 ArrayNoArgumentConstructorStub stub(kind, disable_allocation_sites); 4185 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode);
4183 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4186 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4184 } else if (instr->arity() == 1) { 4187 } else if (instr->arity() == 1) {
4185 Label done; 4188 Label done;
4186 if (IsFastPackedElementsKind(kind)) { 4189 if (IsFastPackedElementsKind(kind)) {
4187 Label packed_case; 4190 Label packed_case;
4188 // We might need a change here 4191 // We might need a change here
4189 // look at the first argument 4192 // look at the first argument
4190 __ mov(ecx, Operand(esp, 0)); 4193 __ mov(ecx, Operand(esp, 0));
4191 __ test(ecx, ecx); 4194 __ test(ecx, ecx);
4192 __ j(zero, &packed_case); 4195 __ j(zero, &packed_case);
4193 4196
4194 ElementsKind holey_kind = GetHoleyElementsKind(kind); 4197 ElementsKind holey_kind = GetHoleyElementsKind(kind);
4195 ArraySingleArgumentConstructorStub stub(holey_kind, 4198 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode,
4196 disable_allocation_sites); 4199 override_mode);
4197 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4200 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4198 __ jmp(&done); 4201 __ jmp(&done);
4199 __ bind(&packed_case); 4202 __ bind(&packed_case);
4200 } 4203 }
4201 4204
4202 ArraySingleArgumentConstructorStub stub(kind, disable_allocation_sites); 4205 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode);
4203 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4206 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4204 __ bind(&done); 4207 __ bind(&done);
4205 } else { 4208 } else {
4206 ArrayNArgumentsConstructorStub stub(kind, disable_allocation_sites); 4209 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode);
4207 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4210 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4208 } 4211 }
4209 } 4212 }
4210 4213
4211 4214
4212 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4215 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4213 CallRuntime(instr->function(), instr->arity(), instr); 4216 CallRuntime(instr->function(), instr->arity(), instr);
4214 } 4217 }
4215 4218
4216 4219
(...skipping 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
6548 FixedArray::kHeaderSize - kPointerSize)); 6551 FixedArray::kHeaderSize - kPointerSize));
6549 __ bind(&done); 6552 __ bind(&done);
6550 } 6553 }
6551 6554
6552 6555
6553 #undef __ 6556 #undef __
6554 6557
6555 } } // namespace v8::internal 6558 } } // namespace v8::internal
6556 6559
6557 #endif // V8_TARGET_ARCH_IA32 6560 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698