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

Unified Diff: src/frames.cc

Issue 1824993002: [builtins] Add support for JS builtins written in TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/js/math.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
diff --git a/src/frames.cc b/src/frames.cc
index 67a03081e5045a826e08f55454ee9620d2c0b269..cfacbac45922f547258b75a11f179828aa4b96f3 100644
--- a/src/frames.cc
+++ b/src/frames.cc
@@ -456,6 +456,12 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
return INTERPRETED;
}
switch (code_obj->kind()) {
+ case Code::BUILTIN:
+ if (marker->IsSmi()) break;
+ // We treat frames for BUILTIN Code objects as OptimizedFrame for now
+ // (all the builtins with JavaScript linkage are actually generated
+ // with TurboFan currently, so this is sound).
+ return OPTIMIZED;
case Code::FUNCTION:
return JAVA_SCRIPT;
case Code::OPTIMIZED_FUNCTION:
@@ -981,8 +987,10 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
// Delegate to JS frame in absence of turbofan deoptimization.
// TODO(turbofan): Revisit once we support deoptimization across the board.
- if (LookupCode()->is_turbofanned() && function()->shared()->asm_function() &&
- !FLAG_turbo_asm_deoptimization) {
+ Code* code = LookupCode();
+ if (code->kind() == Code::BUILTIN ||
+ (code->is_turbofanned() && function()->shared()->asm_function() &&
+ !FLAG_turbo_asm_deoptimization)) {
return JavaScriptFrame::Summarize(frames);
}
@@ -1085,7 +1093,6 @@ void OptimizedFrame::Summarize(List<FrameSummary>* frames) {
int OptimizedFrame::LookupExceptionHandlerInTable(
int* stack_slots, HandlerTable::CatchPrediction* prediction) {
Code* code = LookupCode();
- DCHECK(code->is_optimized_code());
HandlerTable* table = HandlerTable::cast(code->handler_table());
int pc_offset = static_cast<int>(pc() - code->entry());
if (stack_slots) *stack_slots = code->stack_slots();
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | src/js/math.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698