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

Side by Side Diff: src/ia32/lithium-codegen-ia32.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/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-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 4284 matching lines...) Expand 10 before | Expand all | Expand 10 after
4295 ASSERT(ToRegister(instr->constructor()).is(edi)); 4295 ASSERT(ToRegister(instr->constructor()).is(edi));
4296 ASSERT(ToRegister(instr->result()).is(eax)); 4296 ASSERT(ToRegister(instr->result()).is(eax));
4297 4297
4298 __ Set(eax, Immediate(instr->arity())); 4298 __ Set(eax, Immediate(instr->arity()));
4299 __ mov(ebx, instr->hydrogen()->property_cell()); 4299 __ mov(ebx, instr->hydrogen()->property_cell());
4300 ElementsKind kind = instr->hydrogen()->elements_kind(); 4300 ElementsKind kind = instr->hydrogen()->elements_kind();
4301 AllocationSiteOverrideMode override_mode = 4301 AllocationSiteOverrideMode override_mode =
4302 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE) 4302 (AllocationSite::GetMode(kind) == TRACK_ALLOCATION_SITE)
4303 ? DISABLE_ALLOCATION_SITES 4303 ? DISABLE_ALLOCATION_SITES
4304 : DONT_OVERRIDE; 4304 : DONT_OVERRIDE;
4305 ContextCheckMode context_mode = CONTEXT_CHECK_NOT_REQUIRED;
4306 4305
4307 if (instr->arity() == 0) { 4306 if (instr->arity() == 0) {
4308 ArrayNoArgumentConstructorStub stub(kind, context_mode, override_mode); 4307 ArrayNoArgumentConstructorStub stub(kind, override_mode);
4309 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4308 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4310 } else if (instr->arity() == 1) { 4309 } else if (instr->arity() == 1) {
4311 Label done; 4310 Label done;
4312 if (IsFastPackedElementsKind(kind)) { 4311 if (IsFastPackedElementsKind(kind)) {
4313 Label packed_case; 4312 Label packed_case;
4314 // We might need a change here 4313 // We might need a change here
4315 // look at the first argument 4314 // look at the first argument
4316 __ mov(ecx, Operand(esp, 0)); 4315 __ mov(ecx, Operand(esp, 0));
4317 __ test(ecx, ecx); 4316 __ test(ecx, ecx);
4318 __ j(zero, &packed_case, Label::kNear); 4317 __ j(zero, &packed_case, Label::kNear);
4319 4318
4320 ElementsKind holey_kind = GetHoleyElementsKind(kind); 4319 ElementsKind holey_kind = GetHoleyElementsKind(kind);
4321 ArraySingleArgumentConstructorStub stub(holey_kind, context_mode, 4320 ArraySingleArgumentConstructorStub stub(holey_kind, override_mode);
4322 override_mode);
4323 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4321 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4324 __ jmp(&done, Label::kNear); 4322 __ jmp(&done, Label::kNear);
4325 __ bind(&packed_case); 4323 __ bind(&packed_case);
4326 } 4324 }
4327 4325
4328 ArraySingleArgumentConstructorStub stub(kind, context_mode, override_mode); 4326 ArraySingleArgumentConstructorStub stub(kind, override_mode);
4329 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4327 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4330 __ bind(&done); 4328 __ bind(&done);
4331 } else { 4329 } else {
4332 ArrayNArgumentsConstructorStub stub(kind, context_mode, override_mode); 4330 ArrayNArgumentsConstructorStub stub(kind, override_mode);
4333 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr); 4331 CallCode(stub.GetCode(isolate()), RelocInfo::CONSTRUCT_CALL, instr);
4334 } 4332 }
4335 } 4333 }
4336 4334
4337 4335
4338 void LCodeGen::DoCallRuntime(LCallRuntime* instr) { 4336 void LCodeGen::DoCallRuntime(LCallRuntime* instr) {
4339 ASSERT(ToRegister(instr->context()).is(esi)); 4337 ASSERT(ToRegister(instr->context()).is(esi));
4340 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles()); 4338 CallRuntime(instr->function(), instr->arity(), instr, instr->save_doubles());
4341 } 4339 }
4342 4340
(...skipping 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after
6360 FixedArray::kHeaderSize - kPointerSize)); 6358 FixedArray::kHeaderSize - kPointerSize));
6361 __ bind(&done); 6359 __ bind(&done);
6362 } 6360 }
6363 6361
6364 6362
6365 #undef __ 6363 #undef __
6366 6364
6367 } } // namespace v8::internal 6365 } } // namespace v8::internal
6368 6366
6369 #endif // V8_TARGET_ARCH_IA32 6367 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698