Chromium Code Reviews| 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 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ | 5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ |
| 6 #define V8_COMPILER_LINKAGE_IMPL_H_ | 6 #define V8_COMPILER_LINKAGE_IMPL_H_ |
| 7 | 7 |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler/osr.h" | 9 #include "src/compiler/osr.h" |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 50 int spill_slot_index = i - js_parameter_count; | 50 int spill_slot_index = i - js_parameter_count; |
| 51 locations.AddParam(stackloc(spill_slot_index)); | 51 locations.AddParam(stackloc(spill_slot_index)); |
| 52 types.AddParam(kMachAnyTagged); | 52 types.AddParam(kMachAnyTagged); |
| 53 } | 53 } |
| 54 // Add context. | 54 // Add context. |
| 55 locations.AddParam(regloc(LinkageTraits::ContextReg())); | 55 locations.AddParam(regloc(LinkageTraits::ContextReg())); |
| 56 types.AddParam(kMachAnyTagged); | 56 types.AddParam(kMachAnyTagged); |
| 57 | 57 |
| 58 // The target for JS function calls is the JSFunction object. | 58 // The target for JS function calls is the JSFunction object. |
| 59 MachineType target_type = kMachAnyTagged; | 59 MachineType target_type = kMachAnyTagged; |
| 60 // Unoptimized code doesn't preserve the JSCallFunctionReg, so expect the | 60 // TODO(titzer): JSFunction is in the frame, but not currently addressable. |
|
Michael Starzinger
2015/03/25 14:27:37
nit: IIUC this TODO only applies to OSR, for non-O
titzer
2015/03/25 16:12:05
Done.
| |
| 61 // closure on the stack. | 61 LinkageLocation target_loc = regloc(LinkageTraits::JSCallFunctionReg()); |
| 62 LinkageLocation target_loc = | |
| 63 is_osr ? stackloc(Linkage::kJSFunctionCallClosureParamIndex - | |
| 64 js_parameter_count) | |
| 65 : regloc(LinkageTraits::JSCallFunctionReg()); | |
| 66 return new (zone) CallDescriptor( // -- | 62 return new (zone) CallDescriptor( // -- |
| 67 CallDescriptor::kCallJSFunction, // kind | 63 CallDescriptor::kCallJSFunction, // kind |
| 68 target_type, // target MachineType | 64 target_type, // target MachineType |
| 69 target_loc, // target location | 65 target_loc, // target location |
| 70 types.Build(), // machine_sig | 66 types.Build(), // machine_sig |
| 71 locations.Build(), // location_sig | 67 locations.Build(), // location_sig |
| 72 js_parameter_count, // js_parameter_count | 68 js_parameter_count, // js_parameter_count |
| 73 Operator::kNoProperties, // properties | 69 Operator::kNoProperties, // properties |
| 74 kNoCalleeSaved, // callee-saved | 70 kNoCalleeSaved, // callee-saved |
| 75 flags, // flags | 71 flags, // flags |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 int parameter_index = 1 + index; // skip index 0, which is the target. | 281 int parameter_index = 1 + index; // skip index 0, which is the target. |
| 286 return incoming_->GetInputLocation(parameter_index); | 282 return incoming_->GetInputLocation(parameter_index); |
| 287 } | 283 } |
| 288 } | 284 } |
| 289 | 285 |
| 290 } // namespace compiler | 286 } // namespace compiler |
| 291 } // namespace internal | 287 } // namespace internal |
| 292 } // namespace v8 | 288 } // namespace v8 |
| 293 | 289 |
| 294 #endif // V8_COMPILER_LINKAGE_IMPL_H_ | 290 #endif // V8_COMPILER_LINKAGE_IMPL_H_ |
| OLD | NEW |