| 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.h" | 9 #include "src/compiler.h" |
| 10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 Handle<SharedFunctionInfo> shared_info; | 303 Handle<SharedFunctionInfo> shared_info; |
| 304 if (info.shared_info().ToHandle(&shared_info) && | 304 if (info.shared_info().ToHandle(&shared_info) && |
| 305 *shared_info == function->shared()) { | 305 *shared_info == function->shared()) { |
| 306 TRACE("Not inlining %s into %s because call is recursive\n", | 306 TRACE("Not inlining %s into %s because call is recursive\n", |
| 307 function->shared()->DebugName()->ToCString().get(), | 307 function->shared()->DebugName()->ToCString().get(), |
| 308 info_->shared_info()->DebugName()->ToCString().get()); | 308 info_->shared_info()->DebugName()->ToCString().get()); |
| 309 return NoChange(); | 309 return NoChange(); |
| 310 } | 310 } |
| 311 } | 311 } |
| 312 | 312 |
| 313 // TODO(turbofan): Inlining into a try-block is not yet supported. |
| 314 if (NodeProperties::IsExceptionalCall(node)) { |
| 315 TRACE("Not inlining %s into %s because of surrounding try-block\n", |
| 316 function->shared()->DebugName()->ToCString().get(), |
| 317 info_->shared_info()->DebugName()->ToCString().get()); |
| 318 return NoChange(); |
| 319 } |
| 320 |
| 313 Zone zone; | 321 Zone zone; |
| 314 ParseInfo parse_info(&zone, function); | 322 ParseInfo parse_info(&zone, function); |
| 315 CompilationInfo info(&parse_info); | 323 CompilationInfo info(&parse_info); |
| 316 if (info_->is_deoptimization_enabled()) { | 324 if (info_->is_deoptimization_enabled()) { |
| 317 info.MarkAsDeoptimizationEnabled(); | 325 info.MarkAsDeoptimizationEnabled(); |
| 318 } | 326 } |
| 319 if (info_->is_native_context_specializing()) { | 327 if (info_->is_native_context_specializing()) { |
| 320 info.MarkAsNativeContextSpecializing(); | 328 info.MarkAsNativeContextSpecializing(); |
| 321 } | 329 } |
| 322 if (info_->is_typing_enabled()) { | 330 if (info_->is_typing_enabled()) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 410 |
| 403 // Remember that we inlined this function. | 411 // Remember that we inlined this function. |
| 404 info_->AddInlinedFunction(info.shared_info()); | 412 info_->AddInlinedFunction(info.shared_info()); |
| 405 | 413 |
| 406 return InlineCall(node, context, frame_state, start, end); | 414 return InlineCall(node, context, frame_state, start, end); |
| 407 } | 415 } |
| 408 | 416 |
| 409 } // namespace compiler | 417 } // namespace compiler |
| 410 } // namespace internal | 418 } // namespace internal |
| 411 } // namespace v8 | 419 } // namespace v8 |
| OLD | NEW |