OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 } | 2124 } |
2125 | 2125 |
2126 | 2126 |
2127 // --- M e s s a g e --- | 2127 // --- M e s s a g e --- |
2128 | 2128 |
2129 | 2129 |
2130 Local<String> Message::Get() const { | 2130 Local<String> Message::Get() const { |
2131 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2131 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2132 ON_BAILOUT(isolate, "v8::Message::Get()", return Local<String>()); | 2132 ON_BAILOUT(isolate, "v8::Message::Get()", return Local<String>()); |
2133 ENTER_V8(isolate); | 2133 ENTER_V8(isolate); |
2134 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2134 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2135 i::Handle<i::Object> obj = Utils::OpenHandle(this); | 2135 i::Handle<i::Object> obj = Utils::OpenHandle(this); |
2136 i::Handle<i::String> raw_result = i::MessageHandler::GetMessage(isolate, obj); | 2136 i::Handle<i::String> raw_result = i::MessageHandler::GetMessage(isolate, obj); |
2137 Local<String> result = Utils::ToLocal(raw_result); | 2137 Local<String> result = Utils::ToLocal(raw_result); |
2138 return scope.Close(result); | 2138 return scope.Escape(result); |
2139 } | 2139 } |
2140 | 2140 |
2141 | 2141 |
2142 v8::Handle<Value> Message::GetScriptResourceName() const { | 2142 v8::Handle<Value> Message::GetScriptResourceName() const { |
2143 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2143 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2144 ENTER_V8(isolate); | 2144 ENTER_V8(isolate); |
2145 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2145 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2146 i::Handle<i::JSMessageObject> message = | 2146 i::Handle<i::JSMessageObject> message = |
2147 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); | 2147 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); |
2148 // Return this.script.name. | 2148 // Return this.script.name. |
2149 i::Handle<i::JSValue> script = | 2149 i::Handle<i::JSValue> script = |
2150 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), | 2150 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), |
2151 isolate)); | 2151 isolate)); |
2152 i::Handle<i::Object> resource_name(i::Script::cast(script->value())->name(), | 2152 i::Handle<i::Object> resource_name(i::Script::cast(script->value())->name(), |
2153 isolate); | 2153 isolate); |
2154 return scope.Close(Utils::ToLocal(resource_name)); | 2154 return scope.Escape(Utils::ToLocal(resource_name)); |
2155 } | 2155 } |
2156 | 2156 |
2157 | 2157 |
2158 v8::Handle<Value> Message::GetScriptData() const { | 2158 v8::Handle<Value> Message::GetScriptData() const { |
2159 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2159 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2160 ENTER_V8(isolate); | 2160 ENTER_V8(isolate); |
2161 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2161 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2162 i::Handle<i::JSMessageObject> message = | 2162 i::Handle<i::JSMessageObject> message = |
2163 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); | 2163 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); |
2164 // Return this.script.data. | 2164 // Return this.script.data. |
2165 i::Handle<i::JSValue> script = | 2165 i::Handle<i::JSValue> script = |
2166 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), | 2166 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), |
2167 isolate)); | 2167 isolate)); |
2168 i::Handle<i::Object> data(i::Script::cast(script->value())->data(), isolate); | 2168 i::Handle<i::Object> data(i::Script::cast(script->value())->data(), isolate); |
2169 return scope.Close(Utils::ToLocal(data)); | 2169 return scope.Escape(Utils::ToLocal(data)); |
2170 } | 2170 } |
2171 | 2171 |
2172 | 2172 |
2173 v8::Handle<v8::StackTrace> Message::GetStackTrace() const { | 2173 v8::Handle<v8::StackTrace> Message::GetStackTrace() const { |
2174 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2174 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2175 ENTER_V8(isolate); | 2175 ENTER_V8(isolate); |
2176 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2176 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2177 i::Handle<i::JSMessageObject> message = | 2177 i::Handle<i::JSMessageObject> message = |
2178 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); | 2178 i::Handle<i::JSMessageObject>::cast(Utils::OpenHandle(this)); |
2179 i::Handle<i::Object> stackFramesObj(message->stack_frames(), isolate); | 2179 i::Handle<i::Object> stackFramesObj(message->stack_frames(), isolate); |
2180 if (!stackFramesObj->IsJSArray()) return v8::Handle<v8::StackTrace>(); | 2180 if (!stackFramesObj->IsJSArray()) return v8::Handle<v8::StackTrace>(); |
2181 i::Handle<i::JSArray> stackTrace = | 2181 i::Handle<i::JSArray> stackTrace = |
2182 i::Handle<i::JSArray>::cast(stackFramesObj); | 2182 i::Handle<i::JSArray>::cast(stackFramesObj); |
2183 return scope.Close(Utils::StackTraceToLocal(stackTrace)); | 2183 return scope.Escape(Utils::StackTraceToLocal(stackTrace)); |
2184 } | 2184 } |
2185 | 2185 |
2186 | 2186 |
2187 static i::Handle<i::Object> CallV8HeapFunction(const char* name, | 2187 static i::Handle<i::Object> CallV8HeapFunction(const char* name, |
2188 i::Handle<i::Object> recv, | 2188 i::Handle<i::Object> recv, |
2189 int argc, | 2189 int argc, |
2190 i::Handle<i::Object> argv[], | 2190 i::Handle<i::Object> argv[], |
2191 bool* has_pending_exception) { | 2191 bool* has_pending_exception) { |
2192 i::Isolate* isolate = i::Isolate::Current(); | 2192 i::Isolate* isolate = i::Isolate::Current(); |
2193 i::Handle<i::String> fmt_str = | 2193 i::Handle<i::String> fmt_str = |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), | 2293 i::Handle<i::JSValue>::cast(i::Handle<i::Object>(message->script(), |
2294 isolate)); | 2294 isolate)); |
2295 return i::Script::cast(script->value())->is_shared_cross_origin(); | 2295 return i::Script::cast(script->value())->is_shared_cross_origin(); |
2296 } | 2296 } |
2297 | 2297 |
2298 | 2298 |
2299 Local<String> Message::GetSourceLine() const { | 2299 Local<String> Message::GetSourceLine() const { |
2300 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2300 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2301 ON_BAILOUT(isolate, "v8::Message::GetSourceLine()", return Local<String>()); | 2301 ON_BAILOUT(isolate, "v8::Message::GetSourceLine()", return Local<String>()); |
2302 ENTER_V8(isolate); | 2302 ENTER_V8(isolate); |
2303 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2303 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2304 EXCEPTION_PREAMBLE(isolate); | 2304 EXCEPTION_PREAMBLE(isolate); |
2305 i::Handle<i::Object> result = CallV8HeapFunction("GetSourceLine", | 2305 i::Handle<i::Object> result = CallV8HeapFunction("GetSourceLine", |
2306 Utils::OpenHandle(this), | 2306 Utils::OpenHandle(this), |
2307 &has_pending_exception); | 2307 &has_pending_exception); |
2308 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::String>()); | 2308 EXCEPTION_BAILOUT_CHECK(isolate, Local<v8::String>()); |
2309 if (result->IsString()) { | 2309 if (result->IsString()) { |
2310 return scope.Close(Utils::ToLocal(i::Handle<i::String>::cast(result))); | 2310 return scope.Escape(Utils::ToLocal(i::Handle<i::String>::cast(result))); |
2311 } else { | 2311 } else { |
2312 return Local<String>(); | 2312 return Local<String>(); |
2313 } | 2313 } |
2314 } | 2314 } |
2315 | 2315 |
2316 | 2316 |
2317 void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { | 2317 void Message::PrintCurrentStackTrace(Isolate* isolate, FILE* out) { |
2318 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 2318 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
2319 ENTER_V8(i_isolate); | 2319 ENTER_V8(i_isolate); |
2320 i_isolate->PrintCurrentStackTrace(out); | 2320 i_isolate->PrintCurrentStackTrace(out); |
2321 } | 2321 } |
2322 | 2322 |
2323 | 2323 |
2324 void Message::PrintCurrentStackTrace(FILE* out) { | 2324 void Message::PrintCurrentStackTrace(FILE* out) { |
2325 PrintCurrentStackTrace(Isolate::GetCurrent(), out); | 2325 PrintCurrentStackTrace(Isolate::GetCurrent(), out); |
2326 } | 2326 } |
2327 | 2327 |
2328 | 2328 |
2329 // --- S t a c k T r a c e --- | 2329 // --- S t a c k T r a c e --- |
2330 | 2330 |
2331 Local<StackFrame> StackTrace::GetFrame(uint32_t index) const { | 2331 Local<StackFrame> StackTrace::GetFrame(uint32_t index) const { |
2332 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2332 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2333 ENTER_V8(isolate); | 2333 ENTER_V8(isolate); |
2334 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2334 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2335 i::Handle<i::JSArray> self = Utils::OpenHandle(this); | 2335 i::Handle<i::JSArray> self = Utils::OpenHandle(this); |
2336 i::Object* raw_object = self->GetElementNoExceptionThrown(isolate, index); | 2336 i::Object* raw_object = self->GetElementNoExceptionThrown(isolate, index); |
2337 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_object)); | 2337 i::Handle<i::JSObject> obj(i::JSObject::cast(raw_object)); |
2338 return scope.Close(Utils::StackFrameToLocal(obj)); | 2338 return scope.Escape(Utils::StackFrameToLocal(obj)); |
2339 } | 2339 } |
2340 | 2340 |
2341 | 2341 |
2342 int StackTrace::GetFrameCount() const { | 2342 int StackTrace::GetFrameCount() const { |
2343 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2343 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2344 ENTER_V8(isolate); | 2344 ENTER_V8(isolate); |
2345 return i::Smi::cast(Utils::OpenHandle(this)->length())->value(); | 2345 return i::Smi::cast(Utils::OpenHandle(this)->length())->value(); |
2346 } | 2346 } |
2347 | 2347 |
2348 | 2348 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2408 if (!scriptId->IsSmi()) { | 2408 if (!scriptId->IsSmi()) { |
2409 return Message::kNoScriptIdInfo; | 2409 return Message::kNoScriptIdInfo; |
2410 } | 2410 } |
2411 return i::Smi::cast(*scriptId)->value(); | 2411 return i::Smi::cast(*scriptId)->value(); |
2412 } | 2412 } |
2413 | 2413 |
2414 | 2414 |
2415 Local<String> StackFrame::GetScriptName() const { | 2415 Local<String> StackFrame::GetScriptName() const { |
2416 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2416 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2417 ENTER_V8(isolate); | 2417 ENTER_V8(isolate); |
2418 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2418 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2419 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2419 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2420 i::Handle<i::Object> name = GetProperty(self, "scriptName"); | 2420 i::Handle<i::Object> name = GetProperty(self, "scriptName"); |
2421 if (!name->IsString()) { | 2421 if (!name->IsString()) { |
2422 return Local<String>(); | 2422 return Local<String>(); |
2423 } | 2423 } |
2424 return scope.Close(Local<String>::Cast(Utils::ToLocal(name))); | 2424 return scope.Escape(Local<String>::Cast(Utils::ToLocal(name))); |
2425 } | 2425 } |
2426 | 2426 |
2427 | 2427 |
2428 Local<String> StackFrame::GetScriptNameOrSourceURL() const { | 2428 Local<String> StackFrame::GetScriptNameOrSourceURL() const { |
2429 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2429 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2430 ENTER_V8(isolate); | 2430 ENTER_V8(isolate); |
2431 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2431 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2432 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2432 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2433 i::Handle<i::Object> name = GetProperty(self, "scriptNameOrSourceURL"); | 2433 i::Handle<i::Object> name = GetProperty(self, "scriptNameOrSourceURL"); |
2434 if (!name->IsString()) { | 2434 if (!name->IsString()) { |
2435 return Local<String>(); | 2435 return Local<String>(); |
2436 } | 2436 } |
2437 return scope.Close(Local<String>::Cast(Utils::ToLocal(name))); | 2437 return scope.Escape(Local<String>::Cast(Utils::ToLocal(name))); |
2438 } | 2438 } |
2439 | 2439 |
2440 | 2440 |
2441 Local<String> StackFrame::GetFunctionName() const { | 2441 Local<String> StackFrame::GetFunctionName() const { |
2442 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2442 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2443 ENTER_V8(isolate); | 2443 ENTER_V8(isolate); |
2444 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 2444 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
2445 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2445 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2446 i::Handle<i::Object> name = GetProperty(self, "functionName"); | 2446 i::Handle<i::Object> name = GetProperty(self, "functionName"); |
2447 if (!name->IsString()) { | 2447 if (!name->IsString()) { |
2448 return Local<String>(); | 2448 return Local<String>(); |
2449 } | 2449 } |
2450 return scope.Close(Local<String>::Cast(Utils::ToLocal(name))); | 2450 return scope.Escape(Local<String>::Cast(Utils::ToLocal(name))); |
2451 } | 2451 } |
2452 | 2452 |
2453 | 2453 |
2454 bool StackFrame::IsEval() const { | 2454 bool StackFrame::IsEval() const { |
2455 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 2455 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
2456 ENTER_V8(isolate); | 2456 ENTER_V8(isolate); |
2457 i::HandleScope scope(isolate); | 2457 i::HandleScope scope(isolate); |
2458 i::Handle<i::JSObject> self = Utils::OpenHandle(this); | 2458 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
2459 i::Handle<i::Object> is_eval = GetProperty(self, "isEval"); | 2459 i::Handle<i::Object> is_eval = GetProperty(self, "isEval"); |
2460 return is_eval->IsTrue(); | 2460 return is_eval->IsTrue(); |
(...skipping 1690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4151 | 4151 |
4152 Local<v8::Object> Function::NewInstance(int argc, | 4152 Local<v8::Object> Function::NewInstance(int argc, |
4153 v8::Handle<v8::Value> argv[]) const { | 4153 v8::Handle<v8::Value> argv[]) const { |
4154 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4154 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
4155 ON_BAILOUT(isolate, "v8::Function::NewInstance()", | 4155 ON_BAILOUT(isolate, "v8::Function::NewInstance()", |
4156 return Local<v8::Object>()); | 4156 return Local<v8::Object>()); |
4157 LOG_API(isolate, "Function::NewInstance"); | 4157 LOG_API(isolate, "Function::NewInstance"); |
4158 ENTER_V8(isolate); | 4158 ENTER_V8(isolate); |
4159 i::Logger::TimerEventScope timer_scope( | 4159 i::Logger::TimerEventScope timer_scope( |
4160 isolate, i::Logger::TimerEventScope::v8_execute); | 4160 isolate, i::Logger::TimerEventScope::v8_execute); |
4161 HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 4161 EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
4162 i::Handle<i::JSFunction> function = Utils::OpenHandle(this); | 4162 i::Handle<i::JSFunction> function = Utils::OpenHandle(this); |
4163 STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**)); | 4163 STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**)); |
4164 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); | 4164 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); |
4165 EXCEPTION_PREAMBLE(isolate); | 4165 EXCEPTION_PREAMBLE(isolate); |
4166 i::Handle<i::Object> returned = | 4166 i::Handle<i::Object> returned = |
4167 i::Execution::New(function, argc, args, &has_pending_exception); | 4167 i::Execution::New(function, argc, args, &has_pending_exception); |
4168 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<v8::Object>()); | 4168 EXCEPTION_BAILOUT_CHECK_DO_CALLBACK(isolate, Local<v8::Object>()); |
4169 return scope.Close(Utils::ToLocal(i::Handle<i::JSObject>::cast(returned))); | 4169 return scope.Escape(Utils::ToLocal(i::Handle<i::JSObject>::cast(returned))); |
4170 } | 4170 } |
4171 | 4171 |
4172 | 4172 |
4173 Local<v8::Value> Function::Call(v8::Handle<v8::Value> recv, int argc, | 4173 Local<v8::Value> Function::Call(v8::Handle<v8::Value> recv, int argc, |
4174 v8::Handle<v8::Value> argv[]) { | 4174 v8::Handle<v8::Value> argv[]) { |
4175 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); | 4175 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
4176 ON_BAILOUT(isolate, "v8::Function::Call()", return Local<v8::Value>()); | 4176 ON_BAILOUT(isolate, "v8::Function::Call()", return Local<v8::Value>()); |
4177 LOG_API(isolate, "Function::Call"); | 4177 LOG_API(isolate, "Function::Call"); |
4178 ENTER_V8(isolate); | 4178 ENTER_V8(isolate); |
4179 i::Logger::TimerEventScope timer_scope( | 4179 i::Logger::TimerEventScope timer_scope( |
(...skipping 2882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7062 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); | 7062 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); |
7063 return Utils::ToLocal(result); | 7063 return Utils::ToLocal(result); |
7064 } | 7064 } |
7065 | 7065 |
7066 | 7066 |
7067 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { | 7067 Local<Value> Debug::GetMirror(v8::Handle<v8::Value> obj) { |
7068 i::Isolate* isolate = i::Isolate::Current(); | 7068 i::Isolate* isolate = i::Isolate::Current(); |
7069 if (!isolate->IsInitialized()) return Local<Value>(); | 7069 if (!isolate->IsInitialized()) return Local<Value>(); |
7070 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); | 7070 ON_BAILOUT(isolate, "v8::Debug::GetMirror()", return Local<Value>()); |
7071 ENTER_V8(isolate); | 7071 ENTER_V8(isolate); |
7072 v8::HandleScope scope(reinterpret_cast<Isolate*>(isolate)); | 7072 v8::EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate)); |
7073 i::Debug* isolate_debug = isolate->debug(); | 7073 i::Debug* isolate_debug = isolate->debug(); |
7074 isolate_debug->Load(); | 7074 isolate_debug->Load(); |
7075 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object()); | 7075 i::Handle<i::JSObject> debug(isolate_debug->debug_context()->global_object()); |
7076 i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString( | 7076 i::Handle<i::String> name = isolate->factory()->InternalizeOneByteString( |
7077 STATIC_ASCII_VECTOR("MakeMirror")); | 7077 STATIC_ASCII_VECTOR("MakeMirror")); |
7078 i::Handle<i::Object> fun_obj = i::GetProperty(isolate, debug, name); | 7078 i::Handle<i::Object> fun_obj = i::GetProperty(isolate, debug, name); |
7079 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); | 7079 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(fun_obj); |
7080 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); | 7080 v8::Handle<v8::Function> v8_fun = Utils::ToLocal(fun); |
7081 const int kArgc = 1; | 7081 const int kArgc = 1; |
7082 v8::Handle<v8::Value> argv[kArgc] = { obj }; | 7082 v8::Handle<v8::Value> argv[kArgc] = { obj }; |
7083 EXCEPTION_PREAMBLE(isolate); | 7083 EXCEPTION_PREAMBLE(isolate); |
7084 v8::Handle<v8::Value> result = v8_fun->Call(Utils::ToLocal(debug), | 7084 v8::Local<v8::Value> result = |
7085 kArgc, | 7085 v8_fun->Call(Utils::ToLocal(debug), kArgc, argv); |
7086 argv); | |
7087 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); | 7086 EXCEPTION_BAILOUT_CHECK(isolate, Local<Value>()); |
7088 return scope.Close(result); | 7087 return scope.Escape(result); |
7089 } | 7088 } |
7090 | 7089 |
7091 | 7090 |
7092 bool Debug::EnableAgent(const char* name, int port, bool wait_for_connection) { | 7091 bool Debug::EnableAgent(const char* name, int port, bool wait_for_connection) { |
7093 return i::Isolate::Current()->debugger()->StartAgent(name, port, | 7092 return i::Isolate::Current()->debugger()->StartAgent(name, port, |
7094 wait_for_connection); | 7093 wait_for_connection); |
7095 } | 7094 } |
7096 | 7095 |
7097 | 7096 |
7098 void Debug::DisableAgent() { | 7097 void Debug::DisableAgent() { |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7781 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7780 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7782 Address callback_address = | 7781 Address callback_address = |
7783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7782 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7784 VMState<EXTERNAL> state(isolate); | 7783 VMState<EXTERNAL> state(isolate); |
7785 ExternalCallbackScope call_scope(isolate, callback_address); | 7784 ExternalCallbackScope call_scope(isolate, callback_address); |
7786 callback(info); | 7785 callback(info); |
7787 } | 7786 } |
7788 | 7787 |
7789 | 7788 |
7790 } } // namespace v8::internal | 7789 } } // namespace v8::internal |
OLD | NEW |