| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 } | 525 } |
| 526 | 526 |
| 527 | 527 |
| 528 // Add an object to the supplied environment and object materialization list. | 528 // Add an object to the supplied environment and object materialization list. |
| 529 // | 529 // |
| 530 // Notes: | 530 // Notes: |
| 531 // | 531 // |
| 532 // We are building three lists here: | 532 // We are building three lists here: |
| 533 // | 533 // |
| 534 // 1. In the result->object_mapping_ list (added to by the | 534 // 1. In the result->object_mapping_ list (added to by the |
| 535 // LEnvironment::Add*Object methods), we store the lengths (number | 535 // LEnvironment::Add*Object methods), we store the lengths (number |
| 536 // of fields) of the captured objects in depth-first traversal order, or | 536 // of fields) of the captured objects in depth-first traversal order, or |
| 537 // in case of duplicated objects, we store the index to the duplicate object | 537 // in case of duplicated objects, we store the index to the duplicate object |
| 538 // (with a tag to differentiate between captured and duplicated objects). | 538 // (with a tag to differentiate between captured and duplicated objects). |
| 539 // | 539 // |
| 540 // 2. The object fields are stored in the result->values_ list | 540 // 2. The object fields are stored in the result->values_ list |
| 541 // (added to by the LEnvironment.AddValue method) sequentially as lists | 541 // (added to by the LEnvironment.AddValue method) sequentially as lists |
| 542 // of fields with holes for nested objects (the holes will be expanded | 542 // of fields with holes for nested objects (the holes will be expanded |
| 543 // later by LCodegen::AddToTranslation according to the | 543 // later by LCodegen::AddToTranslation according to the |
| 544 // LEnvironment.object_mapping_ list). | 544 // LEnvironment.object_mapping_ list). |
| 545 // | 545 // |
| 546 // 3. The auxiliary objects_to_materialize array stores the hydrogen values | 546 // 3. The auxiliary objects_to_materialize array stores the hydrogen values |
| 547 // in the same order as result->object_mapping_ list. This is used | 547 // in the same order as result->object_mapping_ list. This is used |
| 548 // to detect duplicate values and calculate the corresponding object index. | 548 // to detect duplicate values and calculate the corresponding object index. |
| 549 void LChunkBuilderBase::AddObjectToMaterialize(HValue* value, | 549 void LChunkBuilderBase::AddObjectToMaterialize(HValue* value, |
| 550 ZoneList<HValue*>* objects_to_materialize, LEnvironment* result) { | 550 ZoneList<HValue*>* objects_to_materialize, LEnvironment* result) { |
| 551 int object_index = objects_to_materialize->length(); | 551 int object_index = objects_to_materialize->length(); |
| 552 // Store the hydrogen value into the de-duplication array | 552 // Store the hydrogen value into the de-duplication array |
| 553 objects_to_materialize->Add(value, zone()); | 553 objects_to_materialize->Add(value, zone()); |
| 554 // Find out whether we are storing a duplicated value | 554 // Find out whether we are storing a duplicated value |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 | 605 |
| 606 | 606 |
| 607 LPhase::~LPhase() { | 607 LPhase::~LPhase() { |
| 608 if (ShouldProduceTraceOutput()) { | 608 if (ShouldProduceTraceOutput()) { |
| 609 isolate()->GetHTracer()->TraceLithium(name(), chunk_); | 609 isolate()->GetHTracer()->TraceLithium(name(), chunk_); |
| 610 } | 610 } |
| 611 } | 611 } |
| 612 | 612 |
| 613 | 613 |
| 614 } } // namespace v8::internal | 614 } } // namespace v8::internal |
| OLD | NEW |