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 6698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6709 void Isolate::SetAutorunMicrotasks(bool autorun) { | 6709 void Isolate::SetAutorunMicrotasks(bool autorun) { |
6710 reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); | 6710 reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); |
6711 } | 6711 } |
6712 | 6712 |
6713 | 6713 |
6714 bool Isolate::WillAutorunMicrotasks() const { | 6714 bool Isolate::WillAutorunMicrotasks() const { |
6715 return reinterpret_cast<const i::Isolate*>(this)->autorun_microtasks(); | 6715 return reinterpret_cast<const i::Isolate*>(this)->autorun_microtasks(); |
6716 } | 6716 } |
6717 | 6717 |
6718 | 6718 |
| 6719 void Isolate::SetUseCounterCallback(UseCounterCallback callback) { |
| 6720 reinterpret_cast<i::Isolate*>(this)->SetUseCounterCallback(callback); |
| 6721 } |
| 6722 |
| 6723 |
6719 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) | 6724 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) |
6720 : str_(NULL), length_(0) { | 6725 : str_(NULL), length_(0) { |
6721 i::Isolate* isolate = i::Isolate::Current(); | 6726 i::Isolate* isolate = i::Isolate::Current(); |
6722 if (obj.IsEmpty()) return; | 6727 if (obj.IsEmpty()) return; |
6723 ENTER_V8(isolate); | 6728 ENTER_V8(isolate); |
6724 i::HandleScope scope(isolate); | 6729 i::HandleScope scope(isolate); |
6725 TryCatch try_catch; | 6730 TryCatch try_catch; |
6726 Handle<String> str = obj->ToString(); | 6731 Handle<String> str = obj->ToString(); |
6727 if (str.IsEmpty()) return; | 6732 if (str.IsEmpty()) return; |
6728 i::Handle<i::String> i_str = Utils::OpenHandle(*str); | 6733 i::Handle<i::String> i_str = Utils::OpenHandle(*str); |
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7608 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7613 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7609 Address callback_address = | 7614 Address callback_address = |
7610 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7615 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7611 VMState<EXTERNAL> state(isolate); | 7616 VMState<EXTERNAL> state(isolate); |
7612 ExternalCallbackScope call_scope(isolate, callback_address); | 7617 ExternalCallbackScope call_scope(isolate, callback_address); |
7613 callback(info); | 7618 callback(info); |
7614 } | 7619 } |
7615 | 7620 |
7616 | 7621 |
7617 } } // namespace v8::internal | 7622 } } // namespace v8::internal |
OLD | NEW |