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

Side by Side Diff: src/x64/codegen-x64.h

Issue 21123008: Introduce StackArgumentsAccessor class for X64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed nits Created 7 years, 4 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/x64/code-stubs-x64.cc ('k') | src/x64/codegen-x64.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 XMMRegister input, 96 XMMRegister input,
97 XMMRegister result, 97 XMMRegister result,
98 XMMRegister double_scratch, 98 XMMRegister double_scratch,
99 Register temp1, 99 Register temp1,
100 Register temp2); 100 Register temp2);
101 101
102 private: 102 private:
103 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator); 103 DISALLOW_COPY_AND_ASSIGN(MathExpGenerator);
104 }; 104 };
105 105
106
107 enum StackArgumentsAccessorReceiverMode {
108 ARGUMENTS_CONTAIN_RECEIVER,
109 ARGUMENTS_DONT_CONTAIN_RECEIVER
110 };
111
112
113 class StackArgumentsAccessor BASE_EMBEDDED {
114 public:
115 StackArgumentsAccessor(
116 Register base_reg,
117 int argument_count_immediate,
118 StackArgumentsAccessorReceiverMode receiver_mode =
119 ARGUMENTS_CONTAIN_RECEIVER,
120 int extra_displacement_to_last_argument = 0)
121 : base_reg_(base_reg),
122 argument_count_reg_(no_reg),
123 argument_count_immediate_(argument_count_immediate),
124 receiver_mode_(receiver_mode),
125 extra_displacement_to_last_argument_(
126 extra_displacement_to_last_argument) { }
127
128 StackArgumentsAccessor(
129 Register base_reg,
130 Register argument_count_reg,
131 StackArgumentsAccessorReceiverMode receiver_mode =
132 ARGUMENTS_CONTAIN_RECEIVER,
133 int extra_displacement_to_last_argument = 0)
134 : base_reg_(base_reg),
135 argument_count_reg_(argument_count_reg),
136 argument_count_immediate_(0),
137 receiver_mode_(receiver_mode),
138 extra_displacement_to_last_argument_(
139 extra_displacement_to_last_argument) { }
140
141 StackArgumentsAccessor(
142 Register base_reg,
143 const ParameterCount& parameter_count,
144 StackArgumentsAccessorReceiverMode receiver_mode =
145 ARGUMENTS_CONTAIN_RECEIVER,
146 int extra_displacement_to_last_argument = 0)
147 : base_reg_(base_reg),
148 argument_count_reg_(parameter_count.is_reg() ?
149 parameter_count.reg() : no_reg),
150 argument_count_immediate_(parameter_count.is_immediate() ?
151 parameter_count.immediate() : 0),
152 receiver_mode_(receiver_mode),
153 extra_displacement_to_last_argument_(
154 extra_displacement_to_last_argument) { }
155
156 Operand GetArgumentOperand(int index);
157 Operand GetReceiverOperand() {
158 ASSERT(receiver_mode_ == ARGUMENTS_CONTAIN_RECEIVER);
159 return GetArgumentOperand(0);;
160 }
161
162 private:
163 const Register base_reg_;
164 const Register argument_count_reg_;
165 const int argument_count_immediate_;
166 const StackArgumentsAccessorReceiverMode receiver_mode_;
167 const int extra_displacement_to_last_argument_;
168
169 DISALLOW_IMPLICIT_CONSTRUCTORS(StackArgumentsAccessor);
170 };
171
172
106 } } // namespace v8::internal 173 } } // namespace v8::internal
107 174
108 #endif // V8_X64_CODEGEN_X64_H_ 175 #endif // V8_X64_CODEGEN_X64_H_
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | src/x64/codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698