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

Side by Side Diff: src/ia32/lithium-ia32.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 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 2140 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 (instr->representation().IsInteger32() && 2151 (instr->representation().IsInteger32() &&
2152 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || 2152 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) ||
2153 (instr->representation().IsDouble() && 2153 (instr->representation().IsDouble() &&
2154 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); 2154 (IsDoubleOrFloatElementsKind(instr->elements_kind()))));
2155 LOperand* backing_store = UseRegister(instr->elements()); 2155 LOperand* backing_store = UseRegister(instr->elements());
2156 result = new(zone()) LLoadKeyed(backing_store, key); 2156 result = new(zone()) LLoadKeyed(backing_store, key);
2157 } 2157 }
2158 2158
2159 DefineAsRegister(result); 2159 DefineAsRegister(result);
2160 bool can_deoptimize = instr->RequiresHoleCheck() || 2160 bool can_deoptimize = instr->RequiresHoleCheck() ||
2161 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); 2161 (elements_kind == EXTERNAL_UINT32_ELEMENTS);
2162 // An unsigned int array load might overflow and cause a deopt, make sure it 2162 // An unsigned int array load might overflow and cause a deopt, make sure it
2163 // has an environment. 2163 // has an environment.
2164 return can_deoptimize ? AssignEnvironment(result) : result; 2164 return can_deoptimize ? AssignEnvironment(result) : result;
2165 } 2165 }
2166 2166
2167 2167
2168 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { 2168 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
2169 LOperand* context = UseFixed(instr->context(), esi); 2169 LOperand* context = UseFixed(instr->context(), esi);
2170 LOperand* object = UseFixed(instr->object(), edx); 2170 LOperand* object = UseFixed(instr->object(), edx);
2171 LOperand* key = UseFixed(instr->key(), ecx); 2171 LOperand* key = UseFixed(instr->key(), ecx);
2172 2172
2173 LLoadKeyedGeneric* result = 2173 LLoadKeyedGeneric* result =
2174 new(zone()) LLoadKeyedGeneric(context, object, key); 2174 new(zone()) LLoadKeyedGeneric(context, object, key);
2175 return MarkAsCall(DefineFixed(result, eax), instr); 2175 return MarkAsCall(DefineFixed(result, eax), instr);
2176 } 2176 }
2177 2177
2178 2178
2179 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) { 2179 LOperand* LChunkBuilder::GetStoreKeyedValueOperand(HStoreKeyed* instr) {
2180 ElementsKind elements_kind = instr->elements_kind(); 2180 ElementsKind elements_kind = instr->elements_kind();
2181 2181
2182 // Determine if we need a byte register in this case for the value. 2182 // Determine if we need a byte register in this case for the value.
2183 bool val_is_fixed_register = 2183 bool val_is_fixed_register =
2184 elements_kind == EXTERNAL_BYTE_ELEMENTS || 2184 elements_kind == EXTERNAL_INT8_ELEMENTS ||
2185 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || 2185 elements_kind == EXTERNAL_UINT8_ELEMENTS ||
2186 elements_kind == EXTERNAL_PIXEL_ELEMENTS || 2186 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS ||
2187 elements_kind == UINT8_ELEMENTS || 2187 elements_kind == UINT8_ELEMENTS ||
2188 elements_kind == INT8_ELEMENTS || 2188 elements_kind == INT8_ELEMENTS ||
2189 elements_kind == UINT8_CLAMPED_ELEMENTS; 2189 elements_kind == UINT8_CLAMPED_ELEMENTS;
2190 if (val_is_fixed_register) { 2190 if (val_is_fixed_register) {
2191 return UseFixed(instr->value(), eax); 2191 return UseFixed(instr->value(), eax);
2192 } 2192 }
2193 2193
2194 if (!CpuFeatures::IsSafeForSnapshot(SSE2) && 2194 if (!CpuFeatures::IsSafeForSnapshot(SSE2) &&
2195 IsDoubleOrFloatElementsKind(elements_kind)) { 2195 IsDoubleOrFloatElementsKind(elements_kind)) {
2196 return UseRegisterAtStart(instr->value()); 2196 return UseRegisterAtStart(instr->value());
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
2643 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2643 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2644 LOperand* object = UseRegister(instr->object()); 2644 LOperand* object = UseRegister(instr->object());
2645 LOperand* index = UseTempRegister(instr->index()); 2645 LOperand* index = UseTempRegister(instr->index());
2646 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2646 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2647 } 2647 }
2648 2648
2649 2649
2650 } } // namespace v8::internal 2650 } } // namespace v8::internal
2651 2651
2652 #endif // V8_TARGET_ARCH_IA32 2652 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« src/api.cc ('K') | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698