Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: src/api.cc

Issue 1128533002: [handles] Sanitize Handle and friends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Lower kTargetRecursionDepth. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/api.h ('k') | src/handles.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 = i::Handle<i::String>::cast(tag).EscapeFrom(&handle_scope); 3800 class_name = Utils::OpenHandle(*handle_scope.Escape(
3801 Utils::ToLocal(i::Handle<i::String>::cast(tag))));
3801 } 3802 }
3802 } 3803 }
3803 const char* prefix = "[object "; 3804 const char* prefix = "[object ";
3804 Local<String> str = Utils::ToLocal(class_name); 3805 Local<String> str = Utils::ToLocal(class_name);
3805 const char* postfix = "]"; 3806 const char* postfix = "]";
3806 3807
3807 int prefix_len = i::StrLength(prefix); 3808 int prefix_len = i::StrLength(prefix);
3808 int str_len = str->Utf8Length(); 3809 int str_len = str->Utf8Length();
3809 int postfix_len = i::StrLength(postfix); 3810 int postfix_len = i::StrLength(postfix);
3810 3811
(...skipping 4600 matching lines...) Expand 10 before | Expand all | Expand 10 after
8411 Address callback_address = 8412 Address callback_address =
8412 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8413 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8413 VMState<EXTERNAL> state(isolate); 8414 VMState<EXTERNAL> state(isolate);
8414 ExternalCallbackScope call_scope(isolate, callback_address); 8415 ExternalCallbackScope call_scope(isolate, callback_address);
8415 callback(info); 8416 callback(info);
8416 } 8417 }
8417 8418
8418 8419
8419 } // namespace internal 8420 } // namespace internal
8420 } // namespace v8 8421 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.h ('k') | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698