| 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/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #include "src/allocation-site-scopes.h" | 9 #include "src/allocation-site-scopes.h" |
| 10 #include "src/ast-numbering.h" | 10 #include "src/ast-numbering.h" |
| (...skipping 9831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9842 | 9842 |
| 9843 int args_to_drop = argument_count + (expression->IsCall() ? 2 : 1); | 9843 int args_to_drop = argument_count + (expression->IsCall() ? 2 : 1); |
| 9844 Drop(args_to_drop); | 9844 Drop(args_to_drop); |
| 9845 ast_context()->ReturnValue(new_object); | 9845 ast_context()->ReturnValue(new_object); |
| 9846 } | 9846 } |
| 9847 | 9847 |
| 9848 | 9848 |
| 9849 // Checks whether allocation using the given constructor can be inlined. | 9849 // Checks whether allocation using the given constructor can be inlined. |
| 9850 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { | 9850 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { |
| 9851 return constructor->has_initial_map() && | 9851 return constructor->has_initial_map() && |
| 9852 !IsClassConstructor(constructor->shared()->kind()) && |
| 9852 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && | 9853 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && |
| 9853 constructor->initial_map()->instance_size() < | 9854 constructor->initial_map()->instance_size() < |
| 9854 HAllocate::kMaxInlineSize; | 9855 HAllocate::kMaxInlineSize; |
| 9855 } | 9856 } |
| 9856 | 9857 |
| 9857 | 9858 |
| 9858 bool HOptimizedGraphBuilder::IsCallArrayInlineable( | 9859 bool HOptimizedGraphBuilder::IsCallArrayInlineable( |
| 9859 int argument_count, | 9860 int argument_count, |
| 9860 Handle<AllocationSite> site) { | 9861 Handle<AllocationSite> site) { |
| 9861 Handle<JSFunction> caller = current_info()->closure(); | 9862 Handle<JSFunction> caller = current_info()->closure(); |
| (...skipping 3838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13700 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13701 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13701 } | 13702 } |
| 13702 | 13703 |
| 13703 #ifdef DEBUG | 13704 #ifdef DEBUG |
| 13704 graph_->Verify(false); // No full verify. | 13705 graph_->Verify(false); // No full verify. |
| 13705 #endif | 13706 #endif |
| 13706 } | 13707 } |
| 13707 | 13708 |
| 13708 } // namespace internal | 13709 } // namespace internal |
| 13709 } // namespace v8 | 13710 } // namespace v8 |
| OLD | NEW |