| 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } else if (m.Value()->IsJSBoundFunction()) { | 262 } else if (m.Value()->IsJSBoundFunction()) { |
| 263 Handle<JSBoundFunction> function = | 263 Handle<JSBoundFunction> function = |
| 264 Handle<JSBoundFunction>::cast(m.Value()); | 264 Handle<JSBoundFunction>::cast(m.Value()); |
| 265 Handle<JSReceiver> bound_target_function( | 265 Handle<JSReceiver> bound_target_function( |
| 266 function->bound_target_function(), isolate()); | 266 function->bound_target_function(), isolate()); |
| 267 Handle<Object> bound_this(function->bound_this(), isolate()); | 267 Handle<Object> bound_this(function->bound_this(), isolate()); |
| 268 Handle<FixedArray> bound_arguments(function->bound_arguments(), | 268 Handle<FixedArray> bound_arguments(function->bound_arguments(), |
| 269 isolate()); | 269 isolate()); |
| 270 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); | 270 CallFunctionParameters const& p = CallFunctionParametersOf(node->op()); |
| 271 ConvertReceiverMode const convert_mode = | 271 ConvertReceiverMode const convert_mode = |
| 272 (bound_this->IsNull() || bound_this->IsUndefined()) | 272 (bound_this->IsNull() || bound_this->IsUndefined(isolate())) |
| 273 ? ConvertReceiverMode::kNullOrUndefined | 273 ? ConvertReceiverMode::kNullOrUndefined |
| 274 : ConvertReceiverMode::kNotNullOrUndefined; | 274 : ConvertReceiverMode::kNotNullOrUndefined; |
| 275 size_t arity = p.arity(); | 275 size_t arity = p.arity(); |
| 276 DCHECK_LE(2u, arity); | 276 DCHECK_LE(2u, arity); |
| 277 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]]. | 277 // Patch {node} to use [[BoundTargetFunction]] and [[BoundThis]]. |
| 278 NodeProperties::ReplaceValueInput( | 278 NodeProperties::ReplaceValueInput( |
| 279 node, jsgraph()->Constant(bound_target_function), 0); | 279 node, jsgraph()->Constant(bound_target_function), 0); |
| 280 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this), | 280 NodeProperties::ReplaceValueInput(node, jsgraph()->Constant(bound_this), |
| 281 1); | 281 1); |
| 282 // Insert the [[BoundArguments]] for {node}. | 282 // Insert the [[BoundArguments]] for {node}. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 } | 506 } |
| 507 | 507 |
| 508 | 508 |
| 509 JSOperatorBuilder* JSCallReducer::javascript() const { | 509 JSOperatorBuilder* JSCallReducer::javascript() const { |
| 510 return jsgraph()->javascript(); | 510 return jsgraph()->javascript(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 } // namespace compiler | 513 } // namespace compiler |
| 514 } // namespace internal | 514 } // namespace internal |
| 515 } // namespace v8 | 515 } // namespace v8 |
| OLD | NEW |