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

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

Issue 20298002: Remove support for smi-based keyed accesses on 64bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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/hydrogen-instructions.h ('k') | src/x64/lithium-x64.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 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 2879 matching lines...) Expand 10 before | Expand all | Expand 10 after
2890 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { 2890 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
2891 ElementsKind elements_kind = instr->elements_kind(); 2891 ElementsKind elements_kind = instr->elements_kind();
2892 LOperand* key = instr->key(); 2892 LOperand* key = instr->key();
2893 if (!key->IsConstantOperand()) { 2893 if (!key->IsConstantOperand()) {
2894 Register key_reg = ToRegister(key); 2894 Register key_reg = ToRegister(key);
2895 // Even though the HLoad/StoreKeyed (in this case) instructions force 2895 // Even though the HLoad/StoreKeyed (in this case) instructions force
2896 // the input representation for the key to be an integer, the input 2896 // the input representation for the key to be an integer, the input
2897 // gets replaced during bound check elimination with the index argument 2897 // gets replaced during bound check elimination with the index argument
2898 // to the bounds check, which can be tagged, so that case must be 2898 // to the bounds check, which can be tagged, so that case must be
2899 // handled here, too. 2899 // handled here, too.
2900 if (instr->hydrogen()->key()->representation().IsSmi()) { 2900 if (instr->hydrogen()->IsDehoisted()) {
2901 __ SmiToInteger64(key_reg, key_reg);
2902 } else if (instr->hydrogen()->IsDehoisted()) {
2903 // Sign extend key because it could be a 32 bit negative value 2901 // Sign extend key because it could be a 32 bit negative value
2904 // and the dehoisted address computation happens in 64 bits 2902 // and the dehoisted address computation happens in 64 bits
2905 __ movsxlq(key_reg, key_reg); 2903 __ movsxlq(key_reg, key_reg);
2906 } 2904 }
2907 } 2905 }
2908 Operand operand(BuildFastArrayOperand( 2906 Operand operand(BuildFastArrayOperand(
2909 instr->elements(), 2907 instr->elements(),
2910 key, 2908 key,
2911 elements_kind, 2909 elements_kind,
2912 0, 2910 0,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
2963 2961
2964 void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { 2962 void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
2965 XMMRegister result(ToDoubleRegister(instr->result())); 2963 XMMRegister result(ToDoubleRegister(instr->result()));
2966 LOperand* key = instr->key(); 2964 LOperand* key = instr->key();
2967 if (!key->IsConstantOperand()) { 2965 if (!key->IsConstantOperand()) {
2968 Register key_reg = ToRegister(key); 2966 Register key_reg = ToRegister(key);
2969 // Even though the HLoad/StoreKeyed instructions force the input 2967 // Even though the HLoad/StoreKeyed instructions force the input
2970 // representation for the key to be an integer, the input gets replaced 2968 // representation for the key to be an integer, the input gets replaced
2971 // during bound check elimination with the index argument to the bounds 2969 // during bound check elimination with the index argument to the bounds
2972 // check, which can be tagged, so that case must be handled here, too. 2970 // check, which can be tagged, so that case must be handled here, too.
2973 if (instr->hydrogen()->key()->representation().IsSmi()) { 2971 if (instr->hydrogen()->IsDehoisted()) {
2974 __ SmiToInteger64(key_reg, key_reg);
2975 } else if (instr->hydrogen()->IsDehoisted()) {
2976 // Sign extend key because it could be a 32 bit negative value 2972 // Sign extend key because it could be a 32 bit negative value
2977 // and the dehoisted address computation happens in 64 bits 2973 // and the dehoisted address computation happens in 64 bits
2978 __ movsxlq(key_reg, key_reg); 2974 __ movsxlq(key_reg, key_reg);
2979 } 2975 }
2980 } 2976 }
2981 2977
2982 if (instr->hydrogen()->RequiresHoleCheck()) { 2978 if (instr->hydrogen()->RequiresHoleCheck()) {
2983 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + 2979 int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag +
2984 sizeof(kHoleNanLower32); 2980 sizeof(kHoleNanLower32);
2985 Operand hole_check_operand = BuildFastArrayOperand( 2981 Operand hole_check_operand = BuildFastArrayOperand(
(...skipping 19 matching lines...) Expand all
3005 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { 3001 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
3006 Register result = ToRegister(instr->result()); 3002 Register result = ToRegister(instr->result());
3007 LOperand* key = instr->key(); 3003 LOperand* key = instr->key();
3008 if (!key->IsConstantOperand()) { 3004 if (!key->IsConstantOperand()) {
3009 Register key_reg = ToRegister(key); 3005 Register key_reg = ToRegister(key);
3010 // Even though the HLoad/StoreKeyedFastElement instructions force 3006 // Even though the HLoad/StoreKeyedFastElement instructions force
3011 // the input representation for the key to be an integer, the input 3007 // the input representation for the key to be an integer, the input
3012 // gets replaced during bound check elimination with the index 3008 // gets replaced during bound check elimination with the index
3013 // argument to the bounds check, which can be tagged, so that 3009 // argument to the bounds check, which can be tagged, so that
3014 // case must be handled here, too. 3010 // case must be handled here, too.
3015 if (instr->hydrogen()->key()->representation().IsSmi()) { 3011 if (instr->hydrogen()->IsDehoisted()) {
3016 __ SmiToInteger64(key_reg, key_reg);
3017 } else if (instr->hydrogen()->IsDehoisted()) {
3018 // Sign extend key because it could be a 32 bit negative value 3012 // Sign extend key because it could be a 32 bit negative value
3019 // and the dehoisted address computation happens in 64 bits 3013 // and the dehoisted address computation happens in 64 bits
3020 __ movsxlq(key_reg, key_reg); 3014 __ movsxlq(key_reg, key_reg);
3021 } 3015 }
3022 } 3016 }
3023 3017
3024 // Load the result. 3018 // Load the result.
3025 __ movq(result, 3019 __ movq(result,
3026 BuildFastArrayOperand(instr->elements(), 3020 BuildFastArrayOperand(instr->elements(),
3027 key, 3021 key,
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
4083 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 4077 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
4084 ElementsKind elements_kind = instr->elements_kind(); 4078 ElementsKind elements_kind = instr->elements_kind();
4085 LOperand* key = instr->key(); 4079 LOperand* key = instr->key();
4086 if (!key->IsConstantOperand()) { 4080 if (!key->IsConstantOperand()) {
4087 Register key_reg = ToRegister(key); 4081 Register key_reg = ToRegister(key);
4088 // Even though the HLoad/StoreKeyedFastElement instructions force 4082 // Even though the HLoad/StoreKeyedFastElement instructions force
4089 // the input representation for the key to be an integer, the input 4083 // the input representation for the key to be an integer, the input
4090 // gets replaced during bound check elimination with the index 4084 // gets replaced during bound check elimination with the index
4091 // argument to the bounds check, which can be tagged, so that case 4085 // argument to the bounds check, which can be tagged, so that case
4092 // must be handled here, too. 4086 // must be handled here, too.
4093 if (instr->hydrogen()->key()->representation().IsSmi()) { 4087 if (instr->hydrogen()->IsDehoisted()) {
4094 __ SmiToInteger64(key_reg, key_reg);
4095 } else if (instr->hydrogen()->IsDehoisted()) {
4096 // Sign extend key because it could be a 32 bit negative value 4088 // Sign extend key because it could be a 32 bit negative value
4097 // and the dehoisted address computation happens in 64 bits 4089 // and the dehoisted address computation happens in 64 bits
4098 __ movsxlq(key_reg, key_reg); 4090 __ movsxlq(key_reg, key_reg);
4099 } 4091 }
4100 } 4092 }
4101 Operand operand(BuildFastArrayOperand( 4093 Operand operand(BuildFastArrayOperand(
4102 instr->elements(), 4094 instr->elements(),
4103 key, 4095 key,
4104 elements_kind, 4096 elements_kind,
4105 0, 4097 0,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { 4139 void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
4148 XMMRegister value = ToDoubleRegister(instr->value()); 4140 XMMRegister value = ToDoubleRegister(instr->value());
4149 LOperand* key = instr->key(); 4141 LOperand* key = instr->key();
4150 if (!key->IsConstantOperand()) { 4142 if (!key->IsConstantOperand()) {
4151 Register key_reg = ToRegister(key); 4143 Register key_reg = ToRegister(key);
4152 // Even though the HLoad/StoreKeyedFastElement instructions force 4144 // Even though the HLoad/StoreKeyedFastElement instructions force
4153 // the input representation for the key to be an integer, the 4145 // the input representation for the key to be an integer, the
4154 // input gets replaced during bound check elimination with the index 4146 // input gets replaced during bound check elimination with the index
4155 // argument to the bounds check, which can be tagged, so that case 4147 // argument to the bounds check, which can be tagged, so that case
4156 // must be handled here, too. 4148 // must be handled here, too.
4157 if (instr->hydrogen()->key()->representation().IsSmi()) { 4149 if (instr->hydrogen()->IsDehoisted()) {
4158 __ SmiToInteger64(key_reg, key_reg);
4159 } else if (instr->hydrogen()->IsDehoisted()) {
4160 // Sign extend key because it could be a 32 bit negative value 4150 // Sign extend key because it could be a 32 bit negative value
4161 // and the dehoisted address computation happens in 64 bits 4151 // and the dehoisted address computation happens in 64 bits
4162 __ movsxlq(key_reg, key_reg); 4152 __ movsxlq(key_reg, key_reg);
4163 } 4153 }
4164 } 4154 }
4165 4155
4166 if (instr->NeedsCanonicalization()) { 4156 if (instr->NeedsCanonicalization()) {
4167 Label have_value; 4157 Label have_value;
4168 4158
4169 __ ucomisd(value, value); 4159 __ ucomisd(value, value);
(...skipping 20 matching lines...) Expand all
4190 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { 4180 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
4191 Register elements = ToRegister(instr->elements()); 4181 Register elements = ToRegister(instr->elements());
4192 LOperand* key = instr->key(); 4182 LOperand* key = instr->key();
4193 if (!key->IsConstantOperand()) { 4183 if (!key->IsConstantOperand()) {
4194 Register key_reg = ToRegister(key); 4184 Register key_reg = ToRegister(key);
4195 // Even though the HLoad/StoreKeyedFastElement instructions force 4185 // Even though the HLoad/StoreKeyedFastElement instructions force
4196 // the input representation for the key to be an integer, the 4186 // the input representation for the key to be an integer, the
4197 // input gets replaced during bound check elimination with the index 4187 // input gets replaced during bound check elimination with the index
4198 // argument to the bounds check, which can be tagged, so that case 4188 // argument to the bounds check, which can be tagged, so that case
4199 // must be handled here, too. 4189 // must be handled here, too.
4200 if (instr->hydrogen()->key()->representation().IsSmi()) { 4190 if (instr->hydrogen()->IsDehoisted()) {
4201 __ SmiToInteger64(key_reg, key_reg);
4202 } else if (instr->hydrogen()->IsDehoisted()) {
4203 // Sign extend key because it could be a 32 bit negative value 4191 // Sign extend key because it could be a 32 bit negative value
4204 // and the dehoisted address computation happens in 64 bits 4192 // and the dehoisted address computation happens in 64 bits
4205 __ movsxlq(key_reg, key_reg); 4193 __ movsxlq(key_reg, key_reg);
4206 } 4194 }
4207 } 4195 }
4208 4196
4209 Operand operand = 4197 Operand operand =
4210 BuildFastArrayOperand(instr->elements(), 4198 BuildFastArrayOperand(instr->elements(),
4211 key, 4199 key,
4212 FAST_ELEMENTS, 4200 FAST_ELEMENTS,
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
5558 FixedArray::kHeaderSize - kPointerSize)); 5546 FixedArray::kHeaderSize - kPointerSize));
5559 __ bind(&done); 5547 __ bind(&done);
5560 } 5548 }
5561 5549
5562 5550
5563 #undef __ 5551 #undef __
5564 5552
5565 } } // namespace v8::internal 5553 } } // namespace v8::internal
5566 5554
5567 #endif // V8_TARGET_ARCH_X64 5555 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698