| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 | 322 |
| 323 Reduction JSInliner::Reduce(Node* node) { | 323 Reduction JSInliner::Reduce(Node* node) { |
| 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 if (!function->IsJSFunction()) return NoChange(); |
| 332 if (mode_ == kBuiltinsInlining && !function->shared()->inline_builtin()) { |
| 333 return NoChange(); |
| 334 } |
| 331 | 335 |
| 332 CompilationInfoWithZone info(function); | 336 CompilationInfoWithZone info(function); |
| 333 | 337 |
| 334 if (!Compiler::ParseAndAnalyze(&info)) return NoChange(); | 338 if (!Compiler::ParseAndAnalyze(&info)) return NoChange(); |
| 335 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); | 339 if (!Compiler::EnsureDeoptimizationSupport(&info)) return NoChange(); |
| 336 | 340 |
| 337 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { | 341 if (info.scope()->arguments() != NULL && is_sloppy(info.language_mode())) { |
| 338 // For now do not inline functions that use their arguments array. | 342 // For now do not inline functions that use their arguments array. |
| 339 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); | 343 SmartArrayPointer<char> name = function->shared()->DebugName()->ToCString(); |
| 340 if (FLAG_trace_turbo_inlining) { | 344 if (FLAG_trace_turbo_inlining) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 } | 384 } |
| 381 } | 385 } |
| 382 } | 386 } |
| 383 | 387 |
| 384 return inlinee.InlineAtCall(jsgraph_, node); | 388 return inlinee.InlineAtCall(jsgraph_, node); |
| 385 } | 389 } |
| 386 | 390 |
| 387 } // namespace compiler | 391 } // namespace compiler |
| 388 } // namespace internal | 392 } // namespace internal |
| 389 } // namespace v8 | 393 } // namespace v8 |
| OLD | NEW |