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

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

Issue 11365084: Some improvements in register usage in lithium compilation of LoadKeyed/StoreKeyed operations. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed a compilation error in ia32 hydrogen->lithium. Created 8 years, 1 month 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 2733 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 Register result = ToRegister(instr->result()); 2744 Register result = ToRegister(instr->result());
2745 // There are two words between the frame pointer and the last argument. 2745 // There are two words between the frame pointer and the last argument.
2746 // Subtracting from length accounts for one of them add one more. 2746 // Subtracting from length accounts for one of them add one more.
2747 __ sub(length, index); 2747 __ sub(length, index);
2748 __ mov(result, Operand(arguments, length, times_4, kPointerSize)); 2748 __ mov(result, Operand(arguments, length, times_4, kPointerSize));
2749 } 2749 }
2750 2750
2751 2751
2752 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { 2752 void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
2753 ElementsKind elements_kind = instr->elements_kind(); 2753 ElementsKind elements_kind = instr->elements_kind();
2754 LOperand* key = instr->key(); 2754 if (ExternalArrayOpRequiresTemp<HLoadKeyed>(instr->hydrogen())) {
2755 if (!key->IsConstantOperand() && 2755 __ SmiUntag(ToRegister(instr->key()));
2756 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(),
2757 elements_kind)) {
2758 __ SmiUntag(ToRegister(key));
2759 } 2756 }
2760 Operand operand(BuildFastArrayOperand( 2757 Operand operand(BuildFastArrayOperand(
2761 instr->elements(), 2758 instr->elements(),
2762 key, 2759 instr->key(),
2763 instr->hydrogen()->key()->representation(), 2760 instr->hydrogen()->key()->representation(),
2764 elements_kind, 2761 elements_kind,
2765 0, 2762 0,
2766 instr->additional_index())); 2763 instr->additional_index()));
2767 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { 2764 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) {
2768 XMMRegister result(ToDoubleRegister(instr->result())); 2765 XMMRegister result(ToDoubleRegister(instr->result()));
2769 __ movss(result, operand); 2766 __ movss(result, operand);
2770 __ cvtss2sd(result, result); 2767 __ cvtss2sd(result, result);
2771 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { 2768 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) {
2772 __ movdbl(ToDoubleRegister(instr->result()), operand); 2769 __ movdbl(ToDoubleRegister(instr->result()), operand);
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
3822 DeoptimizeIf(below_equal, instr->environment()); 3819 DeoptimizeIf(below_equal, instr->environment());
3823 } else { 3820 } else {
3824 __ cmp(ToRegister(instr->index()), ToOperand(instr->length())); 3821 __ cmp(ToRegister(instr->index()), ToOperand(instr->length()));
3825 DeoptimizeIf(above_equal, instr->environment()); 3822 DeoptimizeIf(above_equal, instr->environment());
3826 } 3823 }
3827 } 3824 }
3828 3825
3829 3826
3830 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { 3827 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
3831 ElementsKind elements_kind = instr->elements_kind(); 3828 ElementsKind elements_kind = instr->elements_kind();
3832 LOperand* key = instr->key(); 3829 if (ExternalArrayOpRequiresTemp<HStoreKeyed>(instr->hydrogen())) {
3833 if (!key->IsConstantOperand() && 3830 __ SmiUntag(ToRegister(instr->key()));
3834 ExternalArrayOpRequiresTemp(instr->hydrogen()->key()->representation(),
3835 elements_kind)) {
3836 __ SmiUntag(ToRegister(key));
3837 } 3831 }
3838 Operand operand(BuildFastArrayOperand( 3832 Operand operand(BuildFastArrayOperand(
3839 instr->elements(), 3833 instr->elements(),
3840 key, 3834 instr->key(),
3841 instr->hydrogen()->key()->representation(), 3835 instr->hydrogen()->key()->representation(),
3842 elements_kind, 3836 elements_kind,
3843 0, 3837 0,
3844 instr->additional_index())); 3838 instr->additional_index()));
3845 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) { 3839 if (elements_kind == EXTERNAL_FLOAT_ELEMENTS) {
3846 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value())); 3840 __ cvtsd2ss(xmm0, ToDoubleRegister(instr->value()));
3847 __ movss(operand, xmm0); 3841 __ movss(operand, xmm0);
3848 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) { 3842 } else if (elements_kind == EXTERNAL_DOUBLE_ELEMENTS) {
3849 __ movdbl(operand, ToDoubleRegister(instr->value())); 3843 __ movdbl(operand, ToDoubleRegister(instr->value()));
3850 } else { 3844 } else {
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
5556 FixedArray::kHeaderSize - kPointerSize)); 5550 FixedArray::kHeaderSize - kPointerSize));
5557 __ bind(&done); 5551 __ bind(&done);
5558 } 5552 }
5559 5553
5560 5554
5561 #undef __ 5555 #undef __
5562 5556
5563 } } // namespace v8::internal 5557 } } // namespace v8::internal
5564 5558
5565 #endif // V8_TARGET_ARCH_IA32 5559 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698