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

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

Issue 12521011: Compile FastCloneShallowArrayStub using Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years, 8 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/arm/full-codegen-arm.cc ('k') | src/code-stubs.h » ('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 5716 matching lines...) Expand 10 before | Expand all | Expand 10 after
5727 __ cmp(r2, Operand(boilerplate_elements_kind)); 5727 __ cmp(r2, Operand(boilerplate_elements_kind));
5728 DeoptimizeIf(ne, instr->environment()); 5728 DeoptimizeIf(ne, instr->environment());
5729 } 5729 }
5730 5730
5731 // Set up the parameters to the stub/runtime call. 5731 // Set up the parameters to the stub/runtime call.
5732 __ LoadHeapObject(r3, literals); 5732 __ LoadHeapObject(r3, literals);
5733 __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index()))); 5733 __ mov(r2, Operand(Smi::FromInt(instr->hydrogen()->literal_index())));
5734 // Boilerplate already exists, constant elements are never accessed. 5734 // Boilerplate already exists, constant elements are never accessed.
5735 // Pass an empty fixed array. 5735 // Pass an empty fixed array.
5736 __ mov(r1, Operand(isolate()->factory()->empty_fixed_array())); 5736 __ mov(r1, Operand(isolate()->factory()->empty_fixed_array()));
5737 __ Push(r3, r2, r1);
5738 5737
5739 // Pick the right runtime function or stub to call. 5738 // Pick the right runtime function or stub to call.
5740 int length = instr->hydrogen()->length(); 5739 int length = instr->hydrogen()->length();
5741 if (instr->hydrogen()->IsCopyOnWrite()) { 5740 if (instr->hydrogen()->IsCopyOnWrite()) {
5742 ASSERT(instr->hydrogen()->depth() == 1); 5741 ASSERT(instr->hydrogen()->depth() == 1);
5743 FastCloneShallowArrayStub::Mode mode = 5742 FastCloneShallowArrayStub::Mode mode =
5744 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; 5743 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS;
5745 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length); 5744 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length);
5746 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 5745 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
5747 } else if (instr->hydrogen()->depth() > 1) { 5746 } else if (instr->hydrogen()->depth() > 1) {
5747 __ Push(r3, r2, r1);
5748 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); 5748 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr);
5749 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { 5749 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
5750 __ Push(r3, r2, r1);
5750 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); 5751 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr);
5751 } else { 5752 } else {
5752 FastCloneShallowArrayStub::Mode mode = 5753 FastCloneShallowArrayStub::Mode mode =
5753 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS 5754 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS
5754 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS 5755 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS
5755 : FastCloneShallowArrayStub::CLONE_ELEMENTS; 5756 : FastCloneShallowArrayStub::CLONE_ELEMENTS;
5756 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); 5757 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length);
5757 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 5758 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
5758 } 5759 }
5759 } 5760 }
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
6396 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6397 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6397 __ ldr(result, FieldMemOperand(scratch, 6398 __ ldr(result, FieldMemOperand(scratch,
6398 FixedArray::kHeaderSize - kPointerSize)); 6399 FixedArray::kHeaderSize - kPointerSize));
6399 __ bind(&done); 6400 __ bind(&done);
6400 } 6401 }
6401 6402
6402 6403
6403 #undef __ 6404 #undef __
6404 6405
6405 } } // namespace v8::internal 6406 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/full-codegen-arm.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698