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 3779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3790 return v8::String::NewFromUtf8(v8_isolate, "[object Object]", | 3790 return v8::String::NewFromUtf8(v8_isolate, "[object Object]", |
3791 NewStringType::kNormal); | 3791 NewStringType::kNormal); |
3792 } | 3792 } |
3793 if (internal::FLAG_harmony_tostring) { | 3793 if (internal::FLAG_harmony_tostring) { |
3794 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString()", String); | 3794 PREPARE_FOR_EXECUTION(context, "v8::Object::ObjectProtoToString()", String); |
3795 auto toStringTag = isolate->factory()->to_string_tag_symbol(); | 3795 auto toStringTag = isolate->factory()->to_string_tag_symbol(); |
3796 has_pending_exception = !i::Runtime::GetObjectProperty( | 3796 has_pending_exception = !i::Runtime::GetObjectProperty( |
3797 isolate, self, toStringTag).ToHandle(&tag); | 3797 isolate, self, toStringTag).ToHandle(&tag); |
3798 RETURN_ON_FAILED_EXECUTION(String); | 3798 RETURN_ON_FAILED_EXECUTION(String); |
3799 if (tag->IsString()) { | 3799 if (tag->IsString()) { |
3800 class_name = Utils::OpenHandle(*handle_scope.Escape( | 3800 class_name = i::Handle<i::String>::cast(tag).EscapeFrom(&handle_scope); |
3801 Utils::ToLocal(i::Handle<i::String>::cast(tag)))); | |
3802 } | 3801 } |
3803 } | 3802 } |
3804 const char* prefix = "[object "; | 3803 const char* prefix = "[object "; |
3805 Local<String> str = Utils::ToLocal(class_name); | 3804 Local<String> str = Utils::ToLocal(class_name); |
3806 const char* postfix = "]"; | 3805 const char* postfix = "]"; |
3807 | 3806 |
3808 int prefix_len = i::StrLength(prefix); | 3807 int prefix_len = i::StrLength(prefix); |
3809 int str_len = str->Utf8Length(); | 3808 int str_len = str->Utf8Length(); |
3810 int postfix_len = i::StrLength(postfix); | 3809 int postfix_len = i::StrLength(postfix); |
3811 | 3810 |
(...skipping 4600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8412 Address callback_address = | 8411 Address callback_address = |
8413 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8412 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8414 VMState<EXTERNAL> state(isolate); | 8413 VMState<EXTERNAL> state(isolate); |
8415 ExternalCallbackScope call_scope(isolate, callback_address); | 8414 ExternalCallbackScope call_scope(isolate, callback_address); |
8416 callback(info); | 8415 callback(info); |
8417 } | 8416 } |
8418 | 8417 |
8419 | 8418 |
8420 } // namespace internal | 8419 } // namespace internal |
8421 } // namespace v8 | 8420 } // namespace v8 |
OLD | NEW |