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,
116
void DoDeferredInstanceOfKnownGlobal(LInstanceOfKnownGlobal* instr,
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; }
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;
146
148
LChunk* chunk() const { return chunk_; }
148
150
HGraph* graph() const { return chunk_->graph(); }
150
152
Register scratch0() { return r9; }
151
DwVfpRegister double_scratch0() { return d15; }
153
DwVfpRegister double_scratch0() { return kScratchDoubleReg; }
153
155
int GetNextEmittedBlock(int block);
154
156
LInstruction* GetNextInstruction();
215
217
void LoadHeapObject(Register result, Handle<HeapObject> object);
217
void RegisterLazyDeoptimization(LInstruction* instr,
218
SafepointMode safepoint_mode);
219
void RecordSafepointWithLazyDeopt(LInstruction* instr,
220
SafepointMode safepoint_mode);
220
void RegisterEnvironmentForDeoptimization(LEnvironment* environment);
222
void RegisterEnvironmentForDeoptimization(LEnvironment* environment,
223
Safepoint::DeoptMode mode);
221
224
void DeoptimizeIf(Condition cc, LEnvironment* environment);
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);
246
250
void RecordSafepoint(LPointerMap* pointers,
247
251
Safepoint::Kind kind,
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,
254
int deoptimization_index);
258
Safepoint::DeoptMode mode);
255
259
void RecordSafepointWithRegistersAndDoubles(LPointerMap* pointers,
257
int deoptimization_index);
261
Safepoint::DeoptMode mode);
258
262
void RecordPosition(int position);
259
int LastSafepointEnd() {
260
return static_cast<int>(safepoints_.GetPcAfterGap());
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,
278
Handle<String> type_name);
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);
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,
293
Label* is_not_string);
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);
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,
295
311
struct JumpTableEntry {
296
312
explicit inline JumpTableEntry(Address entry)
376
395
class LDeferredCode: public ZoneObject {
378
397
explicit LDeferredCode(LCodeGen* codegen)
379
: codegen_(codegen), external_exit_(NULL) {
399
external_exit_(NULL),
400
instruction_index_(codegen->current_instruction_) {
380
401
codegen->AddDeferredCode(this);
383
404
virtual ~LDeferredCode() { }
384
405
virtual void Generate() = 0;
406
virtual LInstruction* instr() = 0;
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_; }
391
414
LCodeGen* codegen() const { return codegen_; }