| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 current_instruction_(-1), | 54 current_instruction_(-1), |
| 55 instructions_(chunk->instructions()), | 55 instructions_(chunk->instructions()), |
| 56 deoptimizations_(4), | 56 deoptimizations_(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 dynamic_frame_alignment_(false), | 61 dynamic_frame_alignment_(false), |
| 62 deferred_(8), | 62 deferred_(8), |
| 63 osr_pc_offset_(-1), | 63 osr_pc_offset_(-1), |
| 64 deoptimization_reloc_size(), | 64 last_lazy_deopt_pc_(0), |
| 65 resolver_(this), | 65 resolver_(this), |
| 66 expected_safepoint_kind_(Safepoint::kSimple) { | 66 expected_safepoint_kind_(Safepoint::kSimple) { |
| 67 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 67 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 // Simple accessors. | 70 // Simple accessors. |
| 71 MacroAssembler* masm() const { return masm_; } | 71 MacroAssembler* masm() const { return masm_; } |
| 72 CompilationInfo* info() const { return info_; } | 72 CompilationInfo* info() const { return info_; } |
| 73 Isolate* isolate() const { return info_->isolate(); } | 73 Isolate* isolate() const { return info_->isolate(); } |
| 74 Factory* factory() const { return isolate()->factory(); } | 74 Factory* factory() const { return isolate()->factory(); } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 94 void FinishCode(Handle<Code> code); | 94 void FinishCode(Handle<Code> code); |
| 95 | 95 |
| 96 // Deferred code support. | 96 // Deferred code support. |
| 97 void DoDeferredNumberTagD(LNumberTagD* instr); | 97 void DoDeferredNumberTagD(LNumberTagD* instr); |
| 98 void DoDeferredNumberTagI(LNumberTagI* instr); | 98 void DoDeferredNumberTagI(LNumberTagI* instr); |
| 99 void DoDeferredTaggedToI(LTaggedToI* instr); | 99 void DoDeferredTaggedToI(LTaggedToI* instr); |
| 100 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); | 100 void DoDeferredMathAbsTaggedHeapNumber(LUnaryMathOperation* instr); |
| 101 void DoDeferredStackCheck(LStackCheck* instr); | 101 void DoDeferredStackCheck(LStackCheck* instr); |
| 102 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); | 102 void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr); |
| 103 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); | 103 void DoDeferredStringCharFromCode(LStringCharFromCode* instr); |
| 104 void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, | 104 void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr, |
| 105 Label* map_check); | 105 Label* map_check); |
| 106 | 106 |
| 107 // Parallel move support. | 107 // Parallel move support. |
| 108 void DoParallelMove(LParallelMove* move); | 108 void DoParallelMove(LParallelMove* move); |
| 109 void DoGap(LGap* instr); | 109 void DoGap(LGap* instr); |
| 110 | 110 |
| 111 // Emit frame translation commands for an environment. | 111 // Emit frame translation commands for an environment. |
| 112 void WriteTranslation(LEnvironment* environment, Translation* translation); | 112 void WriteTranslation(LEnvironment* environment, Translation* translation); |
| 113 | 113 |
| 114 void EnsureRelocSpaceForDeoptimization(); | 114 void EnsureRelocSpaceForDeoptimization(); |
| 115 | 115 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 137 bool dynamic_frame_alignment() const { return dynamic_frame_alignment_; } | 137 bool dynamic_frame_alignment() const { return dynamic_frame_alignment_; } |
| 138 void set_dynamic_frame_alignment(bool value) { | 138 void set_dynamic_frame_alignment(bool value) { |
| 139 dynamic_frame_alignment_ = value; | 139 dynamic_frame_alignment_ = value; |
| 140 } | 140 } |
| 141 | 141 |
| 142 LChunk* chunk() const { return chunk_; } | 142 LChunk* chunk() const { return chunk_; } |
| 143 Scope* scope() const { return scope_; } | 143 Scope* scope() const { return scope_; } |
| 144 HGraph* graph() const { return chunk_->graph(); } | 144 HGraph* graph() const { return chunk_->graph(); } |
| 145 | 145 |
| 146 int GetNextEmittedBlock(int block); | 146 int GetNextEmittedBlock(int block); |
| 147 LInstruction* GetNextInstruction(); | |
| 148 | 147 |
| 149 void EmitClassOfTest(Label* if_true, | 148 void EmitClassOfTest(Label* if_true, |
| 150 Label* if_false, | 149 Label* if_false, |
| 151 Handle<String> class_name, | 150 Handle<String> class_name, |
| 152 Register input, | 151 Register input, |
| 153 Register temporary, | 152 Register temporary, |
| 154 Register temporary2); | 153 Register temporary2); |
| 155 | 154 |
| 156 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } | 155 int GetStackSlotCount() const { return chunk()->spill_slot_count(); } |
| 157 int GetParameterCount() const { return scope()->num_parameters(); } | 156 int GetParameterCount() const { return scope()->num_parameters(); } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 202 |
| 204 // Generate a direct call to a known function. Expects the function | 203 // Generate a direct call to a known function. Expects the function |
| 205 // to be in edi. | 204 // to be in edi. |
| 206 void CallKnownFunction(Handle<JSFunction> function, | 205 void CallKnownFunction(Handle<JSFunction> function, |
| 207 int arity, | 206 int arity, |
| 208 LInstruction* instr, | 207 LInstruction* instr, |
| 209 CallKind call_kind); | 208 CallKind call_kind); |
| 210 | 209 |
| 211 void LoadHeapObject(Register result, Handle<HeapObject> object); | 210 void LoadHeapObject(Register result, Handle<HeapObject> object); |
| 212 | 211 |
| 213 void RegisterLazyDeoptimization(LInstruction* instr, | 212 void RecordSafepointWithLazyDeopt(LInstruction* instr, |
| 214 SafepointMode safepoint_mode); | 213 SafepointMode safepoint_mode); |
| 215 | 214 |
| 216 void RegisterEnvironmentForDeoptimization(LEnvironment* environment); | 215 void RegisterEnvironmentForDeoptimization(LEnvironment* environment, |
| 216 Safepoint::DeoptMode mode); |
| 217 void DeoptimizeIf(Condition cc, LEnvironment* environment); | 217 void DeoptimizeIf(Condition cc, LEnvironment* environment); |
| 218 | 218 |
| 219 void AddToTranslation(Translation* translation, | 219 void AddToTranslation(Translation* translation, |
| 220 LOperand* op, | 220 LOperand* op, |
| 221 bool is_tagged); | 221 bool is_tagged); |
| 222 void PopulateDeoptimizationData(Handle<Code> code); | 222 void PopulateDeoptimizationData(Handle<Code> code); |
| 223 int DefineDeoptimizationLiteral(Handle<Object> literal); | 223 int DefineDeoptimizationLiteral(Handle<Object> literal); |
| 224 | 224 |
| 225 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 225 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 226 | 226 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 241 void DoMathSqrt(LUnaryMathOperation* instr); | 241 void DoMathSqrt(LUnaryMathOperation* instr); |
| 242 void DoMathPowHalf(LUnaryMathOperation* instr); | 242 void DoMathPowHalf(LUnaryMathOperation* instr); |
| 243 void DoMathLog(LUnaryMathOperation* instr); | 243 void DoMathLog(LUnaryMathOperation* instr); |
| 244 void DoMathCos(LUnaryMathOperation* instr); | 244 void DoMathCos(LUnaryMathOperation* instr); |
| 245 void DoMathSin(LUnaryMathOperation* instr); | 245 void DoMathSin(LUnaryMathOperation* instr); |
| 246 | 246 |
| 247 // Support for recording safepoint and position information. | 247 // Support for recording safepoint and position information. |
| 248 void RecordSafepoint(LPointerMap* pointers, | 248 void RecordSafepoint(LPointerMap* pointers, |
| 249 Safepoint::Kind kind, | 249 Safepoint::Kind kind, |
| 250 int arguments, | 250 int arguments, |
| 251 int deoptimization_index); | 251 Safepoint::DeoptMode mode); |
| 252 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); | 252 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
| 253 void RecordSafepoint(int deoptimization_index); | 253 void RecordSafepoint(Safepoint::DeoptMode mode); |
| 254 void RecordSafepointWithRegisters(LPointerMap* pointers, | 254 void RecordSafepointWithRegisters(LPointerMap* pointers, |
| 255 int arguments, | 255 int arguments, |
| 256 int deoptimization_index); | 256 Safepoint::DeoptMode mode); |
| 257 void RecordPosition(int position); | 257 void RecordPosition(int position); |
| 258 int LastSafepointEnd() { | |
| 259 return static_cast<int>(safepoints_.GetPcAfterGap()); | |
| 260 } | |
| 261 | 258 |
| 262 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 259 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 263 void EmitGoto(int block); | 260 void EmitGoto(int block); |
| 264 void EmitBranch(int left_block, int right_block, Condition cc); | 261 void EmitBranch(int left_block, int right_block, Condition cc); |
| 265 void EmitNumberUntagD(Register input, | 262 void EmitNumberUntagD(Register input, |
| 266 XMMRegister result, | 263 XMMRegister result, |
| 267 bool deoptimize_on_undefined, | 264 bool deoptimize_on_undefined, |
| 268 LEnvironment* env); | 265 LEnvironment* env); |
| 269 | 266 |
| 270 // Emits optimized code for typeof x == "y". Modifies input register. | 267 // Emits optimized code for typeof x == "y". Modifies input register. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 284 Label* is_object); | 281 Label* is_object); |
| 285 | 282 |
| 286 // Emits optimized code for %_IsConstructCall(). | 283 // Emits optimized code for %_IsConstructCall(). |
| 287 // Caller should branch on equal condition. | 284 // Caller should branch on equal condition. |
| 288 void EmitIsConstructCall(Register temp); | 285 void EmitIsConstructCall(Register temp); |
| 289 | 286 |
| 290 void EmitLoadFieldOrConstantFunction(Register result, | 287 void EmitLoadFieldOrConstantFunction(Register result, |
| 291 Register object, | 288 Register object, |
| 292 Handle<Map> type, | 289 Handle<Map> type, |
| 293 Handle<String> name); | 290 Handle<String> name); |
| 291 void EnsureSpaceForLazyDeopt(); |
| 294 | 292 |
| 295 LChunk* const chunk_; | 293 LChunk* const chunk_; |
| 296 MacroAssembler* const masm_; | 294 MacroAssembler* const masm_; |
| 297 CompilationInfo* const info_; | 295 CompilationInfo* const info_; |
| 298 | 296 |
| 299 int current_block_; | 297 int current_block_; |
| 300 int current_instruction_; | 298 int current_instruction_; |
| 301 const ZoneList<LInstruction*>* instructions_; | 299 const ZoneList<LInstruction*>* instructions_; |
| 302 ZoneList<LEnvironment*> deoptimizations_; | 300 ZoneList<LEnvironment*> deoptimizations_; |
| 303 ZoneList<Handle<Object> > deoptimization_literals_; | 301 ZoneList<Handle<Object> > deoptimization_literals_; |
| 304 int inlined_function_count_; | 302 int inlined_function_count_; |
| 305 Scope* const scope_; | 303 Scope* const scope_; |
| 306 Status status_; | 304 Status status_; |
| 307 bool dynamic_frame_alignment_; | 305 bool dynamic_frame_alignment_; |
| 308 TranslationBuffer translations_; | 306 TranslationBuffer translations_; |
| 309 ZoneList<LDeferredCode*> deferred_; | 307 ZoneList<LDeferredCode*> deferred_; |
| 310 int osr_pc_offset_; | 308 int osr_pc_offset_; |
| 311 | 309 int last_lazy_deopt_pc_; |
| 312 struct DeoptimizationRelocSize { | |
| 313 int min_size; | |
| 314 int last_pc_offset; | |
| 315 }; | |
| 316 | |
| 317 DeoptimizationRelocSize deoptimization_reloc_size; | |
| 318 | 310 |
| 319 // Builder that keeps track of safepoints in the code. The table | 311 // Builder that keeps track of safepoints in the code. The table |
| 320 // itself is emitted at the end of the generated code. | 312 // itself is emitted at the end of the generated code. |
| 321 SafepointTableBuilder safepoints_; | 313 SafepointTableBuilder safepoints_; |
| 322 | 314 |
| 323 // 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. |
| 324 LGapResolver resolver_; | 316 LGapResolver resolver_; |
| 325 | 317 |
| 326 Safepoint::Kind expected_safepoint_kind_; | 318 Safepoint::Kind expected_safepoint_kind_; |
| 327 | 319 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 LCodeGen* codegen_; | 369 LCodeGen* codegen_; |
| 378 Label entry_; | 370 Label entry_; |
| 379 Label exit_; | 371 Label exit_; |
| 380 Label* external_exit_; | 372 Label* external_exit_; |
| 381 int instruction_index_; | 373 int instruction_index_; |
| 382 }; | 374 }; |
| 383 | 375 |
| 384 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| 385 | 377 |
| 386 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ | 378 #endif // V8_IA32_LITHIUM_CODEGEN_IA32_H_ |
| OLD | NEW |