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

Side by Side Diff: src/api.cc

Issue 1394983005: Restructure Object::SetProperty and related functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 5 years, 2 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 | « no previous file | src/api-natives.cc » ('j') | src/objects.cc » ('J')
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 3667 matching lines...) Expand 10 before | Expand all | Expand 10 after
3678 3678
3679 3679
3680 Maybe<bool> v8::Object::SetPrototype(Local<Context> context, 3680 Maybe<bool> v8::Object::SetPrototype(Local<Context> context,
3681 Local<Value> value) { 3681 Local<Value> value) {
3682 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetPrototype()", bool); 3682 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetPrototype()", bool);
3683 auto self = Utils::OpenHandle(this); 3683 auto self = Utils::OpenHandle(this);
3684 auto value_obj = Utils::OpenHandle(*value); 3684 auto value_obj = Utils::OpenHandle(*value);
3685 // We do not allow exceptions thrown while setting the prototype 3685 // We do not allow exceptions thrown while setting the prototype
3686 // to propagate outside. 3686 // to propagate outside.
3687 TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate)); 3687 TryCatch try_catch(reinterpret_cast<v8::Isolate*>(isolate));
3688 auto result = 3688 auto result = i::JSObject::SetPrototype(self, value_obj, false,
3689 i::JSObject::SetPrototype(self, value_obj, false, i::THROW_ON_ERROR); 3689 i::Object::THROW_ON_ERROR);
3690 has_pending_exception = result.IsNothing(); 3690 has_pending_exception = result.IsNothing();
3691 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); 3691 RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
3692 return Just(true); 3692 return Just(true);
3693 } 3693 }
3694 3694
3695 3695
3696 bool v8::Object::SetPrototype(Local<Value> value) { 3696 bool v8::Object::SetPrototype(Local<Value> value) {
3697 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); 3697 auto context = ContextFromHeapObject(Utils::OpenHandle(this));
3698 return SetPrototype(context, value).FromMaybe(false); 3698 return SetPrototype(context, value).FromMaybe(false);
3699 } 3699 }
(...skipping 4687 matching lines...) Expand 10 before | Expand all | Expand 10 after
8387 Address callback_address = 8387 Address callback_address =
8388 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8388 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8389 VMState<EXTERNAL> state(isolate); 8389 VMState<EXTERNAL> state(isolate);
8390 ExternalCallbackScope call_scope(isolate, callback_address); 8390 ExternalCallbackScope call_scope(isolate, callback_address);
8391 callback(info); 8391 callback(info);
8392 } 8392 }
8393 8393
8394 8394
8395 } // namespace internal 8395 } // namespace internal
8396 } // namespace v8 8396 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api-natives.cc » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698