Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Side by Side Diff: src/objects.cc

Issue 304143002: Add support for extended constant pool arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sync Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 9845 matching lines...) Expand 10 before | Expand all | Expand 10 after
9856 9856
9857 bool Map::EquivalentToForNormalization(Map* other, 9857 bool Map::EquivalentToForNormalization(Map* other,
9858 PropertyNormalizationMode mode) { 9858 PropertyNormalizationMode mode) {
9859 int properties = mode == CLEAR_INOBJECT_PROPERTIES 9859 int properties = mode == CLEAR_INOBJECT_PROPERTIES
9860 ? 0 : other->inobject_properties(); 9860 ? 0 : other->inobject_properties();
9861 return CheckEquivalent(this, other) && inobject_properties() == properties; 9861 return CheckEquivalent(this, other) && inobject_properties() == properties;
9862 } 9862 }
9863 9863
9864 9864
9865 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) { 9865 void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) {
9866 for (int i = 0; i < count_of_code_ptr_entries(); i++) { 9866 ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR);
9867 int index = first_code_ptr_index() + i; 9867 while (!code_iter.is_finished()) {
9868 v->VisitCodeEntry(reinterpret_cast<Address>(RawFieldOfElementAt(index))); 9868 v->VisitCodeEntry(reinterpret_cast<Address>(
9869 RawFieldOfElementAt(code_iter.next_index())));
9869 } 9870 }
9870 for (int i = 0; i < count_of_heap_ptr_entries(); i++) { 9871
9871 int index = first_heap_ptr_index() + i; 9872 ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR);
9872 v->VisitPointer(RawFieldOfElementAt(index)); 9873 while (!heap_iter.is_finished()) {
9874 v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index()));
9873 } 9875 }
9874 } 9876 }
9875 9877
9878
9879 void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) {
9880 Type type[] = { CODE_PTR, HEAP_PTR };
9881 Address default_value[] = {
9882 isolate->builtins()->builtin(Builtins::kIllegal)->entry(),
9883 reinterpret_cast<Address>(isolate->heap()->undefined_value()) };
9884
9885 for (int i = 0; i < 2; ++i) {
9886 for (int s = 0; s <= final_section(); ++s) {
9887 LayoutSection section = static_cast<LayoutSection>(s);
9888 if (number_of_entries(type[i], section) > 0) {
9889 int offset = OffsetOfElementAt(first_index(type[i], section));
9890 MemsetPointer(
9891 reinterpret_cast<Address*>(HeapObject::RawField(this, offset)),
9892 default_value[i],
9893 number_of_entries(type[i], section));
9894 }
9895 }
9896 }
9897 }
9898
9876 9899
9877 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) { 9900 void JSFunction::JSFunctionIterateBody(int object_size, ObjectVisitor* v) {
9878 // Iterate over all fields in the body but take care in dealing with 9901 // Iterate over all fields in the body but take care in dealing with
9879 // the code entry. 9902 // the code entry.
9880 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset); 9903 IteratePointers(v, kPropertiesOffset, kCodeEntryOffset);
9881 v->VisitCodeEntry(this->address() + kCodeEntryOffset); 9904 v->VisitCodeEntry(this->address() + kCodeEntryOffset);
9882 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size); 9905 IteratePointers(v, kCodeEntryOffset + kPointerSize, object_size);
9883 } 9906 }
9884 9907
9885 9908
(...skipping 7287 matching lines...) Expand 10 before | Expand all | Expand 10 after
17173 #define ERROR_MESSAGES_TEXTS(C, T) T, 17196 #define ERROR_MESSAGES_TEXTS(C, T) T,
17174 static const char* error_messages_[] = { 17197 static const char* error_messages_[] = {
17175 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) 17198 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS)
17176 }; 17199 };
17177 #undef ERROR_MESSAGES_TEXTS 17200 #undef ERROR_MESSAGES_TEXTS
17178 return error_messages_[reason]; 17201 return error_messages_[reason];
17179 } 17202 }
17180 17203
17181 17204
17182 } } // namespace v8::internal 17205 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698