| 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/code-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
| 10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 DCHECK(spill_slot < 0); // Must be a parameter. | 98 DCHECK(spill_slot < 0); // Must be a parameter. |
| 99 int register_save_area_size = frame->GetRegisterSaveAreaSize(); | 99 int register_save_area_size = frame->GetRegisterSaveAreaSize(); |
| 100 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + | 100 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + |
| 101 kPCOnStackSize + extra; | 101 kPCOnStackSize + extra; |
| 102 return FrameOffset::FromStackPointer(offset); | 102 return FrameOffset::FromStackPointer(offset); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 | 105 |
| 106 | 106 |
| 107 // static | 107 // static |
| 108 bool Linkage::NeedsFrameState(Runtime::FunctionId function) { | 108 int Linkage::FrameStateInputCount(Runtime::FunctionId function) { |
| 109 // Most runtime functions need a FrameState. A few chosen ones that we know | 109 // Most runtime functions need a FrameState. A few chosen ones that we know |
| 110 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize | 110 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize |
| 111 // are blacklisted here and can be called without a FrameState. | 111 // are blacklisted here and can be called without a FrameState. |
| 112 switch (function) { | 112 switch (function) { |
| 113 case Runtime::kAllocateInTargetSpace: | 113 case Runtime::kAllocateInTargetSpace: |
| 114 case Runtime::kDateField: | 114 case Runtime::kDateField: |
| 115 case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe? | 115 case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe? |
| 116 case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? | 116 case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe? |
| 117 case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? | 117 case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe? |
| 118 case Runtime::kForInDone: | 118 case Runtime::kForInDone: |
| 119 case Runtime::kForInStep: | 119 case Runtime::kForInStep: |
| 120 case Runtime::kNewArguments: | 120 case Runtime::kNewArguments: |
| 121 case Runtime::kNewClosure: | 121 case Runtime::kNewClosure: |
| 122 case Runtime::kNewFunctionContext: | 122 case Runtime::kNewFunctionContext: |
| 123 case Runtime::kNewRestParamSlow: | 123 case Runtime::kNewRestParamSlow: |
| 124 case Runtime::kPushBlockContext: | 124 case Runtime::kPushBlockContext: |
| 125 case Runtime::kPushCatchContext: | 125 case Runtime::kPushCatchContext: |
| 126 case Runtime::kReThrow: | 126 case Runtime::kReThrow: |
| 127 case Runtime::kStringCompareRT: | 127 case Runtime::kStringCompareRT: |
| 128 case Runtime::kStringEquals: | 128 case Runtime::kStringEquals: |
| 129 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? | 129 case Runtime::kToFastProperties: // TODO(jarin): Is it safe? |
| 130 case Runtime::kTraceEnter: | 130 case Runtime::kTraceEnter: |
| 131 case Runtime::kTraceExit: | 131 case Runtime::kTraceExit: |
| 132 return false; | 132 return 0; |
| 133 case Runtime::kInlineArguments: | 133 case Runtime::kInlineArguments: |
| 134 case Runtime::kInlineCallFunction: | 134 case Runtime::kInlineCallFunction: |
| 135 case Runtime::kInlineDeoptimizeNow: | |
| 136 case Runtime::kInlineGetCallerJSFunction: | 135 case Runtime::kInlineGetCallerJSFunction: |
| 137 case Runtime::kInlineGetPrototype: | 136 case Runtime::kInlineGetPrototype: |
| 138 case Runtime::kInlineRegExpExec: | 137 case Runtime::kInlineRegExpExec: |
| 138 return 1; |
| 139 case Runtime::kInlineDeoptimizeNow: |
| 139 case Runtime::kInlineThrowNotDateError: | 140 case Runtime::kInlineThrowNotDateError: |
| 140 return true; | 141 return 2; |
| 141 default: | 142 default: |
| 142 break; | 143 break; |
| 143 } | 144 } |
| 144 | 145 |
| 145 // Most inlined runtime functions (except the ones listed above) can be called | 146 // Most inlined runtime functions (except the ones listed above) can be called |
| 146 // without a FrameState or will be lowered by JSIntrinsicLowering internally. | 147 // without a FrameState or will be lowered by JSIntrinsicLowering internally. |
| 147 const Runtime::Function* const f = Runtime::FunctionForId(function); | 148 const Runtime::Function* const f = Runtime::FunctionForId(function); |
| 148 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false; | 149 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return 0; |
| 149 | 150 |
| 150 return true; | 151 return 1; |
| 151 } | 152 } |
| 152 | 153 |
| 153 | 154 |
| 154 bool CallDescriptor::UsesOnlyRegisters() const { | 155 bool CallDescriptor::UsesOnlyRegisters() const { |
| 155 for (size_t i = 0; i < InputCount(); ++i) { | 156 for (size_t i = 0; i < InputCount(); ++i) { |
| 156 if (!GetInputLocation(i).is_register()) return false; | 157 if (!GetInputLocation(i).is_register()) return false; |
| 157 } | 158 } |
| 158 for (size_t i = 0; i < ReturnCount(); ++i) { | 159 for (size_t i = 0; i < ReturnCount(); ++i) { |
| 159 if (!GetReturnLocation(i).is_register()) return false; | 160 if (!GetReturnLocation(i).is_register()) return false; |
| 160 } | 161 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 200 |
| 200 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | 201 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, |
| 201 const MachineSignature* sig) { | 202 const MachineSignature* sig) { |
| 202 UNIMPLEMENTED(); | 203 UNIMPLEMENTED(); |
| 203 return NULL; | 204 return NULL; |
| 204 } | 205 } |
| 205 #endif // !V8_TURBOFAN_BACKEND | 206 #endif // !V8_TURBOFAN_BACKEND |
| 206 } // namespace compiler | 207 } // namespace compiler |
| 207 } // namespace internal | 208 } // namespace internal |
| 208 } // namespace v8 | 209 } // namespace v8 |
| OLD | NEW |