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