| OLD | NEW |
| 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 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 | 452 |
| 453 | 453 |
| 454 class LEnvironment: public ZoneObject { | 454 class LEnvironment: public ZoneObject { |
| 455 public: | 455 public: |
| 456 LEnvironment(Handle<JSFunction> closure, | 456 LEnvironment(Handle<JSFunction> closure, |
| 457 FrameType frame_type, | 457 FrameType frame_type, |
| 458 int ast_id, | 458 int ast_id, |
| 459 int parameter_count, | 459 int parameter_count, |
| 460 int argument_count, | 460 int argument_count, |
| 461 int value_count, | 461 int value_count, |
| 462 LEnvironment* outer) | 462 LEnvironment* outer, |
| 463 Zone* zone) |
| 463 : closure_(closure), | 464 : closure_(closure), |
| 464 frame_type_(frame_type), | 465 frame_type_(frame_type), |
| 465 arguments_stack_height_(argument_count), | 466 arguments_stack_height_(argument_count), |
| 466 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), | 467 deoptimization_index_(Safepoint::kNoDeoptimizationIndex), |
| 467 translation_index_(-1), | 468 translation_index_(-1), |
| 468 ast_id_(ast_id), | 469 ast_id_(ast_id), |
| 469 parameter_count_(parameter_count), | 470 parameter_count_(parameter_count), |
| 470 pc_offset_(-1), | 471 pc_offset_(-1), |
| 471 values_(value_count), | 472 values_(value_count), |
| 472 is_tagged_(value_count, closure->GetHeap()->isolate()->zone()), | 473 is_tagged_(value_count, closure->GetHeap()->isolate()->zone()), |
| 473 spilled_registers_(NULL), | 474 spilled_registers_(NULL), |
| 474 spilled_double_registers_(NULL), | 475 spilled_double_registers_(NULL), |
| 475 outer_(outer) { } | 476 outer_(outer), |
| 477 zone_(zone) { } |
| 476 | 478 |
| 477 Handle<JSFunction> closure() const { return closure_; } | 479 Handle<JSFunction> closure() const { return closure_; } |
| 478 FrameType frame_type() const { return frame_type_; } | 480 FrameType frame_type() const { return frame_type_; } |
| 479 int arguments_stack_height() const { return arguments_stack_height_; } | 481 int arguments_stack_height() const { return arguments_stack_height_; } |
| 480 int deoptimization_index() const { return deoptimization_index_; } | 482 int deoptimization_index() const { return deoptimization_index_; } |
| 481 int translation_index() const { return translation_index_; } | 483 int translation_index() const { return translation_index_; } |
| 482 int ast_id() const { return ast_id_; } | 484 int ast_id() const { return ast_id_; } |
| 483 int parameter_count() const { return parameter_count_; } | 485 int parameter_count() const { return parameter_count_; } |
| 484 int pc_offset() const { return pc_offset_; } | 486 int pc_offset() const { return pc_offset_; } |
| 485 LOperand** spilled_registers() const { return spilled_registers_; } | 487 LOperand** spilled_registers() const { return spilled_registers_; } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 513 } | 515 } |
| 514 | 516 |
| 515 void SetSpilledRegisters(LOperand** registers, | 517 void SetSpilledRegisters(LOperand** registers, |
| 516 LOperand** double_registers) { | 518 LOperand** double_registers) { |
| 517 spilled_registers_ = registers; | 519 spilled_registers_ = registers; |
| 518 spilled_double_registers_ = double_registers; | 520 spilled_double_registers_ = double_registers; |
| 519 } | 521 } |
| 520 | 522 |
| 521 void PrintTo(StringStream* stream); | 523 void PrintTo(StringStream* stream); |
| 522 | 524 |
| 525 Zone* zone() { return zone_; } |
| 526 |
| 523 private: | 527 private: |
| 524 Handle<JSFunction> closure_; | 528 Handle<JSFunction> closure_; |
| 525 FrameType frame_type_; | 529 FrameType frame_type_; |
| 526 int arguments_stack_height_; | 530 int arguments_stack_height_; |
| 527 int deoptimization_index_; | 531 int deoptimization_index_; |
| 528 int translation_index_; | 532 int translation_index_; |
| 529 int ast_id_; | 533 int ast_id_; |
| 530 int parameter_count_; | 534 int parameter_count_; |
| 531 int pc_offset_; | 535 int pc_offset_; |
| 532 ZoneList<LOperand*> values_; | 536 ZoneList<LOperand*> values_; |
| 533 BitVector is_tagged_; | 537 BitVector is_tagged_; |
| 534 | 538 |
| 535 // Allocation index indexed arrays of spill slot operands for registers | 539 // Allocation index indexed arrays of spill slot operands for registers |
| 536 // that are also in spill slots at an OSR entry. NULL for environments | 540 // that are also in spill slots at an OSR entry. NULL for environments |
| 537 // that do not correspond to an OSR entry. | 541 // that do not correspond to an OSR entry. |
| 538 LOperand** spilled_registers_; | 542 LOperand** spilled_registers_; |
| 539 LOperand** spilled_double_registers_; | 543 LOperand** spilled_double_registers_; |
| 540 | 544 |
| 541 LEnvironment* outer_; | 545 LEnvironment* outer_; |
| 546 |
| 547 Zone* zone_; |
| 542 }; | 548 }; |
| 543 | 549 |
| 544 | 550 |
| 545 // Iterates over the non-null, non-constant operands in an environment. | 551 // Iterates over the non-null, non-constant operands in an environment. |
| 546 class ShallowIterator BASE_EMBEDDED { | 552 class ShallowIterator BASE_EMBEDDED { |
| 547 public: | 553 public: |
| 548 explicit ShallowIterator(LEnvironment* env) | 554 explicit ShallowIterator(LEnvironment* env) |
| 549 : env_(env), | 555 : env_(env), |
| 550 limit_(env != NULL ? env->values()->length() : 0), | 556 limit_(env != NULL ? env->values()->length() : 0), |
| 551 current_(0) { | 557 current_(0) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 ShallowIterator current_iterator_; | 621 ShallowIterator current_iterator_; |
| 616 }; | 622 }; |
| 617 | 623 |
| 618 | 624 |
| 619 int ElementsKindToShiftSize(ElementsKind elements_kind); | 625 int ElementsKindToShiftSize(ElementsKind elements_kind); |
| 620 | 626 |
| 621 | 627 |
| 622 } } // namespace v8::internal | 628 } } // namespace v8::internal |
| 623 | 629 |
| 624 #endif // V8_LITHIUM_H_ | 630 #endif // V8_LITHIUM_H_ |
| OLD | NEW |