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 9692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9703 | 9703 |
9704 bool Map::EquivalentToForNormalization(Map* other, | 9704 bool Map::EquivalentToForNormalization(Map* other, |
9705 PropertyNormalizationMode mode) { | 9705 PropertyNormalizationMode mode) { |
9706 int properties = mode == CLEAR_INOBJECT_PROPERTIES | 9706 int properties = mode == CLEAR_INOBJECT_PROPERTIES |
9707 ? 0 : other->inobject_properties(); | 9707 ? 0 : other->inobject_properties(); |
9708 return CheckEquivalent(this, other) && inobject_properties() == properties; | 9708 return CheckEquivalent(this, other) && inobject_properties() == properties; |
9709 } | 9709 } |
9710 | 9710 |
9711 | 9711 |
9712 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { | 9712 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { |
9713 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); | 9713 // Unfortunately the serializer relies on pointers within an object being |
9714 while (!code_iter.is_finished()) { | 9714 // visited in-order, so we have to iterate both the code and heap pointers in |
9715 v->VisitCodeEntry(reinterpret_cast<Address>( | 9715 // the small section before doing so in the extended section. |
9716 RawFieldOfElementAt(code_iter.next_index()))); | 9716 for (int s = 0; s <= final_section(); ++s) { |
9717 } | 9717 LayoutSection section = static_cast<LayoutSection>(s); |
| 9718 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR, |
| 9719 section); |
| 9720 while (!code_iter.is_finished()) { |
| 9721 v->VisitCodeEntry(reinterpret_cast<Address>( |
| 9722 RawFieldOfElementAt(code_iter.next_index()))); |
| 9723 } |
9718 | 9724 |
9719 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); | 9725 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR, |
9720 while (!heap_iter.is_finished()) { | 9726 section); |
9721 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); | 9727 while (!heap_iter.is_finished()) { |
| 9728 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); |
| 9729 } |
9722 } | 9730 } |
9723 } | 9731 } |
9724 | 9732 |
9725 | 9733 |
9726 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) { | 9734 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) { |
9727 Type type[] = { CODE_PTR, HEAP_PTR }; | 9735 Type type[] = { CODE_PTR, HEAP_PTR }; |
9728 Address default_value[] = { | 9736 Address default_value[] = { |
9729 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), | 9737 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), |
9730 reinterpret_cast<Address>(isolate->heap()->undefined_value()) }; | 9738 reinterpret_cast<Address>(isolate->heap()->undefined_value()) }; |
9731 | 9739 |
(...skipping 7246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16978 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16986 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16979 static const char* error_messages_[] = { | 16987 static const char* error_messages_[] = { |
16980 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16988 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16981 }; | 16989 }; |
16982 #undef ERROR_MESSAGES_TEXTS | 16990 #undef ERROR_MESSAGES_TEXTS |
16983 return error_messages_[reason]; | 16991 return error_messages_[reason]; |
16984 } | 16992 } |
16985 | 16993 |
16986 | 16994 |
16987 } } // namespace v8::internal | 16995 } } // namespace v8::internal |
OLD | NEW |