| 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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
| 8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
| 9 #include "src/compiler/frame.h" | 9 #include "src/compiler/frame.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // Add JavaScript call argument count. | 338 // Add JavaScript call argument count. |
| 339 locations.AddParam(regloc(kJavaScriptCallArgCountRegister)); | 339 locations.AddParam(regloc(kJavaScriptCallArgCountRegister)); |
| 340 types.AddParam(MachineType::Int32()); | 340 types.AddParam(MachineType::Int32()); |
| 341 | 341 |
| 342 // Add context. | 342 // Add context. |
| 343 locations.AddParam(regloc(kContextRegister)); | 343 locations.AddParam(regloc(kContextRegister)); |
| 344 types.AddParam(MachineType::AnyTagged()); | 344 types.AddParam(MachineType::AnyTagged()); |
| 345 | 345 |
| 346 // The target for JS function calls is the JSFunction object. | 346 // The target for JS function calls is the JSFunction object. |
| 347 MachineType target_type = MachineType::AnyTagged(); | 347 MachineType target_type = MachineType::AnyTagged(); |
| 348 // TODO(titzer): When entering into an OSR function from unoptimized code, | 348 // When entering into an OSR function from unoptimized code the JSFunction |
| 349 // the JSFunction is not in a register, but it is on the stack in an | 349 // is not in a register, but it is on the stack in the marker spill slot. |
| 350 // unaddressable spill slot. We hack this in the OSR prologue. Fix. | 350 LinkageLocation target_loc = is_osr ? LinkageLocation::ForSavedCallerMarker() |
| 351 LinkageLocation target_loc = regloc(kJSFunctionRegister); | 351 : regloc(kJSFunctionRegister); |
| 352 return new (zone) CallDescriptor( // -- | 352 return new (zone) CallDescriptor( // -- |
| 353 CallDescriptor::kCallJSFunction, // kind | 353 CallDescriptor::kCallJSFunction, // kind |
| 354 target_type, // target MachineType | 354 target_type, // target MachineType |
| 355 target_loc, // target location | 355 target_loc, // target location |
| 356 types.Build(), // machine_sig | 356 types.Build(), // machine_sig |
| 357 locations.Build(), // location_sig | 357 locations.Build(), // location_sig |
| 358 js_parameter_count, // stack_parameter_count | 358 js_parameter_count, // stack_parameter_count |
| 359 Operator::kNoProperties, // properties | 359 Operator::kNoProperties, // properties |
| 360 kNoCalleeSaved, // callee-saved | 360 kNoCalleeSaved, // callee-saved |
| 361 kNoCalleeSaved, // callee-saved fp | 361 kNoCalleeSaved, // callee-saved fp |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } else { | 474 } else { |
| 475 DCHECK(loc == regloc(kContextRegister)); | 475 DCHECK(loc == regloc(kContextRegister)); |
| 476 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); | 476 return LinkageLocation::ForCalleeFrameSlot(Frame::kContextSlot); |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 | 480 |
| 481 } // namespace compiler | 481 } // namespace compiler |
| 482 } // namespace internal | 482 } // namespace internal |
| 483 } // namespace v8 | 483 } // namespace v8 |
| OLD | NEW |