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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 8414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8425 BailoutId ast_id, | 8425 BailoutId ast_id, |
8426 ApiCallType call_type) { | 8426 ApiCallType call_type) { |
8427 CallOptimization optimization(function); | 8427 CallOptimization optimization(function); |
8428 if (!optimization.is_simple_api_call()) return false; | 8428 if (!optimization.is_simple_api_call()) return false; |
8429 Handle<Map> holder_map; | 8429 Handle<Map> holder_map; |
8430 if (call_type == kCallApiFunction) { | 8430 if (call_type == kCallApiFunction) { |
8431 // Cannot embed a direct reference to the global proxy map | 8431 // Cannot embed a direct reference to the global proxy map |
8432 // as it maybe dropped on deserialization. | 8432 // as it maybe dropped on deserialization. |
8433 CHECK(!isolate()->serializer_enabled()); | 8433 CHECK(!isolate()->serializer_enabled()); |
8434 ASSERT_EQ(0, receiver_maps->length()); | 8434 ASSERT_EQ(0, receiver_maps->length()); |
8435 receiver_maps->Add(handle( | 8435 receiver_maps->Add(handle(function->context()->global_proxy()->map()), |
Igor Sheludko
2014/07/01 08:35:42
function->global_proxy()
| |
8436 function->context()->global_object()->global_receiver()->map()), | 8436 zone()); |
8437 zone()); | |
8438 } | 8437 } |
8439 CallOptimization::HolderLookup holder_lookup = | 8438 CallOptimization::HolderLookup holder_lookup = |
8440 CallOptimization::kHolderNotFound; | 8439 CallOptimization::kHolderNotFound; |
8441 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( | 8440 Handle<JSObject> api_holder = optimization.LookupHolderOfExpectedType( |
8442 receiver_maps->first(), &holder_lookup); | 8441 receiver_maps->first(), &holder_lookup); |
8443 if (holder_lookup == CallOptimization::kHolderNotFound) return false; | 8442 if (holder_lookup == CallOptimization::kHolderNotFound) return false; |
8444 | 8443 |
8445 if (FLAG_trace_inlining) { | 8444 if (FLAG_trace_inlining) { |
8446 PrintF("Inlining api function "); | 8445 PrintF("Inlining api function "); |
8447 function->ShortPrint(); | 8446 function->ShortPrint(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
8612 } | 8611 } |
8613 | 8612 |
8614 | 8613 |
8615 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, | 8614 HValue* HOptimizedGraphBuilder::ImplicitReceiverFor(HValue* function, |
8616 Handle<JSFunction> target) { | 8615 Handle<JSFunction> target) { |
8617 SharedFunctionInfo* shared = target->shared(); | 8616 SharedFunctionInfo* shared = target->shared(); |
8618 if (shared->strict_mode() == SLOPPY && !shared->native()) { | 8617 if (shared->strict_mode() == SLOPPY && !shared->native()) { |
8619 // Cannot embed a direct reference to the global proxy | 8618 // Cannot embed a direct reference to the global proxy |
8620 // as is it dropped on deserialization. | 8619 // as is it dropped on deserialization. |
8621 CHECK(!isolate()->serializer_enabled()); | 8620 CHECK(!isolate()->serializer_enabled()); |
8622 Handle<JSObject> global_receiver( | 8621 Handle<JSObject> global_proxy(target->context()->global_proxy()); |
8623 target->context()->global_object()->global_receiver()); | 8622 return Add<HConstant>(global_proxy); |
8624 return Add<HConstant>(global_receiver); | |
8625 } | 8623 } |
8626 return graph()->GetConstantUndefined(); | 8624 return graph()->GetConstantUndefined(); |
8627 } | 8625 } |
8628 | 8626 |
8629 | 8627 |
8630 void HOptimizedGraphBuilder::BuildArrayCall(Expression* expression, | 8628 void HOptimizedGraphBuilder::BuildArrayCall(Expression* expression, |
8631 int arguments_count, | 8629 int arguments_count, |
8632 HValue* function, | 8630 HValue* function, |
8633 Handle<AllocationSite> site) { | 8631 Handle<AllocationSite> site) { |
8634 Add<HCheckValue>(function, array_function()); | 8632 Add<HCheckValue>(function, array_function()); |
(...skipping 3729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
12364 if (ShouldProduceTraceOutput()) { | 12362 if (ShouldProduceTraceOutput()) { |
12365 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12363 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12366 } | 12364 } |
12367 | 12365 |
12368 #ifdef DEBUG | 12366 #ifdef DEBUG |
12369 graph_->Verify(false); // No full verify. | 12367 graph_->Verify(false); // No full verify. |
12370 #endif | 12368 #endif |
12371 } | 12369 } |
12372 | 12370 |
12373 } } // namespace v8::internal | 12371 } } // namespace v8::internal |
OLD | NEW |