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 "hydrogen.h" | 5 #include "hydrogen.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "v8.h" | 9 #include "v8.h" |
10 #include "allocation-site-scopes.h" | 10 #include "allocation-site-scopes.h" |
(...skipping 7881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7892 SmallMapList* receiver_maps, | 7892 SmallMapList* receiver_maps, |
7893 int argc, | 7893 int argc, |
7894 BailoutId ast_id, | 7894 BailoutId ast_id, |
7895 ApiCallType call_type) { | 7895 ApiCallType call_type) { |
7896 CallOptimization optimization(function); | 7896 CallOptimization optimization(function); |
7897 if (!optimization.is_simple_api_call()) return false; | 7897 if (!optimization.is_simple_api_call()) return false; |
7898 Handle<Map> holder_map; | 7898 Handle<Map> holder_map; |
7899 if (call_type == kCallApiFunction) { | 7899 if (call_type == kCallApiFunction) { |
7900 // Cannot embed a direct reference to the global proxy map | 7900 // Cannot embed a direct reference to the global proxy map |
7901 // as it maybe dropped on deserialization. | 7901 // as it maybe dropped on deserialization. |
7902 CHECK(!Serializer::enabled()); | 7902 CHECK(!Serializer::enabled(isolate())); |
7903 ASSERT_EQ(0, receiver_maps->length()); | 7903 ASSERT_EQ(0, receiver_maps->length()); |
7904 receiver_maps->Add(handle( | 7904 receiver_maps->Add(handle( |
7905 function->context()->global_object()->global_receiver()->map()), | 7905 function->context()->global_object()->global_receiver()->map()), |
7906 zone()); | 7906 zone()); |
7907 } | 7907 } |
7908 CallOptimization::HolderLookup holder_lookup = | 7908 CallOptimization::HolderLookup holder_lookup = |
7909 CallOptimization::kHolderNotFound; | 7909 CallOptimization::kHolderNotFound; |
7910 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( | 7910 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( |
7911 receiver_maps->first(), &holder_lookup); | 7911 receiver_maps->first(), &holder_lookup); |
7912 if (holder_lookup == CallOptimization::kHolderNotFound) return false; | 7912 if (holder_lookup == CallOptimization::kHolderNotFound) return false; |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8079 } | 8079 } |
8080 } | 8080 } |
8081 | 8081 |
8082 | 8082 |
8083 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, | 8083 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, |
8084 Handle<JSFunction> target) { | 8084 Handle<JSFunction> target) { |
8085 SharedFunctionInfo* shared = target->shared(); | 8085 SharedFunctionInfo* shared = target->shared(); |
8086 if (shared->strict_mode() == SLOPPY && !shared->native()) { | 8086 if (shared->strict_mode() == SLOPPY && !shared->native()) { |
8087 // Cannot embed a direct reference to the global proxy | 8087 // Cannot embed a direct reference to the global proxy |
8088 // as is it dropped on deserialization. | 8088 // as is it dropped on deserialization. |
8089 CHECK(!Serializer::enabled()); | 8089 CHECK(!Serializer::enabled(isolate())); |
8090 Handle<JSObject> global_receiver( | 8090 Handle<JSObject> global_receiver( |
8091 target->context()->global_object()->global_receiver()); | 8091 target->context()->global_object()->global_receiver()); |
8092 return Add<HConstant>(global_receiver); | 8092 return Add<HConstant>(global_receiver); |
8093 } | 8093 } |
8094 return graph()->GetConstantUndefined(); | 8094 return graph()->GetConstantUndefined(); |
8095 } | 8095 } |
8096 | 8096 |
8097 | 8097 |
8098 void HOptimizedGraphBuilder::VisitCall(Call* expr) { | 8098 void HOptimizedGraphBuilder::VisitCall(Call* expr) { |
8099 ASSERT(!HasStackOverflow()); | 8099 ASSERT(!HasStackOverflow()); |
(...skipping 3566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11666 if (ShouldProduceTraceOutput()) { | 11666 if (ShouldProduceTraceOutput()) { |
11667 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11667 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
11668 } | 11668 } |
11669 | 11669 |
11670 #ifdef DEBUG | 11670 #ifdef DEBUG |
11671 graph_->Verify(false); // No full verify. | 11671 graph_->Verify(false); // No full verify. |
11672 #endif | 11672 #endif |
11673 } | 11673 } |
11674 | 11674 |
11675 } } // namespace v8::internal | 11675 } } // namespace v8::internal |
OLD | NEW |