| 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/all-nodes.h" | 9 #include "src/compiler/all-nodes.h" |
| 10 #include "src/compiler/ast-graph-builder.h" | 10 #include "src/compiler/ast-graph-builder.h" |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 HeapObjectMatcher match(call.jsfunction()); | 242 HeapObjectMatcher match(call.jsfunction()); |
| 243 if (!match.HasValue()) return NoChange(); | 243 if (!match.HasValue()) return NoChange(); |
| 244 | 244 |
| 245 if (!match.Value().handle()->IsJSFunction()) return NoChange(); | 245 if (!match.Value().handle()->IsJSFunction()) return NoChange(); |
| 246 Handle<JSFunction> function = | 246 Handle<JSFunction> function = |
| 247 Handle<JSFunction>::cast(match.Value().handle()); | 247 Handle<JSFunction>::cast(match.Value().handle()); |
| 248 if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) { | 248 if (mode_ == kRestrictedInlining && !function->shared()->force_inline()) { |
| 249 return NoChange(); | 249 return NoChange(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 if (function->shared()->HasDebugInfo()) { |
| 253 // Function contains break points. |
| 254 TRACE("Not inlining %s into %s because callee may contain break points\n", |
| 255 function->shared()->DebugName()->ToCString().get(), |
| 256 info_->shared_info()->DebugName()->ToCString().get()); |
| 257 return NoChange(); |
| 258 } |
| 259 |
| 252 // Disallow cross native-context inlining for now. This means that all parts | 260 // Disallow cross native-context inlining for now. This means that all parts |
| 253 // of the resulting code will operate on the same global object. | 261 // of the resulting code will operate on the same global object. |
| 254 // This also prevents cross context leaks for asm.js code, where we could | 262 // This also prevents cross context leaks for asm.js code, where we could |
| 255 // inline functions from a different context and hold on to that context (and | 263 // inline functions from a different context and hold on to that context (and |
| 256 // closure) from the code object. | 264 // closure) from the code object. |
| 257 // TODO(turbofan): We might want to revisit this restriction later when we | 265 // TODO(turbofan): We might want to revisit this restriction later when we |
| 258 // have a need for this, and we know how to model different native contexts | 266 // have a need for this, and we know how to model different native contexts |
| 259 // in the same graph in a compositional way. | 267 // in the same graph in a compositional way. |
| 260 if (function->context()->native_context() != | 268 if (function->context()->native_context() != |
| 261 info_->context()->native_context()) { | 269 info_->context()->native_context()) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 344 |
| 337 // Remember that we inlined this function. | 345 // Remember that we inlined this function. |
| 338 info_->AddInlinedFunction(info.shared_info()); | 346 info_->AddInlinedFunction(info.shared_info()); |
| 339 | 347 |
| 340 return InlineCall(node, context, frame_state, start, end); | 348 return InlineCall(node, context, frame_state, start, end); |
| 341 } | 349 } |
| 342 | 350 |
| 343 } // namespace compiler | 351 } // namespace compiler |
| 344 } // namespace internal | 352 } // namespace internal |
| 345 } // namespace v8 | 353 } // namespace v8 |
| OLD | NEW |