Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 797943002: Consistently use only one of virtual/OVERRIDE/FINAL. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Removed temporary hack. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_IA32_LITHIUM_IA32_H_ 5 #ifndef V8_IA32_LITHIUM_IA32_H_
6 #define V8_IA32_LITHIUM_IA32_H_ 6 #define V8_IA32_LITHIUM_IA32_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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 V(ToFastProperties) \ 160 V(ToFastProperties) \
161 V(TransitionElementsKind) \ 161 V(TransitionElementsKind) \
162 V(TrapAllocationMemento) \ 162 V(TrapAllocationMemento) \
163 V(Typeof) \ 163 V(Typeof) \
164 V(TypeofIsAndBranch) \ 164 V(TypeofIsAndBranch) \
165 V(Uint32ToDouble) \ 165 V(Uint32ToDouble) \
166 V(UnknownOSRValue) \ 166 V(UnknownOSRValue) \
167 V(WrapReceiver) 167 V(WrapReceiver)
168 168
169 169
170 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 170 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
171 virtual Opcode opcode() const FINAL OVERRIDE { \ 171 Opcode opcode() const FINAL { return LInstruction::k##type; } \
172 return LInstruction::k##type; \ 172 void CompileToNative(LCodeGen* generator) FINAL; \
173 } \ 173 const char* Mnemonic() const FINAL { return mnemonic; } \
174 virtual void CompileToNative(LCodeGen* generator) FINAL OVERRIDE; \ 174 static L##type* cast(LInstruction* instr) { \
175 virtual const char* Mnemonic() const FINAL OVERRIDE { \ 175 DCHECK(instr->Is##type()); \
176 return mnemonic; \ 176 return reinterpret_cast<L##type*>(instr); \
177 } \
178 static L##type* cast(LInstruction* instr) { \
179 DCHECK(instr->Is##type()); \
180 return reinterpret_cast<L##type*>(instr); \
181 } 177 }
182 178
183 179
184 #define DECLARE_HYDROGEN_ACCESSOR(type) \ 180 #define DECLARE_HYDROGEN_ACCESSOR(type) \
185 H##type* hydrogen() const { \ 181 H##type* hydrogen() const { \
186 return H##type::cast(hydrogen_value()); \ 182 return H##type::cast(hydrogen_value()); \
187 } 183 }
188 184
189 185
190 class LInstruction : public ZoneObject { 186 class LInstruction : public ZoneObject {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 int bit_field_; 281 int bit_field_;
286 }; 282 };
287 283
288 284
289 // R = number of result operands (0 or 1). 285 // R = number of result operands (0 or 1).
290 template<int R> 286 template<int R>
291 class LTemplateResultInstruction : public LInstruction { 287 class LTemplateResultInstruction : public LInstruction {
292 public: 288 public:
293 // Allow 0 or 1 output operands. 289 // Allow 0 or 1 output operands.
294 STATIC_ASSERT(R == 0 || R == 1); 290 STATIC_ASSERT(R == 0 || R == 1);
295 virtual bool HasResult() const FINAL OVERRIDE { 291 bool HasResult() const FINAL { return R != 0 && result() != NULL; }
296 return R != 0 && result() != NULL;
297 }
298 void set_result(LOperand* operand) { results_[0] = operand; } 292 void set_result(LOperand* operand) { results_[0] = operand; }
299 LOperand* result() const { return results_[0]; } 293 LOperand* result() const OVERRIDE { return results_[0]; }
300 294
301 protected: 295 protected:
302 EmbeddedContainer<LOperand*, R> results_; 296 EmbeddedContainer<LOperand*, R> results_;
303 }; 297 };
304 298
305 299
306 // R = number of result operands (0 or 1). 300 // R = number of result operands (0 or 1).
307 // I = number of input operands. 301 // I = number of input operands.
308 // T = number of temporary operands. 302 // T = number of temporary operands.
309 template<int R, int I, int T> 303 template<int R, int I, int T>
310 class LTemplateInstruction : public LTemplateResultInstruction<R> { 304 class LTemplateInstruction : public LTemplateResultInstruction<R> {
311 protected: 305 protected:
312 EmbeddedContainer<LOperand*, I> inputs_; 306 EmbeddedContainer<LOperand*, I> inputs_;
313 EmbeddedContainer<LOperand*, T> temps_; 307 EmbeddedContainer<LOperand*, T> temps_;
314 308
315 private: 309 private:
316 // Iterator support. 310 // Iterator support.
317 virtual int InputCount() FINAL OVERRIDE { return I; } 311 int InputCount() FINAL { return I; }
318 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } 312 LOperand* InputAt(int i) FINAL { return inputs_[i]; }
319 313
320 virtual int TempCount() FINAL OVERRIDE { return T; } 314 int TempCount() FINAL { return T; }
321 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return temps_[i]; } 315 LOperand* TempAt(int i) FINAL { return temps_[i]; }
322 }; 316 };
323 317
324 318
325 class LGap : public LTemplateInstruction<0, 0, 0> { 319 class LGap : public LTemplateInstruction<0, 0, 0> {
326 public: 320 public:
327 explicit LGap(HBasicBlock* block) : block_(block) { 321 explicit LGap(HBasicBlock* block) : block_(block) {
328 parallel_moves_[BEFORE] = NULL; 322 parallel_moves_[BEFORE] = NULL;
329 parallel_moves_[START] = NULL; 323 parallel_moves_[START] = NULL;
330 parallel_moves_[END] = NULL; 324 parallel_moves_[END] = NULL;
331 parallel_moves_[AFTER] = NULL; 325 parallel_moves_[AFTER] = NULL;
332 } 326 }
333 327
334 // Can't use the DECLARE-macro here because of sub-classes. 328 // Can't use the DECLARE-macro here because of sub-classes.
335 virtual bool IsGap() const FINAL OVERRIDE { return true; } 329 bool IsGap() const FINAL { return true; }
336 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 330 void PrintDataTo(StringStream* stream) OVERRIDE;
337 static LGap* cast(LInstruction* instr) { 331 static LGap* cast(LInstruction* instr) {
338 DCHECK(instr->IsGap()); 332 DCHECK(instr->IsGap());
339 return reinterpret_cast<LGap*>(instr); 333 return reinterpret_cast<LGap*>(instr);
340 } 334 }
341 335
342 bool IsRedundant() const; 336 bool IsRedundant() const;
343 337
344 HBasicBlock* block() const { return block_; } 338 HBasicBlock* block() const { return block_; }
345 339
346 enum InnerPosition { 340 enum InnerPosition {
(...skipping 19 matching lines...) Expand all
366 private: 360 private:
367 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 361 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
368 HBasicBlock* block_; 362 HBasicBlock* block_;
369 }; 363 };
370 364
371 365
372 class LInstructionGap FINAL : public LGap { 366 class LInstructionGap FINAL : public LGap {
373 public: 367 public:
374 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } 368 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
375 369
376 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { 370 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE {
377 return !IsRedundant(); 371 return !IsRedundant();
378 } 372 }
379 373
380 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") 374 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
381 }; 375 };
382 376
383 377
384 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> { 378 class LGoto FINAL : public LTemplateInstruction<0, 0, 0> {
385 public: 379 public:
386 explicit LGoto(HBasicBlock* block) : block_(block) { } 380 explicit LGoto(HBasicBlock* block) : block_(block) { }
387 381
388 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE; 382 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE;
389 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") 383 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
390 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 384 void PrintDataTo(StringStream* stream) OVERRIDE;
391 virtual bool IsControl() const OVERRIDE { return true; } 385 bool IsControl() const OVERRIDE { return true; }
392 386
393 int block_id() const { return block_->block_id(); } 387 int block_id() const { return block_->block_id(); }
394 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE { 388 bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE {
395 return false; 389 return false;
396 } 390 }
397 391
398 bool jumps_to_join() const { return block_->predecessors()->length() > 1; } 392 bool jumps_to_join() const { return block_->predecessors()->length() > 1; }
399 393
400 private: 394 private:
401 HBasicBlock* block_; 395 HBasicBlock* block_;
402 }; 396 };
403 397
404 398
(...skipping 14 matching lines...) Expand all
419 public: 413 public:
420 explicit LDummyUse(LOperand* value) { 414 explicit LDummyUse(LOperand* value) {
421 inputs_[0] = value; 415 inputs_[0] = value;
422 } 416 }
423 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") 417 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
424 }; 418 };
425 419
426 420
427 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> { 421 class LDeoptimize FINAL : public LTemplateInstruction<0, 0, 0> {
428 public: 422 public:
429 virtual bool IsControl() const OVERRIDE { return true; } 423 bool IsControl() const OVERRIDE { return true; }
430 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") 424 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
431 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) 425 DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
432 }; 426 };
433 427
434 428
435 class LLabel FINAL : public LGap { 429 class LLabel FINAL : public LGap {
436 public: 430 public:
437 explicit LLabel(HBasicBlock* block) 431 explicit LLabel(HBasicBlock* block)
438 : LGap(block), replacement_(NULL) { } 432 : LGap(block), replacement_(NULL) { }
439 433
440 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { 434 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
441 return false;
442 }
443 DECLARE_CONCRETE_INSTRUCTION(Label, "label") 435 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
444 436
445 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 437 void PrintDataTo(StringStream* stream) OVERRIDE;
446 438
447 int block_id() const { return block()->block_id(); } 439 int block_id() const { return block()->block_id(); }
448 bool is_loop_header() const { return block()->IsLoopHeader(); } 440 bool is_loop_header() const { return block()->IsLoopHeader(); }
449 bool is_osr_entry() const { return block()->is_osr_entry(); } 441 bool is_osr_entry() const { return block()->is_osr_entry(); }
450 Label* label() { return &label_; } 442 Label* label() { return &label_; }
451 LLabel* replacement() const { return replacement_; } 443 LLabel* replacement() const { return replacement_; }
452 void set_replacement(LLabel* label) { replacement_ = label; } 444 void set_replacement(LLabel* label) { replacement_ = label; }
453 bool HasReplacement() const { return replacement_ != NULL; } 445 bool HasReplacement() const { return replacement_ != NULL; }
454 446
455 private: 447 private:
456 Label label_; 448 Label label_;
457 LLabel* replacement_; 449 LLabel* replacement_;
458 }; 450 };
459 451
460 452
461 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> { 453 class LParameter FINAL : public LTemplateInstruction<1, 0, 0> {
462 public: 454 public:
463 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { 455 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
464 return false;
465 }
466 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 456 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
467 }; 457 };
468 458
469 459
470 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> { 460 class LCallStub FINAL : public LTemplateInstruction<1, 1, 0> {
471 public: 461 public:
472 explicit LCallStub(LOperand* context) { 462 explicit LCallStub(LOperand* context) {
473 inputs_[0] = context; 463 inputs_[0] = context;
474 } 464 }
475 465
(...skipping 20 matching lines...) Expand all
496 LOperand* name() { return inputs_[2]; } 486 LOperand* name() { return inputs_[2]; }
497 487
498 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache, 488 DECLARE_CONCRETE_INSTRUCTION(TailCallThroughMegamorphicCache,
499 "tail-call-through-megamorphic-cache") 489 "tail-call-through-megamorphic-cache")
500 DECLARE_HYDROGEN_ACCESSOR(TailCallThroughMegamorphicCache) 490 DECLARE_HYDROGEN_ACCESSOR(TailCallThroughMegamorphicCache)
501 }; 491 };
502 492
503 493
504 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> { 494 class LUnknownOSRValue FINAL : public LTemplateInstruction<1, 0, 0> {
505 public: 495 public:
506 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { 496 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
507 return false;
508 }
509 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 497 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
510 }; 498 };
511 499
512 500
513 template<int I, int T> 501 template<int I, int T>
514 class LControlInstruction: public LTemplateInstruction<0, I, T> { 502 class LControlInstruction: public LTemplateInstruction<0, I, T> {
515 public: 503 public:
516 LControlInstruction() : false_label_(NULL), true_label_(NULL) { } 504 LControlInstruction() : false_label_(NULL), true_label_(NULL) { }
517 505
518 virtual bool IsControl() const FINAL OVERRIDE { return true; } 506 bool IsControl() const FINAL { return true; }
519 507
520 int SuccessorCount() { return hydrogen()->SuccessorCount(); } 508 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
521 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } 509 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
522 510
523 int TrueDestination(LChunk* chunk) { 511 int TrueDestination(LChunk* chunk) {
524 return chunk->LookupDestination(true_block_id()); 512 return chunk->LookupDestination(true_block_id());
525 } 513 }
526 int FalseDestination(LChunk* chunk) { 514 int FalseDestination(LChunk* chunk) {
527 return chunk->LookupDestination(false_block_id()); 515 return chunk->LookupDestination(false_block_id());
528 } 516 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 inputs_[1] = length; 589 inputs_[1] = length;
602 inputs_[2] = index; 590 inputs_[2] = index;
603 } 591 }
604 592
605 LOperand* arguments() { return inputs_[0]; } 593 LOperand* arguments() { return inputs_[0]; }
606 LOperand* length() { return inputs_[1]; } 594 LOperand* length() { return inputs_[1]; }
607 LOperand* index() { return inputs_[2]; } 595 LOperand* index() { return inputs_[2]; }
608 596
609 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") 597 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
610 598
611 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 599 void PrintDataTo(StringStream* stream) OVERRIDE;
612 }; 600 };
613 601
614 602
615 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> { 603 class LArgumentsLength FINAL : public LTemplateInstruction<1, 1, 0> {
616 public: 604 public:
617 explicit LArgumentsLength(LOperand* elements) { 605 explicit LArgumentsLength(LOperand* elements) {
618 inputs_[0] = elements; 606 inputs_[0] = elements;
619 } 607 }
620 608
621 LOperand* elements() { return inputs_[0]; } 609 LOperand* elements() { return inputs_[0]; }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 838
851 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, 839 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
852 "compare-numeric-and-branch") 840 "compare-numeric-and-branch")
853 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) 841 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
854 842
855 Token::Value op() const { return hydrogen()->token(); } 843 Token::Value op() const { return hydrogen()->token(); }
856 bool is_double() const { 844 bool is_double() const {
857 return hydrogen()->representation().IsDouble(); 845 return hydrogen()->representation().IsDouble();
858 } 846 }
859 847
860 virtual void PrintDataTo(StringStream* stream); 848 void PrintDataTo(StringStream* stream) OVERRIDE;
861 }; 849 };
862 850
863 851
864 class LMathFloor FINAL : public LTemplateInstruction<1, 1, 0> { 852 class LMathFloor FINAL : public LTemplateInstruction<1, 1, 0> {
865 public: 853 public:
866 explicit LMathFloor(LOperand* value) { 854 explicit LMathFloor(LOperand* value) {
867 inputs_[0] = value; 855 inputs_[0] = value;
868 } 856 }
869 857
870 LOperand* value() { return inputs_[0]; } 858 LOperand* value() { return inputs_[0]; }
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 LIsObjectAndBranch(LOperand* value, LOperand* temp) { 1019 LIsObjectAndBranch(LOperand* value, LOperand* temp) {
1032 inputs_[0] = value; 1020 inputs_[0] = value;
1033 temps_[0] = temp; 1021 temps_[0] = temp;
1034 } 1022 }
1035 1023
1036 LOperand* value() { return inputs_[0]; } 1024 LOperand* value() { return inputs_[0]; }
1037 LOperand* temp() { return temps_[0]; } 1025 LOperand* temp() { return temps_[0]; }
1038 1026
1039 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") 1027 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
1040 1028
1041 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1029 void PrintDataTo(StringStream* stream) OVERRIDE;
1042 }; 1030 };
1043 1031
1044 1032
1045 class LIsStringAndBranch FINAL : public LControlInstruction<1, 1> { 1033 class LIsStringAndBranch FINAL : public LControlInstruction<1, 1> {
1046 public: 1034 public:
1047 LIsStringAndBranch(LOperand* value, LOperand* temp) { 1035 LIsStringAndBranch(LOperand* value, LOperand* temp) {
1048 inputs_[0] = value; 1036 inputs_[0] = value;
1049 temps_[0] = temp; 1037 temps_[0] = temp;
1050 } 1038 }
1051 1039
1052 LOperand* value() { return inputs_[0]; } 1040 LOperand* value() { return inputs_[0]; }
1053 LOperand* temp() { return temps_[0]; } 1041 LOperand* temp() { return temps_[0]; }
1054 1042
1055 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") 1043 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
1056 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) 1044 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
1057 1045
1058 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1046 void PrintDataTo(StringStream* stream) OVERRIDE;
1059 }; 1047 };
1060 1048
1061 1049
1062 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> { 1050 class LIsSmiAndBranch FINAL : public LControlInstruction<1, 0> {
1063 public: 1051 public:
1064 explicit LIsSmiAndBranch(LOperand* value) { 1052 explicit LIsSmiAndBranch(LOperand* value) {
1065 inputs_[0] = value; 1053 inputs_[0] = value;
1066 } 1054 }
1067 1055
1068 LOperand* value() { return inputs_[0]; } 1056 LOperand* value() { return inputs_[0]; }
1069 1057
1070 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") 1058 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
1071 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) 1059 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
1072 1060
1073 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1061 void PrintDataTo(StringStream* stream) OVERRIDE;
1074 }; 1062 };
1075 1063
1076 1064
1077 class LIsUndetectableAndBranch FINAL : public LControlInstruction<1, 1> { 1065 class LIsUndetectableAndBranch FINAL : public LControlInstruction<1, 1> {
1078 public: 1066 public:
1079 LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { 1067 LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
1080 inputs_[0] = value; 1068 inputs_[0] = value;
1081 temps_[0] = temp; 1069 temps_[0] = temp;
1082 } 1070 }
1083 1071
1084 LOperand* value() { return inputs_[0]; } 1072 LOperand* value() { return inputs_[0]; }
1085 LOperand* temp() { return temps_[0]; } 1073 LOperand* temp() { return temps_[0]; }
1086 1074
1087 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, 1075 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
1088 "is-undetectable-and-branch") 1076 "is-undetectable-and-branch")
1089 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) 1077 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
1090 1078
1091 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1079 void PrintDataTo(StringStream* stream) OVERRIDE;
1092 }; 1080 };
1093 1081
1094 1082
1095 class LStringCompareAndBranch FINAL : public LControlInstruction<3, 0> { 1083 class LStringCompareAndBranch FINAL : public LControlInstruction<3, 0> {
1096 public: 1084 public:
1097 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) { 1085 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
1098 inputs_[0] = context; 1086 inputs_[0] = context;
1099 inputs_[1] = left; 1087 inputs_[1] = left;
1100 inputs_[2] = right; 1088 inputs_[2] = right;
1101 } 1089 }
1102 1090
1103 LOperand* context() { return inputs_[1]; } 1091 LOperand* context() { return inputs_[1]; }
1104 LOperand* left() { return inputs_[1]; } 1092 LOperand* left() { return inputs_[1]; }
1105 LOperand* right() { return inputs_[2]; } 1093 LOperand* right() { return inputs_[2]; }
1106 1094
1107 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, 1095 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1108 "string-compare-and-branch") 1096 "string-compare-and-branch")
1109 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) 1097 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
1110 1098
1111 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1099 void PrintDataTo(StringStream* stream) OVERRIDE;
1112 1100
1113 Token::Value op() const { return hydrogen()->token(); } 1101 Token::Value op() const { return hydrogen()->token(); }
1114 }; 1102 };
1115 1103
1116 1104
1117 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 1> { 1105 class LHasInstanceTypeAndBranch FINAL : public LControlInstruction<1, 1> {
1118 public: 1106 public:
1119 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { 1107 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
1120 inputs_[0] = value; 1108 inputs_[0] = value;
1121 temps_[0] = temp; 1109 temps_[0] = temp;
1122 } 1110 }
1123 1111
1124 LOperand* value() { return inputs_[0]; } 1112 LOperand* value() { return inputs_[0]; }
1125 LOperand* temp() { return temps_[0]; } 1113 LOperand* temp() { return temps_[0]; }
1126 1114
1127 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 1115 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1128 "has-instance-type-and-branch") 1116 "has-instance-type-and-branch")
1129 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) 1117 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1130 1118
1131 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1119 void PrintDataTo(StringStream* stream) OVERRIDE;
1132 }; 1120 };
1133 1121
1134 1122
1135 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> { 1123 class LGetCachedArrayIndex FINAL : public LTemplateInstruction<1, 1, 0> {
1136 public: 1124 public:
1137 explicit LGetCachedArrayIndex(LOperand* value) { 1125 explicit LGetCachedArrayIndex(LOperand* value) {
1138 inputs_[0] = value; 1126 inputs_[0] = value;
1139 } 1127 }
1140 1128
1141 LOperand* value() { return inputs_[0]; } 1129 LOperand* value() { return inputs_[0]; }
1142 1130
1143 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") 1131 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1144 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) 1132 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1145 }; 1133 };
1146 1134
1147 1135
1148 class LHasCachedArrayIndexAndBranch FINAL 1136 class LHasCachedArrayIndexAndBranch FINAL
1149 : public LControlInstruction<1, 0> { 1137 : public LControlInstruction<1, 0> {
1150 public: 1138 public:
1151 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { 1139 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
1152 inputs_[0] = value; 1140 inputs_[0] = value;
1153 } 1141 }
1154 1142
1155 LOperand* value() { return inputs_[0]; } 1143 LOperand* value() { return inputs_[0]; }
1156 1144
1157 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, 1145 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1158 "has-cached-array-index-and-branch") 1146 "has-cached-array-index-and-branch")
1159 1147
1160 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1148 void PrintDataTo(StringStream* stream) OVERRIDE;
1161 }; 1149 };
1162 1150
1163 1151
1164 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 1> { 1152 class LIsConstructCallAndBranch FINAL : public LControlInstruction<0, 1> {
1165 public: 1153 public:
1166 explicit LIsConstructCallAndBranch(LOperand* temp) { 1154 explicit LIsConstructCallAndBranch(LOperand* temp) {
1167 temps_[0] = temp; 1155 temps_[0] = temp;
1168 } 1156 }
1169 1157
1170 LOperand* temp() { return temps_[0]; } 1158 LOperand* temp() { return temps_[0]; }
(...skipping 12 matching lines...) Expand all
1183 } 1171 }
1184 1172
1185 LOperand* value() { return inputs_[0]; } 1173 LOperand* value() { return inputs_[0]; }
1186 LOperand* temp() { return temps_[0]; } 1174 LOperand* temp() { return temps_[0]; }
1187 LOperand* temp2() { return temps_[1]; } 1175 LOperand* temp2() { return temps_[1]; }
1188 1176
1189 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, 1177 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
1190 "class-of-test-and-branch") 1178 "class-of-test-and-branch")
1191 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) 1179 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
1192 1180
1193 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1181 void PrintDataTo(StringStream* stream) OVERRIDE;
1194 }; 1182 };
1195 1183
1196 1184
1197 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> { 1185 class LCmpT FINAL : public LTemplateInstruction<1, 3, 0> {
1198 public: 1186 public:
1199 LCmpT(LOperand* context, LOperand* left, LOperand* right) { 1187 LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1200 inputs_[0] = context; 1188 inputs_[0] = context;
1201 inputs_[1] = left; 1189 inputs_[1] = left;
1202 inputs_[2] = right; 1190 inputs_[2] = right;
1203 } 1191 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1384 inputs_[0] = value; 1372 inputs_[0] = value;
1385 temps_[0] = temp; 1373 temps_[0] = temp;
1386 } 1374 }
1387 1375
1388 LOperand* value() { return inputs_[0]; } 1376 LOperand* value() { return inputs_[0]; }
1389 LOperand* temp() { return temps_[0]; } 1377 LOperand* temp() { return temps_[0]; }
1390 1378
1391 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1379 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1392 DECLARE_HYDROGEN_ACCESSOR(Branch) 1380 DECLARE_HYDROGEN_ACCESSOR(Branch)
1393 1381
1394 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1382 void PrintDataTo(StringStream* stream) OVERRIDE;
1395 }; 1383 };
1396 1384
1397 1385
1398 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 0> { 1386 class LCmpMapAndBranch FINAL : public LControlInstruction<1, 0> {
1399 public: 1387 public:
1400 explicit LCmpMapAndBranch(LOperand* value) { 1388 explicit LCmpMapAndBranch(LOperand* value) {
1401 inputs_[0] = value; 1389 inputs_[0] = value;
1402 } 1390 }
1403 1391
1404 LOperand* value() { return inputs_[0]; } 1392 LOperand* value() { return inputs_[0]; }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1535 : op_(op) { 1523 : op_(op) {
1536 inputs_[0] = left; 1524 inputs_[0] = left;
1537 inputs_[1] = right; 1525 inputs_[1] = right;
1538 } 1526 }
1539 1527
1540 LOperand* left() { return inputs_[0]; } 1528 LOperand* left() { return inputs_[0]; }
1541 LOperand* right() { return inputs_[1]; } 1529 LOperand* right() { return inputs_[1]; }
1542 1530
1543 Token::Value op() const { return op_; } 1531 Token::Value op() const { return op_; }
1544 1532
1545 virtual Opcode opcode() const OVERRIDE { 1533 Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticD; }
1546 return LInstruction::kArithmeticD; 1534 void CompileToNative(LCodeGen* generator) OVERRIDE;
1547 } 1535 const char* Mnemonic() const OVERRIDE;
1548 virtual void CompileToNative(LCodeGen* generator) OVERRIDE;
1549 virtual const char* Mnemonic() const OVERRIDE;
1550 1536
1551 private: 1537 private:
1552 Token::Value op_; 1538 Token::Value op_;
1553 }; 1539 };
1554 1540
1555 1541
1556 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> { 1542 class LArithmeticT FINAL : public LTemplateInstruction<1, 3, 0> {
1557 public: 1543 public:
1558 LArithmeticT(Token::Value op, 1544 LArithmeticT(Token::Value op,
1559 LOperand* context, 1545 LOperand* context,
1560 LOperand* left, 1546 LOperand* left,
1561 LOperand* right) 1547 LOperand* right)
1562 : op_(op) { 1548 : op_(op) {
1563 inputs_[0] = context; 1549 inputs_[0] = context;
1564 inputs_[1] = left; 1550 inputs_[1] = left;
1565 inputs_[2] = right; 1551 inputs_[2] = right;
1566 } 1552 }
1567 1553
1568 LOperand* context() { return inputs_[0]; } 1554 LOperand* context() { return inputs_[0]; }
1569 LOperand* left() { return inputs_[1]; } 1555 LOperand* left() { return inputs_[1]; }
1570 LOperand* right() { return inputs_[2]; } 1556 LOperand* right() { return inputs_[2]; }
1571 1557
1572 virtual Opcode opcode() const OVERRIDE { 1558 Opcode opcode() const OVERRIDE { return LInstruction::kArithmeticT; }
1573 return LInstruction::kArithmeticT; 1559 void CompileToNative(LCodeGen* generator) OVERRIDE;
1574 } 1560 const char* Mnemonic() const OVERRIDE;
1575 virtual void CompileToNative(LCodeGen* generator) OVERRIDE;
1576 virtual const char* Mnemonic() const OVERRIDE;
1577 1561
1578 Token::Value op() const { return op_; } 1562 Token::Value op() const { return op_; }
1579 1563
1580 private: 1564 private:
1581 Token::Value op_; 1565 Token::Value op_;
1582 }; 1566 };
1583 1567
1584 1568
1585 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> { 1569 class LReturn FINAL : public LTemplateInstruction<0, 3, 0> {
1586 public: 1570 public:
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 bool is_fixed_typed_array() const { 1663 bool is_fixed_typed_array() const {
1680 return hydrogen()->is_fixed_typed_array(); 1664 return hydrogen()->is_fixed_typed_array();
1681 } 1665 }
1682 bool is_typed_elements() const { 1666 bool is_typed_elements() const {
1683 return is_external() || is_fixed_typed_array(); 1667 return is_external() || is_fixed_typed_array();
1684 } 1668 }
1685 1669
1686 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") 1670 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1687 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) 1671 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1688 1672
1689 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1673 void PrintDataTo(StringStream* stream) OVERRIDE;
1690 uint32_t base_offset() const { return hydrogen()->base_offset(); } 1674 uint32_t base_offset() const { return hydrogen()->base_offset(); }
1691 bool key_is_smi() { 1675 bool key_is_smi() {
1692 return hydrogen()->key()->representation().IsTagged(); 1676 return hydrogen()->key()->representation().IsTagged();
1693 } 1677 }
1694 }; 1678 };
1695 1679
1696 1680
1697 inline static bool ExternalArrayOpRequiresTemp( 1681 inline static bool ExternalArrayOpRequiresTemp(
1698 Representation key_representation, 1682 Representation key_representation,
1699 ElementsKind elements_kind) { 1683 ElementsKind elements_kind) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
1777 inputs_[0] = context; 1761 inputs_[0] = context;
1778 } 1762 }
1779 1763
1780 LOperand* context() { return inputs_[0]; } 1764 LOperand* context() { return inputs_[0]; }
1781 1765
1782 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1766 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1783 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1767 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1784 1768
1785 int slot_index() { return hydrogen()->slot_index(); } 1769 int slot_index() { return hydrogen()->slot_index(); }
1786 1770
1787 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1771 void PrintDataTo(StringStream* stream) OVERRIDE;
1788 }; 1772 };
1789 1773
1790 1774
1791 class LStoreContextSlot FINAL : public LTemplateInstruction<0, 2, 1> { 1775 class LStoreContextSlot FINAL : public LTemplateInstruction<0, 2, 1> {
1792 public: 1776 public:
1793 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) { 1777 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1794 inputs_[0] = context; 1778 inputs_[0] = context;
1795 inputs_[1] = value; 1779 inputs_[1] = value;
1796 temps_[0] = temp; 1780 temps_[0] = temp;
1797 } 1781 }
1798 1782
1799 LOperand* context() { return inputs_[0]; } 1783 LOperand* context() { return inputs_[0]; }
1800 LOperand* value() { return inputs_[1]; } 1784 LOperand* value() { return inputs_[1]; }
1801 LOperand* temp() { return temps_[0]; } 1785 LOperand* temp() { return temps_[0]; }
1802 1786
1803 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") 1787 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1804 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) 1788 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1805 1789
1806 int slot_index() { return hydrogen()->slot_index(); } 1790 int slot_index() { return hydrogen()->slot_index(); }
1807 1791
1808 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1792 void PrintDataTo(StringStream* stream) OVERRIDE;
1809 }; 1793 };
1810 1794
1811 1795
1812 class LPushArgument FINAL : public LTemplateInstruction<0, 1, 0> { 1796 class LPushArgument FINAL : public LTemplateInstruction<0, 1, 0> {
1813 public: 1797 public:
1814 explicit LPushArgument(LOperand* value) { 1798 explicit LPushArgument(LOperand* value) {
1815 inputs_[0] = value; 1799 inputs_[0] = value;
1816 } 1800 }
1817 1801
1818 LOperand* value() { return inputs_[0]; } 1802 LOperand* value() { return inputs_[0]; }
(...skipping 18 matching lines...) Expand all
1837 class LStoreCodeEntry FINAL: public LTemplateInstruction<0, 2, 0> { 1821 class LStoreCodeEntry FINAL: public LTemplateInstruction<0, 2, 0> {
1838 public: 1822 public:
1839 LStoreCodeEntry(LOperand* function, LOperand* code_object) { 1823 LStoreCodeEntry(LOperand* function, LOperand* code_object) {
1840 inputs_[0] = function; 1824 inputs_[0] = function;
1841 inputs_[1] = code_object; 1825 inputs_[1] = code_object;
1842 } 1826 }
1843 1827
1844 LOperand* function() { return inputs_[0]; } 1828 LOperand* function() { return inputs_[0]; }
1845 LOperand* code_object() { return inputs_[1]; } 1829 LOperand* code_object() { return inputs_[1]; }
1846 1830
1847 virtual void PrintDataTo(StringStream* stream); 1831 void PrintDataTo(StringStream* stream) OVERRIDE;
1848 1832
1849 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") 1833 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
1850 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) 1834 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
1851 }; 1835 };
1852 1836
1853 1837
1854 class LInnerAllocatedObject FINAL: public LTemplateInstruction<1, 2, 0> { 1838 class LInnerAllocatedObject FINAL: public LTemplateInstruction<1, 2, 0> {
1855 public: 1839 public:
1856 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { 1840 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1857 inputs_[0] = base_object; 1841 inputs_[0] = base_object;
1858 inputs_[1] = offset; 1842 inputs_[1] = offset;
1859 } 1843 }
1860 1844
1861 LOperand* base_object() const { return inputs_[0]; } 1845 LOperand* base_object() const { return inputs_[0]; }
1862 LOperand* offset() const { return inputs_[1]; } 1846 LOperand* offset() const { return inputs_[1]; }
1863 1847
1864 virtual void PrintDataTo(StringStream* stream); 1848 void PrintDataTo(StringStream* stream) OVERRIDE;
1865 1849
1866 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object") 1850 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1867 }; 1851 };
1868 1852
1869 1853
1870 class LThisFunction FINAL : public LTemplateInstruction<1, 0, 0> { 1854 class LThisFunction FINAL : public LTemplateInstruction<1, 0, 0> {
1871 public: 1855 public:
1872 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") 1856 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1873 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) 1857 DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1874 }; 1858 };
(...skipping 23 matching lines...) Expand all
1898 public: 1882 public:
1899 explicit LCallJSFunction(LOperand* function) { 1883 explicit LCallJSFunction(LOperand* function) {
1900 inputs_[0] = function; 1884 inputs_[0] = function;
1901 } 1885 }
1902 1886
1903 LOperand* function() { return inputs_[0]; } 1887 LOperand* function() { return inputs_[0]; }
1904 1888
1905 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function") 1889 DECLARE_CONCRETE_INSTRUCTION(CallJSFunction, "call-js-function")
1906 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction) 1890 DECLARE_HYDROGEN_ACCESSOR(CallJSFunction)
1907 1891
1908 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1892 void PrintDataTo(StringStream* stream) OVERRIDE;
1909 1893
1910 int arity() const { return hydrogen()->argument_count() - 1; } 1894 int arity() const { return hydrogen()->argument_count() - 1; }
1911 }; 1895 };
1912 1896
1913 1897
1914 class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> { 1898 class LCallWithDescriptor FINAL : public LTemplateResultInstruction<1> {
1915 public: 1899 public:
1916 LCallWithDescriptor(CallInterfaceDescriptor descriptor, 1900 LCallWithDescriptor(CallInterfaceDescriptor descriptor,
1917 const ZoneList<LOperand*>& operands, Zone* zone) 1901 const ZoneList<LOperand*>& operands, Zone* zone)
1918 : inputs_(descriptor.GetRegisterParameterCount() + 1, zone) { 1902 : inputs_(descriptor.GetRegisterParameterCount() + 1, zone) {
1919 DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length()); 1903 DCHECK(descriptor.GetRegisterParameterCount() + 1 == operands.length());
1920 inputs_.AddAll(operands, zone); 1904 inputs_.AddAll(operands, zone);
1921 } 1905 }
1922 1906
1923 LOperand* target() const { return inputs_[0]; } 1907 LOperand* target() const { return inputs_[0]; }
1924 1908
1925 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor) 1909 DECLARE_HYDROGEN_ACCESSOR(CallWithDescriptor)
1926 1910
1927 private: 1911 private:
1928 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor") 1912 DECLARE_CONCRETE_INSTRUCTION(CallWithDescriptor, "call-with-descriptor")
1929 1913
1930 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1914 void PrintDataTo(StringStream* stream) OVERRIDE;
1931 1915
1932 int arity() const { return hydrogen()->argument_count() - 1; } 1916 int arity() const { return hydrogen()->argument_count() - 1; }
1933 1917
1934 ZoneList<LOperand*> inputs_; 1918 ZoneList<LOperand*> inputs_;
1935 1919
1936 // Iterator support. 1920 // Iterator support.
1937 virtual int InputCount() FINAL OVERRIDE { return inputs_.length(); } 1921 int InputCount() FINAL { return inputs_.length(); }
1938 virtual LOperand* InputAt(int i) FINAL OVERRIDE { return inputs_[i]; } 1922 LOperand* InputAt(int i) FINAL { return inputs_[i]; }
1939 1923
1940 virtual int TempCount() FINAL OVERRIDE { return 0; } 1924 int TempCount() FINAL { return 0; }
1941 virtual LOperand* TempAt(int i) FINAL OVERRIDE { return NULL; } 1925 LOperand* TempAt(int i) FINAL { return NULL; }
1942 }; 1926 };
1943 1927
1944 1928
1945 class LInvokeFunction FINAL : public LTemplateInstruction<1, 2, 0> { 1929 class LInvokeFunction FINAL : public LTemplateInstruction<1, 2, 0> {
1946 public: 1930 public:
1947 LInvokeFunction(LOperand* context, LOperand* function) { 1931 LInvokeFunction(LOperand* context, LOperand* function) {
1948 inputs_[0] = context; 1932 inputs_[0] = context;
1949 inputs_[1] = function; 1933 inputs_[1] = function;
1950 } 1934 }
1951 1935
1952 LOperand* context() { return inputs_[0]; } 1936 LOperand* context() { return inputs_[0]; }
1953 LOperand* function() { return inputs_[1]; } 1937 LOperand* function() { return inputs_[1]; }
1954 1938
1955 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") 1939 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1956 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) 1940 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1957 1941
1958 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1942 void PrintDataTo(StringStream* stream) OVERRIDE;
1959 1943
1960 int arity() const { return hydrogen()->argument_count() - 1; } 1944 int arity() const { return hydrogen()->argument_count() - 1; }
1961 }; 1945 };
1962 1946
1963 1947
1964 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 0> { 1948 class LCallFunction FINAL : public LTemplateInstruction<1, 2, 0> {
1965 public: 1949 public:
1966 explicit LCallFunction(LOperand* context, LOperand* function) { 1950 explicit LCallFunction(LOperand* context, LOperand* function) {
1967 inputs_[0] = context; 1951 inputs_[0] = context;
1968 inputs_[1] = function; 1952 inputs_[1] = function;
(...skipping 15 matching lines...) Expand all
1984 inputs_[0] = context; 1968 inputs_[0] = context;
1985 inputs_[1] = constructor; 1969 inputs_[1] = constructor;
1986 } 1970 }
1987 1971
1988 LOperand* context() { return inputs_[0]; } 1972 LOperand* context() { return inputs_[0]; }
1989 LOperand* constructor() { return inputs_[1]; } 1973 LOperand* constructor() { return inputs_[1]; }
1990 1974
1991 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") 1975 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1992 DECLARE_HYDROGEN_ACCESSOR(CallNew) 1976 DECLARE_HYDROGEN_ACCESSOR(CallNew)
1993 1977
1994 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1978 void PrintDataTo(StringStream* stream) OVERRIDE;
1995 1979
1996 int arity() const { return hydrogen()->argument_count() - 1; } 1980 int arity() const { return hydrogen()->argument_count() - 1; }
1997 }; 1981 };
1998 1982
1999 1983
2000 class LCallNewArray FINAL : public LTemplateInstruction<1, 2, 0> { 1984 class LCallNewArray FINAL : public LTemplateInstruction<1, 2, 0> {
2001 public: 1985 public:
2002 LCallNewArray(LOperand* context, LOperand* constructor) { 1986 LCallNewArray(LOperand* context, LOperand* constructor) {
2003 inputs_[0] = context; 1987 inputs_[0] = context;
2004 inputs_[1] = constructor; 1988 inputs_[1] = constructor;
2005 } 1989 }
2006 1990
2007 LOperand* context() { return inputs_[0]; } 1991 LOperand* context() { return inputs_[0]; }
2008 LOperand* constructor() { return inputs_[1]; } 1992 LOperand* constructor() { return inputs_[1]; }
2009 1993
2010 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array") 1994 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
2011 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) 1995 DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
2012 1996
2013 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 1997 void PrintDataTo(StringStream* stream) OVERRIDE;
2014 1998
2015 int arity() const { return hydrogen()->argument_count() - 1; } 1999 int arity() const { return hydrogen()->argument_count() - 1; }
2016 }; 2000 };
2017 2001
2018 2002
2019 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> { 2003 class LCallRuntime FINAL : public LTemplateInstruction<1, 1, 0> {
2020 public: 2004 public:
2021 explicit LCallRuntime(LOperand* context) { 2005 explicit LCallRuntime(LOperand* context) {
2022 inputs_[0] = context; 2006 inputs_[0] = context;
2023 } 2007 }
2024 2008
2025 LOperand* context() { return inputs_[0]; } 2009 LOperand* context() { return inputs_[0]; }
2026 2010
2027 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") 2011 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
2028 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) 2012 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
2029 2013
2030 virtual bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE { 2014 bool ClobbersDoubleRegisters(Isolate* isolate) const OVERRIDE {
2031 return save_doubles() == kDontSaveFPRegs; 2015 return save_doubles() == kDontSaveFPRegs;
2032 } 2016 }
2033 2017
2034 const Runtime::Function* function() const { return hydrogen()->function(); } 2018 const Runtime::Function* function() const { return hydrogen()->function(); }
2035 int arity() const { return hydrogen()->argument_count(); } 2019 int arity() const { return hydrogen()->argument_count(); }
2036 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } 2020 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
2037 }; 2021 };
2038 2022
2039 2023
2040 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> { 2024 class LInteger32ToDouble FINAL : public LTemplateInstruction<1, 1, 0> {
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
2212 } 2196 }
2213 2197
2214 LOperand* object() { return inputs_[0]; } 2198 LOperand* object() { return inputs_[0]; }
2215 LOperand* value() { return inputs_[1]; } 2199 LOperand* value() { return inputs_[1]; }
2216 LOperand* temp() { return temps_[0]; } 2200 LOperand* temp() { return temps_[0]; }
2217 LOperand* temp_map() { return temps_[1]; } 2201 LOperand* temp_map() { return temps_[1]; }
2218 2202
2219 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 2203 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
2220 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 2204 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
2221 2205
2222 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2206 void PrintDataTo(StringStream* stream) OVERRIDE;
2223 }; 2207 };
2224 2208
2225 2209
2226 class LStoreNamedGeneric FINAL : public LTemplateInstruction<0, 3, 0> { 2210 class LStoreNamedGeneric FINAL : public LTemplateInstruction<0, 3, 0> {
2227 public: 2211 public:
2228 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) { 2212 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
2229 inputs_[0] = context; 2213 inputs_[0] = context;
2230 inputs_[1] = object; 2214 inputs_[1] = object;
2231 inputs_[2] = value; 2215 inputs_[2] = value;
2232 } 2216 }
2233 2217
2234 LOperand* context() { return inputs_[0]; } 2218 LOperand* context() { return inputs_[0]; }
2235 LOperand* object() { return inputs_[1]; } 2219 LOperand* object() { return inputs_[1]; }
2236 LOperand* value() { return inputs_[2]; } 2220 LOperand* value() { return inputs_[2]; }
2237 2221
2238 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 2222 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
2239 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 2223 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
2240 2224
2241 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2225 void PrintDataTo(StringStream* stream) OVERRIDE;
2242 Handle<Object> name() const { return hydrogen()->name(); } 2226 Handle<Object> name() const { return hydrogen()->name(); }
2243 StrictMode strict_mode() { return hydrogen()->strict_mode(); } 2227 StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2244 }; 2228 };
2245 2229
2246 2230
2247 class LStoreKeyed FINAL : public LTemplateInstruction<0, 3, 0> { 2231 class LStoreKeyed FINAL : public LTemplateInstruction<0, 3, 0> {
2248 public: 2232 public:
2249 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) { 2233 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
2250 inputs_[0] = obj; 2234 inputs_[0] = obj;
2251 inputs_[1] = key; 2235 inputs_[1] = key;
(...skipping 10 matching lines...) Expand all
2262 LOperand* elements() { return inputs_[0]; } 2246 LOperand* elements() { return inputs_[0]; }
2263 LOperand* key() { return inputs_[1]; } 2247 LOperand* key() { return inputs_[1]; }
2264 LOperand* value() { return inputs_[2]; } 2248 LOperand* value() { return inputs_[2]; }
2265 ElementsKind elements_kind() const { 2249 ElementsKind elements_kind() const {
2266 return hydrogen()->elements_kind(); 2250 return hydrogen()->elements_kind();
2267 } 2251 }
2268 2252
2269 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed") 2253 DECLARE_CONCRETE_INSTRUCTION(StoreKeyed, "store-keyed")
2270 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed) 2254 DECLARE_HYDROGEN_ACCESSOR(StoreKeyed)
2271 2255
2272 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2256 void PrintDataTo(StringStream* stream) OVERRIDE;
2273 uint32_t base_offset() const { return hydrogen()->base_offset(); } 2257 uint32_t base_offset() const { return hydrogen()->base_offset(); }
2274 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } 2258 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
2275 }; 2259 };
2276 2260
2277 2261
2278 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> { 2262 class LStoreKeyedGeneric FINAL : public LTemplateInstruction<0, 4, 0> {
2279 public: 2263 public:
2280 LStoreKeyedGeneric(LOperand* context, 2264 LStoreKeyedGeneric(LOperand* context,
2281 LOperand* object, 2265 LOperand* object,
2282 LOperand* key, 2266 LOperand* key,
2283 LOperand* value) { 2267 LOperand* value) {
2284 inputs_[0] = context; 2268 inputs_[0] = context;
2285 inputs_[1] = object; 2269 inputs_[1] = object;
2286 inputs_[2] = key; 2270 inputs_[2] = key;
2287 inputs_[3] = value; 2271 inputs_[3] = value;
2288 } 2272 }
2289 2273
2290 LOperand* context() { return inputs_[0]; } 2274 LOperand* context() { return inputs_[0]; }
2291 LOperand* object() { return inputs_[1]; } 2275 LOperand* object() { return inputs_[1]; }
2292 LOperand* key() { return inputs_[2]; } 2276 LOperand* key() { return inputs_[2]; }
2293 LOperand* value() { return inputs_[3]; } 2277 LOperand* value() { return inputs_[3]; }
2294 2278
2295 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 2279 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2296 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) 2280 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2297 2281
2298 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2282 void PrintDataTo(StringStream* stream) OVERRIDE;
2299 2283
2300 StrictMode strict_mode() { return hydrogen()->strict_mode(); } 2284 StrictMode strict_mode() { return hydrogen()->strict_mode(); }
2301 }; 2285 };
2302 2286
2303 2287
2304 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 2> { 2288 class LTransitionElementsKind FINAL : public LTemplateInstruction<0, 2, 2> {
2305 public: 2289 public:
2306 LTransitionElementsKind(LOperand* object, 2290 LTransitionElementsKind(LOperand* object,
2307 LOperand* context, 2291 LOperand* context,
2308 LOperand* new_map_temp, 2292 LOperand* new_map_temp,
2309 LOperand* temp) { 2293 LOperand* temp) {
2310 inputs_[0] = object; 2294 inputs_[0] = object;
2311 inputs_[1] = context; 2295 inputs_[1] = context;
2312 temps_[0] = new_map_temp; 2296 temps_[0] = new_map_temp;
2313 temps_[1] = temp; 2297 temps_[1] = temp;
2314 } 2298 }
2315 2299
2316 LOperand* context() { return inputs_[1]; } 2300 LOperand* context() { return inputs_[1]; }
2317 LOperand* object() { return inputs_[0]; } 2301 LOperand* object() { return inputs_[0]; }
2318 LOperand* new_map_temp() { return temps_[0]; } 2302 LOperand* new_map_temp() { return temps_[0]; }
2319 LOperand* temp() { return temps_[1]; } 2303 LOperand* temp() { return temps_[1]; }
2320 2304
2321 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, 2305 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2322 "transition-elements-kind") 2306 "transition-elements-kind")
2323 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) 2307 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2324 2308
2325 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2309 void PrintDataTo(StringStream* stream) OVERRIDE;
2326 2310
2327 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } 2311 Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2328 Handle<Map> transitioned_map() { 2312 Handle<Map> transitioned_map() {
2329 return hydrogen()->transitioned_map().handle(); 2313 return hydrogen()->transitioned_map().handle();
2330 } 2314 }
2331 ElementsKind from_kind() { return hydrogen()->from_kind(); } 2315 ElementsKind from_kind() { return hydrogen()->from_kind(); }
2332 ElementsKind to_kind() { return hydrogen()->to_kind(); } 2316 ElementsKind to_kind() { return hydrogen()->to_kind(); }
2333 }; 2317 };
2334 2318
2335 2319
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
2605 inputs_[0] = value; 2589 inputs_[0] = value;
2606 } 2590 }
2607 2591
2608 LOperand* value() { return inputs_[0]; } 2592 LOperand* value() { return inputs_[0]; }
2609 2593
2610 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") 2594 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2611 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) 2595 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2612 2596
2613 Handle<String> type_literal() { return hydrogen()->type_literal(); } 2597 Handle<String> type_literal() { return hydrogen()->type_literal(); }
2614 2598
2615 virtual void PrintDataTo(StringStream* stream) OVERRIDE; 2599 void PrintDataTo(StringStream* stream) OVERRIDE;
2616 }; 2600 };
2617 2601
2618 2602
2619 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> { 2603 class LOsrEntry FINAL : public LTemplateInstruction<0, 0, 0> {
2620 public: 2604 public:
2621 virtual bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { 2605 bool HasInterestingComment(LCodeGen* gen) const OVERRIDE { return false; }
2622 return false;
2623 }
2624 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 2606 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2625 }; 2607 };
2626 2608
2627 2609
2628 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> { 2610 class LStackCheck FINAL : public LTemplateInstruction<0, 1, 0> {
2629 public: 2611 public:
2630 explicit LStackCheck(LOperand* context) { 2612 explicit LStackCheck(LOperand* context) {
2631 inputs_[0] = context; 2613 inputs_[0] = context;
2632 } 2614 }
2633 2615
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2822 2804
2823 // An input operand in a register or a constant operand. 2805 // An input operand in a register or a constant operand.
2824 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); 2806 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2825 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); 2807 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2826 2808
2827 // An input operand in a constant operand. 2809 // An input operand in a constant operand.
2828 MUST_USE_RESULT LOperand* UseConstant(HValue* value); 2810 MUST_USE_RESULT LOperand* UseConstant(HValue* value);
2829 2811
2830 // An input operand in register, stack slot or a constant operand. 2812 // An input operand in register, stack slot or a constant operand.
2831 // Will not be moved to a register even if one is freely available. 2813 // Will not be moved to a register even if one is freely available.
2832 virtual MUST_USE_RESULT LOperand* UseAny(HValue* value) OVERRIDE; 2814 MUST_USE_RESULT LOperand* UseAny(HValue* value) OVERRIDE;
2833 2815
2834 // Temporary operand that must be in a register. 2816 // Temporary operand that must be in a register.
2835 MUST_USE_RESULT LUnallocated* TempRegister(); 2817 MUST_USE_RESULT LUnallocated* TempRegister();
2836 MUST_USE_RESULT LOperand* FixedTemp(Register reg); 2818 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2837 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); 2819 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2838 2820
2839 // Methods for setting up define-use relationships. 2821 // Methods for setting up define-use relationships.
2840 // Return the same instruction that they are passed. 2822 // Return the same instruction that they are passed.
2841 LInstruction* Define(LTemplateResultInstruction<1>* instr, 2823 LInstruction* Define(LTemplateResultInstruction<1>* instr,
2842 LUnallocated* result); 2824 LUnallocated* result);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2886 2868
2887 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2869 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2888 }; 2870 };
2889 2871
2890 #undef DECLARE_HYDROGEN_ACCESSOR 2872 #undef DECLARE_HYDROGEN_ACCESSOR
2891 #undef DECLARE_CONCRETE_INSTRUCTION 2873 #undef DECLARE_CONCRETE_INSTRUCTION
2892 2874
2893 } } // namespace v8::internal 2875 } } // namespace v8::internal
2894 2876
2895 #endif // V8_IA32_LITHIUM_IA32_H_ 2877 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-codegen-ia32.cc ('k') | src/ic/ic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698