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

Side by Side Diff: src/api.cc

Issue 1940483002: Version 5.1.281.24 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@5.1
Patch Set: Created 4 years, 7 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 | « include/v8-version.h ('k') | test/cctest/test-api.cc » ('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 3892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String); 3903 RETURN_TO_LOCAL_UNCHECKED(ObjectProtoToString(context), String);
3904 } 3904 }
3905 3905
3906 3906
3907 Local<String> v8::Object::GetConstructorName() { 3907 Local<String> v8::Object::GetConstructorName() {
3908 auto self = Utils::OpenHandle(this); 3908 auto self = Utils::OpenHandle(this);
3909 i::Handle<i::String> name = i::JSReceiver::GetConstructorName(self); 3909 i::Handle<i::String> name = i::JSReceiver::GetConstructorName(self);
3910 return Utils::ToLocal(name); 3910 return Utils::ToLocal(name);
3911 } 3911 }
3912 3912
3913 Maybe<bool> v8::Object::SetIntegrityLevel(Local<Context> context,
3914 IntegrityLevel level) {
3915 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetIntegrityLevel()",
3916 bool);
3917 auto self = Utils::OpenHandle(this);
3918 i::JSReceiver::IntegrityLevel i_level =
3919 level == IntegrityLevel::kFrozen ? i::FROZEN : i::SEALED;
3920 Maybe<bool> result =
3921 i::JSReceiver::SetIntegrityLevel(self, i_level, i::Object::DONT_THROW);
3922 has_pending_exception = result.IsNothing();
3923 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3924 return result;
3925 }
3913 3926
3914 Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) { 3927 Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) {
3915 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Delete()", bool); 3928 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Delete()", bool);
3916 auto self = Utils::OpenHandle(this); 3929 auto self = Utils::OpenHandle(this);
3917 auto key_obj = Utils::OpenHandle(*key); 3930 auto key_obj = Utils::OpenHandle(*key);
3918 Maybe<bool> result = 3931 Maybe<bool> result =
3919 i::Runtime::DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY); 3932 i::Runtime::DeleteObjectProperty(isolate, self, key_obj, i::SLOPPY);
3920 has_pending_exception = result.IsNothing(); 3933 has_pending_exception = result.IsNothing();
3921 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3934 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3922 return result; 3935 return result;
(...skipping 4859 matching lines...) Expand 10 before | Expand all | Expand 10 after
8782 Address callback_address = 8795 Address callback_address =
8783 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8796 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8784 VMState<EXTERNAL> state(isolate); 8797 VMState<EXTERNAL> state(isolate);
8785 ExternalCallbackScope call_scope(isolate, callback_address); 8798 ExternalCallbackScope call_scope(isolate, callback_address);
8786 callback(info); 8799 callback(info);
8787 } 8800 }
8788 8801
8789 8802
8790 } // namespace internal 8803 } // namespace internal
8791 } // namespace v8 8804 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698