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

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: fixed 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 void* id) {
5787 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5788 ASSERT(isolate == i::Isolate::Current());
5789 if (IsDeadCheck(isolate, "v8::V8::SetObjectGroupId()")) return;
5790 isolate->global_handles()->SetObjectGroupId(
5791 reinterpret_cast<i::Object**>(*object), id);
5792 }
5793
5794
5795 void V8::SetRetainedObjectInfo(Isolate* exported_isolate,
5796 void* id,
5797 RetainedObjectInfo* info = NULL) {
5798 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5799 ASSERT(isolate == i::Isolate::Current());
5800 if (IsDeadCheck(isolate, "v8::V8::SetRetainedObjectInfo()")) return;
5801 isolate->global_handles()->SetRetainedObjectInfo(id, info);
5802 }
5803
5804
5784 void V8::AddImplicitReferences(Persistent<Object> parent, 5805 void V8::AddImplicitReferences(Persistent<Object> parent,
5785 Persistent<Value>* children, 5806 Persistent<Value>* children,
5786 size_t length) { 5807 size_t length) {
5787 i::Isolate* isolate = i::Isolate::Current(); 5808 i::Isolate* isolate = i::Isolate::Current();
5788 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return; 5809 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return;
5789 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**)); 5810 STATIC_ASSERT(sizeof(Persistent<Value>) == sizeof(i::Object**));
5790 isolate->global_handles()->AddImplicitReferences( 5811 isolate->global_handles()->AddImplicitReferences(
5791 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(), 5812 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(*parent)).location(),
5792 reinterpret_cast<i::Object***>(children), length); 5813 reinterpret_cast<i::Object***>(children), length);
5793 } 5814 }
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
7225 7246
7226 v->VisitPointers(blocks_.first(), first_block_limit_); 7247 v->VisitPointers(blocks_.first(), first_block_limit_);
7227 7248
7228 for (int i = 1; i < blocks_.length(); i++) { 7249 for (int i = 1; i < blocks_.length(); i++) {
7229 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7250 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7230 } 7251 }
7231 } 7252 }
7232 7253
7233 7254
7234 } } // namespace v8::internal 7255 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698