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

Side by Side Diff: src/arm/lithium-codegen-arm.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 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 3209 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 // Non-instance prototype: Fetch prototype from constructor field 3220 // Non-instance prototype: Fetch prototype from constructor field
3221 // in initial map. 3221 // in initial map.
3222 __ bind(&non_instance); 3222 __ bind(&non_instance);
3223 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset)); 3223 __ ldr(result, FieldMemOperand(result, Map::kConstructorOffset));
3224 3224
3225 // All done. 3225 // All done.
3226 __ bind(&done); 3226 __ bind(&done);
3227 } 3227 }
3228 3228
3229 3229
3230 void LCodeGen::DoLoadElements(LLoadElements* instr) {
3231 Register result = ToRegister(instr->result());
3232 Register input = ToRegister(instr->object());
3233 Register scratch = scratch0();
3234
3235 __ ldr(result, FieldMemOperand(input, JSObject::kElementsOffset));
3236 if (FLAG_debug_code) {
3237 Label done, fail;
3238 __ ldr(scratch, FieldMemOperand(result, HeapObject::kMapOffset));
3239 __ LoadRoot(ip, Heap::kFixedArrayMapRootIndex);
3240 __ cmp(scratch, ip);
3241 __ b(eq, &done);
3242 __ LoadRoot(ip, Heap::kFixedCOWArrayMapRootIndex);
3243 __ cmp(scratch, ip);
3244 __ b(eq, &done);
3245 // |scratch| still contains |input|'s map.
3246 __ ldr(scratch, FieldMemOperand(scratch, Map::kBitField2Offset));
3247 __ ubfx(scratch, scratch, Map::kElementsKindShift,
3248 Map::kElementsKindBitCount);
3249 __ cmp(scratch, Operand(GetInitialFastElementsKind()));
3250 __ b(lt, &fail);
3251 __ cmp(scratch, Operand(TERMINAL_FAST_ELEMENTS_KIND));
3252 __ b(le, &done);
3253 __ cmp(scratch, Operand(FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND));
3254 __ b(lt, &fail);
3255 __ cmp(scratch, Operand(LAST_EXTERNAL_ARRAY_ELEMENTS_KIND));
3256 __ b(le, &done);
3257 __ bind(&fail);
3258 __ Abort("Check for fast or external elements failed.");
3259 __ bind(&done);
3260 }
3261 }
3262
3263
3264 void LCodeGen::DoLoadExternalArrayPointer( 3230 void LCodeGen::DoLoadExternalArrayPointer(
3265 LLoadExternalArrayPointer* instr) { 3231 LLoadExternalArrayPointer* instr) {
3266 Register to_reg = ToRegister(instr->result()); 3232 Register to_reg = ToRegister(instr->result());
3267 Register from_reg = ToRegister(instr->object()); 3233 Register from_reg = ToRegister(instr->object());
3268 __ ldr(to_reg, FieldMemOperand(from_reg, 3234 __ ldr(to_reg, FieldMemOperand(from_reg,
3269 ExternalArray::kExternalPointerOffset)); 3235 ExternalArray::kExternalPointerOffset));
3270 } 3236 }
3271 3237
3272 3238
3273 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 3239 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after
6041 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6007 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6042 __ ldr(result, FieldMemOperand(scratch, 6008 __ ldr(result, FieldMemOperand(scratch,
6043 FixedArray::kHeaderSize - kPointerSize)); 6009 FixedArray::kHeaderSize - kPointerSize));
6044 __ bind(&done); 6010 __ bind(&done);
6045 } 6011 }
6046 6012
6047 6013
6048 #undef __ 6014 #undef __
6049 6015
6050 } } // namespace v8::internal 6016 } } // namespace v8::internal
OLDNEW
« .gitignore ('K') | « src/arm/lithium-arm.cc ('k') | src/code-stubs-hydrogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698