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

Side by Side Diff: src/heap.cc

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/globals.h ('k') | src/macros.py » ('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 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 bool record_slots) { 1667 bool record_slots) {
1668 Object* head = 1668 Object* head =
1669 VisitWeakList<Context>( 1669 VisitWeakList<Context>(
1670 this, native_contexts_list(), retainer, record_slots); 1670 this, native_contexts_list(), retainer, record_slots);
1671 // Update the head of the list of contexts. 1671 // Update the head of the list of contexts.
1672 native_contexts_list_ = head; 1672 native_contexts_list_ = head;
1673 } 1673 }
1674 1674
1675 1675
1676 template<> 1676 template<>
1677 struct WeakListVisitor<JSTypedArray> { 1677 struct WeakListVisitor<JSArrayBufferView> {
1678 static void SetWeakNext(JSTypedArray* obj, Object* next) { 1678 static void SetWeakNext(JSArrayBufferView* obj, Object* next) {
1679 obj->set_weak_next(next); 1679 obj->set_weak_next(next);
1680 } 1680 }
1681 1681
1682 static Object* WeakNext(JSTypedArray* obj) { 1682 static Object* WeakNext(JSArrayBufferView* obj) {
1683 return obj->weak_next(); 1683 return obj->weak_next();
1684 } 1684 }
1685 1685
1686 static void VisitLiveObject(Heap*, 1686 static void VisitLiveObject(Heap*,
1687 JSTypedArray* obj, 1687 JSArrayBufferView* obj,
1688 WeakObjectRetainer* retainer, 1688 WeakObjectRetainer* retainer,
1689 bool record_slots) {} 1689 bool record_slots) {}
1690 1690
1691 static void VisitPhantomObject(Heap*, JSTypedArray*) {} 1691 static void VisitPhantomObject(Heap*, JSArrayBufferView*) {}
1692 1692
1693 static int WeakNextOffset() { 1693 static int WeakNextOffset() {
1694 return JSTypedArray::kWeakNextOffset; 1694 return JSArrayBufferView::kWeakNextOffset;
1695 } 1695 }
1696 }; 1696 };
1697 1697
1698 1698
1699 template<> 1699 template<>
1700 struct WeakListVisitor<JSArrayBuffer> { 1700 struct WeakListVisitor<JSArrayBuffer> {
1701 static void SetWeakNext(JSArrayBuffer* obj, Object* next) { 1701 static void SetWeakNext(JSArrayBuffer* obj, Object* next) {
1702 obj->set_weak_next(next); 1702 obj->set_weak_next(next);
1703 } 1703 }
1704 1704
1705 static Object* WeakNext(JSArrayBuffer* obj) { 1705 static Object* WeakNext(JSArrayBuffer* obj) {
1706 return obj->weak_next(); 1706 return obj->weak_next();
1707 } 1707 }
1708 1708
1709 static void VisitLiveObject(Heap* heap, 1709 static void VisitLiveObject(Heap* heap,
1710 JSArrayBuffer* array_buffer, 1710 JSArrayBuffer* array_buffer,
1711 WeakObjectRetainer* retainer, 1711 WeakObjectRetainer* retainer,
1712 bool record_slots) { 1712 bool record_slots) {
1713 Object* typed_array_obj = 1713 Object* typed_array_obj =
1714 VisitWeakList<JSTypedArray>( 1714 VisitWeakList<JSArrayBufferView>(
1715 heap, 1715 heap,
1716 array_buffer->weak_first_array(), 1716 array_buffer->weak_first_view(),
1717 retainer, record_slots); 1717 retainer, record_slots);
1718 array_buffer->set_weak_first_array(typed_array_obj); 1718 array_buffer->set_weak_first_view(typed_array_obj);
1719 if (typed_array_obj != heap->undefined_value() && record_slots) { 1719 if (typed_array_obj != heap->undefined_value() && record_slots) {
1720 Object** slot = HeapObject::RawField( 1720 Object** slot = HeapObject::RawField(
1721 array_buffer, JSArrayBuffer::kWeakFirstArrayOffset); 1721 array_buffer, JSArrayBuffer::kWeakFirstViewOffset);
1722 heap->mark_compact_collector()->RecordSlot(slot, slot, typed_array_obj); 1722 heap->mark_compact_collector()->RecordSlot(slot, slot, typed_array_obj);
1723 } 1723 }
1724 } 1724 }
1725 1725
1726 static void VisitPhantomObject(Heap* heap, JSArrayBuffer* phantom) { 1726 static void VisitPhantomObject(Heap* heap, JSArrayBuffer* phantom) {
1727 Runtime::FreeArrayBuffer(heap->isolate(), phantom); 1727 Runtime::FreeArrayBuffer(heap->isolate(), phantom);
1728 } 1728 }
1729 1729
1730 static int WeakNextOffset() { 1730 static int WeakNextOffset() {
1731 return JSArrayBuffer::kWeakNextOffset; 1731 return JSArrayBuffer::kWeakNextOffset;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
1930 Visit); 1930 Visit);
1931 1931
1932 table_.Register(kVisitJSArrayBuffer, 1932 table_.Register(kVisitJSArrayBuffer,
1933 &ObjectEvacuationStrategy<POINTER_OBJECT>:: 1933 &ObjectEvacuationStrategy<POINTER_OBJECT>::
1934 Visit); 1934 Visit);
1935 1935
1936 table_.Register(kVisitJSTypedArray, 1936 table_.Register(kVisitJSTypedArray,
1937 &ObjectEvacuationStrategy<POINTER_OBJECT>:: 1937 &ObjectEvacuationStrategy<POINTER_OBJECT>::
1938 Visit); 1938 Visit);
1939 1939
1940 table_.Register(kVisitJSDataView,
1941 &ObjectEvacuationStrategy<POINTER_OBJECT>::
1942 Visit);
1943
1940 table_.Register(kVisitJSRegExp, 1944 table_.Register(kVisitJSRegExp,
1941 &ObjectEvacuationStrategy<POINTER_OBJECT>:: 1945 &ObjectEvacuationStrategy<POINTER_OBJECT>::
1942 Visit); 1946 Visit);
1943 1947
1944 if (marks_handling == IGNORE_MARKS) { 1948 if (marks_handling == IGNORE_MARKS) {
1945 table_.Register(kVisitJSFunction, 1949 table_.Register(kVisitJSFunction,
1946 &ObjectEvacuationStrategy<POINTER_OBJECT>:: 1950 &ObjectEvacuationStrategy<POINTER_OBJECT>::
1947 template VisitSpecialized<JSFunction::kSize>); 1951 template VisitSpecialized<JSFunction::kSize>);
1948 } else { 1952 } else {
1949 table_.Register(kVisitJSFunction, &EvacuateJSFunction); 1953 table_.Register(kVisitJSFunction, &EvacuateJSFunction);
(...skipping 6158 matching lines...) Expand 10 before | Expand all | Expand 10 after
8108 if (FLAG_parallel_recompilation) { 8112 if (FLAG_parallel_recompilation) {
8109 heap_->relocation_mutex_->Lock(); 8113 heap_->relocation_mutex_->Lock();
8110 #ifdef DEBUG 8114 #ifdef DEBUG
8111 heap_->relocation_mutex_locked_by_optimizer_thread_ = 8115 heap_->relocation_mutex_locked_by_optimizer_thread_ =
8112 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 8116 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
8113 #endif // DEBUG 8117 #endif // DEBUG
8114 } 8118 }
8115 } 8119 }
8116 8120
8117 } } // namespace v8::internal 8121 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698