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

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

Issue 14371005: Various improvements regarding the way we print code code comments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 273
274 // Interface to the register allocator and iterators. 274 // Interface to the register allocator and iterators.
275 bool IsMarkedAsCall() const { return is_call_; } 275 bool IsMarkedAsCall() const { return is_call_; }
276 276
277 virtual bool HasResult() const = 0; 277 virtual bool HasResult() const = 0;
278 virtual LOperand* result() = 0; 278 virtual LOperand* result() = 0;
279 279
280 LOperand* FirstInput() { return InputAt(0); } 280 LOperand* FirstInput() { return InputAt(0); }
281 LOperand* Output() { return HasResult() ? result() : NULL; } 281 LOperand* Output() { return HasResult() ? result() : NULL; }
282 282
283 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; }
284
283 #ifdef DEBUG 285 #ifdef DEBUG
284 void VerifyCall(); 286 void VerifyCall();
285 #endif 287 #endif
286 288
287 private: 289 private:
288 // Iterator support. 290 // Iterator support.
289 friend class InputIterator; 291 friend class InputIterator;
290 virtual int InputCount() = 0; 292 virtual int InputCount() = 0;
291 virtual LOperand* InputAt(int i) = 0; 293 virtual LOperand* InputAt(int i) = 0;
292 294
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 private: 376 private:
375 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 377 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
376 HBasicBlock* block_; 378 HBasicBlock* block_;
377 }; 379 };
378 380
379 381
380 class LInstructionGap: public LGap { 382 class LInstructionGap: public LGap {
381 public: 383 public:
382 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } 384 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { }
383 385
386 virtual bool HasInterestingComment(LCodeGen* gen) const {
387 return !IsRedundant();
388 }
389
384 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") 390 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
385 }; 391 };
386 392
387 393
388 class LGoto: public LTemplateInstruction<0, 0, 0> { 394 class LGoto: public LTemplateInstruction<0, 0, 0> {
389 public: 395 public:
390 explicit LGoto(int block_id) : block_id_(block_id) { } 396 explicit LGoto(int block_id) : block_id_(block_id) { }
391 397
398 virtual bool HasInterestingComment(LCodeGen* gen) const;
392 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") 399 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
393 virtual void PrintDataTo(StringStream* stream); 400 virtual void PrintDataTo(StringStream* stream);
394 virtual bool IsControl() const { return true; } 401 virtual bool IsControl() const { return true; }
395 402
396 int block_id() const { return block_id_; } 403 int block_id() const { return block_id_; }
397 404
398 private: 405 private:
399 int block_id_; 406 int block_id_;
400 }; 407 };
401 408
402 409
403 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { 410 class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
404 public: 411 public:
405 LLazyBailout() : gap_instructions_size_(0) { } 412 LLazyBailout() : gap_instructions_size_(0) { }
406 413
414 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
407 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") 415 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
408 416
409 void set_gap_instructions_size(int gap_instructions_size) { 417 void set_gap_instructions_size(int gap_instructions_size) {
410 gap_instructions_size_ = gap_instructions_size; 418 gap_instructions_size_ = gap_instructions_size;
411 } 419 }
412 int gap_instructions_size() { return gap_instructions_size_; } 420 int gap_instructions_size() { return gap_instructions_size_; }
413 421
414 private: 422 private:
415 int gap_instructions_size_; 423 int gap_instructions_size_;
416 }; 424 };
(...skipping 12 matching lines...) Expand all
429 public: 437 public:
430 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") 438 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
431 }; 439 };
432 440
433 441
434 class LLabel: public LGap { 442 class LLabel: public LGap {
435 public: 443 public:
436 explicit LLabel(HBasicBlock* block) 444 explicit LLabel(HBasicBlock* block)
437 : LGap(block), replacement_(NULL) { } 445 : LGap(block), replacement_(NULL) { }
438 446
447 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
439 DECLARE_CONCRETE_INSTRUCTION(Label, "label") 448 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
440 449
441 virtual void PrintDataTo(StringStream* stream); 450 virtual void PrintDataTo(StringStream* stream);
442 451
443 int block_id() const { return block()->block_id(); } 452 int block_id() const { return block()->block_id(); }
444 bool is_loop_header() const { return block()->IsLoopHeader(); } 453 bool is_loop_header() const { return block()->IsLoopHeader(); }
454 bool is_osr_entry() const { return block()->is_osr_entry(); }
445 Label* label() { return &label_; } 455 Label* label() { return &label_; }
446 LLabel* replacement() const { return replacement_; } 456 LLabel* replacement() const { return replacement_; }
447 void set_replacement(LLabel* label) { replacement_ = label; } 457 void set_replacement(LLabel* label) { replacement_ = label; }
448 bool HasReplacement() const { return replacement_ != NULL; } 458 bool HasReplacement() const { return replacement_ != NULL; }
449 459
450 private: 460 private:
451 Label label_; 461 Label label_;
452 LLabel* replacement_; 462 LLabel* replacement_;
453 }; 463 };
454 464
455 465
456 class LParameter: public LTemplateInstruction<1, 0, 0> { 466 class LParameter: public LTemplateInstruction<1, 0, 0> {
457 public: 467 public:
468 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
458 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 469 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
459 }; 470 };
460 471
461 472
462 class LCallStub: public LTemplateInstruction<1, 0, 0> { 473 class LCallStub: public LTemplateInstruction<1, 0, 0> {
463 public: 474 public:
464 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") 475 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
465 DECLARE_HYDROGEN_ACCESSOR(CallStub) 476 DECLARE_HYDROGEN_ACCESSOR(CallStub)
466 477
467 TranscendentalCache::Type transcendental_type() { 478 TranscendentalCache::Type transcendental_type() {
468 return hydrogen()->transcendental_type(); 479 return hydrogen()->transcendental_type();
469 } 480 }
470 }; 481 };
471 482
472 483
473 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { 484 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
474 public: 485 public:
486 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
475 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 487 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
476 }; 488 };
477 489
478 490
479 template<int I, int T> 491 template<int I, int T>
480 class LControlInstruction: public LTemplateInstruction<0, I, T> { 492 class LControlInstruction: public LTemplateInstruction<0, I, T> {
481 public: 493 public:
482 virtual bool IsControl() const { return true; } 494 virtual bool IsControl() const { return true; }
483 495
484 int SuccessorCount() { return hydrogen()->SuccessorCount(); } 496 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2464 LOperand* key() { return inputs_[1]; } 2476 LOperand* key() { return inputs_[1]; }
2465 2477
2466 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") 2478 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2467 }; 2479 };
2468 2480
2469 2481
2470 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { 2482 class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2471 public: 2483 public:
2472 LOsrEntry(); 2484 LOsrEntry();
2473 2485
2486 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
2474 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 2487 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2475 2488
2476 LOperand** SpilledRegisterArray() { return register_spills_; } 2489 LOperand** SpilledRegisterArray() { return register_spills_; }
2477 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } 2490 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
2478 2491
2479 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); 2492 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
2480 void MarkSpilledDoubleRegister(int allocation_index, 2493 void MarkSpilledDoubleRegister(int allocation_index,
2481 LOperand* spill_operand); 2494 LOperand* spill_operand);
2482 2495
2483 private: 2496 private:
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2737 2750
2738 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2751 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2739 }; 2752 };
2740 2753
2741 #undef DECLARE_HYDROGEN_ACCESSOR 2754 #undef DECLARE_HYDROGEN_ACCESSOR
2742 #undef DECLARE_CONCRETE_INSTRUCTION 2755 #undef DECLARE_CONCRETE_INSTRUCTION
2743 2756
2744 } } // namespace v8::int 2757 } } // namespace v8::int
2745 2758
2746 #endif // V8_X64_LITHIUM_X64_H_ 2759 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698