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

Side by Side Diff: src/api.cc

Issue 687003005: Introduce phantom weak handles in the API and use them internally for debug info (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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
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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 483
484 i::Object** V8::CopyPersistent(i::Object** obj) { 484 i::Object** V8::CopyPersistent(i::Object** obj) {
485 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); 485 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
486 #ifdef DEBUG 486 #ifdef DEBUG
487 (*obj)->ObjectVerify(); 487 (*obj)->ObjectVerify();
488 #endif // DEBUG 488 #endif // DEBUG
489 return result.location(); 489 return result.location();
490 } 490 }
491 491
492 492
493 void V8::MakeWeak(i::Object** object, 493 void V8::MakeWeak(i::Object** object, void* parameters,
494 void* parameters, 494 WeakCallback weak_callback, V8::WeakHandleType weak_type) {
495 WeakCallback weak_callback) { 495 i::GlobalHandles::PhantomState phantom;
496 i::GlobalHandles::MakeWeak(object, parameters, weak_callback); 496 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom
497 : i::GlobalHandles::Nonphantom;
498 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom);
497 } 499 }
498 500
499 501
500 void* V8::ClearWeak(i::Object** obj) { 502 void* V8::ClearWeak(i::Object** obj) {
501 return i::GlobalHandles::ClearWeakness(obj); 503 return i::GlobalHandles::ClearWeakness(obj);
502 } 504 }
503 505
504 506
505 void V8::DisposeGlobal(i::Object** obj) { 507 void V8::DisposeGlobal(i::Object** obj) {
506 i::GlobalHandles::Destroy(obj); 508 i::GlobalHandles::Destroy(obj);
(...skipping 7252 matching lines...) Expand 10 before | Expand all | Expand 10 after
7759 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7761 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7760 Address callback_address = 7762 Address callback_address =
7761 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7763 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7762 VMState<EXTERNAL> state(isolate); 7764 VMState<EXTERNAL> state(isolate);
7763 ExternalCallbackScope call_scope(isolate, callback_address); 7765 ExternalCallbackScope call_scope(isolate, callback_address);
7764 callback(info); 7766 callback(info);
7765 } 7767 }
7766 7768
7767 7769
7768 } } // namespace v8::internal 7770 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/compiler.cc » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698