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

Side by Side Diff: src/api.cc

Issue 649563006: 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: Rebase 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
« no previous file with comments | « include/v8.h ('k') | src/compiler.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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 502
503 i::Object** V8::CopyPersistent(i::Object** obj) { 503 i::Object** V8::CopyPersistent(i::Object** obj) {
504 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); 504 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
505 #ifdef DEBUG 505 #ifdef DEBUG
506 (*obj)->ObjectVerify(); 506 (*obj)->ObjectVerify();
507 #endif // DEBUG 507 #endif // DEBUG
508 return result.location(); 508 return result.location();
509 } 509 }
510 510
511 511
512 void V8::MakeWeak(i::Object** object, 512 void V8::MakeWeak(i::Object** object, void* parameters,
513 void* parameters, 513 WeakCallback weak_callback, V8::WeakHandleType weak_type) {
514 WeakCallback weak_callback) { 514 i::GlobalHandles::PhantomState phantom;
515 i::GlobalHandles::MakeWeak(object, parameters, weak_callback); 515 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom
516 : i::GlobalHandles::Nonphantom;
517 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom);
516 } 518 }
517 519
518 520
519 void* V8::ClearWeak(i::Object** obj) { 521 void* V8::ClearWeak(i::Object** obj) {
520 return i::GlobalHandles::ClearWeakness(obj); 522 return i::GlobalHandles::ClearWeakness(obj);
521 } 523 }
522 524
523 525
524 void V8::DisposeGlobal(i::Object** obj) { 526 void V8::DisposeGlobal(i::Object** obj) {
525 i::GlobalHandles::Destroy(obj); 527 i::GlobalHandles::Destroy(obj);
(...skipping 7239 matching lines...) Expand 10 before | Expand all | Expand 10 after
7765 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7767 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7766 Address callback_address = 7768 Address callback_address =
7767 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7769 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7768 VMState<EXTERNAL> state(isolate); 7770 VMState<EXTERNAL> state(isolate);
7769 ExternalCallbackScope call_scope(isolate, callback_address); 7771 ExternalCallbackScope call_scope(isolate, callback_address);
7770 callback(info); 7772 callback(info);
7771 } 7773 }
7772 7774
7773 7775
7774 } } // namespace v8::internal 7776 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698