| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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-call-reducer.h" | 5 #include "src/compiler/js-call-reducer.h" |
| 6 | 6 |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
| 10 #include "src/type-feedback-vector-inl.h" | 10 #include "src/type-feedback-vector-inl.h" |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 397 |
| 398 // Raise a TypeError if the {target} is not a constructor. | 398 // Raise a TypeError if the {target} is not a constructor. |
| 399 if (!function->IsConstructor()) { | 399 if (!function->IsConstructor()) { |
| 400 // Drop the lazy bailout location and use the eager bailout point for | 400 // Drop the lazy bailout location and use the eager bailout point for |
| 401 // the runtime function (actually as lazy bailout point). It doesn't | 401 // the runtime function (actually as lazy bailout point). It doesn't |
| 402 // really matter which bailout location we use since we never really | 402 // really matter which bailout location we use since we never really |
| 403 // go back after throwing the exception. | 403 // go back after throwing the exception. |
| 404 NodeProperties::RemoveFrameStateInput(node, 0); | 404 NodeProperties::RemoveFrameStateInput(node, 0); |
| 405 NodeProperties::ReplaceValueInputs(node, target); | 405 NodeProperties::ReplaceValueInputs(node, target); |
| 406 NodeProperties::ChangeOp( | 406 NodeProperties::ChangeOp( |
| 407 node, | 407 node, javascript()->CallRuntime(Runtime::kThrowCalledNonCallable)); |
| 408 javascript()->CallRuntime(Runtime::kThrowCalledNonCallable, 1)); | |
| 409 return Changed(node); | 408 return Changed(node); |
| 410 } | 409 } |
| 411 | 410 |
| 412 // Check for the ArrayConstructor. | 411 // Check for the ArrayConstructor. |
| 413 if (*function == function->native_context()->array_function()) { | 412 if (*function == function->native_context()->array_function()) { |
| 414 // Check if we have an allocation site. | 413 // Check if we have an allocation site. |
| 415 Handle<AllocationSite> site; | 414 Handle<AllocationSite> site; |
| 416 if (p.feedback().IsValid()) { | 415 if (p.feedback().IsValid()) { |
| 417 Handle<Object> feedback( | 416 Handle<Object> feedback( |
| 418 p.feedback().vector()->Get(p.feedback().slot()), isolate()); | 417 p.feedback().vector()->Get(p.feedback().slot()), isolate()); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 } | 547 } |
| 549 | 548 |
| 550 | 549 |
| 551 JSOperatorBuilder* JSCallReducer::javascript() const { | 550 JSOperatorBuilder* JSCallReducer::javascript() const { |
| 552 return jsgraph()->javascript(); | 551 return jsgraph()->javascript(); |
| 553 } | 552 } |
| 554 | 553 |
| 555 } // namespace compiler | 554 } // namespace compiler |
| 556 } // namespace internal | 555 } // namespace internal |
| 557 } // namespace v8 | 556 } // namespace v8 |
| OLD | NEW |