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

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

Issue 14556020: Remove HLoadElements instruction and replace with use of more general HLoadNamedField. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 2836 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 // Non-instance prototype: Fetch prototype from constructor field 2847 // Non-instance prototype: Fetch prototype from constructor field
2848 // in the function's map. 2848 // in the function's map.
2849 __ bind(&non_instance); 2849 __ bind(&non_instance);
2850 __ movq(result, FieldOperand(result, Map::kConstructorOffset)); 2850 __ movq(result, FieldOperand(result, Map::kConstructorOffset));
2851 2851
2852 // All done. 2852 // All done.
2853 __ bind(&done); 2853 __ bind(&done);
2854 } 2854 }
2855 2855
2856 2856
2857 void LCodeGen::DoLoadElements(LLoadElements* instr) {
2858 Register result = ToRegister(instr->result());
2859 Register input = ToRegister(instr->object());
2860 __ movq(result, FieldOperand(input, JSObject::kElementsOffset));
2861 if (FLAG_debug_code) {
2862 Label done, ok, fail;
2863 __ CompareRoot(FieldOperand(result, HeapObject::kMapOffset),
2864 Heap::kFixedArrayMapRootIndex);
2865 __ j(equal, &done, Label::kNear);
2866 __ CompareRoot(FieldOperand(result, HeapObject::kMapOffset),
2867 Heap::kFixedCOWArrayMapRootIndex);
2868 __ j(equal, &done, Label::kNear);
2869 Register temp((result.is(rax)) ? rbx : rax);
2870 __ push(temp);
2871 __ movq(temp, FieldOperand(result, HeapObject::kMapOffset));
2872 __ movzxbq(temp, FieldOperand(temp, Map::kBitField2Offset));
2873 __ and_(temp, Immediate(Map::kElementsKindMask));
2874 __ shr(temp, Immediate(Map::kElementsKindShift));
2875 __ cmpl(temp, Immediate(GetInitialFastElementsKind()));
2876 __ j(less, &fail, Label::kNear);
2877 __ cmpl(temp, Immediate(TERMINAL_FAST_ELEMENTS_KIND));
2878 __ j(less_equal, &ok, Label::kNear);
2879 __ cmpl(temp, Immediate(FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND));
2880 __ j(less, &fail, Label::kNear);
2881 __ cmpl(temp, Immediate(LAST_EXTERNAL_ARRAY_ELEMENTS_KIND));
2882 __ j(less_equal, &ok, Label::kNear);
2883 __ bind(&fail);
2884 __ Abort("Check for fast or external elements failed");
2885 __ bind(&ok);
2886 __ pop(temp);
2887 __ bind(&done);
2888 }
2889 }
2890
2891
2892 void LCodeGen::DoLoadExternalArrayPointer( 2857 void LCodeGen::DoLoadExternalArrayPointer(
2893 LLoadExternalArrayPointer* instr) { 2858 LLoadExternalArrayPointer* instr) {
2894 Register result = ToRegister(instr->result()); 2859 Register result = ToRegister(instr->result());
2895 Register input = ToRegister(instr->object()); 2860 Register input = ToRegister(instr->object());
2896 __ movq(result, FieldOperand(input, 2861 __ movq(result, FieldOperand(input,
2897 ExternalPixelArray::kExternalPointerOffset)); 2862 ExternalPixelArray::kExternalPointerOffset));
2898 } 2863 }
2899 2864
2900 2865
2901 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2866 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
(...skipping 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 FixedArray::kHeaderSize - kPointerSize)); 5695 FixedArray::kHeaderSize - kPointerSize));
5731 __ bind(&done); 5696 __ bind(&done);
5732 } 5697 }
5733 5698
5734 5699
5735 #undef __ 5700 #undef __
5736 5701
5737 } } // namespace v8::internal 5702 } } // namespace v8::internal
5738 5703
5739 #endif // V8_TARGET_ARCH_X64 5704 #endif // V8_TARGET_ARCH_X64
OLDNEW
« .gitignore ('K') | « src/mips/lithium-mips.cc ('k') | src/x64/lithium-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698