| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 | 209 |
| 209 // Generate a direct call to a known function. Expects the function | 210 // Generate a direct call to a known function. Expects the function |
| 210 // to be in r1. | 211 // to be in r1. |
| 211 void CallKnownFunction(Handle<JSFunction> function, | 212 void CallKnownFunction(Handle<JSFunction> function, |
| 212 int arity, | 213 int arity, |
| 213 LInstruction* instr, | 214 LInstruction* instr, |
| 214 CallKind call_kind); | 215 CallKind call_kind); |
| 215 | 216 |
| 216 void LoadHeapObject(Register result, Handle<HeapObject> object); | 217 void LoadHeapObject(Register result, Handle<HeapObject> object); |
| 217 | 218 |
| 218 void RegisterLazyDeoptimization(LInstruction* instr, | 219 void RecordSafepointWithLazyDeopt(LInstruction* instr, |
| 219 SafepointMode safepoint_mode); | 220 SafepointMode safepoint_mode); |
| 220 | 221 |
| 221 void RegisterEnvironmentForDeoptimization(LEnvironment* environment); | 222 void RegisterEnvironmentForDeoptimization(LEnvironment* environment, |
| 223 Safepoint::DeoptMode mode); |
| 222 void DeoptimizeIf(Condition cc, LEnvironment* environment); | 224 void DeoptimizeIf(Condition cc, LEnvironment* environment); |
| 223 | 225 |
| 224 void AddToTranslation(Translation* translation, | 226 void AddToTranslation(Translation* translation, |
| 225 LOperand* op, | 227 LOperand* op, |
| 226 bool is_tagged); | 228 bool is_tagged); |
| 227 void PopulateDeoptimizationData(Handle<Code> code); | 229 void PopulateDeoptimizationData(Handle<Code> code); |
| 228 int DefineDeoptimizationLiteral(Handle<Object> literal); | 230 int DefineDeoptimizationLiteral(Handle<Object> literal); |
| 229 | 231 |
| 230 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 232 void PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
| 231 | 233 |
| 232 Register ToRegister(int index) const; | 234 Register ToRegister(int index) const; |
| 233 DoubleRegister ToDoubleRegister(int index) const; | 235 DoubleRegister ToDoubleRegister(int index) const; |
| 234 | 236 |
| 235 // Specific math operations - used from DoUnaryMathOperation. | 237 // Specific math operations - used from DoUnaryMathOperation. |
| 236 void EmitIntegerMathAbs(LUnaryMathOperation* instr); | 238 void EmitIntegerMathAbs(LUnaryMathOperation* instr); |
| 237 void DoMathAbs(LUnaryMathOperation* instr); | 239 void DoMathAbs(LUnaryMathOperation* instr); |
| 238 void DoMathFloor(LUnaryMathOperation* instr); | 240 void DoMathFloor(LUnaryMathOperation* instr); |
| 239 void DoMathRound(LUnaryMathOperation* instr); | 241 void DoMathRound(LUnaryMathOperation* instr); |
| 240 void DoMathSqrt(LUnaryMathOperation* instr); | 242 void DoMathSqrt(LUnaryMathOperation* instr); |
| 241 void DoMathPowHalf(LUnaryMathOperation* instr); | 243 void DoMathPowHalf(LUnaryMathOperation* instr); |
| 242 void DoMathLog(LUnaryMathOperation* instr); | 244 void DoMathLog(LUnaryMathOperation* instr); |
| 243 void DoMathCos(LUnaryMathOperation* instr); | 245 void DoMathCos(LUnaryMathOperation* instr); |
| 244 void DoMathSin(LUnaryMathOperation* instr); | 246 void DoMathSin(LUnaryMathOperation* instr); |
| 245 | 247 |
| 246 // Support for recording safepoint and position information. | 248 // Support for recording safepoint and position information. |
| 247 void RecordSafepoint(LPointerMap* pointers, | 249 void RecordSafepoint(LPointerMap* pointers, |
| 248 Safepoint::Kind kind, | 250 Safepoint::Kind kind, |
| 249 int arguments, | 251 int arguments, |
| 250 int deoptimization_index); | 252 Safepoint::DeoptMode mode); |
| 251 void RecordSafepoint(LPointerMap* pointers, int deoptimization_index); | 253 void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode); |
| 252 void RecordSafepoint(int deoptimization_index); | 254 void RecordSafepoint(Safepoint::DeoptMode mode); |
| 253 void RecordSafepointWithRegisters(LPointerMap* pointers, | 255 void RecordSafepointWithRegisters(LPointerMap* pointers, |
| 254 int arguments, | 256 int arguments, |
| 255 int deoptimization_index); | 257 Safepoint::DeoptMode mode); |
| 256 void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers, | 258 void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers, |
| 257 int arguments, | 259 int arguments, |
| 258 int deoptimization_index); | 260 Safepoint::DeoptMode mode); |
| 259 void RecordPosition(int position); | 261 void RecordPosition(int position); |
| 260 int LastSafepointEnd() { | |
| 261 return static_cast<int>(safepoints_.GetPcAfterGap()); | |
| 262 } | |
| 263 | 262 |
| 264 static Condition TokenToCondition(Token::Value op, bool is_unsigned); | 263 static Condition TokenToCondition(Token::Value op, bool is_unsigned); |
| 265 void EmitGoto(int block); | 264 void EmitGoto(int block); |
| 266 void EmitBranch(int left_block, int right_block, Condition cc); | 265 void EmitBranch(int left_block, int right_block, Condition cc); |
| 267 void EmitNumberUntagD(Register input, | 266 void EmitNumberUntagD(Register input, |
| 268 DoubleRegister result, | 267 DoubleRegister result, |
| 269 bool deoptimize_on_undefined, | 268 bool deoptimize_on_undefined, |
| 270 LEnvironment* env); | 269 LEnvironment* env); |
| 271 | 270 |
| 272 // Emits optimized code for typeof x == "y". Modifies input register. | 271 // Emits optimized code for typeof x == "y". Modifies input register. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 295 Handle<String> name); | 294 Handle<String> name); |
| 296 | 295 |
| 297 struct JumpTableEntry { | 296 struct JumpTableEntry { |
| 298 explicit inline JumpTableEntry(Address entry) | 297 explicit inline JumpTableEntry(Address entry) |
| 299 : label(), | 298 : label(), |
| 300 address(entry) { } | 299 address(entry) { } |
| 301 Label label; | 300 Label label; |
| 302 Address address; | 301 Address address; |
| 303 }; | 302 }; |
| 304 | 303 |
| 304 void EnsureSpaceForLazyDeopt(); |
| 305 |
| 305 LChunk* const chunk_; | 306 LChunk* const chunk_; |
| 306 MacroAssembler* const masm_; | 307 MacroAssembler* const masm_; |
| 307 CompilationInfo* const info_; | 308 CompilationInfo* const info_; |
| 308 | 309 |
| 309 int current_block_; | 310 int current_block_; |
| 310 int current_instruction_; | 311 int current_instruction_; |
| 311 const ZoneList<LInstruction*>* instructions_; | 312 const ZoneList<LInstruction*>* instructions_; |
| 312 ZoneList<LEnvironment*> deoptimizations_; | 313 ZoneList<LEnvironment*> deoptimizations_; |
| 313 ZoneList<JumpTableEntry> deopt_jump_table_; | 314 ZoneList<JumpTableEntry> deopt_jump_table_; |
| 314 ZoneList<Handle<Object> > deoptimization_literals_; | 315 ZoneList<Handle<Object> > deoptimization_literals_; |
| 315 int inlined_function_count_; | 316 int inlined_function_count_; |
| 316 Scope* const scope_; | 317 Scope* const scope_; |
| 317 Status status_; | 318 Status status_; |
| 318 TranslationBuffer translations_; | 319 TranslationBuffer translations_; |
| 319 ZoneList<LDeferredCode*> deferred_; | 320 ZoneList<LDeferredCode*> deferred_; |
| 320 int osr_pc_offset_; | 321 int osr_pc_offset_; |
| 322 int last_lazy_deopt_pc_; |
| 321 | 323 |
| 322 // Builder that keeps track of safepoints in the code. The table | 324 // Builder that keeps track of safepoints in the code. The table |
| 323 // itself is emitted at the end of the generated code. | 325 // itself is emitted at the end of the generated code. |
| 324 SafepointTableBuilder safepoints_; | 326 SafepointTableBuilder safepoints_; |
| 325 | 327 |
| 326 // Compiler from a set of parallel moves to a sequential list of moves. | 328 // Compiler from a set of parallel moves to a sequential list of moves. |
| 327 LGapResolver resolver_; | 329 LGapResolver resolver_; |
| 328 | 330 |
| 329 Safepoint::Kind expected_safepoint_kind_; | 331 Safepoint::Kind expected_safepoint_kind_; |
| 330 | 332 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 LCodeGen* codegen_; | 403 LCodeGen* codegen_; |
| 402 Label entry_; | 404 Label entry_; |
| 403 Label exit_; | 405 Label exit_; |
| 404 Label* external_exit_; | 406 Label* external_exit_; |
| 405 int instruction_index_; | 407 int instruction_index_; |
| 406 }; | 408 }; |
| 407 | 409 |
| 408 } } // namespace v8::internal | 410 } } // namespace v8::internal |
| 409 | 411 |
| 410 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ | 412 #endif // V8_ARM_LITHIUM_CODEGEN_ARM_H_ |
| OLD | NEW |