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

Side by Side Diff: src/api.cc

Issue 664473002: Pass an Isolate to v8::VisitHandlesWithClassIds (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « include/v8.h ('k') | test/cctest/test-api.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/api.h" 5 #include "src/api.h"
6 6
7 #include <string.h> // For memcpy, strlen. 7 #include <string.h> // For memcpy, strlen.
8 #ifdef V8_USE_ADDRESS_SANITIZER 8 #ifdef V8_USE_ADDRESS_SANITIZER
9 #include <sanitizer/asan_interface.h> 9 #include <sanitizer/asan_interface.h>
10 #endif // V8_USE_ADDRESS_SANITIZER 10 #endif // V8_USE_ADDRESS_SANITIZER
(...skipping 5097 matching lines...) Expand 10 before | Expand all | Expand 10 after
5108 virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) { 5108 virtual void VisitEmbedderReference(i::Object** p, uint16_t class_id) {
5109 Value* value = ToApi<Value>(i::Handle<i::Object>(p)); 5109 Value* value = ToApi<Value>(i::Handle<i::Object>(p));
5110 visitor_->VisitPersistentHandle( 5110 visitor_->VisitPersistentHandle(
5111 reinterpret_cast<Persistent<Value>*>(&value), class_id); 5111 reinterpret_cast<Persistent<Value>*>(&value), class_id);
5112 } 5112 }
5113 private: 5113 private:
5114 PersistentHandleVisitor* visitor_; 5114 PersistentHandleVisitor* visitor_;
5115 }; 5115 };
5116 5116
5117 5117
5118 void v8::V8::VisitHandlesWithClassIds(v8::Isolate* exported_isolate,
5119 PersistentHandleVisitor* visitor) {
5120 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(exported_isolate);
5121 i::DisallowHeapAllocation no_allocation;
5122
5123 VisitorAdapter visitor_adapter(visitor);
5124 isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter);
5125 }
5126
5127
5118 void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) { 5128 void v8::V8::VisitHandlesWithClassIds(PersistentHandleVisitor* visitor) {
5119 i::Isolate* isolate = i::Isolate::Current(); 5129 i::Isolate* isolate = i::Isolate::Current();
5120 i::DisallowHeapAllocation no_allocation; 5130 i::DisallowHeapAllocation no_allocation;
5121 5131
5122 VisitorAdapter visitor_adapter(visitor); 5132 VisitorAdapter visitor_adapter(visitor);
5123 isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter); 5133 isolate->global_handles()->IterateAllRootsWithClassIds(&visitor_adapter);
5124 } 5134 }
5125 5135
5126 5136
5127 void v8::V8::VisitHandlesForPartialDependence( 5137 void v8::V8::VisitHandlesForPartialDependence(
(...skipping 2565 matching lines...) Expand 10 before | Expand all | Expand 10 after
7693 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7703 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7694 Address callback_address = 7704 Address callback_address =
7695 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7705 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7696 VMState<EXTERNAL> state(isolate); 7706 VMState<EXTERNAL> state(isolate);
7697 ExternalCallbackScope call_scope(isolate, callback_address); 7707 ExternalCallbackScope call_scope(isolate, callback_address);
7698 callback(info); 7708 callback(info);
7699 } 7709 }
7700 7710
7701 7711
7702 } } // namespace v8::internal 7712 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698