~ubuntu-branches/ubuntu/trusty/libv8/trusty

« back to all changes in this revision

Viewing changes to src/ia32/lithium-codegen-ia32.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-02-20 14:08:17 UTC
  • mfrom: (15.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120220140817-bsvmeoa4sxsj5hbz
Tags: 3.7.12.22-3
Fix mipsel build, allow test debug-step-3 to fail (non-crucial)

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        inlined_function_count_(0),
59
59
        scope_(info->scope()),
60
60
        status_(UNUSED),
 
61
        dynamic_frame_alignment_(false),
61
62
        deferred_(8),
62
63
        osr_pc_offset_(-1),
63
 
        deoptimization_reloc_size(),
 
64
        last_lazy_deopt_pc_(0),
64
65
        resolver_(this),
65
66
        expected_safepoint_kind_(Safepoint::kSimple) {
66
67
    PopulateDeoptimizationLiteralsWithInlinedFunctions();
100
101
  void DoDeferredStackCheck(LStackCheck* instr);
101
102
  void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
102
103
  void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
103
 
  void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
104
 
                                        Label* map_check);
 
104
  void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
 
105
                                       Label* map_check);
105
106
 
106
107
  // Parallel move support.
107
108
  void DoParallelMove(LParallelMove* move);
130
131
  bool is_done() const { return status_ == DONE; }
131
132
  bool is_aborted() const { return status_ == ABORTED; }
132
133
 
133
 
  int strict_mode_flag() const {
134
 
    return info()->is_strict_mode() ? kStrictMode : kNonStrictMode;
 
134
  StrictModeFlag strict_mode_flag() const {
 
135
    return info()->is_classic_mode() ? kNonStrictMode : kStrictMode;
 
136
  }
 
137
  bool dynamic_frame_alignment() const { return dynamic_frame_alignment_; }
 
138
  void set_dynamic_frame_alignment(bool value) {
 
139
    dynamic_frame_alignment_ = value;
135
140
  }
136
141
 
137
142
  LChunk* chunk() const { return chunk_; }
139
144
  HGraph* graph() const { return chunk_->graph(); }
140
145
 
141
146
  int GetNextEmittedBlock(int block);
142
 
  LInstruction* GetNextInstruction();
143
147
 
144
148
  void EmitClassOfTest(Label* if_true,
145
149
                       Label* if_false,
205
209
 
206
210
  void LoadHeapObject(Register result, Handle<HeapObject> object);
207
211
 
208
 
  void RegisterLazyDeoptimization(LInstruction* instr,
209
 
                                  SafepointMode safepoint_mode);
 
212
  void RecordSafepointWithLazyDeopt(LInstruction* instr,
 
213
                                    SafepointMode safepoint_mode);
210
214
 
211
 
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
 
215
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
 
216
                                            Safepoint::DeoptMode mode);
212
217
  void DeoptimizeIf(Condition cc, LEnvironment* environment);
213
218
 
214
219
  void AddToTranslation(Translation* translation,
222
227
  Register ToRegister(int index) const;
223
228
  XMMRegister ToDoubleRegister(int index) const;
224
229
  int ToInteger32(LConstantOperand* op) const;
 
230
  double ToDouble(LConstantOperand* op) const;
225
231
  Operand BuildFastArrayOperand(LOperand* elements_pointer,
226
232
                                LOperand* key,
227
233
                                ElementsKind elements_kind,
235
241
  void DoMathSqrt(LUnaryMathOperation* instr);
236
242
  void DoMathPowHalf(LUnaryMathOperation* instr);
237
243
  void DoMathLog(LUnaryMathOperation* instr);
 
244
  void DoMathTan(LUnaryMathOperation* instr);
238
245
  void DoMathCos(LUnaryMathOperation* instr);
239
246
  void DoMathSin(LUnaryMathOperation* instr);
240
247
 
242
249
  void RecordSafepoint(LPointerMap* pointers,
243
250
                       Safepoint::Kind kind,
244
251
                       int arguments,
245
 
                       int deoptimization_index);
246
 
  void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
247
 
  void RecordSafepoint(int deoptimization_index);
 
252
                       Safepoint::DeoptMode mode);
 
253
  void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode);
 
254
  void RecordSafepoint(Safepoint::DeoptMode mode);
248
255
  void RecordSafepointWithRegisters(LPointerMap* pointers,
249
256
                                    int arguments,
250
 
                                    int deoptimization_index);
 
257
                                    Safepoint::DeoptMode mode);
251
258
  void RecordPosition(int position);
252
 
  int LastSafepointEnd() {
253
 
    return static_cast<int>(safepoints_.GetPcAfterGap());
254
 
  }
255
259
 
256
260
  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
257
261
  void EmitGoto(int block);
258
262
  void EmitBranch(int left_block, int right_block, Condition cc);
259
 
  void EmitCmpI(LOperand* left, LOperand* right);
260
263
  void EmitNumberUntagD(Register input,
261
264
                        XMMRegister result,
262
265
                        bool deoptimize_on_undefined,
265
268
  // Emits optimized code for typeof x == "y".  Modifies input register.
266
269
  // Returns the condition on which a final split to
267
270
  // true and false label should be made, to optimize fallthrough.
268
 
  Condition EmitTypeofIs(Label* true_label, Label* false_label,
269
 
                         Register input, Handle<String> type_name);
 
271
  Condition EmitTypeofIs(Label* true_label,
 
272
                         Label* false_label,
 
273
                         Register input,
 
274
                         Handle<String> type_name);
270
275
 
271
276
  // Emits optimized code for %_IsObject(x).  Preserves input register.
272
277
  // Returns the condition on which a final split to
276
281
                         Label* is_not_object,
277
282
                         Label* is_object);
278
283
 
 
284
  // Emits optimized code for %_IsString(x).  Preserves input register.
 
285
  // Returns the condition on which a final split to
 
286
  // true and false label should be made, to optimize fallthrough.
 
287
  Condition EmitIsString(Register input,
 
288
                         Register temp1,
 
289
                         Label* is_not_string);
 
290
 
279
291
  // Emits optimized code for %_IsConstructCall().
280
292
  // Caller should branch on equal condition.
281
293
  void EmitIsConstructCall(Register temp);
285
297
                                       Handle<Map> type,
286
298
                                       Handle<String> name);
287
299
 
 
300
  // Emits optimized code to deep-copy the contents of statically known
 
301
  // object graphs (e.g. object literal boilerplate).
 
302
  void EmitDeepCopy(Handle<JSObject> object,
 
303
                    Register result,
 
304
                    Register source,
 
305
                    int* offset);
 
306
 
 
307
  void EnsureSpaceForLazyDeopt();
 
308
 
288
309
  LChunk* const chunk_;
289
310
  MacroAssembler* const masm_;
290
311
  CompilationInfo* const info_;
297
318
  int inlined_function_count_;
298
319
  Scope* const scope_;
299
320
  Status status_;
 
321
  bool dynamic_frame_alignment_;
300
322
  TranslationBuffer translations_;
301
323
  ZoneList<LDeferredCode*> deferred_;
302
324
  int osr_pc_offset_;
303
 
 
304
 
  struct DeoptimizationRelocSize {
305
 
    int min_size;
306
 
    int last_pc_offset;
307
 
  };
308
 
 
309
 
  DeoptimizationRelocSize deoptimization_reloc_size;
 
325
  int last_lazy_deopt_pc_;
310
326
 
311
327
  // Builder that keeps track of safepoints in the code. The table
312
328
  // itself is emitted at the end of the generated code.
346
362
class LDeferredCode: public ZoneObject {
347
363
 public:
348
364
  explicit LDeferredCode(LCodeGen* codegen)
349
 
      : codegen_(codegen), external_exit_(NULL) {
 
365
      : codegen_(codegen),
 
366
        external_exit_(NULL),
 
367
        instruction_index_(codegen->current_instruction_) {
350
368
    codegen->AddDeferredCode(this);
351
369
  }
352
370
 
353
371
  virtual ~LDeferredCode() { }
354
372
  virtual void Generate() = 0;
 
373
  virtual LInstruction* instr() = 0;
355
374
 
356
375
  void SetExit(Label *exit) { external_exit_ = exit; }
357
376
  Label* entry() { return &entry_; }
358
377
  Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
 
378
  int instruction_index() const { return instruction_index_; }
359
379
 
360
380
 protected:
361
381
  LCodeGen* codegen() const { return codegen_; }
366
386
  Label entry_;
367
387
  Label exit_;
368
388
  Label* external_exit_;
 
389
  int instruction_index_;
369
390
};
370
391
 
371
392
} }  // namespace v8::internal