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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 current_instruction_(-1), | 53 current_instruction_(-1), |
54 instructions_(chunk->instructions()), | 54 instructions_(chunk->instructions()), |
55 deoptimizations_(4), | 55 deoptimizations_(4), |
56 jump_table_(4), | 56 jump_table_(4), |
57 deoptimization_literals_(8), | 57 deoptimization_literals_(8), |
58 inlined_function_count_(0), | 58 inlined_function_count_(0), |
59 scope_(info->scope()), | 59 scope_(info->scope()), |
60 status_(UNUSED), | 60 status_(UNUSED), |
61 deferred_(8), | 61 deferred_(8), |
62 osr_pc_offset_(-1), | 62 osr_pc_offset_(-1), |
| 63 last_lazy_deopt_pc_(0), |
63 resolver_(this), | 64 resolver_(this), |
64 expected_safepoint_kind_(Safepoint::kSimple) { | 65 expected_safepoint_kind_(Safepoint::kSimple) { |
65 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 66 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
66 } | 67 } |
67 | 68 |
68 // Simple accessors. | 69 // Simple accessors. |
69 MacroAssembler* masm() const { return masm_; } | 70 MacroAssembler* masm() const { return masm_; } |
70 CompilationInfo* info() const { return info_; } | 71 CompilationInfo* info() const { return info_; } |
71 Isolate* isolate() const { return info_->isolate(); } | 72 Isolate* isolate() const { return info_->isolate(); } |
72 Factory* factory() const { return isolate()->factory(); } | 73 Factory* factory() const { return isolate()->factory(); } |
(...skipping 18 matching lines...) Expand all Loading... |
91 // information on it. | 92 // information on it. |
92 void FinishCode(Handle<Code> code); | 93 void FinishCode(Handle<Code> code); |
93 | 94 |
94 // Deferred code support. | 95 // Deferred code support. |
95 void DoDeferredNumberTagD(LNumberTagD* instr); | 96 void DoDeferredNumberTagD(LNumberTagD* instr); |
96 void DoDeferredTaggedToI(LTaggedToI* instr); | 97 void DoDeferredTaggedToI(LTaggedToI* instr); |
97 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); | 98 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); |
98 void DoDeferredStackCheck(LStackCheck* instr); | 99 void DoDeferredStackCheck(LStackCheck* instr); |
99 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 100 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
100 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 101 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
101 void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 102 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
102 Label* map_check); | 103 Label* map_check); |
103 | 104 |
104 // Parallel move support. | 105 // Parallel move support. |
105 void DoParallelMove(LParallelMove* move); | 106 void DoParallelMove(LParallelMove* move); |
106 void DoGap(LGap* instr); | 107 void DoGap(LGap* instr); |
107 | 108 |
108 // Emit frame translation commands for an environment. | 109 // Emit frame translation commands for an environment. |
109 void WriteTranslation(LEnvironment* environment, Translation* translation); | 110 void WriteTranslation(LEnvironment* environment, Translation* translation); |
110 | 111 |
111 // Declare methods that deal with the individual node types. | 112 // Declare methods that deal with the individual node types. |
112 #define DECLARE_DO(type) void Do##type(L##type* node); | 113 #define DECLARE_DO(type) void Do##type(L##type* node); |
(...skipping 15 matching lines...) Expand all Loading... |
128 | 129 |
129 StrictModeFlag strict_mode_flag() const { | 130 StrictModeFlag strict_mode_flag() const { |
130 return info()->strict_mode_flag(); | 131 return info()->strict_mode_flag(); |
131 } | 132 } |
132 | 133 |
133 LChunk* chunk() const { return chunk_; } | 134 LChunk* chunk() const { return chunk_; } |
134 Scope* scope() const { return scope_; } | 135 Scope* scope() const { return scope_; } |
135 HGraph* graph() const { return chunk_->graph(); } | 136 HGraph* graph() const { return chunk_->graph(); } |
136 | 137 |
137 int GetNextEmittedBlock(int block); | 138 int GetNextEmittedBlock(int block); |
138 LInstruction* GetNextInstruction(); | |
139 | 139 |
140 void EmitClassOfTest(Label* if_true, | 140 void EmitClassOfTest(Label* if_true, |
141 Label* if_false, | 141 Label* if_false, |
142 Handle<String> class_name, | 142 Handle<String> class_name, |
143 Register input, | 143 Register input, |
144 Register temporary, | 144 Register temporary, |
145 Register scratch); | 145 Register scratch); |
146 | 146 |
147 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 147 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
148 int GetParameterCount() const { return scope()->num_parameters(); } | 148 int GetParameterCount() const { return scope()->num_parameters(); } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 // Generate a direct call to a known function. Expects the function | 194 // Generate a direct call to a known function. Expects the function |
195 // to be in rdi. | 195 // to be in rdi. |
196 void CallKnownFunction(Handle<JSFunction> function, | 196 void CallKnownFunction(Handle<JSFunction> function, |
197 int arity, | 197 int arity, |
198 LInstruction* instr, | 198 LInstruction* instr, |
199 CallKind call_kind); | 199 CallKind call_kind); |
200 | 200 |
201 void LoadHeapObject(Register result, Handle<HeapObject> object); | 201 void LoadHeapObject(Register result, Handle<HeapObject> object); |
202 | 202 |
203 void RegisterLazyDeoptimization(LInstruction* instr, | 203 void RecordSafepointWithLazyDeopt(LInstruction* instr, |
204 SafepointMode safepoint_mode, | 204 SafepointMode safepoint_mode, |
205 int argc); | 205 int argc); |
206 void RegisterEnvironmentForDeoptimization(LEnvironment* environment); | 206 void RegisterEnvironmentForDeoptimization(LEnvironment* environment, |
| 207 Safepoint::DeoptMode mode); |
207 void DeoptimizeIf(Condition cc, LEnvironment* environment); | 208 void DeoptimizeIf(Condition cc, LEnvironment* environment); |
208 | 209 |
209 void AddToTranslation(Translation* translation, | 210 void AddToTranslation(Translation* translation, |
210 LOperand* op, | 211 LOperand* op, |
211 bool is_tagged); | 212 bool is_tagged); |
212 void PopulateDeoptimizationData(Handle<Code> code); | 213 void PopulateDeoptimizationData(Handle<Code> code); |
213 int DefineDeoptimizationLiteral(Handle<Object> literal); | 214 int DefineDeoptimizationLiteral(Handle<Object> literal); |
214 | 215 |
215 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 216 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
216 | 217 |
(...skipping 13 matching lines...) Expand all Loading... |
230 void DoMathSqrt(LUnaryMathOperation* instr); | 231 void DoMathSqrt(LUnaryMathOperation* instr); |
231 void DoMathPowHalf(LUnaryMathOperation* instr); | 232 void DoMathPowHalf(LUnaryMathOperation* instr); |
232 void DoMathLog(LUnaryMathOperation* instr); | 233 void DoMathLog(LUnaryMathOperation* instr); |
233 void DoMathCos(LUnaryMathOperation* instr); | 234 void DoMathCos(LUnaryMathOperation* instr); |
234 void DoMathSin(LUnaryMathOperation* instr); | 235 void DoMathSin(LUnaryMathOperation* instr); |
235 | 236 |
236 // Support for recording safepoint and position information. | 237 // Support for recording safepoint and position information. |
237 void RecordSafepoint(LPointerMap* pointers, | 238 void RecordSafepoint(LPointerMap* pointers, |
238 Safepoint::Kind kind, | 239 Safepoint::Kind kind, |
239 int arguments, | 240 int arguments, |
240 int deoptimization_index); | 241 Safepoint::DeoptMode mode); |
241 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); | 242 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
242 void RecordSafepoint(int deoptimization_index); | 243 void RecordSafepoint(Safepoint::DeoptMode mode); |
243 void RecordSafepointWithRegisters(LPointerMap* pointers, | 244 void RecordSafepointWithRegisters(LPointerMap* pointers, |
244 int arguments, | 245 int arguments, |
245 int deoptimization_index); | 246 Safepoint::DeoptMode mode); |
246 void RecordPosition(int position); | 247 void RecordPosition(int position); |
247 int LastSafepointEnd() { | |
248 return static_cast<int>(safepoints_.GetPcAfterGap()); | |
249 } | |
250 | 248 |
251 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 249 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
252 void EmitGoto(int block); | 250 void EmitGoto(int block); |
253 void EmitBranch(int left_block, int right_block, Condition cc); | 251 void EmitBranch(int left_block, int right_block, Condition cc); |
254 void EmitNumberUntagD(Register input, | 252 void EmitNumberUntagD(Register input, |
255 XMMRegister result, | 253 XMMRegister result, |
256 bool deoptimize_on_undefined, | 254 bool deoptimize_on_undefined, |
257 LEnvironment* env); | 255 LEnvironment* env); |
258 | 256 |
259 // Emits optimized code for typeof x == "y". Modifies input register. | 257 // Emits optimized code for typeof x == "y". Modifies input register. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 const ZoneList<LInstruction*>* instructions_; | 299 const ZoneList<LInstruction*>* instructions_; |
302 ZoneList<LEnvironment*> deoptimizations_; | 300 ZoneList<LEnvironment*> deoptimizations_; |
303 ZoneList<JumpTableEntry> jump_table_; | 301 ZoneList<JumpTableEntry> jump_table_; |
304 ZoneList<Handle<Object> > deoptimization_literals_; | 302 ZoneList<Handle<Object> > deoptimization_literals_; |
305 int inlined_function_count_; | 303 int inlined_function_count_; |
306 Scope* const scope_; | 304 Scope* const scope_; |
307 Status status_; | 305 Status status_; |
308 TranslationBuffer translations_; | 306 TranslationBuffer translations_; |
309 ZoneList<LDeferredCode*> deferred_; | 307 ZoneList<LDeferredCode*> deferred_; |
310 int osr_pc_offset_; | 308 int osr_pc_offset_; |
| 309 int last_lazy_deopt_pc_; |
311 | 310 |
312 // Builder that keeps track of safepoints in the code. The table | 311 // Builder that keeps track of safepoints in the code. The table |
313 // itself is emitted at the end of the generated code. | 312 // itself is emitted at the end of the generated code. |
314 SafepointTableBuilder safepoints_; | 313 SafepointTableBuilder safepoints_; |
315 | 314 |
316 // Compiler from a set of parallel moves to a sequential list of moves. | 315 // Compiler from a set of parallel moves to a sequential list of moves. |
317 LGapResolver resolver_; | 316 LGapResolver resolver_; |
318 | 317 |
319 Safepoint::Kind expected_safepoint_kind_; | 318 Safepoint::Kind expected_safepoint_kind_; |
320 | 319 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 LCodeGen* codegen_; | 369 LCodeGen* codegen_; |
371 Label entry_; | 370 Label entry_; |
372 Label exit_; | 371 Label exit_; |
373 Label* external_exit_; | 372 Label* external_exit_; |
374 int instruction_index_; | 373 int instruction_index_; |
375 }; | 374 }; |
376 | 375 |
377 } } // namespace v8::internal | 376 } } // namespace v8::internal |
378 | 377 |
379 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ | 378 #endif // V8_X64_LITHIUM_CODEGEN_X64_H_ |
OLD | NEW |