OLD | NEW |
---|---|
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/allocation-site-scopes.h" | 8 #include "src/allocation-site-scopes.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 9656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9667 | 9667 |
9668 bool Map::EquivalentToForNormalization(Map* other, | 9668 bool Map::EquivalentToForNormalization(Map* other, |
9669 PropertyNormalizationMode mode) { | 9669 PropertyNormalizationMode mode) { |
9670 int properties = mode == CLEAR_INOBJECT_PROPERTIES | 9670 int properties = mode == CLEAR_INOBJECT_PROPERTIES |
9671 ? 0 : other->inobject_properties(); | 9671 ? 0 : other->inobject_properties(); |
9672 return CheckEquivalent(this, other) && inobject_properties() == properties; | 9672 return CheckEquivalent(this, other) && inobject_properties() == properties; |
9673 } | 9673 } |
9674 | 9674 |
9675 | 9675 |
9676 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { | 9676 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { |
9677 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); | 9677 // Unfortunately the serializer relies on pointers being visited in-order, |
ulan
2014/07/01 13:29:48
Since we iterating first code pointers and the hea
rmcilroy
2014/07/02 16:35:55
In-order means that we visit the entries of the co
ulan
2014/07/03 09:19:55
Yes, the new comment makes it clear.
| |
9678 while (!code_iter.is_finished()) { | 9678 // so we have to iterate both the code and heap pointers in the small section |
9679 v->VisitCodeEntry(reinterpret_cast<Address>( | 9679 // before doing so in the extended section. |
9680 RawFieldOfElementAt(code_iter.next_index()))); | 9680 for (int s = 0; s <= final_section(); ++s) { |
9681 } | 9681 LayoutSection section = static_cast<LayoutSection>(s); |
9682 ConstantPoolArray::Iterator code_iter( | |
9683 this, ConstantPoolArray::CODE_PTR, section); | |
9684 while (!code_iter.is_finished()) { | |
9685 v->VisitCodeEntry(reinterpret_cast<Address>( | |
9686 RawFieldOfElementAt(code_iter.next_index()))); | |
9687 } | |
9682 | 9688 |
9683 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); | 9689 ConstantPoolArray::Iterator heap_iter( |
9684 while (!heap_iter.is_finished()) { | 9690 this, ConstantPoolArray::HEAP_PTR, section); |
9685 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); | 9691 while (!heap_iter.is_finished()) { |
9692 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); | |
9693 } | |
9686 } | 9694 } |
9687 } | 9695 } |
9688 | 9696 |
9689 | 9697 |
9690 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) { | 9698 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) { |
9691 Type type[] = { CODE_PTR, HEAP_PTR }; | 9699 Type type[] = { CODE_PTR, HEAP_PTR }; |
9692 Address default_value[] = { | 9700 Address default_value[] = { |
9693 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), | 9701 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), |
9694 reinterpret_cast<Address>(isolate->heap()->undefined_value()) }; | 9702 reinterpret_cast<Address>(isolate->heap()->undefined_value()) }; |
9695 | 9703 |
(...skipping 7244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16940 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16948 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16941 static const char* error_messages_[] = { | 16949 static const char* error_messages_[] = { |
16942 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16950 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16943 }; | 16951 }; |
16944 #undef ERROR_MESSAGES_TEXTS | 16952 #undef ERROR_MESSAGES_TEXTS |
16945 return error_messages_[reason]; | 16953 return error_messages_[reason]; |
16946 } | 16954 } |
16947 | 16955 |
16948 | 16956 |
16949 } } // namespace v8::internal | 16957 } } // namespace v8::internal |
OLD | NEW |