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

Side by Side Diff: src/api.cc

Issue 13786002: [WIP] New GC related APIs. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: code review (svenpanne) Created 7 years, 8 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
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 5763 matching lines...) Expand 10 before | Expand all | Expand 10 after
5774 RetainedObjectInfo* info) { 5774 RetainedObjectInfo* info) {
5775 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate); 5775 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5776 ASSERT(isolate == i::Isolate::Current()); 5776 ASSERT(isolate == i::Isolate::Current());
5777 if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return; 5777 if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return;
5778 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); 5778 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
5779 isolate->global_handles()->AddObjectGroup( 5779 isolate->global_handles()->AddObjectGroup(
5780 reinterpret_cast<i::Object***>(objects), length, info); 5780 reinterpret_cast<i::Object***>(objects), length, info);
5781 } 5781 }
5782 5782
5783 5783
5784 void V8::SetObjectGroupId(Isolate* exported_isolate,
5785 const Persistent<Value>& object,
5786 UniqueId id) {
5787 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5788 isolate->global_handles()->SetObjectGroupId(
5789 reinterpret_cast<i::Object**>(*object), id);
5790 }
5791
5792
5793 void V8::SetRetainedObjectInfo(Isolate* exported_isolate,
5794 UniqueId id,
5795 RetainedObjectInfo* info) {
5796 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5797 isolate->global_handles()->SetRetainedObjectInfo(id, info);
5798 }
5799
5800
5784 void V8::AddImplicitReferences(Persistent<Object> parent, 5801 void V8::AddImplicitReferences(Persistent<Object> parent,
5785 Persistent<Value>* children, 5802 Persistent<Value>* children,
5786 size_t length) { 5803 size_t length) {
5787 i::Isolate* isolate = i::Isolate::Current(); 5804 i::Isolate* isolate = i::Isolate::Current();
5788 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; 5805 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return;
5789 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); 5806 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
5790 isolate->global_handles()->AddImplicitReferences( 5807 isolate->global_handles()->AddImplicitReferences(
5791 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), 5808 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(),
5792 reinterpret_cast<i::Object***>(children), length); 5809 reinterpret_cast<i::Object***>(children), length);
5793 } 5810 }
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
7225 7242
7226 v->VisitPointers(blocks_.first(), first_block_limit_); 7243 v->VisitPointers(blocks_.first(), first_block_limit_);
7227 7244
7228 for (int i = 1; i < blocks_.length(); i++) { 7245 for (int i = 1; i < blocks_.length(); i++) {
7229 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7246 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7230 } 7247 }
7231 } 7248 }
7232 7249
7233 7250
7234 } } // namespace v8::internal 7251 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698