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

Side by Side Diff: src/builtins/builtins.cc

Issue 2350933007: Make sure to use the correct context for eval checks (Closed)
Patch Set: updates Created 4 years, 3 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') | no next file » | 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/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/code-events.h" 6 #include "src/code-events.h"
7 #include "src/code-stub-assembler.h" 7 #include "src/code-stub-assembler.h"
8 #include "src/ic/ic-state.h" 8 #include "src/ic/ic-state.h"
9 #include "src/interface-descriptors.h" 9 #include "src/interface-descriptors.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 return Handle<Code>(code_address); \ 273 return Handle<Code>(code_address); \
274 } 274 }
275 BUILTIN_LIST_ALL(DEFINE_BUILTIN_ACCESSOR) 275 BUILTIN_LIST_ALL(DEFINE_BUILTIN_ACCESSOR)
276 #undef DEFINE_BUILTIN_ACCESSOR 276 #undef DEFINE_BUILTIN_ACCESSOR
277 277
278 // static 278 // static
279 bool Builtins::AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target, 279 bool Builtins::AllowDynamicFunction(Isolate* isolate, Handle<JSFunction> target,
280 Handle<JSObject> target_global_proxy) { 280 Handle<JSObject> target_global_proxy) {
281 if (FLAG_allow_unsafe_function_constructor) return true; 281 if (FLAG_allow_unsafe_function_constructor) return true;
282 HandleScopeImplementer* impl = isolate->handle_scope_implementer(); 282 HandleScopeImplementer* impl = isolate->handle_scope_implementer();
283 Handle<Context> responsible_context = impl->LastEnteredContext(); 283 Handle<Context> responsible_context =
284 impl->MicrotaskContextIsLastEnteredContext() ? impl->MicrotaskContext()
285 : impl->LastEnteredContext();
286 // TODO(jochen): Remove this.
284 if (responsible_context.is_null()) { 287 if (responsible_context.is_null()) {
285 responsible_context = impl->MicrotaskContext(); 288 return true;
286 // TODO(jochen): Remove this.
287 if (responsible_context.is_null()) {
288 return true;
289 }
290 } 289 }
291 if (*responsible_context == target->context()) return true; 290 if (*responsible_context == target->context()) return true;
292 return isolate->MayAccess(responsible_context, target_global_proxy); 291 return isolate->MayAccess(responsible_context, target_global_proxy);
293 } 292 }
294 293
295 } // namespace internal 294 } // namespace internal
296 } // namespace v8 295 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698