| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_ARM64_LITHIUM_ARM64_H_ | 5 #ifndef V8_ARM64_LITHIUM_ARM64_H_ |
| 6 #define V8_ARM64_LITHIUM_ARM64_H_ | 6 #define V8_ARM64_LITHIUM_ARM64_H_ |
| 7 | 7 |
| 8 #include "src/hydrogen.h" | 8 #include "src/hydrogen.h" |
| 9 #include "src/lithium.h" | 9 #include "src/lithium.h" |
| 10 #include "src/lithium-allocator.h" | 10 #include "src/lithium-allocator.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 V(TrapAllocationMemento) \ | 171 V(TrapAllocationMemento) \ |
| 172 V(TruncateDoubleToIntOrSmi) \ | 172 V(TruncateDoubleToIntOrSmi) \ |
| 173 V(Typeof) \ | 173 V(Typeof) \ |
| 174 V(TypeofIsAndBranch) \ | 174 V(TypeofIsAndBranch) \ |
| 175 V(Uint32ToDouble) \ | 175 V(Uint32ToDouble) \ |
| 176 V(UnknownOSRValue) \ | 176 V(UnknownOSRValue) \ |
| 177 V(WrapReceiver) | 177 V(WrapReceiver) |
| 178 | 178 |
| 179 | 179 |
| 180 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ | 180 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ |
| 181 virtual Opcode opcode() const V8_FINAL V8_OVERRIDE { \ | 181 virtual Opcode opcode() const FINAL OVERRIDE { \ |
| 182 return LInstruction::k##type; \ | 182 return LInstruction::k##type; \ |
| 183 } \ | 183 } \ |
| 184 virtual void CompileToNative(LCodeGen* generator) V8_FINAL V8_OVERRIDE; \ | 184 virtual void CompileToNative(LCodeGen* generator) FINAL OVERRIDE; \ |
| 185 virtual const char* Mnemonic() const V8_FINAL V8_OVERRIDE { \ | 185 virtual const char* Mnemonic() const FINAL OVERRIDE { \ |
| 186 return mnemonic; \ | 186 return mnemonic; \ |
| 187 } \ | 187 } \ |
| 188 static L##type* cast(LInstruction* instr) { \ | 188 static L##type* cast(LInstruction* instr) { \ |
| 189 DCHECK(instr->Is##type()); \ | 189 DCHECK(instr->Is##type()); \ |
| 190 return reinterpret_cast<L##type*>(instr); \ | 190 return reinterpret_cast<L##type*>(instr); \ |
| 191 } | 191 } |
| 192 | 192 |
| 193 | 193 |
| 194 #define DECLARE_HYDROGEN_ACCESSOR(type) \ | 194 #define DECLARE_HYDROGEN_ACCESSOR(type) \ |
| 195 H##type* hydrogen() const { \ | 195 H##type* hydrogen() const { \ |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 int32_t bit_field_; | 287 int32_t bit_field_; |
| 288 }; | 288 }; |
| 289 | 289 |
| 290 | 290 |
| 291 // R = number of result operands (0 or 1). | 291 // R = number of result operands (0 or 1). |
| 292 template<int R> | 292 template<int R> |
| 293 class LTemplateResultInstruction : public LInstruction { | 293 class LTemplateResultInstruction : public LInstruction { |
| 294 public: | 294 public: |
| 295 // Allow 0 or 1 output operands. | 295 // Allow 0 or 1 output operands. |
| 296 STATIC_ASSERT(R == 0 || R == 1); | 296 STATIC_ASSERT(R == 0 || R == 1); |
| 297 virtual bool HasResult() const V8_FINAL V8_OVERRIDE { | 297 virtual bool HasResult() const FINAL OVERRIDE { |
| 298 return (R != 0) && (result() != NULL); | 298 return (R != 0) && (result() != NULL); |
| 299 } | 299 } |
| 300 void set_result(LOperand* operand) { results_[0] = operand; } | 300 void set_result(LOperand* operand) { results_[0] = operand; } |
| 301 LOperand* result() const { return results_[0]; } | 301 LOperand* result() const { return results_[0]; } |
| 302 | 302 |
| 303 protected: | 303 protected: |
| 304 EmbeddedContainer<LOperand*, R> results_; | 304 EmbeddedContainer<LOperand*, R> results_; |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 | 307 |
| 308 // R = number of result operands (0 or 1). | 308 // R = number of result operands (0 or 1). |
| 309 // I = number of input operands. | 309 // I = number of input operands. |
| 310 // T = number of temporary operands. | 310 // T = number of temporary operands. |
| 311 template<int R, int I, int T> | 311 template<int R, int I, int T> |
| 312 class LTemplateInstruction : public LTemplateResultInstruction<R> { | 312 class LTemplateInstruction : public LTemplateResultInstruction<R> { |
| 313 protected: | 313 protected: |
| 314 EmbeddedContainer<LOperand*, I> inputs_; | 314 EmbeddedContainer<LOperand*, I> inputs_; |
| 315 EmbeddedContainer<LOperand*, T> temps_; | 315 EmbeddedContainer<LOperand*, T> temps_; |
| 316 | 316 |
| 317 private: | 317 private: |
| 318 // Iterator support. | 318 // Iterator support. |
| 319 virtual int InputCount() V8_FINAL V8_OVERRIDE { return I; } | 319 virtual int InputCount() FINAL OVERRIDE { return I; } |
| 320 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } | 320 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } |
| 321 | 321 |
| 322 virtual int TempCount() V8_FINAL V8_OVERRIDE { return T; } | 322 virtual int TempCount() FINAL OVERRIDE { return T; } |
| 323 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return temps_[i]; } | 323 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return temps_[i]; } |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 | 326 |
| 327 class LUnknownOSRValue V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 327 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { |
| 328 public: | 328 public: |
| 329 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 329 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 330 return false; | 330 return false; |
| 331 } | 331 } |
| 332 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 332 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 333 }; | 333 }; |
| 334 | 334 |
| 335 | 335 |
| 336 template<int I, int T> | 336 template<int I, int T> |
| 337 class LControlInstruction : public LTemplateInstruction<0, I, T> { | 337 class LControlInstruction : public LTemplateInstruction<0, I, T> { |
| 338 public: | 338 public: |
| 339 LControlInstruction() : false_label_(NULL), true_label_(NULL) { } | 339 LControlInstruction() : false_label_(NULL), true_label_(NULL) { } |
| 340 | 340 |
| 341 virtual bool IsControl() const V8_FINAL V8_OVERRIDE { return true; } | 341 virtual bool IsControl() const FINAL OVERRIDE { return true; } |
| 342 | 342 |
| 343 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 343 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| 344 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } | 344 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } |
| 345 | 345 |
| 346 int TrueDestination(LChunk* chunk) { | 346 int TrueDestination(LChunk* chunk) { |
| 347 return chunk->LookupDestination(true_block_id()); | 347 return chunk->LookupDestination(true_block_id()); |
| 348 } | 348 } |
| 349 | 349 |
| 350 int FalseDestination(LChunk* chunk) { | 350 int FalseDestination(LChunk* chunk) { |
| 351 return chunk->LookupDestination(false_block_id()); | 351 return chunk->LookupDestination(false_block_id()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 381 public: | 381 public: |
| 382 explicit LGap(HBasicBlock* block) | 382 explicit LGap(HBasicBlock* block) |
| 383 : block_(block) { | 383 : block_(block) { |
| 384 parallel_moves_[BEFORE] = NULL; | 384 parallel_moves_[BEFORE] = NULL; |
| 385 parallel_moves_[START] = NULL; | 385 parallel_moves_[START] = NULL; |
| 386 parallel_moves_[END] = NULL; | 386 parallel_moves_[END] = NULL; |
| 387 parallel_moves_[AFTER] = NULL; | 387 parallel_moves_[AFTER] = NULL; |
| 388 } | 388 } |
| 389 | 389 |
| 390 // Can't use the DECLARE-macro here because of sub-classes. | 390 // Can't use the DECLARE-macro here because of sub-classes. |
| 391 virtual bool IsGap() const V8_OVERRIDE { return true; } | 391 virtual bool IsGap() const OVERRIDE { return true; } |
| 392 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 392 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 393 static LGap* cast(LInstruction* instr) { | 393 static LGap* cast(LInstruction* instr) { |
| 394 DCHECK(instr->IsGap()); | 394 DCHECK(instr->IsGap()); |
| 395 return reinterpret_cast<LGap*>(instr); | 395 return reinterpret_cast<LGap*>(instr); |
| 396 } | 396 } |
| 397 | 397 |
| 398 bool IsRedundant() const; | 398 bool IsRedundant() const; |
| 399 | 399 |
| 400 HBasicBlock* block() const { return block_; } | 400 HBasicBlock* block() const { return block_; } |
| 401 | 401 |
| 402 enum InnerPosition { | 402 enum InnerPosition { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 418 LParallelMove* GetParallelMove(InnerPosition pos) { | 418 LParallelMove* GetParallelMove(InnerPosition pos) { |
| 419 return parallel_moves_[pos]; | 419 return parallel_moves_[pos]; |
| 420 } | 420 } |
| 421 | 421 |
| 422 private: | 422 private: |
| 423 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 423 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 424 HBasicBlock* block_; | 424 HBasicBlock* block_; |
| 425 }; | 425 }; |
| 426 | 426 |
| 427 | 427 |
| 428 class LInstructionGap V8_FINAL : public LGap { | 428 class LInstructionGap FINAL : public LGap { |
| 429 public: | 429 public: |
| 430 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 430 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 431 | 431 |
| 432 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 432 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 433 return !IsRedundant(); | 433 return !IsRedundant(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 436 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 437 }; | 437 }; |
| 438 | 438 |
| 439 | 439 |
| 440 class LDrop V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 440 class LDrop FINAL : public LTemplateInstruction<0, 0, 0> { |
| 441 public: | 441 public: |
| 442 explicit LDrop(int count) : count_(count) { } | 442 explicit LDrop(int count) : count_(count) { } |
| 443 | 443 |
| 444 int count() const { return count_; } | 444 int count() const { return count_; } |
| 445 | 445 |
| 446 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") | 446 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") |
| 447 | 447 |
| 448 private: | 448 private: |
| 449 int count_; | 449 int count_; |
| 450 }; | 450 }; |
| 451 | 451 |
| 452 | 452 |
| 453 class LDummy V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 453 class LDummy FINAL : public LTemplateInstruction<1, 0, 0> { |
| 454 public: | 454 public: |
| 455 LDummy() {} | 455 LDummy() {} |
| 456 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") | 456 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") |
| 457 }; | 457 }; |
| 458 | 458 |
| 459 | 459 |
| 460 class LDummyUse V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 460 class LDummyUse FINAL : public LTemplateInstruction<1, 1, 0> { |
| 461 public: | 461 public: |
| 462 explicit LDummyUse(LOperand* value) { | 462 explicit LDummyUse(LOperand* value) { |
| 463 inputs_[0] = value; | 463 inputs_[0] = value; |
| 464 } | 464 } |
| 465 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") | 465 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") |
| 466 }; | 466 }; |
| 467 | 467 |
| 468 | 468 |
| 469 class LGoto V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 469 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> { |
| 470 public: | 470 public: |
| 471 explicit LGoto(HBasicBlock* block) : block_(block) { } | 471 explicit LGoto(HBasicBlock* block) : block_(block) { } |
| 472 | 472 |
| 473 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE; | 473 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE; |
| 474 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 474 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 475 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 475 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 476 virtual bool IsControl() const V8_OVERRIDE { return true; } | 476 virtual bool IsControl() const OVERRIDE { return true; } |
| 477 | 477 |
| 478 int block_id() const { return block_->block_id(); } | 478 int block_id() const { return block_->block_id(); } |
| 479 | 479 |
| 480 private: | 480 private: |
| 481 HBasicBlock* block_; | 481 HBasicBlock* block_; |
| 482 }; | 482 }; |
| 483 | 483 |
| 484 | 484 |
| 485 class LLazyBailout V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 485 class LLazyBailout FINAL : public LTemplateInstruction<0, 0, 0> { |
| 486 public: | 486 public: |
| 487 LLazyBailout() : gap_instructions_size_(0) { } | 487 LLazyBailout() : gap_instructions_size_(0) { } |
| 488 | 488 |
| 489 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 489 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 490 | 490 |
| 491 void set_gap_instructions_size(int gap_instructions_size) { | 491 void set_gap_instructions_size(int gap_instructions_size) { |
| 492 gap_instructions_size_ = gap_instructions_size; | 492 gap_instructions_size_ = gap_instructions_size; |
| 493 } | 493 } |
| 494 int gap_instructions_size() { return gap_instructions_size_; } | 494 int gap_instructions_size() { return gap_instructions_size_; } |
| 495 | 495 |
| 496 private: | 496 private: |
| 497 int gap_instructions_size_; | 497 int gap_instructions_size_; |
| 498 }; | 498 }; |
| 499 | 499 |
| 500 | 500 |
| 501 class LLabel V8_FINAL : public LGap { | 501 class LLabel FINAL : public LGap { |
| 502 public: | 502 public: |
| 503 explicit LLabel(HBasicBlock* block) | 503 explicit LLabel(HBasicBlock* block) |
| 504 : LGap(block), replacement_(NULL) { } | 504 : LGap(block), replacement_(NULL) { } |
| 505 | 505 |
| 506 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 506 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 507 return false; | 507 return false; |
| 508 } | 508 } |
| 509 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 509 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 510 | 510 |
| 511 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 511 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 512 | 512 |
| 513 int block_id() const { return block()->block_id(); } | 513 int block_id() const { return block()->block_id(); } |
| 514 bool is_loop_header() const { return block()->IsLoopHeader(); } | 514 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 515 bool is_osr_entry() const { return block()->is_osr_entry(); } | 515 bool is_osr_entry() const { return block()->is_osr_entry(); } |
| 516 Label* label() { return &label_; } | 516 Label* label() { return &label_; } |
| 517 LLabel* replacement() const { return replacement_; } | 517 LLabel* replacement() const { return replacement_; } |
| 518 void set_replacement(LLabel* label) { replacement_ = label; } | 518 void set_replacement(LLabel* label) { replacement_ = label; } |
| 519 bool HasReplacement() const { return replacement_ != NULL; } | 519 bool HasReplacement() const { return replacement_ != NULL; } |
| 520 | 520 |
| 521 private: | 521 private: |
| 522 Label label_; | 522 Label label_; |
| 523 LLabel* replacement_; | 523 LLabel* replacement_; |
| 524 }; | 524 }; |
| 525 | 525 |
| 526 | 526 |
| 527 class LOsrEntry V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 527 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> { |
| 528 public: | 528 public: |
| 529 LOsrEntry() {} | 529 LOsrEntry() {} |
| 530 | 530 |
| 531 virtual bool HasInterestingComment(LCodeGen* gen) const V8_OVERRIDE { | 531 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { |
| 532 return false; | 532 return false; |
| 533 } | 533 } |
| 534 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 534 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 535 }; | 535 }; |
| 536 | 536 |
| 537 | 537 |
| 538 class LAccessArgumentsAt V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 538 class LAccessArgumentsAt FINAL : public LTemplateInstruction<1, 3, 0> { |
| 539 public: | 539 public: |
| 540 LAccessArgumentsAt(LOperand* arguments, | 540 LAccessArgumentsAt(LOperand* arguments, |
| 541 LOperand* length, | 541 LOperand* length, |
| 542 LOperand* index) { | 542 LOperand* index) { |
| 543 inputs_[0] = arguments; | 543 inputs_[0] = arguments; |
| 544 inputs_[1] = length; | 544 inputs_[1] = length; |
| 545 inputs_[2] = index; | 545 inputs_[2] = index; |
| 546 } | 546 } |
| 547 | 547 |
| 548 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") | 548 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") |
| 549 | 549 |
| 550 LOperand* arguments() { return inputs_[0]; } | 550 LOperand* arguments() { return inputs_[0]; } |
| 551 LOperand* length() { return inputs_[1]; } | 551 LOperand* length() { return inputs_[1]; } |
| 552 LOperand* index() { return inputs_[2]; } | 552 LOperand* index() { return inputs_[2]; } |
| 553 | 553 |
| 554 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 554 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 555 }; | 555 }; |
| 556 | 556 |
| 557 | 557 |
| 558 class LAddE V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 558 class LAddE FINAL : public LTemplateInstruction<1, 2, 0> { |
| 559 public: | 559 public: |
| 560 LAddE(LOperand* left, LOperand* right) { | 560 LAddE(LOperand* left, LOperand* right) { |
| 561 inputs_[0] = left; | 561 inputs_[0] = left; |
| 562 inputs_[1] = right; | 562 inputs_[1] = right; |
| 563 } | 563 } |
| 564 | 564 |
| 565 LOperand* left() { return inputs_[0]; } | 565 LOperand* left() { return inputs_[0]; } |
| 566 LOperand* right() { return inputs_[1]; } | 566 LOperand* right() { return inputs_[1]; } |
| 567 | 567 |
| 568 DECLARE_CONCRETE_INSTRUCTION(AddE, "add-e") | 568 DECLARE_CONCRETE_INSTRUCTION(AddE, "add-e") |
| 569 DECLARE_HYDROGEN_ACCESSOR(Add) | 569 DECLARE_HYDROGEN_ACCESSOR(Add) |
| 570 }; | 570 }; |
| 571 | 571 |
| 572 | 572 |
| 573 class LAddI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 573 class LAddI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 574 public: | 574 public: |
| 575 LAddI(LOperand* left, LOperand* right) | 575 LAddI(LOperand* left, LOperand* right) |
| 576 : shift_(NO_SHIFT), shift_amount_(0) { | 576 : shift_(NO_SHIFT), shift_amount_(0) { |
| 577 inputs_[0] = left; | 577 inputs_[0] = left; |
| 578 inputs_[1] = right; | 578 inputs_[1] = right; |
| 579 } | 579 } |
| 580 | 580 |
| 581 LAddI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) | 581 LAddI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) |
| 582 : shift_(shift), shift_amount_(shift_amount) { | 582 : shift_(shift), shift_amount_(shift_amount) { |
| 583 inputs_[0] = left; | 583 inputs_[0] = left; |
| 584 inputs_[1] = right; | 584 inputs_[1] = right; |
| 585 } | 585 } |
| 586 | 586 |
| 587 LOperand* left() { return inputs_[0]; } | 587 LOperand* left() { return inputs_[0]; } |
| 588 LOperand* right() { return inputs_[1]; } | 588 LOperand* right() { return inputs_[1]; } |
| 589 | 589 |
| 590 Shift shift() const { return shift_; } | 590 Shift shift() const { return shift_; } |
| 591 LOperand* shift_amount() const { return shift_amount_; } | 591 LOperand* shift_amount() const { return shift_amount_; } |
| 592 | 592 |
| 593 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") | 593 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") |
| 594 DECLARE_HYDROGEN_ACCESSOR(Add) | 594 DECLARE_HYDROGEN_ACCESSOR(Add) |
| 595 | 595 |
| 596 protected: | 596 protected: |
| 597 Shift shift_; | 597 Shift shift_; |
| 598 LOperand* shift_amount_; | 598 LOperand* shift_amount_; |
| 599 }; | 599 }; |
| 600 | 600 |
| 601 | 601 |
| 602 class LAddS V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 602 class LAddS FINAL : public LTemplateInstruction<1, 2, 0> { |
| 603 public: | 603 public: |
| 604 LAddS(LOperand* left, LOperand* right) { | 604 LAddS(LOperand* left, LOperand* right) { |
| 605 inputs_[0] = left; | 605 inputs_[0] = left; |
| 606 inputs_[1] = right; | 606 inputs_[1] = right; |
| 607 } | 607 } |
| 608 | 608 |
| 609 LOperand* left() { return inputs_[0]; } | 609 LOperand* left() { return inputs_[0]; } |
| 610 LOperand* right() { return inputs_[1]; } | 610 LOperand* right() { return inputs_[1]; } |
| 611 | 611 |
| 612 DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s") | 612 DECLARE_CONCRETE_INSTRUCTION(AddS, "add-s") |
| 613 DECLARE_HYDROGEN_ACCESSOR(Add) | 613 DECLARE_HYDROGEN_ACCESSOR(Add) |
| 614 }; | 614 }; |
| 615 | 615 |
| 616 | 616 |
| 617 class LAllocate V8_FINAL : public LTemplateInstruction<1, 2, 3> { | 617 class LAllocate FINAL : public LTemplateInstruction<1, 2, 3> { |
| 618 public: | 618 public: |
| 619 LAllocate(LOperand* context, | 619 LAllocate(LOperand* context, |
| 620 LOperand* size, | 620 LOperand* size, |
| 621 LOperand* temp1, | 621 LOperand* temp1, |
| 622 LOperand* temp2, | 622 LOperand* temp2, |
| 623 LOperand* temp3) { | 623 LOperand* temp3) { |
| 624 inputs_[0] = context; | 624 inputs_[0] = context; |
| 625 inputs_[1] = size; | 625 inputs_[1] = size; |
| 626 temps_[0] = temp1; | 626 temps_[0] = temp1; |
| 627 temps_[1] = temp2; | 627 temps_[1] = temp2; |
| 628 temps_[2] = temp3; | 628 temps_[2] = temp3; |
| 629 } | 629 } |
| 630 | 630 |
| 631 LOperand* context() { return inputs_[0]; } | 631 LOperand* context() { return inputs_[0]; } |
| 632 LOperand* size() { return inputs_[1]; } | 632 LOperand* size() { return inputs_[1]; } |
| 633 LOperand* temp1() { return temps_[0]; } | 633 LOperand* temp1() { return temps_[0]; } |
| 634 LOperand* temp2() { return temps_[1]; } | 634 LOperand* temp2() { return temps_[1]; } |
| 635 LOperand* temp3() { return temps_[2]; } | 635 LOperand* temp3() { return temps_[2]; } |
| 636 | 636 |
| 637 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") | 637 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") |
| 638 DECLARE_HYDROGEN_ACCESSOR(Allocate) | 638 DECLARE_HYDROGEN_ACCESSOR(Allocate) |
| 639 }; | 639 }; |
| 640 | 640 |
| 641 | 641 |
| 642 class LApplyArguments V8_FINAL : public LTemplateInstruction<1, 4, 0> { | 642 class LApplyArguments FINAL : public LTemplateInstruction<1, 4, 0> { |
| 643 public: | 643 public: |
| 644 LApplyArguments(LOperand* function, | 644 LApplyArguments(LOperand* function, |
| 645 LOperand* receiver, | 645 LOperand* receiver, |
| 646 LOperand* length, | 646 LOperand* length, |
| 647 LOperand* elements) { | 647 LOperand* elements) { |
| 648 inputs_[0] = function; | 648 inputs_[0] = function; |
| 649 inputs_[1] = receiver; | 649 inputs_[1] = receiver; |
| 650 inputs_[2] = length; | 650 inputs_[2] = length; |
| 651 inputs_[3] = elements; | 651 inputs_[3] = elements; |
| 652 } | 652 } |
| 653 | 653 |
| 654 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") | 654 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") |
| 655 | 655 |
| 656 LOperand* function() { return inputs_[0]; } | 656 LOperand* function() { return inputs_[0]; } |
| 657 LOperand* receiver() { return inputs_[1]; } | 657 LOperand* receiver() { return inputs_[1]; } |
| 658 LOperand* length() { return inputs_[2]; } | 658 LOperand* length() { return inputs_[2]; } |
| 659 LOperand* elements() { return inputs_[3]; } | 659 LOperand* elements() { return inputs_[3]; } |
| 660 }; | 660 }; |
| 661 | 661 |
| 662 | 662 |
| 663 class LArgumentsElements V8_FINAL : public LTemplateInstruction<1, 0, 1> { | 663 class LArgumentsElements FINAL : public LTemplateInstruction<1, 0, 1> { |
| 664 public: | 664 public: |
| 665 explicit LArgumentsElements(LOperand* temp) { | 665 explicit LArgumentsElements(LOperand* temp) { |
| 666 temps_[0] = temp; | 666 temps_[0] = temp; |
| 667 } | 667 } |
| 668 | 668 |
| 669 LOperand* temp() { return temps_[0]; } | 669 LOperand* temp() { return temps_[0]; } |
| 670 | 670 |
| 671 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") | 671 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") |
| 672 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) | 672 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) |
| 673 }; | 673 }; |
| 674 | 674 |
| 675 | 675 |
| 676 class LArgumentsLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 676 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> { |
| 677 public: | 677 public: |
| 678 explicit LArgumentsLength(LOperand* elements) { | 678 explicit LArgumentsLength(LOperand* elements) { |
| 679 inputs_[0] = elements; | 679 inputs_[0] = elements; |
| 680 } | 680 } |
| 681 | 681 |
| 682 LOperand* elements() { return inputs_[0]; } | 682 LOperand* elements() { return inputs_[0]; } |
| 683 | 683 |
| 684 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") | 684 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
| 685 }; | 685 }; |
| 686 | 686 |
| 687 | 687 |
| 688 class LArithmeticD V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 688 class LArithmeticD FINAL : public LTemplateInstruction<1, 2, 0> { |
| 689 public: | 689 public: |
| 690 LArithmeticD(Token::Value op, | 690 LArithmeticD(Token::Value op, |
| 691 LOperand* left, | 691 LOperand* left, |
| 692 LOperand* right) | 692 LOperand* right) |
| 693 : op_(op) { | 693 : op_(op) { |
| 694 inputs_[0] = left; | 694 inputs_[0] = left; |
| 695 inputs_[1] = right; | 695 inputs_[1] = right; |
| 696 } | 696 } |
| 697 | 697 |
| 698 Token::Value op() const { return op_; } | 698 Token::Value op() const { return op_; } |
| 699 LOperand* left() { return inputs_[0]; } | 699 LOperand* left() { return inputs_[0]; } |
| 700 LOperand* right() { return inputs_[1]; } | 700 LOperand* right() { return inputs_[1]; } |
| 701 | 701 |
| 702 virtual Opcode opcode() const V8_OVERRIDE { | 702 virtual Opcode opcode() const OVERRIDE { |
| 703 return LInstruction::kArithmeticD; | 703 return LInstruction::kArithmeticD; |
| 704 } | 704 } |
| 705 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; | 705 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; |
| 706 virtual const char* Mnemonic() const V8_OVERRIDE; | 706 virtual const char* Mnemonic() const OVERRIDE; |
| 707 | 707 |
| 708 private: | 708 private: |
| 709 Token::Value op_; | 709 Token::Value op_; |
| 710 }; | 710 }; |
| 711 | 711 |
| 712 | 712 |
| 713 class LArithmeticT V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 713 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> { |
| 714 public: | 714 public: |
| 715 LArithmeticT(Token::Value op, | 715 LArithmeticT(Token::Value op, |
| 716 LOperand* context, | 716 LOperand* context, |
| 717 LOperand* left, | 717 LOperand* left, |
| 718 LOperand* right) | 718 LOperand* right) |
| 719 : op_(op) { | 719 : op_(op) { |
| 720 inputs_[0] = context; | 720 inputs_[0] = context; |
| 721 inputs_[1] = left; | 721 inputs_[1] = left; |
| 722 inputs_[2] = right; | 722 inputs_[2] = right; |
| 723 } | 723 } |
| 724 | 724 |
| 725 LOperand* context() { return inputs_[0]; } | 725 LOperand* context() { return inputs_[0]; } |
| 726 LOperand* left() { return inputs_[1]; } | 726 LOperand* left() { return inputs_[1]; } |
| 727 LOperand* right() { return inputs_[2]; } | 727 LOperand* right() { return inputs_[2]; } |
| 728 Token::Value op() const { return op_; } | 728 Token::Value op() const { return op_; } |
| 729 | 729 |
| 730 virtual Opcode opcode() const V8_OVERRIDE { | 730 virtual Opcode opcode() const OVERRIDE { |
| 731 return LInstruction::kArithmeticT; | 731 return LInstruction::kArithmeticT; |
| 732 } | 732 } |
| 733 virtual void CompileToNative(LCodeGen* generator) V8_OVERRIDE; | 733 virtual void CompileToNative(LCodeGen* generator) OVERRIDE; |
| 734 virtual const char* Mnemonic() const V8_OVERRIDE; | 734 virtual const char* Mnemonic() const OVERRIDE; |
| 735 | 735 |
| 736 private: | 736 private: |
| 737 Token::Value op_; | 737 Token::Value op_; |
| 738 }; | 738 }; |
| 739 | 739 |
| 740 | 740 |
| 741 class LBoundsCheck V8_FINAL : public LTemplateInstruction<0, 2, 0> { | 741 class LBoundsCheck FINAL : public LTemplateInstruction<0, 2, 0> { |
| 742 public: | 742 public: |
| 743 explicit LBoundsCheck(LOperand* index, LOperand* length) { | 743 explicit LBoundsCheck(LOperand* index, LOperand* length) { |
| 744 inputs_[0] = index; | 744 inputs_[0] = index; |
| 745 inputs_[1] = length; | 745 inputs_[1] = length; |
| 746 } | 746 } |
| 747 | 747 |
| 748 LOperand* index() { return inputs_[0]; } | 748 LOperand* index() { return inputs_[0]; } |
| 749 LOperand* length() { return inputs_[1]; } | 749 LOperand* length() { return inputs_[1]; } |
| 750 | 750 |
| 751 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") | 751 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") |
| 752 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) | 752 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) |
| 753 }; | 753 }; |
| 754 | 754 |
| 755 | 755 |
| 756 class LBitI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 756 class LBitI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 757 public: | 757 public: |
| 758 LBitI(LOperand* left, LOperand* right) | 758 LBitI(LOperand* left, LOperand* right) |
| 759 : shift_(NO_SHIFT), shift_amount_(0) { | 759 : shift_(NO_SHIFT), shift_amount_(0) { |
| 760 inputs_[0] = left; | 760 inputs_[0] = left; |
| 761 inputs_[1] = right; | 761 inputs_[1] = right; |
| 762 } | 762 } |
| 763 | 763 |
| 764 LBitI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) | 764 LBitI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) |
| 765 : shift_(shift), shift_amount_(shift_amount) { | 765 : shift_(shift), shift_amount_(shift_amount) { |
| 766 inputs_[0] = left; | 766 inputs_[0] = left; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 777 | 777 |
| 778 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") | 778 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") |
| 779 DECLARE_HYDROGEN_ACCESSOR(Bitwise) | 779 DECLARE_HYDROGEN_ACCESSOR(Bitwise) |
| 780 | 780 |
| 781 protected: | 781 protected: |
| 782 Shift shift_; | 782 Shift shift_; |
| 783 LOperand* shift_amount_; | 783 LOperand* shift_amount_; |
| 784 }; | 784 }; |
| 785 | 785 |
| 786 | 786 |
| 787 class LBitS V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 787 class LBitS FINAL : public LTemplateInstruction<1, 2, 0> { |
| 788 public: | 788 public: |
| 789 LBitS(LOperand* left, LOperand* right) { | 789 LBitS(LOperand* left, LOperand* right) { |
| 790 inputs_[0] = left; | 790 inputs_[0] = left; |
| 791 inputs_[1] = right; | 791 inputs_[1] = right; |
| 792 } | 792 } |
| 793 | 793 |
| 794 LOperand* left() { return inputs_[0]; } | 794 LOperand* left() { return inputs_[0]; } |
| 795 LOperand* right() { return inputs_[1]; } | 795 LOperand* right() { return inputs_[1]; } |
| 796 | 796 |
| 797 Token::Value op() const { return hydrogen()->op(); } | 797 Token::Value op() const { return hydrogen()->op(); } |
| 798 | 798 |
| 799 DECLARE_CONCRETE_INSTRUCTION(BitS, "bit-s") | 799 DECLARE_CONCRETE_INSTRUCTION(BitS, "bit-s") |
| 800 DECLARE_HYDROGEN_ACCESSOR(Bitwise) | 800 DECLARE_HYDROGEN_ACCESSOR(Bitwise) |
| 801 }; | 801 }; |
| 802 | 802 |
| 803 | 803 |
| 804 class LBranch V8_FINAL : public LControlInstruction<1, 2> { | 804 class LBranch FINAL : public LControlInstruction<1, 2> { |
| 805 public: | 805 public: |
| 806 explicit LBranch(LOperand* value, LOperand *temp1, LOperand *temp2) { | 806 explicit LBranch(LOperand* value, LOperand *temp1, LOperand *temp2) { |
| 807 inputs_[0] = value; | 807 inputs_[0] = value; |
| 808 temps_[0] = temp1; | 808 temps_[0] = temp1; |
| 809 temps_[1] = temp2; | 809 temps_[1] = temp2; |
| 810 } | 810 } |
| 811 | 811 |
| 812 LOperand* value() { return inputs_[0]; } | 812 LOperand* value() { return inputs_[0]; } |
| 813 LOperand* temp1() { return temps_[0]; } | 813 LOperand* temp1() { return temps_[0]; } |
| 814 LOperand* temp2() { return temps_[1]; } | 814 LOperand* temp2() { return temps_[1]; } |
| 815 | 815 |
| 816 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 816 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
| 817 DECLARE_HYDROGEN_ACCESSOR(Branch) | 817 DECLARE_HYDROGEN_ACCESSOR(Branch) |
| 818 | 818 |
| 819 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 819 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 820 }; | 820 }; |
| 821 | 821 |
| 822 | 822 |
| 823 class LCallJSFunction V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 823 class LCallJSFunction FINAL : public LTemplateInstruction<1, 1, 0> { |
| 824 public: | 824 public: |
| 825 explicit LCallJSFunction(LOperand* function) { | 825 explicit LCallJSFunction(LOperand* function) { |
| 826 inputs_[0] = function; | 826 inputs_[0] = function; |
| 827 } | 827 } |
| 828 | 828 |
| 829 LOperand* function() { return inputs_[0]; } | 829 LOperand* function() { return inputs_[0]; } |
| 830 | 830 |
| 831 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") | 831 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") |
| 832 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) | 832 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) |
| 833 | 833 |
| 834 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 834 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 835 | 835 |
| 836 int arity() const { return hydrogen()->argument_count() - 1; } | 836 int arity() const { return hydrogen()->argument_count() - 1; } |
| 837 }; | 837 }; |
| 838 | 838 |
| 839 | 839 |
| 840 class LCallFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 840 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 0> { |
| 841 public: | 841 public: |
| 842 LCallFunction(LOperand* context, LOperand* function) { | 842 LCallFunction(LOperand* context, LOperand* function) { |
| 843 inputs_[0] = context; | 843 inputs_[0] = context; |
| 844 inputs_[1] = function; | 844 inputs_[1] = function; |
| 845 } | 845 } |
| 846 | 846 |
| 847 LOperand* context() { return inputs_[0]; } | 847 LOperand* context() { return inputs_[0]; } |
| 848 LOperand* function() { return inputs_[1]; } | 848 LOperand* function() { return inputs_[1]; } |
| 849 | 849 |
| 850 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") | 850 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") |
| 851 DECLARE_HYDROGEN_ACCESSOR(CallFunction) | 851 DECLARE_HYDROGEN_ACCESSOR(CallFunction) |
| 852 | 852 |
| 853 int arity() const { return hydrogen()->argument_count() - 1; } | 853 int arity() const { return hydrogen()->argument_count() - 1; } |
| 854 }; | 854 }; |
| 855 | 855 |
| 856 | 856 |
| 857 class LCallNew V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 857 class LCallNew FINAL : public LTemplateInstruction<1, 2, 0> { |
| 858 public: | 858 public: |
| 859 LCallNew(LOperand* context, LOperand* constructor) { | 859 LCallNew(LOperand* context, LOperand* constructor) { |
| 860 inputs_[0] = context; | 860 inputs_[0] = context; |
| 861 inputs_[1] = constructor; | 861 inputs_[1] = constructor; |
| 862 } | 862 } |
| 863 | 863 |
| 864 LOperand* context() { return inputs_[0]; } | 864 LOperand* context() { return inputs_[0]; } |
| 865 LOperand* constructor() { return inputs_[1]; } | 865 LOperand* constructor() { return inputs_[1]; } |
| 866 | 866 |
| 867 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") | 867 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") |
| 868 DECLARE_HYDROGEN_ACCESSOR(CallNew) | 868 DECLARE_HYDROGEN_ACCESSOR(CallNew) |
| 869 | 869 |
| 870 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 870 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 871 | 871 |
| 872 int arity() const { return hydrogen()->argument_count() - 1; } | 872 int arity() const { return hydrogen()->argument_count() - 1; } |
| 873 }; | 873 }; |
| 874 | 874 |
| 875 | 875 |
| 876 class LCallNewArray V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 876 class LCallNewArray FINAL : public LTemplateInstruction<1, 2, 0> { |
| 877 public: | 877 public: |
| 878 LCallNewArray(LOperand* context, LOperand* constructor) { | 878 LCallNewArray(LOperand* context, LOperand* constructor) { |
| 879 inputs_[0] = context; | 879 inputs_[0] = context; |
| 880 inputs_[1] = constructor; | 880 inputs_[1] = constructor; |
| 881 } | 881 } |
| 882 | 882 |
| 883 LOperand* context() { return inputs_[0]; } | 883 LOperand* context() { return inputs_[0]; } |
| 884 LOperand* constructor() { return inputs_[1]; } | 884 LOperand* constructor() { return inputs_[1]; } |
| 885 | 885 |
| 886 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array") | 886 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array") |
| 887 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) | 887 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) |
| 888 | 888 |
| 889 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 889 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 890 | 890 |
| 891 int arity() const { return hydrogen()->argument_count() - 1; } | 891 int arity() const { return hydrogen()->argument_count() - 1; } |
| 892 }; | 892 }; |
| 893 | 893 |
| 894 | 894 |
| 895 class LCallRuntime V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 895 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> { |
| 896 public: | 896 public: |
| 897 explicit LCallRuntime(LOperand* context) { | 897 explicit LCallRuntime(LOperand* context) { |
| 898 inputs_[0] = context; | 898 inputs_[0] = context; |
| 899 } | 899 } |
| 900 | 900 |
| 901 LOperand* context() { return inputs_[0]; } | 901 LOperand* context() { return inputs_[0]; } |
| 902 | 902 |
| 903 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 903 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
| 904 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 904 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
| 905 | 905 |
| 906 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const V8_OVERRIDE { | 906 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE { |
| 907 return save_doubles() == kDontSaveFPRegs; | 907 return save_doubles() == kDontSaveFPRegs; |
| 908 } | 908 } |
| 909 | 909 |
| 910 const Runtime::Function* function() const { return hydrogen()->function(); } | 910 const Runtime::Function* function() const { return hydrogen()->function(); } |
| 911 int arity() const { return hydrogen()->argument_count(); } | 911 int arity() const { return hydrogen()->argument_count(); } |
| 912 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } | 912 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } |
| 913 }; | 913 }; |
| 914 | 914 |
| 915 | 915 |
| 916 class LCallStub V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 916 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { |
| 917 public: | 917 public: |
| 918 explicit LCallStub(LOperand* context) { | 918 explicit LCallStub(LOperand* context) { |
| 919 inputs_[0] = context; | 919 inputs_[0] = context; |
| 920 } | 920 } |
| 921 | 921 |
| 922 LOperand* context() { return inputs_[0]; } | 922 LOperand* context() { return inputs_[0]; } |
| 923 | 923 |
| 924 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 924 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 925 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 925 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 926 }; | 926 }; |
| 927 | 927 |
| 928 | 928 |
| 929 class LCheckInstanceType V8_FINAL : public LTemplateInstruction<0, 1, 1> { | 929 class LCheckInstanceType FINAL : public LTemplateInstruction<0, 1, 1> { |
| 930 public: | 930 public: |
| 931 explicit LCheckInstanceType(LOperand* value, LOperand* temp) { | 931 explicit LCheckInstanceType(LOperand* value, LOperand* temp) { |
| 932 inputs_[0] = value; | 932 inputs_[0] = value; |
| 933 temps_[0] = temp; | 933 temps_[0] = temp; |
| 934 } | 934 } |
| 935 | 935 |
| 936 LOperand* value() { return inputs_[0]; } | 936 LOperand* value() { return inputs_[0]; } |
| 937 LOperand* temp() { return temps_[0]; } | 937 LOperand* temp() { return temps_[0]; } |
| 938 | 938 |
| 939 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 939 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
| 940 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 940 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
| 941 }; | 941 }; |
| 942 | 942 |
| 943 | 943 |
| 944 class LCheckMaps V8_FINAL : public LTemplateInstruction<0, 1, 1> { | 944 class LCheckMaps FINAL : public LTemplateInstruction<0, 1, 1> { |
| 945 public: | 945 public: |
| 946 explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) { | 946 explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) { |
| 947 inputs_[0] = value; | 947 inputs_[0] = value; |
| 948 temps_[0] = temp; | 948 temps_[0] = temp; |
| 949 } | 949 } |
| 950 | 950 |
| 951 LOperand* value() { return inputs_[0]; } | 951 LOperand* value() { return inputs_[0]; } |
| 952 LOperand* temp() { return temps_[0]; } | 952 LOperand* temp() { return temps_[0]; } |
| 953 | 953 |
| 954 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") | 954 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") |
| 955 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) | 955 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) |
| 956 }; | 956 }; |
| 957 | 957 |
| 958 | 958 |
| 959 class LCheckNonSmi V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 959 class LCheckNonSmi FINAL : public LTemplateInstruction<0, 1, 0> { |
| 960 public: | 960 public: |
| 961 explicit LCheckNonSmi(LOperand* value) { | 961 explicit LCheckNonSmi(LOperand* value) { |
| 962 inputs_[0] = value; | 962 inputs_[0] = value; |
| 963 } | 963 } |
| 964 | 964 |
| 965 LOperand* value() { return inputs_[0]; } | 965 LOperand* value() { return inputs_[0]; } |
| 966 | 966 |
| 967 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 967 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
| 968 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) | 968 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) |
| 969 }; | 969 }; |
| 970 | 970 |
| 971 | 971 |
| 972 class LCheckSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 972 class LCheckSmi FINAL : public LTemplateInstruction<1, 1, 0> { |
| 973 public: | 973 public: |
| 974 explicit LCheckSmi(LOperand* value) { | 974 explicit LCheckSmi(LOperand* value) { |
| 975 inputs_[0] = value; | 975 inputs_[0] = value; |
| 976 } | 976 } |
| 977 | 977 |
| 978 LOperand* value() { return inputs_[0]; } | 978 LOperand* value() { return inputs_[0]; } |
| 979 | 979 |
| 980 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") | 980 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") |
| 981 }; | 981 }; |
| 982 | 982 |
| 983 | 983 |
| 984 class LCheckValue V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 984 class LCheckValue FINAL : public LTemplateInstruction<0, 1, 0> { |
| 985 public: | 985 public: |
| 986 explicit LCheckValue(LOperand* value) { | 986 explicit LCheckValue(LOperand* value) { |
| 987 inputs_[0] = value; | 987 inputs_[0] = value; |
| 988 } | 988 } |
| 989 | 989 |
| 990 LOperand* value() { return inputs_[0]; } | 990 LOperand* value() { return inputs_[0]; } |
| 991 | 991 |
| 992 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") | 992 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") |
| 993 DECLARE_HYDROGEN_ACCESSOR(CheckValue) | 993 DECLARE_HYDROGEN_ACCESSOR(CheckValue) |
| 994 }; | 994 }; |
| 995 | 995 |
| 996 | 996 |
| 997 class LClampDToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 997 class LClampDToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { |
| 998 public: | 998 public: |
| 999 explicit LClampDToUint8(LOperand* unclamped) { | 999 explicit LClampDToUint8(LOperand* unclamped) { |
| 1000 inputs_[0] = unclamped; | 1000 inputs_[0] = unclamped; |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 LOperand* unclamped() { return inputs_[0]; } | 1003 LOperand* unclamped() { return inputs_[0]; } |
| 1004 | 1004 |
| 1005 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") | 1005 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") |
| 1006 }; | 1006 }; |
| 1007 | 1007 |
| 1008 | 1008 |
| 1009 class LClampIToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1009 class LClampIToUint8 FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1010 public: | 1010 public: |
| 1011 explicit LClampIToUint8(LOperand* unclamped) { | 1011 explicit LClampIToUint8(LOperand* unclamped) { |
| 1012 inputs_[0] = unclamped; | 1012 inputs_[0] = unclamped; |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 LOperand* unclamped() { return inputs_[0]; } | 1015 LOperand* unclamped() { return inputs_[0]; } |
| 1016 | 1016 |
| 1017 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") | 1017 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") |
| 1018 }; | 1018 }; |
| 1019 | 1019 |
| 1020 | 1020 |
| 1021 class LClampTToUint8 V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 1021 class LClampTToUint8 FINAL : public LTemplateInstruction<1, 1, 2> { |
| 1022 public: | 1022 public: |
| 1023 LClampTToUint8(LOperand* unclamped, LOperand* temp1, LOperand* temp2) { | 1023 LClampTToUint8(LOperand* unclamped, LOperand* temp1, LOperand* temp2) { |
| 1024 inputs_[0] = unclamped; | 1024 inputs_[0] = unclamped; |
| 1025 temps_[0] = temp1; | 1025 temps_[0] = temp1; |
| 1026 temps_[1] = temp2; | 1026 temps_[1] = temp2; |
| 1027 } | 1027 } |
| 1028 | 1028 |
| 1029 LOperand* unclamped() { return inputs_[0]; } | 1029 LOperand* unclamped() { return inputs_[0]; } |
| 1030 LOperand* temp1() { return temps_[0]; } | 1030 LOperand* temp1() { return temps_[0]; } |
| 1031 LOperand* temp2() { return temps_[1]; } | 1031 LOperand* temp2() { return temps_[1]; } |
| 1032 | 1032 |
| 1033 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") | 1033 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") |
| 1034 }; | 1034 }; |
| 1035 | 1035 |
| 1036 | 1036 |
| 1037 class LDoubleBits V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1037 class LDoubleBits FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1038 public: | 1038 public: |
| 1039 explicit LDoubleBits(LOperand* value) { | 1039 explicit LDoubleBits(LOperand* value) { |
| 1040 inputs_[0] = value; | 1040 inputs_[0] = value; |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 LOperand* value() { return inputs_[0]; } | 1043 LOperand* value() { return inputs_[0]; } |
| 1044 | 1044 |
| 1045 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") | 1045 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") |
| 1046 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) | 1046 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) |
| 1047 }; | 1047 }; |
| 1048 | 1048 |
| 1049 | 1049 |
| 1050 class LConstructDouble V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1050 class LConstructDouble FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1051 public: | 1051 public: |
| 1052 LConstructDouble(LOperand* hi, LOperand* lo) { | 1052 LConstructDouble(LOperand* hi, LOperand* lo) { |
| 1053 inputs_[0] = hi; | 1053 inputs_[0] = hi; |
| 1054 inputs_[1] = lo; | 1054 inputs_[1] = lo; |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 LOperand* hi() { return inputs_[0]; } | 1057 LOperand* hi() { return inputs_[0]; } |
| 1058 LOperand* lo() { return inputs_[1]; } | 1058 LOperand* lo() { return inputs_[1]; } |
| 1059 | 1059 |
| 1060 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") | 1060 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") |
| 1061 }; | 1061 }; |
| 1062 | 1062 |
| 1063 | 1063 |
| 1064 class LClassOfTestAndBranch V8_FINAL : public LControlInstruction<1, 2> { | 1064 class LClassOfTestAndBranch FINAL : public LControlInstruction<1, 2> { |
| 1065 public: | 1065 public: |
| 1066 LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { | 1066 LClassOfTestAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 1067 inputs_[0] = value; | 1067 inputs_[0] = value; |
| 1068 temps_[0] = temp1; | 1068 temps_[0] = temp1; |
| 1069 temps_[1] = temp2; | 1069 temps_[1] = temp2; |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 LOperand* value() { return inputs_[0]; } | 1072 LOperand* value() { return inputs_[0]; } |
| 1073 LOperand* temp1() { return temps_[0]; } | 1073 LOperand* temp1() { return temps_[0]; } |
| 1074 LOperand* temp2() { return temps_[1]; } | 1074 LOperand* temp2() { return temps_[1]; } |
| 1075 | 1075 |
| 1076 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 1076 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
| 1077 "class-of-test-and-branch") | 1077 "class-of-test-and-branch") |
| 1078 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) | 1078 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
| 1079 | 1079 |
| 1080 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1080 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1081 }; | 1081 }; |
| 1082 | 1082 |
| 1083 | 1083 |
| 1084 class LCmpHoleAndBranchD V8_FINAL : public LControlInstruction<1, 1> { | 1084 class LCmpHoleAndBranchD FINAL : public LControlInstruction<1, 1> { |
| 1085 public: | 1085 public: |
| 1086 explicit LCmpHoleAndBranchD(LOperand* object, LOperand* temp) { | 1086 explicit LCmpHoleAndBranchD(LOperand* object, LOperand* temp) { |
| 1087 inputs_[0] = object; | 1087 inputs_[0] = object; |
| 1088 temps_[0] = temp; | 1088 temps_[0] = temp; |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 LOperand* object() { return inputs_[0]; } | 1091 LOperand* object() { return inputs_[0]; } |
| 1092 LOperand* temp() { return temps_[0]; } | 1092 LOperand* temp() { return temps_[0]; } |
| 1093 | 1093 |
| 1094 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchD, "cmp-hole-and-branch-d") | 1094 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchD, "cmp-hole-and-branch-d") |
| 1095 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) | 1095 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) |
| 1096 }; | 1096 }; |
| 1097 | 1097 |
| 1098 | 1098 |
| 1099 class LCmpHoleAndBranchT V8_FINAL : public LControlInstruction<1, 0> { | 1099 class LCmpHoleAndBranchT FINAL : public LControlInstruction<1, 0> { |
| 1100 public: | 1100 public: |
| 1101 explicit LCmpHoleAndBranchT(LOperand* object) { | 1101 explicit LCmpHoleAndBranchT(LOperand* object) { |
| 1102 inputs_[0] = object; | 1102 inputs_[0] = object; |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 LOperand* object() { return inputs_[0]; } | 1105 LOperand* object() { return inputs_[0]; } |
| 1106 | 1106 |
| 1107 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchT, "cmp-hole-and-branch-t") | 1107 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranchT, "cmp-hole-and-branch-t") |
| 1108 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) | 1108 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) |
| 1109 }; | 1109 }; |
| 1110 | 1110 |
| 1111 | 1111 |
| 1112 class LCmpMapAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1112 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1113 public: | 1113 public: |
| 1114 LCmpMapAndBranch(LOperand* value, LOperand* temp) { | 1114 LCmpMapAndBranch(LOperand* value, LOperand* temp) { |
| 1115 inputs_[0] = value; | 1115 inputs_[0] = value; |
| 1116 temps_[0] = temp; | 1116 temps_[0] = temp; |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 LOperand* value() { return inputs_[0]; } | 1119 LOperand* value() { return inputs_[0]; } |
| 1120 LOperand* temp() { return temps_[0]; } | 1120 LOperand* temp() { return temps_[0]; } |
| 1121 | 1121 |
| 1122 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1122 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
| 1123 DECLARE_HYDROGEN_ACCESSOR(CompareMap) | 1123 DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
| 1124 | 1124 |
| 1125 Handle<Map> map() const { return hydrogen()->map().handle(); } | 1125 Handle<Map> map() const { return hydrogen()->map().handle(); } |
| 1126 }; | 1126 }; |
| 1127 | 1127 |
| 1128 | 1128 |
| 1129 class LCmpObjectEqAndBranch V8_FINAL : public LControlInstruction<2, 0> { | 1129 class LCmpObjectEqAndBranch FINAL : public LControlInstruction<2, 0> { |
| 1130 public: | 1130 public: |
| 1131 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { | 1131 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { |
| 1132 inputs_[0] = left; | 1132 inputs_[0] = left; |
| 1133 inputs_[1] = right; | 1133 inputs_[1] = right; |
| 1134 } | 1134 } |
| 1135 | 1135 |
| 1136 LOperand* left() { return inputs_[0]; } | 1136 LOperand* left() { return inputs_[0]; } |
| 1137 LOperand* right() { return inputs_[1]; } | 1137 LOperand* right() { return inputs_[1]; } |
| 1138 | 1138 |
| 1139 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") | 1139 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") |
| 1140 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) | 1140 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) |
| 1141 }; | 1141 }; |
| 1142 | 1142 |
| 1143 | 1143 |
| 1144 class LCmpT V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1144 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1145 public: | 1145 public: |
| 1146 LCmpT(LOperand* context, LOperand* left, LOperand* right) { | 1146 LCmpT(LOperand* context, LOperand* left, LOperand* right) { |
| 1147 inputs_[0] = context; | 1147 inputs_[0] = context; |
| 1148 inputs_[1] = left; | 1148 inputs_[1] = left; |
| 1149 inputs_[2] = right; | 1149 inputs_[2] = right; |
| 1150 } | 1150 } |
| 1151 | 1151 |
| 1152 LOperand* context() { return inputs_[0]; } | 1152 LOperand* context() { return inputs_[0]; } |
| 1153 LOperand* left() { return inputs_[1]; } | 1153 LOperand* left() { return inputs_[1]; } |
| 1154 LOperand* right() { return inputs_[2]; } | 1154 LOperand* right() { return inputs_[2]; } |
| 1155 | 1155 |
| 1156 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 1156 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
| 1157 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) | 1157 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) |
| 1158 | 1158 |
| 1159 Token::Value op() const { return hydrogen()->token(); } | 1159 Token::Value op() const { return hydrogen()->token(); } |
| 1160 }; | 1160 }; |
| 1161 | 1161 |
| 1162 | 1162 |
| 1163 class LCompareMinusZeroAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1163 class LCompareMinusZeroAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1164 public: | 1164 public: |
| 1165 LCompareMinusZeroAndBranch(LOperand* value, LOperand* temp) { | 1165 LCompareMinusZeroAndBranch(LOperand* value, LOperand* temp) { |
| 1166 inputs_[0] = value; | 1166 inputs_[0] = value; |
| 1167 temps_[0] = temp; | 1167 temps_[0] = temp; |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 LOperand* value() { return inputs_[0]; } | 1170 LOperand* value() { return inputs_[0]; } |
| 1171 LOperand* temp() { return temps_[0]; } | 1171 LOperand* temp() { return temps_[0]; } |
| 1172 | 1172 |
| 1173 DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch, | 1173 DECLARE_CONCRETE_INSTRUCTION(CompareMinusZeroAndBranch, |
| 1174 "cmp-minus-zero-and-branch") | 1174 "cmp-minus-zero-and-branch") |
| 1175 DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch) | 1175 DECLARE_HYDROGEN_ACCESSOR(CompareMinusZeroAndBranch) |
| 1176 }; | 1176 }; |
| 1177 | 1177 |
| 1178 | 1178 |
| 1179 class LCompareNumericAndBranch V8_FINAL : public LControlInstruction<2, 0> { | 1179 class LCompareNumericAndBranch FINAL : public LControlInstruction<2, 0> { |
| 1180 public: | 1180 public: |
| 1181 LCompareNumericAndBranch(LOperand* left, LOperand* right) { | 1181 LCompareNumericAndBranch(LOperand* left, LOperand* right) { |
| 1182 inputs_[0] = left; | 1182 inputs_[0] = left; |
| 1183 inputs_[1] = right; | 1183 inputs_[1] = right; |
| 1184 } | 1184 } |
| 1185 | 1185 |
| 1186 LOperand* left() { return inputs_[0]; } | 1186 LOperand* left() { return inputs_[0]; } |
| 1187 LOperand* right() { return inputs_[1]; } | 1187 LOperand* right() { return inputs_[1]; } |
| 1188 | 1188 |
| 1189 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, | 1189 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, |
| 1190 "compare-numeric-and-branch") | 1190 "compare-numeric-and-branch") |
| 1191 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) | 1191 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) |
| 1192 | 1192 |
| 1193 Token::Value op() const { return hydrogen()->token(); } | 1193 Token::Value op() const { return hydrogen()->token(); } |
| 1194 bool is_double() const { | 1194 bool is_double() const { |
| 1195 return hydrogen()->representation().IsDouble(); | 1195 return hydrogen()->representation().IsDouble(); |
| 1196 } | 1196 } |
| 1197 | 1197 |
| 1198 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1198 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1199 }; | 1199 }; |
| 1200 | 1200 |
| 1201 | 1201 |
| 1202 class LConstantD V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1202 class LConstantD FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1203 public: | 1203 public: |
| 1204 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 1204 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
| 1205 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1205 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1206 | 1206 |
| 1207 double value() const { return hydrogen()->DoubleValue(); } | 1207 double value() const { return hydrogen()->DoubleValue(); } |
| 1208 }; | 1208 }; |
| 1209 | 1209 |
| 1210 | 1210 |
| 1211 class LConstantE V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1211 class LConstantE FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1212 public: | 1212 public: |
| 1213 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") | 1213 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") |
| 1214 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1214 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1215 | 1215 |
| 1216 ExternalReference value() const { | 1216 ExternalReference value() const { |
| 1217 return hydrogen()->ExternalReferenceValue(); | 1217 return hydrogen()->ExternalReferenceValue(); |
| 1218 } | 1218 } |
| 1219 }; | 1219 }; |
| 1220 | 1220 |
| 1221 | 1221 |
| 1222 class LConstantI V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1222 class LConstantI FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1223 public: | 1223 public: |
| 1224 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") | 1224 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") |
| 1225 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1225 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1226 | 1226 |
| 1227 int32_t value() const { return hydrogen()->Integer32Value(); } | 1227 int32_t value() const { return hydrogen()->Integer32Value(); } |
| 1228 }; | 1228 }; |
| 1229 | 1229 |
| 1230 | 1230 |
| 1231 class LConstantS V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1231 class LConstantS FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1232 public: | 1232 public: |
| 1233 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s") | 1233 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s") |
| 1234 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1234 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1235 | 1235 |
| 1236 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } | 1236 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } |
| 1237 }; | 1237 }; |
| 1238 | 1238 |
| 1239 | 1239 |
| 1240 class LConstantT V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1240 class LConstantT FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1241 public: | 1241 public: |
| 1242 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1242 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
| 1243 DECLARE_HYDROGEN_ACCESSOR(Constant) | 1243 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 1244 | 1244 |
| 1245 Handle<Object> value(Isolate* isolate) const { | 1245 Handle<Object> value(Isolate* isolate) const { |
| 1246 return hydrogen()->handle(isolate); | 1246 return hydrogen()->handle(isolate); |
| 1247 } | 1247 } |
| 1248 }; | 1248 }; |
| 1249 | 1249 |
| 1250 | 1250 |
| 1251 class LContext V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1251 class LContext FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1252 public: | 1252 public: |
| 1253 DECLARE_CONCRETE_INSTRUCTION(Context, "context") | 1253 DECLARE_CONCRETE_INSTRUCTION(Context, "context") |
| 1254 DECLARE_HYDROGEN_ACCESSOR(Context) | 1254 DECLARE_HYDROGEN_ACCESSOR(Context) |
| 1255 }; | 1255 }; |
| 1256 | 1256 |
| 1257 | 1257 |
| 1258 class LDateField V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1258 class LDateField FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1259 public: | 1259 public: |
| 1260 LDateField(LOperand* date, Smi* index) : index_(index) { | 1260 LDateField(LOperand* date, Smi* index) : index_(index) { |
| 1261 inputs_[0] = date; | 1261 inputs_[0] = date; |
| 1262 } | 1262 } |
| 1263 | 1263 |
| 1264 LOperand* date() { return inputs_[0]; } | 1264 LOperand* date() { return inputs_[0]; } |
| 1265 Smi* index() const { return index_; } | 1265 Smi* index() const { return index_; } |
| 1266 | 1266 |
| 1267 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field") | 1267 DECLARE_CONCRETE_INSTRUCTION(DateField, "date-field") |
| 1268 DECLARE_HYDROGEN_ACCESSOR(DateField) | 1268 DECLARE_HYDROGEN_ACCESSOR(DateField) |
| 1269 | 1269 |
| 1270 private: | 1270 private: |
| 1271 Smi* index_; | 1271 Smi* index_; |
| 1272 }; | 1272 }; |
| 1273 | 1273 |
| 1274 | 1274 |
| 1275 class LDebugBreak V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 1275 class LDebugBreak FINAL : public LTemplateInstruction<0, 0, 0> { |
| 1276 public: | 1276 public: |
| 1277 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break") | 1277 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break") |
| 1278 }; | 1278 }; |
| 1279 | 1279 |
| 1280 | 1280 |
| 1281 class LDeclareGlobals V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 1281 class LDeclareGlobals FINAL : public LTemplateInstruction<0, 1, 0> { |
| 1282 public: | 1282 public: |
| 1283 explicit LDeclareGlobals(LOperand* context) { | 1283 explicit LDeclareGlobals(LOperand* context) { |
| 1284 inputs_[0] = context; | 1284 inputs_[0] = context; |
| 1285 } | 1285 } |
| 1286 | 1286 |
| 1287 LOperand* context() { return inputs_[0]; } | 1287 LOperand* context() { return inputs_[0]; } |
| 1288 | 1288 |
| 1289 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") | 1289 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") |
| 1290 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) | 1290 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) |
| 1291 }; | 1291 }; |
| 1292 | 1292 |
| 1293 | 1293 |
| 1294 class LDeoptimize V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 1294 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> { |
| 1295 public: | 1295 public: |
| 1296 virtual bool IsControl() const V8_OVERRIDE { return true; } | 1296 virtual bool IsControl() const OVERRIDE { return true; } |
| 1297 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 1297 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 1298 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) | 1298 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) |
| 1299 }; | 1299 }; |
| 1300 | 1300 |
| 1301 | 1301 |
| 1302 class LDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1302 class LDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1303 public: | 1303 public: |
| 1304 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 1304 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 1305 inputs_[0] = dividend; | 1305 inputs_[0] = dividend; |
| 1306 divisor_ = divisor; | 1306 divisor_ = divisor; |
| 1307 } | 1307 } |
| 1308 | 1308 |
| 1309 LOperand* dividend() { return inputs_[0]; } | 1309 LOperand* dividend() { return inputs_[0]; } |
| 1310 int32_t divisor() const { return divisor_; } | 1310 int32_t divisor() const { return divisor_; } |
| 1311 | 1311 |
| 1312 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") | 1312 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") |
| 1313 DECLARE_HYDROGEN_ACCESSOR(Div) | 1313 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 1314 | 1314 |
| 1315 private: | 1315 private: |
| 1316 int32_t divisor_; | 1316 int32_t divisor_; |
| 1317 }; | 1317 }; |
| 1318 | 1318 |
| 1319 | 1319 |
| 1320 class LDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 1320 class LDivByConstI FINAL : public LTemplateInstruction<1, 1, 1> { |
| 1321 public: | 1321 public: |
| 1322 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | 1322 LDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 1323 inputs_[0] = dividend; | 1323 inputs_[0] = dividend; |
| 1324 divisor_ = divisor; | 1324 divisor_ = divisor; |
| 1325 temps_[0] = temp; | 1325 temps_[0] = temp; |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 LOperand* dividend() { return inputs_[0]; } | 1328 LOperand* dividend() { return inputs_[0]; } |
| 1329 int32_t divisor() const { return divisor_; } | 1329 int32_t divisor() const { return divisor_; } |
| 1330 LOperand* temp() { return temps_[0]; } | 1330 LOperand* temp() { return temps_[0]; } |
| 1331 | 1331 |
| 1332 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") | 1332 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") |
| 1333 DECLARE_HYDROGEN_ACCESSOR(Div) | 1333 DECLARE_HYDROGEN_ACCESSOR(Div) |
| 1334 | 1334 |
| 1335 private: | 1335 private: |
| 1336 int32_t divisor_; | 1336 int32_t divisor_; |
| 1337 }; | 1337 }; |
| 1338 | 1338 |
| 1339 | 1339 |
| 1340 class LDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1340 class LDivI FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1341 public: | 1341 public: |
| 1342 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 1342 LDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { |
| 1343 inputs_[0] = dividend; | 1343 inputs_[0] = dividend; |
| 1344 inputs_[1] = divisor; | 1344 inputs_[1] = divisor; |
| 1345 temps_[0] = temp; | 1345 temps_[0] = temp; |
| 1346 } | 1346 } |
| 1347 | 1347 |
| 1348 LOperand* dividend() { return inputs_[0]; } | 1348 LOperand* dividend() { return inputs_[0]; } |
| 1349 LOperand* divisor() { return inputs_[1]; } | 1349 LOperand* divisor() { return inputs_[1]; } |
| 1350 LOperand* temp() { return temps_[0]; } | 1350 LOperand* temp() { return temps_[0]; } |
| 1351 | 1351 |
| 1352 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 1352 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") |
| 1353 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) | 1353 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) |
| 1354 }; | 1354 }; |
| 1355 | 1355 |
| 1356 | 1356 |
| 1357 class LDoubleToIntOrSmi V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1357 class LDoubleToIntOrSmi FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1358 public: | 1358 public: |
| 1359 explicit LDoubleToIntOrSmi(LOperand* value) { | 1359 explicit LDoubleToIntOrSmi(LOperand* value) { |
| 1360 inputs_[0] = value; | 1360 inputs_[0] = value; |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 LOperand* value() { return inputs_[0]; } | 1363 LOperand* value() { return inputs_[0]; } |
| 1364 | 1364 |
| 1365 DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi") | 1365 DECLARE_CONCRETE_INSTRUCTION(DoubleToIntOrSmi, "double-to-int-or-smi") |
| 1366 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 1366 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 1367 | 1367 |
| 1368 bool tag_result() { return hydrogen()->representation().IsSmi(); } | 1368 bool tag_result() { return hydrogen()->representation().IsSmi(); } |
| 1369 }; | 1369 }; |
| 1370 | 1370 |
| 1371 | 1371 |
| 1372 class LForInCacheArray V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1372 class LForInCacheArray FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1373 public: | 1373 public: |
| 1374 explicit LForInCacheArray(LOperand* map) { | 1374 explicit LForInCacheArray(LOperand* map) { |
| 1375 inputs_[0] = map; | 1375 inputs_[0] = map; |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 LOperand* map() { return inputs_[0]; } | 1378 LOperand* map() { return inputs_[0]; } |
| 1379 | 1379 |
| 1380 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") | 1380 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") |
| 1381 | 1381 |
| 1382 int idx() { | 1382 int idx() { |
| 1383 return HForInCacheArray::cast(this->hydrogen_value())->idx(); | 1383 return HForInCacheArray::cast(this->hydrogen_value())->idx(); |
| 1384 } | 1384 } |
| 1385 }; | 1385 }; |
| 1386 | 1386 |
| 1387 | 1387 |
| 1388 class LForInPrepareMap V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1388 class LForInPrepareMap FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1389 public: | 1389 public: |
| 1390 LForInPrepareMap(LOperand* context, LOperand* object) { | 1390 LForInPrepareMap(LOperand* context, LOperand* object) { |
| 1391 inputs_[0] = context; | 1391 inputs_[0] = context; |
| 1392 inputs_[1] = object; | 1392 inputs_[1] = object; |
| 1393 } | 1393 } |
| 1394 | 1394 |
| 1395 LOperand* context() { return inputs_[0]; } | 1395 LOperand* context() { return inputs_[0]; } |
| 1396 LOperand* object() { return inputs_[1]; } | 1396 LOperand* object() { return inputs_[1]; } |
| 1397 | 1397 |
| 1398 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") | 1398 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") |
| 1399 }; | 1399 }; |
| 1400 | 1400 |
| 1401 | 1401 |
| 1402 class LGetCachedArrayIndex V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1402 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1403 public: | 1403 public: |
| 1404 explicit LGetCachedArrayIndex(LOperand* value) { | 1404 explicit LGetCachedArrayIndex(LOperand* value) { |
| 1405 inputs_[0] = value; | 1405 inputs_[0] = value; |
| 1406 } | 1406 } |
| 1407 | 1407 |
| 1408 LOperand* value() { return inputs_[0]; } | 1408 LOperand* value() { return inputs_[0]; } |
| 1409 | 1409 |
| 1410 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") | 1410 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") |
| 1411 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) | 1411 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) |
| 1412 }; | 1412 }; |
| 1413 | 1413 |
| 1414 | 1414 |
| 1415 class LHasCachedArrayIndexAndBranch V8_FINAL | 1415 class LHasCachedArrayIndexAndBranch FINAL |
| 1416 : public LControlInstruction<1, 1> { | 1416 : public LControlInstruction<1, 1> { |
| 1417 public: | 1417 public: |
| 1418 LHasCachedArrayIndexAndBranch(LOperand* value, LOperand* temp) { | 1418 LHasCachedArrayIndexAndBranch(LOperand* value, LOperand* temp) { |
| 1419 inputs_[0] = value; | 1419 inputs_[0] = value; |
| 1420 temps_[0] = temp; | 1420 temps_[0] = temp; |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 LOperand* value() { return inputs_[0]; } | 1423 LOperand* value() { return inputs_[0]; } |
| 1424 LOperand* temp() { return temps_[0]; } | 1424 LOperand* temp() { return temps_[0]; } |
| 1425 | 1425 |
| 1426 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 1426 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
| 1427 "has-cached-array-index-and-branch") | 1427 "has-cached-array-index-and-branch") |
| 1428 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) | 1428 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) |
| 1429 | 1429 |
| 1430 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1430 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1431 }; | 1431 }; |
| 1432 | 1432 |
| 1433 | 1433 |
| 1434 class LHasInstanceTypeAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1434 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1435 public: | 1435 public: |
| 1436 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { | 1436 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { |
| 1437 inputs_[0] = value; | 1437 inputs_[0] = value; |
| 1438 temps_[0] = temp; | 1438 temps_[0] = temp; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 LOperand* value() { return inputs_[0]; } | 1441 LOperand* value() { return inputs_[0]; } |
| 1442 LOperand* temp() { return temps_[0]; } | 1442 LOperand* temp() { return temps_[0]; } |
| 1443 | 1443 |
| 1444 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 1444 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
| 1445 "has-instance-type-and-branch") | 1445 "has-instance-type-and-branch") |
| 1446 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) | 1446 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) |
| 1447 | 1447 |
| 1448 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1448 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1449 }; | 1449 }; |
| 1450 | 1450 |
| 1451 | 1451 |
| 1452 class LInnerAllocatedObject V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1452 class LInnerAllocatedObject FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1453 public: | 1453 public: |
| 1454 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { | 1454 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { |
| 1455 inputs_[0] = base_object; | 1455 inputs_[0] = base_object; |
| 1456 inputs_[1] = offset; | 1456 inputs_[1] = offset; |
| 1457 } | 1457 } |
| 1458 | 1458 |
| 1459 LOperand* base_object() const { return inputs_[0]; } | 1459 LOperand* base_object() const { return inputs_[0]; } |
| 1460 LOperand* offset() const { return inputs_[1]; } | 1460 LOperand* offset() const { return inputs_[1]; } |
| 1461 | 1461 |
| 1462 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1462 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1463 | 1463 |
| 1464 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object") | 1464 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object") |
| 1465 }; | 1465 }; |
| 1466 | 1466 |
| 1467 | 1467 |
| 1468 class LInstanceOf V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 1468 class LInstanceOf FINAL : public LTemplateInstruction<1, 3, 0> { |
| 1469 public: | 1469 public: |
| 1470 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { | 1470 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { |
| 1471 inputs_[0] = context; | 1471 inputs_[0] = context; |
| 1472 inputs_[1] = left; | 1472 inputs_[1] = left; |
| 1473 inputs_[2] = right; | 1473 inputs_[2] = right; |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 LOperand* context() { return inputs_[0]; } | 1476 LOperand* context() { return inputs_[0]; } |
| 1477 LOperand* left() { return inputs_[1]; } | 1477 LOperand* left() { return inputs_[1]; } |
| 1478 LOperand* right() { return inputs_[2]; } | 1478 LOperand* right() { return inputs_[2]; } |
| 1479 | 1479 |
| 1480 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 1480 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
| 1481 }; | 1481 }; |
| 1482 | 1482 |
| 1483 | 1483 |
| 1484 class LInstanceOfKnownGlobal V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1484 class LInstanceOfKnownGlobal FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1485 public: | 1485 public: |
| 1486 LInstanceOfKnownGlobal(LOperand* context, LOperand* value) { | 1486 LInstanceOfKnownGlobal(LOperand* context, LOperand* value) { |
| 1487 inputs_[0] = context; | 1487 inputs_[0] = context; |
| 1488 inputs_[1] = value; | 1488 inputs_[1] = value; |
| 1489 } | 1489 } |
| 1490 | 1490 |
| 1491 LOperand* context() { return inputs_[0]; } | 1491 LOperand* context() { return inputs_[0]; } |
| 1492 LOperand* value() { return inputs_[1]; } | 1492 LOperand* value() { return inputs_[1]; } |
| 1493 | 1493 |
| 1494 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 1494 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
| 1495 "instance-of-known-global") | 1495 "instance-of-known-global") |
| 1496 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 1496 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) |
| 1497 | 1497 |
| 1498 Handle<JSFunction> function() const { return hydrogen()->function(); } | 1498 Handle<JSFunction> function() const { return hydrogen()->function(); } |
| 1499 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { | 1499 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { |
| 1500 return lazy_deopt_env_; | 1500 return lazy_deopt_env_; |
| 1501 } | 1501 } |
| 1502 virtual void SetDeferredLazyDeoptimizationEnvironment( | 1502 virtual void SetDeferredLazyDeoptimizationEnvironment( |
| 1503 LEnvironment* env) V8_OVERRIDE { | 1503 LEnvironment* env) OVERRIDE { |
| 1504 lazy_deopt_env_ = env; | 1504 lazy_deopt_env_ = env; |
| 1505 } | 1505 } |
| 1506 | 1506 |
| 1507 private: | 1507 private: |
| 1508 LEnvironment* lazy_deopt_env_; | 1508 LEnvironment* lazy_deopt_env_; |
| 1509 }; | 1509 }; |
| 1510 | 1510 |
| 1511 | 1511 |
| 1512 class LInteger32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1512 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1513 public: | 1513 public: |
| 1514 explicit LInteger32ToDouble(LOperand* value) { | 1514 explicit LInteger32ToDouble(LOperand* value) { |
| 1515 inputs_[0] = value; | 1515 inputs_[0] = value; |
| 1516 } | 1516 } |
| 1517 | 1517 |
| 1518 LOperand* value() { return inputs_[0]; } | 1518 LOperand* value() { return inputs_[0]; } |
| 1519 | 1519 |
| 1520 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1520 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
| 1521 }; | 1521 }; |
| 1522 | 1522 |
| 1523 | 1523 |
| 1524 class LCallWithDescriptor V8_FINAL : public LTemplateResultInstruction<1> { | 1524 class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { |
| 1525 public: | 1525 public: |
| 1526 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, | 1526 LCallWithDescriptor(const CallInterfaceDescriptor* descriptor, |
| 1527 const ZoneList<LOperand*>& operands, Zone* zone) | 1527 const ZoneList<LOperand*>& operands, Zone* zone) |
| 1528 : descriptor_(descriptor), | 1528 : descriptor_(descriptor), |
| 1529 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { | 1529 inputs_(descriptor->GetRegisterParameterCount() + 1, zone) { |
| 1530 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); | 1530 DCHECK(descriptor->GetRegisterParameterCount() + 1 == operands.length()); |
| 1531 inputs_.AddAll(operands, zone); | 1531 inputs_.AddAll(operands, zone); |
| 1532 } | 1532 } |
| 1533 | 1533 |
| 1534 LOperand* target() const { return inputs_[0]; } | 1534 LOperand* target() const { return inputs_[0]; } |
| 1535 | 1535 |
| 1536 const CallInterfaceDescriptor* descriptor() { return descriptor_; } | 1536 const CallInterfaceDescriptor* descriptor() { return descriptor_; } |
| 1537 | 1537 |
| 1538 private: | 1538 private: |
| 1539 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") | 1539 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") |
| 1540 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) | 1540 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) |
| 1541 | 1541 |
| 1542 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1542 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1543 | 1543 |
| 1544 int arity() const { return hydrogen()->argument_count() - 1; } | 1544 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1545 | 1545 |
| 1546 const CallInterfaceDescriptor* descriptor_; | 1546 const CallInterfaceDescriptor* descriptor_; |
| 1547 ZoneList<LOperand*> inputs_; | 1547 ZoneList<LOperand*> inputs_; |
| 1548 | 1548 |
| 1549 // Iterator support. | 1549 // Iterator support. |
| 1550 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); } | 1550 virtual int InputCount() FINAL OVERRIDE { return inputs_.length(); } |
| 1551 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } | 1551 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } |
| 1552 | 1552 |
| 1553 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; } | 1553 virtual int TempCount() FINAL OVERRIDE { return 0; } |
| 1554 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; } | 1554 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return NULL; } |
| 1555 }; | 1555 }; |
| 1556 | 1556 |
| 1557 | 1557 |
| 1558 class LInvokeFunction V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 1558 class LInvokeFunction FINAL : public LTemplateInstruction<1, 2, 0> { |
| 1559 public: | 1559 public: |
| 1560 LInvokeFunction(LOperand* context, LOperand* function) { | 1560 LInvokeFunction(LOperand* context, LOperand* function) { |
| 1561 inputs_[0] = context; | 1561 inputs_[0] = context; |
| 1562 inputs_[1] = function; | 1562 inputs_[1] = function; |
| 1563 } | 1563 } |
| 1564 | 1564 |
| 1565 LOperand* context() { return inputs_[0]; } | 1565 LOperand* context() { return inputs_[0]; } |
| 1566 LOperand* function() { return inputs_[1]; } | 1566 LOperand* function() { return inputs_[1]; } |
| 1567 | 1567 |
| 1568 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") | 1568 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") |
| 1569 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) | 1569 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) |
| 1570 | 1570 |
| 1571 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1571 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1572 | 1572 |
| 1573 int arity() const { return hydrogen()->argument_count() - 1; } | 1573 int arity() const { return hydrogen()->argument_count() - 1; } |
| 1574 }; | 1574 }; |
| 1575 | 1575 |
| 1576 | 1576 |
| 1577 class LIsConstructCallAndBranch V8_FINAL : public LControlInstruction<0, 2> { | 1577 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 2> { |
| 1578 public: | 1578 public: |
| 1579 LIsConstructCallAndBranch(LOperand* temp1, LOperand* temp2) { | 1579 LIsConstructCallAndBranch(LOperand* temp1, LOperand* temp2) { |
| 1580 temps_[0] = temp1; | 1580 temps_[0] = temp1; |
| 1581 temps_[1] = temp2; | 1581 temps_[1] = temp2; |
| 1582 } | 1582 } |
| 1583 | 1583 |
| 1584 LOperand* temp1() { return temps_[0]; } | 1584 LOperand* temp1() { return temps_[0]; } |
| 1585 LOperand* temp2() { return temps_[1]; } | 1585 LOperand* temp2() { return temps_[1]; } |
| 1586 | 1586 |
| 1587 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, | 1587 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
| 1588 "is-construct-call-and-branch") | 1588 "is-construct-call-and-branch") |
| 1589 }; | 1589 }; |
| 1590 | 1590 |
| 1591 | 1591 |
| 1592 class LIsObjectAndBranch V8_FINAL : public LControlInstruction<1, 2> { | 1592 class LIsObjectAndBranch FINAL : public LControlInstruction<1, 2> { |
| 1593 public: | 1593 public: |
| 1594 LIsObjectAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { | 1594 LIsObjectAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 1595 inputs_[0] = value; | 1595 inputs_[0] = value; |
| 1596 temps_[0] = temp1; | 1596 temps_[0] = temp1; |
| 1597 temps_[1] = temp2; | 1597 temps_[1] = temp2; |
| 1598 } | 1598 } |
| 1599 | 1599 |
| 1600 LOperand* value() { return inputs_[0]; } | 1600 LOperand* value() { return inputs_[0]; } |
| 1601 LOperand* temp1() { return temps_[0]; } | 1601 LOperand* temp1() { return temps_[0]; } |
| 1602 LOperand* temp2() { return temps_[1]; } | 1602 LOperand* temp2() { return temps_[1]; } |
| 1603 | 1603 |
| 1604 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 1604 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
| 1605 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) | 1605 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) |
| 1606 | 1606 |
| 1607 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1607 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1608 }; | 1608 }; |
| 1609 | 1609 |
| 1610 | 1610 |
| 1611 class LIsStringAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1611 class LIsStringAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1612 public: | 1612 public: |
| 1613 LIsStringAndBranch(LOperand* value, LOperand* temp) { | 1613 LIsStringAndBranch(LOperand* value, LOperand* temp) { |
| 1614 inputs_[0] = value; | 1614 inputs_[0] = value; |
| 1615 temps_[0] = temp; | 1615 temps_[0] = temp; |
| 1616 } | 1616 } |
| 1617 | 1617 |
| 1618 LOperand* value() { return inputs_[0]; } | 1618 LOperand* value() { return inputs_[0]; } |
| 1619 LOperand* temp() { return temps_[0]; } | 1619 LOperand* temp() { return temps_[0]; } |
| 1620 | 1620 |
| 1621 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") | 1621 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") |
| 1622 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) | 1622 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) |
| 1623 | 1623 |
| 1624 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1624 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1625 }; | 1625 }; |
| 1626 | 1626 |
| 1627 | 1627 |
| 1628 class LIsSmiAndBranch V8_FINAL : public LControlInstruction<1, 0> { | 1628 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> { |
| 1629 public: | 1629 public: |
| 1630 explicit LIsSmiAndBranch(LOperand* value) { | 1630 explicit LIsSmiAndBranch(LOperand* value) { |
| 1631 inputs_[0] = value; | 1631 inputs_[0] = value; |
| 1632 } | 1632 } |
| 1633 | 1633 |
| 1634 LOperand* value() { return inputs_[0]; } | 1634 LOperand* value() { return inputs_[0]; } |
| 1635 | 1635 |
| 1636 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 1636 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
| 1637 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) | 1637 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
| 1638 | 1638 |
| 1639 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1639 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1640 }; | 1640 }; |
| 1641 | 1641 |
| 1642 | 1642 |
| 1643 class LIsUndetectableAndBranch V8_FINAL : public LControlInstruction<1, 1> { | 1643 class LIsUndetectableAndBranch FINAL : public LControlInstruction<1, 1> { |
| 1644 public: | 1644 public: |
| 1645 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { | 1645 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { |
| 1646 inputs_[0] = value; | 1646 inputs_[0] = value; |
| 1647 temps_[0] = temp; | 1647 temps_[0] = temp; |
| 1648 } | 1648 } |
| 1649 | 1649 |
| 1650 LOperand* value() { return inputs_[0]; } | 1650 LOperand* value() { return inputs_[0]; } |
| 1651 LOperand* temp() { return temps_[0]; } | 1651 LOperand* temp() { return temps_[0]; } |
| 1652 | 1652 |
| 1653 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, | 1653 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, |
| 1654 "is-undetectable-and-branch") | 1654 "is-undetectable-and-branch") |
| 1655 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) | 1655 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) |
| 1656 | 1656 |
| 1657 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1657 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1658 }; | 1658 }; |
| 1659 | 1659 |
| 1660 | 1660 |
| 1661 class LLoadContextSlot V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1661 class LLoadContextSlot FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1662 public: | 1662 public: |
| 1663 explicit LLoadContextSlot(LOperand* context) { | 1663 explicit LLoadContextSlot(LOperand* context) { |
| 1664 inputs_[0] = context; | 1664 inputs_[0] = context; |
| 1665 } | 1665 } |
| 1666 | 1666 |
| 1667 LOperand* context() { return inputs_[0]; } | 1667 LOperand* context() { return inputs_[0]; } |
| 1668 | 1668 |
| 1669 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1669 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
| 1670 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1670 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
| 1671 | 1671 |
| 1672 int slot_index() const { return hydrogen()->slot_index(); } | 1672 int slot_index() const { return hydrogen()->slot_index(); } |
| 1673 | 1673 |
| 1674 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1674 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1675 }; | 1675 }; |
| 1676 | 1676 |
| 1677 | 1677 |
| 1678 class LLoadNamedField V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1678 class LLoadNamedField FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1679 public: | 1679 public: |
| 1680 explicit LLoadNamedField(LOperand* object) { | 1680 explicit LLoadNamedField(LOperand* object) { |
| 1681 inputs_[0] = object; | 1681 inputs_[0] = object; |
| 1682 } | 1682 } |
| 1683 | 1683 |
| 1684 LOperand* object() { return inputs_[0]; } | 1684 LOperand* object() { return inputs_[0]; } |
| 1685 | 1685 |
| 1686 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1686 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
| 1687 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1687 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
| 1688 }; | 1688 }; |
| 1689 | 1689 |
| 1690 | 1690 |
| 1691 class LFunctionLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1691 class LFunctionLiteral FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1692 public: | 1692 public: |
| 1693 explicit LFunctionLiteral(LOperand* context) { | 1693 explicit LFunctionLiteral(LOperand* context) { |
| 1694 inputs_[0] = context; | 1694 inputs_[0] = context; |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 LOperand* context() { return inputs_[0]; } | 1697 LOperand* context() { return inputs_[0]; } |
| 1698 | 1698 |
| 1699 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 1699 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
| 1700 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 1700 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
| 1701 }; | 1701 }; |
| 1702 | 1702 |
| 1703 | 1703 |
| 1704 class LLoadFunctionPrototype V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 1704 class LLoadFunctionPrototype FINAL : public LTemplateInstruction<1, 1, 1> { |
| 1705 public: | 1705 public: |
| 1706 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { | 1706 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { |
| 1707 inputs_[0] = function; | 1707 inputs_[0] = function; |
| 1708 temps_[0] = temp; | 1708 temps_[0] = temp; |
| 1709 } | 1709 } |
| 1710 | 1710 |
| 1711 LOperand* function() { return inputs_[0]; } | 1711 LOperand* function() { return inputs_[0]; } |
| 1712 LOperand* temp() { return temps_[0]; } | 1712 LOperand* temp() { return temps_[0]; } |
| 1713 | 1713 |
| 1714 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1714 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
| 1715 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1715 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
| 1716 }; | 1716 }; |
| 1717 | 1717 |
| 1718 | 1718 |
| 1719 class LLoadGlobalCell V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1719 class LLoadGlobalCell FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1720 public: | 1720 public: |
| 1721 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell") | 1721 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalCell, "load-global-cell") |
| 1722 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell) | 1722 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalCell) |
| 1723 }; | 1723 }; |
| 1724 | 1724 |
| 1725 | 1725 |
| 1726 class LLoadGlobalGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1726 class LLoadGlobalGeneric FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1727 public: | 1727 public: |
| 1728 LLoadGlobalGeneric(LOperand* context, LOperand* global_object, | 1728 LLoadGlobalGeneric(LOperand* context, LOperand* global_object, |
| 1729 LOperand* vector) { | 1729 LOperand* vector) { |
| 1730 inputs_[0] = context; | 1730 inputs_[0] = context; |
| 1731 inputs_[1] = global_object; | 1731 inputs_[1] = global_object; |
| 1732 temps_[0] = vector; | 1732 temps_[0] = vector; |
| 1733 } | 1733 } |
| 1734 | 1734 |
| 1735 LOperand* context() { return inputs_[0]; } | 1735 LOperand* context() { return inputs_[0]; } |
| 1736 LOperand* global_object() { return inputs_[1]; } | 1736 LOperand* global_object() { return inputs_[1]; } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 1762 } | 1762 } |
| 1763 bool is_fixed_typed_array() const { | 1763 bool is_fixed_typed_array() const { |
| 1764 return hydrogen()->is_fixed_typed_array(); | 1764 return hydrogen()->is_fixed_typed_array(); |
| 1765 } | 1765 } |
| 1766 bool is_typed_elements() const { | 1766 bool is_typed_elements() const { |
| 1767 return is_external() || is_fixed_typed_array(); | 1767 return is_external() || is_fixed_typed_array(); |
| 1768 } | 1768 } |
| 1769 uint32_t base_offset() const { | 1769 uint32_t base_offset() const { |
| 1770 return this->hydrogen()->base_offset(); | 1770 return this->hydrogen()->base_offset(); |
| 1771 } | 1771 } |
| 1772 void PrintDataTo(StringStream* stream) V8_OVERRIDE { | 1772 void PrintDataTo(StringStream* stream) OVERRIDE { |
| 1773 this->elements()->PrintTo(stream); | 1773 this->elements()->PrintTo(stream); |
| 1774 stream->Add("["); | 1774 stream->Add("["); |
| 1775 this->key()->PrintTo(stream); | 1775 this->key()->PrintTo(stream); |
| 1776 if (this->base_offset() != 0) { | 1776 if (this->base_offset() != 0) { |
| 1777 stream->Add(" + %d]", this->base_offset()); | 1777 stream->Add(" + %d]", this->base_offset()); |
| 1778 } else { | 1778 } else { |
| 1779 stream->Add("]"); | 1779 stream->Add("]"); |
| 1780 } | 1780 } |
| 1781 } | 1781 } |
| 1782 | 1782 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 LLoadKeyed<1>(elements, key) { | 1816 LLoadKeyed<1>(elements, key) { |
| 1817 temps_[0] = temp; | 1817 temps_[0] = temp; |
| 1818 } | 1818 } |
| 1819 | 1819 |
| 1820 LOperand* temp() { return temps_[0]; } | 1820 LOperand* temp() { return temps_[0]; } |
| 1821 | 1821 |
| 1822 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double"); | 1822 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFixedDouble, "load-keyed-fixed-double"); |
| 1823 }; | 1823 }; |
| 1824 | 1824 |
| 1825 | 1825 |
| 1826 class LLoadKeyedGeneric V8_FINAL : public LTemplateInstruction<1, 3, 1> { | 1826 class LLoadKeyedGeneric FINAL : public LTemplateInstruction<1, 3, 1> { |
| 1827 public: | 1827 public: |
| 1828 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, | 1828 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, |
| 1829 LOperand* vector) { | 1829 LOperand* vector) { |
| 1830 inputs_[0] = context; | 1830 inputs_[0] = context; |
| 1831 inputs_[1] = object; | 1831 inputs_[1] = object; |
| 1832 inputs_[2] = key; | 1832 inputs_[2] = key; |
| 1833 temps_[0] = vector; | 1833 temps_[0] = vector; |
| 1834 } | 1834 } |
| 1835 | 1835 |
| 1836 LOperand* context() { return inputs_[0]; } | 1836 LOperand* context() { return inputs_[0]; } |
| 1837 LOperand* object() { return inputs_[1]; } | 1837 LOperand* object() { return inputs_[1]; } |
| 1838 LOperand* key() { return inputs_[2]; } | 1838 LOperand* key() { return inputs_[2]; } |
| 1839 LOperand* temp_vector() { return temps_[0]; } | 1839 LOperand* temp_vector() { return temps_[0]; } |
| 1840 | 1840 |
| 1841 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") | 1841 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") |
| 1842 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric) | 1842 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric) |
| 1843 }; | 1843 }; |
| 1844 | 1844 |
| 1845 | 1845 |
| 1846 class LLoadNamedGeneric V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 1846 class LLoadNamedGeneric FINAL : public LTemplateInstruction<1, 2, 1> { |
| 1847 public: | 1847 public: |
| 1848 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { | 1848 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { |
| 1849 inputs_[0] = context; | 1849 inputs_[0] = context; |
| 1850 inputs_[1] = object; | 1850 inputs_[1] = object; |
| 1851 temps_[0] = vector; | 1851 temps_[0] = vector; |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 LOperand* context() { return inputs_[0]; } | 1854 LOperand* context() { return inputs_[0]; } |
| 1855 LOperand* object() { return inputs_[1]; } | 1855 LOperand* object() { return inputs_[1]; } |
| 1856 LOperand* temp_vector() { return temps_[0]; } | 1856 LOperand* temp_vector() { return temps_[0]; } |
| 1857 | 1857 |
| 1858 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1858 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
| 1859 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1859 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
| 1860 | 1860 |
| 1861 Handle<Object> name() const { return hydrogen()->name(); } | 1861 Handle<Object> name() const { return hydrogen()->name(); } |
| 1862 }; | 1862 }; |
| 1863 | 1863 |
| 1864 | 1864 |
| 1865 class LLoadRoot V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 1865 class LLoadRoot FINAL : public LTemplateInstruction<1, 0, 0> { |
| 1866 public: | 1866 public: |
| 1867 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") | 1867 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") |
| 1868 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) | 1868 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) |
| 1869 | 1869 |
| 1870 Heap::RootListIndex index() const { return hydrogen()->index(); } | 1870 Heap::RootListIndex index() const { return hydrogen()->index(); } |
| 1871 }; | 1871 }; |
| 1872 | 1872 |
| 1873 | 1873 |
| 1874 class LMapEnumLength V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1874 class LMapEnumLength FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1875 public: | 1875 public: |
| 1876 explicit LMapEnumLength(LOperand* value) { | 1876 explicit LMapEnumLength(LOperand* value) { |
| 1877 inputs_[0] = value; | 1877 inputs_[0] = value; |
| 1878 } | 1878 } |
| 1879 | 1879 |
| 1880 LOperand* value() { return inputs_[0]; } | 1880 LOperand* value() { return inputs_[0]; } |
| 1881 | 1881 |
| 1882 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") | 1882 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") |
| 1883 }; | 1883 }; |
| 1884 | 1884 |
| 1885 | 1885 |
| 1886 template<int T> | 1886 template<int T> |
| 1887 class LUnaryMathOperation : public LTemplateInstruction<1, 1, T> { | 1887 class LUnaryMathOperation : public LTemplateInstruction<1, 1, T> { |
| 1888 public: | 1888 public: |
| 1889 explicit LUnaryMathOperation(LOperand* value) { | 1889 explicit LUnaryMathOperation(LOperand* value) { |
| 1890 this->inputs_[0] = value; | 1890 this->inputs_[0] = value; |
| 1891 } | 1891 } |
| 1892 | 1892 |
| 1893 LOperand* value() { return this->inputs_[0]; } | 1893 LOperand* value() { return this->inputs_[0]; } |
| 1894 BuiltinFunctionId op() const { return this->hydrogen()->op(); } | 1894 BuiltinFunctionId op() const { return this->hydrogen()->op(); } |
| 1895 | 1895 |
| 1896 void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 1896 void PrintDataTo(StringStream* stream) OVERRIDE; |
| 1897 | 1897 |
| 1898 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 1898 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 1899 }; | 1899 }; |
| 1900 | 1900 |
| 1901 | 1901 |
| 1902 class LMathAbs V8_FINAL : public LUnaryMathOperation<0> { | 1902 class LMathAbs FINAL : public LUnaryMathOperation<0> { |
| 1903 public: | 1903 public: |
| 1904 explicit LMathAbs(LOperand* value) : LUnaryMathOperation<0>(value) {} | 1904 explicit LMathAbs(LOperand* value) : LUnaryMathOperation<0>(value) {} |
| 1905 | 1905 |
| 1906 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") | 1906 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") |
| 1907 }; | 1907 }; |
| 1908 | 1908 |
| 1909 | 1909 |
| 1910 class LMathAbsTagged: public LTemplateInstruction<1, 2, 3> { | 1910 class LMathAbsTagged: public LTemplateInstruction<1, 2, 3> { |
| 1911 public: | 1911 public: |
| 1912 LMathAbsTagged(LOperand* context, LOperand* value, | 1912 LMathAbsTagged(LOperand* context, LOperand* value, |
| 1913 LOperand* temp1, LOperand* temp2, LOperand* temp3) { | 1913 LOperand* temp1, LOperand* temp2, LOperand* temp3) { |
| 1914 inputs_[0] = context; | 1914 inputs_[0] = context; |
| 1915 inputs_[1] = value; | 1915 inputs_[1] = value; |
| 1916 temps_[0] = temp1; | 1916 temps_[0] = temp1; |
| 1917 temps_[1] = temp2; | 1917 temps_[1] = temp2; |
| 1918 temps_[2] = temp3; | 1918 temps_[2] = temp3; |
| 1919 } | 1919 } |
| 1920 | 1920 |
| 1921 LOperand* context() { return inputs_[0]; } | 1921 LOperand* context() { return inputs_[0]; } |
| 1922 LOperand* value() { return inputs_[1]; } | 1922 LOperand* value() { return inputs_[1]; } |
| 1923 LOperand* temp1() { return temps_[0]; } | 1923 LOperand* temp1() { return temps_[0]; } |
| 1924 LOperand* temp2() { return temps_[1]; } | 1924 LOperand* temp2() { return temps_[1]; } |
| 1925 LOperand* temp3() { return temps_[2]; } | 1925 LOperand* temp3() { return temps_[2]; } |
| 1926 | 1926 |
| 1927 DECLARE_CONCRETE_INSTRUCTION(MathAbsTagged, "math-abs-tagged") | 1927 DECLARE_CONCRETE_INSTRUCTION(MathAbsTagged, "math-abs-tagged") |
| 1928 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 1928 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
| 1929 }; | 1929 }; |
| 1930 | 1930 |
| 1931 | 1931 |
| 1932 class LMathExp V8_FINAL : public LUnaryMathOperation<4> { | 1932 class LMathExp FINAL : public LUnaryMathOperation<4> { |
| 1933 public: | 1933 public: |
| 1934 LMathExp(LOperand* value, | 1934 LMathExp(LOperand* value, |
| 1935 LOperand* double_temp1, | 1935 LOperand* double_temp1, |
| 1936 LOperand* temp1, | 1936 LOperand* temp1, |
| 1937 LOperand* temp2, | 1937 LOperand* temp2, |
| 1938 LOperand* temp3) | 1938 LOperand* temp3) |
| 1939 : LUnaryMathOperation<4>(value) { | 1939 : LUnaryMathOperation<4>(value) { |
| 1940 temps_[0] = double_temp1; | 1940 temps_[0] = double_temp1; |
| 1941 temps_[1] = temp1; | 1941 temps_[1] = temp1; |
| 1942 temps_[2] = temp2; | 1942 temps_[2] = temp2; |
| 1943 temps_[3] = temp3; | 1943 temps_[3] = temp3; |
| 1944 ExternalReference::InitializeMathExpData(); | 1944 ExternalReference::InitializeMathExpData(); |
| 1945 } | 1945 } |
| 1946 | 1946 |
| 1947 LOperand* double_temp1() { return temps_[0]; } | 1947 LOperand* double_temp1() { return temps_[0]; } |
| 1948 LOperand* temp1() { return temps_[1]; } | 1948 LOperand* temp1() { return temps_[1]; } |
| 1949 LOperand* temp2() { return temps_[2]; } | 1949 LOperand* temp2() { return temps_[2]; } |
| 1950 LOperand* temp3() { return temps_[3]; } | 1950 LOperand* temp3() { return temps_[3]; } |
| 1951 | 1951 |
| 1952 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") | 1952 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") |
| 1953 }; | 1953 }; |
| 1954 | 1954 |
| 1955 | 1955 |
| 1956 // Math.floor with a double result. | 1956 // Math.floor with a double result. |
| 1957 class LMathFloorD V8_FINAL : public LUnaryMathOperation<0> { | 1957 class LMathFloorD FINAL : public LUnaryMathOperation<0> { |
| 1958 public: | 1958 public: |
| 1959 explicit LMathFloorD(LOperand* value) : LUnaryMathOperation<0>(value) { } | 1959 explicit LMathFloorD(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 1960 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") | 1960 DECLARE_CONCRETE_INSTRUCTION(MathFloorD, "math-floor-d") |
| 1961 }; | 1961 }; |
| 1962 | 1962 |
| 1963 | 1963 |
| 1964 // Math.floor with an integer result. | 1964 // Math.floor with an integer result. |
| 1965 class LMathFloorI V8_FINAL : public LUnaryMathOperation<0> { | 1965 class LMathFloorI FINAL : public LUnaryMathOperation<0> { |
| 1966 public: | 1966 public: |
| 1967 explicit LMathFloorI(LOperand* value) : LUnaryMathOperation<0>(value) { } | 1967 explicit LMathFloorI(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 1968 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") | 1968 DECLARE_CONCRETE_INSTRUCTION(MathFloorI, "math-floor-i") |
| 1969 }; | 1969 }; |
| 1970 | 1970 |
| 1971 | 1971 |
| 1972 class LFlooringDivByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 1972 class LFlooringDivByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { |
| 1973 public: | 1973 public: |
| 1974 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { | 1974 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 1975 inputs_[0] = dividend; | 1975 inputs_[0] = dividend; |
| 1976 divisor_ = divisor; | 1976 divisor_ = divisor; |
| 1977 } | 1977 } |
| 1978 | 1978 |
| 1979 LOperand* dividend() { return inputs_[0]; } | 1979 LOperand* dividend() { return inputs_[0]; } |
| 1980 int32_t divisor() const { return divisor_; } | 1980 int32_t divisor() const { return divisor_; } |
| 1981 | 1981 |
| 1982 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, | 1982 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, |
| 1983 "flooring-div-by-power-of-2-i") | 1983 "flooring-div-by-power-of-2-i") |
| 1984 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 1984 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 1985 | 1985 |
| 1986 private: | 1986 private: |
| 1987 int32_t divisor_; | 1987 int32_t divisor_; |
| 1988 }; | 1988 }; |
| 1989 | 1989 |
| 1990 | 1990 |
| 1991 class LFlooringDivByConstI V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 1991 class LFlooringDivByConstI FINAL : public LTemplateInstruction<1, 1, 2> { |
| 1992 public: | 1992 public: |
| 1993 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | 1993 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 1994 inputs_[0] = dividend; | 1994 inputs_[0] = dividend; |
| 1995 divisor_ = divisor; | 1995 divisor_ = divisor; |
| 1996 temps_[0] = temp; | 1996 temps_[0] = temp; |
| 1997 } | 1997 } |
| 1998 | 1998 |
| 1999 LOperand* dividend() { return inputs_[0]; } | 1999 LOperand* dividend() { return inputs_[0]; } |
| 2000 int32_t divisor() const { return divisor_; } | 2000 int32_t divisor() const { return divisor_; } |
| 2001 LOperand* temp() { return temps_[0]; } | 2001 LOperand* temp() { return temps_[0]; } |
| 2002 | 2002 |
| 2003 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") | 2003 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") |
| 2004 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 2004 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 2005 | 2005 |
| 2006 private: | 2006 private: |
| 2007 int32_t divisor_; | 2007 int32_t divisor_; |
| 2008 }; | 2008 }; |
| 2009 | 2009 |
| 2010 | 2010 |
| 2011 class LFlooringDivI V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 2011 class LFlooringDivI FINAL : public LTemplateInstruction<1, 2, 1> { |
| 2012 public: | 2012 public: |
| 2013 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { | 2013 LFlooringDivI(LOperand* dividend, LOperand* divisor, LOperand* temp) { |
| 2014 inputs_[0] = dividend; | 2014 inputs_[0] = dividend; |
| 2015 inputs_[1] = divisor; | 2015 inputs_[1] = divisor; |
| 2016 temps_[0] = temp; | 2016 temps_[0] = temp; |
| 2017 } | 2017 } |
| 2018 | 2018 |
| 2019 LOperand* dividend() { return inputs_[0]; } | 2019 LOperand* dividend() { return inputs_[0]; } |
| 2020 LOperand* divisor() { return inputs_[1]; } | 2020 LOperand* divisor() { return inputs_[1]; } |
| 2021 LOperand* temp() { return temps_[0]; } | 2021 LOperand* temp() { return temps_[0]; } |
| 2022 | 2022 |
| 2023 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") | 2023 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") |
| 2024 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) | 2024 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) |
| 2025 }; | 2025 }; |
| 2026 | 2026 |
| 2027 | 2027 |
| 2028 class LMathLog V8_FINAL : public LUnaryMathOperation<0> { | 2028 class LMathLog FINAL : public LUnaryMathOperation<0> { |
| 2029 public: | 2029 public: |
| 2030 explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { } | 2030 explicit LMathLog(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 2031 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") | 2031 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") |
| 2032 }; | 2032 }; |
| 2033 | 2033 |
| 2034 | 2034 |
| 2035 class LMathClz32 V8_FINAL : public LUnaryMathOperation<0> { | 2035 class LMathClz32 FINAL : public LUnaryMathOperation<0> { |
| 2036 public: | 2036 public: |
| 2037 explicit LMathClz32(LOperand* value) : LUnaryMathOperation<0>(value) { } | 2037 explicit LMathClz32(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 2038 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") | 2038 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") |
| 2039 }; | 2039 }; |
| 2040 | 2040 |
| 2041 | 2041 |
| 2042 class LMathMinMax V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2042 class LMathMinMax FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2043 public: | 2043 public: |
| 2044 LMathMinMax(LOperand* left, LOperand* right) { | 2044 LMathMinMax(LOperand* left, LOperand* right) { |
| 2045 inputs_[0] = left; | 2045 inputs_[0] = left; |
| 2046 inputs_[1] = right; | 2046 inputs_[1] = right; |
| 2047 } | 2047 } |
| 2048 | 2048 |
| 2049 LOperand* left() { return inputs_[0]; } | 2049 LOperand* left() { return inputs_[0]; } |
| 2050 LOperand* right() { return inputs_[1]; } | 2050 LOperand* right() { return inputs_[1]; } |
| 2051 | 2051 |
| 2052 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") | 2052 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") |
| 2053 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) | 2053 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) |
| 2054 }; | 2054 }; |
| 2055 | 2055 |
| 2056 | 2056 |
| 2057 class LMathPowHalf V8_FINAL : public LUnaryMathOperation<0> { | 2057 class LMathPowHalf FINAL : public LUnaryMathOperation<0> { |
| 2058 public: | 2058 public: |
| 2059 explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { } | 2059 explicit LMathPowHalf(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 2060 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") | 2060 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") |
| 2061 }; | 2061 }; |
| 2062 | 2062 |
| 2063 | 2063 |
| 2064 // Math.round with an integer result. | 2064 // Math.round with an integer result. |
| 2065 class LMathRoundD V8_FINAL : public LUnaryMathOperation<0> { | 2065 class LMathRoundD FINAL : public LUnaryMathOperation<0> { |
| 2066 public: | 2066 public: |
| 2067 explicit LMathRoundD(LOperand* value) | 2067 explicit LMathRoundD(LOperand* value) |
| 2068 : LUnaryMathOperation<0>(value) { | 2068 : LUnaryMathOperation<0>(value) { |
| 2069 } | 2069 } |
| 2070 | 2070 |
| 2071 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") | 2071 DECLARE_CONCRETE_INSTRUCTION(MathRoundD, "math-round-d") |
| 2072 }; | 2072 }; |
| 2073 | 2073 |
| 2074 | 2074 |
| 2075 // Math.round with an integer result. | 2075 // Math.round with an integer result. |
| 2076 class LMathRoundI V8_FINAL : public LUnaryMathOperation<1> { | 2076 class LMathRoundI FINAL : public LUnaryMathOperation<1> { |
| 2077 public: | 2077 public: |
| 2078 LMathRoundI(LOperand* value, LOperand* temp1) | 2078 LMathRoundI(LOperand* value, LOperand* temp1) |
| 2079 : LUnaryMathOperation<1>(value) { | 2079 : LUnaryMathOperation<1>(value) { |
| 2080 temps_[0] = temp1; | 2080 temps_[0] = temp1; |
| 2081 } | 2081 } |
| 2082 | 2082 |
| 2083 LOperand* temp1() { return temps_[0]; } | 2083 LOperand* temp1() { return temps_[0]; } |
| 2084 | 2084 |
| 2085 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") | 2085 DECLARE_CONCRETE_INSTRUCTION(MathRoundI, "math-round-i") |
| 2086 }; | 2086 }; |
| 2087 | 2087 |
| 2088 | 2088 |
| 2089 class LMathFround V8_FINAL : public LUnaryMathOperation<0> { | 2089 class LMathFround FINAL : public LUnaryMathOperation<0> { |
| 2090 public: | 2090 public: |
| 2091 explicit LMathFround(LOperand* value) : LUnaryMathOperation<0>(value) {} | 2091 explicit LMathFround(LOperand* value) : LUnaryMathOperation<0>(value) {} |
| 2092 | 2092 |
| 2093 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround") | 2093 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround") |
| 2094 }; | 2094 }; |
| 2095 | 2095 |
| 2096 | 2096 |
| 2097 class LMathSqrt V8_FINAL : public LUnaryMathOperation<0> { | 2097 class LMathSqrt FINAL : public LUnaryMathOperation<0> { |
| 2098 public: | 2098 public: |
| 2099 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { } | 2099 explicit LMathSqrt(LOperand* value) : LUnaryMathOperation<0>(value) { } |
| 2100 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") | 2100 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") |
| 2101 }; | 2101 }; |
| 2102 | 2102 |
| 2103 | 2103 |
| 2104 class LModByPowerOf2I V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2104 class LModByPowerOf2I FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2105 public: | 2105 public: |
| 2106 LModByPowerOf2I(LOperand* dividend, int32_t divisor) { | 2106 LModByPowerOf2I(LOperand* dividend, int32_t divisor) { |
| 2107 inputs_[0] = dividend; | 2107 inputs_[0] = dividend; |
| 2108 divisor_ = divisor; | 2108 divisor_ = divisor; |
| 2109 } | 2109 } |
| 2110 | 2110 |
| 2111 LOperand* dividend() { return inputs_[0]; } | 2111 LOperand* dividend() { return inputs_[0]; } |
| 2112 int32_t divisor() const { return divisor_; } | 2112 int32_t divisor() const { return divisor_; } |
| 2113 | 2113 |
| 2114 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") | 2114 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") |
| 2115 DECLARE_HYDROGEN_ACCESSOR(Mod) | 2115 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2116 | 2116 |
| 2117 private: | 2117 private: |
| 2118 int32_t divisor_; | 2118 int32_t divisor_; |
| 2119 }; | 2119 }; |
| 2120 | 2120 |
| 2121 | 2121 |
| 2122 class LModByConstI V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2122 class LModByConstI FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2123 public: | 2123 public: |
| 2124 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { | 2124 LModByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { |
| 2125 inputs_[0] = dividend; | 2125 inputs_[0] = dividend; |
| 2126 divisor_ = divisor; | 2126 divisor_ = divisor; |
| 2127 temps_[0] = temp; | 2127 temps_[0] = temp; |
| 2128 } | 2128 } |
| 2129 | 2129 |
| 2130 LOperand* dividend() { return inputs_[0]; } | 2130 LOperand* dividend() { return inputs_[0]; } |
| 2131 int32_t divisor() const { return divisor_; } | 2131 int32_t divisor() const { return divisor_; } |
| 2132 LOperand* temp() { return temps_[0]; } | 2132 LOperand* temp() { return temps_[0]; } |
| 2133 | 2133 |
| 2134 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") | 2134 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") |
| 2135 DECLARE_HYDROGEN_ACCESSOR(Mod) | 2135 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2136 | 2136 |
| 2137 private: | 2137 private: |
| 2138 int32_t divisor_; | 2138 int32_t divisor_; |
| 2139 }; | 2139 }; |
| 2140 | 2140 |
| 2141 | 2141 |
| 2142 class LModI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2142 class LModI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2143 public: | 2143 public: |
| 2144 LModI(LOperand* left, LOperand* right) { | 2144 LModI(LOperand* left, LOperand* right) { |
| 2145 inputs_[0] = left; | 2145 inputs_[0] = left; |
| 2146 inputs_[1] = right; | 2146 inputs_[1] = right; |
| 2147 } | 2147 } |
| 2148 | 2148 |
| 2149 LOperand* left() { return inputs_[0]; } | 2149 LOperand* left() { return inputs_[0]; } |
| 2150 LOperand* right() { return inputs_[1]; } | 2150 LOperand* right() { return inputs_[1]; } |
| 2151 | 2151 |
| 2152 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") | 2152 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") |
| 2153 DECLARE_HYDROGEN_ACCESSOR(Mod) | 2153 DECLARE_HYDROGEN_ACCESSOR(Mod) |
| 2154 }; | 2154 }; |
| 2155 | 2155 |
| 2156 | 2156 |
| 2157 class LMulConstIS V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2157 class LMulConstIS FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2158 public: | 2158 public: |
| 2159 LMulConstIS(LOperand* left, LConstantOperand* right) { | 2159 LMulConstIS(LOperand* left, LConstantOperand* right) { |
| 2160 inputs_[0] = left; | 2160 inputs_[0] = left; |
| 2161 inputs_[1] = right; | 2161 inputs_[1] = right; |
| 2162 } | 2162 } |
| 2163 | 2163 |
| 2164 LOperand* left() { return inputs_[0]; } | 2164 LOperand* left() { return inputs_[0]; } |
| 2165 LConstantOperand* right() { return LConstantOperand::cast(inputs_[1]); } | 2165 LConstantOperand* right() { return LConstantOperand::cast(inputs_[1]); } |
| 2166 | 2166 |
| 2167 DECLARE_CONCRETE_INSTRUCTION(MulConstIS, "mul-const-i-s") | 2167 DECLARE_CONCRETE_INSTRUCTION(MulConstIS, "mul-const-i-s") |
| 2168 DECLARE_HYDROGEN_ACCESSOR(Mul) | 2168 DECLARE_HYDROGEN_ACCESSOR(Mul) |
| 2169 }; | 2169 }; |
| 2170 | 2170 |
| 2171 | 2171 |
| 2172 class LMulI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2172 class LMulI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2173 public: | 2173 public: |
| 2174 LMulI(LOperand* left, LOperand* right) { | 2174 LMulI(LOperand* left, LOperand* right) { |
| 2175 inputs_[0] = left; | 2175 inputs_[0] = left; |
| 2176 inputs_[1] = right; | 2176 inputs_[1] = right; |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 LOperand* left() { return inputs_[0]; } | 2179 LOperand* left() { return inputs_[0]; } |
| 2180 LOperand* right() { return inputs_[1]; } | 2180 LOperand* right() { return inputs_[1]; } |
| 2181 | 2181 |
| 2182 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 2182 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") |
| 2183 DECLARE_HYDROGEN_ACCESSOR(Mul) | 2183 DECLARE_HYDROGEN_ACCESSOR(Mul) |
| 2184 }; | 2184 }; |
| 2185 | 2185 |
| 2186 | 2186 |
| 2187 class LMulS V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2187 class LMulS FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2188 public: | 2188 public: |
| 2189 LMulS(LOperand* left, LOperand* right) { | 2189 LMulS(LOperand* left, LOperand* right) { |
| 2190 inputs_[0] = left; | 2190 inputs_[0] = left; |
| 2191 inputs_[1] = right; | 2191 inputs_[1] = right; |
| 2192 } | 2192 } |
| 2193 | 2193 |
| 2194 LOperand* left() { return inputs_[0]; } | 2194 LOperand* left() { return inputs_[0]; } |
| 2195 LOperand* right() { return inputs_[1]; } | 2195 LOperand* right() { return inputs_[1]; } |
| 2196 | 2196 |
| 2197 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-s") | 2197 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-s") |
| 2198 DECLARE_HYDROGEN_ACCESSOR(Mul) | 2198 DECLARE_HYDROGEN_ACCESSOR(Mul) |
| 2199 }; | 2199 }; |
| 2200 | 2200 |
| 2201 | 2201 |
| 2202 class LNumberTagD V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 2202 class LNumberTagD FINAL : public LTemplateInstruction<1, 1, 2> { |
| 2203 public: | 2203 public: |
| 2204 LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) { | 2204 LNumberTagD(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 2205 inputs_[0] = value; | 2205 inputs_[0] = value; |
| 2206 temps_[0] = temp1; | 2206 temps_[0] = temp1; |
| 2207 temps_[1] = temp2; | 2207 temps_[1] = temp2; |
| 2208 } | 2208 } |
| 2209 | 2209 |
| 2210 LOperand* value() { return inputs_[0]; } | 2210 LOperand* value() { return inputs_[0]; } |
| 2211 LOperand* temp1() { return temps_[0]; } | 2211 LOperand* temp1() { return temps_[0]; } |
| 2212 LOperand* temp2() { return temps_[1]; } | 2212 LOperand* temp2() { return temps_[1]; } |
| 2213 | 2213 |
| 2214 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 2214 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") |
| 2215 DECLARE_HYDROGEN_ACCESSOR(Change) | 2215 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2216 }; | 2216 }; |
| 2217 | 2217 |
| 2218 | 2218 |
| 2219 class LNumberTagU V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 2219 class LNumberTagU FINAL : public LTemplateInstruction<1, 1, 2> { |
| 2220 public: | 2220 public: |
| 2221 explicit LNumberTagU(LOperand* value, | 2221 explicit LNumberTagU(LOperand* value, |
| 2222 LOperand* temp1, | 2222 LOperand* temp1, |
| 2223 LOperand* temp2) { | 2223 LOperand* temp2) { |
| 2224 inputs_[0] = value; | 2224 inputs_[0] = value; |
| 2225 temps_[0] = temp1; | 2225 temps_[0] = temp1; |
| 2226 temps_[1] = temp2; | 2226 temps_[1] = temp2; |
| 2227 } | 2227 } |
| 2228 | 2228 |
| 2229 LOperand* value() { return inputs_[0]; } | 2229 LOperand* value() { return inputs_[0]; } |
| 2230 LOperand* temp1() { return temps_[0]; } | 2230 LOperand* temp1() { return temps_[0]; } |
| 2231 LOperand* temp2() { return temps_[1]; } | 2231 LOperand* temp2() { return temps_[1]; } |
| 2232 | 2232 |
| 2233 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") | 2233 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") |
| 2234 }; | 2234 }; |
| 2235 | 2235 |
| 2236 | 2236 |
| 2237 class LNumberUntagD V8_FINAL : public LTemplateInstruction<1, 1, 1> { | 2237 class LNumberUntagD FINAL : public LTemplateInstruction<1, 1, 1> { |
| 2238 public: | 2238 public: |
| 2239 LNumberUntagD(LOperand* value, LOperand* temp) { | 2239 LNumberUntagD(LOperand* value, LOperand* temp) { |
| 2240 inputs_[0] = value; | 2240 inputs_[0] = value; |
| 2241 temps_[0] = temp; | 2241 temps_[0] = temp; |
| 2242 } | 2242 } |
| 2243 | 2243 |
| 2244 LOperand* value() { return inputs_[0]; } | 2244 LOperand* value() { return inputs_[0]; } |
| 2245 | 2245 |
| 2246 LOperand* temp() { return temps_[0]; } | 2246 LOperand* temp() { return temps_[0]; } |
| 2247 | 2247 |
| 2248 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 2248 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
| 2249 DECLARE_HYDROGEN_ACCESSOR(Change) | 2249 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2250 }; | 2250 }; |
| 2251 | 2251 |
| 2252 | 2252 |
| 2253 class LParameter V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 2253 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> { |
| 2254 public: | 2254 public: |
| 2255 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } | 2255 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 2256 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 2256 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 2257 }; | 2257 }; |
| 2258 | 2258 |
| 2259 | 2259 |
| 2260 class LPower V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2260 class LPower FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2261 public: | 2261 public: |
| 2262 LPower(LOperand* left, LOperand* right) { | 2262 LPower(LOperand* left, LOperand* right) { |
| 2263 inputs_[0] = left; | 2263 inputs_[0] = left; |
| 2264 inputs_[1] = right; | 2264 inputs_[1] = right; |
| 2265 } | 2265 } |
| 2266 | 2266 |
| 2267 LOperand* left() { return inputs_[0]; } | 2267 LOperand* left() { return inputs_[0]; } |
| 2268 LOperand* right() { return inputs_[1]; } | 2268 LOperand* right() { return inputs_[1]; } |
| 2269 | 2269 |
| 2270 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | 2270 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
| 2271 DECLARE_HYDROGEN_ACCESSOR(Power) | 2271 DECLARE_HYDROGEN_ACCESSOR(Power) |
| 2272 }; | 2272 }; |
| 2273 | 2273 |
| 2274 | 2274 |
| 2275 class LPreparePushArguments V8_FINAL : public LTemplateInstruction<0, 0, 0> { | 2275 class LPreparePushArguments FINAL : public LTemplateInstruction<0, 0, 0> { |
| 2276 public: | 2276 public: |
| 2277 explicit LPreparePushArguments(int argc) : argc_(argc) {} | 2277 explicit LPreparePushArguments(int argc) : argc_(argc) {} |
| 2278 | 2278 |
| 2279 inline int argc() const { return argc_; } | 2279 inline int argc() const { return argc_; } |
| 2280 | 2280 |
| 2281 DECLARE_CONCRETE_INSTRUCTION(PreparePushArguments, "prepare-push-arguments") | 2281 DECLARE_CONCRETE_INSTRUCTION(PreparePushArguments, "prepare-push-arguments") |
| 2282 | 2282 |
| 2283 protected: | 2283 protected: |
| 2284 int argc_; | 2284 int argc_; |
| 2285 }; | 2285 }; |
| 2286 | 2286 |
| 2287 | 2287 |
| 2288 class LPushArguments V8_FINAL : public LTemplateResultInstruction<0> { | 2288 class LPushArguments FINAL : public LTemplateResultInstruction<0> { |
| 2289 public: | 2289 public: |
| 2290 explicit LPushArguments(Zone* zone, | 2290 explicit LPushArguments(Zone* zone, |
| 2291 int capacity = kRecommendedMaxPushedArgs) | 2291 int capacity = kRecommendedMaxPushedArgs) |
| 2292 : zone_(zone), inputs_(capacity, zone) {} | 2292 : zone_(zone), inputs_(capacity, zone) {} |
| 2293 | 2293 |
| 2294 LOperand* argument(int i) { return inputs_[i]; } | 2294 LOperand* argument(int i) { return inputs_[i]; } |
| 2295 int ArgumentCount() const { return inputs_.length(); } | 2295 int ArgumentCount() const { return inputs_.length(); } |
| 2296 | 2296 |
| 2297 void AddArgument(LOperand* arg) { inputs_.Add(arg, zone_); } | 2297 void AddArgument(LOperand* arg) { inputs_.Add(arg, zone_); } |
| 2298 | 2298 |
| 2299 DECLARE_CONCRETE_INSTRUCTION(PushArguments, "push-arguments") | 2299 DECLARE_CONCRETE_INSTRUCTION(PushArguments, "push-arguments") |
| 2300 | 2300 |
| 2301 // It is better to limit the number of arguments pushed simultaneously to | 2301 // It is better to limit the number of arguments pushed simultaneously to |
| 2302 // avoid pressure on the register allocator. | 2302 // avoid pressure on the register allocator. |
| 2303 static const int kRecommendedMaxPushedArgs = 4; | 2303 static const int kRecommendedMaxPushedArgs = 4; |
| 2304 bool ShouldSplitPush() const { | 2304 bool ShouldSplitPush() const { |
| 2305 return inputs_.length() >= kRecommendedMaxPushedArgs; | 2305 return inputs_.length() >= kRecommendedMaxPushedArgs; |
| 2306 } | 2306 } |
| 2307 | 2307 |
| 2308 protected: | 2308 protected: |
| 2309 Zone* zone_; | 2309 Zone* zone_; |
| 2310 ZoneList<LOperand*> inputs_; | 2310 ZoneList<LOperand*> inputs_; |
| 2311 | 2311 |
| 2312 private: | 2312 private: |
| 2313 // Iterator support. | 2313 // Iterator support. |
| 2314 virtual int InputCount() V8_FINAL V8_OVERRIDE { return inputs_.length(); } | 2314 virtual int InputCount() FINAL OVERRIDE { return inputs_.length(); } |
| 2315 virtual LOperand* InputAt(int i) V8_FINAL V8_OVERRIDE { return inputs_[i]; } | 2315 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } |
| 2316 | 2316 |
| 2317 virtual int TempCount() V8_FINAL V8_OVERRIDE { return 0; } | 2317 virtual int TempCount() FINAL OVERRIDE { return 0; } |
| 2318 virtual LOperand* TempAt(int i) V8_FINAL V8_OVERRIDE { return NULL; } | 2318 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return NULL; } |
| 2319 }; | 2319 }; |
| 2320 | 2320 |
| 2321 | 2321 |
| 2322 class LRegExpLiteral V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2322 class LRegExpLiteral FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2323 public: | 2323 public: |
| 2324 explicit LRegExpLiteral(LOperand* context) { | 2324 explicit LRegExpLiteral(LOperand* context) { |
| 2325 inputs_[0] = context; | 2325 inputs_[0] = context; |
| 2326 } | 2326 } |
| 2327 | 2327 |
| 2328 LOperand* context() { return inputs_[0]; } | 2328 LOperand* context() { return inputs_[0]; } |
| 2329 | 2329 |
| 2330 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") | 2330 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
| 2331 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) | 2331 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
| 2332 }; | 2332 }; |
| 2333 | 2333 |
| 2334 | 2334 |
| 2335 class LReturn V8_FINAL : public LTemplateInstruction<0, 3, 0> { | 2335 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> { |
| 2336 public: | 2336 public: |
| 2337 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) { | 2337 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) { |
| 2338 inputs_[0] = value; | 2338 inputs_[0] = value; |
| 2339 inputs_[1] = context; | 2339 inputs_[1] = context; |
| 2340 inputs_[2] = parameter_count; | 2340 inputs_[2] = parameter_count; |
| 2341 } | 2341 } |
| 2342 | 2342 |
| 2343 LOperand* value() { return inputs_[0]; } | 2343 LOperand* value() { return inputs_[0]; } |
| 2344 LOperand* parameter_count() { return inputs_[2]; } | 2344 LOperand* parameter_count() { return inputs_[2]; } |
| 2345 | 2345 |
| 2346 bool has_constant_parameter_count() { | 2346 bool has_constant_parameter_count() { |
| 2347 return parameter_count()->IsConstantOperand(); | 2347 return parameter_count()->IsConstantOperand(); |
| 2348 } | 2348 } |
| 2349 LConstantOperand* constant_parameter_count() { | 2349 LConstantOperand* constant_parameter_count() { |
| 2350 DCHECK(has_constant_parameter_count()); | 2350 DCHECK(has_constant_parameter_count()); |
| 2351 return LConstantOperand::cast(parameter_count()); | 2351 return LConstantOperand::cast(parameter_count()); |
| 2352 } | 2352 } |
| 2353 | 2353 |
| 2354 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 2354 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
| 2355 }; | 2355 }; |
| 2356 | 2356 |
| 2357 | 2357 |
| 2358 class LSeqStringGetChar V8_FINAL : public LTemplateInstruction<1, 2, 1> { | 2358 class LSeqStringGetChar FINAL : public LTemplateInstruction<1, 2, 1> { |
| 2359 public: | 2359 public: |
| 2360 LSeqStringGetChar(LOperand* string, | 2360 LSeqStringGetChar(LOperand* string, |
| 2361 LOperand* index, | 2361 LOperand* index, |
| 2362 LOperand* temp) { | 2362 LOperand* temp) { |
| 2363 inputs_[0] = string; | 2363 inputs_[0] = string; |
| 2364 inputs_[1] = index; | 2364 inputs_[1] = index; |
| 2365 temps_[0] = temp; | 2365 temps_[0] = temp; |
| 2366 } | 2366 } |
| 2367 | 2367 |
| 2368 LOperand* string() { return inputs_[0]; } | 2368 LOperand* string() { return inputs_[0]; } |
| 2369 LOperand* index() { return inputs_[1]; } | 2369 LOperand* index() { return inputs_[1]; } |
| 2370 LOperand* temp() { return temps_[0]; } | 2370 LOperand* temp() { return temps_[0]; } |
| 2371 | 2371 |
| 2372 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") | 2372 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") |
| 2373 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) | 2373 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) |
| 2374 }; | 2374 }; |
| 2375 | 2375 |
| 2376 | 2376 |
| 2377 class LSeqStringSetChar V8_FINAL : public LTemplateInstruction<1, 4, 1> { | 2377 class LSeqStringSetChar FINAL : public LTemplateInstruction<1, 4, 1> { |
| 2378 public: | 2378 public: |
| 2379 LSeqStringSetChar(LOperand* context, | 2379 LSeqStringSetChar(LOperand* context, |
| 2380 LOperand* string, | 2380 LOperand* string, |
| 2381 LOperand* index, | 2381 LOperand* index, |
| 2382 LOperand* value, | 2382 LOperand* value, |
| 2383 LOperand* temp) { | 2383 LOperand* temp) { |
| 2384 inputs_[0] = context; | 2384 inputs_[0] = context; |
| 2385 inputs_[1] = string; | 2385 inputs_[1] = string; |
| 2386 inputs_[2] = index; | 2386 inputs_[2] = index; |
| 2387 inputs_[3] = value; | 2387 inputs_[3] = value; |
| 2388 temps_[0] = temp; | 2388 temps_[0] = temp; |
| 2389 } | 2389 } |
| 2390 | 2390 |
| 2391 LOperand* context() { return inputs_[0]; } | 2391 LOperand* context() { return inputs_[0]; } |
| 2392 LOperand* string() { return inputs_[1]; } | 2392 LOperand* string() { return inputs_[1]; } |
| 2393 LOperand* index() { return inputs_[2]; } | 2393 LOperand* index() { return inputs_[2]; } |
| 2394 LOperand* value() { return inputs_[3]; } | 2394 LOperand* value() { return inputs_[3]; } |
| 2395 LOperand* temp() { return temps_[0]; } | 2395 LOperand* temp() { return temps_[0]; } |
| 2396 | 2396 |
| 2397 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char") | 2397 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char") |
| 2398 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar) | 2398 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar) |
| 2399 }; | 2399 }; |
| 2400 | 2400 |
| 2401 | 2401 |
| 2402 class LSmiTag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2402 class LSmiTag FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2403 public: | 2403 public: |
| 2404 explicit LSmiTag(LOperand* value) { | 2404 explicit LSmiTag(LOperand* value) { |
| 2405 inputs_[0] = value; | 2405 inputs_[0] = value; |
| 2406 } | 2406 } |
| 2407 | 2407 |
| 2408 LOperand* value() { return inputs_[0]; } | 2408 LOperand* value() { return inputs_[0]; } |
| 2409 | 2409 |
| 2410 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 2410 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
| 2411 DECLARE_HYDROGEN_ACCESSOR(Change) | 2411 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2412 }; | 2412 }; |
| 2413 | 2413 |
| 2414 | 2414 |
| 2415 class LSmiUntag V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2415 class LSmiUntag FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2416 public: | 2416 public: |
| 2417 LSmiUntag(LOperand* value, bool needs_check) | 2417 LSmiUntag(LOperand* value, bool needs_check) |
| 2418 : needs_check_(needs_check) { | 2418 : needs_check_(needs_check) { |
| 2419 inputs_[0] = value; | 2419 inputs_[0] = value; |
| 2420 } | 2420 } |
| 2421 | 2421 |
| 2422 LOperand* value() { return inputs_[0]; } | 2422 LOperand* value() { return inputs_[0]; } |
| 2423 bool needs_check() const { return needs_check_; } | 2423 bool needs_check() const { return needs_check_; } |
| 2424 | 2424 |
| 2425 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 2425 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
| 2426 | 2426 |
| 2427 private: | 2427 private: |
| 2428 bool needs_check_; | 2428 bool needs_check_; |
| 2429 }; | 2429 }; |
| 2430 | 2430 |
| 2431 | 2431 |
| 2432 class LStackCheck V8_FINAL : public LTemplateInstruction<0, 1, 0> { | 2432 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> { |
| 2433 public: | 2433 public: |
| 2434 explicit LStackCheck(LOperand* context) { | 2434 explicit LStackCheck(LOperand* context) { |
| 2435 inputs_[0] = context; | 2435 inputs_[0] = context; |
| 2436 } | 2436 } |
| 2437 | 2437 |
| 2438 LOperand* context() { return inputs_[0]; } | 2438 LOperand* context() { return inputs_[0]; } |
| 2439 | 2439 |
| 2440 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 2440 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
| 2441 DECLARE_HYDROGEN_ACCESSOR(StackCheck) | 2441 DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
| 2442 | 2442 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2472 | 2472 |
| 2473 bool NeedsCanonicalization() { | 2473 bool NeedsCanonicalization() { |
| 2474 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || | 2474 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || |
| 2475 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { | 2475 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { |
| 2476 return false; | 2476 return false; |
| 2477 } | 2477 } |
| 2478 return this->hydrogen()->NeedsCanonicalization(); | 2478 return this->hydrogen()->NeedsCanonicalization(); |
| 2479 } | 2479 } |
| 2480 uint32_t base_offset() const { return this->hydrogen()->base_offset(); } | 2480 uint32_t base_offset() const { return this->hydrogen()->base_offset(); } |
| 2481 | 2481 |
| 2482 void PrintDataTo(StringStream* stream) V8_OVERRIDE { | 2482 void PrintDataTo(StringStream* stream) OVERRIDE { |
| 2483 this->elements()->PrintTo(stream); | 2483 this->elements()->PrintTo(stream); |
| 2484 stream->Add("["); | 2484 stream->Add("["); |
| 2485 this->key()->PrintTo(stream); | 2485 this->key()->PrintTo(stream); |
| 2486 if (this->base_offset() != 0) { | 2486 if (this->base_offset() != 0) { |
| 2487 stream->Add(" + %d] <-", this->base_offset()); | 2487 stream->Add(" + %d] <-", this->base_offset()); |
| 2488 } else { | 2488 } else { |
| 2489 stream->Add("] <- "); | 2489 stream->Add("] <- "); |
| 2490 } | 2490 } |
| 2491 | 2491 |
| 2492 if (this->value() == NULL) { | 2492 if (this->value() == NULL) { |
| 2493 DCHECK(hydrogen()->IsConstantHoleStore() && | 2493 DCHECK(hydrogen()->IsConstantHoleStore() && |
| 2494 hydrogen()->value()->representation().IsDouble()); | 2494 hydrogen()->value()->representation().IsDouble()); |
| 2495 stream->Add("<the hole(nan)>"); | 2495 stream->Add("<the hole(nan)>"); |
| 2496 } else { | 2496 } else { |
| 2497 this->value()->PrintTo(stream); | 2497 this->value()->PrintTo(stream); |
| 2498 } | 2498 } |
| 2499 } | 2499 } |
| 2500 | 2500 |
| 2501 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) | 2501 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) |
| 2502 }; | 2502 }; |
| 2503 | 2503 |
| 2504 | 2504 |
| 2505 class LStoreKeyedExternal V8_FINAL : public LStoreKeyed<1> { | 2505 class LStoreKeyedExternal FINAL : public LStoreKeyed<1> { |
| 2506 public: | 2506 public: |
| 2507 LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value, | 2507 LStoreKeyedExternal(LOperand* elements, LOperand* key, LOperand* value, |
| 2508 LOperand* temp) : | 2508 LOperand* temp) : |
| 2509 LStoreKeyed<1>(elements, key, value) { | 2509 LStoreKeyed<1>(elements, key, value) { |
| 2510 temps_[0] = temp; | 2510 temps_[0] = temp; |
| 2511 } | 2511 } |
| 2512 | 2512 |
| 2513 LOperand* temp() { return temps_[0]; } | 2513 LOperand* temp() { return temps_[0]; } |
| 2514 | 2514 |
| 2515 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external") | 2515 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedExternal, "store-keyed-external") |
| 2516 }; | 2516 }; |
| 2517 | 2517 |
| 2518 | 2518 |
| 2519 class LStoreKeyedFixed V8_FINAL : public LStoreKeyed<1> { | 2519 class LStoreKeyedFixed FINAL : public LStoreKeyed<1> { |
| 2520 public: | 2520 public: |
| 2521 LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value, | 2521 LStoreKeyedFixed(LOperand* elements, LOperand* key, LOperand* value, |
| 2522 LOperand* temp) : | 2522 LOperand* temp) : |
| 2523 LStoreKeyed<1>(elements, key, value) { | 2523 LStoreKeyed<1>(elements, key, value) { |
| 2524 temps_[0] = temp; | 2524 temps_[0] = temp; |
| 2525 } | 2525 } |
| 2526 | 2526 |
| 2527 LOperand* temp() { return temps_[0]; } | 2527 LOperand* temp() { return temps_[0]; } |
| 2528 | 2528 |
| 2529 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed") | 2529 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixed, "store-keyed-fixed") |
| 2530 }; | 2530 }; |
| 2531 | 2531 |
| 2532 | 2532 |
| 2533 class LStoreKeyedFixedDouble V8_FINAL : public LStoreKeyed<1> { | 2533 class LStoreKeyedFixedDouble FINAL : public LStoreKeyed<1> { |
| 2534 public: | 2534 public: |
| 2535 LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value, | 2535 LStoreKeyedFixedDouble(LOperand* elements, LOperand* key, LOperand* value, |
| 2536 LOperand* temp) : | 2536 LOperand* temp) : |
| 2537 LStoreKeyed<1>(elements, key, value) { | 2537 LStoreKeyed<1>(elements, key, value) { |
| 2538 temps_[0] = temp; | 2538 temps_[0] = temp; |
| 2539 } | 2539 } |
| 2540 | 2540 |
| 2541 LOperand* temp() { return temps_[0]; } | 2541 LOperand* temp() { return temps_[0]; } |
| 2542 | 2542 |
| 2543 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble, | 2543 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFixedDouble, |
| 2544 "store-keyed-fixed-double") | 2544 "store-keyed-fixed-double") |
| 2545 }; | 2545 }; |
| 2546 | 2546 |
| 2547 | 2547 |
| 2548 class LStoreKeyedGeneric V8_FINAL : public LTemplateInstruction<0, 4, 0> { | 2548 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> { |
| 2549 public: | 2549 public: |
| 2550 LStoreKeyedGeneric(LOperand* context, | 2550 LStoreKeyedGeneric(LOperand* context, |
| 2551 LOperand* obj, | 2551 LOperand* obj, |
| 2552 LOperand* key, | 2552 LOperand* key, |
| 2553 LOperand* value) { | 2553 LOperand* value) { |
| 2554 inputs_[0] = context; | 2554 inputs_[0] = context; |
| 2555 inputs_[1] = obj; | 2555 inputs_[1] = obj; |
| 2556 inputs_[2] = key; | 2556 inputs_[2] = key; |
| 2557 inputs_[3] = value; | 2557 inputs_[3] = value; |
| 2558 } | 2558 } |
| 2559 | 2559 |
| 2560 LOperand* context() { return inputs_[0]; } | 2560 LOperand* context() { return inputs_[0]; } |
| 2561 LOperand* object() { return inputs_[1]; } | 2561 LOperand* object() { return inputs_[1]; } |
| 2562 LOperand* key() { return inputs_[2]; } | 2562 LOperand* key() { return inputs_[2]; } |
| 2563 LOperand* value() { return inputs_[3]; } | 2563 LOperand* value() { return inputs_[3]; } |
| 2564 | 2564 |
| 2565 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 2565 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
| 2566 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) | 2566 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) |
| 2567 | 2567 |
| 2568 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2568 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2569 | 2569 |
| 2570 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2570 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
| 2571 }; | 2571 }; |
| 2572 | 2572 |
| 2573 | 2573 |
| 2574 class LStoreNamedField V8_FINAL : public LTemplateInstruction<0, 2, 2> { | 2574 class LStoreNamedField FINAL : public LTemplateInstruction<0, 2, 2> { |
| 2575 public: | 2575 public: |
| 2576 LStoreNamedField(LOperand* object, LOperand* value, | 2576 LStoreNamedField(LOperand* object, LOperand* value, |
| 2577 LOperand* temp0, LOperand* temp1) { | 2577 LOperand* temp0, LOperand* temp1) { |
| 2578 inputs_[0] = object; | 2578 inputs_[0] = object; |
| 2579 inputs_[1] = value; | 2579 inputs_[1] = value; |
| 2580 temps_[0] = temp0; | 2580 temps_[0] = temp0; |
| 2581 temps_[1] = temp1; | 2581 temps_[1] = temp1; |
| 2582 } | 2582 } |
| 2583 | 2583 |
| 2584 LOperand* object() { return inputs_[0]; } | 2584 LOperand* object() { return inputs_[0]; } |
| 2585 LOperand* value() { return inputs_[1]; } | 2585 LOperand* value() { return inputs_[1]; } |
| 2586 LOperand* temp0() { return temps_[0]; } | 2586 LOperand* temp0() { return temps_[0]; } |
| 2587 LOperand* temp1() { return temps_[1]; } | 2587 LOperand* temp1() { return temps_[1]; } |
| 2588 | 2588 |
| 2589 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") | 2589 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") |
| 2590 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) | 2590 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) |
| 2591 | 2591 |
| 2592 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2592 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2593 | 2593 |
| 2594 Representation representation() const { | 2594 Representation representation() const { |
| 2595 return hydrogen()->field_representation(); | 2595 return hydrogen()->field_representation(); |
| 2596 } | 2596 } |
| 2597 }; | 2597 }; |
| 2598 | 2598 |
| 2599 | 2599 |
| 2600 class LStoreNamedGeneric V8_FINAL: public LTemplateInstruction<0, 3, 0> { | 2600 class LStoreNamedGeneric FINAL: public LTemplateInstruction<0, 3, 0> { |
| 2601 public: | 2601 public: |
| 2602 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) { | 2602 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) { |
| 2603 inputs_[0] = context; | 2603 inputs_[0] = context; |
| 2604 inputs_[1] = object; | 2604 inputs_[1] = object; |
| 2605 inputs_[2] = value; | 2605 inputs_[2] = value; |
| 2606 } | 2606 } |
| 2607 | 2607 |
| 2608 LOperand* context() { return inputs_[0]; } | 2608 LOperand* context() { return inputs_[0]; } |
| 2609 LOperand* object() { return inputs_[1]; } | 2609 LOperand* object() { return inputs_[1]; } |
| 2610 LOperand* value() { return inputs_[2]; } | 2610 LOperand* value() { return inputs_[2]; } |
| 2611 | 2611 |
| 2612 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 2612 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") |
| 2613 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 2613 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) |
| 2614 | 2614 |
| 2615 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2615 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2616 | 2616 |
| 2617 Handle<Object> name() const { return hydrogen()->name(); } | 2617 Handle<Object> name() const { return hydrogen()->name(); } |
| 2618 StrictMode strict_mode() { return hydrogen()->strict_mode(); } | 2618 StrictMode strict_mode() { return hydrogen()->strict_mode(); } |
| 2619 }; | 2619 }; |
| 2620 | 2620 |
| 2621 | 2621 |
| 2622 class LStringAdd V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 2622 class LStringAdd FINAL : public LTemplateInstruction<1, 3, 0> { |
| 2623 public: | 2623 public: |
| 2624 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { | 2624 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
| 2625 inputs_[0] = context; | 2625 inputs_[0] = context; |
| 2626 inputs_[1] = left; | 2626 inputs_[1] = left; |
| 2627 inputs_[2] = right; | 2627 inputs_[2] = right; |
| 2628 } | 2628 } |
| 2629 | 2629 |
| 2630 LOperand* context() { return inputs_[0]; } | 2630 LOperand* context() { return inputs_[0]; } |
| 2631 LOperand* left() { return inputs_[1]; } | 2631 LOperand* left() { return inputs_[1]; } |
| 2632 LOperand* right() { return inputs_[2]; } | 2632 LOperand* right() { return inputs_[2]; } |
| 2633 | 2633 |
| 2634 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") | 2634 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") |
| 2635 DECLARE_HYDROGEN_ACCESSOR(StringAdd) | 2635 DECLARE_HYDROGEN_ACCESSOR(StringAdd) |
| 2636 }; | 2636 }; |
| 2637 | 2637 |
| 2638 | 2638 |
| 2639 | 2639 |
| 2640 class LStringCharCodeAt V8_FINAL : public LTemplateInstruction<1, 3, 0> { | 2640 class LStringCharCodeAt FINAL : public LTemplateInstruction<1, 3, 0> { |
| 2641 public: | 2641 public: |
| 2642 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { | 2642 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { |
| 2643 inputs_[0] = context; | 2643 inputs_[0] = context; |
| 2644 inputs_[1] = string; | 2644 inputs_[1] = string; |
| 2645 inputs_[2] = index; | 2645 inputs_[2] = index; |
| 2646 } | 2646 } |
| 2647 | 2647 |
| 2648 LOperand* context() { return inputs_[0]; } | 2648 LOperand* context() { return inputs_[0]; } |
| 2649 LOperand* string() { return inputs_[1]; } | 2649 LOperand* string() { return inputs_[1]; } |
| 2650 LOperand* index() { return inputs_[2]; } | 2650 LOperand* index() { return inputs_[2]; } |
| 2651 | 2651 |
| 2652 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") | 2652 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") |
| 2653 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) | 2653 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) |
| 2654 }; | 2654 }; |
| 2655 | 2655 |
| 2656 | 2656 |
| 2657 class LStringCharFromCode V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2657 class LStringCharFromCode FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2658 public: | 2658 public: |
| 2659 LStringCharFromCode(LOperand* context, LOperand* char_code) { | 2659 LStringCharFromCode(LOperand* context, LOperand* char_code) { |
| 2660 inputs_[0] = context; | 2660 inputs_[0] = context; |
| 2661 inputs_[1] = char_code; | 2661 inputs_[1] = char_code; |
| 2662 } | 2662 } |
| 2663 | 2663 |
| 2664 LOperand* context() { return inputs_[0]; } | 2664 LOperand* context() { return inputs_[0]; } |
| 2665 LOperand* char_code() { return inputs_[1]; } | 2665 LOperand* char_code() { return inputs_[1]; } |
| 2666 | 2666 |
| 2667 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") | 2667 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
| 2668 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) | 2668 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
| 2669 }; | 2669 }; |
| 2670 | 2670 |
| 2671 | 2671 |
| 2672 class LStringCompareAndBranch V8_FINAL : public LControlInstruction<3, 0> { | 2672 class LStringCompareAndBranch FINAL : public LControlInstruction<3, 0> { |
| 2673 public: | 2673 public: |
| 2674 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) { | 2674 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) { |
| 2675 inputs_[0] = context; | 2675 inputs_[0] = context; |
| 2676 inputs_[1] = left; | 2676 inputs_[1] = left; |
| 2677 inputs_[2] = right; | 2677 inputs_[2] = right; |
| 2678 } | 2678 } |
| 2679 | 2679 |
| 2680 LOperand* context() { return inputs_[0]; } | 2680 LOperand* context() { return inputs_[0]; } |
| 2681 LOperand* left() { return inputs_[1]; } | 2681 LOperand* left() { return inputs_[1]; } |
| 2682 LOperand* right() { return inputs_[2]; } | 2682 LOperand* right() { return inputs_[2]; } |
| 2683 | 2683 |
| 2684 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, | 2684 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, |
| 2685 "string-compare-and-branch") | 2685 "string-compare-and-branch") |
| 2686 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) | 2686 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) |
| 2687 | 2687 |
| 2688 Token::Value op() const { return hydrogen()->token(); } | 2688 Token::Value op() const { return hydrogen()->token(); } |
| 2689 | 2689 |
| 2690 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2690 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2691 }; | 2691 }; |
| 2692 | 2692 |
| 2693 | 2693 |
| 2694 // Truncating conversion from a tagged value to an int32. | 2694 // Truncating conversion from a tagged value to an int32. |
| 2695 class LTaggedToI V8_FINAL : public LTemplateInstruction<1, 1, 2> { | 2695 class LTaggedToI FINAL : public LTemplateInstruction<1, 1, 2> { |
| 2696 public: | 2696 public: |
| 2697 explicit LTaggedToI(LOperand* value, LOperand* temp1, LOperand* temp2) { | 2697 explicit LTaggedToI(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 2698 inputs_[0] = value; | 2698 inputs_[0] = value; |
| 2699 temps_[0] = temp1; | 2699 temps_[0] = temp1; |
| 2700 temps_[1] = temp2; | 2700 temps_[1] = temp2; |
| 2701 } | 2701 } |
| 2702 | 2702 |
| 2703 LOperand* value() { return inputs_[0]; } | 2703 LOperand* value() { return inputs_[0]; } |
| 2704 LOperand* temp1() { return temps_[0]; } | 2704 LOperand* temp1() { return temps_[0]; } |
| 2705 LOperand* temp2() { return temps_[1]; } | 2705 LOperand* temp2() { return temps_[1]; } |
| 2706 | 2706 |
| 2707 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 2707 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
| 2708 DECLARE_HYDROGEN_ACCESSOR(Change) | 2708 DECLARE_HYDROGEN_ACCESSOR(Change) |
| 2709 | 2709 |
| 2710 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 2710 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
| 2711 }; | 2711 }; |
| 2712 | 2712 |
| 2713 | 2713 |
| 2714 class LShiftI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2714 class LShiftI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2715 public: | 2715 public: |
| 2716 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) | 2716 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) |
| 2717 : op_(op), can_deopt_(can_deopt) { | 2717 : op_(op), can_deopt_(can_deopt) { |
| 2718 inputs_[0] = left; | 2718 inputs_[0] = left; |
| 2719 inputs_[1] = right; | 2719 inputs_[1] = right; |
| 2720 } | 2720 } |
| 2721 | 2721 |
| 2722 Token::Value op() const { return op_; } | 2722 Token::Value op() const { return op_; } |
| 2723 LOperand* left() { return inputs_[0]; } | 2723 LOperand* left() { return inputs_[0]; } |
| 2724 LOperand* right() { return inputs_[1]; } | 2724 LOperand* right() { return inputs_[1]; } |
| 2725 bool can_deopt() const { return can_deopt_; } | 2725 bool can_deopt() const { return can_deopt_; } |
| 2726 | 2726 |
| 2727 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") | 2727 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") |
| 2728 | 2728 |
| 2729 private: | 2729 private: |
| 2730 Token::Value op_; | 2730 Token::Value op_; |
| 2731 bool can_deopt_; | 2731 bool can_deopt_; |
| 2732 }; | 2732 }; |
| 2733 | 2733 |
| 2734 | 2734 |
| 2735 class LShiftS V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2735 class LShiftS FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2736 public: | 2736 public: |
| 2737 LShiftS(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) | 2737 LShiftS(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) |
| 2738 : op_(op), can_deopt_(can_deopt) { | 2738 : op_(op), can_deopt_(can_deopt) { |
| 2739 inputs_[0] = left; | 2739 inputs_[0] = left; |
| 2740 inputs_[1] = right; | 2740 inputs_[1] = right; |
| 2741 } | 2741 } |
| 2742 | 2742 |
| 2743 Token::Value op() const { return op_; } | 2743 Token::Value op() const { return op_; } |
| 2744 LOperand* left() { return inputs_[0]; } | 2744 LOperand* left() { return inputs_[0]; } |
| 2745 LOperand* right() { return inputs_[1]; } | 2745 LOperand* right() { return inputs_[1]; } |
| 2746 bool can_deopt() const { return can_deopt_; } | 2746 bool can_deopt() const { return can_deopt_; } |
| 2747 | 2747 |
| 2748 DECLARE_CONCRETE_INSTRUCTION(ShiftS, "shift-s") | 2748 DECLARE_CONCRETE_INSTRUCTION(ShiftS, "shift-s") |
| 2749 | 2749 |
| 2750 private: | 2750 private: |
| 2751 Token::Value op_; | 2751 Token::Value op_; |
| 2752 bool can_deopt_; | 2752 bool can_deopt_; |
| 2753 }; | 2753 }; |
| 2754 | 2754 |
| 2755 | 2755 |
| 2756 class LStoreCodeEntry V8_FINAL: public LTemplateInstruction<0, 2, 1> { | 2756 class LStoreCodeEntry FINAL: public LTemplateInstruction<0, 2, 1> { |
| 2757 public: | 2757 public: |
| 2758 LStoreCodeEntry(LOperand* function, LOperand* code_object, | 2758 LStoreCodeEntry(LOperand* function, LOperand* code_object, |
| 2759 LOperand* temp) { | 2759 LOperand* temp) { |
| 2760 inputs_[0] = function; | 2760 inputs_[0] = function; |
| 2761 inputs_[1] = code_object; | 2761 inputs_[1] = code_object; |
| 2762 temps_[0] = temp; | 2762 temps_[0] = temp; |
| 2763 } | 2763 } |
| 2764 | 2764 |
| 2765 LOperand* function() { return inputs_[0]; } | 2765 LOperand* function() { return inputs_[0]; } |
| 2766 LOperand* code_object() { return inputs_[1]; } | 2766 LOperand* code_object() { return inputs_[1]; } |
| 2767 LOperand* temp() { return temps_[0]; } | 2767 LOperand* temp() { return temps_[0]; } |
| 2768 | 2768 |
| 2769 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2769 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2770 | 2770 |
| 2771 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") | 2771 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") |
| 2772 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) | 2772 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) |
| 2773 }; | 2773 }; |
| 2774 | 2774 |
| 2775 | 2775 |
| 2776 class LStoreContextSlot V8_FINAL : public LTemplateInstruction<0, 2, 1> { | 2776 class LStoreContextSlot FINAL : public LTemplateInstruction<0, 2, 1> { |
| 2777 public: | 2777 public: |
| 2778 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) { | 2778 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) { |
| 2779 inputs_[0] = context; | 2779 inputs_[0] = context; |
| 2780 inputs_[1] = value; | 2780 inputs_[1] = value; |
| 2781 temps_[0] = temp; | 2781 temps_[0] = temp; |
| 2782 } | 2782 } |
| 2783 | 2783 |
| 2784 LOperand* context() { return inputs_[0]; } | 2784 LOperand* context() { return inputs_[0]; } |
| 2785 LOperand* value() { return inputs_[1]; } | 2785 LOperand* value() { return inputs_[1]; } |
| 2786 LOperand* temp() { return temps_[0]; } | 2786 LOperand* temp() { return temps_[0]; } |
| 2787 | 2787 |
| 2788 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") | 2788 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") |
| 2789 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) | 2789 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) |
| 2790 | 2790 |
| 2791 int slot_index() { return hydrogen()->slot_index(); } | 2791 int slot_index() { return hydrogen()->slot_index(); } |
| 2792 | 2792 |
| 2793 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2793 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2794 }; | 2794 }; |
| 2795 | 2795 |
| 2796 | 2796 |
| 2797 class LStoreGlobalCell V8_FINAL : public LTemplateInstruction<0, 1, 2> { | 2797 class LStoreGlobalCell FINAL : public LTemplateInstruction<0, 1, 2> { |
| 2798 public: | 2798 public: |
| 2799 LStoreGlobalCell(LOperand* value, LOperand* temp1, LOperand* temp2) { | 2799 LStoreGlobalCell(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 2800 inputs_[0] = value; | 2800 inputs_[0] = value; |
| 2801 temps_[0] = temp1; | 2801 temps_[0] = temp1; |
| 2802 temps_[1] = temp2; | 2802 temps_[1] = temp2; |
| 2803 } | 2803 } |
| 2804 | 2804 |
| 2805 LOperand* value() { return inputs_[0]; } | 2805 LOperand* value() { return inputs_[0]; } |
| 2806 LOperand* temp1() { return temps_[0]; } | 2806 LOperand* temp1() { return temps_[0]; } |
| 2807 LOperand* temp2() { return temps_[1]; } | 2807 LOperand* temp2() { return temps_[1]; } |
| 2808 | 2808 |
| 2809 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 2809 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
| 2810 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 2810 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
| 2811 }; | 2811 }; |
| 2812 | 2812 |
| 2813 | 2813 |
| 2814 class LSubI V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2814 class LSubI FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2815 public: | 2815 public: |
| 2816 LSubI(LOperand* left, LOperand* right) | 2816 LSubI(LOperand* left, LOperand* right) |
| 2817 : shift_(NO_SHIFT), shift_amount_(0) { | 2817 : shift_(NO_SHIFT), shift_amount_(0) { |
| 2818 inputs_[0] = left; | 2818 inputs_[0] = left; |
| 2819 inputs_[1] = right; | 2819 inputs_[1] = right; |
| 2820 } | 2820 } |
| 2821 | 2821 |
| 2822 LSubI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) | 2822 LSubI(LOperand* left, LOperand* right, Shift shift, LOperand* shift_amount) |
| 2823 : shift_(shift), shift_amount_(shift_amount) { | 2823 : shift_(shift), shift_amount_(shift_amount) { |
| 2824 inputs_[0] = left; | 2824 inputs_[0] = left; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2848 } | 2848 } |
| 2849 | 2849 |
| 2850 LOperand* left() { return inputs_[0]; } | 2850 LOperand* left() { return inputs_[0]; } |
| 2851 LOperand* right() { return inputs_[1]; } | 2851 LOperand* right() { return inputs_[1]; } |
| 2852 | 2852 |
| 2853 DECLARE_CONCRETE_INSTRUCTION(SubS, "sub-s") | 2853 DECLARE_CONCRETE_INSTRUCTION(SubS, "sub-s") |
| 2854 DECLARE_HYDROGEN_ACCESSOR(Sub) | 2854 DECLARE_HYDROGEN_ACCESSOR(Sub) |
| 2855 }; | 2855 }; |
| 2856 | 2856 |
| 2857 | 2857 |
| 2858 class LThisFunction V8_FINAL : public LTemplateInstruction<1, 0, 0> { | 2858 class LThisFunction FINAL : public LTemplateInstruction<1, 0, 0> { |
| 2859 public: | 2859 public: |
| 2860 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") | 2860 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") |
| 2861 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) | 2861 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) |
| 2862 }; | 2862 }; |
| 2863 | 2863 |
| 2864 | 2864 |
| 2865 class LToFastProperties V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2865 class LToFastProperties FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2866 public: | 2866 public: |
| 2867 explicit LToFastProperties(LOperand* value) { | 2867 explicit LToFastProperties(LOperand* value) { |
| 2868 inputs_[0] = value; | 2868 inputs_[0] = value; |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 LOperand* value() { return inputs_[0]; } | 2871 LOperand* value() { return inputs_[0]; } |
| 2872 | 2872 |
| 2873 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") | 2873 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") |
| 2874 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) | 2874 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) |
| 2875 }; | 2875 }; |
| 2876 | 2876 |
| 2877 | 2877 |
| 2878 class LTransitionElementsKind V8_FINAL : public LTemplateInstruction<0, 2, 2> { | 2878 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 2> { |
| 2879 public: | 2879 public: |
| 2880 LTransitionElementsKind(LOperand* object, | 2880 LTransitionElementsKind(LOperand* object, |
| 2881 LOperand* context, | 2881 LOperand* context, |
| 2882 LOperand* temp1, | 2882 LOperand* temp1, |
| 2883 LOperand* temp2) { | 2883 LOperand* temp2) { |
| 2884 inputs_[0] = object; | 2884 inputs_[0] = object; |
| 2885 inputs_[1] = context; | 2885 inputs_[1] = context; |
| 2886 temps_[0] = temp1; | 2886 temps_[0] = temp1; |
| 2887 temps_[1] = temp2; | 2887 temps_[1] = temp2; |
| 2888 } | 2888 } |
| 2889 | 2889 |
| 2890 LOperand* object() { return inputs_[0]; } | 2890 LOperand* object() { return inputs_[0]; } |
| 2891 LOperand* context() { return inputs_[1]; } | 2891 LOperand* context() { return inputs_[1]; } |
| 2892 LOperand* temp1() { return temps_[0]; } | 2892 LOperand* temp1() { return temps_[0]; } |
| 2893 LOperand* temp2() { return temps_[1]; } | 2893 LOperand* temp2() { return temps_[1]; } |
| 2894 | 2894 |
| 2895 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, | 2895 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, |
| 2896 "transition-elements-kind") | 2896 "transition-elements-kind") |
| 2897 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) | 2897 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) |
| 2898 | 2898 |
| 2899 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2899 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2900 | 2900 |
| 2901 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } | 2901 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } |
| 2902 Handle<Map> transitioned_map() { | 2902 Handle<Map> transitioned_map() { |
| 2903 return hydrogen()->transitioned_map().handle(); | 2903 return hydrogen()->transitioned_map().handle(); |
| 2904 } | 2904 } |
| 2905 ElementsKind from_kind() const { return hydrogen()->from_kind(); } | 2905 ElementsKind from_kind() const { return hydrogen()->from_kind(); } |
| 2906 ElementsKind to_kind() const { return hydrogen()->to_kind(); } | 2906 ElementsKind to_kind() const { return hydrogen()->to_kind(); } |
| 2907 }; | 2907 }; |
| 2908 | 2908 |
| 2909 | 2909 |
| 2910 class LTrapAllocationMemento V8_FINAL : public LTemplateInstruction<0, 1, 2> { | 2910 class LTrapAllocationMemento FINAL : public LTemplateInstruction<0, 1, 2> { |
| 2911 public: | 2911 public: |
| 2912 LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) { | 2912 LTrapAllocationMemento(LOperand* object, LOperand* temp1, LOperand* temp2) { |
| 2913 inputs_[0] = object; | 2913 inputs_[0] = object; |
| 2914 temps_[0] = temp1; | 2914 temps_[0] = temp1; |
| 2915 temps_[1] = temp2; | 2915 temps_[1] = temp2; |
| 2916 } | 2916 } |
| 2917 | 2917 |
| 2918 LOperand* object() { return inputs_[0]; } | 2918 LOperand* object() { return inputs_[0]; } |
| 2919 LOperand* temp1() { return temps_[0]; } | 2919 LOperand* temp1() { return temps_[0]; } |
| 2920 LOperand* temp2() { return temps_[1]; } | 2920 LOperand* temp2() { return temps_[1]; } |
| 2921 | 2921 |
| 2922 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") | 2922 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") |
| 2923 }; | 2923 }; |
| 2924 | 2924 |
| 2925 | 2925 |
| 2926 class LTruncateDoubleToIntOrSmi V8_FINAL | 2926 class LTruncateDoubleToIntOrSmi FINAL |
| 2927 : public LTemplateInstruction<1, 1, 0> { | 2927 : public LTemplateInstruction<1, 1, 0> { |
| 2928 public: | 2928 public: |
| 2929 explicit LTruncateDoubleToIntOrSmi(LOperand* value) { | 2929 explicit LTruncateDoubleToIntOrSmi(LOperand* value) { |
| 2930 inputs_[0] = value; | 2930 inputs_[0] = value; |
| 2931 } | 2931 } |
| 2932 | 2932 |
| 2933 LOperand* value() { return inputs_[0]; } | 2933 LOperand* value() { return inputs_[0]; } |
| 2934 | 2934 |
| 2935 DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi, | 2935 DECLARE_CONCRETE_INSTRUCTION(TruncateDoubleToIntOrSmi, |
| 2936 "truncate-double-to-int-or-smi") | 2936 "truncate-double-to-int-or-smi") |
| 2937 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) | 2937 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) |
| 2938 | 2938 |
| 2939 bool tag_result() { return hydrogen()->representation().IsSmi(); } | 2939 bool tag_result() { return hydrogen()->representation().IsSmi(); } |
| 2940 }; | 2940 }; |
| 2941 | 2941 |
| 2942 | 2942 |
| 2943 class LTypeof V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 2943 class LTypeof FINAL : public LTemplateInstruction<1, 2, 0> { |
| 2944 public: | 2944 public: |
| 2945 LTypeof(LOperand* context, LOperand* value) { | 2945 LTypeof(LOperand* context, LOperand* value) { |
| 2946 inputs_[0] = context; | 2946 inputs_[0] = context; |
| 2947 inputs_[1] = value; | 2947 inputs_[1] = value; |
| 2948 } | 2948 } |
| 2949 | 2949 |
| 2950 LOperand* context() { return inputs_[0]; } | 2950 LOperand* context() { return inputs_[0]; } |
| 2951 LOperand* value() { return inputs_[1]; } | 2951 LOperand* value() { return inputs_[1]; } |
| 2952 | 2952 |
| 2953 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 2953 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
| 2954 }; | 2954 }; |
| 2955 | 2955 |
| 2956 | 2956 |
| 2957 class LTypeofIsAndBranch V8_FINAL : public LControlInstruction<1, 2> { | 2957 class LTypeofIsAndBranch FINAL : public LControlInstruction<1, 2> { |
| 2958 public: | 2958 public: |
| 2959 LTypeofIsAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { | 2959 LTypeofIsAndBranch(LOperand* value, LOperand* temp1, LOperand* temp2) { |
| 2960 inputs_[0] = value; | 2960 inputs_[0] = value; |
| 2961 temps_[0] = temp1; | 2961 temps_[0] = temp1; |
| 2962 temps_[1] = temp2; | 2962 temps_[1] = temp2; |
| 2963 } | 2963 } |
| 2964 | 2964 |
| 2965 LOperand* value() { return inputs_[0]; } | 2965 LOperand* value() { return inputs_[0]; } |
| 2966 LOperand* temp1() { return temps_[0]; } | 2966 LOperand* temp1() { return temps_[0]; } |
| 2967 LOperand* temp2() { return temps_[1]; } | 2967 LOperand* temp2() { return temps_[1]; } |
| 2968 | 2968 |
| 2969 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 2969 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
| 2970 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) | 2970 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
| 2971 | 2971 |
| 2972 Handle<String> type_literal() const { return hydrogen()->type_literal(); } | 2972 Handle<String> type_literal() const { return hydrogen()->type_literal(); } |
| 2973 | 2973 |
| 2974 virtual void PrintDataTo(StringStream* stream) V8_OVERRIDE; | 2974 virtual void PrintDataTo(StringStream* stream) OVERRIDE; |
| 2975 }; | 2975 }; |
| 2976 | 2976 |
| 2977 | 2977 |
| 2978 class LUint32ToDouble V8_FINAL : public LTemplateInstruction<1, 1, 0> { | 2978 class LUint32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { |
| 2979 public: | 2979 public: |
| 2980 explicit LUint32ToDouble(LOperand* value) { | 2980 explicit LUint32ToDouble(LOperand* value) { |
| 2981 inputs_[0] = value; | 2981 inputs_[0] = value; |
| 2982 } | 2982 } |
| 2983 | 2983 |
| 2984 LOperand* value() { return inputs_[0]; } | 2984 LOperand* value() { return inputs_[0]; } |
| 2985 | 2985 |
| 2986 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") | 2986 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") |
| 2987 }; | 2987 }; |
| 2988 | 2988 |
| 2989 | 2989 |
| 2990 class LCheckMapValue V8_FINAL : public LTemplateInstruction<0, 2, 1> { | 2990 class LCheckMapValue FINAL : public LTemplateInstruction<0, 2, 1> { |
| 2991 public: | 2991 public: |
| 2992 LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) { | 2992 LCheckMapValue(LOperand* value, LOperand* map, LOperand* temp) { |
| 2993 inputs_[0] = value; | 2993 inputs_[0] = value; |
| 2994 inputs_[1] = map; | 2994 inputs_[1] = map; |
| 2995 temps_[0] = temp; | 2995 temps_[0] = temp; |
| 2996 } | 2996 } |
| 2997 | 2997 |
| 2998 LOperand* value() { return inputs_[0]; } | 2998 LOperand* value() { return inputs_[0]; } |
| 2999 LOperand* map() { return inputs_[1]; } | 2999 LOperand* map() { return inputs_[1]; } |
| 3000 LOperand* temp() { return temps_[0]; } | 3000 LOperand* temp() { return temps_[0]; } |
| 3001 | 3001 |
| 3002 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") | 3002 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") |
| 3003 }; | 3003 }; |
| 3004 | 3004 |
| 3005 | 3005 |
| 3006 class LLoadFieldByIndex V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 3006 class LLoadFieldByIndex FINAL : public LTemplateInstruction<1, 2, 0> { |
| 3007 public: | 3007 public: |
| 3008 LLoadFieldByIndex(LOperand* object, LOperand* index) { | 3008 LLoadFieldByIndex(LOperand* object, LOperand* index) { |
| 3009 inputs_[0] = object; | 3009 inputs_[0] = object; |
| 3010 inputs_[1] = index; | 3010 inputs_[1] = index; |
| 3011 } | 3011 } |
| 3012 | 3012 |
| 3013 LOperand* object() { return inputs_[0]; } | 3013 LOperand* object() { return inputs_[0]; } |
| 3014 LOperand* index() { return inputs_[1]; } | 3014 LOperand* index() { return inputs_[1]; } |
| 3015 | 3015 |
| 3016 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") | 3016 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") |
| (...skipping 22 matching lines...) Expand all Loading... |
| 3039 LOperand* context() { return inputs_[0]; } | 3039 LOperand* context() { return inputs_[0]; } |
| 3040 LOperand* function() { return inputs_[1]; } | 3040 LOperand* function() { return inputs_[1]; } |
| 3041 | 3041 |
| 3042 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } | 3042 Handle<ScopeInfo> scope_info() { return hydrogen()->scope_info(); } |
| 3043 | 3043 |
| 3044 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") | 3044 DECLARE_CONCRETE_INSTRUCTION(AllocateBlockContext, "allocate-block-context") |
| 3045 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) | 3045 DECLARE_HYDROGEN_ACCESSOR(AllocateBlockContext) |
| 3046 }; | 3046 }; |
| 3047 | 3047 |
| 3048 | 3048 |
| 3049 class LWrapReceiver V8_FINAL : public LTemplateInstruction<1, 2, 0> { | 3049 class LWrapReceiver FINAL : public LTemplateInstruction<1, 2, 0> { |
| 3050 public: | 3050 public: |
| 3051 LWrapReceiver(LOperand* receiver, LOperand* function) { | 3051 LWrapReceiver(LOperand* receiver, LOperand* function) { |
| 3052 inputs_[0] = receiver; | 3052 inputs_[0] = receiver; |
| 3053 inputs_[1] = function; | 3053 inputs_[1] = function; |
| 3054 } | 3054 } |
| 3055 | 3055 |
| 3056 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") | 3056 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") |
| 3057 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) | 3057 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) |
| 3058 | 3058 |
| 3059 LOperand* receiver() { return inputs_[0]; } | 3059 LOperand* receiver() { return inputs_[0]; } |
| 3060 LOperand* function() { return inputs_[1]; } | 3060 LOperand* function() { return inputs_[1]; } |
| 3061 }; | 3061 }; |
| 3062 | 3062 |
| 3063 | 3063 |
| 3064 class LChunkBuilder; | 3064 class LChunkBuilder; |
| 3065 class LPlatformChunk V8_FINAL : public LChunk { | 3065 class LPlatformChunk FINAL : public LChunk { |
| 3066 public: | 3066 public: |
| 3067 LPlatformChunk(CompilationInfo* info, HGraph* graph) | 3067 LPlatformChunk(CompilationInfo* info, HGraph* graph) |
| 3068 : LChunk(info, graph) { } | 3068 : LChunk(info, graph) { } |
| 3069 | 3069 |
| 3070 int GetNextSpillIndex(); | 3070 int GetNextSpillIndex(); |
| 3071 LOperand* GetNextSpillSlot(RegisterKind kind); | 3071 LOperand* GetNextSpillSlot(RegisterKind kind); |
| 3072 }; | 3072 }; |
| 3073 | 3073 |
| 3074 | 3074 |
| 3075 class LChunkBuilder V8_FINAL : public LChunkBuilderBase { | 3075 class LChunkBuilder FINAL : public LChunkBuilderBase { |
| 3076 public: | 3076 public: |
| 3077 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) | 3077 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) |
| 3078 : LChunkBuilderBase(graph->zone()), | 3078 : LChunkBuilderBase(graph->zone()), |
| 3079 chunk_(NULL), | 3079 chunk_(NULL), |
| 3080 info_(info), | 3080 info_(info), |
| 3081 graph_(graph), | 3081 graph_(graph), |
| 3082 status_(UNUSED), | 3082 status_(UNUSED), |
| 3083 current_instruction_(NULL), | 3083 current_instruction_(NULL), |
| 3084 current_block_(NULL), | 3084 current_block_(NULL), |
| 3085 allocator_(allocator) { } | 3085 allocator_(allocator) { } |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3259 | 3259 |
| 3260 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 3260 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 3261 }; | 3261 }; |
| 3262 | 3262 |
| 3263 #undef DECLARE_HYDROGEN_ACCESSOR | 3263 #undef DECLARE_HYDROGEN_ACCESSOR |
| 3264 #undef DECLARE_CONCRETE_INSTRUCTION | 3264 #undef DECLARE_CONCRETE_INSTRUCTION |
| 3265 | 3265 |
| 3266 } } // namespace v8::internal | 3266 } } // namespace v8::internal |
| 3267 | 3267 |
| 3268 #endif // V8_ARM64_LITHIUM_ARM64_H_ | 3268 #endif // V8_ARM64_LITHIUM_ARM64_H_ |
| OLD | NEW |