OLD | NEW |
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 8628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8639 | 8639 |
8640 bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function, | 8640 bool HOptimizedGraphBuilder::TryInlineApiCall(Handle<JSFunction> function, |
8641 HValue* receiver, | 8641 HValue* receiver, |
8642 SmallMapList* receiver_maps, | 8642 SmallMapList* receiver_maps, |
8643 int argc, | 8643 int argc, |
8644 BailoutId ast_id, | 8644 BailoutId ast_id, |
8645 ApiCallType call_type) { | 8645 ApiCallType call_type) { |
8646 CallOptimization optimization(function); | 8646 CallOptimization optimization(function); |
8647 if (!optimization.is_simple_api_call()) return false; | 8647 if (!optimization.is_simple_api_call()) return false; |
8648 Handle<Map> holder_map; | 8648 Handle<Map> holder_map; |
8649 for (int i = 0; i < receiver_maps->length(); ++i) { | |
8650 auto map = receiver_maps->at(i); | |
8651 // Don't inline calls to receivers requiring accesschecks. | |
8652 if (map->is_access_check_needed() && | |
8653 map->instance_type() != JS_GLOBAL_PROXY_TYPE) { | |
8654 return false; | |
8655 } | |
8656 } | |
8657 if (call_type == kCallApiFunction) { | 8649 if (call_type == kCallApiFunction) { |
8658 // Cannot embed a direct reference to the global proxy map | 8650 // Cannot embed a direct reference to the global proxy map |
8659 // as it maybe dropped on deserialization. | 8651 // as it maybe dropped on deserialization. |
8660 CHECK(!isolate()->serializer_enabled()); | 8652 CHECK(!isolate()->serializer_enabled()); |
8661 DCHECK_EQ(0, receiver_maps->length()); | 8653 DCHECK_EQ(0, receiver_maps->length()); |
8662 receiver_maps->Add(handle(function->global_proxy()->map()), zone()); | 8654 receiver_maps->Add(handle(function->global_proxy()->map()), zone()); |
8663 } | 8655 } |
8664 CallOptimization::HolderLookup holder_lookup = | 8656 CallOptimization::HolderLookup holder_lookup = |
8665 CallOptimization::kHolderNotFound; | 8657 CallOptimization::kHolderNotFound; |
8666 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( | 8658 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( |
(...skipping 4730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13397 if (ShouldProduceTraceOutput()) { | 13389 if (ShouldProduceTraceOutput()) { |
13398 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13390 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13399 } | 13391 } |
13400 | 13392 |
13401 #ifdef DEBUG | 13393 #ifdef DEBUG |
13402 graph_->Verify(false); // No full verify. | 13394 graph_->Verify(false); // No full verify. |
13403 #endif | 13395 #endif |
13404 } | 13396 } |
13405 | 13397 |
13406 } } // namespace v8::internal | 13398 } } // namespace v8::internal |
OLD | NEW |