OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // |
| 3 // Copyright IBM Corp. 2012, 2013. All rights reserved. |
| 4 // |
2 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 6 // found in the LICENSE file. |
4 | 7 |
5 #ifndef V8_ARM_LITHIUM_ARM_H_ | 8 #ifndef V8_PPC_LITHIUM_PPC_H_ |
6 #define V8_ARM_LITHIUM_ARM_H_ | 9 #define V8_PPC_LITHIUM_PPC_H_ |
7 | 10 |
8 #include "src/hydrogen.h" | 11 #include "src/hydrogen.h" |
9 #include "src/lithium.h" | 12 #include "src/lithium.h" |
10 #include "src/lithium-allocator.h" | 13 #include "src/lithium-allocator.h" |
11 #include "src/safepoint-table.h" | 14 #include "src/safepoint-table.h" |
12 #include "src/utils.h" | 15 #include "src/utils.h" |
13 | 16 |
14 namespace v8 { | 17 namespace v8 { |
15 namespace internal { | 18 namespace internal { |
16 | 19 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 V(ToFastProperties) \ | 161 V(ToFastProperties) \ |
159 V(TransitionElementsKind) \ | 162 V(TransitionElementsKind) \ |
160 V(TrapAllocationMemento) \ | 163 V(TrapAllocationMemento) \ |
161 V(Typeof) \ | 164 V(Typeof) \ |
162 V(TypeofIsAndBranch) \ | 165 V(TypeofIsAndBranch) \ |
163 V(Uint32ToDouble) \ | 166 V(Uint32ToDouble) \ |
164 V(UnknownOSRValue) \ | 167 V(UnknownOSRValue) \ |
165 V(WrapReceiver) | 168 V(WrapReceiver) |
166 | 169 |
167 | 170 |
168 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 171 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
169 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 172 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ |
170 return LInstruction::k##type; \ | 173 return LInstruction::k##type; \ |
171 } \ | 174 } \ |
172 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 175 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ |
173 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ | 176 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ |
174 return mnemonic; \ | 177 return mnemonic; \ |
175 } \ | 178 } \ |
176 static L##type* cast(LInstruction* instr) { \ | 179 static L##type* cast(LInstruction* instr) { \ |
177 DCHECK(instr->Is##type()); \ | 180 DCHECK(instr->Is##type()); \ |
178 return reinterpret_cast<L##type*>(instr); \ | 181 return reinterpret_cast<L##type*>(instr); \ |
179 } | 182 } |
180 | 183 |
181 | 184 |
182 #define DECLARE_HYDROGEN_ACCESSOR(type) \ | 185 #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
183 H##type* hydrogen() const { \ | 186 H##type* hydrogen() const { return H##type::cast(hydrogen_value()); } |
184 return H##type::cast(hydrogen_value()); \ | |
185 } | |
186 | 187 |
187 | 188 |
188 class LInstruction : public ZoneObject { | 189 class LInstruction : public ZoneObject { |
189 public: | 190 public: |
190 LInstruction() | 191 LInstruction() |
191 : environment_(NULL), | 192 : environment_(NULL), |
192 hydrogen_value_(NULL), | 193 hydrogen_value_(NULL), |
193 bit_field_(IsCallBits::encode(false)) { | 194 bit_field_(IsCallBits::encode(false)) {} |
194 } | |
195 | 195 |
196 virtual ~LInstruction() {} | 196 virtual ~LInstruction() {} |
197 | 197 |
198 virtual void CompileToNative(LCodeGen* generator) = 0; | 198 virtual void CompileToNative(LCodeGen* generator) = 0; |
199 virtual const char* Mnemonic() const = 0; | 199 virtual const char* Mnemonic() const = 0; |
200 virtual void PrintTo(StringStream* stream); | 200 virtual void PrintTo(StringStream* stream); |
201 virtual void PrintDataTo(StringStream* stream); | 201 virtual void PrintDataTo(StringStream* stream); |
202 virtual void PrintOutputOperandTo(StringStream* stream); | 202 virtual void PrintOutputOperandTo(StringStream* stream); |
203 | 203 |
204 enum Opcode { | 204 enum Opcode { |
205 // Declare a unique enum value for each instruction. | 205 // Declare a unique enum value for each instruction. |
206 #define DECLARE_OPCODE(type) k##type, | 206 #define DECLARE_OPCODE(type) k##type, |
207 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) | 207 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_OPCODE) kNumberOfInstructions |
208 kNumberOfInstructions | |
209 #undef DECLARE_OPCODE | 208 #undef DECLARE_OPCODE |
210 }; | 209 }; |
211 | 210 |
212 virtual Opcode opcode() const = 0; | 211 virtual Opcode opcode() const = 0; |
213 | 212 |
214 // Declare non-virtual type testers for all leaf IR classes. | 213 // Declare non-virtual type testers for all leaf IR classes. |
215 #define DECLARE_PREDICATE(type) \ | 214 #define DECLARE_PREDICATE(type) \ |
216 bool Is##type() const { return opcode() == k##type; } | 215 bool Is##type() const { return opcode() == k##type; } |
217 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) | 216 LITHIUM_CONCRETE_INSTRUCTION_LIST(DECLARE_PREDICATE) |
218 #undef DECLARE_PREDICATE | 217 #undef DECLARE_PREDICATE |
219 | 218 |
220 // Declare virtual predicates for instructions that don't have | 219 // Declare virtual predicates for instructions that don't have |
221 // an opcode. | 220 // an opcode. |
222 virtual bool IsGap() const { return false; } | 221 virtual bool IsGap() const { return false; } |
223 | 222 |
224 virtual bool IsControl() const { return false; } | 223 virtual bool IsControl() const { return false; } |
225 | 224 |
226 // Try deleting this instruction if possible. | 225 // Try deleting this instruction if possible. |
227 virtual bool TryDelete() { return false; } | 226 virtual bool TryDelete() { return false; } |
228 | 227 |
229 void set_environment(LEnvironment* env) { environment_ = env; } | 228 void set_environment(LEnvironment* env) { environment_ = env; } |
230 LEnvironment* environment() const { return environment_; } | 229 LEnvironment* environment() const { return environment_; } |
231 bool HasEnvironment() const { return environment_ != NULL; } | 230 bool HasEnvironment() const { return environment_ != NULL; } |
232 | 231 |
233 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 232 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } |
234 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 233 LPointerMap* pointer_map() const { return pointer_map_.get(); } |
235 bool HasPointerMap() const { return pointer_map_.is_set(); } | 234 bool HasPointerMap() const { return pointer_map_.is_set(); } |
236 | 235 |
237 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } | 236 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } |
238 HValue* hydrogen_value() const { return hydrogen_value_; } | 237 HValue* hydrogen_value() const { return hydrogen_value_; } |
239 | 238 |
240 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } | 239 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {} |
241 | 240 |
242 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } | 241 void MarkAsCall() { bit_field_ = IsCallBits::update(bit_field_, true); } |
243 bool IsCall() const { return IsCallBits::decode(bit_field_); } | 242 bool IsCall() const { return IsCallBits::decode(bit_field_); } |
244 | 243 |
245 // Interface to the register allocator and iterators. | 244 // Interface to the register allocator and iterators. |
246 bool ClobbersTemps() const { return IsCall(); } | 245 bool ClobbersTemps() const { return IsCall(); } |
247 bool ClobbersRegisters() const { return IsCall(); } | 246 bool ClobbersRegisters() const { return IsCall(); } |
248 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { | 247 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const { |
249 return IsCall(); | 248 return IsCall(); |
250 } | 249 } |
(...skipping 17 matching lines...) Expand all Loading... |
268 virtual LOperand* InputAt(int i) = 0; | 267 virtual LOperand* InputAt(int i) = 0; |
269 | 268 |
270 private: | 269 private: |
271 // Iterator support. | 270 // Iterator support. |
272 friend class InputIterator; | 271 friend class InputIterator; |
273 | 272 |
274 friend class TempIterator; | 273 friend class TempIterator; |
275 virtual int TempCount() = 0; | 274 virtual int TempCount() = 0; |
276 virtual LOperand* TempAt(int i) = 0; | 275 virtual LOperand* TempAt(int i) = 0; |
277 | 276 |
278 class IsCallBits: public BitField<bool, 0, 1> {}; | 277 class IsCallBits : public BitField<bool, 0, 1> {}; |
279 | 278 |
280 LEnvironment* environment_; | 279 LEnvironment* environment_; |
281 SetOncePointer<LPointerMap> pointer_map_; | 280 SetOncePointer<LPointerMap> pointer_map_; |
282 HValue* hydrogen_value_; | 281 HValue* hydrogen_value_; |
283 int bit_field_; | 282 int bit_field_; |
284 }; | 283 }; |
285 | 284 |
286 | 285 |
287 // R = number of result operands (0 or 1). | 286 // R = number of result operands (0 or 1). |
288 template<int R> | 287 template <int R> |
289 class LTemplateResultInstruction : public LInstruction { | 288 class LTemplateResultInstruction : public LInstruction { |
290 public: | 289 public: |
291 // Allow 0 or 1 output operands. | 290 // Allow 0 or 1 output operands. |
292 STATIC_ASSERT(R == 0 || R == 1); | 291 STATIC_ASSERT(R == 0 || R == 1); |
293 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { | 292 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { |
294 return R != 0 && result() != NULL; | 293 return R != 0 && result() != NULL; |
295 } | 294 } |
296 void set_result(LOperand* operand) { results_[0] = operand; } | 295 void set_result(LOperand* operand) { results_[0] = operand; } |
297 LOperand* result() const { return results_[0]; } | 296 LOperand* result() const { return results_[0]; } |
298 | 297 |
299 protected: | 298 protected: |
300 EmbeddedContainer<LOperand*, R> results_; | 299 EmbeddedContainer<LOperand*, R> results_; |
301 }; | 300 }; |
302 | 301 |
303 | 302 |
304 // R = number of result operands (0 or 1). | 303 // R = number of result operands (0 or 1). |
305 // I = number of input operands. | 304 // I = number of input operands. |
306 // T = number of temporary operands. | 305 // T = number of temporary operands. |
307 template<int R, int I, int T> | 306 template <int R, int I, int T> |
308 class LTemplateInstruction : public LTemplateResultInstruction<R> { | 307 class LTemplateInstruction : public LTemplateResultInstruction<R> { |
309 protected: | 308 protected: |
310 EmbeddedContainer<LOperand*, I> inputs_; | 309 EmbeddedContainer<LOperand*, I> inputs_; |
311 EmbeddedContainer<LOperand*, T> temps_; | 310 EmbeddedContainer<LOperand*, T> temps_; |
312 | 311 |
313 private: | 312 private: |
314 // Iterator support. | 313 // Iterator support. |
315 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } | 314 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } |
316 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } | 315 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } |
317 | 316 |
318 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } | 317 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } |
319 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; } | 318 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; } |
320 }; | 319 }; |
321 | 320 |
322 | 321 |
323 class LGap : public LTemplateInstruction<0, 0, 0> { | 322 class LGap : public LTemplateInstruction<0, 0, 0> { |
324 public: | 323 public: |
325 explicit LGap(HBasicBlock* block) | 324 explicit LGap(HBasicBlock* block) : block_(block) { |
326 : block_(block) { | |
327 parallel_moves_[BEFORE] = NULL; | 325 parallel_moves_[BEFORE] = NULL; |
328 parallel_moves_[START] = NULL; | 326 parallel_moves_[START] = NULL; |
329 parallel_moves_[END] = NULL; | 327 parallel_moves_[END] = NULL; |
330 parallel_moves_[AFTER] = NULL; | 328 parallel_moves_[AFTER] = NULL; |
331 } | 329 } |
332 | 330 |
333 // Can't use the DECLARE-macro here because of sub-classes. | 331 // Can't use the DECLARE-macro here because of sub-classes. |
334 virtual bool IsGap() const V8_OVERRIDE { return true; } | 332 virtual bool IsGap() const V8_OVERRIDE { return true; } |
335 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 333 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
336 static LGap* cast(LInstruction* instr) { | 334 static LGap* cast(LInstruction* instr) { |
337 DCHECK(instr->IsGap()); | 335 DCHECK(instr->IsGap()); |
338 return reinterpret_cast<LGap*>(instr); | 336 return reinterpret_cast<LGap*>(instr); |
339 } | 337 } |
340 | 338 |
341 bool IsRedundant() const; | 339 bool IsRedundant() const; |
342 | 340 |
343 HBasicBlock* block() const { return block_; } | 341 HBasicBlock* block() const { return block_; } |
344 | 342 |
345 enum InnerPosition { | 343 enum InnerPosition { |
346 BEFORE, | 344 BEFORE, |
347 START, | 345 START, |
348 END, | 346 END, |
349 AFTER, | 347 AFTER, |
350 FIRST_INNER_POSITION = BEFORE, | 348 FIRST_INNER_POSITION = BEFORE, |
351 LAST_INNER_POSITION = AFTER | 349 LAST_INNER_POSITION = AFTER |
352 }; | 350 }; |
353 | 351 |
354 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { | 352 LParallelMove* GetOrCreateParallelMove(InnerPosition pos, Zone* zone) { |
355 if (parallel_moves_[pos] == NULL) { | 353 if (parallel_moves_[pos] == NULL) { |
356 parallel_moves_[pos] = new(zone) LParallelMove(zone); | 354 parallel_moves_[pos] = new (zone) LParallelMove(zone); |
357 } | 355 } |
358 return parallel_moves_[pos]; | 356 return parallel_moves_[pos]; |
359 } | 357 } |
360 | 358 |
361 LParallelMove* GetParallelMove(InnerPosition pos) { | 359 LParallelMove* GetParallelMove(InnerPosition pos) { |
362 return parallel_moves_[pos]; | 360 return parallel_moves_[pos]; |
363 } | 361 } |
364 | 362 |
365 private: | 363 private: |
366 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 364 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
367 HBasicBlock* block_; | 365 HBasicBlock* block_; |
368 }; | 366 }; |
369 | 367 |
370 | 368 |
371 class LInstructionGap V8_FINAL : public LGap { | 369 class LInstructionGap V8_FINAL : public LGap { |
372 public: | 370 public: |
373 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 371 explicit LInstructionGap(HBasicBlock* block) : LGap(block) {} |
374 | 372 |
375 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 373 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
376 return !IsRedundant(); | 374 return !IsRedundant(); |
377 } | 375 } |
378 | 376 |
379 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 377 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
380 }; | 378 }; |
381 | 379 |
382 | 380 |
383 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 381 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
384 public: | 382 public: |
385 explicit LGoto(HBasicBlock* block) : block_(block) { } | 383 explicit LGoto(HBasicBlock* block) : block_(block) {} |
386 | 384 |
387 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 385 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; |
388 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 386 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
389 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 387 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
390 virtual bool IsControl() const V8_OVERRIDE { return true; } | 388 virtual bool IsControl() const V8_OVERRIDE { return true; } |
391 | 389 |
392 int block_id() const { return block_->block_id(); } | 390 int block_id() const { return block_->block_id(); } |
393 | 391 |
394 private: | 392 private: |
395 HBasicBlock* block_; | 393 HBasicBlock* block_; |
396 }; | 394 }; |
397 | 395 |
398 | 396 |
399 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 397 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
400 public: | 398 public: |
401 LLazyBailout() : gap_instructions_size_(0) { } | 399 LLazyBailout() : gap_instructions_size_(0) {} |
402 | 400 |
403 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 401 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
404 | 402 |
405 void set_gap_instructions_size(int gap_instructions_size) { | 403 void set_gap_instructions_size(int gap_instructions_size) { |
406 gap_instructions_size_ = gap_instructions_size; | 404 gap_instructions_size_ = gap_instructions_size; |
407 } | 405 } |
408 int gap_instructions_size() { return gap_instructions_size_; } | 406 int gap_instructions_size() { return gap_instructions_size_; } |
409 | 407 |
410 private: | 408 private: |
411 int gap_instructions_size_; | 409 int gap_instructions_size_; |
412 }; | 410 }; |
413 | 411 |
414 | 412 |
415 class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 413 class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
416 public: | 414 public: |
417 LDummy() {} | 415 LDummy() {} |
418 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") | 416 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") |
419 }; | 417 }; |
420 | 418 |
421 | 419 |
422 class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 420 class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
423 public: | 421 public: |
424 explicit LDummyUse(LOperand* value) { | 422 explicit LDummyUse(LOperand* value) { inputs_[0] = value; } |
425 inputs_[0] = value; | |
426 } | |
427 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") | 423 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") |
428 }; | 424 }; |
429 | 425 |
430 | 426 |
431 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 427 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
432 public: | 428 public: |
433 virtual bool IsControl() const V8_OVERRIDE { return true; } | 429 virtual bool IsControl() const V8_OVERRIDE { return true; } |
434 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 430 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
435 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) | 431 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) |
436 }; | 432 }; |
437 | 433 |
438 | 434 |
439 class LLabel V8_FINAL : public LGap { | 435 class LLabel V8_FINAL : public LGap { |
440 public: | 436 public: |
441 explicit LLabel(HBasicBlock* block) | 437 explicit LLabel(HBasicBlock* block) : LGap(block), replacement_(NULL) {} |
442 : LGap(block), replacement_(NULL) { } | |
443 | 438 |
444 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 439 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
445 return false; | 440 return false; |
446 } | 441 } |
447 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 442 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
448 | 443 |
449 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 444 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
450 | 445 |
451 int block_id() const { return block()->block_id(); } | 446 int block_id() const { return block()->block_id(); } |
452 bool is_loop_header() const { return block()->IsLoopHeader(); } | 447 bool is_loop_header() const { return block()->IsLoopHeader(); } |
(...skipping 11 matching lines...) Expand all Loading... |
464 | 459 |
465 class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 460 class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
466 public: | 461 public: |
467 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } | 462 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
468 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 463 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
469 }; | 464 }; |
470 | 465 |
471 | 466 |
472 class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 467 class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
473 public: | 468 public: |
474 explicit LCallStub(LOperand* context) { | 469 explicit LCallStub(LOperand* context) { inputs_[0] = context; } |
475 inputs_[0] = context; | |
476 } | |
477 | 470 |
478 LOperand* context() { return inputs_[0]; } | 471 LOperand* context() { return inputs_[0]; } |
479 | 472 |
480 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 473 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
481 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 474 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
482 }; | 475 }; |
483 | 476 |
484 | 477 |
485 class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 478 class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
486 public: | 479 public: |
487 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 480 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
488 return false; | 481 return false; |
489 } | 482 } |
490 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 483 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
491 }; | 484 }; |
492 | 485 |
493 | 486 |
494 template<int I, int T> | 487 template <int I, int T> |
495 class LControlInstruction : public LTemplateInstruction<0, I, T> { | 488 class LControlInstruction : public LTemplateInstruction<0, I, T> { |
496 public: | 489 public: |
497 LControlInstruction() : false_label_(NULL), true_label_(NULL) { } | 490 LControlInstruction() : false_label_(NULL), true_label_(NULL) {} |
498 | 491 |
499 virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; } | 492 virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; } |
500 | 493 |
501 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 494 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
502 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } | 495 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } |
503 | 496 |
504 int TrueDestination(LChunk* chunk) { | 497 int TrueDestination(LChunk* chunk) { |
505 return chunk->LookupDestination(true_block_id()); | 498 return chunk->LookupDestination(true_block_id()); |
506 } | 499 } |
507 int FalseDestination(LChunk* chunk) { | 500 int FalseDestination(LChunk* chunk) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") | 538 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") |
546 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) | 539 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) |
547 | 540 |
548 LOperand* receiver() { return inputs_[0]; } | 541 LOperand* receiver() { return inputs_[0]; } |
549 LOperand* function() { return inputs_[1]; } | 542 LOperand* function() { return inputs_[1]; } |
550 }; | 543 }; |
551 | 544 |
552 | 545 |
553 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> { | 546 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> { |
554 public: | 547 public: |
555 LApplyArguments(LOperand* function, | 548 LApplyArguments(LOperand* function, LOperand* receiver, LOperand* length, |
556 LOperand* receiver, | |
557 LOperand* length, | |
558 LOperand* elements) { | 549 LOperand* elements) { |
559 inputs_[0] = function; | 550 inputs_[0] = function; |
560 inputs_[1] = receiver; | 551 inputs_[1] = receiver; |
561 inputs_[2] = length; | 552 inputs_[2] = length; |
562 inputs_[3] = elements; | 553 inputs_[3] = elements; |
563 } | 554 } |
564 | 555 |
565 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") | 556 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") |
566 | 557 |
567 LOperand* function() { return inputs_[0]; } | 558 LOperand* function() { return inputs_[0]; } |
(...skipping 16 matching lines...) Expand all Loading... |
584 LOperand* arguments() { return inputs_[0]; } | 575 LOperand* arguments() { return inputs_[0]; } |
585 LOperand* length() { return inputs_[1]; } | 576 LOperand* length() { return inputs_[1]; } |
586 LOperand* index() { return inputs_[2]; } | 577 LOperand* index() { return inputs_[2]; } |
587 | 578 |
588 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 579 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
589 }; | 580 }; |
590 | 581 |
591 | 582 |
592 class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 583 class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
593 public: | 584 public: |
594 explicit LArgumentsLength(LOperand* elements) { | 585 explicit LArgumentsLength(LOperand* elements) { inputs_[0] = elements; } |
595 inputs_[0] = elements; | |
596 } | |
597 | 586 |
598 LOperand* elements() { return inputs_[0]; } | 587 LOperand* elements() { return inputs_[0]; } |
599 | 588 |
600 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") | 589 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
601 }; | 590 }; |
602 | 591 |
603 | 592 |
604 class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 593 class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
605 public: | 594 public: |
606 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") | 595 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") |
(...skipping 30 matching lines...) Expand all Loading... |
637 int32_t divisor() const { return divisor_; } | 626 int32_t divisor() const { return divisor_; } |
638 | 627 |
639 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") | 628 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") |
640 DECLARE_HYDROGEN_ACCESSOR(Mod) | 629 DECLARE_HYDROGEN_ACCESSOR(Mod) |
641 | 630 |
642 private: | 631 private: |
643 int32_t divisor_; | 632 int32_t divisor_; |
644 }; | 633 }; |
645 | 634 |
646 | 635 |
647 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 2> { | 636 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
648 public: | 637 public: |
649 LModI(LOperand* left, LOperand* right, LOperand* temp, LOperand* temp2) { | 638 LModI(LOperand* left, LOperand* right) { |
650 inputs_[0] = left; | 639 inputs_[0] = left; |
651 inputs_[1] = right; | 640 inputs_[1] = right; |
652 temps_[0] = temp; | |
653 temps_[1] = temp2; | |
654 } | 641 } |
655 | 642 |
656 LOperand* left() { return inputs_[0]; } | 643 LOperand* left() { return inputs_[0]; } |
657 LOperand* right() { return inputs_[1]; } | 644 LOperand* right() { return inputs_[1]; } |
658 LOperand* temp() { return temps_[0]; } | |
659 LOperand* temp2() { return temps_[1]; } | |
660 | 645 |
661 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") | 646 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") |
662 DECLARE_HYDROGEN_ACCESSOR(Mod) | 647 DECLARE_HYDROGEN_ACCESSOR(Mod) |
663 }; | 648 }; |
664 | 649 |
665 | 650 |
666 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 651 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
667 public: | 652 public: |
668 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 653 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
669 inputs_[0] = dividend; | 654 inputs_[0] = dividend; |
(...skipping 22 matching lines...) Expand all Loading... |
692 int32_t divisor() const { return divisor_; } | 677 int32_t divisor() const { return divisor_; } |
693 | 678 |
694 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") | 679 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") |
695 DECLARE_HYDROGEN_ACCESSOR(Div) | 680 DECLARE_HYDROGEN_ACCESSOR(Div) |
696 | 681 |
697 private: | 682 private: |
698 int32_t divisor_; | 683 int32_t divisor_; |
699 }; | 684 }; |
700 | 685 |
701 | 686 |
702 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 687 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
703 public: | 688 public: |
704 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 689 LDivI(LOperand* dividend, LOperand* divisor) { |
705 inputs_[0] = dividend; | 690 inputs_[0] = dividend; |
706 inputs_[1] = divisor; | 691 inputs_[1] = divisor; |
707 temps_[0] = temp; | |
708 } | 692 } |
709 | 693 |
710 LOperand* dividend() { return inputs_[0]; } | 694 LOperand* dividend() { return inputs_[0]; } |
711 LOperand* divisor() { return inputs_[1]; } | 695 LOperand* divisor() { return inputs_[1]; } |
712 LOperand* temp() { return temps_[0]; } | |
713 | 696 |
714 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 697 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
715 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) | 698 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) |
716 }; | 699 }; |
717 | 700 |
718 | 701 |
719 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 702 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
720 public: | 703 public: |
721 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 704 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
722 inputs_[0] = dividend; | 705 inputs_[0] = dividend; |
723 divisor_ = divisor; | 706 divisor_ = divisor; |
724 } | 707 } |
725 | 708 |
726 LOperand* dividend() { return inputs_[0]; } | 709 LOperand* dividend() { return inputs_[0]; } |
727 int32_t divisor() { return divisor_; } | 710 int32_t divisor() { return divisor_; } |
728 | 711 |
729 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, | 712 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
730 "flooring-div-by-power-of-2-i") | 713 "flooring-div-by-power-of-2-i") |
731 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 714 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
732 | 715 |
733 private: | 716 private: |
734 int32_t divisor_; | 717 int32_t divisor_; |
735 }; | 718 }; |
736 | 719 |
737 | 720 |
738 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 721 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
739 public: | 722 public: |
740 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | 723 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
741 inputs_[0] = dividend; | 724 inputs_[0] = dividend; |
742 divisor_ = divisor; | 725 divisor_ = divisor; |
743 temps_[0] = temp; | 726 temps_[0] = temp; |
744 } | 727 } |
745 | 728 |
746 LOperand* dividend() { return inputs_[0]; } | 729 LOperand* dividend() { return inputs_[0]; } |
747 int32_t divisor() const { return divisor_; } | 730 int32_t divisor() const { return divisor_; } |
748 LOperand* temp() { return temps_[0]; } | 731 LOperand* temp() { return temps_[0]; } |
749 | 732 |
750 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") | 733 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") |
751 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 734 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
752 | 735 |
753 private: | 736 private: |
754 int32_t divisor_; | 737 int32_t divisor_; |
755 }; | 738 }; |
756 | 739 |
757 | 740 |
758 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 741 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
759 public: | 742 public: |
760 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 743 LFlooringDivI(LOperand* dividend, LOperand* divisor) { |
761 inputs_[0] = dividend; | 744 inputs_[0] = dividend; |
762 inputs_[1] = divisor; | 745 inputs_[1] = divisor; |
763 temps_[0] = temp; | |
764 } | 746 } |
765 | 747 |
766 LOperand* dividend() { return inputs_[0]; } | 748 LOperand* dividend() { return inputs_[0]; } |
767 LOperand* divisor() { return inputs_[1]; } | 749 LOperand* divisor() { return inputs_[1]; } |
768 LOperand* temp() { return temps_[0]; } | |
769 | 750 |
770 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") | 751 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") |
771 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 752 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
772 }; | 753 }; |
773 | 754 |
774 | 755 |
775 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 756 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
776 public: | 757 public: |
777 LMulI(LOperand* left, LOperand* right) { | 758 LMulI(LOperand* left, LOperand* right) { |
778 inputs_[0] = left; | 759 inputs_[0] = left; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 } | 818 } |
838 | 819 |
839 LOperand* left() { return inputs_[0]; } | 820 LOperand* left() { return inputs_[0]; } |
840 LOperand* right() { return inputs_[1]; } | 821 LOperand* right() { return inputs_[1]; } |
841 | 822 |
842 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, | 823 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, |
843 "compare-numeric-and-branch") | 824 "compare-numeric-and-branch") |
844 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) | 825 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) |
845 | 826 |
846 Token::Value op() const { return hydrogen()->token(); } | 827 Token::Value op() const { return hydrogen()->token(); } |
847 bool is_double() const { | 828 bool is_double() const { return hydrogen()->representation().IsDouble(); } |
848 return hydrogen()->representation().IsDouble(); | |
849 } | |
850 | 829 |
851 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 830 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
852 }; | 831 }; |
853 | 832 |
854 | 833 |
855 class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 834 class LMathFloor V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
856 public: | 835 public: |
857 explicit LMathFloor(LOperand* value) { | 836 explicit LMathFloor(LOperand* value) { inputs_[0] = value; } |
858 inputs_[0] = value; | |
859 } | |
860 | 837 |
861 LOperand* value() { return inputs_[0]; } | 838 LOperand* value() { return inputs_[0]; } |
862 | 839 |
863 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") | 840 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") |
864 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 841 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
865 }; | 842 }; |
866 | 843 |
867 | 844 |
868 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 845 class LMathRound V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
869 public: | 846 public: |
(...skipping 30 matching lines...) Expand all Loading... |
900 LOperand* context() { return inputs_[1]; } | 877 LOperand* context() { return inputs_[1]; } |
901 LOperand* value() { return inputs_[0]; } | 878 LOperand* value() { return inputs_[0]; } |
902 | 879 |
903 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") | 880 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") |
904 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 881 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
905 }; | 882 }; |
906 | 883 |
907 | 884 |
908 class LMathLog V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 885 class LMathLog V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
909 public: | 886 public: |
910 explicit LMathLog(LOperand* value) { | 887 explicit LMathLog(LOperand* value) { inputs_[0] = value; } |
911 inputs_[0] = value; | |
912 } | |
913 | 888 |
914 LOperand* value() { return inputs_[0]; } | 889 LOperand* value() { return inputs_[0]; } |
915 | 890 |
916 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") | 891 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
917 }; | 892 }; |
918 | 893 |
919 | 894 |
920 class LMathClz32 V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 895 class LMathClz32 V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
921 public: | 896 public: |
922 explicit LMathClz32(LOperand* value) { | 897 explicit LMathClz32(LOperand* value) { inputs_[0] = value; } |
923 inputs_[0] = value; | |
924 } | |
925 | 898 |
926 LOperand* value() { return inputs_[0]; } | 899 LOperand* value() { return inputs_[0]; } |
927 | 900 |
928 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") | 901 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") |
929 }; | 902 }; |
930 | 903 |
931 | 904 |
932 class LMathExp V8_FINAL : public LTemplateInstruction<1, 1, 3> { | 905 class LMathExp V8_FINAL : public LTemplateInstruction<1, 1, 3> { |
933 public: | 906 public: |
934 LMathExp(LOperand* value, | 907 LMathExp(LOperand* value, LOperand* double_temp, LOperand* temp1, |
935 LOperand* double_temp, | |
936 LOperand* temp1, | |
937 LOperand* temp2) { | 908 LOperand* temp2) { |
938 inputs_[0] = value; | 909 inputs_[0] = value; |
939 temps_[0] = temp1; | 910 temps_[0] = temp1; |
940 temps_[1] = temp2; | 911 temps_[1] = temp2; |
941 temps_[2] = double_temp; | 912 temps_[2] = double_temp; |
942 ExternalReference::InitializeMathExpData(); | 913 ExternalReference::InitializeMathExpData(); |
943 } | 914 } |
944 | 915 |
945 LOperand* value() { return inputs_[0]; } | 916 LOperand* value() { return inputs_[0]; } |
946 LOperand* temp1() { return temps_[0]; } | 917 LOperand* temp1() { return temps_[0]; } |
947 LOperand* temp2() { return temps_[1]; } | 918 LOperand* temp2() { return temps_[1]; } |
948 LOperand* double_temp() { return temps_[2]; } | 919 LOperand* double_temp() { return temps_[2]; } |
949 | 920 |
950 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") | 921 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
951 }; | 922 }; |
952 | 923 |
953 | 924 |
954 class LMathSqrt V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 925 class LMathSqrt V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
955 public: | 926 public: |
956 explicit LMathSqrt(LOperand* value) { | 927 explicit LMathSqrt(LOperand* value) { inputs_[0] = value; } |
957 inputs_[0] = value; | |
958 } | |
959 | 928 |
960 LOperand* value() { return inputs_[0]; } | 929 LOperand* value() { return inputs_[0]; } |
961 | 930 |
962 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") | 931 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
963 }; | 932 }; |
964 | 933 |
965 | 934 |
966 class LMathPowHalf V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 935 class LMathPowHalf V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
967 public: | 936 public: |
968 explicit LMathPowHalf(LOperand* value) { | 937 explicit LMathPowHalf(LOperand* value) { inputs_[0] = value; } |
969 inputs_[0] = value; | |
970 } | |
971 | 938 |
972 LOperand* value() { return inputs_[0]; } | 939 LOperand* value() { return inputs_[0]; } |
973 | 940 |
974 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") | 941 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
975 }; | 942 }; |
976 | 943 |
977 | 944 |
978 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> { | 945 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> { |
979 public: | 946 public: |
980 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 947 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
981 inputs_[0] = left; | 948 inputs_[0] = left; |
982 inputs_[1] = right; | 949 inputs_[1] = right; |
983 } | 950 } |
984 | 951 |
985 LOperand* left() { return inputs_[0]; } | 952 LOperand* left() { return inputs_[0]; } |
986 LOperand* right() { return inputs_[1]; } | 953 LOperand* right() { return inputs_[1]; } |
987 | 954 |
988 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") | 955 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") |
989 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) | 956 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) |
990 }; | 957 }; |
991 | 958 |
992 | 959 |
993 class LCmpHoleAndBranch V8_FINAL : public LControlInstruction<1, 0> { | 960 class LCmpHoleAndBranch V8_FINAL : public LControlInstruction<1, 0> { |
994 public: | 961 public: |
995 explicit LCmpHoleAndBranch(LOperand* object) { | 962 explicit LCmpHoleAndBranch(LOperand* object) { inputs_[0] = object; } |
996 inputs_[0] = object; | |
997 } | |
998 | 963 |
999 LOperand* object() { return inputs_[0]; } | 964 LOperand* object() { return inputs_[0]; } |
1000 | 965 |
1001 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") | 966 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") |
1002 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) | 967 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) |
1003 }; | 968 }; |
1004 | 969 |
1005 | 970 |
1006 class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 971 class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> { |
1007 public: | 972 public: |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1048 | 1013 |
1049 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") | 1014 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") |
1050 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) | 1015 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) |
1051 | 1016 |
1052 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1017 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1053 }; | 1018 }; |
1054 | 1019 |
1055 | 1020 |
1056 class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> { | 1021 class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> { |
1057 public: | 1022 public: |
1058 explicit LIsSmiAndBranch(LOperand* value) { | 1023 explicit LIsSmiAndBranch(LOperand* value) { inputs_[0] = value; } |
1059 inputs_[0] = value; | |
1060 } | |
1061 | 1024 |
1062 LOperand* value() { return inputs_[0]; } | 1025 LOperand* value() { return inputs_[0]; } |
1063 | 1026 |
1064 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 1027 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
1065 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) | 1028 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
1066 | 1029 |
1067 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1030 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1068 }; | 1031 }; |
1069 | 1032 |
1070 | 1033 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) | 1066 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) |
1104 | 1067 |
1105 Token::Value op() const { return hydrogen()->token(); } | 1068 Token::Value op() const { return hydrogen()->token(); } |
1106 | 1069 |
1107 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1070 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1108 }; | 1071 }; |
1109 | 1072 |
1110 | 1073 |
1111 class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 0> { | 1074 class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 0> { |
1112 public: | 1075 public: |
1113 explicit LHasInstanceTypeAndBranch(LOperand* value) { | 1076 explicit LHasInstanceTypeAndBranch(LOperand* value) { inputs_[0] = value; } |
1114 inputs_[0] = value; | |
1115 } | |
1116 | 1077 |
1117 LOperand* value() { return inputs_[0]; } | 1078 LOperand* value() { return inputs_[0]; } |
1118 | 1079 |
1119 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 1080 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
1120 "has-instance-type-and-branch") | 1081 "has-instance-type-and-branch") |
1121 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) | 1082 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) |
1122 | 1083 |
1123 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1084 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1124 }; | 1085 }; |
1125 | 1086 |
1126 | 1087 |
1127 class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1088 class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1128 public: | 1089 public: |
1129 explicit LGetCachedArrayIndex(LOperand* value) { | 1090 explicit LGetCachedArrayIndex(LOperand* value) { inputs_[0] = value; } |
1130 inputs_[0] = value; | |
1131 } | |
1132 | 1091 |
1133 LOperand* value() { return inputs_[0]; } | 1092 LOperand* value() { return inputs_[0]; } |
1134 | 1093 |
1135 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") | 1094 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
1136 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) | 1095 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
1137 }; | 1096 }; |
1138 | 1097 |
1139 | 1098 |
1140 class LHasCachedArrayIndexAndBranch V8_FINAL | 1099 class LHasCachedArrayIndexAndBranch V8_FINAL |
1141 : public LControlInstruction<1, 0> { | 1100 : public LControlInstruction<1, 0> { |
(...skipping 15 matching lines...) Expand all Loading... |
1157 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1116 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 1> { |
1158 public: | 1117 public: |
1159 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { | 1118 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { |
1160 inputs_[0] = value; | 1119 inputs_[0] = value; |
1161 temps_[0] = temp; | 1120 temps_[0] = temp; |
1162 } | 1121 } |
1163 | 1122 |
1164 LOperand* value() { return inputs_[0]; } | 1123 LOperand* value() { return inputs_[0]; } |
1165 LOperand* temp() { return temps_[0]; } | 1124 LOperand* temp() { return temps_[0]; } |
1166 | 1125 |
1167 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 1126 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, "class-of-test-and-branch") |
1168 "class-of-test-and-branch") | |
1169 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) | 1127 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
1170 | 1128 |
1171 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1129 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1172 }; | 1130 }; |
1173 | 1131 |
1174 | 1132 |
1175 class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1133 class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
1176 public: | 1134 public: |
1177 LCmpT(LOperand* context, LOperand* left, LOperand* right) { | 1135 LCmpT(LOperand* context, LOperand* left, LOperand* right) { |
1178 inputs_[0] = context; | 1136 inputs_[0] = context; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 LOperand* temp() { return temps_[0]; } | 1178 LOperand* temp() { return temps_[0]; } |
1221 | 1179 |
1222 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 1180 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
1223 "instance-of-known-global") | 1181 "instance-of-known-global") |
1224 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 1182 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) |
1225 | 1183 |
1226 Handle<JSFunction> function() const { return hydrogen()->function(); } | 1184 Handle<JSFunction> function() const { return hydrogen()->function(); } |
1227 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { | 1185 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { |
1228 return lazy_deopt_env_; | 1186 return lazy_deopt_env_; |
1229 } | 1187 } |
1230 virtual void SetDeferredLazyDeoptimizationEnvironment( | 1188 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) |
1231 LEnvironment* env) V8_OVERRIDE { | 1189 V8_OVERRIDE { |
1232 lazy_deopt_env_ = env; | 1190 lazy_deopt_env_ = env; |
1233 } | 1191 } |
1234 | 1192 |
1235 private: | 1193 private: |
1236 LEnvironment* lazy_deopt_env_; | 1194 LEnvironment* lazy_deopt_env_; |
1237 }; | 1195 }; |
1238 | 1196 |
1239 | 1197 |
1240 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { | 1198 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { |
1241 public: | 1199 public: |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1322 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1365 | 1323 |
1366 Handle<Object> value(Isolate* isolate) const { | 1324 Handle<Object> value(Isolate* isolate) const { |
1367 return hydrogen()->handle(isolate); | 1325 return hydrogen()->handle(isolate); |
1368 } | 1326 } |
1369 }; | 1327 }; |
1370 | 1328 |
1371 | 1329 |
1372 class LBranch V8_FINAL : public LControlInstruction<1, 0> { | 1330 class LBranch V8_FINAL : public LControlInstruction<1, 0> { |
1373 public: | 1331 public: |
1374 explicit LBranch(LOperand* value) { | 1332 explicit LBranch(LOperand* value) { inputs_[0] = value; } |
1375 inputs_[0] = value; | |
1376 } | |
1377 | 1333 |
1378 LOperand* value() { return inputs_[0]; } | 1334 LOperand* value() { return inputs_[0]; } |
1379 | 1335 |
1380 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 1336 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
1381 DECLARE_HYDROGEN_ACCESSOR(Branch) | 1337 DECLARE_HYDROGEN_ACCESSOR(Branch) |
1382 | 1338 |
1383 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1339 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1384 }; | 1340 }; |
1385 | 1341 |
1386 | 1342 |
1387 class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1343 class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> { |
1388 public: | 1344 public: |
1389 LCmpMapAndBranch(LOperand* value, LOperand* temp) { | 1345 LCmpMapAndBranch(LOperand* value, LOperand* temp) { |
1390 inputs_[0] = value; | 1346 inputs_[0] = value; |
1391 temps_[0] = temp; | 1347 temps_[0] = temp; |
1392 } | 1348 } |
1393 | 1349 |
1394 LOperand* value() { return inputs_[0]; } | 1350 LOperand* value() { return inputs_[0]; } |
1395 LOperand* temp() { return temps_[0]; } | 1351 LOperand* temp() { return temps_[0]; } |
1396 | 1352 |
1397 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1353 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
1398 DECLARE_HYDROGEN_ACCESSOR(CompareMap) | 1354 DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
1399 | 1355 |
1400 Handle<Map> map() const { return hydrogen()->map().handle(); } | 1356 Handle<Map> map() const { return hydrogen()->map().handle(); } |
1401 }; | 1357 }; |
1402 | 1358 |
1403 | 1359 |
1404 class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1360 class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1405 public: | 1361 public: |
1406 explicit LMapEnumLength(LOperand* value) { | 1362 explicit LMapEnumLength(LOperand* value) { inputs_[0] = value; } |
1407 inputs_[0] = value; | |
1408 } | |
1409 | 1363 |
1410 LOperand* value() { return inputs_[0]; } | 1364 LOperand* value() { return inputs_[0]; } |
1411 | 1365 |
1412 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") | 1366 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") |
1413 }; | 1367 }; |
1414 | 1368 |
1415 | 1369 |
1416 class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 1370 class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
1417 public: | 1371 public: |
1418 LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { | 1372 LDateField(LOperand* date, LOperand* temp, Smi* index) : index_(index) { |
(...skipping 23 matching lines...) Expand all Loading... |
1442 LOperand* string() const { return inputs_[0]; } | 1396 LOperand* string() const { return inputs_[0]; } |
1443 LOperand* index() const { return inputs_[1]; } | 1397 LOperand* index() const { return inputs_[1]; } |
1444 | 1398 |
1445 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") | 1399 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") |
1446 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) | 1400 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) |
1447 }; | 1401 }; |
1448 | 1402 |
1449 | 1403 |
1450 class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> { | 1404 class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 0> { |
1451 public: | 1405 public: |
1452 LSeqStringSetChar(LOperand* context, | 1406 LSeqStringSetChar(LOperand* context, LOperand* string, LOperand* index, |
1453 LOperand* string, | |
1454 LOperand* index, | |
1455 LOperand* value) { | 1407 LOperand* value) { |
1456 inputs_[0] = context; | 1408 inputs_[0] = context; |
1457 inputs_[1] = string; | 1409 inputs_[1] = string; |
1458 inputs_[2] = index; | 1410 inputs_[2] = index; |
1459 inputs_[3] = value; | 1411 inputs_[3] = value; |
1460 } | 1412 } |
1461 | 1413 |
1462 LOperand* string() { return inputs_[1]; } | 1414 LOperand* string() { return inputs_[1]; } |
1463 LOperand* index() { return inputs_[2]; } | 1415 LOperand* index() { return inputs_[2]; } |
1464 LOperand* value() { return inputs_[3]; } | 1416 LOperand* value() { return inputs_[3]; } |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1508 LOperand* left() { return inputs_[0]; } | 1460 LOperand* left() { return inputs_[0]; } |
1509 LOperand* right() { return inputs_[1]; } | 1461 LOperand* right() { return inputs_[1]; } |
1510 | 1462 |
1511 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | 1463 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
1512 DECLARE_HYDROGEN_ACCESSOR(Power) | 1464 DECLARE_HYDROGEN_ACCESSOR(Power) |
1513 }; | 1465 }; |
1514 | 1466 |
1515 | 1467 |
1516 class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1468 class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
1517 public: | 1469 public: |
1518 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) | 1470 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) : op_(op) { |
1519 : op_(op) { | |
1520 inputs_[0] = left; | 1471 inputs_[0] = left; |
1521 inputs_[1] = right; | 1472 inputs_[1] = right; |
1522 } | 1473 } |
1523 | 1474 |
1524 Token::Value op() const { return op_; } | 1475 Token::Value op() const { return op_; } |
1525 LOperand* left() { return inputs_[0]; } | 1476 LOperand* left() { return inputs_[0]; } |
1526 LOperand* right() { return inputs_[1]; } | 1477 LOperand* right() { return inputs_[1]; } |
1527 | 1478 |
1528 virtual Opcode opcode() const V8_OVERRIDE { | 1479 virtual Opcode opcode() const V8_OVERRIDE { |
1529 return LInstruction::kArithmeticD; | 1480 return LInstruction::kArithmeticD; |
1530 } | 1481 } |
1531 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; | 1482 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; |
1532 virtual const char* Mnemonic() const V8_OVERRIDE; | 1483 virtual const char* Mnemonic() const V8_OVERRIDE; |
1533 | 1484 |
1534 private: | 1485 private: |
1535 Token::Value op_; | 1486 Token::Value op_; |
1536 }; | 1487 }; |
1537 | 1488 |
1538 | 1489 |
1539 class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1490 class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
1540 public: | 1491 public: |
1541 LArithmeticT(Token::Value op, | 1492 LArithmeticT(Token::Value op, LOperand* context, LOperand* left, |
1542 LOperand* context, | |
1543 LOperand* left, | |
1544 LOperand* right) | 1493 LOperand* right) |
1545 : op_(op) { | 1494 : op_(op) { |
1546 inputs_[0] = context; | 1495 inputs_[0] = context; |
1547 inputs_[1] = left; | 1496 inputs_[1] = left; |
1548 inputs_[2] = right; | 1497 inputs_[2] = right; |
1549 } | 1498 } |
1550 | 1499 |
1551 LOperand* context() { return inputs_[0]; } | 1500 LOperand* context() { return inputs_[0]; } |
1552 LOperand* left() { return inputs_[1]; } | 1501 LOperand* left() { return inputs_[1]; } |
1553 LOperand* right() { return inputs_[2]; } | 1502 LOperand* right() { return inputs_[2]; } |
(...skipping 28 matching lines...) Expand all Loading... |
1582 return LConstantOperand::cast(parameter_count()); | 1531 return LConstantOperand::cast(parameter_count()); |
1583 } | 1532 } |
1584 LOperand* parameter_count() { return inputs_[2]; } | 1533 LOperand* parameter_count() { return inputs_[2]; } |
1585 | 1534 |
1586 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1535 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
1587 }; | 1536 }; |
1588 | 1537 |
1589 | 1538 |
1590 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1539 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1591 public: | 1540 public: |
1592 explicit LLoadNamedField(LOperand* object) { | 1541 explicit LLoadNamedField(LOperand* object) { inputs_[0] = object; } |
1593 inputs_[0] = object; | |
1594 } | |
1595 | 1542 |
1596 LOperand* object() { return inputs_[0]; } | 1543 LOperand* object() { return inputs_[0]; } |
1597 | 1544 |
1598 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1545 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
1599 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1546 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
1600 }; | 1547 }; |
1601 | 1548 |
1602 | 1549 |
1603 class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1550 class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> { |
1604 public: | 1551 public: |
1605 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { | 1552 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { |
1606 inputs_[0] = context; | 1553 inputs_[0] = context; |
1607 inputs_[1] = object; | 1554 inputs_[1] = object; |
1608 temps_[0] = vector; | 1555 temps_[0] = vector; |
1609 } | 1556 } |
1610 | 1557 |
1611 LOperand* context() { return inputs_[0]; } | 1558 LOperand* context() { return inputs_[0]; } |
1612 LOperand* object() { return inputs_[1]; } | 1559 LOperand* object() { return inputs_[1]; } |
1613 LOperand* temp_vector() { return temps_[0]; } | 1560 LOperand* temp_vector() { return temps_[0]; } |
1614 | 1561 |
1615 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1562 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
1616 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1563 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
1617 | 1564 |
1618 Handle<Object> name() const { return hydrogen()->name(); } | 1565 Handle<Object> name() const { return hydrogen()->name(); } |
1619 }; | 1566 }; |
1620 | 1567 |
1621 | 1568 |
1622 class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1569 class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1623 public: | 1570 public: |
1624 explicit LLoadFunctionPrototype(LOperand* function) { | 1571 explicit LLoadFunctionPrototype(LOperand* function) { inputs_[0] = function; } |
1625 inputs_[0] = function; | |
1626 } | |
1627 | 1572 |
1628 LOperand* function() { return inputs_[0]; } | 1573 LOperand* function() { return inputs_[0]; } |
1629 | 1574 |
1630 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1575 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
1631 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1576 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
1632 }; | 1577 }; |
1633 | 1578 |
1634 | 1579 |
1635 class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1580 class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
1636 public: | 1581 public: |
1637 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") | 1582 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") |
1638 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) | 1583 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) |
1639 | 1584 |
1640 Heap::RootListIndex index() const { return hydrogen()->index(); } | 1585 Heap::RootListIndex index() const { return hydrogen()->index(); } |
1641 }; | 1586 }; |
1642 | 1587 |
1643 | 1588 |
1644 class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1589 class LLoadKeyed V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
1645 public: | 1590 public: |
1646 LLoadKeyed(LOperand* elements, LOperand* key) { | 1591 LLoadKeyed(LOperand* elements, LOperand* key) { |
1647 inputs_[0] = elements; | 1592 inputs_[0] = elements; |
1648 inputs_[1] = key; | 1593 inputs_[1] = key; |
1649 } | 1594 } |
1650 | 1595 |
1651 LOperand* elements() { return inputs_[0]; } | 1596 LOperand* elements() { return inputs_[0]; } |
1652 LOperand* key() { return inputs_[1]; } | 1597 LOperand* key() { return inputs_[1]; } |
1653 ElementsKind elements_kind() const { | 1598 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
1654 return hydrogen()->elements_kind(); | 1599 bool is_external() const { return hydrogen()->is_external(); } |
1655 } | |
1656 bool is_external() const { | |
1657 return hydrogen()->is_external(); | |
1658 } | |
1659 bool is_fixed_typed_array() const { | 1600 bool is_fixed_typed_array() const { |
1660 return hydrogen()->is_fixed_typed_array(); | 1601 return hydrogen()->is_fixed_typed_array(); |
1661 } | 1602 } |
1662 bool is_typed_elements() const { | 1603 bool is_typed_elements() const { |
1663 return is_external() || is_fixed_typed_array(); | 1604 return is_external() || is_fixed_typed_array(); |
1664 } | 1605 } |
1665 | 1606 |
1666 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") | 1607 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") |
1667 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) | 1608 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) |
1668 | 1609 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 LOperand* value() { return inputs_[0]; } | 1670 LOperand* value() { return inputs_[0]; } |
1730 LOperand* temp() { return temps_[0]; } | 1671 LOperand* temp() { return temps_[0]; } |
1731 | 1672 |
1732 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 1673 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
1733 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 1674 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
1734 }; | 1675 }; |
1735 | 1676 |
1736 | 1677 |
1737 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1678 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1738 public: | 1679 public: |
1739 explicit LLoadContextSlot(LOperand* context) { | 1680 explicit LLoadContextSlot(LOperand* context) { inputs_[0] = context; } |
1740 inputs_[0] = context; | |
1741 } | |
1742 | 1681 |
1743 LOperand* context() { return inputs_[0]; } | 1682 LOperand* context() { return inputs_[0]; } |
1744 | 1683 |
1745 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1684 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
1746 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1685 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
1747 | 1686 |
1748 int slot_index() { return hydrogen()->slot_index(); } | 1687 int slot_index() { return hydrogen()->slot_index(); } |
1749 | 1688 |
1750 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1689 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1751 }; | 1690 }; |
(...skipping 13 matching lines...) Expand all Loading... |
1765 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) | 1704 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) |
1766 | 1705 |
1767 int slot_index() { return hydrogen()->slot_index(); } | 1706 int slot_index() { return hydrogen()->slot_index(); } |
1768 | 1707 |
1769 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1708 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1770 }; | 1709 }; |
1771 | 1710 |
1772 | 1711 |
1773 class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 1712 class LPushArgument V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
1774 public: | 1713 public: |
1775 explicit LPushArgument(LOperand* value) { | 1714 explicit LPushArgument(LOperand* value) { inputs_[0] = value; } |
1776 inputs_[0] = value; | |
1777 } | |
1778 | 1715 |
1779 LOperand* value() { return inputs_[0]; } | 1716 LOperand* value() { return inputs_[0]; } |
1780 | 1717 |
1781 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1718 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
1782 }; | 1719 }; |
1783 | 1720 |
1784 | 1721 |
1785 class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 1722 class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
1786 public: | 1723 public: |
1787 explicit LDrop(int count) : count_(count) { } | 1724 explicit LDrop(int count) : count_(count) {} |
1788 | 1725 |
1789 int count() const { return count_; } | 1726 int count() const { return count_; } |
1790 | 1727 |
1791 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") | 1728 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") |
1792 | 1729 |
1793 private: | 1730 private: |
1794 int count_; | 1731 int count_; |
1795 }; | 1732 }; |
1796 | 1733 |
1797 | 1734 |
1798 class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 2, 0> { | 1735 class LStoreCodeEntry V8_FINAL : public LTemplateInstruction<0, 2, 0> { |
1799 public: | 1736 public: |
1800 LStoreCodeEntry(LOperand* function, LOperand* code_object) { | 1737 LStoreCodeEntry(LOperand* function, LOperand* code_object) { |
1801 inputs_[0] = function; | 1738 inputs_[0] = function; |
1802 inputs_[1] = code_object; | 1739 inputs_[1] = code_object; |
1803 } | 1740 } |
1804 | 1741 |
1805 LOperand* function() { return inputs_[0]; } | 1742 LOperand* function() { return inputs_[0]; } |
1806 LOperand* code_object() { return inputs_[1]; } | 1743 LOperand* code_object() { return inputs_[1]; } |
1807 | 1744 |
1808 virtual void PrintDataTo(StringStream* stream); | 1745 virtual void PrintDataTo(StringStream* stream); |
1809 | 1746 |
1810 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") | 1747 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") |
1811 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) | 1748 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) |
1812 }; | 1749 }; |
1813 | 1750 |
1814 | 1751 |
1815 class LInnerAllocatedObject V8_FINAL: public LTemplateInstruction<1, 2, 0> { | 1752 class LInnerAllocatedObject V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
1816 public: | 1753 public: |
1817 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { | 1754 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { |
1818 inputs_[0] = base_object; | 1755 inputs_[0] = base_object; |
1819 inputs_[1] = offset; | 1756 inputs_[1] = offset; |
1820 } | 1757 } |
1821 | 1758 |
1822 LOperand* base_object() const { return inputs_[0]; } | 1759 LOperand* base_object() const { return inputs_[0]; } |
1823 LOperand* offset() const { return inputs_[1]; } | 1760 LOperand* offset() const { return inputs_[1]; } |
1824 | 1761 |
1825 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1762 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
(...skipping 11 matching lines...) Expand all Loading... |
1837 | 1774 |
1838 class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1775 class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> { |
1839 public: | 1776 public: |
1840 DECLARE_CONCRETE_INSTRUCTION(Context, "context") | 1777 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
1841 DECLARE_HYDROGEN_ACCESSOR(Context) | 1778 DECLARE_HYDROGEN_ACCESSOR(Context) |
1842 }; | 1779 }; |
1843 | 1780 |
1844 | 1781 |
1845 class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 1782 class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
1846 public: | 1783 public: |
1847 explicit LDeclareGlobals(LOperand* context) { | 1784 explicit LDeclareGlobals(LOperand* context) { inputs_[0] = context; } |
1848 inputs_[0] = context; | |
1849 } | |
1850 | 1785 |
1851 LOperand* context() { return inputs_[0]; } | 1786 LOperand* context() { return inputs_[0]; } |
1852 | 1787 |
1853 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") | 1788 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") |
1854 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) | 1789 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) |
1855 }; | 1790 }; |
1856 | 1791 |
1857 | 1792 |
1858 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1793 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1859 public: | 1794 public: |
1860 explicit LCallJSFunction(LOperand* function) { | 1795 explicit LCallJSFunction(LOperand* function) { inputs_[0] = function; } |
1861 inputs_[0] = function; | |
1862 } | |
1863 | 1796 |
1864 LOperand* function() { return inputs_[0]; } | 1797 LOperand* function() { return inputs_[0]; } |
1865 | 1798 |
1866 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") | 1799 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") |
1867 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) | 1800 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) |
1868 | 1801 |
1869 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1802 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1870 | 1803 |
1871 int arity() const { return hydrogen()->argument_count() - 1; } | 1804 int arity() const { return hydrogen()->argument_count() - 1; } |
1872 }; | 1805 }; |
1873 | 1806 |
1874 | 1807 |
1875 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1808 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { |
1876 public: | 1809 public: |
1877 LCallWithDescriptor(const InterfaceDescriptor* descriptor, | 1810 LCallWithDescriptor(const InterfaceDescriptor* descriptor, |
1878 const ZoneList<LOperand*>& operands, | 1811 const ZoneList<LOperand*>& operands, Zone* zone) |
1879 Zone* zone) | 1812 : descriptor_(descriptor), |
1880 : descriptor_(descriptor), | 1813 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { |
1881 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { | |
1882 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); | 1814 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); |
1883 inputs_.AddAll(operands, zone); | 1815 inputs_.AddAll(operands, zone); |
1884 } | 1816 } |
1885 | 1817 |
1886 LOperand* target() const { return inputs_[0]; } | 1818 LOperand* target() const { return inputs_[0]; } |
1887 | 1819 |
1888 const InterfaceDescriptor* descriptor() { return descriptor_; } | 1820 const InterfaceDescriptor* descriptor() { return descriptor_; } |
1889 | 1821 |
1890 private: | 1822 private: |
1891 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1823 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1976 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) | 1908 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) |
1977 | 1909 |
1978 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1910 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
1979 | 1911 |
1980 int arity() const { return hydrogen()->argument_count() - 1; } | 1912 int arity() const { return hydrogen()->argument_count() - 1; } |
1981 }; | 1913 }; |
1982 | 1914 |
1983 | 1915 |
1984 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1916 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
1985 public: | 1917 public: |
1986 explicit LCallRuntime(LOperand* context) { | 1918 explicit LCallRuntime(LOperand* context) { inputs_[0] = context; } |
1987 inputs_[0] = context; | |
1988 } | |
1989 | 1919 |
1990 LOperand* context() { return inputs_[0]; } | 1920 LOperand* context() { return inputs_[0]; } |
1991 | 1921 |
1992 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1922 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1993 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1923 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1994 | 1924 |
1995 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { | 1925 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { |
1996 return save_doubles() == kDontSaveFPRegs; | 1926 return save_doubles() == kDontSaveFPRegs; |
1997 } | 1927 } |
1998 | 1928 |
1999 const Runtime::Function* function() const { return hydrogen()->function(); } | 1929 const Runtime::Function* function() const { return hydrogen()->function(); } |
2000 int arity() const { return hydrogen()->argument_count(); } | 1930 int arity() const { return hydrogen()->argument_count(); } |
2001 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } | 1931 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
2002 }; | 1932 }; |
2003 | 1933 |
2004 | 1934 |
2005 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1935 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2006 public: | 1936 public: |
2007 explicit LInteger32ToDouble(LOperand* value) { | 1937 explicit LInteger32ToDouble(LOperand* value) { inputs_[0] = value; } |
2008 inputs_[0] = value; | |
2009 } | |
2010 | 1938 |
2011 LOperand* value() { return inputs_[0]; } | 1939 LOperand* value() { return inputs_[0]; } |
2012 | 1940 |
2013 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1941 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
2014 }; | 1942 }; |
2015 | 1943 |
2016 | 1944 |
2017 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1945 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2018 public: | 1946 public: |
2019 explicit LUint32ToDouble(LOperand* value) { | 1947 explicit LUint32ToDouble(LOperand* value) { inputs_[0] = value; } |
2020 inputs_[0] = value; | |
2021 } | |
2022 | 1948 |
2023 LOperand* value() { return inputs_[0]; } | 1949 LOperand* value() { return inputs_[0]; } |
2024 | 1950 |
2025 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 1951 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
2026 }; | 1952 }; |
2027 | 1953 |
2028 | 1954 |
2029 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 1955 class LNumberTagI V8_FINAL : public LTemplateInstruction<1, 1, 2> { |
2030 public: | 1956 public: |
2031 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) { | 1957 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 LOperand* temp() { return temps_[0]; } | 1996 LOperand* temp() { return temps_[0]; } |
2071 LOperand* temp2() { return temps_[1]; } | 1997 LOperand* temp2() { return temps_[1]; } |
2072 | 1998 |
2073 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 1999 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
2074 DECLARE_HYDROGEN_ACCESSOR(Change) | 2000 DECLARE_HYDROGEN_ACCESSOR(Change) |
2075 }; | 2001 }; |
2076 | 2002 |
2077 | 2003 |
2078 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2004 class LDoubleToSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2079 public: | 2005 public: |
2080 explicit LDoubleToSmi(LOperand* value) { | 2006 explicit LDoubleToSmi(LOperand* value) { inputs_[0] = value; } |
2081 inputs_[0] = value; | |
2082 } | |
2083 | 2007 |
2084 LOperand* value() { return inputs_[0]; } | 2008 LOperand* value() { return inputs_[0]; } |
2085 | 2009 |
2086 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") | 2010 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") |
2087 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2011 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
2088 | 2012 |
2089 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2013 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
2090 }; | 2014 }; |
2091 | 2015 |
2092 | 2016 |
2093 // Sometimes truncating conversion from a tagged value to an int32. | 2017 // Sometimes truncating conversion from a tagged value to an int32. |
2094 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2018 class LDoubleToI V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2095 public: | 2019 public: |
2096 explicit LDoubleToI(LOperand* value) { | 2020 explicit LDoubleToI(LOperand* value) { inputs_[0] = value; } |
2097 inputs_[0] = value; | |
2098 } | |
2099 | 2021 |
2100 LOperand* value() { return inputs_[0]; } | 2022 LOperand* value() { return inputs_[0]; } |
2101 | 2023 |
2102 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 2024 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") |
2103 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2025 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
2104 | 2026 |
2105 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2027 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
2106 }; | 2028 }; |
2107 | 2029 |
2108 | 2030 |
2109 // Truncating conversion from a tagged value to an int32. | 2031 // Truncating conversion from a tagged value to an int32. |
2110 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 2032 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 2> { |
2111 public: | 2033 public: |
2112 LTaggedToI(LOperand* value, | 2034 LTaggedToI(LOperand* value, LOperand* temp, LOperand* temp2) { |
2113 LOperand* temp, | |
2114 LOperand* temp2) { | |
2115 inputs_[0] = value; | 2035 inputs_[0] = value; |
2116 temps_[0] = temp; | 2036 temps_[0] = temp; |
2117 temps_[1] = temp2; | 2037 temps_[1] = temp2; |
2118 } | 2038 } |
2119 | 2039 |
2120 LOperand* value() { return inputs_[0]; } | 2040 LOperand* value() { return inputs_[0]; } |
2121 LOperand* temp() { return temps_[0]; } | 2041 LOperand* temp() { return temps_[0]; } |
2122 LOperand* temp2() { return temps_[1]; } | 2042 LOperand* temp2() { return temps_[1]; } |
2123 | 2043 |
2124 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 2044 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
2125 DECLARE_HYDROGEN_ACCESSOR(Change) | 2045 DECLARE_HYDROGEN_ACCESSOR(Change) |
2126 | 2046 |
2127 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2047 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
2128 }; | 2048 }; |
2129 | 2049 |
2130 | 2050 |
2131 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2051 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2132 public: | 2052 public: |
2133 explicit LSmiTag(LOperand* value) { | 2053 explicit LSmiTag(LOperand* value) { inputs_[0] = value; } |
2134 inputs_[0] = value; | |
2135 } | |
2136 | 2054 |
2137 LOperand* value() { return inputs_[0]; } | 2055 LOperand* value() { return inputs_[0]; } |
2138 | 2056 |
2139 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 2057 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
2140 DECLARE_HYDROGEN_ACCESSOR(Change) | 2058 DECLARE_HYDROGEN_ACCESSOR(Change) |
2141 }; | 2059 }; |
2142 | 2060 |
2143 | 2061 |
2144 class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2062 class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2145 public: | 2063 public: |
2146 explicit LNumberUntagD(LOperand* value) { | 2064 explicit LNumberUntagD(LOperand* value) { inputs_[0] = value; } |
2147 inputs_[0] = value; | |
2148 } | |
2149 | 2065 |
2150 LOperand* value() { return inputs_[0]; } | 2066 LOperand* value() { return inputs_[0]; } |
2151 | 2067 |
2152 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 2068 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
2153 DECLARE_HYDROGEN_ACCESSOR(Change) | 2069 DECLARE_HYDROGEN_ACCESSOR(Change) |
2154 }; | 2070 }; |
2155 | 2071 |
2156 | 2072 |
2157 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2073 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2158 public: | 2074 public: |
2159 LSmiUntag(LOperand* value, bool needs_check) | 2075 LSmiUntag(LOperand* value, bool needs_check) : needs_check_(needs_check) { |
2160 : needs_check_(needs_check) { | |
2161 inputs_[0] = value; | 2076 inputs_[0] = value; |
2162 } | 2077 } |
2163 | 2078 |
2164 LOperand* value() { return inputs_[0]; } | 2079 LOperand* value() { return inputs_[0]; } |
2165 bool needs_check() const { return needs_check_; } | 2080 bool needs_check() const { return needs_check_; } |
2166 | 2081 |
2167 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 2082 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
2168 | 2083 |
2169 private: | 2084 private: |
2170 bool needs_check_; | 2085 bool needs_check_; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2227 bool is_external() const { return hydrogen()->is_external(); } | 2142 bool is_external() const { return hydrogen()->is_external(); } |
2228 bool is_fixed_typed_array() const { | 2143 bool is_fixed_typed_array() const { |
2229 return hydrogen()->is_fixed_typed_array(); | 2144 return hydrogen()->is_fixed_typed_array(); |
2230 } | 2145 } |
2231 bool is_typed_elements() const { | 2146 bool is_typed_elements() const { |
2232 return is_external() || is_fixed_typed_array(); | 2147 return is_external() || is_fixed_typed_array(); |
2233 } | 2148 } |
2234 LOperand* elements() { return inputs_[0]; } | 2149 LOperand* elements() { return inputs_[0]; } |
2235 LOperand* key() { return inputs_[1]; } | 2150 LOperand* key() { return inputs_[1]; } |
2236 LOperand* value() { return inputs_[2]; } | 2151 LOperand* value() { return inputs_[2]; } |
2237 ElementsKind elements_kind() const { | 2152 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } |
2238 return hydrogen()->elements_kind(); | |
2239 } | |
2240 | 2153 |
2241 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") | 2154 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") |
2242 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2155 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
2243 | 2156 |
2244 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2157 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2245 bool NeedsCanonicalization() { | 2158 bool NeedsCanonicalization() { |
2246 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || | 2159 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || |
2247 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { | 2160 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { |
2248 return false; | 2161 return false; |
2249 } | 2162 } |
2250 return hydrogen()->NeedsCanonicalization(); | 2163 return hydrogen()->NeedsCanonicalization(); |
2251 } | 2164 } |
2252 uint32_t base_offset() const { return hydrogen()->base_offset(); } | 2165 uint32_t base_offset() const { return hydrogen()->base_offset(); } |
2253 }; | 2166 }; |
2254 | 2167 |
2255 | 2168 |
2256 class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> { | 2169 class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> { |
2257 public: | 2170 public: |
2258 LStoreKeyedGeneric(LOperand* context, | 2171 LStoreKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key, |
2259 LOperand* obj, | |
2260 LOperand* key, | |
2261 LOperand* value) { | 2172 LOperand* value) { |
2262 inputs_[0] = context; | 2173 inputs_[0] = context; |
2263 inputs_[1] = obj; | 2174 inputs_[1] = obj; |
2264 inputs_[2] = key; | 2175 inputs_[2] = key; |
2265 inputs_[3] = value; | 2176 inputs_[3] = value; |
2266 } | 2177 } |
2267 | 2178 |
2268 LOperand* context() { return inputs_[0]; } | 2179 LOperand* context() { return inputs_[0]; } |
2269 LOperand* object() { return inputs_[1]; } | 2180 LOperand* object() { return inputs_[1]; } |
2270 LOperand* key() { return inputs_[2]; } | 2181 LOperand* key() { return inputs_[2]; } |
2271 LOperand* value() { return inputs_[3]; } | 2182 LOperand* value() { return inputs_[3]; } |
2272 | 2183 |
2273 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2184 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
2274 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2185 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
2275 | 2186 |
2276 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2187 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2277 | 2188 |
2278 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2189 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
2279 }; | 2190 }; |
2280 | 2191 |
2281 | 2192 |
2282 class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> { | 2193 class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 1> { |
2283 public: | 2194 public: |
2284 LTransitionElementsKind(LOperand* object, | 2195 LTransitionElementsKind(LOperand* object, LOperand* context, |
2285 LOperand* context, | |
2286 LOperand* new_map_temp) { | 2196 LOperand* new_map_temp) { |
2287 inputs_[0] = object; | 2197 inputs_[0] = object; |
2288 inputs_[1] = context; | 2198 inputs_[1] = context; |
2289 temps_[0] = new_map_temp; | 2199 temps_[0] = new_map_temp; |
2290 } | 2200 } |
2291 | 2201 |
2292 LOperand* context() { return inputs_[1]; } | 2202 LOperand* context() { return inputs_[1]; } |
2293 LOperand* object() { return inputs_[0]; } | 2203 LOperand* object() { return inputs_[0]; } |
2294 LOperand* new_map_temp() { return temps_[0]; } | 2204 LOperand* new_map_temp() { return temps_[0]; } |
2295 | 2205 |
2296 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, | 2206 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
2297 "transition-elements-kind") | 2207 "transition-elements-kind") |
2298 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) | 2208 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
2299 | 2209 |
2300 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2210 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2301 | 2211 |
2302 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } | 2212 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } |
2303 Handle<Map> transitioned_map() { | 2213 Handle<Map> transitioned_map() { |
2304 return hydrogen()->transitioned_map().handle(); | 2214 return hydrogen()->transitioned_map().handle(); |
2305 } | 2215 } |
2306 ElementsKind from_kind() { return hydrogen()->from_kind(); } | 2216 ElementsKind from_kind() { return hydrogen()->from_kind(); } |
2307 ElementsKind to_kind() { return hydrogen()->to_kind(); } | 2217 ElementsKind to_kind() { return hydrogen()->to_kind(); } |
2308 }; | 2218 }; |
2309 | 2219 |
2310 | 2220 |
2311 class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> { | 2221 class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 1> { |
2312 public: | 2222 public: |
2313 LTrapAllocationMemento(LOperand* object, | 2223 LTrapAllocationMemento(LOperand* object, LOperand* temp) { |
2314 LOperand* temp) { | |
2315 inputs_[0] = object; | 2224 inputs_[0] = object; |
2316 temps_[0] = temp; | 2225 temps_[0] = temp; |
2317 } | 2226 } |
2318 | 2227 |
2319 LOperand* object() { return inputs_[0]; } | 2228 LOperand* object() { return inputs_[0]; } |
2320 LOperand* temp() { return temps_[0]; } | 2229 LOperand* temp() { return temps_[0]; } |
2321 | 2230 |
2322 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, | 2231 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") |
2323 "trap-allocation-memento") | |
2324 }; | 2232 }; |
2325 | 2233 |
2326 | 2234 |
2327 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 2235 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
2328 public: | 2236 public: |
2329 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { | 2237 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
2330 inputs_[0] = context; | 2238 inputs_[0] = context; |
2331 inputs_[1] = left; | 2239 inputs_[1] = left; |
2332 inputs_[2] = right; | 2240 inputs_[2] = right; |
2333 } | 2241 } |
2334 | 2242 |
2335 LOperand* context() { return inputs_[0]; } | 2243 LOperand* context() { return inputs_[0]; } |
2336 LOperand* left() { return inputs_[1]; } | 2244 LOperand* left() { return inputs_[1]; } |
2337 LOperand* right() { return inputs_[2]; } | 2245 LOperand* right() { return inputs_[2]; } |
2338 | 2246 |
2339 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") | 2247 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") |
2340 DECLARE_HYDROGEN_ACCESSOR(StringAdd) | 2248 DECLARE_HYDROGEN_ACCESSOR(StringAdd) |
2341 }; | 2249 }; |
2342 | 2250 |
2343 | 2251 |
2344 | |
2345 class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 2252 class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> { |
2346 public: | 2253 public: |
2347 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { | 2254 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { |
2348 inputs_[0] = context; | 2255 inputs_[0] = context; |
2349 inputs_[1] = string; | 2256 inputs_[1] = string; |
2350 inputs_[2] = index; | 2257 inputs_[2] = index; |
2351 } | 2258 } |
2352 | 2259 |
2353 LOperand* context() { return inputs_[0]; } | 2260 LOperand* context() { return inputs_[0]; } |
2354 LOperand* string() { return inputs_[1]; } | 2261 LOperand* string() { return inputs_[1]; } |
(...skipping 14 matching lines...) Expand all Loading... |
2369 LOperand* context() { return inputs_[0]; } | 2276 LOperand* context() { return inputs_[0]; } |
2370 LOperand* char_code() { return inputs_[1]; } | 2277 LOperand* char_code() { return inputs_[1]; } |
2371 | 2278 |
2372 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") | 2279 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
2373 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) | 2280 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
2374 }; | 2281 }; |
2375 | 2282 |
2376 | 2283 |
2377 class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2284 class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2378 public: | 2285 public: |
2379 explicit LCheckValue(LOperand* value) { | 2286 explicit LCheckValue(LOperand* value) { inputs_[0] = value; } |
2380 inputs_[0] = value; | |
2381 } | |
2382 | 2287 |
2383 LOperand* value() { return inputs_[0]; } | 2288 LOperand* value() { return inputs_[0]; } |
2384 | 2289 |
2385 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") | 2290 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") |
2386 DECLARE_HYDROGEN_ACCESSOR(CheckValue) | 2291 DECLARE_HYDROGEN_ACCESSOR(CheckValue) |
2387 }; | 2292 }; |
2388 | 2293 |
2389 | 2294 |
2390 class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2295 class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2391 public: | 2296 public: |
2392 explicit LCheckInstanceType(LOperand* value) { | 2297 explicit LCheckInstanceType(LOperand* value) { inputs_[0] = value; } |
2393 inputs_[0] = value; | |
2394 } | |
2395 | 2298 |
2396 LOperand* value() { return inputs_[0]; } | 2299 LOperand* value() { return inputs_[0]; } |
2397 | 2300 |
2398 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 2301 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
2399 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 2302 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
2400 }; | 2303 }; |
2401 | 2304 |
2402 | 2305 |
2403 class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2306 class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2404 public: | 2307 public: |
2405 explicit LCheckMaps(LOperand* value = NULL) { | 2308 explicit LCheckMaps(LOperand* value = NULL) { inputs_[0] = value; } |
2406 inputs_[0] = value; | |
2407 } | |
2408 | 2309 |
2409 LOperand* value() { return inputs_[0]; } | 2310 LOperand* value() { return inputs_[0]; } |
2410 | 2311 |
2411 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") | 2312 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") |
2412 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) | 2313 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) |
2413 }; | 2314 }; |
2414 | 2315 |
2415 | 2316 |
2416 class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2317 class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2417 public: | 2318 public: |
2418 explicit LCheckSmi(LOperand* value) { | 2319 explicit LCheckSmi(LOperand* value) { inputs_[0] = value; } |
2419 inputs_[0] = value; | |
2420 } | |
2421 | 2320 |
2422 LOperand* value() { return inputs_[0]; } | 2321 LOperand* value() { return inputs_[0]; } |
2423 | 2322 |
2424 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") | 2323 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") |
2425 }; | 2324 }; |
2426 | 2325 |
2427 | 2326 |
2428 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2327 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2429 public: | 2328 public: |
2430 explicit LCheckNonSmi(LOperand* value) { | 2329 explicit LCheckNonSmi(LOperand* value) { inputs_[0] = value; } |
2431 inputs_[0] = value; | |
2432 } | |
2433 | 2330 |
2434 LOperand* value() { return inputs_[0]; } | 2331 LOperand* value() { return inputs_[0]; } |
2435 | 2332 |
2436 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 2333 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
2437 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) | 2334 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) |
2438 }; | 2335 }; |
2439 | 2336 |
2440 | 2337 |
2441 class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2338 class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2442 public: | 2339 public: |
2443 explicit LClampDToUint8(LOperand* unclamped) { | 2340 explicit LClampDToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } |
2444 inputs_[0] = unclamped; | |
2445 } | |
2446 | 2341 |
2447 LOperand* unclamped() { return inputs_[0]; } | 2342 LOperand* unclamped() { return inputs_[0]; } |
2448 | 2343 |
2449 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") | 2344 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") |
2450 }; | 2345 }; |
2451 | 2346 |
2452 | 2347 |
2453 class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2348 class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2454 public: | 2349 public: |
2455 explicit LClampIToUint8(LOperand* unclamped) { | 2350 explicit LClampIToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } |
2456 inputs_[0] = unclamped; | |
2457 } | |
2458 | 2351 |
2459 LOperand* unclamped() { return inputs_[0]; } | 2352 LOperand* unclamped() { return inputs_[0]; } |
2460 | 2353 |
2461 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") | 2354 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") |
2462 }; | 2355 }; |
2463 | 2356 |
2464 | 2357 |
2465 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2358 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 1> { |
2466 public: | 2359 public: |
2467 LClampTToUint8(LOperand* unclamped, LOperand* temp) { | 2360 LClampTToUint8(LOperand* unclamped, LOperand* temp) { |
2468 inputs_[0] = unclamped; | 2361 inputs_[0] = unclamped; |
2469 temps_[0] = temp; | 2362 temps_[0] = temp; |
2470 } | 2363 } |
2471 | 2364 |
2472 LOperand* unclamped() { return inputs_[0]; } | 2365 LOperand* unclamped() { return inputs_[0]; } |
2473 LOperand* temp() { return temps_[0]; } | 2366 LOperand* temp() { return temps_[0]; } |
2474 | 2367 |
2475 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 2368 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
2476 }; | 2369 }; |
2477 | 2370 |
2478 | 2371 |
2479 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2372 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2480 public: | 2373 public: |
2481 explicit LDoubleBits(LOperand* value) { | 2374 explicit LDoubleBits(LOperand* value) { inputs_[0] = value; } |
2482 inputs_[0] = value; | |
2483 } | |
2484 | 2375 |
2485 LOperand* value() { return inputs_[0]; } | 2376 LOperand* value() { return inputs_[0]; } |
2486 | 2377 |
2487 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") | 2378 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") |
2488 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) | 2379 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) |
2489 }; | 2380 }; |
2490 | 2381 |
2491 | 2382 |
2492 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2383 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
2493 public: | 2384 public: |
2494 LConstructDouble(LOperand* hi, LOperand* lo) { | 2385 LConstructDouble(LOperand* hi, LOperand* lo) { |
2495 inputs_[0] = hi; | 2386 inputs_[0] = hi; |
2496 inputs_[1] = lo; | 2387 inputs_[1] = lo; |
2497 } | 2388 } |
2498 | 2389 |
2499 LOperand* hi() { return inputs_[0]; } | 2390 LOperand* hi() { return inputs_[0]; } |
2500 LOperand* lo() { return inputs_[1]; } | 2391 LOperand* lo() { return inputs_[1]; } |
2501 | 2392 |
2502 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") | 2393 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") |
2503 }; | 2394 }; |
2504 | 2395 |
2505 | 2396 |
2506 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> { | 2397 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 2> { |
2507 public: | 2398 public: |
2508 LAllocate(LOperand* context, | 2399 LAllocate(LOperand* context, LOperand* size, LOperand* temp1, |
2509 LOperand* size, | |
2510 LOperand* temp1, | |
2511 LOperand* temp2) { | 2400 LOperand* temp2) { |
2512 inputs_[0] = context; | 2401 inputs_[0] = context; |
2513 inputs_[1] = size; | 2402 inputs_[1] = size; |
2514 temps_[0] = temp1; | 2403 temps_[0] = temp1; |
2515 temps_[1] = temp2; | 2404 temps_[1] = temp2; |
2516 } | 2405 } |
2517 | 2406 |
2518 LOperand* context() { return inputs_[0]; } | 2407 LOperand* context() { return inputs_[0]; } |
2519 LOperand* size() { return inputs_[1]; } | 2408 LOperand* size() { return inputs_[1]; } |
2520 LOperand* temp1() { return temps_[0]; } | 2409 LOperand* temp1() { return temps_[0]; } |
2521 LOperand* temp2() { return temps_[1]; } | 2410 LOperand* temp2() { return temps_[1]; } |
2522 | 2411 |
2523 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") | 2412 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
2524 DECLARE_HYDROGEN_ACCESSOR(Allocate) | 2413 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
2525 }; | 2414 }; |
2526 | 2415 |
2527 | 2416 |
2528 class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2417 class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2529 public: | 2418 public: |
2530 explicit LRegExpLiteral(LOperand* context) { | 2419 explicit LRegExpLiteral(LOperand* context) { inputs_[0] = context; } |
2531 inputs_[0] = context; | |
2532 } | |
2533 | 2420 |
2534 LOperand* context() { return inputs_[0]; } | 2421 LOperand* context() { return inputs_[0]; } |
2535 | 2422 |
2536 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") | 2423 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
2537 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) | 2424 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
2538 }; | 2425 }; |
2539 | 2426 |
2540 | 2427 |
2541 class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2428 class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2542 public: | 2429 public: |
2543 explicit LFunctionLiteral(LOperand* context) { | 2430 explicit LFunctionLiteral(LOperand* context) { inputs_[0] = context; } |
2544 inputs_[0] = context; | |
2545 } | |
2546 | 2431 |
2547 LOperand* context() { return inputs_[0]; } | 2432 LOperand* context() { return inputs_[0]; } |
2548 | 2433 |
2549 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 2434 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
2550 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 2435 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
2551 }; | 2436 }; |
2552 | 2437 |
2553 | 2438 |
2554 class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2439 class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2555 public: | 2440 public: |
2556 explicit LToFastProperties(LOperand* value) { | 2441 explicit LToFastProperties(LOperand* value) { inputs_[0] = value; } |
2557 inputs_[0] = value; | |
2558 } | |
2559 | 2442 |
2560 LOperand* value() { return inputs_[0]; } | 2443 LOperand* value() { return inputs_[0]; } |
2561 | 2444 |
2562 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") | 2445 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") |
2563 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) | 2446 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) |
2564 }; | 2447 }; |
2565 | 2448 |
2566 | 2449 |
2567 class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2450 class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
2568 public: | 2451 public: |
2569 LTypeof(LOperand* context, LOperand* value) { | 2452 LTypeof(LOperand* context, LOperand* value) { |
2570 inputs_[0] = context; | 2453 inputs_[0] = context; |
2571 inputs_[1] = value; | 2454 inputs_[1] = value; |
2572 } | 2455 } |
2573 | 2456 |
2574 LOperand* context() { return inputs_[0]; } | 2457 LOperand* context() { return inputs_[0]; } |
2575 LOperand* value() { return inputs_[1]; } | 2458 LOperand* value() { return inputs_[1]; } |
2576 | 2459 |
2577 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 2460 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
2578 }; | 2461 }; |
2579 | 2462 |
2580 | 2463 |
2581 class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 0> { | 2464 class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 0> { |
2582 public: | 2465 public: |
2583 explicit LTypeofIsAndBranch(LOperand* value) { | 2466 explicit LTypeofIsAndBranch(LOperand* value) { inputs_[0] = value; } |
2584 inputs_[0] = value; | |
2585 } | |
2586 | 2467 |
2587 LOperand* value() { return inputs_[0]; } | 2468 LOperand* value() { return inputs_[0]; } |
2588 | 2469 |
2589 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 2470 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
2590 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) | 2471 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
2591 | 2472 |
2592 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 2473 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
2593 | 2474 |
2594 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2475 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; |
2595 }; | 2476 }; |
2596 | 2477 |
2597 | 2478 |
2598 class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 1> { | 2479 class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 1> { |
2599 public: | 2480 public: |
2600 explicit LIsConstructCallAndBranch(LOperand* temp) { | 2481 explicit LIsConstructCallAndBranch(LOperand* temp) { temps_[0] = temp; } |
2601 temps_[0] = temp; | |
2602 } | |
2603 | 2482 |
2604 LOperand* temp() { return temps_[0]; } | 2483 LOperand* temp() { return temps_[0]; } |
2605 | 2484 |
2606 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, | 2485 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
2607 "is-construct-call-and-branch") | 2486 "is-construct-call-and-branch") |
2608 }; | 2487 }; |
2609 | 2488 |
2610 | 2489 |
2611 class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 2490 class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> { |
2612 public: | 2491 public: |
2613 LOsrEntry() {} | 2492 LOsrEntry() {} |
2614 | 2493 |
2615 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 2494 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { |
2616 return false; | 2495 return false; |
2617 } | 2496 } |
2618 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2497 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
2619 }; | 2498 }; |
2620 | 2499 |
2621 | 2500 |
2622 class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2501 class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> { |
2623 public: | 2502 public: |
2624 explicit LStackCheck(LOperand* context) { | 2503 explicit LStackCheck(LOperand* context) { inputs_[0] = context; } |
2625 inputs_[0] = context; | |
2626 } | |
2627 | 2504 |
2628 LOperand* context() { return inputs_[0]; } | 2505 LOperand* context() { return inputs_[0]; } |
2629 | 2506 |
2630 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 2507 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
2631 DECLARE_HYDROGEN_ACCESSOR(StackCheck) | 2508 DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
2632 | 2509 |
2633 Label* done_label() { return &done_label_; } | 2510 Label* done_label() { return &done_label_; } |
2634 | 2511 |
2635 private: | 2512 private: |
2636 Label done_label_; | 2513 Label done_label_; |
2637 }; | 2514 }; |
2638 | 2515 |
2639 | 2516 |
2640 class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2517 class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> { |
2641 public: | 2518 public: |
2642 LForInPrepareMap(LOperand* context, LOperand* object) { | 2519 LForInPrepareMap(LOperand* context, LOperand* object) { |
2643 inputs_[0] = context; | 2520 inputs_[0] = context; |
2644 inputs_[1] = object; | 2521 inputs_[1] = object; |
2645 } | 2522 } |
2646 | 2523 |
2647 LOperand* context() { return inputs_[0]; } | 2524 LOperand* context() { return inputs_[0]; } |
2648 LOperand* object() { return inputs_[1]; } | 2525 LOperand* object() { return inputs_[1]; } |
2649 | 2526 |
2650 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") | 2527 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
2651 }; | 2528 }; |
2652 | 2529 |
2653 | 2530 |
2654 class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2531 class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> { |
2655 public: | 2532 public: |
2656 explicit LForInCacheArray(LOperand* map) { | 2533 explicit LForInCacheArray(LOperand* map) { inputs_[0] = map; } |
2657 inputs_[0] = map; | |
2658 } | |
2659 | 2534 |
2660 LOperand* map() { return inputs_[0]; } | 2535 LOperand* map() { return inputs_[0]; } |
2661 | 2536 |
2662 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") | 2537 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
2663 | 2538 |
2664 int idx() { | 2539 int idx() { return HForInCacheArray::cast(this->hydrogen_value())->idx(); } |
2665 return HForInCacheArray::cast(this->hydrogen_value())->idx(); | |
2666 } | |
2667 }; | 2540 }; |
2668 | 2541 |
2669 | 2542 |
2670 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 0> { | 2543 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 0> { |
2671 public: | 2544 public: |
2672 LCheckMapValue(LOperand* value, LOperand* map) { | 2545 LCheckMapValue(LOperand* value, LOperand* map) { |
2673 inputs_[0] = value; | 2546 inputs_[0] = value; |
2674 inputs_[1] = map; | 2547 inputs_[1] = map; |
2675 } | 2548 } |
2676 | 2549 |
(...skipping 11 matching lines...) Expand all Loading... |
2688 inputs_[1] = index; | 2561 inputs_[1] = index; |
2689 } | 2562 } |
2690 | 2563 |
2691 LOperand* object() { return inputs_[0]; } | 2564 LOperand* object() { return inputs_[0]; } |
2692 LOperand* index() { return inputs_[1]; } | 2565 LOperand* index() { return inputs_[1]; } |
2693 | 2566 |
2694 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 2567 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
2695 }; | 2568 }; |
2696 | 2569 |
2697 | 2570 |
2698 class LStoreFrameContext: public LTemplateInstruction<0, 1, 0> { | 2571 class LStoreFrameContext : public LTemplateInstruction<0, 1, 0> { |
2699 public: | 2572 public: |
2700 explicit LStoreFrameContext(LOperand* context) { | 2573 explicit LStoreFrameContext(LOperand* context) { inputs_[0] = context; } |
2701 inputs_[0] = context; | |
2702 } | |
2703 | 2574 |
2704 LOperand* context() { return inputs_[0]; } | 2575 LOperand* context() { return inputs_[0]; } |
2705 | 2576 |
2706 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context") | 2577 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context") |
2707 }; | 2578 }; |
2708 | 2579 |
2709 | 2580 |
2710 class LAllocateBlockContext: public LTemplateInstruction<1, 2, 0> { | 2581 class LAllocateBlockContext : public LTemplateInstruction<1, 2, 0> { |
2711 public: | 2582 public: |
2712 LAllocateBlockContext(LOperand* context, LOperand* function) { | 2583 LAllocateBlockContext(LOperand* context, LOperand* function) { |
2713 inputs_[0] = context; | 2584 inputs_[0] = context; |
2714 inputs_[1] = function; | 2585 inputs_[1] = function; |
2715 } | 2586 } |
2716 | 2587 |
2717 LOperand* context() { return inputs_[0]; } | 2588 LOperand* context() { return inputs_[0]; } |
2718 LOperand* function() { return inputs_[1]; } | 2589 LOperand* function() { return inputs_[1]; } |
2719 | 2590 |
2720 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } | 2591 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } |
2721 | 2592 |
2722 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") | 2593 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") |
2723 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) | 2594 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) |
2724 }; | 2595 }; |
2725 | 2596 |
2726 | 2597 |
2727 class LChunkBuilder; | 2598 class LChunkBuilder; |
2728 class LPlatformChunk V8_FINAL : public LChunk { | 2599 class LPlatformChunk V8_FINAL : public LChunk { |
2729 public: | 2600 public: |
2730 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 2601 LPlatformChunk(CompilationInfo* info, HGraph* graph) : LChunk(info, graph) {} |
2731 : LChunk(info, graph) { } | |
2732 | 2602 |
2733 int GetNextSpillIndex(RegisterKind kind); | 2603 int GetNextSpillIndex(RegisterKind kind); |
2734 LOperand* GetNextSpillSlot(RegisterKind kind); | 2604 LOperand* GetNextSpillSlot(RegisterKind kind); |
2735 }; | 2605 }; |
2736 | 2606 |
2737 | 2607 |
2738 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { | 2608 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { |
2739 public: | 2609 public: |
2740 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 2610 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
2741 : LChunkBuilderBase(graph->zone()), | 2611 : LChunkBuilderBase(graph->zone()), |
2742 chunk_(NULL), | 2612 chunk_(NULL), |
2743 info_(info), | 2613 info_(info), |
2744 graph_(graph), | 2614 graph_(graph), |
2745 status_(UNUSED), | 2615 status_(UNUSED), |
2746 current_instruction_(NULL), | 2616 current_instruction_(NULL), |
2747 current_block_(NULL), | 2617 current_block_(NULL), |
2748 next_block_(NULL), | 2618 next_block_(NULL), |
2749 allocator_(allocator) { } | 2619 allocator_(allocator) {} |
2750 | 2620 |
2751 Isolate* isolate() const { return graph_->isolate(); } | 2621 Isolate* isolate() const { return graph_->isolate(); } |
2752 | 2622 |
2753 // Build the sequence for the graph. | 2623 // Build the sequence for the graph. |
2754 LPlatformChunk* Build(); | 2624 LPlatformChunk* Build(); |
2755 | 2625 |
2756 // Declare methods that deal with the individual node types. | 2626 // Declare methods that deal with the individual node types. |
2757 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); | 2627 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); |
2758 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) | 2628 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) |
2759 #undef DECLARE_DO | 2629 #undef DECLARE_DO |
2760 | 2630 |
2761 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); | 2631 LInstruction* DoMultiplyAdd(HMul* mul, HValue* addend); |
2762 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); | 2632 LInstruction* DoMultiplySub(HValue* minuend, HMul* mul); |
2763 LInstruction* DoRSub(HSub* instr); | 2633 LInstruction* DoRSub(HSub* instr); |
2764 | 2634 |
2765 static bool HasMagicNumberForDivisor(int32_t divisor); | 2635 static bool HasMagicNumberForDivisor(int32_t divisor); |
2766 | 2636 |
(...skipping 10 matching lines...) Expand all Loading... |
2777 LInstruction* DoDivByConstI(HDiv* instr); | 2647 LInstruction* DoDivByConstI(HDiv* instr); |
2778 LInstruction* DoDivI(HDiv* instr); | 2648 LInstruction* DoDivI(HDiv* instr); |
2779 LInstruction* DoModByPowerOf2I(HMod* instr); | 2649 LInstruction* DoModByPowerOf2I(HMod* instr); |
2780 LInstruction* DoModByConstI(HMod* instr); | 2650 LInstruction* DoModByConstI(HMod* instr); |
2781 LInstruction* DoModI(HMod* instr); | 2651 LInstruction* DoModI(HMod* instr); |
2782 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); | 2652 LInstruction* DoFlooringDivByPowerOf2I(HMathFloorOfDiv* instr); |
2783 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); | 2653 LInstruction* DoFlooringDivByConstI(HMathFloorOfDiv* instr); |
2784 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); | 2654 LInstruction* DoFlooringDivI(HMathFloorOfDiv* instr); |
2785 | 2655 |
2786 private: | 2656 private: |
2787 enum Status { | 2657 enum Status { UNUSED, BUILDING, DONE, ABORTED }; |
2788 UNUSED, | |
2789 BUILDING, | |
2790 DONE, | |
2791 ABORTED | |
2792 }; | |
2793 | 2658 |
2794 LPlatformChunk* chunk() const { return chunk_; } | 2659 LPlatformChunk* chunk() const { return chunk_; } |
2795 CompilationInfo* info() const { return info_; } | 2660 CompilationInfo* info() const { return info_; } |
2796 HGraph* graph() const { return graph_; } | 2661 HGraph* graph() const { return graph_; } |
2797 | 2662 |
2798 bool is_unused() const { return status_ == UNUSED; } | 2663 bool is_unused() const { return status_ == UNUSED; } |
2799 bool is_building() const { return status_ == BUILDING; } | 2664 bool is_building() const { return status_ == BUILDING; } |
2800 bool is_done() const { return status_ == DONE; } | 2665 bool is_done() const { return status_ == DONE; } |
2801 bool is_aborted() const { return status_ == ABORTED; } | 2666 bool is_aborted() const { return status_ == ABORTED; } |
2802 | 2667 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2852 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); | 2717 MUST_USE_RESULT LOperand* FixedTemp(DoubleRegister reg); |
2853 | 2718 |
2854 // Methods for setting up define-use relationships. | 2719 // Methods for setting up define-use relationships. |
2855 // Return the same instruction that they are passed. | 2720 // Return the same instruction that they are passed. |
2856 LInstruction* Define(LTemplateResultInstruction<1>* instr, | 2721 LInstruction* Define(LTemplateResultInstruction<1>* instr, |
2857 LUnallocated* result); | 2722 LUnallocated* result); |
2858 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); | 2723 LInstruction* DefineAsRegister(LTemplateResultInstruction<1>* instr); |
2859 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, | 2724 LInstruction* DefineAsSpilled(LTemplateResultInstruction<1>* instr, |
2860 int index); | 2725 int index); |
2861 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); | 2726 LInstruction* DefineSameAsFirst(LTemplateResultInstruction<1>* instr); |
2862 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, | 2727 LInstruction* DefineFixed(LTemplateResultInstruction<1>* instr, Register reg); |
2863 Register reg); | |
2864 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, | 2728 LInstruction* DefineFixedDouble(LTemplateResultInstruction<1>* instr, |
2865 DoubleRegister reg); | 2729 DoubleRegister reg); |
2866 LInstruction* AssignEnvironment(LInstruction* instr); | 2730 LInstruction* AssignEnvironment(LInstruction* instr); |
2867 LInstruction* AssignPointerMap(LInstruction* instr); | 2731 LInstruction* AssignPointerMap(LInstruction* instr); |
2868 | 2732 |
2869 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; | 2733 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; |
2870 | 2734 |
2871 // By default we assume that instruction sequences generated for calls | 2735 // By default we assume that instruction sequences generated for calls |
2872 // cannot deoptimize eagerly and we do not attach environment to this | 2736 // cannot deoptimize eagerly and we do not attach environment to this |
2873 // instruction. | 2737 // instruction. |
2874 LInstruction* MarkAsCall( | 2738 LInstruction* MarkAsCall( |
2875 LInstruction* instr, | 2739 LInstruction* instr, HInstruction* hinstr, |
2876 HInstruction* hinstr, | |
2877 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 2740 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); |
2878 | 2741 |
2879 void VisitInstruction(HInstruction* current); | 2742 void VisitInstruction(HInstruction* current); |
2880 void AddInstruction(LInstruction* instr, HInstruction* current); | 2743 void AddInstruction(LInstruction* instr, HInstruction* current); |
2881 | 2744 |
2882 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 2745 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); |
2883 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 2746 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); |
2884 LInstruction* DoArithmeticD(Token::Value op, | 2747 LInstruction* DoArithmeticD(Token::Value op, |
2885 HArithmeticBinaryOperation* instr); | 2748 HArithmeticBinaryOperation* instr); |
2886 LInstruction* DoArithmeticT(Token::Value op, | 2749 LInstruction* DoArithmeticT(Token::Value op, HBinaryOperation* instr); |
2887 HBinaryOperation* instr); | |
2888 | 2750 |
2889 LPlatformChunk* chunk_; | 2751 LPlatformChunk* chunk_; |
2890 CompilationInfo* info_; | 2752 CompilationInfo* info_; |
2891 HGraph* const graph_; | 2753 HGraph* const graph_; |
2892 Status status_; | 2754 Status status_; |
2893 HInstruction* current_instruction_; | 2755 HInstruction* current_instruction_; |
2894 HBasicBlock* current_block_; | 2756 HBasicBlock* current_block_; |
2895 HBasicBlock* next_block_; | 2757 HBasicBlock* next_block_; |
2896 LAllocator* allocator_; | 2758 LAllocator* allocator_; |
2897 | 2759 |
2898 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2760 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2899 }; | 2761 }; |
2900 | 2762 |
2901 #undef DECLARE_HYDROGEN_ACCESSOR | 2763 #undef DECLARE_HYDROGEN_ACCESSOR |
2902 #undef DECLARE_CONCRETE_INSTRUCTION | 2764 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2765 } |
| 2766 } // namespace v8::internal |
2903 | 2767 |
2904 } } // namespace v8::internal | 2768 #endif // V8_PPC_LITHIUM_PPC_H_ |
2905 | |
2906 #endif // V8_ARM_LITHIUM_ARM_H_ | |
OLD | NEW |