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

« back to all changes in this revision

Viewing changes to src/arm/lithium-codegen-arm.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
        status_(UNUSED),
59
59
        deferred_(8),
60
60
        osr_pc_offset_(-1),
 
61
        last_lazy_deopt_pc_(0),
61
62
        resolver_(this),
62
63
        expected_safepoint_kind_(Safepoint::kSimple) {
63
64
    PopulateDeoptimizationLiteralsWithInlinedFunctions();
86
87
                                        SwVfpRegister flt_scratch,
87
88
                                        DoubleRegister dbl_scratch);
88
89
  int ToInteger32(LConstantOperand* op) const;
 
90
  double ToDouble(LConstantOperand* op) const;
89
91
  Operand ToOperand(LOperand* op);
90
92
  MemOperand ToMemOperand(LOperand* op) const;
91
93
  // Returns a MemOperand pointing to the high word of a DoubleStackSlot.
111
113
  void DoDeferredStackCheck(LStackCheck* instr);
112
114
  void DoDeferredStringCharCodeAt(LStringCharCodeAt* instr);
113
115
  void DoDeferredStringCharFromCode(LStringCharFromCode* instr);
114
 
  void DoDeferredLInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
115
 
                                        Label* map_check);
 
116
  void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
 
117
                                       Label* map_check);
116
118
 
117
119
  // Parallel move support.
118
120
  void DoParallelMove(LParallelMove* move);
139
141
  bool is_done() const { return status_ == DONE; }
140
142
  bool is_aborted() const { return status_ == ABORTED; }
141
143
 
142
 
  int strict_mode_flag() const {
143
 
    return info()->is_strict_mode() ? kStrictMode : kNonStrictMode;
 
144
  StrictModeFlag strict_mode_flag() const {
 
145
    return info()->is_classic_mode() ? kNonStrictMode : kStrictMode;
144
146
  }
145
147
 
146
148
  LChunk* chunk() const { return chunk_; }
148
150
  HGraph* graph() const { return chunk_->graph(); }
149
151
 
150
152
  Register scratch0() { return r9; }
151
 
  DwVfpRegister double_scratch0() { return d15; }
 
153
  DwVfpRegister double_scratch0() { return kScratchDoubleReg; }
152
154
 
153
155
  int GetNextEmittedBlock(int block);
154
156
  LInstruction* GetNextInstruction();
206
208
                               LInstruction* instr);
207
209
 
208
210
  // Generate a direct call to a known function.  Expects the function
209
 
  // to be in edi.
 
211
  // to be in r1.
210
212
  void CallKnownFunction(Handle<JSFunction> function,
211
213
                         int arity,
212
214
                         LInstruction* instr,
214
216
 
215
217
  void LoadHeapObject(Register result, Handle<HeapObject> object);
216
218
 
217
 
  void RegisterLazyDeoptimization(LInstruction* instr,
218
 
                                  SafepointMode safepoint_mode);
 
219
  void RecordSafepointWithLazyDeopt(LInstruction* instr,
 
220
                                    SafepointMode safepoint_mode);
219
221
 
220
 
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
 
222
  void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
 
223
                                            Safepoint::DeoptMode mode);
221
224
  void DeoptimizeIf(Condition cc, LEnvironment* environment);
222
225
 
223
226
  void AddToTranslation(Translation* translation,
239
242
  void DoMathSqrt(LUnaryMathOperation* instr);
240
243
  void DoMathPowHalf(LUnaryMathOperation* instr);
241
244
  void DoMathLog(LUnaryMathOperation* instr);
 
245
  void DoMathTan(LUnaryMathOperation* instr);
242
246
  void DoMathCos(LUnaryMathOperation* instr);
243
247
  void DoMathSin(LUnaryMathOperation* instr);
244
248
 
246
250
  void RecordSafepoint(LPointerMap* pointers,
247
251
                       Safepoint::Kind kind,
248
252
                       int arguments,
249
 
                       int deoptimization_index);
250
 
  void RecordSafepoint(LPointerMap* pointers, int deoptimization_index);
251
 
  void RecordSafepoint(int deoptimization_index);
 
253
                       Safepoint::DeoptMode mode);
 
254
  void RecordSafepoint(LPointerMap* pointers, Safepoint::DeoptMode mode);
 
255
  void RecordSafepoint(Safepoint::DeoptMode mode);
252
256
  void RecordSafepointWithRegisters(LPointerMap* pointers,
253
257
                                    int arguments,
254
 
                                    int deoptimization_index);
 
258
                                    Safepoint::DeoptMode mode);
255
259
  void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
256
260
                                              int arguments,
257
 
                                              int deoptimization_index);
 
261
                                              Safepoint::DeoptMode mode);
258
262
  void RecordPosition(int position);
259
 
  int LastSafepointEnd() {
260
 
    return static_cast<int>(safepoints_.GetPcAfterGap());
261
 
  }
262
263
 
263
264
  static Condition TokenToCondition(Token::Value op, bool is_unsigned);
264
265
  void EmitGoto(int block);
265
266
  void EmitBranch(int left_block, int right_block, Condition cc);
266
 
  void EmitCmpI(LOperand* left, LOperand* right);
267
267
  void EmitNumberUntagD(Register input,
268
268
                        DoubleRegister result,
269
269
                        bool deoptimize_on_undefined,
272
272
  // Emits optimized code for typeof x == "y".  Modifies input register.
273
273
  // Returns the condition on which a final split to
274
274
  // true and false label should be made, to optimize fallthrough.
275
 
  Condition EmitTypeofIs(Label* true_label, Label* false_label,
276
 
                         Register input, Handle<String> type_name);
 
275
  Condition EmitTypeofIs(Label* true_label,
 
276
                         Label* false_label,
 
277
                         Register input,
 
278
                         Handle<String> type_name);
277
279
 
278
280
  // Emits optimized code for %_IsObject(x).  Preserves input register.
279
281
  // Returns the condition on which a final split to
283
285
                         Label* is_not_object,
284
286
                         Label* is_object);
285
287
 
 
288
  // Emits optimized code for %_IsString(x).  Preserves input register.
 
289
  // Returns the condition on which a final split to
 
290
  // true and false label should be made, to optimize fallthrough.
 
291
  Condition EmitIsString(Register input,
 
292
                         Register temp1,
 
293
                         Label* is_not_string);
 
294
 
286
295
  // Emits optimized code for %_IsConstructCall().
287
296
  // Caller should branch on equal condition.
288
297
  void EmitIsConstructCall(Register temp1, Register temp2);
292
301
                                       Handle<Map> type,
293
302
                                       Handle<String> name);
294
303
 
 
304
  // Emits optimized code to deep-copy the contents of statically known
 
305
  // object graphs (e.g. object literal boilerplate).
 
306
  void EmitDeepCopy(Handle<JSObject> object,
 
307
                    Register result,
 
308
                    Register source,
 
309
                    int* offset);
 
310
 
295
311
  struct JumpTableEntry {
296
312
    explicit inline JumpTableEntry(Address entry)
297
313
        : label(),
300
316
    Address address;
301
317
  };
302
318
 
 
319
  void EnsureSpaceForLazyDeopt();
 
320
 
303
321
  LChunk* const chunk_;
304
322
  MacroAssembler* const masm_;
305
323
  CompilationInfo* const info_;
316
334
  TranslationBuffer translations_;
317
335
  ZoneList<LDeferredCode*> deferred_;
318
336
  int osr_pc_offset_;
 
337
  int last_lazy_deopt_pc_;
319
338
 
320
339
  // Builder that keeps track of safepoints in the code. The table
321
340
  // itself is emitted at the end of the generated code.
376
395
class LDeferredCode: public ZoneObject {
377
396
 public:
378
397
  explicit LDeferredCode(LCodeGen* codegen)
379
 
      : codegen_(codegen), external_exit_(NULL) {
 
398
      : codegen_(codegen),
 
399
        external_exit_(NULL),
 
400
        instruction_index_(codegen->current_instruction_) {
380
401
    codegen->AddDeferredCode(this);
381
402
  }
382
403
 
383
404
  virtual ~LDeferredCode() { }
384
405
  virtual void Generate() = 0;
 
406
  virtual LInstruction* instr() = 0;
385
407
 
386
408
  void SetExit(Label *exit) { external_exit_ = exit; }
387
409
  Label* entry() { return &entry_; }
388
410
  Label* exit() { return external_exit_ != NULL ? external_exit_ : &exit_; }
 
411
  int instruction_index() const { return instruction_index_; }
389
412
 
390
413
 protected:
391
414
  LCodeGen* codegen() const { return codegen_; }
396
419
  Label entry_;
397
420
  Label exit_;
398
421
  Label* external_exit_;
 
422
  int instruction_index_;
399
423
};
400
424
 
401
425
} }  // namespace v8::internal