Revision f230a1cf deps/v8/src/ia32/lithium-codegen-ia32.h

View differences:

deps/v8/src/ia32/lithium-codegen-ia32.h
33 33
#include "checks.h"
34 34
#include "deoptimizer.h"
35 35
#include "ia32/lithium-gap-resolver-ia32.h"
36
#include "lithium-codegen.h"
36 37
#include "safepoint-table.h"
37 38
#include "scopes.h"
38 39
#include "v8utils.h"
......
45 46
class LGapNode;
46 47
class SafepointGenerator;
47 48

  
48
class LCodeGen V8_FINAL BASE_EMBEDDED {
49
class LCodeGen: public LCodeGenBase {
49 50
 public:
50 51
  LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info)
51
      : zone_(info->zone()),
52
        chunk_(static_cast<LPlatformChunk*>(chunk)),
53
        masm_(assembler),
54
        info_(info),
55
        current_block_(-1),
56
        current_instruction_(-1),
57
        instructions_(chunk->instructions()),
52
      : LCodeGenBase(chunk, assembler, info),
58 53
        deoptimizations_(4, info->zone()),
59 54
        jump_table_(4, info->zone()),
60 55
        deoptimization_literals_(8, info->zone()),
61 56
        inlined_function_count_(0),
62 57
        scope_(info->scope()),
63
        status_(UNUSED),
64 58
        translations_(info->zone()),
65 59
        deferred_(8, info->zone()),
66 60
        dynamic_frame_alignment_(false),
67 61
        support_aligned_spilled_doubles_(false),
68 62
        osr_pc_offset_(-1),
69
        last_lazy_deopt_pc_(0),
70 63
        frame_is_built_(false),
71 64
        x87_stack_(assembler),
72 65
        safepoints_(info->zone()),
73 66
        resolver_(this),
74
        expected_safepoint_kind_(Safepoint::kSimple),
75
        old_position_(RelocInfo::kNoPosition) {
67
        expected_safepoint_kind_(Safepoint::kSimple) {
76 68
    PopulateDeoptimizationLiteralsWithInlinedFunctions();
77 69
  }
78 70

  
79
  // Simple accessors.
80
  MacroAssembler* masm() const { return masm_; }
81
  CompilationInfo* info() const { return info_; }
82
  Isolate* isolate() const { return info_->isolate(); }
83
  Factory* factory() const { return isolate()->factory(); }
84
  Heap* heap() const { return isolate()->heap(); }
85
  Zone* zone() const { return zone_; }
86

  
87 71
  int LookupDestination(int block_id) const {
88 72
    return chunk()->LookupDestination(block_id);
89 73
  }
......
129 113
      X87Register left, X87Register right, X87Register result);
130 114

  
131 115
  void X87LoadForUsage(X87Register reg);
116
  void X87LoadForUsage(X87Register reg1, X87Register reg2);
132 117
  void X87PrepareToWrite(X87Register reg) { x87_stack_.PrepareToWrite(reg); }
133 118
  void X87CommitWrite(X87Register reg) { x87_stack_.CommitWrite(reg); }
134 119

  
135 120
  void X87Fxch(X87Register reg, int other_slot = 0) {
136 121
    x87_stack_.Fxch(reg, other_slot);
137 122
  }
123
  void X87Free(X87Register reg) {
124
    x87_stack_.Free(reg);
125
  }
126

  
138 127

  
139 128
  bool X87StackEmpty() {
140 129
    return x87_stack_.depth() == 0;
......
188 177
#undef DECLARE_DO
189 178

  
190 179
 private:
191
  enum Status {
192
    UNUSED,
193
    GENERATING,
194
    DONE,
195
    ABORTED
196
  };
197

  
198
  bool is_unused() const { return status_ == UNUSED; }
199
  bool is_generating() const { return status_ == GENERATING; }
200
  bool is_done() const { return status_ == DONE; }
201
  bool is_aborted() const { return status_ == ABORTED; }
202

  
203 180
  StrictModeFlag strict_mode_flag() const {
204 181
    return info()->is_classic_mode() ? kNonStrictMode : kStrictMode;
205 182
  }
206 183

  
207
  LPlatformChunk* chunk() const { return chunk_; }
208 184
  Scope* scope() const { return scope_; }
209
  HGraph* graph() const { return chunk()->graph(); }
210 185

  
211
  int GetNextEmittedBlock() const;
186
  XMMRegister double_scratch0() const { return xmm0; }
212 187

  
213 188
  void EmitClassOfTest(Label* if_true,
214 189
                       Label* if_false,
......
220 195
  int GetStackSlotCount() const { return chunk()->spill_slot_count(); }
221 196

  
222 197
  void Abort(BailoutReason reason);
223
  void FPRINTF_CHECKING Comment(const char* format, ...);
224 198

  
225 199
  void AddDeferredCode(LDeferredCode* code) { deferred_.Add(code, zone()); }
226 200

  
227 201
  // Code generation passes.  Returns true if code generation should
228 202
  // continue.
203
  void GenerateBodyInstructionPre(LInstruction* instr) V8_OVERRIDE;
204
  void GenerateBodyInstructionPost(LInstruction* instr) V8_OVERRIDE;
229 205
  bool GeneratePrologue();
230
  bool GenerateBody();
231 206
  bool GenerateDeferredCode();
232 207
  bool GenerateJumpTable();
233 208
  bool GenerateSafepointTable();
......
251 226

  
252 227
  void CallRuntime(const Runtime::Function* fun,
253 228
                   int argc,
254
                   LInstruction* instr);
229
                   LInstruction* instr,
230
                   SaveFPRegsMode save_doubles = kDontSaveFPRegs);
255 231

  
256 232
  void CallRuntime(Runtime::FunctionId id,
257 233
                   int argc,
......
331 307
  void RecordSafepointWithRegisters(LPointerMap* pointers,
332 308
                                    int arguments,
333 309
                                    Safepoint::DeoptMode mode);
334
  void RecordPosition(int position);
335 310

  
336
  void RecordAndUpdatePosition(int position);
311
  void RecordAndWritePosition(int position) V8_OVERRIDE;
337 312

  
338 313
  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
339 314
  void EmitGoto(int block);
......
395 370
                    int* offset,
396 371
                    AllocationSiteMode mode);
397 372

  
398
  void EnsureSpaceForLazyDeopt();
373
  void EnsureSpaceForLazyDeopt(int space_needed) V8_OVERRIDE;
399 374
  void DoLoadKeyedExternalArray(LLoadKeyed* instr);
400 375
  void DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr);
401 376
  void DoLoadKeyedFixedArray(LLoadKeyed* instr);
......
425 400
  void MakeSureStackPagesMapped(int offset);
426 401
#endif
427 402

  
428
  Zone* zone_;
429
  LPlatformChunk* const chunk_;
430
  MacroAssembler* const masm_;
431
  CompilationInfo* const info_;
432

  
433
  int current_block_;
434
  int current_instruction_;
435
  const ZoneList<LInstruction*>* instructions_;
436 403
  ZoneList<LEnvironment*> deoptimizations_;
437 404
  ZoneList<Deoptimizer::JumpTableEntry> jump_table_;
438 405
  ZoneList<Handle<Object> > deoptimization_literals_;
439 406
  int inlined_function_count_;
440 407
  Scope* const scope_;
441
  Status status_;
442 408
  TranslationBuffer translations_;
443 409
  ZoneList<LDeferredCode*> deferred_;
444 410
  bool dynamic_frame_alignment_;
445 411
  bool support_aligned_spilled_doubles_;
446 412
  int osr_pc_offset_;
447
  int last_lazy_deopt_pc_;
448 413
  bool frame_is_built_;
449 414

  
450 415
  class X87Stack {
......
505 470

  
506 471
  Safepoint::Kind expected_safepoint_kind_;
507 472

  
508
  int old_position_;
509

  
510 473
  class PushSafepointRegistersScope V8_FINAL  BASE_EMBEDDED {
511 474
   public:
512 475
    explicit PushSafepointRegistersScope(LCodeGen* codegen)

Also available in: Unified diff