| 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 if (node->opcode() != IrOpcode::kJSCallFunction) return NoChange(); | 324 if (node->opcode() != IrOpcode::kJSCallFunction) return NoChange(); |
| 325 | 325 |
| 326 JSCallFunctionAccessor call(node); | 326 JSCallFunctionAccessor call(node); |
| 327 HeapObjectMatcher<JSFunction> match(call.jsfunction()); | 327 HeapObjectMatcher<JSFunction> match(call.jsfunction()); |
| 328 if (!match.HasValue()) return NoChange(); | 328 if (!match.HasValue()) return NoChange(); |
| 329 | 329 |
| 330 Handle<JSFunction> function = match.Value().handle(); | 330 Handle<JSFunction> function = match.Value().handle(); |
| 331 | 331 |
| 332 CompilationInfoWithZone info(function); | 332 CompilationInfoWithZone info(function); |
| 333 | 333 |
| 334 if (!Compiler::ParseAndAnalyze(&info)) return NoChange(); | 334 if (!Compiler::ParseAndAnalyze(info.parse_info())) return NoChange(); |
| 335 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); | 335 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); |
| 336 | 336 |
| 337 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { | 337 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { |
| 338 // For now do not inline functions that use their arguments array. | 338 // For now do not inline functions that use their arguments array. |
| 339 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); | 339 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); |
| 340 if (FLAG_trace_turbo_inlining) { | 340 if (FLAG_trace_turbo_inlining) { |
| 341 PrintF( | 341 PrintF( |
| 342 "Not Inlining %s into %s because inlinee uses arguments " | 342 "Not Inlining %s into %s because inlinee uses arguments " |
| 343 "array\n", | 343 "array\n", |
| 344 name.get(), info_->shared_info()->DebugName()->ToCString().get()); | 344 name.get(), info_->shared_info()->DebugName()->ToCString().get()); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 } | 382 } |
| 383 | 383 |
| 384 return inlinee.InlineAtCall(jsgraph_, node); | 384 return inlinee.InlineAtCall(jsgraph_, node); |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace compiler | 387 } // namespace compiler |
| 388 } // namespace internal | 388 } // namespace internal |
| 389 } // namespace v8 | 389 } // namespace v8 |
| OLD | NEW |