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

Side by Side Diff: src/lithium.h

Issue 23064017: Use V8_FINAL and V8_OVERRIDE in various places, fixing bugs revealed by them. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use V8_FINAL and V8_OVERRIDE instead. Created 7 years, 4 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
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.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 // 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 } 264 }
265 265
266 // [lifetime]: Only for non-FIXED_SLOT. 266 // [lifetime]: Only for non-FIXED_SLOT.
267 bool IsUsedAtStart() { 267 bool IsUsedAtStart() {
268 ASSERT(basic_policy() == EXTENDED_POLICY); 268 ASSERT(basic_policy() == EXTENDED_POLICY);
269 return LifetimeField::decode(value_) == USED_AT_START; 269 return LifetimeField::decode(value_) == USED_AT_START;
270 } 270 }
271 }; 271 };
272 272
273 273
274 class LMoveOperands FINAL BASE_EMBEDDED { 274 class LMoveOperands V8_FINAL BASE_EMBEDDED {
275 public: 275 public:
276 LMoveOperands(LOperand* source, LOperand* destination) 276 LMoveOperands(LOperand* source, LOperand* destination)
277 : source_(source), destination_(destination) { 277 : source_(source), destination_(destination) {
278 } 278 }
279 279
280 LOperand* source() const { return source_; } 280 LOperand* source() const { return source_; }
281 void set_source(LOperand* operand) { source_ = operand; } 281 void set_source(LOperand* operand) { source_ = operand; }
282 282
283 LOperand* destination() const { return destination_; } 283 LOperand* destination() const { return destination_; }
284 void set_destination(LOperand* operand) { destination_ = operand; } 284 void set_destination(LOperand* operand) { destination_ = operand; }
(...skipping 25 matching lines...) Expand all
310 ASSERT(source_ != NULL || destination_ == NULL); 310 ASSERT(source_ != NULL || destination_ == NULL);
311 return source_ == NULL; 311 return source_ == NULL;
312 } 312 }
313 313
314 private: 314 private:
315 LOperand* source_; 315 LOperand* source_;
316 LOperand* destination_; 316 LOperand* destination_;
317 }; 317 };
318 318
319 319
320 class LConstantOperand FINAL : public LOperand { 320 class LConstantOperand V8_FINAL : public LOperand {
321 public: 321 public:
322 static LConstantOperand* Create(int index, Zone* zone) { 322 static LConstantOperand* Create(int index, Zone* zone) {
323 ASSERT(index >= 0); 323 ASSERT(index >= 0);
324 if (index < kNumCachedOperands) return &cache[index]; 324 if (index < kNumCachedOperands) return &cache[index];
325 return new(zone) LConstantOperand(index); 325 return new(zone) LConstantOperand(index);
326 } 326 }
327 327
328 static LConstantOperand* cast(LOperand* op) { 328 static LConstantOperand* cast(LOperand* op) {
329 ASSERT(op->IsConstantOperand()); 329 ASSERT(op->IsConstantOperand());
330 return reinterpret_cast<LConstantOperand*>(op); 330 return reinterpret_cast<LConstantOperand*>(op);
331 } 331 }
332 332
333 static void SetUpCache(); 333 static void SetUpCache();
334 static void TearDownCache(); 334 static void TearDownCache();
335 335
336 private: 336 private:
337 static const int kNumCachedOperands = 128; 337 static const int kNumCachedOperands = 128;
338 static LConstantOperand* cache; 338 static LConstantOperand* cache;
339 339
340 LConstantOperand() : LOperand() { } 340 LConstantOperand() : LOperand() { }
341 explicit LConstantOperand(int index) : LOperand(CONSTANT_OPERAND, index) { } 341 explicit LConstantOperand(int index) : LOperand(CONSTANT_OPERAND, index) { }
342 }; 342 };
343 343
344 344
345 class LArgument FINAL : public LOperand { 345 class LArgument V8_FINAL : public LOperand {
346 public: 346 public:
347 explicit LArgument(int index) : LOperand(ARGUMENT, index) { } 347 explicit LArgument(int index) : LOperand(ARGUMENT, index) { }
348 348
349 static LArgument* cast(LOperand* op) { 349 static LArgument* cast(LOperand* op) {
350 ASSERT(op->IsArgument()); 350 ASSERT(op->IsArgument());
351 return reinterpret_cast<LArgument*>(op); 351 return reinterpret_cast<LArgument*>(op);
352 } 352 }
353 }; 353 };
354 354
355 355
356 class LStackSlot FINAL : public LOperand { 356 class LStackSlot V8_FINAL : public LOperand {
357 public: 357 public:
358 static LStackSlot* Create(int index, Zone* zone) { 358 static LStackSlot* Create(int index, Zone* zone) {
359 ASSERT(index >= 0); 359 ASSERT(index >= 0);
360 if (index < kNumCachedOperands) return &cache[index]; 360 if (index < kNumCachedOperands) return &cache[index];
361 return new(zone) LStackSlot(index); 361 return new(zone) LStackSlot(index);
362 } 362 }
363 363
364 static LStackSlot* cast(LOperand* op) { 364 static LStackSlot* cast(LOperand* op) {
365 ASSERT(op->IsStackSlot()); 365 ASSERT(op->IsStackSlot());
366 return reinterpret_cast<LStackSlot*>(op); 366 return reinterpret_cast<LStackSlot*>(op);
367 } 367 }
368 368
369 static void SetUpCache(); 369 static void SetUpCache();
370 static void TearDownCache(); 370 static void TearDownCache();
371 371
372 private: 372 private:
373 static const int kNumCachedOperands = 128; 373 static const int kNumCachedOperands = 128;
374 static LStackSlot* cache; 374 static LStackSlot* cache;
375 375
376 LStackSlot() : LOperand() { } 376 LStackSlot() : LOperand() { }
377 explicit LStackSlot(int index) : LOperand(STACK_SLOT, index) { } 377 explicit LStackSlot(int index) : LOperand(STACK_SLOT, index) { }
378 }; 378 };
379 379
380 380
381 class LDoubleStackSlot FINAL : public LOperand { 381 class LDoubleStackSlot V8_FINAL : public LOperand {
382 public: 382 public:
383 static LDoubleStackSlot* Create(int index, Zone* zone) { 383 static LDoubleStackSlot* Create(int index, Zone* zone) {
384 ASSERT(index >= 0); 384 ASSERT(index >= 0);
385 if (index < kNumCachedOperands) return &cache[index]; 385 if (index < kNumCachedOperands) return &cache[index];
386 return new(zone) LDoubleStackSlot(index); 386 return new(zone) LDoubleStackSlot(index);
387 } 387 }
388 388
389 static LDoubleStackSlot* cast(LOperand* op) { 389 static LDoubleStackSlot* cast(LOperand* op) {
390 ASSERT(op->IsStackSlot()); 390 ASSERT(op->IsStackSlot());
391 return reinterpret_cast<LDoubleStackSlot*>(op); 391 return reinterpret_cast<LDoubleStackSlot*>(op);
392 } 392 }
393 393
394 static void SetUpCache(); 394 static void SetUpCache();
395 static void TearDownCache(); 395 static void TearDownCache();
396 396
397 private: 397 private:
398 static const int kNumCachedOperands = 128; 398 static const int kNumCachedOperands = 128;
399 static LDoubleStackSlot* cache; 399 static LDoubleStackSlot* cache;
400 400
401 LDoubleStackSlot() : LOperand() { } 401 LDoubleStackSlot() : LOperand() { }
402 explicit LDoubleStackSlot(int index) : LOperand(DOUBLE_STACK_SLOT, index) { } 402 explicit LDoubleStackSlot(int index) : LOperand(DOUBLE_STACK_SLOT, index) { }
403 }; 403 };
404 404
405 405
406 class LRegister FINAL : public LOperand { 406 class LRegister V8_FINAL : public LOperand {
407 public: 407 public:
408 static LRegister* Create(int index, Zone* zone) { 408 static LRegister* Create(int index, Zone* zone) {
409 ASSERT(index >= 0); 409 ASSERT(index >= 0);
410 if (index < kNumCachedOperands) return &cache[index]; 410 if (index < kNumCachedOperands) return &cache[index];
411 return new(zone) LRegister(index); 411 return new(zone) LRegister(index);
412 } 412 }
413 413
414 static LRegister* cast(LOperand* op) { 414 static LRegister* cast(LOperand* op) {
415 ASSERT(op->IsRegister()); 415 ASSERT(op->IsRegister());
416 return reinterpret_cast<LRegister*>(op); 416 return reinterpret_cast<LRegister*>(op);
417 } 417 }
418 418
419 static void SetUpCache(); 419 static void SetUpCache();
420 static void TearDownCache(); 420 static void TearDownCache();
421 421
422 private: 422 private:
423 static const int kNumCachedOperands = 16; 423 static const int kNumCachedOperands = 16;
424 static LRegister* cache; 424 static LRegister* cache;
425 425
426 LRegister() : LOperand() { } 426 LRegister() : LOperand() { }
427 explicit LRegister(int index) : LOperand(REGISTER, index) { } 427 explicit LRegister(int index) : LOperand(REGISTER, index) { }
428 }; 428 };
429 429
430 430
431 class LDoubleRegister FINAL : public LOperand { 431 class LDoubleRegister V8_FINAL : public LOperand {
432 public: 432 public:
433 static LDoubleRegister* Create(int index, Zone* zone) { 433 static LDoubleRegister* Create(int index, Zone* zone) {
434 ASSERT(index >= 0); 434 ASSERT(index >= 0);
435 if (index < kNumCachedOperands) return &cache[index]; 435 if (index < kNumCachedOperands) return &cache[index];
436 return new(zone) LDoubleRegister(index); 436 return new(zone) LDoubleRegister(index);
437 } 437 }
438 438
439 static LDoubleRegister* cast(LOperand* op) { 439 static LDoubleRegister* cast(LOperand* op) {
440 ASSERT(op->IsDoubleRegister()); 440 ASSERT(op->IsDoubleRegister());
441 return reinterpret_cast<LDoubleRegister*>(op); 441 return reinterpret_cast<LDoubleRegister*>(op);
442 } 442 }
443 443
444 static void SetUpCache(); 444 static void SetUpCache();
445 static void TearDownCache(); 445 static void TearDownCache();
446 446
447 private: 447 private:
448 static const int kNumCachedOperands = 16; 448 static const int kNumCachedOperands = 16;
449 static LDoubleRegister* cache; 449 static LDoubleRegister* cache;
450 450
451 LDoubleRegister() : LOperand() { } 451 LDoubleRegister() : LOperand() { }
452 explicit LDoubleRegister(int index) : LOperand(DOUBLE_REGISTER, index) { } 452 explicit LDoubleRegister(int index) : LOperand(DOUBLE_REGISTER, index) { }
453 }; 453 };
454 454
455 455
456 class LParallelMove FINAL : public ZoneObject { 456 class LParallelMove V8_FINAL : public ZoneObject {
457 public: 457 public:
458 explicit LParallelMove(Zone* zone) : move_operands_(4, zone) { } 458 explicit LParallelMove(Zone* zone) : move_operands_(4, zone) { }
459 459
460 void AddMove(LOperand* from, LOperand* to, Zone* zone) { 460 void AddMove(LOperand* from, LOperand* to, Zone* zone) {
461 move_operands_.Add(LMoveOperands(from, to), zone); 461 move_operands_.Add(LMoveOperands(from, to), zone);
462 } 462 }
463 463
464 bool IsRedundant() const; 464 bool IsRedundant() const;
465 465
466 const ZoneList<LMoveOperands>* move_operands() const { 466 const ZoneList<LMoveOperands>* move_operands() const {
467 return &move_operands_; 467 return &move_operands_;
468 } 468 }
469 469
470 void PrintDataTo(StringStream* stream) const; 470 void PrintDataTo(StringStream* stream) const;
471 471
472 private: 472 private:
473 ZoneList<LMoveOperands> move_operands_; 473 ZoneList<LMoveOperands> move_operands_;
474 }; 474 };
475 475
476 476
477 class LPointerMap FINAL : public ZoneObject { 477 class LPointerMap V8_FINAL : public ZoneObject {
478 public: 478 public:
479 explicit LPointerMap(int position, Zone* zone) 479 explicit LPointerMap(int position, Zone* zone)
480 : pointer_operands_(8, zone), 480 : pointer_operands_(8, zone),
481 untagged_operands_(0, zone), 481 untagged_operands_(0, zone),
482 position_(position), 482 position_(position),
483 lithium_position_(-1) { } 483 lithium_position_(-1) { }
484 484
485 const ZoneList<LOperand*>* GetNormalizedOperands() { 485 const ZoneList<LOperand*>* GetNormalizedOperands() {
486 for (int i = 0; i < untagged_operands_.length(); ++i) { 486 for (int i = 0; i < untagged_operands_.length(); ++i) {
487 RemovePointer(untagged_operands_[i]); 487 RemovePointer(untagged_operands_[i]);
(...skipping 15 matching lines...) Expand all
503 void PrintTo(StringStream* stream); 503 void PrintTo(StringStream* stream);
504 504
505 private: 505 private:
506 ZoneList<LOperand*> pointer_operands_; 506 ZoneList<LOperand*> pointer_operands_;
507 ZoneList<LOperand*> untagged_operands_; 507 ZoneList<LOperand*> untagged_operands_;
508 int position_; 508 int position_;
509 int lithium_position_; 509 int lithium_position_;
510 }; 510 };
511 511
512 512
513 class LEnvironment FINAL : public ZoneObject { 513 class LEnvironment V8_FINAL : public ZoneObject {
514 public: 514 public:
515 LEnvironment(Handle<JSFunction> closure, 515 LEnvironment(Handle<JSFunction> closure,
516 FrameType frame_type, 516 FrameType frame_type,
517 BailoutId ast_id, 517 BailoutId ast_id,
518 int parameter_count, 518 int parameter_count,
519 int argument_count, 519 int argument_count,
520 int value_count, 520 int value_count,
521 LEnvironment* outer, 521 LEnvironment* outer,
522 HEnterInlined* entry, 522 HEnterInlined* entry,
523 Zone* zone) 523 Zone* zone)
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 // Map with encoded information about materialization_marker operands. 648 // Map with encoded information about materialization_marker operands.
649 ZoneList<uint32_t> object_mapping_; 649 ZoneList<uint32_t> object_mapping_;
650 650
651 LEnvironment* outer_; 651 LEnvironment* outer_;
652 HEnterInlined* entry_; 652 HEnterInlined* entry_;
653 Zone* zone_; 653 Zone* zone_;
654 }; 654 };
655 655
656 656
657 // Iterates over the non-null, non-constant operands in an environment. 657 // Iterates over the non-null, non-constant operands in an environment.
658 class ShallowIterator FINAL BASE_EMBEDDED { 658 class ShallowIterator V8_FINAL BASE_EMBEDDED {
659 public: 659 public:
660 explicit ShallowIterator(LEnvironment* env) 660 explicit ShallowIterator(LEnvironment* env)
661 : env_(env), 661 : env_(env),
662 limit_(env != NULL ? env->values()->length() : 0), 662 limit_(env != NULL ? env->values()->length() : 0),
663 current_(0) { 663 current_(0) {
664 SkipUninteresting(); 664 SkipUninteresting();
665 } 665 }
666 666
667 bool Done() { return current_ >= limit_; } 667 bool Done() { return current_ >= limit_; }
668 668
(...skipping 23 matching lines...) Expand all
692 } 692 }
693 } 693 }
694 694
695 LEnvironment* env_; 695 LEnvironment* env_;
696 int limit_; 696 int limit_;
697 int current_; 697 int current_;
698 }; 698 };
699 699
700 700
701 // Iterator for non-null, non-constant operands incl. outer environments. 701 // Iterator for non-null, non-constant operands incl. outer environments.
702 class DeepIterator FINAL BASE_EMBEDDED { 702 class DeepIterator V8_FINAL BASE_EMBEDDED {
703 public: 703 public:
704 explicit DeepIterator(LEnvironment* env) 704 explicit DeepIterator(LEnvironment* env)
705 : current_iterator_(env) { 705 : current_iterator_(env) {
706 SkipUninteresting(); 706 SkipUninteresting();
707 } 707 }
708 708
709 bool Done() { return current_iterator_.Done(); } 709 bool Done() { return current_iterator_.Done(); }
710 710
711 LOperand* Current() { 711 LOperand* Current() {
712 ASSERT(!current_iterator_.Done()); 712 ASSERT(!current_iterator_.Done());
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 private: 813 private:
814 LChunk* chunk_; 814 LChunk* chunk_;
815 815
816 DISALLOW_COPY_AND_ASSIGN(LPhase); 816 DISALLOW_COPY_AND_ASSIGN(LPhase);
817 }; 817 };
818 818
819 819
820 } } // namespace v8::internal 820 } } // namespace v8::internal
821 821
822 #endif // V8_LITHIUM_H_ 822 #endif // V8_LITHIUM_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.h ('k') | src/mips/lithium-codegen-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698