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

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

Issue 12521011: Compile FastCloneShallowArrayStub using Crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Make this thing work with snapshots. Created 7 years, 9 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
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 5598 matching lines...) Expand 10 before | Expand all | Expand 10 after
5609 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); 5609 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset));
5610 // Load the map's "bit field 2". We only need the first byte, 5610 // Load the map's "bit field 2". We only need the first byte,
5611 // but the following masking takes care of that anyway. 5611 // but the following masking takes care of that anyway.
5612 __ mov(ebx, FieldOperand(ebx, Map::kBitField2Offset)); 5612 __ mov(ebx, FieldOperand(ebx, Map::kBitField2Offset));
5613 // Retrieve elements_kind from bit field 2. 5613 // Retrieve elements_kind from bit field 2.
5614 __ and_(ebx, Map::kElementsKindMask); 5614 __ and_(ebx, Map::kElementsKindMask);
5615 __ cmp(ebx, boilerplate_elements_kind << Map::kElementsKindShift); 5615 __ cmp(ebx, boilerplate_elements_kind << Map::kElementsKindShift);
5616 DeoptimizeIf(not_equal, instr->environment()); 5616 DeoptimizeIf(not_equal, instr->environment());
5617 } 5617 }
5618 5618
5619 // Set up the parameters to the stub/runtime call. 5619 // Set up the parameters to the stub/runtime call and pick the right
5620 __ PushHeapObject(literals); 5620 // runtime function or stub to call. Boilerplate already exists,
5621 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index()))); 5621 // constant elements are never accessed, pass an empty fixed array.
5622 // Boilerplate already exists, constant elements are never accessed.
5623 // Pass an empty fixed array.
5624 __ push(Immediate(isolate()->factory()->empty_fixed_array()));
5625
5626 // Pick the right runtime function or stub to call.
5627 int length = instr->hydrogen()->length(); 5622 int length = instr->hydrogen()->length();
5628 if (instr->hydrogen()->IsCopyOnWrite()) { 5623 if (instr->hydrogen()->IsCopyOnWrite()) {
5629 ASSERT(instr->hydrogen()->depth() == 1); 5624 ASSERT(instr->hydrogen()->depth() == 1);
5625 __ LoadHeapObject(eax, literals);
5626 __ mov(ebx, Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
5627 __ mov(ecx, Immediate(isolate()->factory()->empty_fixed_array()));
5630 FastCloneShallowArrayStub::Mode mode = 5628 FastCloneShallowArrayStub::Mode mode =
5631 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS; 5629 FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS;
5632 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length); 5630 FastCloneShallowArrayStub stub(mode, DONT_TRACK_ALLOCATION_SITE, length);
5633 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 5631 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
5634 } else if (instr->hydrogen()->depth() > 1) { 5632 } else if (instr->hydrogen()->depth() > 1) {
5633 __ PushHeapObject(literals);
5634 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
5635 __ push(Immediate(isolate()->factory()->empty_fixed_array()));
5635 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr); 5636 CallRuntime(Runtime::kCreateArrayLiteral, 3, instr);
5636 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { 5637 } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
5638 __ PushHeapObject(literals);
5639 __ push(Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
5640 __ push(Immediate(isolate()->factory()->empty_fixed_array()));
5637 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr); 5641 CallRuntime(Runtime::kCreateArrayLiteralShallow, 3, instr);
5638 } else { 5642 } else {
5643 __ LoadHeapObject(eax, literals);
5644 __ mov(ebx, Immediate(Smi::FromInt(instr->hydrogen()->literal_index())));
5645 __ mov(ecx, Immediate(isolate()->factory()->empty_fixed_array()));
5639 FastCloneShallowArrayStub::Mode mode = 5646 FastCloneShallowArrayStub::Mode mode =
5640 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS 5647 boilerplate_elements_kind == FAST_DOUBLE_ELEMENTS
5641 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS 5648 ? FastCloneShallowArrayStub::CLONE_DOUBLE_ELEMENTS
5642 : FastCloneShallowArrayStub::CLONE_ELEMENTS; 5649 : FastCloneShallowArrayStub::CLONE_ELEMENTS;
5643 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); 5650 FastCloneShallowArrayStub stub(mode, allocation_site_mode, length);
5644 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr); 5651 CallCode(stub.GetCode(isolate()), RelocInfo::CODE_TARGET, instr);
5645 } 5652 }
5646 } 5653 }
5647 5654
5648 5655
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
6294 FixedArray::kHeaderSize - kPointerSize)); 6301 FixedArray::kHeaderSize - kPointerSize));
6295 __ bind(&done); 6302 __ bind(&done);
6296 } 6303 }
6297 6304
6298 6305
6299 #undef __ 6306 #undef __
6300 6307
6301 } } // namespace v8::internal 6308 } } // namespace v8::internal
6302 6309
6303 #endif // V8_TARGET_ARCH_IA32 6310 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698