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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void V8::SetNativesDataBlob(StartupData* natives_blob) { | 302 void V8::SetNativesDataBlob(StartupData* natives_blob) { |
303 i::V8::SetNativesBlob(natives_blob); | 303 i::V8::SetNativesBlob(natives_blob); |
304 } | 304 } |
305 | 305 |
306 | 306 |
307 void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { | 307 void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) { |
308 i::V8::SetSnapshotBlob(snapshot_blob); | 308 i::V8::SetSnapshotBlob(snapshot_blob); |
309 } | 309 } |
310 | 310 |
311 | 311 |
312 bool RunExtraCode(Isolate* isolate, const char* utf8_source) { | 312 bool RunExtraCode(Isolate* isolate, Local<Context> context, |
| 313 const char* utf8_source) { |
313 // Run custom script if provided. | 314 // Run custom script if provided. |
314 base::ElapsedTimer timer; | 315 base::ElapsedTimer timer; |
315 timer.Start(); | 316 timer.Start(); |
316 TryCatch try_catch(isolate); | 317 TryCatch try_catch(isolate); |
317 Local<String> source_string = String::NewFromUtf8(isolate, utf8_source); | 318 Local<String> source_string; |
318 if (try_catch.HasCaught()) return false; | 319 if (!String::NewFromUtf8(isolate, utf8_source, NewStringType::kNormal) |
319 ScriptOrigin origin(String::NewFromUtf8(isolate, "<embedded script>")); | 320 .ToLocal(&source_string)) { |
| 321 return false; |
| 322 } |
| 323 Local<String> resource_name = |
| 324 String::NewFromUtf8(isolate, "<embedded script>", NewStringType::kNormal) |
| 325 .ToLocalChecked(); |
| 326 ScriptOrigin origin(resource_name); |
320 ScriptCompiler::Source source(source_string, origin); | 327 ScriptCompiler::Source source(source_string, origin); |
321 Local<Script> script = ScriptCompiler::Compile(isolate, &source); | 328 Local<Script> script; |
322 if (try_catch.HasCaught()) return false; | 329 if (!ScriptCompiler::Compile(context, &source).ToLocal(&script)) return false; |
323 script->Run(); | 330 if (script->Run(context).IsEmpty()) return false; |
324 if (i::FLAG_profile_deserialization) { | 331 if (i::FLAG_profile_deserialization) { |
325 i::PrintF("Executing custom snapshot script took %0.3f ms\n", | 332 i::PrintF("Executing custom snapshot script took %0.3f ms\n", |
326 timer.Elapsed().InMillisecondsF()); | 333 timer.Elapsed().InMillisecondsF()); |
327 } | 334 } |
328 timer.Stop(); | 335 timer.Stop(); |
329 return !try_catch.HasCaught(); | 336 CHECK(!try_catch.HasCaught()); |
| 337 return true; |
330 } | 338 } |
331 | 339 |
332 | 340 |
333 namespace { | 341 namespace { |
334 | 342 |
335 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { | 343 class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
336 public: | 344 public: |
337 virtual void* Allocate(size_t length) { | 345 virtual void* Allocate(size_t length) { |
338 void* data = AllocateUninitialized(length); | 346 void* data = AllocateUninitialized(length); |
339 return data == NULL ? data : memset(data, 0, length); | 347 return data == NULL ? data : memset(data, 0, length); |
(...skipping 20 matching lines...) Expand all Loading... |
360 Persistent<Context> context; | 368 Persistent<Context> context; |
361 i::Snapshot::Metadata metadata; | 369 i::Snapshot::Metadata metadata; |
362 { | 370 { |
363 HandleScope handle_scope(isolate); | 371 HandleScope handle_scope(isolate); |
364 Handle<Context> new_context = Context::New(isolate); | 372 Handle<Context> new_context = Context::New(isolate); |
365 internal_isolate->set_creating_default_snapshot(false); | 373 internal_isolate->set_creating_default_snapshot(false); |
366 context.Reset(isolate, new_context); | 374 context.Reset(isolate, new_context); |
367 if (custom_source != NULL) { | 375 if (custom_source != NULL) { |
368 metadata.set_embeds_script(true); | 376 metadata.set_embeds_script(true); |
369 Context::Scope context_scope(new_context); | 377 Context::Scope context_scope(new_context); |
370 if (!RunExtraCode(isolate, custom_source)) context.Reset(); | 378 if (!RunExtraCode(isolate, new_context, custom_source)) context.Reset(); |
371 } | 379 } |
372 } | 380 } |
373 if (!context.IsEmpty()) { | 381 if (!context.IsEmpty()) { |
374 // Make sure all builtin scripts are cached. | 382 // Make sure all builtin scripts are cached. |
375 { | 383 { |
376 HandleScope scope(isolate); | 384 HandleScope scope(isolate); |
377 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { | 385 for (int i = 0; i < i::Natives::GetBuiltinsCount(); i++) { |
378 internal_isolate->bootstrapper()->SourceLookup<i::Natives>(i); | 386 internal_isolate->bootstrapper()->SourceLookup<i::Natives>(i); |
379 } | 387 } |
380 } | 388 } |
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 Local<Script> Script::Compile(v8::Handle<String> source, | 2059 Local<Script> Script::Compile(v8::Handle<String> source, |
2052 v8::ScriptOrigin* origin) { | 2060 v8::ScriptOrigin* origin) { |
2053 auto str = Utils::OpenHandle(*source); | 2061 auto str = Utils::OpenHandle(*source); |
2054 auto context = ContextFromHeapObject(str); | 2062 auto context = ContextFromHeapObject(str); |
2055 RETURN_TO_LOCAL_UNCHECKED(Compile(context, source, origin), Script); | 2063 RETURN_TO_LOCAL_UNCHECKED(Compile(context, source, origin), Script); |
2056 } | 2064 } |
2057 | 2065 |
2058 | 2066 |
2059 Local<Script> Script::Compile(v8::Handle<String> source, | 2067 Local<Script> Script::Compile(v8::Handle<String> source, |
2060 v8::Handle<String> file_name) { | 2068 v8::Handle<String> file_name) { |
| 2069 auto str = Utils::OpenHandle(*source); |
| 2070 auto context = ContextFromHeapObject(str); |
2061 ScriptOrigin origin(file_name); | 2071 ScriptOrigin origin(file_name); |
2062 return Compile(source, &origin); | 2072 return Compile(context, source, &origin).FromMaybe(Local<Script>()); |
2063 } | 2073 } |
2064 | 2074 |
2065 | 2075 |
2066 // --- E x c e p t i o n s --- | 2076 // --- E x c e p t i o n s --- |
2067 | 2077 |
2068 | 2078 |
2069 v8::TryCatch::TryCatch() | 2079 v8::TryCatch::TryCatch() |
2070 : isolate_(i::Isolate::Current()), | 2080 : isolate_(i::Isolate::Current()), |
2071 next_(isolate_->try_catch_handler()), | 2081 next_(isolate_->try_catch_handler()), |
2072 is_verbose_(false), | 2082 is_verbose_(false), |
(...skipping 1549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3622 key_obj, | 3632 key_obj, |
3623 value_obj, | 3633 value_obj, |
3624 static_cast<PropertyAttributes>(attribs)).is_null(); | 3634 static_cast<PropertyAttributes>(attribs)).is_null(); |
3625 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); | 3635 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
3626 return Just(true); | 3636 return Just(true); |
3627 } | 3637 } |
3628 | 3638 |
3629 | 3639 |
3630 bool v8::Object::ForceSet(v8::Handle<Value> key, v8::Handle<Value> value, | 3640 bool v8::Object::ForceSet(v8::Handle<Value> key, v8::Handle<Value> value, |
3631 v8::PropertyAttribute attribs) { | 3641 v8::PropertyAttribute attribs) { |
3632 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 3642 i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate(); |
3633 return ForceSet(context, key, value, attribs).FromMaybe(false); | 3643 PREPARE_FOR_EXECUTION_GENERIC(isolate, Local<Context>(), |
| 3644 "v8::Object::ForceSet", false, i::HandleScope, |
| 3645 false); |
| 3646 i::Handle<i::JSObject> self = Utils::OpenHandle(this); |
| 3647 i::Handle<i::Object> key_obj = Utils::OpenHandle(*key); |
| 3648 i::Handle<i::Object> value_obj = Utils::OpenHandle(*value); |
| 3649 has_pending_exception = |
| 3650 i::Runtime::DefineObjectProperty(self, key_obj, value_obj, |
| 3651 static_cast<PropertyAttributes>(attribs)) |
| 3652 .is_null(); |
| 3653 EXCEPTION_BAILOUT_CHECK_SCOPED(isolate, false); |
| 3654 return true; |
3634 } | 3655 } |
3635 | 3656 |
3636 | 3657 |
3637 namespace { | 3658 namespace { |
3638 | 3659 |
3639 i::MaybeHandle<i::Object> DeleteObjectProperty( | 3660 i::MaybeHandle<i::Object> DeleteObjectProperty( |
3640 i::Isolate* isolate, i::Handle<i::JSReceiver> receiver, | 3661 i::Isolate* isolate, i::Handle<i::JSReceiver> receiver, |
3641 i::Handle<i::Object> key, i::LanguageMode language_mode) { | 3662 i::Handle<i::Object> key, i::LanguageMode language_mode) { |
3642 // Check if the given key is an array index. | 3663 // Check if the given key is an array index. |
3643 uint32_t index; | 3664 uint32_t index; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3860 auto v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); | 3881 auto v8_isolate = reinterpret_cast<v8::Isolate*>(isolate); |
3861 i::Handle<i::Object> name(self->class_name(), isolate); | 3882 i::Handle<i::Object> name(self->class_name(), isolate); |
3862 i::Handle<i::Object> tag; | 3883 i::Handle<i::Object> tag; |
3863 | 3884 |
3864 // Native implementation of Object.prototype.toString (v8natives.js): | 3885 // Native implementation of Object.prototype.toString (v8natives.js): |
3865 // var c = %_ClassOf(this); | 3886 // var c = %_ClassOf(this); |
3866 // if (c === 'Arguments') c = 'Object'; | 3887 // if (c === 'Arguments') c = 'Object'; |
3867 // return "[object " + c + "]"; | 3888 // return "[object " + c + "]"; |
3868 | 3889 |
3869 if (!name->IsString()) { | 3890 if (!name->IsString()) { |
3870 return v8::String::NewFromUtf8(v8_isolate, "[object ]"); | 3891 return v8::String::NewFromUtf8(v8_isolate, "[object ]", |
| 3892 NewStringType::kNormal); |
3871 } | 3893 } |
3872 auto class_name = i::Handle<i::String>::cast(name); | 3894 auto class_name = i::Handle<i::String>::cast(name); |
3873 if (i::String::Equals(class_name, isolate->factory()->Arguments_string())) { | 3895 if (i::String::Equals(class_name, isolate->factory()->Arguments_string())) { |
3874 return v8::String::NewFromUtf8(v8_isolate, "[object Object]"); | 3896 return v8::String::NewFromUtf8(v8_isolate, "[object Object]", |
| 3897 NewStringType::kNormal); |
3875 } | 3898 } |
3876 if (internal::FLAG_harmony_tostring) { | 3899 if (internal::FLAG_harmony_tostring) { |
3877 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString()", String); | 3900 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString()", String); |
3878 auto toStringTag = isolate->factory()->to_string_tag_symbol(); | 3901 auto toStringTag = isolate->factory()->to_string_tag_symbol(); |
3879 has_pending_exception = !i::Runtime::GetObjectProperty( | 3902 has_pending_exception = !i::Runtime::GetObjectProperty( |
3880 isolate, self, toStringTag).ToHandle(&tag); | 3903 isolate, self, toStringTag).ToHandle(&tag); |
3881 RETURN_ON_FAILED_EXECUTION(String); | 3904 RETURN_ON_FAILED_EXECUTION(String); |
3882 if (tag->IsString()) { | 3905 if (tag->IsString()) { |
3883 class_name = i::Handle<i::String>::cast(tag).EscapeFrom(&handle_scope); | 3906 class_name = i::Handle<i::String>::cast(tag).EscapeFrom(&handle_scope); |
3884 } | 3907 } |
(...skipping 15 matching lines...) Expand all Loading... |
3900 ptr += prefix_len; | 3923 ptr += prefix_len; |
3901 | 3924 |
3902 // Write real content. | 3925 // Write real content. |
3903 str->WriteUtf8(ptr, str_len); | 3926 str->WriteUtf8(ptr, str_len); |
3904 ptr += str_len; | 3927 ptr += str_len; |
3905 | 3928 |
3906 // Write postfix. | 3929 // Write postfix. |
3907 i::MemCopy(ptr, postfix, postfix_len * v8::internal::kCharSize); | 3930 i::MemCopy(ptr, postfix, postfix_len * v8::internal::kCharSize); |
3908 | 3931 |
3909 // Copy the buffer into a heap-allocated string and return it. | 3932 // Copy the buffer into a heap-allocated string and return it. |
3910 return v8::String::NewFromUtf8(v8_isolate, buf.start(), String::kNormalString, | 3933 return v8::String::NewFromUtf8(v8_isolate, buf.start(), |
3911 buf_len); | 3934 NewStringType::kNormal, buf_len); |
3912 } | 3935 } |
3913 | 3936 |
3914 | 3937 |
3915 Local<String> v8::Object::ObjectProtoToString() { | 3938 Local<String> v8::Object::ObjectProtoToString() { |
3916 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 3939 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
3917 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); | 3940 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); |
3918 } | 3941 } |
3919 | 3942 |
3920 | 3943 |
3921 Local<String> v8::Object::GetConstructorName() { | 3944 Local<String> v8::Object::GetConstructorName() { |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4465 | 4488 |
4466 | 4489 |
4467 Local<Function> Function::New(Isolate* v8_isolate, FunctionCallback callback, | 4490 Local<Function> Function::New(Isolate* v8_isolate, FunctionCallback callback, |
4468 Local<Value> data, int length) { | 4491 Local<Value> data, int length) { |
4469 return Function::New(v8_isolate->GetCurrentContext(), callback, data, length) | 4492 return Function::New(v8_isolate->GetCurrentContext(), callback, data, length) |
4470 .FromMaybe(Local<Function>()); | 4493 .FromMaybe(Local<Function>()); |
4471 } | 4494 } |
4472 | 4495 |
4473 | 4496 |
4474 Local<v8::Object> Function::NewInstance() const { | 4497 Local<v8::Object> Function::NewInstance() const { |
4475 return NewInstance(0, NULL); | 4498 return NewInstance(Isolate::GetCurrent()->GetCurrentContext(), 0, NULL) |
| 4499 .FromMaybe(Local<Object>()); |
4476 } | 4500 } |
4477 | 4501 |
4478 | 4502 |
4479 MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc, | 4503 MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc, |
4480 v8::Handle<v8::Value> argv[]) const { | 4504 v8::Handle<v8::Value> argv[]) const { |
4481 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::NewInstance()", | 4505 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, "v8::Function::NewInstance()", |
4482 Object); | 4506 Object); |
4483 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 4507 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
4484 auto self = Utils::OpenHandle(this); | 4508 auto self = Utils::OpenHandle(this); |
4485 STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**)); | 4509 STATIC_ASSERT(sizeof(v8::Handle<v8::Value>) == sizeof(i::Object**)); |
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5395 return Utils::ToLocal(value); | 5419 return Utils::ToLocal(value); |
5396 } | 5420 } |
5397 | 5421 |
5398 | 5422 |
5399 void v8::Object::SetInternalField(int index, v8::Handle<Value> value) { | 5423 void v8::Object::SetInternalField(int index, v8::Handle<Value> value) { |
5400 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 5424 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
5401 const char* location = "v8::Object::SetInternalField()"; | 5425 const char* location = "v8::Object::SetInternalField()"; |
5402 if (!InternalFieldOK(obj, index, location)) return; | 5426 if (!InternalFieldOK(obj, index, location)) return; |
5403 i::Handle<i::Object> val = Utils::OpenHandle(*value); | 5427 i::Handle<i::Object> val = Utils::OpenHandle(*value); |
5404 obj->SetInternalField(index, *val); | 5428 obj->SetInternalField(index, *val); |
5405 DCHECK(value->Equals(GetInternalField(index))); | |
5406 } | 5429 } |
5407 | 5430 |
5408 | 5431 |
5409 void* v8::Object::SlowGetAlignedPointerFromInternalField(int index) { | 5432 void* v8::Object::SlowGetAlignedPointerFromInternalField(int index) { |
5410 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); | 5433 i::Handle<i::JSObject> obj = Utils::OpenHandle(this); |
5411 const char* location = "v8::Object::GetAlignedPointerFromInternalField()"; | 5434 const char* location = "v8::Object::GetAlignedPointerFromInternalField()"; |
5412 if (!InternalFieldOK(obj, index, location)) return NULL; | 5435 if (!InternalFieldOK(obj, index, location)) return NULL; |
5413 return DecodeSmiToAligned(obj->GetInternalField(index), location); | 5436 return DecodeSmiToAligned(obj->GetInternalField(index), location); |
5414 } | 5437 } |
5415 | 5438 |
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7499 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 7522 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
7500 i::DisallowHeapAllocation no_allocation; | 7523 i::DisallowHeapAllocation no_allocation; |
7501 VisitorAdapter visitor_adapter(visitor); | 7524 VisitorAdapter visitor_adapter(visitor); |
7502 isolate->global_handles()->IterateAllRootsInNewSpaceWithClassIds( | 7525 isolate->global_handles()->IterateAllRootsInNewSpaceWithClassIds( |
7503 &visitor_adapter); | 7526 &visitor_adapter); |
7504 } | 7527 } |
7505 | 7528 |
7506 | 7529 |
7507 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) | 7530 String::Utf8Value::Utf8Value(v8::Handle<v8::Value> obj) |
7508 : str_(NULL), length_(0) { | 7531 : str_(NULL), length_(0) { |
| 7532 if (obj.IsEmpty()) return; |
7509 i::Isolate* isolate = i::Isolate::Current(); | 7533 i::Isolate* isolate = i::Isolate::Current(); |
7510 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); | 7534 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
7511 if (obj.IsEmpty()) return; | |
7512 ENTER_V8(isolate); | 7535 ENTER_V8(isolate); |
7513 i::HandleScope scope(isolate); | 7536 i::HandleScope scope(isolate); |
| 7537 Local<Context> context = v8_isolate->GetCurrentContext(); |
7514 TryCatch try_catch(v8_isolate); | 7538 TryCatch try_catch(v8_isolate); |
7515 Handle<String> str = obj->ToString(v8_isolate); | 7539 Handle<String> str; |
7516 if (str.IsEmpty()) return; | 7540 if (!obj->ToString(context).ToLocal(&str)) return; |
7517 i::Handle<i::String> i_str = Utils::OpenHandle(*str); | 7541 i::Handle<i::String> i_str = Utils::OpenHandle(*str); |
7518 length_ = v8::Utf8Length(*i_str, isolate); | 7542 length_ = v8::Utf8Length(*i_str, isolate); |
7519 str_ = i::NewArray<char>(length_ + 1); | 7543 str_ = i::NewArray<char>(length_ + 1); |
7520 str->WriteUtf8(str_); | 7544 str->WriteUtf8(str_); |
7521 } | 7545 } |
7522 | 7546 |
7523 | 7547 |
7524 String::Utf8Value::~Utf8Value() { | 7548 String::Utf8Value::~Utf8Value() { |
7525 i::DeleteArray(str_); | 7549 i::DeleteArray(str_); |
7526 } | 7550 } |
7527 | 7551 |
7528 | 7552 |
7529 String::Value::Value(v8::Handle<v8::Value> obj) | 7553 String::Value::Value(v8::Handle<v8::Value> obj) |
7530 : str_(NULL), length_(0) { | 7554 : str_(NULL), length_(0) { |
| 7555 if (obj.IsEmpty()) return; |
7531 i::Isolate* isolate = i::Isolate::Current(); | 7556 i::Isolate* isolate = i::Isolate::Current(); |
7532 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); | 7557 Isolate* v8_isolate = reinterpret_cast<Isolate*>(isolate); |
7533 if (obj.IsEmpty()) return; | |
7534 ENTER_V8(isolate); | 7558 ENTER_V8(isolate); |
7535 i::HandleScope scope(isolate); | 7559 i::HandleScope scope(isolate); |
| 7560 Local<Context> context = v8_isolate->GetCurrentContext(); |
7536 TryCatch try_catch(v8_isolate); | 7561 TryCatch try_catch(v8_isolate); |
7537 Handle<String> str = obj->ToString(v8_isolate); | 7562 Handle<String> str; |
7538 if (str.IsEmpty()) return; | 7563 if (!obj->ToString(context).ToLocal(&str)) return; |
7539 length_ = str->Length(); | 7564 length_ = str->Length(); |
7540 str_ = i::NewArray<uint16_t>(length_ + 1); | 7565 str_ = i::NewArray<uint16_t>(length_ + 1); |
7541 str->Write(str_); | 7566 str->Write(str_); |
7542 } | 7567 } |
7543 | 7568 |
7544 | 7569 |
7545 String::Value::~Value() { | 7570 String::Value::~Value() { |
7546 i::DeleteArray(str_); | 7571 i::DeleteArray(str_); |
7547 } | 7572 } |
7548 | 7573 |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8362 Address callback_address = | 8387 Address callback_address = |
8363 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8388 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8364 VMState<EXTERNAL> state(isolate); | 8389 VMState<EXTERNAL> state(isolate); |
8365 ExternalCallbackScope call_scope(isolate, callback_address); | 8390 ExternalCallbackScope call_scope(isolate, callback_address); |
8366 callback(info); | 8391 callback(info); |
8367 } | 8392 } |
8368 | 8393 |
8369 | 8394 |
8370 } // namespace internal | 8395 } // namespace internal |
8371 } // namespace v8 | 8396 } // namespace v8 |
OLD | NEW |