OLD | NEW |
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void RecordSafepoint(LPointerMap* pointers, | 203 void RecordSafepoint(LPointerMap* pointers, |
204 Safepoint::Kind kind, | 204 Safepoint::Kind kind, |
205 int arguments, | 205 int arguments, |
206 int deoptimization_index); | 206 int deoptimization_index); |
207 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); | 207 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); |
208 void RecordSafepoint(int deoptimization_index); | 208 void RecordSafepoint(int deoptimization_index); |
209 void RecordSafepointWithRegisters(LPointerMap* pointers, | 209 void RecordSafepointWithRegisters(LPointerMap* pointers, |
210 int arguments, | 210 int arguments, |
211 int deoptimization_index); | 211 int deoptimization_index); |
212 void RecordPosition(int position); | 212 void RecordPosition(int position); |
| 213 int LastSafepointEnd() { |
| 214 return static_cast<int>(safepoints_.GetPcAfterGap()); |
| 215 } |
213 | 216 |
214 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 217 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
215 void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL); | 218 void EmitGoto(int block, LDeferredCode* deferred_stack_check = NULL); |
216 void EmitBranch(int left_block, int right_block, Condition cc); | 219 void EmitBranch(int left_block, int right_block, Condition cc); |
217 void EmitCmpI(LOperand* left, LOperand* right); | 220 void EmitCmpI(LOperand* left, LOperand* right); |
218 void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env); | 221 void EmitNumberUntagD(Register input, XMMRegister result, LEnvironment* env); |
219 | 222 |
220 // Emits optimized code for typeof x == "y". Modifies input register. | 223 // Emits optimized code for typeof x == "y". Modifies input register. |
221 // Returns the condition on which a final split to | 224 // Returns the condition on which a final split to |
222 // true and false label should be made, to optimize fallthrough. | 225 // true and false label should be made, to optimize fallthrough. |
223 Condition EmitTypeofIs(Label* true_label, Label* false_label, | 226 Condition EmitTypeofIs(Label* true_label, Label* false_label, |
224 Register input, Handle<String> type_name); | 227 Register input, Handle<String> type_name); |
225 | 228 |
226 // Emits optimized code for %_IsObject(x). Preserves input register. | 229 // Emits optimized code for %_IsObject(x). Preserves input register. |
227 // Returns the condition on which a final split to | 230 // Returns the condition on which a final split to |
228 // true and false label should be made, to optimize fallthrough. | 231 // true and false label should be made, to optimize fallthrough. |
229 Condition EmitIsObject(Register input, | 232 Condition EmitIsObject(Register input, |
230 Label* is_not_object, | 233 Label* is_not_object, |
231 Label* is_object); | 234 Label* is_object); |
232 | 235 |
233 // Emits optimized code for %_IsConstructCall(). | 236 // Emits optimized code for %_IsConstructCall(). |
234 // Caller should branch on equal condition. | 237 // Caller should branch on equal condition. |
235 void EmitIsConstructCall(Register temp); | 238 void EmitIsConstructCall(Register temp); |
236 | 239 |
237 // Emits code for pushing a constant operand. | 240 // Emits code for pushing a constant operand. |
238 void EmitPushConstantOperand(LOperand* operand); | 241 void EmitPushConstantOperand(LOperand* operand); |
239 | 242 |
240 struct JumpTableEntry { | 243 struct JumpTableEntry { |
241 inline JumpTableEntry(Address address) | 244 inline JumpTableEntry(Address entry) |
242 : label_(), | 245 : label(), |
243 address_(address) { } | 246 address(entry) { } |
244 Label label_; | 247 Label label; |
245 Address address_; | 248 Address address; |
246 }; | 249 }; |
247 | 250 |
248 LChunk* const chunk_; | 251 LChunk* const chunk_; |
249 MacroAssembler* const masm_; | 252 MacroAssembler* const masm_; |
250 CompilationInfo* const info_; | 253 CompilationInfo* const info_; |
251 | 254 |
252 int current_block_; | 255 int current_block_; |
253 int current_instruction_; | 256 int current_instruction_; |
254 const ZoneList<LInstruction*>* instructions_; | 257 const ZoneList<LInstruction*>* instructions_; |
255 ZoneList<LEnvironment*> deoptimizations_; | 258 ZoneList<LEnvironment*> deoptimizations_; |
256 ZoneList<JumpTableEntry*> jump_table_; | 259 ZoneList<JumpTableEntry> jump_table_; |
257 ZoneList<Handle<Object> > deoptimization_literals_; | 260 ZoneList<Handle<Object> > deoptimization_literals_; |
258 int inlined_function_count_; | 261 int inlined_function_count_; |
259 Scope* const scope_; | 262 Scope* const scope_; |
260 Status status_; | 263 Status status_; |
261 TranslationBuffer translations_; | 264 TranslationBuffer translations_; |
262 ZoneList<LDeferredCode*> deferred_; | 265 ZoneList<LDeferredCode*> deferred_; |
263 int osr_pc_offset_; | 266 int osr_pc_offset_; |
264 | 267 |
265 // Builder that keeps track of safepoints in the code. The table | 268 // Builder that keeps track of safepoints in the code. The table |
266 // itself is emitted at the end of the generated code. | 269 // itself is emitted at the end of the generated code. |
(...skipping 30 matching lines...) Expand all Loading... |
297 private: | 300 private: |
298 LCodeGen* codegen_; | 301 LCodeGen* codegen_; |
299 Label entry_; | 302 Label entry_; |
300 Label exit_; | 303 Label exit_; |
301 Label* external_exit_; | 304 Label* external_exit_; |
302 }; | 305 }; |
303 | 306 |
304 } } // namespace v8::internal | 307 } } // namespace v8::internal |
305 | 308 |
306 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 309 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
OLD | NEW |