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

Side by Side Diff: src/api.cc

Issue 1398093002: Pass the context from which a given receiver is accessed explicitly (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/builtins.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 3480 matching lines...) Expand 10 before | Expand all | Expand 10 after
3491 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context, 3491 Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context,
3492 v8::Local<Name> key, 3492 v8::Local<Name> key,
3493 v8::Local<Value> value, 3493 v8::Local<Value> value,
3494 v8::PropertyAttribute attributes) { 3494 v8::PropertyAttribute attributes) {
3495 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::DefineOwnProperty()", 3495 PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::DefineOwnProperty()",
3496 bool); 3496 bool);
3497 auto self = Utils::OpenHandle(this); 3497 auto self = Utils::OpenHandle(this);
3498 auto key_obj = Utils::OpenHandle(*key); 3498 auto key_obj = Utils::OpenHandle(*key);
3499 auto value_obj = Utils::OpenHandle(*value); 3499 auto value_obj = Utils::OpenHandle(*value);
3500 3500
3501 if (self->IsAccessCheckNeeded() && !isolate->MayAccess(self)) { 3501 if (self->IsAccessCheckNeeded() &&
3502 !isolate->MayAccess(handle(isolate->context()), self)) {
3502 isolate->ReportFailedAccessCheck(self); 3503 isolate->ReportFailedAccessCheck(self);
3503 return Nothing<bool>(); 3504 return Nothing<bool>();
3504 } 3505 }
3505 3506
3506 i::Handle<i::FixedArray> desc = isolate->factory()->NewFixedArray(3); 3507 i::Handle<i::FixedArray> desc = isolate->factory()->NewFixedArray(3);
3507 desc->set(0, isolate->heap()->ToBoolean(!(attributes & v8::ReadOnly))); 3508 desc->set(0, isolate->heap()->ToBoolean(!(attributes & v8::ReadOnly)));
3508 desc->set(1, isolate->heap()->ToBoolean(!(attributes & v8::DontEnum))); 3509 desc->set(1, isolate->heap()->ToBoolean(!(attributes & v8::DontEnum)));
3509 desc->set(2, isolate->heap()->ToBoolean(!(attributes & v8::DontDelete))); 3510 desc->set(2, isolate->heap()->ToBoolean(!(attributes & v8::DontDelete)));
3510 i::Handle<i::JSArray> desc_array = 3511 i::Handle<i::JSArray> desc_array =
3511 isolate->factory()->NewJSArrayWithElements(desc, i::FAST_ELEMENTS, 3); 3512 isolate->factory()->NewJSArrayWithElements(desc, i::FAST_ELEMENTS, 3);
(...skipping 4876 matching lines...) Expand 10 before | Expand all | Expand 10 after
8388 Address callback_address = 8389 Address callback_address =
8389 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 8390 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
8390 VMState<EXTERNAL> state(isolate); 8391 VMState<EXTERNAL> state(isolate);
8391 ExternalCallbackScope call_scope(isolate, callback_address); 8392 ExternalCallbackScope call_scope(isolate, callback_address);
8392 callback(info); 8393 callback(info);
8393 } 8394 }
8394 8395
8395 8396
8396 } // namespace internal 8397 } // namespace internal
8397 } // namespace v8 8398 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698