OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 namespace v8 { | 37 namespace v8 { |
38 namespace internal { | 38 namespace internal { |
39 | 39 |
40 // Forward declarations. | 40 // Forward declarations. |
41 class LDeferredCode; | 41 class LDeferredCode; |
42 class SafepointGenerator; | 42 class SafepointGenerator; |
43 | 43 |
44 class LCodeGen BASE_EMBEDDED { | 44 class LCodeGen BASE_EMBEDDED { |
45 public: | 45 public: |
46 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) | 46 LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info, |
| 47 Zone* zone) |
47 : chunk_(chunk), | 48 : chunk_(chunk), |
48 masm_(assembler), | 49 masm_(assembler), |
49 info_(info), | 50 info_(info), |
50 current_block_(-1), | 51 current_block_(-1), |
51 current_instruction_(-1), | 52 current_instruction_(-1), |
52 instructions_(chunk->instructions()), | 53 instructions_(chunk->instructions()), |
53 deoptimizations_(4), | 54 deoptimizations_(4), |
54 deopt_jump_table_(4), | 55 deopt_jump_table_(4), |
55 deoptimization_literals_(8), | 56 deoptimization_literals_(8), |
56 inlined_function_count_(0), | 57 inlined_function_count_(0), |
57 scope_(info->scope()), | 58 scope_(info->scope()), |
58 status_(UNUSED), | 59 status_(UNUSED), |
| 60 translations_(zone), |
59 deferred_(8), | 61 deferred_(8), |
60 osr_pc_offset_(-1), | 62 osr_pc_offset_(-1), |
61 last_lazy_deopt_pc_(0), | 63 last_lazy_deopt_pc_(0), |
| 64 safepoints_(zone), |
62 resolver_(this), | 65 resolver_(this), |
63 expected_safepoint_kind_(Safepoint::kSimple) { | 66 expected_safepoint_kind_(Safepoint::kSimple), |
| 67 zone_(zone) { |
64 PopulateDeoptimizationLiteralsWithInlinedFunctions(); | 68 PopulateDeoptimizationLiteralsWithInlinedFunctions(); |
65 } | 69 } |
66 | 70 |
67 | 71 |
68 // Simple accessors. | 72 // Simple accessors. |
69 MacroAssembler* masm() const { return masm_; } | 73 MacroAssembler* masm() const { return masm_; } |
70 CompilationInfo* info() const { return info_; } | 74 CompilationInfo* info() const { return info_; } |
71 Isolate* isolate() const { return info_->isolate(); } | 75 Isolate* isolate() const { return info_->isolate(); } |
72 Factory* factory() const { return isolate()->factory(); } | 76 Factory* factory() const { return isolate()->factory(); } |
73 Heap* heap() const { return isolate()->heap(); } | 77 Heap* heap() const { return isolate()->heap(); } |
| 78 Zone* zone() const { return zone_; } |
74 | 79 |
75 // Support for converting LOperands to assembler types. | 80 // Support for converting LOperands to assembler types. |
76 // LOperand must be a register. | 81 // LOperand must be a register. |
77 Register ToRegister(LOperand* op) const; | 82 Register ToRegister(LOperand* op) const; |
78 | 83 |
79 // LOperand is loaded into scratch, unless already a register. | 84 // LOperand is loaded into scratch, unless already a register. |
80 Register EmitLoadRegister(LOperand* op, Register scratch); | 85 Register EmitLoadRegister(LOperand* op, Register scratch); |
81 | 86 |
82 // LOperand must be a double register. | 87 // LOperand must be a double register. |
83 DoubleRegister ToDoubleRegister(LOperand* op) const; | 88 DoubleRegister ToDoubleRegister(LOperand* op) const; |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 373 |
369 // Builder that keeps track of safepoints in the code. The table | 374 // Builder that keeps track of safepoints in the code. The table |
370 // itself is emitted at the end of the generated code. | 375 // itself is emitted at the end of the generated code. |
371 SafepointTableBuilder safepoints_; | 376 SafepointTableBuilder safepoints_; |
372 | 377 |
373 // Compiler from a set of parallel moves to a sequential list of moves. | 378 // Compiler from a set of parallel moves to a sequential list of moves. |
374 LGapResolver resolver_; | 379 LGapResolver resolver_; |
375 | 380 |
376 Safepoint::Kind expected_safepoint_kind_; | 381 Safepoint::Kind expected_safepoint_kind_; |
377 | 382 |
| 383 Zone* zone_; |
| 384 |
378 class PushSafepointRegistersScope BASE_EMBEDDED { | 385 class PushSafepointRegistersScope BASE_EMBEDDED { |
379 public: | 386 public: |
380 PushSafepointRegistersScope(LCodeGen* codegen, | 387 PushSafepointRegistersScope(LCodeGen* codegen, |
381 Safepoint::Kind kind) | 388 Safepoint::Kind kind) |
382 : codegen_(codegen) { | 389 : codegen_(codegen) { |
383 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); | 390 ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
384 codegen_->expected_safepoint_kind_ = kind; | 391 codegen_->expected_safepoint_kind_ = kind; |
385 | 392 |
386 switch (codegen_->expected_safepoint_kind_) { | 393 switch (codegen_->expected_safepoint_kind_) { |
387 case Safepoint::kWithRegisters: | 394 case Safepoint::kWithRegisters: |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 LCodeGen* codegen_; | 455 LCodeGen* codegen_; |
449 Label entry_; | 456 Label entry_; |
450 Label exit_; | 457 Label exit_; |
451 Label* external_exit_; | 458 Label* external_exit_; |
452 int instruction_index_; | 459 int instruction_index_; |
453 }; | 460 }; |
454 | 461 |
455 } } // namespace v8::internal | 462 } } // namespace v8::internal |
456 | 463 |
457 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ | 464 #endif // V8_MIPS_LITHIUM_CODEGEN_MIPS_H_ |
OLD | NEW |