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

Side by Side Diff: src/hydrogen.cc

Issue 1036743004: add access checks to receivers on function callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: super nit Created 5 years, 9 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/builtins.cc ('k') | src/objects.h » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/hydrogen.h" 5 #include "src/hydrogen.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 8637 matching lines...) Expand 10 before | Expand all | Expand 10 after
8648 int argc, 8648 int argc,
8649 BailoutId ast_id, 8649 BailoutId ast_id,
8650 ApiCallType call_type) { 8650 ApiCallType call_type) {
8651 if (function->context()->native_context() != 8651 if (function->context()->native_context() !=
8652 top_info()->closure()->context()->native_context()) { 8652 top_info()->closure()->context()->native_context()) {
8653 return false; 8653 return false;
8654 } 8654 }
8655 CallOptimization optimization(function); 8655 CallOptimization optimization(function);
8656 if (!optimization.is_simple_api_call()) return false; 8656 if (!optimization.is_simple_api_call()) return false;
8657 Handle<Map> holder_map; 8657 Handle<Map> holder_map;
8658 for (int i = 0; i < receiver_maps->length(); ++i) {
8659 auto map = receiver_maps->at(i);
8660 // Don't inline calls to receivers requiring accesschecks.
8661 if (map->is_access_check_needed()) return false;
8662 }
8658 if (call_type == kCallApiFunction) { 8663 if (call_type == kCallApiFunction) {
8659 // Cannot embed a direct reference to the global proxy map 8664 // Cannot embed a direct reference to the global proxy map
8660 // as it maybe dropped on deserialization. 8665 // as it maybe dropped on deserialization.
8661 CHECK(!isolate()->serializer_enabled()); 8666 CHECK(!isolate()->serializer_enabled());
8662 DCHECK_EQ(0, receiver_maps->length()); 8667 DCHECK_EQ(0, receiver_maps->length());
8663 receiver_maps->Add(handle(function->global_proxy()->map()), zone()); 8668 receiver_maps->Add(handle(function->global_proxy()->map()), zone());
8664 } 8669 }
8665 CallOptimization::HolderLookup holder_lookup = 8670 CallOptimization::HolderLookup holder_lookup =
8666 CallOptimization::kHolderNotFound; 8671 CallOptimization::kHolderNotFound;
8667 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( 8672 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType(
(...skipping 4730 matching lines...) Expand 10 before | Expand all | Expand 10 after
13398 if (ShouldProduceTraceOutput()) { 13403 if (ShouldProduceTraceOutput()) {
13399 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13404 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13400 } 13405 }
13401 13406
13402 #ifdef DEBUG 13407 #ifdef DEBUG
13403 graph_->Verify(false); // No full verify. 13408 graph_->Verify(false); // No full verify.
13404 #endif 13409 #endif
13405 } 13410 }
13406 13411
13407 } } // namespace v8::internal 13412 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698