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

Side by Side Diff: src/api.cc

Issue 753553002: Phantom references support internal fields (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
« no previous file with comments | « include/v8.h ('k') | src/debug.h » ('j') | src/global-handles.cc » ('J')
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 i::Object** V8::CopyPersistent(i::Object** obj) { 357 i::Object** V8::CopyPersistent(i::Object** obj) {
358 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); 358 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
359 #ifdef DEBUG 359 #ifdef DEBUG
360 (*obj)->ObjectVerify(); 360 (*obj)->ObjectVerify();
361 #endif // DEBUG 361 #endif // DEBUG
362 return result.location(); 362 return result.location();
363 } 363 }
364 364
365 365
366 void V8::MakeWeak(i::Object** object, void* parameters, 366 void V8::MakeWeak(i::Object** object, void* parameter,
367 WeakCallback weak_callback, V8::WeakHandleType weak_type) { 367 WeakCallback weak_callback) {
368 i::GlobalHandles::PhantomState phantom; 368 i::GlobalHandles::MakeWeak(object, parameter, weak_callback);
369 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom
370 : i::GlobalHandles::Nonphantom;
371 i::GlobalHandles::MakeWeak(object, parameters, weak_callback, phantom);
372 } 369 }
373 370
374 371
372 void V8::MakePhantom(i::Object** object, void* parameter,
373 PhantomCallback weak_callback, int internal_field_index1,
374 int internal_field_index2) {
375 i::GlobalHandles::MakePhantom(object, parameter, weak_callback, internal_field _index1, internal_field_index2);
376 }
377
378
375 void* V8::ClearWeak(i::Object** obj) { 379 void* V8::ClearWeak(i::Object** obj) {
376 return i::GlobalHandles::ClearWeakness(obj); 380 return i::GlobalHandles::ClearWeakness(obj);
377 } 381 }
378 382
379 383
380 void V8::DisposeGlobal(i::Object** obj) { 384 void V8::DisposeGlobal(i::Object** obj) {
381 i::GlobalHandles::Destroy(obj); 385 i::GlobalHandles::Destroy(obj);
382 } 386 }
383 387
384 388
(...skipping 7273 matching lines...) Expand 10 before | Expand all | Expand 10 after
7658 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 7662 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
7659 Address callback_address = 7663 Address callback_address =
7660 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 7664 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
7661 VMState<EXTERNAL> state(isolate); 7665 VMState<EXTERNAL> state(isolate);
7662 ExternalCallbackScope call_scope(isolate, callback_address); 7666 ExternalCallbackScope call_scope(isolate, callback_address);
7663 callback(info); 7667 callback(info);
7664 } 7668 }
7665 7669
7666 7670
7667 } } // namespace v8::internal 7671 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | src/debug.h » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698