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

Side by Side Diff: src/compiler/code-generator-impl.h

Issue 1242303005: [turbofan]: Elide extra move when accessing stack or frame register (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: src/compiler/code-generator.cc Created 5 years, 5 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
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_CODE_GENERATOR_IMPL_H_ 5 #ifndef V8_COMPILER_CODE_GENERATOR_IMPL_H_
6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_ 6 #define V8_COMPILER_CODE_GENERATOR_IMPL_H_
7 7
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compiler/code-generator.h" 9 #include "src/compiler/code-generator.h"
10 #include "src/compiler/instruction.h" 10 #include "src/compiler/instruction.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 Label* ToLabel(InstructionOperand* op) { 88 Label* ToLabel(InstructionOperand* op) {
89 return gen_->GetLabel(ToRpoNumber(op)); 89 return gen_->GetLabel(ToRpoNumber(op));
90 } 90 }
91 91
92 RpoNumber ToRpoNumber(InstructionOperand* op) { 92 RpoNumber ToRpoNumber(InstructionOperand* op) {
93 return ToConstant(op).ToRpoNumber(); 93 return ToConstant(op).ToRpoNumber();
94 } 94 }
95 95
96 Register ToRegister(InstructionOperand* op) { 96 Register ToRegister(InstructionOperand* op) {
97 if (op->kind() == InstructionOperand::STACK_POINTER) {
98 return StandardFrame::sp_register();
99 }
100 if (op->kind() == InstructionOperand::FRAME_POINTER) {
101 return StandardFrame::fp_register();
102 }
97 return Register::FromAllocationIndex(RegisterOperand::cast(op)->index()); 103 return Register::FromAllocationIndex(RegisterOperand::cast(op)->index());
98 } 104 }
99 105
100 DoubleRegister ToDoubleRegister(InstructionOperand* op) { 106 DoubleRegister ToDoubleRegister(InstructionOperand* op) {
101 return DoubleRegister::FromAllocationIndex( 107 return DoubleRegister::FromAllocationIndex(
102 DoubleRegisterOperand::cast(op)->index()); 108 DoubleRegisterOperand::cast(op)->index());
103 } 109 }
104 110
105 Constant ToConstant(InstructionOperand* op) { 111 Constant ToConstant(InstructionOperand* op) {
106 if (op->IsImmediate()) { 112 if (op->IsImmediate()) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 165 #elif V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64
160 masm->ud2(); 166 masm->ud2();
161 #endif 167 #endif
162 } 168 }
163 169
164 } // namespace compiler 170 } // namespace compiler
165 } // namespace internal 171 } // namespace internal
166 } // namespace v8 172 } // namespace v8
167 173
168 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H 174 #endif // V8_COMPILER_CODE_GENERATOR_IMPL_H
OLDNEW
« no previous file with comments | « src/compiler/arm64/code-generator-arm64.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698