| 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 9908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9919 if (function->IsConstant() && | 9919 if (function->IsConstant() && |
| 9920 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { | 9920 HConstant::cast(function)->handle(isolate())->IsJSFunction()) { |
| 9921 Handle<Object> constant = HConstant::cast(function)->handle(isolate()); | 9921 Handle<Object> constant = HConstant::cast(function)->handle(isolate()); |
| 9922 expr->SetKnownGlobalTarget(Handle<JSFunction>::cast(constant)); | 9922 expr->SetKnownGlobalTarget(Handle<JSFunction>::cast(constant)); |
| 9923 } | 9923 } |
| 9924 | 9924 |
| 9925 if (FLAG_inline_construct && | 9925 if (FLAG_inline_construct && |
| 9926 expr->IsMonomorphic() && | 9926 expr->IsMonomorphic() && |
| 9927 IsAllocationInlineable(expr->target())) { | 9927 IsAllocationInlineable(expr->target())) { |
| 9928 Handle<JSFunction> constructor = expr->target(); | 9928 Handle<JSFunction> constructor = expr->target(); |
| 9929 DCHECK( |
| 9930 constructor->shared()->construct_stub() == |
| 9931 isolate()->builtins()->builtin(Builtins::kJSConstructStubGeneric) || |
| 9932 constructor->shared()->construct_stub() == |
| 9933 isolate()->builtins()->builtin(Builtins::kJSConstructStubApi)); |
| 9929 HValue* check = Add<HCheckValue>(function, constructor); | 9934 HValue* check = Add<HCheckValue>(function, constructor); |
| 9930 | 9935 |
| 9931 // Force completion of inobject slack tracking before generating | 9936 // Force completion of inobject slack tracking before generating |
| 9932 // allocation code to finalize instance size. | 9937 // allocation code to finalize instance size. |
| 9933 if (constructor->IsInobjectSlackTrackingInProgress()) { | 9938 if (constructor->IsInobjectSlackTrackingInProgress()) { |
| 9934 constructor->CompleteInobjectSlackTracking(); | 9939 constructor->CompleteInobjectSlackTracking(); |
| 9935 } | 9940 } |
| 9936 | 9941 |
| 9937 // Calculate instance size from initial map of constructor. | 9942 // Calculate instance size from initial map of constructor. |
| 9938 DCHECK(constructor->has_initial_map()); | 9943 DCHECK(constructor->has_initial_map()); |
| (...skipping 3691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13630 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13635 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 13631 } | 13636 } |
| 13632 | 13637 |
| 13633 #ifdef DEBUG | 13638 #ifdef DEBUG |
| 13634 graph_->Verify(false); // No full verify. | 13639 graph_->Verify(false); // No full verify. |
| 13635 #endif | 13640 #endif |
| 13636 } | 13641 } |
| 13637 | 13642 |
| 13638 } // namespace internal | 13643 } // namespace internal |
| 13639 } // namespace v8 | 13644 } // namespace v8 |
| OLD | NEW |