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

Side by Side Diff: src/lithium.h

Issue 9104042: Save zone memory in LEnvironment by using a bit vector. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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 | « no previous file | no next file » | 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 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 LEnvironment* outer) 446 LEnvironment* outer)
447 : closure_(closure), 447 : closure_(closure),
448 is_arguments_adaptor_(is_arguments_adaptor), 448 is_arguments_adaptor_(is_arguments_adaptor),
449 arguments_stack_height_(argument_count), 449 arguments_stack_height_(argument_count),
450 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), 450 deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
451 translation_index_(-1), 451 translation_index_(-1),
452 ast_id_(ast_id), 452 ast_id_(ast_id),
453 parameter_count_(parameter_count), 453 parameter_count_(parameter_count),
454 pc_offset_(-1), 454 pc_offset_(-1),
455 values_(value_count), 455 values_(value_count),
456 representations_(value_count), 456 is_tagged_(value_count),
457 spilled_registers_(NULL), 457 spilled_registers_(NULL),
458 spilled_double_registers_(NULL), 458 spilled_double_registers_(NULL),
459 outer_(outer) { 459 outer_(outer) {
460 } 460 }
461 461
462 Handle<JSFunction> closure() const { return closure_; } 462 Handle<JSFunction> closure() const { return closure_; }
463 int arguments_stack_height() const { return arguments_stack_height_; } 463 int arguments_stack_height() const { return arguments_stack_height_; }
464 int deoptimization_index() const { return deoptimization_index_; } 464 int deoptimization_index() const { return deoptimization_index_; }
465 int translation_index() const { return translation_index_; } 465 int translation_index() const { return translation_index_; }
466 int ast_id() const { return ast_id_; } 466 int ast_id() const { return ast_id_; }
467 int parameter_count() const { return parameter_count_; } 467 int parameter_count() const { return parameter_count_; }
468 int pc_offset() const { return pc_offset_; } 468 int pc_offset() const { return pc_offset_; }
469 LOperand** spilled_registers() const { return spilled_registers_; } 469 LOperand** spilled_registers() const { return spilled_registers_; }
470 LOperand** spilled_double_registers() const { 470 LOperand** spilled_double_registers() const {
471 return spilled_double_registers_; 471 return spilled_double_registers_;
472 } 472 }
473 const ZoneList<LOperand*>* values() const { return &values_; } 473 const ZoneList<LOperand*>* values() const { return &values_; }
474 LEnvironment* outer() const { return outer_; } 474 LEnvironment* outer() const { return outer_; }
475 475
476 void AddValue(LOperand* operand, Representation representation) { 476 void AddValue(LOperand* operand, Representation representation) {
477 values_.Add(operand); 477 values_.Add(operand);
478 representations_.Add(representation); 478 if (representation.IsTagged()) {
479 is_tagged_.Add(values_.length() - 1);
480 }
479 } 481 }
480 482
481 bool HasTaggedValueAt(int index) const { 483 bool HasTaggedValueAt(int index) const {
482 return representations_[index].IsTagged(); 484 return is_tagged_.Contains(index);
483 } 485 }
484 486
485 void Register(int deoptimization_index, 487 void Register(int deoptimization_index,
486 int translation_index, 488 int translation_index,
487 int pc_offset) { 489 int pc_offset) {
488 ASSERT(!HasBeenRegistered()); 490 ASSERT(!HasBeenRegistered());
489 deoptimization_index_ = deoptimization_index; 491 deoptimization_index_ = deoptimization_index;
490 translation_index_ = translation_index; 492 translation_index_ = translation_index;
491 pc_offset_ = pc_offset; 493 pc_offset_ = pc_offset;
492 } 494 }
(...skipping 14 matching lines...) Expand all
507 private: 509 private:
508 Handle<JSFunction> closure_; 510 Handle<JSFunction> closure_;
509 bool is_arguments_adaptor_; 511 bool is_arguments_adaptor_;
510 int arguments_stack_height_; 512 int arguments_stack_height_;
511 int deoptimization_index_; 513 int deoptimization_index_;
512 int translation_index_; 514 int translation_index_;
513 int ast_id_; 515 int ast_id_;
514 int parameter_count_; 516 int parameter_count_;
515 int pc_offset_; 517 int pc_offset_;
516 ZoneList<LOperand*> values_; 518 ZoneList<LOperand*> values_;
517 ZoneList<Representation> representations_; 519 BitVector is_tagged_;
518 520
519 // Allocation index indexed arrays of spill slot operands for registers 521 // Allocation index indexed arrays of spill slot operands for registers
520 // that are also in spill slots at an OSR entry. NULL for environments 522 // that are also in spill slots at an OSR entry. NULL for environments
521 // that do not correspond to an OSR entry. 523 // that do not correspond to an OSR entry.
522 LOperand** spilled_registers_; 524 LOperand** spilled_registers_;
523 LOperand** spilled_double_registers_; 525 LOperand** spilled_double_registers_;
524 526
525 LEnvironment* outer_; 527 LEnvironment* outer_;
526 }; 528 };
527 529
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 ShallowIterator current_iterator_; 601 ShallowIterator current_iterator_;
600 }; 602 };
601 603
602 604
603 int ElementsKindToShiftSize(ElementsKind elements_kind); 605 int ElementsKindToShiftSize(ElementsKind elements_kind);
604 606
605 607
606 } } // namespace v8::internal 608 } } // namespace v8::internal
607 609
608 #endif // V8_LITHIUM_H_ 610 #endif // V8_LITHIUM_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698