| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/js-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
| 6 | 6 |
| 7 #include "src/ast.h" | 7 #include "src/ast.h" |
| 8 #include "src/ast-numbering.h" | 8 #include "src/ast-numbering.h" |
| 9 #include "src/compiler/access-builder.h" | 9 #include "src/compiler/access-builder.h" |
| 10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 if (!match.HasValue()) return NoChange(); | 329 if (!match.HasValue()) return NoChange(); |
| 330 | 330 |
| 331 Handle<JSFunction> function = match.Value().handle(); | 331 Handle<JSFunction> function = match.Value().handle(); |
| 332 if (!function->IsJSFunction()) return NoChange(); | 332 if (!function->IsJSFunction()) return NoChange(); |
| 333 if (mode_ == kBuiltinsInlining && !function->shared()->inline_builtin()) { | 333 if (mode_ == kBuiltinsInlining && !function->shared()->inline_builtin()) { |
| 334 return NoChange(); | 334 return NoChange(); |
| 335 } | 335 } |
| 336 | 336 |
| 337 CompilationInfoWithZone info(function); | 337 CompilationInfoWithZone info(function); |
| 338 | 338 |
| 339 if (!Compiler::ParseAndAnalyze(&info)) return NoChange(); | 339 if (!Compiler::ParseAndAnalyze(info.parse_info())) return NoChange(); |
| 340 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); | 340 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); |
| 341 | 341 |
| 342 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { | 342 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { |
| 343 // For now do not inline functions that use their arguments array. | 343 // For now do not inline functions that use their arguments array. |
| 344 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); | 344 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); |
| 345 if (FLAG_trace_turbo_inlining) { | 345 if (FLAG_trace_turbo_inlining) { |
| 346 PrintF( | 346 PrintF( |
| 347 "Not Inlining %s into %s because inlinee uses arguments " | 347 "Not Inlining %s into %s because inlinee uses arguments " |
| 348 "array\n", | 348 "array\n", |
| 349 name.get(), info_->shared_info()->DebugName()->ToCString().get()); | 349 name.get(), info_->shared_info()->DebugName()->ToCString().get()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 return inlinee.InlineAtCall(jsgraph_, node); | 390 return inlinee.InlineAtCall(jsgraph_, node); |
| 391 } | 391 } |
| 392 | 392 |
| 393 } // namespace compiler | 393 } // namespace compiler |
| 394 } // namespace internal | 394 } // namespace internal |
| 395 } // namespace v8 | 395 } // namespace v8 |
| OLD | NEW |