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

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

Issue 17153011: DataView implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 V(Oddball) \ 88 V(Oddball) \
89 V(Code) \ 89 V(Code) \
90 V(Map) \ 90 V(Map) \
91 V(Cell) \ 91 V(Cell) \
92 V(PropertyCell) \ 92 V(PropertyCell) \
93 V(SharedFunctionInfo) \ 93 V(SharedFunctionInfo) \
94 V(JSFunction) \ 94 V(JSFunction) \
95 V(JSWeakMap) \ 95 V(JSWeakMap) \
96 V(JSArrayBuffer) \ 96 V(JSArrayBuffer) \
97 V(JSTypedArray) \ 97 V(JSTypedArray) \
98 V(JSDataView) \
98 V(JSRegExp) 99 V(JSRegExp)
99 100
100 // For data objects, JS objects and structs along with generic visitor which 101 // For data objects, JS objects and structs along with generic visitor which
101 // can visit object of any size we provide visitors specialized by 102 // can visit object of any size we provide visitors specialized by
102 // object size in words. 103 // object size in words.
103 // Ids of specialized visitors are declared in a linear order (without 104 // Ids of specialized visitors are declared in a linear order (without
104 // holes) starting from the id of visitor specialized for 2 words objects 105 // holes) starting from the id of visitor specialized for 2 words objects
105 // (base visitor id) and ending with the id of generic visitor. 106 // (base visitor id) and ending with the id of generic visitor.
106 // Method GetVisitorIdForSize depends on this ordering to calculate visitor 107 // Method GetVisitorIdForSize depends on this ordering to calculate visitor
107 // id of specialized visitor from given instance size, base visitor id and 108 // id of specialized visitor from given instance size, base visitor id and
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 return SeqTwoByteString::cast(object)-> 332 return SeqTwoByteString::cast(object)->
332 SeqTwoByteStringSize(map->instance_type()); 333 SeqTwoByteStringSize(map->instance_type());
333 } 334 }
334 335
335 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) { 336 INLINE(static int VisitFreeSpace(Map* map, HeapObject* object)) {
336 return FreeSpace::cast(object)->Size(); 337 return FreeSpace::cast(object)->Size();
337 } 338 }
338 339
339 INLINE(static int VisitJSArrayBuffer(Map* map, HeapObject* object)); 340 INLINE(static int VisitJSArrayBuffer(Map* map, HeapObject* object));
340 INLINE(static int VisitJSTypedArray(Map* map, HeapObject* object)); 341 INLINE(static int VisitJSTypedArray(Map* map, HeapObject* object));
342 INLINE(static int VisitJSDataView(Map* map, HeapObject* object));
341 343
342 class DataObjectVisitor { 344 class DataObjectVisitor {
343 public: 345 public:
344 template<int object_size> 346 template<int object_size>
345 static inline int VisitSpecialized(Map* map, HeapObject* object) { 347 static inline int VisitSpecialized(Map* map, HeapObject* object) {
346 return object_size; 348 return object_size;
347 } 349 }
348 350
349 INLINE(static int Visit(Map* map, HeapObject* object)) { 351 INLINE(static int Visit(Map* map, HeapObject* object)) {
350 return map->instance_size(); 352 return map->instance_size();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 static void MarkInlinedFunctionsCode(Heap* heap, Code* code); 410 static void MarkInlinedFunctionsCode(Heap* heap, Code* code);
409 411
410 protected: 412 protected:
411 INLINE(static void VisitMap(Map* map, HeapObject* object)); 413 INLINE(static void VisitMap(Map* map, HeapObject* object));
412 INLINE(static void VisitCode(Map* map, HeapObject* object)); 414 INLINE(static void VisitCode(Map* map, HeapObject* object));
413 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object)); 415 INLINE(static void VisitSharedFunctionInfo(Map* map, HeapObject* object));
414 INLINE(static void VisitJSFunction(Map* map, HeapObject* object)); 416 INLINE(static void VisitJSFunction(Map* map, HeapObject* object));
415 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object)); 417 INLINE(static void VisitJSRegExp(Map* map, HeapObject* object));
416 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object)); 418 INLINE(static void VisitJSArrayBuffer(Map* map, HeapObject* object));
417 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object)); 419 INLINE(static void VisitJSTypedArray(Map* map, HeapObject* object));
420 INLINE(static void VisitJSDataView(Map* map, HeapObject* object));
418 INLINE(static void VisitNativeContext(Map* map, HeapObject* object)); 421 INLINE(static void VisitNativeContext(Map* map, HeapObject* object));
419 422
420 // Mark pointers in a Map and its TransitionArray together, possibly 423 // Mark pointers in a Map and its TransitionArray together, possibly
421 // treating transitions or back pointers weak. 424 // treating transitions or back pointers weak.
422 static void MarkMapContents(Heap* heap, Map* map); 425 static void MarkMapContents(Heap* heap, Map* map);
423 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions); 426 static void MarkTransitionArray(Heap* heap, TransitionArray* transitions);
424 427
425 // Code flushing support. 428 // Code flushing support.
426 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function)); 429 INLINE(static bool IsFlushable(Heap* heap, JSFunction* function));
427 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info)); 430 INLINE(static bool IsFlushable(Heap* heap, SharedFunctionInfo* shared_info));
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 465
463 466
464 template<typename StaticVisitor> 467 template<typename StaticVisitor>
465 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback> 468 VisitorDispatchTable<typename StaticMarkingVisitor<StaticVisitor>::Callback>
466 StaticMarkingVisitor<StaticVisitor>::table_; 469 StaticMarkingVisitor<StaticVisitor>::table_;
467 470
468 471
469 } } // namespace v8::internal 472 } } // namespace v8::internal
470 473
471 #endif // V8_OBJECTS_VISITING_H_ 474 #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