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

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

Issue 14022011: Improvements in lithium code generation. Recognizing if some operands are constants, we can often s… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review updates Created 7 years, 8 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/arm/lithium-arm.cc ('k') | src/ia32/lithium-codegen-ia32.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 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 3269 matching lines...) Expand 10 before | Expand all | Expand 10 after
3280 LLoadExternalArrayPointer* instr) { 3280 LLoadExternalArrayPointer* instr) {
3281 Register to_reg = ToRegister(instr->result()); 3281 Register to_reg = ToRegister(instr->result());
3282 Register from_reg = ToRegister(instr->object()); 3282 Register from_reg = ToRegister(instr->object());
3283 __ ldr(to_reg, FieldMemOperand(from_reg, 3283 __ ldr(to_reg, FieldMemOperand(from_reg,
3284 ExternalArray::kExternalPointerOffset)); 3284 ExternalArray::kExternalPointerOffset));
3285 } 3285 }
3286 3286
3287 3287
3288 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 3288 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
3289 Register arguments = ToRegister(instr->arguments()); 3289 Register arguments = ToRegister(instr->arguments());
3290 Register length = ToRegister(instr->length());
3291 Register index = ToRegister(instr->index());
3292 Register result = ToRegister(instr->result()); 3290 Register result = ToRegister(instr->result());
3293 // There are two words between the frame pointer and the last argument. 3291 if (instr->length()->IsConstantOperand() &&
3294 // Subtracting from length accounts for one of them add one more. 3292 instr->index()->IsConstantOperand()) {
3295 __ sub(length, length, index); 3293 int const_index = ToInteger32(LConstantOperand::cast(instr->index()));
3296 __ add(length, length, Operand(1)); 3294 int const_length = ToInteger32(LConstantOperand::cast(instr->length()));
3297 __ ldr(result, MemOperand(arguments, length, LSL, kPointerSizeLog2)); 3295 int index = (const_length - const_index) + 1;
3296 __ ldr(result, MemOperand(arguments, index * kPointerSize));
3297 } else {
3298 Register length = ToRegister(instr->length());
3299 Register index = ToRegister(instr->index());
3300 // There are two words between the frame pointer and the last argument.
3301 // Subtracting from length accounts for one of them add one more.
3302 __ sub(length, length, index);
3303 __ add(length, length, Operand(1));
3304 __ ldr(result, MemOperand(arguments, length, LSL, kPointerSizeLog2));
3305 }
3298 } 3306 }
3299 3307
3300 3308
3301 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { 3309 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
3302 Register external_pointer = ToRegister(instr->elements()); 3310 Register external_pointer = ToRegister(instr->elements());
3303 Register key = no_reg; 3311 Register key = no_reg;
3304 ElementsKind elements_kind = instr->elements_kind(); 3312 ElementsKind elements_kind = instr->elements_kind();
3305 bool key_is_constant = instr->key()->IsConstantOperand(); 3313 bool key_is_constant = instr->key()->IsConstantOperand();
3306 int constant_key = 0; 3314 int constant_key = 0;
3307 if (key_is_constant) { 3315 if (key_is_constant) {
(...skipping 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after
6008 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); 6016 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize));
6009 __ ldr(result, FieldMemOperand(scratch, 6017 __ ldr(result, FieldMemOperand(scratch,
6010 FixedArray::kHeaderSize - kPointerSize)); 6018 FixedArray::kHeaderSize - kPointerSize));
6011 __ bind(&done); 6019 __ bind(&done);
6012 } 6020 }
6013 6021
6014 6022
6015 #undef __ 6023 #undef __
6016 6024
6017 } } // namespace v8::internal 6025 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698