| 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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } else if (m.Value()->IsJSBoundFunction()) { | 265 } else if (m.Value()->IsJSBoundFunction()) { |
| 266 Handle<JSBoundFunction> function = | 266 Handle<JSBoundFunction> function = |
| 267 Handle<JSBoundFunction>::cast(m.Value()); | 267 Handle<JSBoundFunction>::cast(m.Value()); |
| 268 Handle<JSReceiver> bound_target_function( | 268 Handle<JSReceiver> bound_target_function( |
| 269 function->bound_target_function(), isolate()); | 269 function->bound_target_function(), isolate()); |
| 270 Handle<Object> bound_this(function->bound_this(), isolate()); | 270 Handle<Object> bound_this(function->bound_this(), isolate()); |
| 271 Handle<FixedArray> bound_arguments(function->bound_arguments(), | 271 Handle<FixedArray> bound_arguments(function->bound_arguments(), |
| 272 isolate()); | 272 isolate()); |
| 273 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); | 273 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); |
| 274 ConvertReceiverMode const convert_mode = | 274 ConvertReceiverMode const convert_mode = |
| 275 (bound_this->IsNull() || bound_this->IsUndefined()) | 275 (bound_this->IsNull() || bound_this->IsUndefined(isolate())) |
| 276 ? ConvertReceiverMode::kNullOrUndefined | 276 ? ConvertReceiverMode::kNullOrUndefined |
| 277 : ConvertReceiverMode::kNotNullOrUndefined; | 277 : ConvertReceiverMode::kNotNullOrUndefined; |
| 278 size_t arity = p.arity(); | 278 size_t arity = p.arity(); |
| 279 DCHECK_LE(2u, arity); | 279 DCHECK_LE(2u, arity); |
| 280 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]]. | 280 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]]. |
| 281 NodeProperties::ReplaceValueInput( | 281 NodeProperties::ReplaceValueInput( |
| 282 node, jsgraph()->Constant(bound_target_function), 0); | 282 node, jsgraph()->Constant(bound_target_function), 0); |
| 283 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this), | 283 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this), |
| 284 1); | 284 1); |
| 285 // Insert the [[BoundArguments]] for {node}. | 285 // Insert the [[BoundArguments]] for {node}. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 } | 516 } |
| 517 | 517 |
| 518 | 518 |
| 519 JSOperatorBuilder* JSCallReducer::javascript() const { | 519 JSOperatorBuilder* JSCallReducer::javascript() const { |
| 520 return jsgraph()->javascript(); | 520 return jsgraph()->javascript(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } // namespace compiler | 523 } // namespace compiler |
| 524 } // namespace internal | 524 } // namespace internal |
| 525 } // namespace v8 | 525 } // namespace v8 |
| OLD | NEW |