Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 isolate->stack_guard()->SetStackLimit(limit); | 332 isolate->stack_guard()->SetStackLimit(limit); |
| 333 } | 333 } |
| 334 | 334 |
| 335 isolate->set_max_available_threads(constraints.max_available_threads()); | 335 isolate->set_max_available_threads(constraints.max_available_threads()); |
| 336 } | 336 } |
| 337 | 337 |
| 338 | 338 |
| 339 i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { | 339 i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { |
| 340 LOG_API(isolate, "Persistent::New"); | 340 LOG_API(isolate, "Persistent::New"); |
| 341 i::Handle<i::Object> result = isolate->global_handles()->Create(*obj); | 341 i::Handle<i::Object> result = isolate->global_handles()->Create(*obj); |
| 342 #ifdef DEBUG | 342 #ifdef VERIFY_HEAP |
| 343 (*obj)->ObjectVerify(); | 343 (*obj)->ObjectVerify(); |
| 344 #endif // DEBUG | 344 #endif // DEBUG |
|
Jakob Kummerow
2014/12/04 08:59:45
nit: s/DEBUG/VERIFY_HEAP/, again below
| |
| 345 return result.location(); | 345 return result.location(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 | 348 |
| 349 i::Object** V8::CopyPersistent(i::Object** obj) { | 349 i::Object** V8::CopyPersistent(i::Object** obj) { |
| 350 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); | 350 i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); |
| 351 #ifdef DEBUG | 351 #ifdef VERIFY_HEAP |
| 352 (*obj)->ObjectVerify(); | 352 (*obj)->ObjectVerify(); |
| 353 #endif // DEBUG | 353 #endif // DEBUG |
| 354 return result.location(); | 354 return result.location(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 | 357 |
| 358 void V8::MakeWeak(i::Object** object, void* parameters, | 358 void V8::MakeWeak(i::Object** object, void* parameters, |
| 359 WeakCallback weak_callback, V8::WeakHandleType weak_type) { | 359 WeakCallback weak_callback, V8::WeakHandleType weak_type) { |
| 360 i::GlobalHandles::PhantomState phantom; | 360 i::GlobalHandles::PhantomState phantom; |
| 361 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom | 361 phantom = weak_type == V8::PhantomHandle ? i::GlobalHandles::Phantom |
| (...skipping 7335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7697 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7697 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7698 Address callback_address = | 7698 Address callback_address = |
| 7699 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7699 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7700 VMState<EXTERNAL> state(isolate); | 7700 VMState<EXTERNAL> state(isolate); |
| 7701 ExternalCallbackScope call_scope(isolate, callback_address); | 7701 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7702 callback(info); | 7702 callback(info); |
| 7703 } | 7703 } |
| 7704 | 7704 |
| 7705 | 7705 |
| 7706 } } // namespace v8::internal | 7706 } } // namespace v8::internal |
| OLD | NEW |