OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1609 if (obj->script()->IsScript()) { | 1609 if (obj->script()->IsScript()) { |
1610 i::Object* name = i::Script::cast(obj->script())->name(); | 1610 i::Object* name = i::Script::cast(obj->script())->name(); |
1611 return Utils::ToLocal(i::Handle<i::Object>(name, isolate)); | 1611 return Utils::ToLocal(i::Handle<i::Object>(name, isolate)); |
1612 } else { | 1612 } else { |
1613 return Handle<String>(); | 1613 return Handle<String>(); |
1614 } | 1614 } |
1615 } | 1615 } |
1616 | 1616 |
1617 | 1617 |
1618 Local<Value> Script::Run() { | 1618 Local<Value> Script::Run() { |
1619 i::Handle<i::HeapObject> obj = | 1619 i::Handle<i::Object> obj = Utils::OpenHandle(this, true); |
1620 i::Handle<i::HeapObject>::cast(Utils::OpenHandle(this, true)); | |
1621 // If execution is terminating, Compile(..)->Run() requires this | 1620 // If execution is terminating, Compile(..)->Run() requires this |
1622 // check. | 1621 // check. |
1623 if (obj.is_null()) return Local<Value>(); | 1622 if (obj.is_null()) return Local<Value>(); |
1624 i::Isolate* isolate = obj->GetIsolate(); | 1623 i::Isolate* isolate = i::Handle<i::HeapObject>::cast(obj)->GetIsolate(); |
1625 ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>()); | 1624 ON_BAILOUT(isolate, "v8::Script::Run()", return Local<Value>()); |
1626 LOG_API(isolate, "Script::Run"); | 1625 LOG_API(isolate, "Script::Run"); |
1627 ENTER_V8(isolate); | 1626 ENTER_V8(isolate); |
1628 i::Logger::TimerEventScope timer_scope( | 1627 i::Logger::TimerEventScope timer_scope( |
1629 isolate, i::Logger::TimerEventScope::v8_execute); | 1628 isolate, i::Logger::TimerEventScope::v8_execute); |
1630 i::HandleScope scope(isolate); | 1629 i::HandleScope scope(isolate); |
1631 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(obj); | 1630 i::Handle<i::JSFunction> fun = i::Handle<i::JSFunction>::cast(obj); |
1632 EXCEPTION_PREAMBLE(isolate); | 1631 EXCEPTION_PREAMBLE(isolate); |
1633 i::Handle<i::Object> receiver( | 1632 i::Handle<i::Object> receiver( |
1634 isolate->context()->global_proxy(), isolate); | 1633 isolate->context()->global_proxy(), isolate); |
(...skipping 5964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7599 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7598 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
7600 Address callback_address = | 7599 Address callback_address = |
7601 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7600 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
7602 VMState<EXTERNAL> state(isolate); | 7601 VMState<EXTERNAL> state(isolate); |
7603 ExternalCallbackScope call_scope(isolate, callback_address); | 7602 ExternalCallbackScope call_scope(isolate, callback_address); |
7604 callback(info); | 7603 callback(info); |
7605 } | 7604 } |
7606 | 7605 |
7607 | 7606 |
7608 } } // namespace v8::internal | 7607 } } // namespace v8::internal |
OLD | NEW |