| 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 "api.h" | 5 #include "api.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
| 8 #include <cmath> // For isnan. | 8 #include <cmath> // For isnan. |
| 9 #include "../include/v8-debug.h" | 9 #include "../include/v8-debug.h" |
| 10 #include "../include/v8-profiler.h" | 10 #include "../include/v8-profiler.h" |
| (...skipping 6641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6652 ENTER_V8(i_isolate); | 6652 ENTER_V8(i_isolate); |
| 6653 i::Execution::EnqueueMicrotask(i_isolate, Utils::OpenHandle(*microtask)); | 6653 i::Execution::EnqueueMicrotask(i_isolate, Utils::OpenHandle(*microtask)); |
| 6654 } | 6654 } |
| 6655 | 6655 |
| 6656 | 6656 |
| 6657 void Isolate::SetAutorunMicrotasks(bool autorun) { | 6657 void Isolate::SetAutorunMicrotasks(bool autorun) { |
| 6658 reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); | 6658 reinterpret_cast<i::Isolate*>(this)->set_autorun_microtasks(autorun); |
| 6659 } | 6659 } |
| 6660 | 6660 |
| 6661 | 6661 |
| 6662 bool Isolate::WillAutorunMicrotasks() const { |
| 6663 return reinterpret_cast<const i::Isolate*>(this)->autorun_microtasks(); |
| 6664 } |
| 6665 |
| 6666 |
| 6662 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) | 6667 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) |
| 6663 : str_(NULL), length_(0) { | 6668 : str_(NULL), length_(0) { |
| 6664 i::Isolate* isolate = i::Isolate::Current(); | 6669 i::Isolate* isolate = i::Isolate::Current(); |
| 6665 if (obj.IsEmpty()) return; | 6670 if (obj.IsEmpty()) return; |
| 6666 ENTER_V8(isolate); | 6671 ENTER_V8(isolate); |
| 6667 i::HandleScope scope(isolate); | 6672 i::HandleScope scope(isolate); |
| 6668 TryCatch try_catch; | 6673 TryCatch try_catch; |
| 6669 Handle<String> str = obj->ToString(); | 6674 Handle<String> str = obj->ToString(); |
| 6670 if (str.IsEmpty()) return; | 6675 if (str.IsEmpty()) return; |
| 6671 i::Handle<i::String> i_str = Utils::OpenHandle(*str); | 6676 i::Handle<i::String> i_str = Utils::OpenHandle(*str); |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7594 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7599 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7595 Address callback_address = | 7600 Address callback_address = |
| 7596 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7601 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7597 VMState<EXTERNAL> state(isolate); | 7602 VMState<EXTERNAL> state(isolate); |
| 7598 ExternalCallbackScope call_scope(isolate, callback_address); | 7603 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7599 callback(info); | 7604 callback(info); |
| 7600 } | 7605 } |
| 7601 | 7606 |
| 7602 | 7607 |
| 7603 } } // namespace v8::internal | 7608 } } // namespace v8::internal |
| OLD | NEW |