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

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

Issue 14159015: MIPS: Improvements in lithium code generation. Recognizing if some operands are constants, we can o… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | src/mips/lithium-mips.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 2855 matching lines...) Expand 10 before | Expand all | Expand 10 after
2866 LLoadExternalArrayPointer* instr) { 2866 LLoadExternalArrayPointer* instr) {
2867 Register to_reg = ToRegister(instr->result()); 2867 Register to_reg = ToRegister(instr->result());
2868 Register from_reg = ToRegister(instr->object()); 2868 Register from_reg = ToRegister(instr->object());
2869 __ lw(to_reg, FieldMemOperand(from_reg, 2869 __ lw(to_reg, FieldMemOperand(from_reg,
2870 ExternalArray::kExternalPointerOffset)); 2870 ExternalArray::kExternalPointerOffset));
2871 } 2871 }
2872 2872
2873 2873
2874 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { 2874 void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) {
2875 Register arguments = ToRegister(instr->arguments()); 2875 Register arguments = ToRegister(instr->arguments());
2876 Register length = ToRegister(instr->length());
2877 Register index = ToRegister(instr->index());
2878 Register result = ToRegister(instr->result()); 2876 Register result = ToRegister(instr->result());
2879 // There are two words between the frame pointer and the last argument. 2877 if (instr->length()->IsConstantOperand() &&
2880 // Subtracting from length accounts for one of them, add one more. 2878 instr->index()->IsConstantOperand()) {
2881 __ subu(length, length, index); 2879 int const_index = ToInteger32(LConstantOperand::cast(instr->index()));
2882 __ Addu(length, length, Operand(1)); 2880 int const_length = ToInteger32(LConstantOperand::cast(instr->length()));
2883 __ sll(length, length, kPointerSizeLog2); 2881 int index = (const_length - const_index) + 1;
2884 __ Addu(at, arguments, Operand(length)); 2882 __ lw(result, MemOperand(arguments, index * kPointerSize));
2885 __ lw(result, MemOperand(at, 0)); 2883 } else {
2884 Register length = ToRegister(instr->length());
2885 Register index = ToRegister(instr->index());
2886 // There are two words between the frame pointer and the last argument.
2887 // Subtracting from length accounts for one of them, add one more.
2888 __ subu(length, length, index);
2889 __ Addu(length, length, Operand(1));
2890 __ sll(length, length, kPointerSizeLog2);
2891 __ Addu(at, arguments, Operand(length));
2892 __ lw(result, MemOperand(at, 0));
2893 }
2886 } 2894 }
2887 2895
2888 2896
2889 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { 2897 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
2890 Register external_pointer = ToRegister(instr->elements()); 2898 Register external_pointer = ToRegister(instr->elements());
2891 Register key = no_reg; 2899 Register key = no_reg;
2892 ElementsKind elements_kind = instr->elements_kind(); 2900 ElementsKind elements_kind = instr->elements_kind();
2893 bool key_is_constant = instr->key()->IsConstantOperand(); 2901 bool key_is_constant = instr->key()->IsConstantOperand();
2894 int constant_key = 0; 2902 int constant_key = 0;
2895 if (key_is_constant) { 2903 if (key_is_constant) {
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
5710 __ Subu(scratch, result, scratch); 5718 __ Subu(scratch, result, scratch);
5711 __ lw(result, FieldMemOperand(scratch, 5719 __ lw(result, FieldMemOperand(scratch,
5712 FixedArray::kHeaderSize - kPointerSize)); 5720 FixedArray::kHeaderSize - kPointerSize));
5713 __ bind(&done); 5721 __ bind(&done);
5714 } 5722 }
5715 5723
5716 5724
5717 #undef __ 5725 #undef __
5718 5726
5719 } } // namespace v8::internal 5727 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/mips/lithium-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698