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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #include "accessors.h" | 7 #include "accessors.h" |
8 #include "allocation-site-scopes.h" | 8 #include "allocation-site-scopes.h" |
9 #include "api.h" | 9 #include "api.h" |
10 #include "arguments.h" | 10 #include "arguments.h" |
(...skipping 9945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9956 | 9956 |
9957 bool Map::EquivalentToForNormalization(Map* other, | 9957 bool Map::EquivalentToForNormalization(Map* other, |
9958 PropertyNormalizationMode mode) { | 9958 PropertyNormalizationMode mode) { |
9959 int properties = mode == CLEAR_INOBJECT_PROPERTIES | 9959 int properties = mode == CLEAR_INOBJECT_PROPERTIES |
9960 ? 0 : other->inobject_properties(); | 9960 ? 0 : other->inobject_properties(); |
9961 return CheckEquivalent(this, other) && inobject_properties() == properties; | 9961 return CheckEquivalent(this, other) && inobject_properties() == properties; |
9962 } | 9962 } |
9963 | 9963 |
9964 | 9964 |
9965 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { | 9965 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { |
9966 for (int i = 0; i < count_of_code_ptr_entries(); i++) { | 9966 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR); |
9967 int index = first_code_ptr_index() + i; | 9967 while (!code_iter.is_finished()) { |
9968 v->VisitCodeEntry(reinterpret_cast<Address>(RawFieldOfElementAt(index))); | 9968 v->VisitCodeEntry(reinterpret_cast<Address>( |
9969 RawFieldOfElementAt(code_iter.next_index()))); | |
9969 } | 9970 } |
9970 for (int i = 0; i < count_of_heap_ptr_entries(); i++) { | 9971 |
9971 int index = first_heap_ptr_index() + i; | 9972 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR); |
9972 v->VisitPointer(RawFieldOfElementAt(index)); | 9973 while (!heap_iter.is_finished()) { |
9974 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index())); | |
9973 } | 9975 } |
9974 } | 9976 } |
9975 | 9977 |
9978 | |
9979 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) { | |
9980 if (number_of_entries(CODE_PTR, SMALL_SECTION) > 0) { | |
ulan
2014/06/02 12:32:58
Type type[] = {CODE_PTR, HEAP_PTR};
Address value[
rmcilroy
2014/06/03 12:32:28
Done. I'm not convinced this is clearer though.
| |
9981 int offset = OffsetOfElementAt(first_index(CODE_PTR, SMALL_SECTION)); | |
9982 MemsetPointer( | |
9983 reinterpret_cast<Address*>(HeapObject::RawField(this, offset)), | |
9984 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), | |
9985 number_of_entries(CODE_PTR, SMALL_SECTION)); | |
9986 } | |
9987 if (number_of_entries(HEAP_PTR, SMALL_SECTION) > 0) { | |
9988 int offset = OffsetOfElementAt(first_index(HEAP_PTR, SMALL_SECTION)); | |
9989 MemsetPointer( | |
9990 HeapObject::RawField(this, offset), | |
9991 isolate->heap()->undefined_value(), | |
9992 number_of_entries(HEAP_PTR, SMALL_SECTION)); | |
9993 } | |
9994 if (is_extended_layout()) { | |
9995 if (number_of_entries(CODE_PTR, EXTENDED_SECTION) > 0) { | |
9996 int offset = OffsetOfElementAt(first_index(CODE_PTR, EXTENDED_SECTION)); | |
9997 MemsetPointer( | |
9998 reinterpret_cast<Address*>(HeapObject::RawField(this, offset)), | |
9999 isolate->builtins()->builtin(Builtins::kIllegal)->entry(), | |
10000 number_of_entries(CODE_PTR, EXTENDED_SECTION)); | |
10001 } | |
10002 if (number_of_entries(HEAP_PTR, EXTENDED_SECTION) > 0) { | |
10003 int offset = OffsetOfElementAt(first_index(HEAP_PTR, EXTENDED_SECTION)); | |
10004 MemsetPointer( | |
10005 HeapObject::RawField(this, offset), | |
10006 isolate->heap()->undefined_value(), | |
10007 number_of_entries(HEAP_PTR, EXTENDED_SECTION)); | |
10008 } | |
10009 } | |
10010 } | |
10011 | |
9976 | 10012 |
9977 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { | 10013 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { |
9978 // Iterate over all fields in the body but take care in dealing with | 10014 // Iterate over all fields in the body but take care in dealing with |
9979 // the code entry. | 10015 // the code entry. |
9980 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); | 10016 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); |
9981 v->VisitCodeEntry(this->address() + kCodeEntryOffset); | 10017 v->VisitCodeEntry(this->address() + kCodeEntryOffset); |
9982 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); | 10018 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); |
9983 } | 10019 } |
9984 | 10020 |
9985 | 10021 |
(...skipping 7283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
17269 #define ERROR_MESSAGES_TEXTS(C, T) T, | 17305 #define ERROR_MESSAGES_TEXTS(C, T) T, |
17270 static const char* error_messages_[] = { | 17306 static const char* error_messages_[] = { |
17271 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 17307 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
17272 }; | 17308 }; |
17273 #undef ERROR_MESSAGES_TEXTS | 17309 #undef ERROR_MESSAGES_TEXTS |
17274 return error_messages_[reason]; | 17310 return error_messages_[reason]; |
17275 } | 17311 } |
17276 | 17312 |
17277 | 17313 |
17278 } } // namespace v8::internal | 17314 } } // namespace v8::internal |
OLD | NEW |