Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: src/compiler/linkage.cc

Issue 878743006: Make the Linkage::NeedsFrameState list more intuitive. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix for OSR. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 return GetStubCallDescriptor(isolate_, zone_, descriptor, 113 return GetStubCallDescriptor(isolate_, zone_, descriptor,
114 stack_parameter_count, flags, properties); 114 stack_parameter_count, flags, properties);
115 } 115 }
116 116
117 117
118 // static 118 // static
119 bool Linkage::NeedsFrameState(Runtime::FunctionId function) { 119 bool Linkage::NeedsFrameState(Runtime::FunctionId function) {
120 if (!FLAG_turbo_deoptimization) { 120 if (!FLAG_turbo_deoptimization) {
121 return false; 121 return false;
122 } 122 }
123 // TODO(jarin) At the moment, we only add frame state for 123
124 // few chosen runtime functions. 124 // Most runtime functions need a FrameState. A few chosen ones that we know
125 // not to call into arbitrary JavaScript, not to throw, and not to deoptimize
126 // are blacklisted here and can be called without a FrameState.
125 switch (function) { 127 switch (function) {
126 case Runtime::kApply: 128 case Runtime::kBooleanize:
127 case Runtime::kArrayBufferNeuter: 129 case Runtime::kDeclareGlobals: // TODO(jarin): Is it safe?
128 case Runtime::kArrayConcat: 130 case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe?
129 case Runtime::kBasicJSONStringify: 131 case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
130 case Runtime::kCheckExecutionState: 132 case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
131 case Runtime::kCollectStackTrace: 133 case Runtime::kForInCacheArrayLength:
132 case Runtime::kCompileLazy: 134 case Runtime::kForInInit:
133 case Runtime::kCompileOptimized: 135 case Runtime::kForInNext:
134 case Runtime::kCompileString: 136 case Runtime::kNewArguments:
135 case Runtime::kCreateArrayLiteral: 137 case Runtime::kNewClosure:
136 case Runtime::kCreateObjectLiteral: 138 case Runtime::kNewFunctionContext:
137 case Runtime::kDebugBreak: 139 case Runtime::kPushBlockContext:
138 case Runtime::kDataViewSetInt8: 140 case Runtime::kPushCatchContext:
139 case Runtime::kDataViewSetUint8: 141 case Runtime::kReThrow:
140 case Runtime::kDataViewSetInt16: 142 case Runtime::kSetProperty: // TODO(jarin): Is it safe?
141 case Runtime::kDataViewSetUint16: 143 case Runtime::kStringCompare:
142 case Runtime::kDataViewSetInt32: 144 case Runtime::kStringEquals:
143 case Runtime::kDataViewSetUint32: 145 case Runtime::kToFastProperties: // TODO(jarin): Is it safe?
144 case Runtime::kDataViewSetFloat32: 146 case Runtime::kTraceEnter:
145 case Runtime::kDataViewSetFloat64: 147 case Runtime::kTraceExit:
146 case Runtime::kDataViewGetInt8: 148 case Runtime::kTypeof:
147 case Runtime::kDataViewGetUint8: 149 return false;
148 case Runtime::kDataViewGetInt16:
149 case Runtime::kDataViewGetUint16:
150 case Runtime::kDataViewGetInt32:
151 case Runtime::kDataViewGetUint32:
152 case Runtime::kDataViewGetFloat32:
153 case Runtime::kDataViewGetFloat64:
154 case Runtime::kDebugEvaluate:
155 case Runtime::kDebugEvaluateGlobal:
156 case Runtime::kDebugGetLoadedScripts:
157 case Runtime::kDebugGetPropertyDetails:
158 case Runtime::kDebugPromiseEvent:
159 case Runtime::kDefaultConstructorSuperCall:
160 case Runtime::kDefineAccessorPropertyUnchecked:
161 case Runtime::kDefineClass:
162 case Runtime::kDefineDataPropertyUnchecked:
163 case Runtime::kDeleteProperty:
164 case Runtime::kDeliverObservationChangeRecords:
165 case Runtime::kDeoptimizeFunction:
166 case Runtime::kFunctionBindArguments:
167 case Runtime::kGetDefaultReceiver:
168 case Runtime::kGetFrameCount:
169 case Runtime::kGetOwnProperty:
170 case Runtime::kGetOwnPropertyNames:
171 case Runtime::kGetPropertyNamesFast:
172 case Runtime::kGetPrototype:
173 case Runtime::kInlineArguments: 150 case Runtime::kInlineArguments:
174 case Runtime::kInlineCallFunction: 151 case Runtime::kInlineCallFunction:
175 case Runtime::kInlineDateField: 152 case Runtime::kInlineDateField:
176 case Runtime::kInlineOptimizedGetPrototype: 153 case Runtime::kInlineOptimizedGetPrototype:
177 case Runtime::kInlineRegExpExec: 154 case Runtime::kInlineRegExpExec:
178 case Runtime::kInternalSetPrototype:
179 case Runtime::kInterrupt:
180 case Runtime::kIsPropertyEnumerable:
181 case Runtime::kIsSloppyModeFunction:
182 case Runtime::kLiveEditGatherCompileInfo:
183 case Runtime::kLoadLookupSlot:
184 case Runtime::kLoadLookupSlotNoReferenceError:
185 case Runtime::kMaterializeRegExpLiteral:
186 case Runtime::kNewObject:
187 case Runtime::kNewObjectFromBound:
188 case Runtime::kNewObjectWithAllocationSite:
189 case Runtime::kObjectFreeze:
190 case Runtime::kObjectSeal:
191 case Runtime::kOwnKeys:
192 case Runtime::kParseJson:
193 case Runtime::kPrepareStep:
194 case Runtime::kPreventExtensions:
195 case Runtime::kPromiseRejectEvent:
196 case Runtime::kPromiseRevokeReject:
197 case Runtime::kPushWithContext:
198 case Runtime::kRegExpInitializeAndCompile:
199 case Runtime::kRegExpExecMultiple:
200 case Runtime::kResolvePossiblyDirectEval:
201 case Runtime::kRunMicrotasks:
202 case Runtime::kSetPrototype:
203 case Runtime::kSetScriptBreakPoint:
204 case Runtime::kSparseJoinWithSeparator:
205 case Runtime::kStackGuard:
206 case Runtime::kStoreKeyedToSuper_Sloppy:
207 case Runtime::kStoreKeyedToSuper_Strict:
208 case Runtime::kStoreToSuper_Sloppy:
209 case Runtime::kStoreToSuper_Strict:
210 case Runtime::kStoreLookupSlot:
211 case Runtime::kStringBuilderConcat:
212 case Runtime::kStringBuilderJoin:
213 case Runtime::kStringMatch:
214 case Runtime::kStringReplaceGlobalRegExpWithString:
215 case Runtime::kThrowConstAssignError:
216 case Runtime::kThrowConstructorNonCallableError:
217 case Runtime::kThrowNonMethodError:
218 case Runtime::kThrowNotDateError:
219 case Runtime::kThrowReferenceError:
220 case Runtime::kThrowUnsupportedSuperError:
221 case Runtime::kThrow:
222 case Runtime::kTypedArraySetFastCases:
223 case Runtime::kTypedArrayInitializeFromArrayLike:
224 #ifdef V8_I18N_SUPPORT
225 case Runtime::kGetImplFromInitializedIntlObject:
226 #endif
227 return true; 155 return true;
228 default: 156 default:
229 return false; 157 break;
230 } 158 }
159
160 // Most inlined runtime functions (except the ones listed above) can be called
161 // without a FrameState or will be lowered by JSIntrinsicLowering internally.
162 const Runtime::Function* const f = Runtime::FunctionForId(function);
163 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false;
164
165 return true;
231 } 166 }
232 167
233 168
234 //============================================================================== 169 //==============================================================================
235 // Provide unimplemented methods on unsupported architectures, to at least link. 170 // Provide unimplemented methods on unsupported architectures, to at least link.
236 //============================================================================== 171 //==============================================================================
237 #if !V8_TURBOFAN_BACKEND 172 #if !V8_TURBOFAN_BACKEND
238 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, 173 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
239 int parameter_count, 174 int parameter_count,
240 CallDescriptor::Flags flags) { 175 CallDescriptor::Flags flags) {
(...skipping 27 matching lines...) Expand all
268 203
269 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, 204 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
270 MachineSignature* sig) { 205 MachineSignature* sig) {
271 UNIMPLEMENTED(); 206 UNIMPLEMENTED();
272 return NULL; 207 return NULL;
273 } 208 }
274 #endif // !V8_TURBOFAN_BACKEND 209 #endif // !V8_TURBOFAN_BACKEND
275 } 210 }
276 } 211 }
277 } // namespace v8::internal::compiler 212 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698