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

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

Issue 145133013: External Array renaming and boilerplate scrapping (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
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 2885 matching lines...) Expand 10 before | Expand all | Expand 10 after
2896 void LCodeGen::DoLoadRoot(LLoadRoot* instr) { 2896 void LCodeGen::DoLoadRoot(LLoadRoot* instr) {
2897 Register result = ToRegister(instr->result()); 2897 Register result = ToRegister(instr->result());
2898 __ LoadRoot(result, instr->index()); 2898 __ LoadRoot(result, instr->index());
2899 } 2899 }
2900 2900
2901 2901
2902 void LCodeGen::DoLoadExternalArrayPointer( 2902 void LCodeGen::DoLoadExternalArrayPointer(
2903 LLoadExternalArrayPointer* instr) { 2903 LLoadExternalArrayPointer* instr) {
2904 Register result = ToRegister(instr->result()); 2904 Register result = ToRegister(instr->result());
2905 Register input = ToRegister(instr->object()); 2905 Register input = ToRegister(instr->object());
2906 __ movp(result, FieldOperand(input, 2906 __ movp(result,
2907 ExternalPixelArray::kExternalPointerOffset)); 2907 FieldOperand(input,
2908 ExternalUint8ClampedArray::kExternalPointerOffset));
2908 } 2909 }
2909 2910
2910 2911
2911 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2912 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2912 Register arguments = ToRegister(instr->arguments()); 2913 Register arguments = ToRegister(instr->arguments());
2913 Register result = ToRegister(instr->result()); 2914 Register result = ToRegister(instr->result());
2914 2915
2915 if (instr->length()->IsConstantOperand() && 2916 if (instr->length()->IsConstantOperand() &&
2916 instr->index()->IsConstantOperand()) { 2917 instr->index()->IsConstantOperand()) {
2917 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index())); 2918 int32_t const_index = ToInteger32(LConstantOperand::cast(instr->index()));
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
2954 int base_offset = instr->is_fixed_typed_array() 2955 int base_offset = instr->is_fixed_typed_array()
2955 ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag 2956 ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag
2956 : 0; 2957 : 0;
2957 Operand operand(BuildFastArrayOperand( 2958 Operand operand(BuildFastArrayOperand(
2958 instr->elements(), 2959 instr->elements(),
2959 key, 2960 key,
2960 elements_kind, 2961 elements_kind,
2961 base_offset, 2962 base_offset,
2962 instr->additional_index())); 2963 instr->additional_index()));
2963 2964
2964 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || 2965 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
2965 elements_kind == FLOAT32_ELEMENTS) { 2966 elements_kind == FLOAT32_ELEMENTS) {
2966 XMMRegister result(ToDoubleRegister(instr->result())); 2967 XMMRegister result(ToDoubleRegister(instr->result()));
2967 __ movss(result, operand); 2968 __ movss(result, operand);
2968 __ cvtss2sd(result, result); 2969 __ cvtss2sd(result, result);
2969 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS || 2970 } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
2970 elements_kind == FLOAT64_ELEMENTS) { 2971 elements_kind == FLOAT64_ELEMENTS) {
2971 __ movsd(ToDoubleRegister(instr->result()), operand); 2972 __ movsd(ToDoubleRegister(instr->result()), operand);
2972 } else { 2973 } else {
2973 Register result(ToRegister(instr->result())); 2974 Register result(ToRegister(instr->result()));
2974 switch (elements_kind) { 2975 switch (elements_kind) {
2975 case EXTERNAL_BYTE_ELEMENTS: 2976 case EXTERNAL_INT8_ELEMENTS:
2976 case INT8_ELEMENTS: 2977 case INT8_ELEMENTS:
2977 __ movsxbq(result, operand); 2978 __ movsxbq(result, operand);
2978 break; 2979 break;
2979 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 2980 case EXTERNAL_UINT8_ELEMENTS:
2980 case EXTERNAL_PIXEL_ELEMENTS: 2981 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
2981 case UINT8_ELEMENTS: 2982 case UINT8_ELEMENTS:
2982 case UINT8_CLAMPED_ELEMENTS: 2983 case UINT8_CLAMPED_ELEMENTS:
2983 __ movzxbq(result, operand); 2984 __ movzxbq(result, operand);
2984 break; 2985 break;
2985 case EXTERNAL_SHORT_ELEMENTS: 2986 case EXTERNAL_INT16_ELEMENTS:
2986 case INT16_ELEMENTS: 2987 case INT16_ELEMENTS:
2987 __ movsxwq(result, operand); 2988 __ movsxwq(result, operand);
2988 break; 2989 break;
2989 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 2990 case EXTERNAL_UINT16_ELEMENTS:
2990 case UINT16_ELEMENTS: 2991 case UINT16_ELEMENTS:
2991 __ movzxwq(result, operand); 2992 __ movzxwq(result, operand);
2992 break; 2993 break;
2993 case EXTERNAL_INT_ELEMENTS: 2994 case EXTERNAL_INT32_ELEMENTS:
2994 case INT32_ELEMENTS: 2995 case INT32_ELEMENTS:
2995 __ movsxlq(result, operand); 2996 __ movsxlq(result, operand);
2996 break; 2997 break;
2997 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 2998 case EXTERNAL_UINT32_ELEMENTS:
2998 case UINT32_ELEMENTS: 2999 case UINT32_ELEMENTS:
2999 __ movl(result, operand); 3000 __ movl(result, operand);
3000 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { 3001 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) {
3001 __ testl(result, result); 3002 __ testl(result, result);
3002 DeoptimizeIf(negative, instr->environment()); 3003 DeoptimizeIf(negative, instr->environment());
3003 } 3004 }
3004 break; 3005 break;
3005 case EXTERNAL_FLOAT_ELEMENTS: 3006 case EXTERNAL_FLOAT32_ELEMENTS:
3006 case EXTERNAL_DOUBLE_ELEMENTS: 3007 case EXTERNAL_FLOAT64_ELEMENTS:
3007 case FLOAT32_ELEMENTS: 3008 case FLOAT32_ELEMENTS:
3008 case FLOAT64_ELEMENTS: 3009 case FLOAT64_ELEMENTS:
3009 case FAST_ELEMENTS: 3010 case FAST_ELEMENTS:
3010 case FAST_SMI_ELEMENTS: 3011 case FAST_SMI_ELEMENTS:
3011 case FAST_DOUBLE_ELEMENTS: 3012 case FAST_DOUBLE_ELEMENTS:
3012 case FAST_HOLEY_ELEMENTS: 3013 case FAST_HOLEY_ELEMENTS:
3013 case FAST_HOLEY_SMI_ELEMENTS: 3014 case FAST_HOLEY_SMI_ELEMENTS:
3014 case FAST_HOLEY_DOUBLE_ELEMENTS: 3015 case FAST_HOLEY_DOUBLE_ELEMENTS:
3015 case DICTIONARY_ELEMENTS: 3016 case DICTIONARY_ELEMENTS:
3016 case NON_STRICT_ARGUMENTS_ELEMENTS: 3017 case NON_STRICT_ARGUMENTS_ELEMENTS:
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
4146 int base_offset = instr->is_fixed_typed_array() 4147 int base_offset = instr->is_fixed_typed_array()
4147 ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag 4148 ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag
4148 : 0; 4149 : 0;
4149 Operand operand(BuildFastArrayOperand( 4150 Operand operand(BuildFastArrayOperand(
4150 instr->elements(), 4151 instr->elements(),
4151 key, 4152 key,
4152 elements_kind, 4153 elements_kind,
4153 base_offset, 4154 base_offset,
4154 instr->additional_index())); 4155 instr->additional_index()));
4155 4156
4156 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS || 4157 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS ||
4157 elements_kind == FLOAT32_ELEMENTS) { 4158 elements_kind == FLOAT32_ELEMENTS) {
4158 XMMRegister value(ToDoubleRegister(instr->value())); 4159 XMMRegister value(ToDoubleRegister(instr->value()));
4159 __ cvtsd2ss(value, value); 4160 __ cvtsd2ss(value, value);
4160 __ movss(operand, value); 4161 __ movss(operand, value);
4161 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS || 4162 } else if (elements_kind == EXTERNAL_FLOAT64_ELEMENTS ||
4162 elements_kind == FLOAT64_ELEMENTS) { 4163 elements_kind == FLOAT64_ELEMENTS) {
4163 __ movsd(operand, ToDoubleRegister(instr->value())); 4164 __ movsd(operand, ToDoubleRegister(instr->value()));
4164 } else { 4165 } else {
4165 Register value(ToRegister(instr->value())); 4166 Register value(ToRegister(instr->value()));
4166 switch (elements_kind) { 4167 switch (elements_kind) {
4167 case EXTERNAL_PIXEL_ELEMENTS: 4168 case EXTERNAL_UINT8_CLAMPED_ELEMENTS:
4168 case EXTERNAL_BYTE_ELEMENTS: 4169 case EXTERNAL_INT8_ELEMENTS:
4169 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: 4170 case EXTERNAL_UINT8_ELEMENTS:
4170 case INT8_ELEMENTS: 4171 case INT8_ELEMENTS:
4171 case UINT8_ELEMENTS: 4172 case UINT8_ELEMENTS:
4172 case UINT8_CLAMPED_ELEMENTS: 4173 case UINT8_CLAMPED_ELEMENTS:
4173 __ movb(operand, value); 4174 __ movb(operand, value);
4174 break; 4175 break;
4175 case EXTERNAL_SHORT_ELEMENTS: 4176 case EXTERNAL_INT16_ELEMENTS:
4176 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: 4177 case EXTERNAL_UINT16_ELEMENTS:
4177 case INT16_ELEMENTS: 4178 case INT16_ELEMENTS:
4178 case UINT16_ELEMENTS: 4179 case UINT16_ELEMENTS:
4179 __ movw(operand, value); 4180 __ movw(operand, value);
4180 break; 4181 break;
4181 case EXTERNAL_INT_ELEMENTS: 4182 case EXTERNAL_INT32_ELEMENTS:
4182 case EXTERNAL_UNSIGNED_INT_ELEMENTS: 4183 case EXTERNAL_UINT32_ELEMENTS:
4183 case INT32_ELEMENTS: 4184 case INT32_ELEMENTS:
4184 case UINT32_ELEMENTS: 4185 case UINT32_ELEMENTS:
4185 __ movl(operand, value); 4186 __ movl(operand, value);
4186 break; 4187 break;
4187 case EXTERNAL_FLOAT_ELEMENTS: 4188 case EXTERNAL_FLOAT32_ELEMENTS:
4188 case EXTERNAL_DOUBLE_ELEMENTS: 4189 case EXTERNAL_FLOAT64_ELEMENTS:
4189 case FLOAT32_ELEMENTS: 4190 case FLOAT32_ELEMENTS:
4190 case FLOAT64_ELEMENTS: 4191 case FLOAT64_ELEMENTS:
4191 case FAST_ELEMENTS: 4192 case FAST_ELEMENTS:
4192 case FAST_SMI_ELEMENTS: 4193 case FAST_SMI_ELEMENTS:
4193 case FAST_DOUBLE_ELEMENTS: 4194 case FAST_DOUBLE_ELEMENTS:
4194 case FAST_HOLEY_ELEMENTS: 4195 case FAST_HOLEY_ELEMENTS:
4195 case FAST_HOLEY_SMI_ELEMENTS: 4196 case FAST_HOLEY_SMI_ELEMENTS:
4196 case FAST_HOLEY_DOUBLE_ELEMENTS: 4197 case FAST_HOLEY_DOUBLE_ELEMENTS:
4197 case DICTIONARY_ELEMENTS: 4198 case DICTIONARY_ELEMENTS:
4198 case NON_STRICT_ARGUMENTS_ELEMENTS: 4199 case NON_STRICT_ARGUMENTS_ELEMENTS:
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
5630 FixedArray::kHeaderSize - kPointerSize)); 5631 FixedArray::kHeaderSize - kPointerSize));
5631 __ bind(&done); 5632 __ bind(&done);
5632 } 5633 }
5633 5634
5634 5635
5635 #undef __ 5636 #undef __
5636 5637
5637 } } // namespace v8::internal 5638 } } // namespace v8::internal
5638 5639
5639 #endif // V8_TARGET_ARCH_X64 5640 #endif // V8_TARGET_ARCH_X64
OLDNEW
« src/api.cc ('K') | « src/runtime.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698