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

Side by Side Diff: src/builtins.cc

Issue 1420413002: Assume that ReportFailedAccessCheck always schedules an exception. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/objects.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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1694 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 DCHECK(!args[0]->IsNull()); 1705 DCHECK(!args[0]->IsNull());
1706 if (args[0]->IsUndefined()) args[0] = function->global_proxy(); 1706 if (args[0]->IsUndefined()) args[0] = function->global_proxy();
1707 1707
1708 if (!is_construct && !fun_data->accept_any_receiver()) { 1708 if (!is_construct && !fun_data->accept_any_receiver()) {
1709 Handle<Object> receiver(&args[0]); 1709 Handle<Object> receiver(&args[0]);
1710 if (receiver->IsJSObject() && receiver->IsAccessCheckNeeded()) { 1710 if (receiver->IsJSObject() && receiver->IsAccessCheckNeeded()) {
1711 Handle<JSObject> js_receiver = Handle<JSObject>::cast(receiver); 1711 Handle<JSObject> js_receiver = Handle<JSObject>::cast(receiver);
1712 if (!isolate->MayAccess(handle(isolate->context()), js_receiver)) { 1712 if (!isolate->MayAccess(handle(isolate->context()), js_receiver)) {
1713 isolate->ReportFailedAccessCheck(js_receiver); 1713 isolate->ReportFailedAccessCheck(js_receiver);
1714 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object); 1714 RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
1715 UNREACHABLE();
1715 } 1716 }
1716 } 1717 }
1717 } 1718 }
1718 1719
1719 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]); 1720 Object* raw_holder = fun_data->GetCompatibleReceiver(isolate, args[0]);
1720 1721
1721 if (raw_holder->IsNull()) { 1722 if (raw_holder->IsNull()) {
1722 // This function cannot be called with the given receiver. Abort! 1723 // This function cannot be called with the given receiver. Abort!
1723 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIllegalInvocation), 1724 THROW_NEW_ERROR(isolate, NewTypeError(MessageTemplate::kIllegalInvocation),
1724 Object); 1725 Object);
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
2265 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2266 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2266 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2267 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2267 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2268 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2268 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2269 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2269 #undef DEFINE_BUILTIN_ACCESSOR_C 2270 #undef DEFINE_BUILTIN_ACCESSOR_C
2270 #undef DEFINE_BUILTIN_ACCESSOR_A 2271 #undef DEFINE_BUILTIN_ACCESSOR_A
2271 2272
2272 2273
2273 } // namespace internal 2274 } // namespace internal
2274 } // namespace v8 2275 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698