Lines Matching refs:Isolate
62 #define LOG_API(isolate, expr) LOG(isolate, ApiEntryCall(expr))
64 #define ENTER_V8(isolate) \
65 ASSERT((isolate)->IsInitialized()); \
66 i::VMState __state__((isolate), i::OTHER)
67 #define LEAVE_V8(isolate) \
68 i::VMState __state__((isolate), i::EXTERNAL)
72 #define ON_BAILOUT(isolate, location, code) \
73 if (IsDeadCheck(isolate, location) || \
74 IsExecutionTerminatingCheck(isolate)) { \
80 #define EXCEPTION_PREAMBLE(isolate) \
81 (isolate)->handle_scope_implementer()->IncrementCallDepth(); \
82 ASSERT(!(isolate)->external_caught_exception()); \
86 #define EXCEPTION_BAILOUT_CHECK_GENERIC(isolate, value, do_callback) \
89 (isolate)->handle_scope_implementer(); \
93 (isolate)->is_out_of_memory()) { \
94 if (!(isolate)->ignore_out_of_memory()) \
98 (isolate)->OptionalRescheduleException(call_depth_is_zero); \
106 #define EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, value) \
108 isolate, value, i::V8::FireCallCompletedCallback(isolate);)
111 #define EXCEPTION_BAILOUT_CHECK(isolate, value) \
112 EXCEPTION_BAILOUT_CHECK_GENERIC(isolate, value, ;)
115 #define API_ENTRY_CHECK(isolate, msg) \
118 ApiCheck(isolate->thread_manager()->IsLockedByCurrentThread(), \
130 i::VMState __state__(i::Isolate::Current(), i::OTHER);
136 i::Isolate* isolate = i::Isolate::Current();
137 if (isolate->exception_behavior() == NULL) {
138 isolate->set_exception_behavior(DefaultFatalErrorHandler);
140 return isolate->exception_behavior();
203 i::Isolate* isolate = i::Isolate::Current();
207 isolate->heap()->RecordStats(&heap_stats, false);
211 LEAVE_V8(isolate);
265 static inline bool IsDeadCheck(i::Isolate* isolate, const char* location) {
266 return !isolate->IsInitialized()
271 static inline bool IsExecutionTerminatingCheck(i::Isolate* isolate) {
272 if (!isolate->IsInitialized()) return false;
273 if (isolate->has_scheduled_exception()) {
274 return isolate->scheduled_exception() ==
275 isolate->heap()->termination_exception();
299 static inline bool EnsureInitializedForIsolate(i::Isolate* isolate,
301 if (IsDeadCheck(isolate, location)) return false;
302 if (isolate != NULL) {
303 if (isolate->IsInitialized()) return true;
305 ASSERT(isolate == i::Isolate::Current());
311 // If Isolate API is used, Isolate::Enter() will initialize TLS so
312 // Isolate::Current() works. If it's a legacy case, then the thread
316 static inline i::Isolate* EnterIsolateIfNeeded() {
317 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
318 if (isolate != NULL)
319 return isolate;
321 i::Isolate::EnterDefaultIsolate();
322 isolate = i::Isolate::Current();
323 return isolate;
455 i::Isolate* isolate = EnterIsolateIfNeeded();
456 isolate->set_exception_behavior(that);
462 i::Isolate* isolate = EnterIsolateIfNeeded();
463 isolate->set_allow_code_gen_callback(callback);
486 i::Isolate* isolate = i::Isolate::Current();
487 if (IsDeadCheck(isolate, "v8::ThrowException()")) {
490 ENTER_V8(isolate);
494 isolate->ScheduleThrow(isolate->heap()->undefined_value());
496 isolate->ScheduleThrow(*Utils::OpenHandle(*value));
537 i::Isolate* isolate = i::Isolate::Current();
538 if (!EnsureInitializedForIsolate(isolate, "v8::Undefined()")) {
542 isolate->factory()->undefined_value()));
547 i::Isolate* isolate = i::Isolate::Current();
548 if (!EnsureInitializedForIsolate(isolate, "v8::Null()")) {
552 ToApi<Primitive>(isolate->factory()->null_value()));
557 i::Isolate* isolate = i::Isolate::Current();
558 if (!EnsureInitializedForIsolate(isolate, "v8::True()")) {
562 ToApi<Boolean>(isolate->factory()->true_value()));
567 i::Isolate* isolate = i::Isolate::Current();
568 if (!EnsureInitializedForIsolate(isolate, "v8::False()")) {
572 ToApi<Boolean>(isolate->factory()->false_value()));
584 i::Isolate* isolate = EnterIsolateIfNeeded();
591 ASSERT(!isolate->IsInitialized());
592 bool result = isolate->heap()->ConfigureHeap(young_space_size / 2,
599 isolate->stack_guard()->SetStackLimit(limit);
606 i::Isolate* isolate = i::Isolate::Current();
607 if (IsDeadCheck(isolate, "V8::Persistent::New")) return NULL;
608 LOG_API(isolate, "Persistent::New");
610 isolate->global_handles()->Create(*obj);
617 i::Isolate* isolate = i::Isolate::Current();
618 LOG_API(isolate, "MakeWeak");
619 isolate->global_handles()->MakeWeak(object, parameters,
625 i::Isolate* isolate = i::Isolate::Current();
626 LOG_API(isolate, "ClearWeak");
627 isolate->global_handles()->ClearWeakness(obj);
632 i::Isolate* isolate = i::Isolate::Current();
633 LOG_API(isolate, "MakeIndependent");
634 isolate->global_handles()->MarkIndependent(object);
639 i::Isolate* isolate = i::Isolate::Current();
640 LOG_API(isolate, "IsGlobalNearDeath");
641 if (!isolate->IsInitialized()) return false;
647 i::Isolate* isolate = i::Isolate::Current();
648 LOG_API(isolate, "IsGlobalWeak");
649 if (!isolate->IsInitialized()) return false;
655 i::Isolate* isolate = i::Isolate::Current();
656 LOG_API(isolate, "DisposeGlobal");
657 if (!isolate->IsInitialized()) return;
658 isolate->global_handles()->Destroy(obj);
665 i::Isolate* isolate = i::Isolate::Current();
666 API_ENTRY_CHECK(isolate, "HandleScope::HandleScope");
668 isolate->handle_scope_data();
669 isolate_ = isolate;
685 ASSERT(isolate_ == i::Isolate::Current());
704 i::Isolate::Current(), "HandleScope::NumberOfHandles");
710 return i::HandleScope::CreateHandle(value, i::Isolate::Current());
723 i::Isolate* isolate = env->GetIsolate();
724 if (IsDeadCheck(isolate, "v8::Context::Enter()")) return;
725 ENTER_V8(isolate);
727 isolate->handle_scope_implementer()->EnterContext(env);
729 isolate->handle_scope_implementer()->SaveContext(isolate->context());
730 isolate->set_context(*env);
736 // receiver, so we have to get the current isolate from the thread
738 i::Isolate* isolate = i::Isolate::Current();
739 if (!isolate->IsInitialized()) return;
741 if (!ApiCheck(isolate->handle_scope_implementer()->LeaveLastContext(),
749 isolate->handle_scope_implementer()->RestoreContext();
750 isolate->set_context(last_context);
751 isolate->set_context_exit_happened(true);
757 i::Isolate* isolate = env->GetIsolate();
758 if (IsDeadCheck(isolate, "v8::Context::SetData()")) return;
769 i::Isolate* isolate = env->GetIsolate();
770 if (IsDeadCheck(isolate, "v8::Context::GetData()")) {
780 i::Handle<i::Object> result(raw_result, isolate);
820 i::Isolate* isolate = i::Isolate::Current();
821 EnsureInitializedForIsolate(isolate, "v8::Nowhere");
822 ENTER_V8(isolate);
823 value_ = isolate->factory()->NewNeanderObject();
824 i::Handle<i::FixedArray> elements = isolate->factory()->NewFixedArray(size);
886 i::Isolate* isolate = i::Isolate::Current();
887 if (IsDeadCheck(isolate, "v8::Template::Set()")) return;
888 ENTER_V8(isolate);
889 i::HandleScope scope(isolate);
911 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
912 if (IsDeadCheck(isolate, "v8::FunctionTemplate::PrototypeTemplate()")) {
915 ENTER_V8(isolate);
926 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
927 if (IsDeadCheck(isolate, "v8::FunctionTemplate::Inherit()")) return;
928 ENTER_V8(isolate);
935 i::Isolate* isolate = i::Isolate::Current();
936 EnsureInitializedForIsolate(isolate, "v8::FunctionTemplate::New()");
937 LOG_API(isolate, "FunctionTemplate::New");
938 ENTER_V8(isolate);
940 isolate->factory()->NewStruct(i::FUNCTION_TEMPLATE_INFO_TYPE);
944 int next_serial_number = isolate->next_serial_number();
945 isolate->set_next_serial_number(next_serial_number + 1);
962 i::Isolate* isolate = i::Isolate::Current();
963 EnsureInitializedForIsolate(isolate, "v8::Signature::New()");
964 LOG_API(isolate, "Signature::New");
965 ENTER_V8(isolate);
967 isolate->factory()->NewStruct(i::SIGNATURE_INFO_TYPE);
972 i::Handle<i::FixedArray> args = isolate->factory()->NewFixedArray(argc);
990 i::Isolate* isolate = i::Isolate::Current();
991 EnsureInitializedForIsolate(isolate, "v8::TypeSwitch::New()");
992 LOG_API(isolate, "TypeSwitch::New");
993 ENTER_V8(isolate);
994 i::Handle<i::FixedArray> vector = isolate->factory()->NewFixedArray(argc);
998 isolate->factory()->NewStruct(i::TYPE_SWITCH_INFO_TYPE);
1007 i::Isolate* isolate = i::Isolate::Current();
1008 LOG_API(isolate, "TypeSwitch::match");
1009 USE(isolate);
1029 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1030 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetCallHandler()")) return;
1031 ENTER_V8(isolate);
1032 i::HandleScope scope(isolate);
1034 isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE);
1073 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1074 if (IsDeadCheck(isolate,
1078 ENTER_V8(isolate);
1079 i::HandleScope scope(isolate);
1095 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1096 if (IsDeadCheck(isolate, "v8::FunctionTemplate::InstanceTemplate()")
1099 ENTER_V8(isolate);
1112 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1113 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetClassName()")) return;
1114 ENTER_V8(isolate);
1120 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1121 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetHiddenPrototype()")) {
1124 ENTER_V8(isolate);
1130 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1131 if (IsDeadCheck(isolate, "v8::FunctionTemplate::SetPrototypeAttributes()")) {
1134 ENTER_V8(isolate);
1146 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1147 if (IsDeadCheck(isolate,
1151 ENTER_V8(isolate);
1152 i::HandleScope scope(isolate);
1154 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE);
1177 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1178 if (IsDeadCheck(isolate,
1182 ENTER_V8(isolate);
1183 i::HandleScope scope(isolate);
1185 isolate->factory()->NewStruct(i::INTERCEPTOR_INFO_TYPE);
1204 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1205 if (IsDeadCheck(isolate,
1209 ENTER_V8(isolate);
1210 i::HandleScope scope(isolate);
1212 isolate->factory()->NewStruct(i::CALL_HANDLER_INFO_TYPE);
1232 i::Isolate* isolate = i::Isolate::Current();
1233 if (IsDeadCheck(isolate, "v8::ObjectTemplate::New()")) {
1236 EnsureInitializedForIsolate(isolate, "v8::ObjectTemplate::New()");
1237 LOG_API(isolate, "ObjectTemplate::New");
1238 ENTER_V8(isolate);
1240 isolate->factory()->NewStruct(i::OBJECT_TEMPLATE_INFO_TYPE);
1269 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1270 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetAccessor()")) return;
1271 ENTER_V8(isolate);
1272 i::HandleScope scope(isolate);
1292 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1293 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetNamedPropertyHandler()")) {
1296 ENTER_V8(isolate);
1297 i::HandleScope scope(isolate);
1312 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1313 if (IsDeadCheck(isolate, "v8::ObjectTemplate::MarkAsUndetectable()")) return;
1314 ENTER_V8(isolate);
1315 i::HandleScope scope(isolate);
1329 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1330 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetAccessCheckCallbacks()")) {
1333 ENTER_V8(isolate);
1334 i::HandleScope scope(isolate);
1338 isolate->factory()->NewStruct(i::ACCESS_CHECK_INFO_TYPE);
1363 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1364 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetIndexedPropertyHandler()")) {
1367 ENTER_V8(isolate);
1368 i::HandleScope scope(isolate);
1384 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1385 if (IsDeadCheck(isolate,
1389 ENTER_V8(isolate);
1390 i::HandleScope scope(isolate);
1409 Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1410 if (IsDeadCheck(isolate, "v8::ObjectTemplate::SetInternalFieldCount()")) {
1418 ENTER_V8(isolate);
1480 i::Isolate* isolate = i::Isolate::Current();
1481 ON_BAILOUT(isolate, "v8::Script::New()", return Local<Script>());
1482 LOG_API(isolate, "Script::New");
1483 ENTER_V8(isolate);
1485 { i::HandleScope scope(isolate);
1502 EXCEPTION_PREAMBLE(isolate);
1522 EXCEPTION_BAILOUT_CHECK(isolate, Local<Script>());
1525 i::Handle<i::SharedFunctionInfo> result(raw_result, isolate);
1541 i::Isolate* isolate = i::Isolate::Current();
1542 ON_BAILOUT(isolate, "v8::Script::Compile()", return Local<Script>());
1543 LOG_API(isolate, "Script::Compile");
1544 ENTER_V8(isolate);
1552 isolate->factory()->NewFunctionFromSharedFunctionInfo(
1554 isolate->global_context());
1568 i::Isolate* isolate = i::Isolate::Current();
1569 ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>());
1570 LOG_API(isolate, "Script::Run");
1571 ENTER_V8(isolate);
1574 i::HandleScope scope(isolate);
1579 function_info(i::SharedFunctionInfo::cast(*obj), isolate);
1580 fun = isolate->factory()->NewFunctionFromSharedFunctionInfo(
1581 function_info, isolate->global_context());
1583 fun = i::Handle<i::JSFunction>(i::JSFunction::cast(*obj), isolate);
1585 EXCEPTION_PREAMBLE(isolate);
1587 isolate->context()->global_proxy(), isolate);
1590 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<Value>());
1593 i::Handle<i::Object> result(raw_result, isolate);
1613 i::Isolate* isolate = i::Isolate::Current();
1614 ON_BAILOUT(isolate, "v8::Script::Id()", return Local<Value>());
1615 LOG_API(isolate, "Script::Id");
1618 i::HandleScope scope(isolate);
1630 i::Isolate* isolate = i::Isolate::Current();
1631 ON_BAILOUT(isolate, "v8::Script::SetData()", return);
1632 LOG_API(isolate, "Script::SetData");
1634 i::HandleScope scope(isolate);
1647 : isolate_(i::Isolate::Current()),
1660 ASSERT(isolate_ == i::Isolate::Current());
1690 ASSERT(isolate_ == i::Isolate::Current());
1702 ASSERT(isolate_ == i::Isolate::Current());
1720 ASSERT(isolate_ == i::Isolate::Current());
1731 ASSERT(isolate_ == i::Isolate::Current());
1751 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1752 ON_BAILOUT(isolate, "v8::Message::Get()", return Local<String>());
1753 ENTER_V8(isolate);
1763 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1764 if (IsDeadCheck(isolate, "v8::Message::GetScriptResourceName()")) {
1767 ENTER_V8(isolate);
1780 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1781 if (IsDeadCheck(isolate, "v8::Message::GetScriptResourceData()")) {
1784 ENTER_V8(isolate);
1797 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1798 if (IsDeadCheck(isolate, "v8::Message::GetStackTrace()")) {
1801 ENTER_V8(isolate);
1818 i::Isolate* isolate = i::Isolate::Current();
1819 i::Handle<i::String> fmt_str = isolate->factory()->LookupAsciiSymbol(name);
1821 isolate->js_builtins_object()->GetPropertyNoExceptionThrown(*fmt_str);
1835 i::Isolate::Current()->js_builtins_object(),
1843 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1844 ON_BAILOUT(isolate, "v8::Message::GetLineNumber()", return kNoLineNumberInfo);
1845 ENTER_V8(isolate);
1846 i::HandleScope scope(isolate);
1848 EXCEPTION_PREAMBLE(isolate);
1852 EXCEPTION_BAILOUT_CHECK(isolate, 0);
1858 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1859 if (IsDeadCheck(isolate, "v8::Message::GetStartPosition()")) return 0;
1860 ENTER_V8(isolate);
1861 i::HandleScope scope(isolate);
1869 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1870 if (IsDeadCheck(isolate, "v8::Message::GetEndPosition()")) return 0;
1871 ENTER_V8(isolate);
1872 i::HandleScope scope(isolate);
1880 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1881 if (IsDeadCheck(isolate, "v8::Message::GetStartColumn()")) {
1884 ENTER_V8(isolate);
1885 i::HandleScope scope(isolate
1887 EXCEPTION_PREAMBLE(isolate);
1892 EXCEPTION_BAILOUT_CHECK(isolate, 0);
1898 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1899 if (IsDeadCheck(isolate, "v8::Message::GetEndColumn()")) return kNoColumnInfo;
1900 ENTER_V8(isolate);
1901 i::HandleScope scope(isolate);
1903 EXCEPTION_PREAMBLE(isolate);
1908 EXCEPTION_BAILOUT_CHECK(isolate, 0);
1918 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1919 ON_BAILOUT(isolate, "v8::Message::GetSourceLine()", return Local<String>());
1920 ENTER_V8(isolate);
1922 EXCEPTION_PREAMBLE(isolate);
1926 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::String>());
1936 i::Isolate* isolate = i::Isolate::Current();
1937 if (IsDeadCheck(isolate, "v8::Message::PrintCurrentStackTrace()")) return;
1938 ENTER_V8(isolate);
1939 isolate->PrintCurrentStackTrace(out);
1946 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1947 if (IsDeadCheck(isolate, "v8::StackTrace::GetFrame()")) {
1950 ENTER_V8(isolate);
1960 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1961 if (IsDeadCheck(isolate, "v8::StackTrace::GetFrameCount()")) return -1;
1962 ENTER_V8(isolate);
1968 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1969 if (IsDeadCheck(isolate, "v8::StackTrace::AsArray()")) Local<Array>();
1970 ENTER_V8(isolate);
1977 i::Isolate* isolate = i::Isolate::Current();
1978 if (IsDeadCheck(isolate, "v8::StackTrace::CurrentStackTrace()")) {
1981 ENTER_V8(isolate);
1983 isolate->CaptureCurrentStackTrace(frame_limit, options);
1991 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
1992 if (IsDeadCheck(isolate, "v8::StackFrame::GetLineNumber()")) {
1995 ENTER_V8(isolate);
1996 i::HandleScope scope(isolate);
2007 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2008 if (IsDeadCheck(isolate, "v8::StackFrame::GetColumn()")) {
2011 ENTER_V8(isolate);
2012 i::HandleScope scope(isolate);
2023 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2024 if (IsDeadCheck(isolate, "v8::StackFrame::GetScriptName()")) {
2027 ENTER_V8(isolate);
2039 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2040 if (IsDeadCheck(isolate, "v8::StackFrame::GetScriptNameOrSourceURL()")) {
2043 ENTER_V8(isolate);
2055 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2056 if (IsDeadCheck(isolate, "v8::StackFrame::GetFunctionName()")) {
2059 ENTER_V8(isolate);
2071 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2072 if (IsDeadCheck(isolate, "v8::StackFrame::IsEval()")) return false;
2073 ENTER_V8(isolate);
2074 i::HandleScope scope(isolate);
2082 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2083 if (IsDeadCheck(isolate, "v8::StackFrame::IsConstructor()")) return false;
2084 ENTER_V8(isolate);
2085 i::HandleScope scope(isolate);
2095 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsUndefined()")) {
2103 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsNull()")) return false;
2109 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsTrue()")) return false;
2115 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsFalse()")) return false;
2121 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsFunction()")) {
2129 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsString()")) return false;
2137 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsArray()")) return false;
2143 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsObject()")) return false;
2149 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsNumber()")) return false;
2155 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsBoolean()")) {
2163 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsExternal()")) {
2171 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsInt32()")) return false;
2188 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsUint32()")) return false;
2205 i::Isolate* isolate = i::Isolate::Current();
2206 if (IsDeadCheck(isolate, "v8::Value::IsDate()")) return false;
2208 return obj->HasSpecificClassOf(isolate->heap()->Date_symbol());
2213 i::Isolate* isolate = i::Isolate::Current();
2214 if (IsDeadCheck(isolate, "v8::Value::IsStringObject()")) return false;
2216 return obj->HasSpecificClassOf(isolate->heap()->String_symbol());
2221 i::Isolate* isolate = i::Isolate::Current();
2222 if (IsDeadCheck(isolate, "v8::Value::IsNumberObject()")) return false;
2224 return obj->HasSpecificClassOf(isolate->heap()->Number_symbol());
2228 static i::Object* LookupBuiltin(i::Isolate* isolate,
2231 isolate->factory()->LookupAsciiSymbol(builtin_name);
2232 i::Handle<i::JSBuiltinsObject> builtins = isolate->js_builtins_object();
2237 static bool CheckConstructor(i::Isolate* isolate,
2240 return obj->map()->constructor() == LookupBuiltin(isolate, class_name);
2245 i::Isolate* isolate = i::Isolate::Current();
2246 if (IsDeadCheck(isolate, "v8::Value::IsNativeError()")) return false;
2250 return CheckConstructor(isolate, js_obj, "$Error") ||
2251 CheckConstructor(isolate, js_obj, "$EvalError") ||
2252 CheckConstructor(isolate, js_obj, "$RangeError") ||
2253 CheckConstructor(isolate, js_obj, "$ReferenceError") ||
2254 CheckConstructor(isolate, js_obj, "$SyntaxError") ||
2255 CheckConstructor(isolate, js_obj, "$TypeError") ||
2256 CheckConstructor(isolate, js_obj, "$URIError");
2264 i::Isolate* isolate = i::Isolate::Current();
2265 if (IsDeadCheck(isolate, "v8::Value::IsBooleanObject()")) return false;
2267 return obj->HasSpecificClassOf(isolate->heap()->Boolean_symbol());
2272 if (IsDeadCheck(i::Isolate::Current(), "v8::Value::IsRegExp()")) return false;
2284 i::Isolate* isolate = i::Isolate::Current();
2285 if (IsDeadCheck(isolate, "v8::Value::ToString()")) {
2288 LOG_API(isolate, "ToString");
2289 ENTER_V8(isolate);
2290 EXCEPTION_PREAMBLE(isolate);
2292 EXCEPTION_BAILOUT_CHECK(isolate, Local<String>());
2304 i::Isolate* isolate = i::Isolate::Current();
2305 if (IsDeadCheck(isolate, "v8::Value::ToDetailString()")) {
2308 LOG_API(isolate, "ToDetailString");
2309 ENTER_V8(isolate);
2310 EXCEPTION_PREAMBLE(isolate);
2312 EXCEPTION_BAILOUT_CHECK(isolate, Local<String>());
2324 i::Isolate* isolate = i::Isolate::Current();
2325 if (IsDeadCheck(isolate, "v8::Value::ToObject()")) {
2328 LOG_API(isolate, "ToObject");
2329 ENTER_V8(isolate);
2330 EXCEPTION_PREAMBLE(isolate);
2332 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Object>());
2343 i::Isolate* isolate = i::Isolate::Current();
2344 if (IsDeadCheck(isolate, "v8::Value::ToBoolean()")) {
2347 LOG_API(isolate, "ToBoolean");
2348 ENTER_V8(isolate);
2361 i::Isolate* isolate = i::Isolate::Current();
2362 if (IsDeadCheck(isolate, "v8::Value::ToNumber()")) {
2365 LOG_API(isolate, "ToNumber");
2366 ENTER_V8(isolate);
2367 EXCEPTION_PREAMBLE(isolate);
2369 EXCEPTION_BAILOUT_CHECK(isolate, Local<Number>());
2381 i::Isolate* isolate = i::Isolate::Current();
2382 if (IsDeadCheck(isolate, "v8::Value::ToInteger()")) return Local<Integer>();
2383 LOG_API(isolate, "ToInteger");
2384 ENTER_V8(isolate);
2385 EXCEPTION_PREAMBLE(isolate);
2387 EXCEPTION_BAILOUT_CHECK(isolate, Local<Integer>());
2394 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Cast()")) return;
2403 if (IsDeadCheck(i::Isolate::Current(), "v8::Object::Cast()")) return;
2412 if (IsDeadCheck(i::Isolate::Current(), "v8::Function::Cast()")) return;
2421 if (IsDeadCheck(i::Isolate::Current(), "v8::String::Cast()")) return;
2430 if (IsDeadCheck(i::Isolate::Current(), "v8::Number::Cast()")) return;
2439 if (IsDeadCheck(i::Isolate::Current(), "v8::Integer::Cast()")) return;
2448 if (IsDeadCheck(i::Isolate::Current(), "v8::Array::Cast()")) return;
2457 i::Isolate* isolate = i::Isolate::Current();
2458 if (IsDeadCheck(isolate, "v8::Date::Cast()")) return;
2460 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Date_symbol()),
2467 i::Isolate* isolate = i::Isolate::Current();
2468 if (IsDeadCheck(isolate, "v8::StringObject::Cast()")) return;
2470 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->String_symbol()),
2477 i::Isolate* isolate = i::Isolate::Current();
2478 if (IsDeadCheck(isolate, "v8::NumberObject::Cast()")) return;
2480 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Number_symbol()),
2487 i::Isolate* isolate = i::Isolate::Current();
2488 if (IsDeadCheck(isolate, "v8::BooleanObject::Cast()")) return;
2490 ApiCheck(obj->HasSpecificClassOf(isolate->heap()->Boolean_symbol()),
2497 if (IsDeadCheck(i::Isolate::Current(), "v8::RegExp::Cast()")) return;
2510 i::Isolate* isolate = i::Isolate::Current();
2511 if (IsDeadCheck(isolate, "v8::Value::BooleanValue()")) return false;
2512 LOG_API(isolate, "BooleanValue");
2513 ENTER_V8(isolate);
2526 i::Isolate* isolate = i::Isolate::Current();
2527 if (IsDeadCheck(isolate, "v8::Value::NumberValue()")) {
2530 LOG_API(isolate, "NumberValue");
2531 ENTER_V8(isolate);
2532 EXCEPTION_PREAMBLE(isolate);
2534 EXCEPTION_BAILOUT_CHECK(isolate, i::OS::nan_value());
2546 i::Isolate* isolate = i::Isolate::Current();
2547 if (IsDeadCheck(isolate, "v8::Value::IntegerValue()")) return 0;
2548 LOG_API(isolate, "IntegerValue");
2549 ENTER_V8(isolate);
2550 EXCEPTION_PREAMBLE(isolate);
2552 EXCEPTION_BAILOUT_CHECK(isolate, 0);
2568 i::Isolate* isolate = i::Isolate::Current();
2569 if (IsDeadCheck(isolate, "v8::Value::ToInt32()")) return Local<Int32>();
2570 LOG_API(isolate, "ToInt32");
2571 ENTER_V8(isolate);
2572 EXCEPTION_PREAMBLE(isolate);
2574 EXCEPTION_BAILOUT_CHECK(isolate, Local<Int32>());
2586 i::Isolate* isolate = i::Isolate::Current();
2587 if (IsDeadCheck(isolate, "v8::Value::ToUint32()")) return Local<Uint32>();
2588 LOG_API(isolate, "ToUInt32");
2589 ENTER_V8(isolate);
2590 EXCEPTION_PREAMBLE(isolate);
2592 EXCEPTION_BAILOUT_CHECK(isolate, Local<Uint32>());
2604 i::Isolate* isolate = i::Isolate::Current();
2605 if (IsDeadCheck(isolate, "v8::Value::ToArrayIndex()")) return Local<Uint32>();
2606 LOG_API(isolate, "ToArrayIndex");
2607 ENTER_V8(isolate);
2608 EXCEPTION_PREAMBLE(isolate);
2611 EXCEPTION_BAILOUT_CHECK(isolate, Local<Uint32>());
2619 value = isolate->factory()->NewNumber(index);
2632 i::Isolate* isolate = i::Isolate::Current();
2633 if (IsDeadCheck(isolate, "v8::Value::Int32Value()")) return 0;
2634 LOG_API(isolate, "Int32Value (slow)");
2635 ENTER_V8(isolate);
2636 EXCEPTION_PREAMBLE(isolate);
2639 EXCEPTION_BAILOUT_CHECK(isolate, 0);
2650 i::Isolate* isolate = i::Isolate::Current();
2651 if (IsDeadCheck(isolate, "v8::Value::Equals()")
2656 LOG_API(isolate, "Equals");
2657 ENTER_V8(isolate);
2667 EXCEPTION_PREAMBLE(isolate);
2671 EXCEPTION_BAILOUT_CHECK(isolate, false);
2677 i::Isolate* isolate = i::Isolate::Current();
2678 if (IsDeadCheck(isolate, "v8::Value::StrictEquals()")
2683 LOG_API(isolate, "StrictEquals");
2713 i::Isolate* isolate = i::Isolate::Current();
2714 if (IsDeadCheck(isolate, "v8::Value::Uint32Value()")) return 0;
2715 LOG_API(isolate, "Uint32Value");
2716 ENTER_V8(isolate);
2717 EXCEPTION_PREAMBLE(isolate);
2720 EXCEPTION_BAILOUT_CHECK(isolate, 0);
2732 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2733 ON_BAILOUT(isolate, "v8::Object::Set()", return false);
2734 ENTER_V8(isolate);
2735 i::HandleScope scope(isolate);
2739 EXCEPTION_PREAMBLE(isolate);
2747 EXCEPTION_BAILOUT_CHECK(isolate, false);
2753 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2754 ON_BAILOUT(isolate, "v8::Object::Set()", return false);
2755 ENTER_V8(isolate);
2756 i::HandleScope scope(isolate);
2759 EXCEPTION_PREAMBLE(isolate);
2767 EXCEPTION_BAILOUT_CHECK(isolate, false);
2775 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2776 ON_BAILOUT(isolate, "v8::Object::ForceSet()", return false);
2777 ENTER_V8(isolate);
2778 i::HandleScope scope(isolate);
2782 EXCEPTION_PREAMBLE(isolate);
2789 EXCEPTION_BAILOUT_CHECK(isolate, false);
2795 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2796 ON_BAILOUT(isolate, "v8::Object::ForceDelete()", return false);
2797 ENTER_V8(isolate);
2798 i::HandleScope scope(isolate);
2806 EXCEPTION_PREAMBLE(isolate);
2809 EXCEPTION_BAILOUT_CHECK(isolate, false);
2815 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2816 ON_BAILOUT(isolate, "v8::Object::Get()", return Local<v8::Value>());
2817 ENTER_V8(isolate);
2820 EXCEPTION_PREAMBLE(isolate);
2823 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
2829 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2830 ON_BAILOUT(isolate, "v8::Object::Get()", return Local<v8::Value>());
2831 ENTER_V8(isolate);
2833 EXCEPTION_PREAMBLE(isolate);
2836 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
2842 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2843 ON_BAILOUT(isolate, "v8::Object::GetPropertyAttribute()",
2845 ENTER_V8(isolate);
2846 i::HandleScope scope(isolate);
2850 EXCEPTION_PREAMBLE(isolate);
2852 EXCEPTION_BAILOUT_CHECK(isolate, static_cast<PropertyAttribute>(NONE));
2862 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2863 ON_BAILOUT(isolate, "v8::Object::GetPrototype()",
2865 ENTER_V8(isolate);
2873 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2874 ON_BAILOUT(isolate, "v8::Object::SetPrototype()", return false);
2875 ENTER_V8(isolate);
2881 EXCEPTION_PREAMBLE(isolate);
2884 EXCEPTION_BAILOUT_CHECK(isolate, false);
2891 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2892 ON_BAILOUT(isolate,
2895 ENTER_V8(isolate);
2908 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2909 ON_BAILOUT(isolate, "v8::Object::GetPropertyNames()",
2911 ENTER_V8(isolate);
2912 i::HandleScope scope(isolate);
2921 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value);
2923 isolate->factory()->NewJSArrayWithElements(elms);
2929 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2930 ON_BAILOUT(isolate, "v8::Object::GetOwnPropertyNames()",
2932 ENTER_V8(isolate);
2933 i::HandleScope scope(isolate);
2942 i::Handle<i::FixedArray> elms = isolate->factory()->CopyFixedArray(value);
2944 isolate->factory()->NewJSArrayWithElements(elms);
2950 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
2951 ON_BAILOUT(isolate, "v8::Object::ObjectProtoToString()",
2953 ENTER_V8(isolate);
3004 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3005 ON_BAILOUT(isolate, "v8::Object::GetConstructorName()",
3007 ENTER_V8(isolate);
3015 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3016 ON_BAILOUT(isolate, "v8::Object::Delete()", return false);
3017 ENTER_V8(isolate);
3018 i::HandleScope scope(isolate);
3026 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3027 ON_BAILOUT(isolate, "v8::Object::Has()", return false);
3028 ENTER_V8(isolate);
3036 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3037 ON_BAILOUT(isolate, "v8::Object::DeleteProperty()",
3039 ENTER_V8(isolate);
3047 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3048 ON_BAILOUT(isolate, "v8::Object::HasProperty()", return false);
3060 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3061 ON_BAILOUT(isolate, "v8::Object::SetAccessor()", return false);
3062 ENTER_V8(isolate);
3063 i::HandleScope scope(isolate);
3076 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3077 ON_BAILOUT(isolate, "v8::Object::HasOwnProperty()",
3085 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3086 ON_BAILOUT(isolate, "v8::Object::HasRealNamedProperty()",
3102 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3103 ON_BAILOUT(isolate,
3106 ENTER_V8(isolate);
3113 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3114 ON_BAILOUT(isolate, "v8::Object::HasNamedLookupInterceptor()",
3121 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3122 ON_BAILOUT(isolate, "v8::Object::HasIndexedLookupInterceptor()",
3128 static Local<Value> GetPropertyByLookup(i::Isolate* isolate,
3139 EXCEPTION_PREAMBLE(isolate);
3145 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
3153 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3154 ON_BAILOUT(isolate,
3157 ENTER_V8(isolate);
3160 i::LookupResult lookup(isolate);
3162 return GetPropertyByLookup(isolate, self_obj, key_obj, &lookup);
3167 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3168 ON_BAILOUT(isolate, "v8::Object::GetRealNamedProperty()",
3170 ENTER_V8(isolate);
3173 i::LookupResult lookup(isolate);
3175 return GetPropertyByLookup(isolate, self_obj, key_obj, &lookup);
3183 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3184 ON_BAILOUT(isolate, "v8::Object::TurnOnAccessCheck()", return);
3185 ENTER_V8(isolate);
3186 i::HandleScope scope(isolate);
3194 isolate->factory()->CopyMapDropTransitions(i::Handle<i::Map>(obj->map()));
3206 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3207 ON_BAILOUT(isolate, "v8::Object::Clone()", return Local<Object>());
3208 ENTER_V8(isolate);
3210 EXCEPTION_PREAMBLE(isolate);
3213 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
3234 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3235 ON_BAILOUT(isolate,
3237 ENTER_V8(isolate);
3245 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3246 ON_BAILOUT(isolate, "v8::Object::GetIdentityHash()", return 0);
3247 ENTER_V8(isolate);
3248 i::HandleScope scope(isolate);
3256 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3257 ON_BAILOUT(isolate, "v8::Object::SetHiddenValue()", return false);
3258 ENTER_V8(isolate);
3259 i::HandleScope scope(isolate);
3270 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3271 ON_BAILOUT(isolate, "v8::Object::GetHiddenValue()",
3273 ENTER_V8(isolate);
3283 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3284 ON_BAILOUT(isolate, "v8::DeleteHiddenValue()", return false);
3285 ENTER_V8(isolate);
3286 i::HandleScope scope(isolate);
3336 i::Isolate* isolate = object->GetIsolate();
3338 isolate->factory()->NewExternalArray(length, array_type, data);
3341 isolate->factory()->GetElementsTransitionMap(
3353 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3354 ON_BAILOUT(isolate
3355 ENTER_V8(isolate);
3356 i::HandleScope scope(isolate);
3409 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3410 ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return);
3411 ENTER_V8(isolate);
3412 i::HandleScope scope(isolate);
3494 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3495 ON_BAILOUT(isolate, "v8::Object::IsCallable()", return false);
3496 ENTER_V8(isolate);
3497 i::HandleScope scope(isolate);
3507 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3508 ON_BAILOUT(isolate, "v8::Object::CallAsFunction()",
3510 LOG_API(isolate, "Object::CallAsFunction");
3511 ENTER_V8(isolate);
3512 i::HandleScope scope(isolate);
3521 EXCEPTION_PREAMBLE(isolate);
3524 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
3528 EXCEPTION_PREAMBLE(isolate);
3531 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<Value>());
3538 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3539 ON_BAILOUT(isolate, "v8::Object::CallAsConstructor()",
3541 LOG_API(isolate, "Object::CallAsConstructor");
3542 ENTER_V8(isolate);
3543 i::HandleScope scope(isolate);
3549 EXCEPTION_PREAMBLE(isolate);
3552 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<v8::Object>());
3556 EXCEPTION_PREAMBLE(isolate);
3559 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Object>());
3562 EXCEPTION_PREAMBLE(isolate);
3565 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<v8::Object>());
3580 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3581 ON_BAILOUT(isolate, "v8::Function::NewInstance()",
3583 LOG_API(isolate, "Function::NewInstance");
3584 ENTER_V8(isolate);
3589 EXCEPTION_PREAMBLE(isolate);
3592 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<v8::Object>());
3599 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3600 ON_BAILOUT(isolate, "v8::Function::Call()", return Local<v8::Value>());
3601 LOG_API(isolate, "Function::Call");
3602 ENTER_V8(isolate);
3605 i::HandleScope scope(isolate);
3610 EXCEPTION_PREAMBLE(isolate);
3613 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<Object>());
3622 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3623 ENTER_V8(isolate);
3624 USE(isolate);
3801 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3802 if (IsDeadCheck(isolate
3803 LOG_API(isolate, "String::WriteUtf8");
3804 ENTER_V8(isolate);
3860 i::StringInputBuffer& write_input_buffer = *isolate->write_input_buffer();
3861 isolate->string_tracker()->RecordWrite(str);
3932 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3933 if (IsDeadCheck(isolate, "v8::String::WriteAscii()")) return 0;
3934 LOG_API(isolate, "String::WriteAscii");
3935 ENTER_V8(isolate);
3936 i::StringInputBuffer& write_input_buffer = *isolate->write_input_buffer();
3939 isolate->string_tracker()->RecordWrite(str);
3966 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
3967 if (IsDeadCheck(isolate, "v8::String::Write()")) return 0;
3968 LOG_API(isolate, "String::Write");
3969 ENTER_V8(isolate);
3972 isolate->string_tracker()->RecordWrite(str);
4043 if (IsDeadCheck(i::Isolate::Current(), "v8::Number::Value()")) return 0;
4050 if (IsDeadCheck(i::Isolate::Current(), "v8::Boolean::Value()")) return false;
4057 if (IsDeadCheck(i::Isolate::Current(), "v8::Integer::Value()")) return 0;
4068 if (IsDeadCheck(i::Isolate::Current(), "v8::Int32::Value()")) return 0;
4079 if (IsDeadCheck(i::Isolate::Current(), "v8::Uint32::Value()")) return 0;
4120 i::Isolate* isolate = obj->GetIsolate();
4121 if (IsDeadCheck(isolate, "v8::Object::SetInternalField()")) {
4129 ENTER_V8(isolate);
4153 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
4154 ENTER_V8(isolate);
4160 isolate->factory()->NewForeign(
4173 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
4174 if (isolate != NULL && isolate->IsInitialized()) {
4193 i::Isolate* isolate = i::Isolate::Current();
4194 if (!ApiCheck(isolate != NULL && isolate->IsDefaultIsolate(),
4196 "Use v8::Isolate::Dispose() for a non-default isolate.")) {
4211 if (!i::Isolate::Current()->IsInitialized()) {
4212 // Isolate is unitialized thus heap is not configured yet.
4220 i::Heap* heap = i::Isolate::Current()->heap();
4230 i::Isolate* isolate = i::Isolate::Current();
4231 IsDeadCheck(isolate, "v8::V8::VisitExternalResources");
4232 isolate->heap()->VisitExternalResources(visitor);
4239 i::Isolate* isolate = i::Isolate::Current();
4240 if (isolate == NULL || !isolate->IsInitialized()) return true;
4246 i::Isolate* isolate = i::Isolate::Current();
4247 if (isolate == NULL || !isolate->IsInitialized()) return;
4248 isolate->heap()->CollectAllAvailableGarbage("low memory notification");
4253 i::Isolate* isolate = i::Isolate::Current();
4254 if (!isolate->IsInitialized()) return 0;
4255 return isolate->heap()->NotifyContextDisposed();
4280 i::Isolate::EnsureDefaultIsolate();
4281 i::Isolate* isolate = i::Isolate::Current();
4282 EnsureInitializedForIsolate(isolate, "v8::Context::New()");
4283 LOG_API(isolate, "Context::New");
4284 ON_BAILOUT(isolate, "v8::Context::New()", return Persistent<Context>());
4289 ENTER_V8(isolate);
4319 isolate->heap()->undefined_value());
4324 env = isolate->bootstrapper()->CreateEnvironment(
4325 isolate,
4339 isolate->runtime_profiler()->Reset();
4351 i::Isolate* isolate = i::Isolate::Current();
4352 if (IsDeadCheck(isolate, "v8::Context::SetSecurityToken()")) {
4355 ENTER_V8(isolate);
4363 i::Isolate* isolate = i::Isolate::Current();
4364 if (IsDeadCheck(isolate,
4368 ENTER_V8(isolate);
4375 i::Isolate* isolate = i::Isolate::Current();
4376 if (IsDeadCheck(isolate, "v8::Context::GetSecurityToken()")) {
4393 return i::Isolate::Current()->context() != NULL;
4398 i::Isolate* isolate = i::Isolate::Current();
4399 if (!EnsureInitializedForIsolate(isolate, "v8::Context::GetEntered()")) {
4403 isolate->handle_scope_implementer()->LastEnteredContext();
4411 i::Isolate* isolate = i::Isolate::Current();
4412 if (IsDeadCheck(isolate, "v8::Context::GetCurrent()")) {
4415 i::Handle<i::Object> current = isolate->global_context();
4423 i::Isolate* isolate = i::Isolate::Current();
4424 if (IsDeadCheck(isolate, "v8::Context::GetCalling()")) {
4428 isolate->GetCallingGlobalContext();
4436 if (IsDeadCheck(i::Isolate::Current(), "v8::Context::Global()")) {
4448 i::Isolate* isolate = i::Isolate::Current();
4449 if (IsDeadCheck(isolate, "v8::Context::DetachGlobal()")) return;
4450 ENTER_V8(isolate);
4454 isolate->bootstrapper()->DetachGlobal(context);
4459 i::Isolate* isolate = i::Isolate::Current();
4460 if (IsDeadCheck(isolate, "v8::Context::ReattachGlobal()")) return;
4461 ENTER_V8(isolate);
4465 isolate->bootstrapper()->ReattachGlobal(
4472 i::Isolate* isolate = i::Isolate::Current();
4473 if (IsDeadCheck(isolate, "v8::Context::AllowCodeGenerationFromStrings()")) {
4476 ENTER_V8(isolate);
4481 allow ? isolate->heap()->true_value() : isolate->heap()->false_value());
4486 i::Isolate* isolate = i::Isolate::Current();
4487 if (IsDeadCheck(isolate,
4491 ENTER_V8(isolate);
4505 i::Isolate* isolate = i::Isolate::Current();
4506 ON_BAILOUT(isolate, "v8::ObjectTemplate::NewInstance()",
4508 LOG_API(isolate, "ObjectTemplate::NewInstance");
4509 ENTER_V8(isolate);
4510 EXCEPTION_PREAMBLE(isolate);
4514 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Object>());
4520 i::Isolate* isolate = i::Isolate::Current();
4521 ON_BAILOUT(isolate, "v8::FunctionTemplate::GetFunction()",
4523 LOG_API(isolate, "FunctionTemplate::GetFunction");
4524 ENTER_V8(isolate);
4525 EXCEPTION_PREAMBLE(isolate);
4529 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Function>());
4535 ON_BAILOUT(i::Isolate::Current(), "v8::FunctionTemplate::HasInstanceOf()",
4552 i::Isolate* isolate = i::Isolate::Current();
4554 EnsureInitializedForIsolate(isolate, "v8::External::Wrap()");
4555 LOG_API(isolate, "External::Wrap");
4556 ENTER_V8(isolate);
4581 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Unwrap()")) return 0;
4598 i::Isolate* isolate = i::Isolate::Current();
4599 EnsureInitializedForIsolate(isolate, "v8::External::New()");
4600 LOG_API(isolate, "External::New");
4601 ENTER_V8(isolate);
4607 if (IsDeadCheck(i::Isolate::Current(), "v8::External::Value()")) return 0;
4614 i::Isolate* isolate = i::Isolate::Current();
4615 EnsureInitializedForIsolate(isolate, "v8::String::Empty()");
4616 LOG_API(isolate, "String::Empty()");
4617 return Utils::ToLocal(isolate->factory()->empty_symbol());
4622 i::Isolate* isolate = i::Isolate::Current();
4623 EnsureInitializedForIsolate(isolate, "v8::String::New()");
4624 LOG_API(isolate, "String::New(char)");
4626 ENTER_V8(isolate);
4629 isolate->factory()->NewStringFromUtf8(
4637 i::Isolate* isolate = left_string->GetIsolate();
4638 EnsureInitializedForIsolate(isolate, "v8::String::New()");
4639 LOG_API(isolate, "String::New(char)");
4640 ENTER_V8(isolate);
4642 i::Handle<i::String> result = isolate->factory()->NewConsString(left_string,
4649 i::Isolate* isolate = i::Isolate::Current();
4650 EnsureInitializedForIsolate(isolate, "v8::String::NewUndetectable()");
4651 LOG_API(isolate, "String::NewUndetectable(char)");
4652 ENTER_V8(isolate);
4655 isolate->factory()->NewStringFromUtf8(
4670 i::Isolate* isolate = i::Isolate::Current();
4671 EnsureInitializedForIsolate(isolate, "v8::String::New()");
4672 LOG_API(isolate, "String::New(uint16_)");
4674 ENTER_V8(isolate);
4677 isolate->factory()->NewStringFromTwoByte(
4684 i::Isolate* isolate = i::Isolate::Current();
4685 EnsureInitializedForIsolate(isolate, "v8::String::NewUndetectable()");
4686 LOG_API(isolate, "String::NewUndetectable(uint16_)");
4687 ENTER_V8(isolate);
4690 isolate->factory()->NewStringFromTwoByte(
4697 i::Handle<i::String> NewExternalStringHandle(i::Isolate* isolate,
4700 isolate->factory()->NewExternalStringFromTwoByte(resource);
4705 i::Handle<i::String> NewExternalAsciiStringHandle(i::Isolate* isolate,
4708 isolate->factory()->NewExternalStringFromAscii(resource);
4715 i::Isolate* isolate = i::Isolate::Current();
4716 EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()");
4717 LOG_API(isolate, "String::NewExternal");
4718 ENTER_V8(isolate);
4719 i::Handle<i::String> result = NewExternalStringHandle(isolate, resource);
4720 isolate->heap()->external_string_table()->AddString(*result);
4727 i::Isolate* isolate = obj->GetIsolate();
4728 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false;
4732 ENTER_V8(isolate);
4733 if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
4736 if (isolate->heap()->IsInGCPostProcessing()) {
4741 isolate->heap()->external_string_table()->AddString(*obj);
4749 i::Isolate* isolate = i::Isolate::Current();
4750 EnsureInitializedForIsolate(isolate, "v8::String::NewExternal()");
4751 LOG_API(isolate, "String::NewExternal");
4752 ENTER_V8(isolate);
4753 i::Handle<i::String> result = NewExternalAsciiStringHandle(isolate, resource);
4754 isolate->heap()->external_string_table()->AddString(*result);
4762 i::Isolate* isolate = obj->GetIsolate();
4763 if (IsDeadCheck(isolate, "v8::String::MakeExternal()")) return false;
4767 ENTER_V8(isolate);
4768 if (isolate->string_tracker()->IsFreshUnusedString(obj)) {
4771 if (isolate->heap()->IsInGCPostProcessing()) {
4776 isolate->heap()->external_string_table()->AddString(*obj);
4785 i::Isolate* isolate = obj->GetIsolate();
4786 if (IsDeadCheck(isolate, "v8::String::CanMakeExternal()")) return false;
4787 if (isolate
4796 i::Isolate* isolate = i::Isolate::Current();
4797 EnsureInitializedForIsolate(isolate, "v8::Object::New()");
4798 LOG_API(isolate, "Object::New");
4799 ENTER_V8(isolate);
4801 isolate->factory()->NewJSObject(isolate->object_function());
4807 i::Isolate* isolate = i::Isolate::Current();
4808 EnsureInitializedForIsolate(isolate, "v8::NumberObject::New()");
4809 LOG_API(isolate, "NumberObject::New");
4810 ENTER_V8(isolate);
4811 i::Handle<i::Object> number = isolate->factory()->NewNumber(value);
4812 i::Handle<i::Object> obj = isolate->factory()->ToObject(number);
4818 i::Isolate* isolate = i::Isolate::Current();
4819 if (IsDeadCheck(isolate, "v8::NumberObject::NumberValue()")) return 0;
4820 LOG_API(isolate, "NumberObject::NumberValue");
4828 i::Isolate* isolate = i::Isolate::Current();
4829 EnsureInitializedForIsolate(isolate, "v8::BooleanObject::New()");
4830 LOG_API(isolate, "BooleanObject::New");
4831 ENTER_V8(isolate);
4832 i::Handle<i::Object> boolean(value ? isolate->heap()->true_value()
4833 : isolate->heap()->false_value());
4834 i::Handle<i::Object> obj = isolate->factory()->ToObject(boolean);
4840 i::Isolate* isolate = i::Isolate::Current();
4841 if (IsDeadCheck(isolate, "v8::BooleanObject::BooleanValue()")) return 0;
4842 LOG_API(isolate, "BooleanObject::BooleanValue");
4850 i::Isolate* isolate = i::Isolate::Current();
4851 EnsureInitializedForIsolate(isolate, "v8::StringObject::New()");
4852 LOG_API(isolate, "StringObject::New");
4853 ENTER_V8(isolate);
4855 isolate->factory()->ToObject(Utils::OpenHandle(*value));
4861 i::Isolate* isolate = i::Isolate::Current();
4862 if (IsDeadCheck(isolate, "v8::StringObject::StringValue()")) {
4865 LOG_API(isolate, "StringObject::StringValue");
4874 i::Isolate* isolate = i::Isolate::Current();
4875 EnsureInitializedForIsolate(isolate, "v8::Date::New()");
4876 LOG_API(isolate, "Date::New");
4881 ENTER_V8(isolate);
4882 EXCEPTION_PREAMBLE(isolate);
4885 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::Value>());
4891 i::Isolate* isolate = i::Isolate::Current();
4892 if (IsDeadCheck(isolate, "v8::Date::NumberValue()")) return 0;
4893 LOG_API(isolate, "Date::NumberValue");
4901 i::Isolate* isolate = i::Isolate::Current();
4902 ON_BAILOUT(isolate, "v8::Date::DateTimeConfigurationChangeNotification()",
4904 LOG_API(isolate, "Date::DateTimeConfigurationChangeNotification");
4905 ENTER_V8(isolate);
4907 isolate->date_cache()->ResetDateCache();
4909 i::HandleScope scope(isolate);
4912 isolate->factory()->LookupAsciiSymbol("ResetDateCache");
4914 isolate->js_builtins_object()->GetProperty(*func_name_str);
4927 isolate->js_builtins_object(),
4949 i::Isolate* isolate = Utils::OpenHandle(*pattern)->GetIsolate();
4950 EnsureInitializedForIsolate(isolate, "v8::RegExp::New()");
4951 LOG_API(isolate, "RegExp::New");
4952 ENTER_V8(isolate);
4953 EXCEPTION_PREAMBLE(isolate);
4958 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::RegExp>());
4964 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
4965 if (IsDeadCheck(isolate, "v8::RegExp::GetSource()")) {
4984 if (IsDeadCheck(i::Isolate::Current(), "v8::RegExp::GetFlags()")) {
4993 i::Isolate* isolate = i::Isolate::Current();
4994 EnsureInitializedForIsolate(isolate, "v8::Array::New()");
4995 LOG_API(isolate, "Array::New");
4996 ENTER_V8(isolate);
4998 i::Handle<i::JSArray> obj = isolate->factory()->NewJSArray(real_length);
5000 isolate->factory()->NewNumberFromInt(real_length);
5007 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
5008 if (IsDeadCheck(isolate, "v8::Array::Length()")) return 0;
5020 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
5021 ON_BAILOUT(isolate, "v8::Array::CloneElementAt()", return Local<Object>());
5032 EXCEPTION_PREAMBLE(isolate);
5033 ENTER_V8(isolate);
5036 EXCEPTION_BAILOUT_CHECK(isolate, Local<Object>());
5042 i::Isolate* isolate = i::Isolate::Current();
5043 EnsureInitializedForIsolate(isolate, "v8::String::NewSymbol()");
5044 LOG_API(isolate, "String::NewSymbol(char)");
5045 ENTER_V8(isolate);
5048 isolate->factory()->LookupSymbol(i::Vector<const char>(data, length));
5054 i::Isolate* isolate = i::Isolate::Current();
5055 EnsureInitializedForIsolate(isolate, "v8::Number::New()");
5060 ENTER_V8(isolate);
5061 i::Handle<i::Object> result = isolate->factory()->NewNumber(value);
5067 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
5068 EnsureInitializedForIsolate(isolate, "v8::Integer::New()");
5071 isolate));
5073 ENTER_V8(isolate);
5074 i::Handle<i::Object> result = isolate->factory()->NewNumber(value);
5084 i::Isolate* isolate = i::Isolate::Current();
5085 ENTER_V8(isolate);
5086 i::Handle<i::Object> result = isolate->factory()->NewNumber(value);
5097 i::Isolate* isolate = i::Isolate::Current();
5098 EnsureInitializedForIsolate(isolate, "v8::V8::AddMessageListener()");
5099 ON_BAILOUT(isolate, "v8::V8::AddMessageListener()", return false);
5100 ENTER_V8(isolate);
5101 i::HandleScope scope(isolate);
5102 NeanderArray listeners(isolate->factory()->message_listeners());
5104 obj.set(0, *isolate->factory()->NewForeign(FUNCTION_ADDR(that)));
5106 isolate->heap()->undefined_value() :
5114 i::Isolate* isolate = i::Isolate::Current();
5115 EnsureInitializedForIsolate(isolate, "v8::V8::RemoveMessageListener()");
5116 ON_BAILOUT(isolate, "v8::V8::RemoveMessageListeners()", return);
5117 ENTER_V8(isolate);
5118 i::HandleScope scope(isolate);
5119 NeanderArray listeners(isolate->factory()->message_listeners());
5126 listeners.set(i, isolate->heap()->undefined_value());
5136 i::Isolate::Current()->SetCaptureStackTraceForUncaughtExceptions(
5144 i::Isolate* isolate = EnterIsolateIfNeeded();
5145 if (IsDeadCheck(isolate, "v8::V8::SetCounterFunction()")) return;
5146 isolate->stats_table()->SetCounterFunction(callback);
5150 i::Isolate* isolate = EnterIsolateIfNeeded();
5151 if (IsDeadCheck(isolate, "v8::V8::SetCreateHistogramFunction()")) return;
5152 isolate->stats_table()->SetCreateHistogramFunction(callback);
5156 i::Isolate* isolate = EnterIsolateIfNeeded();
5157 if (IsDeadCheck(isolate, "v8::V8::SetAddHistogramSampleFunction()")) return;
5158 isolate->stats_table()->
5163 i::Isolate* isolate = i::Isolate::Current();
5164 if (IsDeadCheck(isolate, "v8::V8::EnableSlidingStateWindow()")) return;
5165 isolate->logger()->EnableSlidingStateWindow();
5171 i::Isolate* isolate = i::Isolate::Current();
5172 if (IsDeadCheck(isolate, "v8::V8::SetFailedAccessCheckCallbackFunction()")) {
5175 isolate->SetFailedAccessCheckCallback(callback);
5181 i::Isolate* isolate = i::Isolate::Current();
5182 if (IsDeadCheck(isolate, "v8::V8::AddObjectGroup()")) return;
5184 isolate->global_handles()->AddObjectGroup(
5192 i::Isolate* isolate = i::Isolate::Current();
5193 if (IsDeadCheck(isolate, "v8::V8::AddImplicitReferences()")) return;
5195 isolate->global_handles()->AddImplicitReferences(
5202 i::Isolate* isolate = i::Isolate::Current();
5203 if (IsDeadCheck(isolate, "v8::V8::AdjustAmountOfExternalAllocatedMemory()")) {
5206 return isolate->heap()->AdjustAmountOfExternalAllocatedMemory(
5212 i::Isolate* isolate = i::Isolate::Current();
5213 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCPrologueCallback()")) return;
5214 isolate->heap()->SetGlobalGCPrologueCallback(callback);
5219 i::Isolate* isolate = i::Isolate::Current();
5220 if (IsDeadCheck(isolate, "v8::V8::SetGlobalGCEpilogueCallback()")) return;
5221 isolate->heap()->SetGlobalGCEpilogueCallback(callback);
5226 i::Isolate* isolate = i::Isolate::Current();
5227 if (IsDeadCheck(isolate, "v8::V8::AddGCPrologueCallback()")) return;
5228 isolate->heap()->AddGCPrologueCallback(callback, gc_type);
5233 i::Isolate* isolate = i::Isolate::Current();
5234 if (IsDeadCheck(isolate, "v8::V8::RemoveGCPrologueCallback()")) return;
5235 isolate->heap()->RemoveGCPrologueCallback(callback);
5240 i::Isolate* isolate = i::Isolate::Current();
5241 if (IsDeadCheck(isolate, "v8::V8::AddGCEpilogueCallback()")) return;
5242 isolate->heap()->AddGCEpilogueCallback(callback, gc_type);
5247 i::Isolate* isolate = i::Isolate::Current();
5248 if (IsDeadCheck(isolate
5249 isolate->heap()->RemoveGCEpilogueCallback(callback);
5256 i::Isolate* isolate = i::Isolate::Current();
5257 if (IsDeadCheck(isolate, "v8::V8::AddMemoryAllocationCallback()")) return;
5258 isolate->memory_allocator()->AddMemoryAllocationCallback(
5264 i::Isolate* isolate = i::Isolate::Current();
5265 if (IsDeadCheck(isolate, "v8::V8::RemoveMemoryAllocationCallback()")) return;
5266 isolate->memory_allocator()->RemoveMemoryAllocationCallback(
5273 i::Isolate::EnsureDefaultIsolate();
5274 i::Isolate* isolate = i::Isolate::Current();
5275 if (IsDeadCheck(isolate, "v8::V8::AddLeaveScriptCallback()")) return;
5281 i::Isolate::EnsureDefaultIsolate();
5282 i::Isolate* isolate = i::Isolate::Current();
5283 if (IsDeadCheck(isolate, "v8::V8::RemoveLeaveScriptCallback()")) return;
5289 i::Isolate* isolate = i::Isolate::Current();
5290 isolate->logger()->PauseProfiler();
5295 i::Isolate* isolate = i::Isolate::Current();
5296 isolate->logger()->ResumeProfiler();
5301 i::Isolate* isolate = i::Isolate::Current();
5302 return isolate->logger()->IsProfilerPaused();
5307 i::Isolate* isolate = i::Isolate::Current();
5308 EnsureInitializedForIsolate(isolate, "V8::GetCurrentThreadId()");
5309 return isolate->thread_id().ToInteger();
5314 i::Isolate* isolate = i::Isolate::Current();
5315 if (!isolate->IsInitialized()) return;
5316 API_ENTRY_CHECK(isolate, "V8::TerminateExecution()");
5321 if (isolate->thread_id().Equals(internal_tid)) {
5322 isolate->stack_guard()->TerminateExecution();
5324 isolate->thread_manager()->TerminateExecution(internal_tid);
5329 void V8::TerminateExecution(Isolate* isolate) {
5330 // If no isolate is supplied, use the default isolate.
5331 if (isolate != NULL) {
5332 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->TerminateExecution();
5334 i::Isolate::GetDefaultIsolateStackGuard()->TerminateExecution();
5339 bool V8::IsExecutionTerminating(Isolate* isolate) {
5340 i::Isolate* i_isolate = isolate != NULL ?
5341 reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current();
5346 Isolate* Isolate::GetCurrent() {
5347 i::Isolate* isolate = i::Isolate::UncheckedCurrent();
5348 return reinterpret_cast<Isolate*>(isolate);
5352 Isolate* Isolate::New() {
5353 i::Isolate* isolate = new i::Isolate();
5354 return reinterpret_cast<Isolate*>(isolate);
5358 void Isolate::Dispose() {
5359 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5360 if (!ApiCheck(!isolate->IsInUse(),
5361 "v8::Isolate::Dispose()",
5362 "Disposing the isolate that is entered by a thread.")) {
5365 isolate->TearDown();
5369 void Isolate::Enter() {
5370 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5371 isolate->Enter();
5375 void Isolate::Exit() {
5376 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5377 isolate->Exit();
5381 void Isolate::SetData(void* data) {
5382 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5383 isolate->SetData(data);
5386 void* Isolate::GetData() {
5387 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5388 return isolate->GetData();
5394 i::Isolate* isolate = i::Isolate::Current();
5395 if (IsDeadCheck(isolate, "v8::String::Utf8Value::Utf8Value()")) return;
5397 ENTER_V8(isolate);
5398 i::HandleScope scope(isolate);
5416 i::Isolate* isolate = i::Isolate::Current();
5417 if (IsDeadCheck(isolate, "v8::String::AsciiValue::AsciiValue()")) return;
5419 ENTER_V8(isolate);
5420 i::HandleScope scope(isolate);
5437 i::Isolate* isolate = i::Isolate::Current();
5438 if (IsDeadCheck(isolate, "v8::String::Value::Value()")) return;
5440 ENTER_V8(isolate);
5441 i::HandleScope scope(isolate);
5456 i::Isolate* isolate = i::Isolate::Current();
5457 LOG_API(isolate, "RangeError");
5458 ON_BAILOUT(isolate, "v8::Exception::RangeError()", return Local<Value>());
5459 ENTER_V8(isolate);
5462 i::HandleScope scope(isolate);
5464 i::Handle<i::Object> result = isolate->factory()->NewRangeError(message);
5472 i::Isolate* isolate = i::Isolate::Current();
5473 LOG_API(isolate, "ReferenceError");
5474 ON_BAILOUT(isolate, "v8::Exception::ReferenceError()", return Local<Value>());
5475 ENTER_V8(isolate);
5478 i::HandleScope scope(isolate);
5481 isolate->factory()->NewReferenceError(message);
5489 i::Isolate* isolate = i::Isolate::Current();
5490 LOG_API(isolate, "SyntaxError");
5491 ON_BAILOUT(isolate, "v8::Exception::SyntaxError()", return Local<Value>());
5492 ENTER_V8(isolate);
5495 i::HandleScope scope(isolate);
5497 i::Handle<i::Object> result = isolate->factory()->NewSyntaxError(message);
5505 i::Isolate* isolate = i::Isolate::Current();
5506 LOG_API(isolate, "TypeError");
5507 ON_BAILOUT(isolate, "v8::Exception::TypeError()", return Local<Value>());
5508 ENTER_V8(isolate);
5511 i::HandleScope scope(isolate);
5513 i::Handle<i::Object> result = isolate->factory()->NewTypeError(message);
5521 i::Isolate* isolate = i::Isolate::Current();
5522 LOG_API(isolate, "Error");
5523 ON_BAILOUT(isolate, "v8::Exception::Error()", return Local<Value>());
5524 ENTER_V8(isolate);
5527 i::HandleScope scope(isolate);
5529 i::Handle<i::Object> result = isolate->factory()->NewError(message);
5542 i::Isolate* isolate = i::Isolate::Current();
5543 if (isolate->debug_event_callback() != NULL) {
5544 isolate->debug_event_callback()(event_details.GetEvent(),
5553 i::Isolate* isolate = i::Isolate::Current();
5554 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener()");
5555 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
5556 ENTER_V8(isolate);
5558 isolate->set_debug_event_callback(that);
5560 i::HandleScope scope(isolate);
5561 i::Handle<i::Object> foreign = isolate->factory()->undefined_value();
5564 isolate->factory()->NewForeign(FUNCTION_ADDR(EventCallbackWrapper));
5566 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data));
5572 i::Isolate* isolate = i::Isolate::Current();
5573 EnsureInitializedForIsolate(isolate, "v8::Debug::SetDebugEventListener2()");
5574 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener2()", return false);
5575 ENTER_V8(isolate);
5576 i::HandleScope scope(isolate);
5577 i::Handle<i::Object> foreign = isolate->factory()->undefined_value();
5579 foreign = isolate->factory()->NewForeign(FUNCTION_ADDR(that));
5581 isolate->debugger()->SetEventListener(foreign, Utils::OpenHandle(*data));
5588 i::Isolate* isolate = i::Isolate::Current();
5589 ON_BAILOUT(isolate, "v8::Debug::SetDebugEventListener()", return false);
5590 ENTER_V8(isolate);
5591 isolate->debugger()->SetEventListener(Utils::OpenHandle(*that),
5597 void Debug::DebugBreak(Isolate* isolate) {
5598 // If no isolate is supplied, use the default isolate.
5599 if (isolate != NULL) {
5600 reinterpret_cast<i::Isolate*>(isolate)->stack_guard()->DebugBreak();
5602 i::Isolate::GetDefaultIsolateStackGuard()->DebugBreak();
5607 void Debug::CancelDebugBreak(Isolate* isolate) {
5608 // If no isolate is supplied, use the default isolate.
5609 if (isolate != NULL) {
5610 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
5613 i::Isolate::GetDefaultIsolateStackGuard()->Continue(i::DEBUGBREAK);
5618 void Debug::DebugBreakForCommand(ClientData* data, Isolate* isolate) {
5619 // If no isolate is supplied, use the default isolate.
5620 if (isolate != NULL) {
5621 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
5624 i::Isolate::GetDefaultIsolateDebugger()->EnqueueDebugCommand(data);
5630 i::Isolate* isolate = i::Isolate::Current();
5631 if (isolate->message_handler()) {
5633 (isolate->message_handler())(*json, json.length(), message.GetClientData());
5640 i::Isolate* isolate = i::Isolate::Current();
5641 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler");
5642 ENTER_V8(isolate);
5649 isolate->set_message_handler(handler);
5651 isolate->debugger()->SetMessageHandler(MessageHandlerWrapper);
5653 isolate->debugger()->SetMessageHandler(NULL);
5659 i::Isolate* isolate = i::Isolate::Current();
5660 EnsureInitializedForIsolate(isolate, "v8::Debug::SetMessageHandler");
5661 ENTER_V8(isolate);
5662 isolate->debugger()->SetMessageHandler(handler);
5668 Isolate* isolate) {
5669 // If no isolate is supplied, use the default isolate.
5670 if (isolate != NULL) {
5671 i::Isolate* internal_isolate = reinterpret_cast<i::Isolate*>(isolate);
5675 i::Isolate::GetDefaultIsolateDebugger()->ProcessCommand(
5683 i::Isolate* isolate = i::Isolate::Current();
5684 EnsureInitializedForIsolate(isolate, "v8::Debug::SetHostDispatchHandler");
5685 ENTER_V8(isolate);
5686 isolate->debugger()->SetHostDispatchHandler(handler, period);
5692 i::Isolate* isolate = i::Isolate::Current();
5693 EnsureInitializedForIsolate(isolate,
5695 ENTER_V8(isolate);
5696 isolate->debugger()->SetDebugMessageDispatchHandler(
5703 i::Isolate* isolate = i::Isolate::Current();
5704 if (!isolate->IsInitialized()) return Local<Value>();
5705 ON_BAILOUT(isolate, "v8::Debug::Call()", return Local<Value>());
5706 ENTER_V8(isolate);
5708 EXCEPTION_PREAMBLE(isolate);
5710 result = isolate->debugger()->Call(Utils::OpenHandle(*fun),
5711 isolate->factory()->undefined_value(),
5714 result = isolate->debugger()->Call(Utils::OpenHandle(*fun),
5718 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
5724 i::Isolate* isolate = i::Isolate::Current();
5725 if (!isolate->IsInitialized()) return Local<Value>();
5726 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>());
5727 ENTER_V8(isolate);
5729 i::Debug* isolate_debug = isolate->debug();
5733 isolate->factory()->LookupAsciiSymbol("MakeMirror");
5739 EXCEPTION_PREAMBLE(isolate);
5743 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>());
5749 return i::Isolate
5755 return i::Isolate::Current()->debugger()->StopAgent();
5764 i::Isolate* isolate = i::Isolate::Current();
5765 EnsureInitializedForIsolate(isolate, "v8::Debug::GetDebugContext()");
5766 ENTER_V8(isolate);
5767 return Utils::ToLocal(i::Isolate::Current()->debugger()->GetDebugContext());
5774 i::Isolate* isolate = i::Isolate::Current();
5775 IsDeadCheck(isolate, "v8::CpuProfileNode::GetFunctionName");
5780 isolate->factory()->LookupAsciiSymbol(entry->name())));
5782 return Handle<String>(ToApi<String>(isolate->factory()->NewConsString(
5783 isolate->factory()->LookupAsciiSymbol(entry->name_prefix()),
5784 isolate->factory()->LookupAsciiSymbol(entry->name()))));
5790 i::Isolate* isolate = i::Isolate::Current();
5791 IsDeadCheck(isolate, "v8::CpuProfileNode::GetScriptResourceName");
5793 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol(
5799 i::Isolate* isolate = i::Isolate::Current();
5800 IsDeadCheck(isolate, "v8::CpuProfileNode::GetLineNumber");
5806 i::Isolate* isolate = i::Isolate::Current();
5807 IsDeadCheck(isolate, "v8::CpuProfileNode::GetTotalTime");
5813 i::Isolate* isolate = i::Isolate::Current();
5814 IsDeadCheck(isolate, "v8::CpuProfileNode::GetSelfTime");
5820 i::Isolate* isolate = i::Isolate::Current();
5821 IsDeadCheck(isolate, "v8::CpuProfileNode::GetTotalSamplesCount");
5827 i::Isolate* isolate = i::Isolate::Current();
5828 IsDeadCheck(isolate, "v8::CpuProfileNode::GetSelfSamplesCount");
5834 i::Isolate* isolate = i::Isolate::Current();
5835 IsDeadCheck(isolate, "v8::CpuProfileNode::GetCallUid");
5841 i::Isolate* isolate = i::Isolate::Current();
5842 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChildrenCount");
5848 i::Isolate* isolate = i::Isolate::Current();
5849 IsDeadCheck(isolate, "v8::CpuProfileNode::GetChild");
5857 i::Isolate* isolate = i::Isolate::Current();
5858 IsDeadCheck(isolate, "v8::CpuProfile::Delete");
5869 i::Isolate* isolate = i::Isolate::Current();
5870 IsDeadCheck(isolate, "v8::CpuProfile::GetUid");
5876 i::Isolate* isolate = i::Isolate::Current();
5877 IsDeadCheck(isolate, "v8::CpuProfile::GetTitle");
5879 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol(
5885 i::Isolate* isolate = i::Isolate::Current();
5886 IsDeadCheck(isolate, "v8::CpuProfile::GetBottomUpRoot");
5893 i::Isolate* isolate = i::Isolate::Current();
5894 IsDeadCheck(isolate, "v8::CpuProfile::GetTopDownRoot");
5901 i::Isolate* isolate = i::Isolate::Current();
5902 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfilesCount");
5909 i::Isolate* isolate = i::Isolate::Current();
5910 IsDeadCheck(isolate, "v8::CpuProfiler::GetProfile");
5920 i::Isolate* isolate = i::Isolate::Current();
5921 IsDeadCheck(isolate, "v8::CpuProfiler::FindProfile");
5930 i::Isolate* isolate = i::Isolate::Current();
5931 IsDeadCheck(isolate, "v8::CpuProfiler::StartProfiling");
5938 i::Isolate* isolate = i::Isolate::Current();
5939 IsDeadCheck(isolate, "v8::CpuProfiler::StopProfiling");
5948 i::Isolate* isolate = i::Isolate::Current();
5949 IsDeadCheck(isolate, "v8::CpuProfiler::DeleteAllProfiles");
5961 i::Isolate* isolate = i::Isolate::Current();
5962 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetType");
5968 i::Isolate* isolate = i::Isolate::Current();
5969 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetName");
5976 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol(
5980 return Handle<Number>(ToApi<Number>(isolate->factory()->NewNumberFromInt(
5989 i::Isolate* isolate = i::Isolate::Current();
5990 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetFromNode");
5997 i::Isolate* isolate = i::Isolate::Current();
5998 IsDeadCheck(isolate, "v8::HeapGraphEdge::GetToNode");
6011 i::Isolate* isolate = i::Isolate::Current();
6012 IsDeadCheck(isolate, "v8::HeapGraphNode::GetType");
6018 i::Isolate* isolate = i::Isolate::Current();
6019 IsDeadCheck(isolate, "v8::HeapGraphNode::GetName");
6020 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol(
6026 i::Isolate* isolate = i::Isolate::Current();
6027 IsDeadCheck(isolate, "v8::HeapGraphNode::GetId");
6033 i::Isolate* isolate = i::Isolate::Current();
6034 IsDeadCheck(isolate, "v8::HeapGraphNode::GetSelfSize");
6040 i::Isolate* isolate = i::Isolate::Current();
6041 IsDeadCheck(isolate, "v8::HeapSnapshot::GetRetainedSize");
6047 i::Isolate* isolate = i::Isolate::Current();
6048 IsDeadCheck(isolate, "v8::HeapSnapshot::GetChildrenCount");
6054 i::Isolate* isolate = i::Isolate::Current();
6055 IsDeadCheck(isolate, "v8::HeapSnapshot::GetChild");
6062 i::Isolate* isolate = i::Isolate::Current();
6063 IsDeadCheck(isolate, "v8::HeapSnapshot::GetRetainersCount");
6069 i::Isolate* isolate = i::Isolate::Current();
6070 IsDeadCheck(isolate, "v8::HeapSnapshot::GetRetainer");
6077 i::Isolate* isolate = i::Isolate::Current();
6078 IsDeadCheck(isolate, "v8::HeapSnapshot::GetDominatorNode");
6084 i::Isolate* isolate = i::Isolate::Current();
6085 IsDeadCheck(isolate, "v8::HeapGraphNode::GetHeapValue");
6089 isolate->factory()->undefined_value()));
6100 i::Isolate* isolate = i::Isolate::Current();
6101 IsDeadCheck(isolate, "v8::HeapSnapshot::Delete");
6112 i::Isolate* isolate = i::Isolate::Current();
6113 IsDeadCheck(isolate, "v8::HeapSnapshot::GetType");
6119 i::Isolate* isolate = i::Isolate::Current();
6120 IsDeadCheck(isolate, "v8::HeapSnapshot::GetUid");
6126 i::Isolate* isolate = i::Isolate::Current();
6127 IsDeadCheck(isolate, "v8::HeapSnapshot::GetTitle");
6128 return Handle<String>(ToApi<String>(isolate->factory()->LookupAsciiSymbol(
6134 i::Isolate* isolate = i::Isolate::Current();
6135 IsDeadCheck(isolate, "v8::HeapSnapshot::GetHead");
6141 i::Isolate* isolate = i::Isolate::Current();
6142 IsDeadCheck(isolate, "v8::HeapSnapshot::GetNodeById");
6149 i::Isolate* isolate = i::Isolate::Current();
6150 IsDeadCheck(isolate, "v8::HeapSnapshot::GetNodesCount");
6156 i::Isolate* isolate = i::Isolate::Current();
6157 IsDeadCheck(isolate, "v8::HeapSnapshot::GetNode");
6165 i::Isolate* isolate = i::Isolate::Current();
6166 IsDeadCheck(isolate, "v8::HeapSnapshot::Serialize");
6182 i::Isolate* isolate = i::Isolate::Current();
6183 IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshotsCount");
6189 i::Isolate* isolate = i::Isolate::Current();
6190 IsDeadCheck(isolate, "v8::HeapProfiler::GetSnapshot");
6197 i::Isolate* isolate = i::Isolate::Current();
6198 IsDeadCheck(isolate, "v8::HeapProfiler::FindSnapshot");
6207 i::Isolate* isolate = i::Isolate::Current();
6208 IsDeadCheck(isolate, "v8::HeapProfiler::TakeSnapshot");
6224 i::Isolate* isolate = i::Isolate::Current();
6225 IsDeadCheck(isolate, "v8::HeapProfiler::DeleteAllSnapshots");
6232 i::Isolate::Current()->heap_profiler()->DefineWrapperClass(class_id,
6238 i::Isolate* isolate = i::Isolate::Current();
6239 return isolate->global_handles()->NumberOfGlobalHandles();