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

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

Issue 15562008: Recording array buffer views. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CR feedback Created 7 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-printer.cc ('k') | src/objects-visiting.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 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 V(ConsString) \ 85 V(ConsString) \
86 V(SlicedString) \ 86 V(SlicedString) \
87 V(Symbol) \ 87 V(Symbol) \
88 V(Oddball) \ 88 V(Oddball) \
89 V(Code) \ 89 V(Code) \
90 V(Map) \ 90 V(Map) \
91 V(PropertyCell) \ 91 V(PropertyCell) \
92 V(SharedFunctionInfo) \ 92 V(SharedFunctionInfo) \
93 V(JSFunction) \ 93 V(JSFunction) \
94 V(JSWeakMap) \ 94 V(JSWeakMap) \
95 V(JSArrayBuffer) \
96 V(JSTypedArray) \
95 V(JSRegExp) 97 V(JSRegExp)
96 98
97 // For data objects, JS objects and structs along with generic visitor which 99 // For data objects, JS objects and structs along with generic visitor which
98 // can visit object of any size we provide visitors specialized by 100 // can visit object of any size we provide visitors specialized by
99 // object size in words. 101 // object size in words.
100 // Ids of specialized visitors are declared in a linear order (without 102 // Ids of specialized visitors are declared in a linear order (without
101 // holes) starting from the id of visitor specialized for 2 words objects 103 // holes) starting from the id of visitor specialized for 2 words objects
102 // (base visitor id) and ending with the id of generic visitor. 104 // (base visitor id) and ending with the id of generic visitor.
103 // Method GetVisitorIdForSize depends on this ordering to calculate visitor 105 // Method GetVisitorIdForSize depends on this ordering to calculate visitor
104 // id of specialized visitor from given instance size, base visitor id and 106 // id of specialized visitor from given instance size, base visitor id and
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 328
327 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) { 329 INLINE(static int VisitSeqTwoByteString(Map* map, HeapObject* object)) {
328 return SeqTwoByteString::cast(object)-> 330 return SeqTwoByteString::cast(object)->
329 SeqTwoByteStringSize(map->instance_type()); 331 SeqTwoByteStringSize(map->instance_type());
330 } 332 }
331 333
332 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) { 334 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) {
333 return FreeSpace::cast(object)->Size(); 335 return FreeSpace::cast(object)->Size();
334 } 336 }
335 337
338 INLINE(static int VisitJSArrayBuffer(Map* map, HeapObject* object));
339 INLINE(static int VisitJSTypedArray(Map* map, HeapObject* object));
340
336 class DataObjectVisitor { 341 class DataObjectVisitor {
337 public: 342 public:
338 template<int object_size> 343 template<int object_size>
339 static inline int VisitSpecialized(Map* map, HeapObject* object) { 344 static inline int VisitSpecialized(Map* map, HeapObject* object) {
340 return object_size; 345 return object_size;
341 } 346 }
342 347
343 INLINE(static int Visit(Map* map, HeapObject* object)) { 348 INLINE(static int Visit(Map* map, HeapObject* object)) {
344 return map->instance_size(); 349 return map->instance_size();
345 } 350 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 // Mark non-optimize code for functions inlined into the given optimized 405 // Mark non-optimize code for functions inlined into the given optimized
401 // code. This will prevent it from being flushed. 406 // code. This will prevent it from being flushed.
402 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); 407 static void MarkInlinedFunctionsCode(Heap* heap, Code* code);
403 408
404 protected: 409 protected:
405 INLINE(static void VisitMap(Map* map, HeapObject* object)); 410 INLINE(static void VisitMap(Map* map, HeapObject* object));
406 INLINE(static void VisitCode(Map* map, HeapObject* object)); 411 INLINE(static void VisitCode(Map* map, HeapObject* object));
407 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); 412 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object));
408 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); 413 INLINE(static void VisitJSFunction(Map* map, HeapObject* object));
409 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); 414 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object));
415 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object));
416 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object));
410 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); 417 INLINE(static void VisitNativeContext(Map* map, HeapObject* object));
411 418
412 // Mark pointers in a Map and its TransitionArray together, possibly 419 // Mark pointers in a Map and its TransitionArray together, possibly
413 // treating transitions or back pointers weak. 420 // treating transitions or back pointers weak.
414 static void MarkMapContents(Heap* heap, Map* map); 421 static void MarkMapContents(Heap* heap, Map* map);
415 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); 422 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions);
416 423
417 // Code flushing support. 424 // Code flushing support.
418 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); 425 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function));
419 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); 426 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 461
455 462
456 template<typename StaticVisitor> 463 template<typename StaticVisitor>
457 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> 464 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback>
458 StaticMarkingVisitor<StaticVisitor>::table_; 465 StaticMarkingVisitor<StaticVisitor>::table_;
459 466
460 467
461 } } // namespace v8::internal 468 } } // namespace v8::internal
462 469
463 #endif // V8_OBJECTS_VISITING_H_ 470 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698