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

Side by Side Diff: src/objects-visiting.h

Issue 101413006: Implement in-heap backing store for typed arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Self-review Created 7 years 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
OLDNEW
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 29 matching lines...) Expand all
40 // field which contains an index of specialized visitor to use. 40 // field which contains an index of specialized visitor to use.
41 41
42 namespace v8 { 42 namespace v8 {
43 namespace internal { 43 namespace internal {
44 44
45 45
46 // Base class for all static visitors. 46 // Base class for all static visitors.
47 class StaticVisitorBase : public AllStatic { 47 class StaticVisitorBase : public AllStatic {
48 public: 48 public:
49 #define VISITOR_ID_LIST(V) \ 49 #define VISITOR_ID_LIST(V) \
50 V(SeqOneByteString) \ 50 V(SeqOneByteString) \
51 V(SeqTwoByteString) \ 51 V(SeqTwoByteString) \
52 V(ShortcutCandidate) \ 52 V(ShortcutCandidate) \
53 V(ByteArray) \ 53 V(ByteArray) \
54 V(FreeSpace) \ 54 V(FreeSpace) \
55 V(FixedArray) \ 55 V(FixedArray) \
56 V(FixedDoubleArray) \ 56 V(FixedDoubleArray) \
57 V(FixedTypedArray) \
57 V(ConstantPoolArray) \ 58 V(ConstantPoolArray) \
58 V(NativeContext) \ 59 V(NativeContext) \
59 V(AllocationSite) \ 60 V(AllocationSite) \
60 V(DataObject2) \ 61 V(DataObject2) \
61 V(DataObject3) \ 62 V(DataObject3) \
62 V(DataObject4) \ 63 V(DataObject4) \
63 V(DataObject5) \ 64 V(DataObject5) \
64 V(DataObject6) \ 65 V(DataObject6) \
65 V(DataObject7) \ 66 V(DataObject7) \
66 V(DataObject8) \ 67 V(DataObject8) \
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 316
316 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) { 317 INLINE(static int VisitByteArray(Map* map, HeapObject* object)) {
317 return reinterpret_cast<ByteArray*>(object)->ByteArraySize(); 318 return reinterpret_cast<ByteArray*>(object)->ByteArraySize();
318 } 319 }
319 320
320 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) { 321 INLINE(static int VisitFixedDoubleArray(Map* map, HeapObject* object)) {
321 int length = reinterpret_cast<FixedDoubleArray*>(object)->length(); 322 int length = reinterpret_cast<FixedDoubleArray*>(object)->length();
322 return FixedDoubleArray::SizeFor(length); 323 return FixedDoubleArray::SizeFor(length);
323 } 324 }
324 325
326 INLINE(static int VisitFixedTypedArray(Map* map, HeapObject* object)) {
327 return reinterpret_cast<FixedTypedArrayBase*>(object)->size();
328 }
329
325 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) { 330 INLINE(static int VisitJSObject(Map* map, HeapObject* object)) {
326 return JSObjectVisitor::Visit(map, object); 331 return JSObjectVisitor::Visit(map, object);
327 } 332 }
328 333
329 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) { 334 INLINE(static int VisitSeqOneByteString(Map* map, HeapObject* object)) {
330 return SeqOneByteString::cast(object)-> 335 return SeqOneByteString::cast(object)->
331 SeqOneByteStringSize(map->instance_type()); 336 SeqOneByteStringSize(map->instance_type());
332 } 337 }
333 338
334 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { 339 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 476
472 477
473 template<typename StaticVisitor> 478 template<typename StaticVisitor>
474 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> 479 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback>
475 StaticMarkingVisitor<StaticVisitor>::table_; 480 StaticMarkingVisitor<StaticVisitor>::table_;
476 481
477 482
478 } } // namespace v8::internal 483 } } // namespace v8::internal
479 484
480 #endif // V8_OBJECTS_VISITING_H_ 485 #endif // V8_OBJECTS_VISITING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698