| 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 <memory> | 7 #include <memory> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 | 9 |
| 10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
| (...skipping 3928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3939 | 3939 |
| 3940 void HOptimizedGraphBuilder::VisitExpressions(ZoneList<Expression*>* exprs, | 3940 void HOptimizedGraphBuilder::VisitExpressions(ZoneList<Expression*>* exprs, |
| 3941 ArgumentsAllowedFlag flag) { | 3941 ArgumentsAllowedFlag flag) { |
| 3942 for (int i = 0; i < exprs->length(); ++i) { | 3942 for (int i = 0; i < exprs->length(); ++i) { |
| 3943 CHECK_ALIVE(VisitForValue(exprs->at(i), flag)); | 3943 CHECK_ALIVE(VisitForValue(exprs->at(i), flag)); |
| 3944 } | 3944 } |
| 3945 } | 3945 } |
| 3946 | 3946 |
| 3947 | 3947 |
| 3948 bool HOptimizedGraphBuilder::BuildGraph() { | 3948 bool HOptimizedGraphBuilder::BuildGraph() { |
| 3949 if (IsSubclassConstructor(current_info()->literal()->kind())) { | 3949 if (IsDerivedConstructor(current_info()->literal()->kind())) { |
| 3950 Bailout(kSuperReference); | 3950 Bailout(kSuperReference); |
| 3951 return false; | 3951 return false; |
| 3952 } | 3952 } |
| 3953 | 3953 |
| 3954 DeclarationScope* scope = current_info()->scope(); | 3954 DeclarationScope* scope = current_info()->scope(); |
| 3955 SetUpScope(scope); | 3955 SetUpScope(scope); |
| 3956 | 3956 |
| 3957 // Add an edge to the body entry. This is warty: the graph's start | 3957 // Add an edge to the body entry. This is warty: the graph's start |
| 3958 // environment will be used by the Lithium translation as the initial | 3958 // environment will be used by the Lithium translation as the initial |
| 3959 // environment on graph entry, but it has now been mutated by the | 3959 // environment on graph entry, but it has now been mutated by the |
| (...skipping 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9664 int args_to_drop = argument_count + (expression->IsCall() ? 2 : 1); | 9664 int args_to_drop = argument_count + (expression->IsCall() ? 2 : 1); |
| 9665 Drop(args_to_drop); | 9665 Drop(args_to_drop); |
| 9666 ast_context()->ReturnValue(new_object); | 9666 ast_context()->ReturnValue(new_object); |
| 9667 return true; | 9667 return true; |
| 9668 } | 9668 } |
| 9669 | 9669 |
| 9670 | 9670 |
| 9671 // Checks whether allocation using the given constructor can be inlined. | 9671 // Checks whether allocation using the given constructor can be inlined. |
| 9672 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { | 9672 static bool IsAllocationInlineable(Handle<JSFunction> constructor) { |
| 9673 return constructor->has_initial_map() && | 9673 return constructor->has_initial_map() && |
| 9674 !IsSubclassConstructor(constructor->shared()->kind()) && | 9674 !IsDerivedConstructor(constructor->shared()->kind()) && |
| 9675 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && | 9675 constructor->initial_map()->instance_type() == JS_OBJECT_TYPE && |
| 9676 constructor->initial_map()->instance_size() < | 9676 constructor->initial_map()->instance_size() < |
| 9677 HAllocate::kMaxInlineSize; | 9677 HAllocate::kMaxInlineSize; |
| 9678 } | 9678 } |
| 9679 | 9679 |
| 9680 void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) { | 9680 void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) { |
| 9681 DCHECK(!HasStackOverflow()); | 9681 DCHECK(!HasStackOverflow()); |
| 9682 DCHECK(current_block() != NULL); | 9682 DCHECK(current_block() != NULL); |
| 9683 DCHECK(current_block()->HasPredecessor()); | 9683 DCHECK(current_block()->HasPredecessor()); |
| 9684 if (!is_tracking_positions()) SetSourcePosition(expr->position()); | 9684 if (!is_tracking_positions()) SetSourcePosition(expr->position()); |
| (...skipping 3312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12997 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12997 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 12998 } | 12998 } |
| 12999 | 12999 |
| 13000 #ifdef DEBUG | 13000 #ifdef DEBUG |
| 13001 graph_->Verify(false); // No full verify. | 13001 graph_->Verify(false); // No full verify. |
| 13002 #endif | 13002 #endif |
| 13003 } | 13003 } |
| 13004 | 13004 |
| 13005 } // namespace internal | 13005 } // namespace internal |
| 13006 } // namespace v8 | 13006 } // namespace v8 |
| OLD | NEW |