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

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: 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') | src/objects.cc » ('J')
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 8641 matching lines...) Expand 10 before | Expand all | Expand 10 after
8652 CHECK(!isolate()->serializer_enabled()); 8652 CHECK(!isolate()->serializer_enabled());
8653 DCHECK_EQ(0, receiver_maps->length()); 8653 DCHECK_EQ(0, receiver_maps->length());
8654 receiver_maps->Add(handle(function->global_proxy()->map()), zone()); 8654 receiver_maps->Add(handle(function->global_proxy()->map()), zone());
8655 } 8655 }
8656 CallOptimization::HolderLookup holder_lookup = 8656 CallOptimization::HolderLookup holder_lookup =
8657 CallOptimization::kHolderNotFound; 8657 CallOptimization::kHolderNotFound;
8658 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( 8658 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType(
8659 receiver_maps->first(), &holder_lookup); 8659 receiver_maps->first(), &holder_lookup);
8660 if (holder_lookup == CallOptimization::kHolderNotFound) return false; 8660 if (holder_lookup == CallOptimization::kHolderNotFound) return false;
8661 8661
8662 // Don't inline calls to receivers requiring accesschecks.
8663 for (int i = 0; i < receiver_maps->length(); ++i) {
8664 if (receiver_maps->at(i)->is_access_check_needed()) return false;
8665 }
8666
8662 if (FLAG_trace_inlining) { 8667 if (FLAG_trace_inlining) {
8663 PrintF("Inlining api function "); 8668 PrintF("Inlining api function ");
8664 function->ShortPrint(); 8669 function->ShortPrint();
8665 PrintF("\n"); 8670 PrintF("\n");
8666 } 8671 }
8667 8672
8668 bool is_function = false; 8673 bool is_function = false;
8669 bool is_store = false; 8674 bool is_store = false;
8670 switch (call_type) { 8675 switch (call_type) {
8671 case kCallApiFunction: 8676 case kCallApiFunction:
(...skipping 4717 matching lines...) Expand 10 before | Expand all | Expand 10 after
13389 if (ShouldProduceTraceOutput()) { 13394 if (ShouldProduceTraceOutput()) {
13390 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); 13395 isolate()->GetHTracer()->TraceHydrogen(name(), graph_);
13391 } 13396 }
13392 13397
13393 #ifdef DEBUG 13398 #ifdef DEBUG
13394 graph_->Verify(false); // No full verify. 13399 graph_->Verify(false); // No full verify.
13395 #endif 13400 #endif
13396 } 13401 }
13397 13402
13398 } } // namespace v8::internal 13403 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/builtins.cc ('k') | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698