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

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

Issue 8587008: MIPS: Fix lazy deoptimization at HInvokeFunction and enable target-recording call-function stub. (Closed)
Patch Set: Created 9 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
« no previous file with comments | « src/mips/deoptimizer-mips.cc ('k') | src/mips/lithium-codegen-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 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 current_instruction_(-1), 51 current_instruction_(-1),
52 instructions_(chunk->instructions()), 52 instructions_(chunk->instructions()),
53 deoptimizations_(4), 53 deoptimizations_(4),
54 deopt_jump_table_(4), 54 deopt_jump_table_(4),
55 deoptimization_literals_(8), 55 deoptimization_literals_(8),
56 inlined_function_count_(0), 56 inlined_function_count_(0),
57 scope_(info->scope()), 57 scope_(info->scope()),
58 status_(UNUSED), 58 status_(UNUSED),
59 deferred_(8), 59 deferred_(8),
60 osr_pc_offset_(-1), 60 osr_pc_offset_(-1),
61 last_lazy_deopt_pc_(0),
61 resolver_(this), 62 resolver_(this),
62 expected_safepoint_kind_(Safepoint::kSimple) { 63 expected_safepoint_kind_(Safepoint::kSimple) {
63 PopulateDeoptimizationLiteralsWithInlinedFunctions(); 64 PopulateDeoptimizationLiteralsWithInlinedFunctions();
64 } 65 }
65 66
66 67
67 // Simple accessors. 68 // Simple accessors.
68 MacroAssembler* masm() const { return masm_; } 69 MacroAssembler* masm() const { return masm_; }
69 CompilationInfo* info() const { return info_; } 70 CompilationInfo* info() const { return info_; }
70 Isolate* isolate() const { return info_->isolate(); } 71 Isolate* isolate() const { return info_->isolate(); }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 template<int T> 106 template<int T>
106 void DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr, 107 void DoDeferredBinaryOpStub(LTemplateInstruction<1, 2, T>* instr,
107 Token::Value op); 108 Token::Value op);
108 void DoDeferredNumberTagD(LNumberTagD* instr); 109 void DoDeferredNumberTagD(LNumberTagD* instr);
109 void DoDeferredNumberTagI(LNumberTagI* instr); 110 void DoDeferredNumberTagI(LNumberTagI* instr);
110 void DoDeferredTaggedToI(LTaggedToI* instr); 111 void DoDeferredTaggedToI(LTaggedToI* instr);
111 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); 112 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr);
112 void DoDeferredStackCheck(LStackCheck* instr); 113 void DoDeferredStackCheck(LStackCheck* instr);
113 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); 114 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
114 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); 115 void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
115 void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, 116 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
116 Label* map_check); 117 Label* map_check);
117 118
118 // Parallel move support. 119 // Parallel move support.
119 void DoParallelMove(LParallelMove* move); 120 void DoParallelMove(LParallelMove* move);
120 void DoGap(LGap* instr); 121 void DoGap(LGap* instr);
121 122
122 // Emit frame translation commands for an environment. 123 // Emit frame translation commands for an environment.
123 void WriteTranslation(LEnvironment* environment, Translation* translation); 124 void WriteTranslation(LEnvironment* environment, Translation* translation);
124 125
125 // Declare methods that deal with the individual node types. 126 // Declare methods that deal with the individual node types.
126 #define DECLARE_DO(type) void Do##type(L##type* node); 127 #define DECLARE_DO(type) void Do##type(L##type* node);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 210
210 // Generate a direct call to a known function. Expects the function 211 // Generate a direct call to a known function. Expects the function
211 // to be in a1. 212 // to be in a1.
212 void CallKnownFunction(Handle<JSFunction> function, 213 void CallKnownFunction(Handle<JSFunction> function,
213 int arity, 214 int arity,
214 LInstruction* instr, 215 LInstruction* instr,
215 CallKind call_kind); 216 CallKind call_kind);
216 217
217 void LoadHeapObject(Register result, Handle<HeapObject> object); 218 void LoadHeapObject(Register result, Handle<HeapObject> object);
218 219
219 void RegisterLazyDeoptimization(LInstruction* instr, 220 void RecordSafepointWithLazyDeopt(LInstruction* instr,
220 SafepointMode safepoint_mode); 221 SafepointMode safepoint_mode);
221 222
222 void RegisterEnvironmentForDeoptimization(LEnvironment* environment); 223 void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
224 Safepoint::DeoptMode mode);
223 void DeoptimizeIf(Condition cc, 225 void DeoptimizeIf(Condition cc,
224 LEnvironment* environment, 226 LEnvironment* environment,
225 Register src1, 227 Register src1,
226 const Operand& src2); 228 const Operand& src2);
227 229
228 void AddToTranslation(Translation* translation, 230 void AddToTranslation(Translation* translation,
229 LOperand* op, 231 LOperand* op,
230 bool is_tagged); 232 bool is_tagged);
231 void PopulateDeoptimizationData(Handle<Code> code); 233 void PopulateDeoptimizationData(Handle<Code> code);
232 int DefineDeoptimizationLiteral(Handle<Object> literal); 234 int DefineDeoptimizationLiteral(Handle<Object> literal);
(...skipping 11 matching lines...) Expand all
244 void DoMathSqrt(LUnaryMathOperation* instr); 246 void DoMathSqrt(LUnaryMathOperation* instr);
245 void DoMathPowHalf(LUnaryMathOperation* instr); 247 void DoMathPowHalf(LUnaryMathOperation* instr);
246 void DoMathLog(LUnaryMathOperation* instr); 248 void DoMathLog(LUnaryMathOperation* instr);
247 void DoMathCos(LUnaryMathOperation* instr); 249 void DoMathCos(LUnaryMathOperation* instr);
248 void DoMathSin(LUnaryMathOperation* instr); 250 void DoMathSin(LUnaryMathOperation* instr);
249 251
250 // Support for recording safepoint and position information. 252 // Support for recording safepoint and position information.
251 void RecordSafepoint(LPointerMap* pointers, 253 void RecordSafepoint(LPointerMap* pointers,
252 Safepoint::Kind kind, 254 Safepoint::Kind kind,
253 int arguments, 255 int arguments,
254 int deoptimization_index); 256 Safepoint::DeoptMode mode);
255 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); 257 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode);
256 void RecordSafepoint(int deoptimization_index); 258 void RecordSafepoint(Safepoint::DeoptMode mode);
257 void RecordSafepointWithRegisters(LPointerMap* pointers, 259 void RecordSafepointWithRegisters(LPointerMap* pointers,
258 int arguments, 260 int arguments,
259 int deoptimization_index); 261 Safepoint::DeoptMode mode);
260 void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers, 262 void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
261 int arguments, 263 int arguments,
262 int deoptimization_index); 264 Safepoint::DeoptMode mode);
263 void RecordPosition(int position); 265 void RecordPosition(int position);
264 int LastSafepointEnd() {
265 return static_cast<int>(safepoints_.GetPcAfterGap());
266 }
267 266
268 static Condition TokenToCondition(Token::Value op, bool is_unsigned); 267 static Condition TokenToCondition(Token::Value op, bool is_unsigned);
269 void EmitGoto(int block); 268 void EmitGoto(int block);
270 void EmitBranch(int left_block, 269 void EmitBranch(int left_block,
271 int right_block, 270 int right_block,
272 Condition cc, 271 Condition cc,
273 Register src1, 272 Register src1,
274 const Operand& src2); 273 const Operand& src2);
275 void EmitBranchF(int left_block, 274 void EmitBranchF(int left_block,
276 int right_block, 275 int right_block,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 Handle<String> name); 312 Handle<String> name);
314 313
315 struct JumpTableEntry { 314 struct JumpTableEntry {
316 explicit inline JumpTableEntry(Address entry) 315 explicit inline JumpTableEntry(Address entry)
317 : label(), 316 : label(),
318 address(entry) { } 317 address(entry) { }
319 Label label; 318 Label label;
320 Address address; 319 Address address;
321 }; 320 };
322 321
322 void EnsureSpaceForLazyDeopt();
323
323 LChunk* const chunk_; 324 LChunk* const chunk_;
324 MacroAssembler* const masm_; 325 MacroAssembler* const masm_;
325 CompilationInfo* const info_; 326 CompilationInfo* const info_;
326 327
327 int current_block_; 328 int current_block_;
328 int current_instruction_; 329 int current_instruction_;
329 const ZoneList<LInstruction*>* instructions_; 330 const ZoneList<LInstruction*>* instructions_;
330 ZoneList<LEnvironment*> deoptimizations_; 331 ZoneList<LEnvironment*> deoptimizations_;
331 ZoneList<JumpTableEntry> deopt_jump_table_; 332 ZoneList<JumpTableEntry> deopt_jump_table_;
332 ZoneList<Handle<Object> > deoptimization_literals_; 333 ZoneList<Handle<Object> > deoptimization_literals_;
333 int inlined_function_count_; 334 int inlined_function_count_;
334 Scope* const scope_; 335 Scope* const scope_;
335 Status status_; 336 Status status_;
336 TranslationBuffer translations_; 337 TranslationBuffer translations_;
337 ZoneList<LDeferredCode*> deferred_; 338 ZoneList<LDeferredCode*> deferred_;
338 int osr_pc_offset_; 339 int osr_pc_offset_;
340 int last_lazy_deopt_pc_;
339 341
340 // Builder that keeps track of safepoints in the code. The table 342 // Builder that keeps track of safepoints in the code. The table
341 // itself is emitted at the end of the generated code. 343 // itself is emitted at the end of the generated code.
342 SafepointTableBuilder safepoints_; 344 SafepointTableBuilder safepoints_;
343 345
344 // Compiler from a set of parallel moves to a sequential list of moves. 346 // Compiler from a set of parallel moves to a sequential list of moves.
345 LGapResolver resolver_; 347 LGapResolver resolver_;
346 348
347 Safepoint::Kind expected_safepoint_kind_; 349 Safepoint::Kind expected_safepoint_kind_;
348 350
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 LCodeGen* codegen_; 421 LCodeGen* codegen_;
420 Label entry_; 422 Label entry_;
421 Label exit_; 423 Label exit_;
422 Label* external_exit_; 424 Label* external_exit_;
423 int instruction_index_; 425 int instruction_index_;
424 }; 426 };
425 427
426 } } // namespace v8::internal 428 } } // namespace v8::internal
427 429
428 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ 430 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_
OLDNEW
« no previous file with comments | « src/mips/deoptimizer-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698