From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/JavaScriptCore/ftl/FTLOSRExit.h | 206 +++++++++++++-------------------- 1 file changed, 83 insertions(+), 123 deletions(-) (limited to 'Source/JavaScriptCore/ftl/FTLOSRExit.h') diff --git a/Source/JavaScriptCore/ftl/FTLOSRExit.h b/Source/JavaScriptCore/ftl/FTLOSRExit.h index 4e479ebdd..d17909b0a 100644 --- a/Source/JavaScriptCore/ftl/FTLOSRExit.h +++ b/Source/JavaScriptCore/ftl/FTLOSRExit.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013-2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,154 +23,114 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef FTLOSRExit_h -#define FTLOSRExit_h - -#include +#pragma once #if ENABLE(FTL_JIT) +#include "B3ValueRep.h" #include "CodeOrigin.h" #include "DFGExitProfile.h" +#include "DFGNodeOrigin.h" #include "DFGOSRExitBase.h" -#include "FTLAbbreviations.h" -#include "FTLExitArgumentList.h" +#include "FTLAbbreviatedTypes.h" +#include "FTLExitTimeObjectMaterialization.h" #include "FTLExitValue.h" #include "FTLFormattedValue.h" +#include "FTLOSRExitHandle.h" +#include "FTLStackmapArgumentList.h" +#include "HandlerInfo.h" #include "MethodOfGettingAValueProfile.h" #include "Operands.h" +#include "Reg.h" #include "ValueProfile.h" #include "VirtualRegister.h" -namespace JSC { namespace FTL { - -// Tracks one OSR exit site within the FTL JIT. OSR exit in FTL works by deconstructing -// the crazy that is OSR down to simple SSA CFG primitives that any compiler backend -// (including of course LLVM) can grok and do meaningful things to. Except for -// watchpoint-based exits, which haven't yet been implemented (see webkit.org/b/113647), -// an exit is just a conditional branch in the emitted code where one destination is the -// continuation and the other is a basic block that performs a no-return tail-call to an -// exit thunk. This thunk takes as its arguments the live non-constant -// not-already-accounted-for bytecode state. To appreciate how this works consider the -// following JavaScript program, and its lowering down to LLVM IR including the relevant -// exits: -// -// function foo(o) { -// var a = o.a; // predicted int -// var b = o.b; -// var c = o.c; // NB this is dead -// a = a | 5; // our example OSR exit: need to check if a is an int -// return a + b; -// } -// -// Just consider the "a | 5". In the DFG IR, this looks like: -// -// BitOr(Check:Int32:@a, Int32:5) -// -// Where @a is the node for the GetLocal node that gets the value of the 'a' variable. -// Conceptually, this node can be further broken down to the following (note that this -// particular lowering never actually happens - we skip this step and go straight to -// LLVM IR - but it's still useful to see this): -// -// exitIf(@a is not int32); -// continuation; -// -// Where 'exitIf()' is a function that will exit if the argument is true, and -// 'continuation' is the stuff that we will do after the exitIf() check. (Note that -// FTL refers to 'exitIf()' as 'speculate()', which is in line with DFG terminology.) -// This then gets broken down to the following LLVM IR, assuming that %0 is the LLVM -// value corresponding to variable 'a', and %1 is the LLVM value for variable 'b': -// -// %2 = ... // the predictate corresponding to '@a is not int32' -// br i1 %2, label %3, label %4 -// ;