Changeset 169005 in webkit
- Timestamp:
- May 17, 2014, 8:44:23 PM (11 years ago)
- Location:
- branches/ftlopt/Source/JavaScriptCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ftlopt/Source/JavaScriptCore/ChangeLog
r168780 r169005 1 2014-05-17 Filip Pizlo <[email protected]> 2 3 [ftlopt] InlineCallFrame::isCall should be an enumeration 4 https://bugs.webkit.org/show_bug.cgi?id=133034 5 6 Reviewed by Sam Weinig. 7 8 Once we start inlining getters and setters, we'll want InlineCallFrame to be able to tell 9 us that the inlined call was a getter call or a setter call. Initially I thought I would 10 have a new field called "kind" that would have components NormalCall, GetterCall, and 11 SetterCall. But that doesn't make sense, because for GetterCall and SetterCall, isCall 12 would have to be true. Hence, It makes more sense to have one enumeration that is Call, 13 Construct, GetterCall, or SetterCall. This patch is a first step towards this. 14 15 It's interesting that isClosureCall should probably still be separate, since getter and 16 setter inlining could inline closure calls. 17 18 * bytecode/CodeBlock.h: 19 (JSC::baselineCodeBlockForInlineCallFrame): 20 * bytecode/CodeOrigin.cpp: 21 (JSC::InlineCallFrame::dumpInContext): 22 (WTF::printInternal): 23 * bytecode/CodeOrigin.h: 24 (JSC::InlineCallFrame::kindFor): 25 (JSC::InlineCallFrame::specializationKindFor): 26 (JSC::InlineCallFrame::InlineCallFrame): 27 (JSC::InlineCallFrame::specializationKind): 28 * dfg/DFGByteCodeParser.cpp: 29 (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): 30 * dfg/DFGOSRExitPreparation.cpp: 31 (JSC::DFG::prepareCodeOriginForOSRExit): 32 * runtime/Arguments.h: 33 (JSC::Arguments::finishCreation): 34 1 35 2014-05-13 Filip Pizlo <[email protected]> 2 36 -
branches/ftlopt/Source/JavaScriptCore/bytecode/CodeBlock.h
r168178 r169005 1196 1196 ExecutableBase* executable = inlineCallFrame->executable.get(); 1197 1197 RELEASE_ASSERT(executable->structure()->classInfo() == FunctionExecutable::info()); 1198 return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame-> isCall ? CodeForCall : CodeForConstruct);1198 return static_cast<FunctionExecutable*>(executable)->baselineCodeBlockFor(inlineCallFrame->specializationKind()); 1199 1199 } 1200 1200 -
branches/ftlopt/Source/JavaScriptCore/bytecode/CodeOrigin.cpp
r165522 r169005 1 1 /* 2 * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2012, 2013, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 179 179 if (executable->isStrictMode()) 180 180 out.print(" (StrictMode)"); 181 out.print(", bc#", caller.bytecodeIndex, ", ", specializationKind());181 out.print(", bc#", caller.bytecodeIndex, ", ", kind); 182 182 if (isClosureCall) 183 183 out.print(", closure call"); … … 196 196 } // namespace JSC 197 197 198 namespace WTF { 199 200 void printInternal(PrintStream& out, JSC::InlineCallFrame::Kind kind) 201 { 202 switch (kind) { 203 case JSC::InlineCallFrame::Call: 204 out.print("Call"); 205 return; 206 case JSC::InlineCallFrame::Construct: 207 out.print("Construct"); 208 return; 209 } 210 RELEASE_ASSERT_NOT_REACHED(); 211 } 212 213 } // namespace WTF 214 -
branches/ftlopt/Source/JavaScriptCore/bytecode/CodeOrigin.h
r167182 r169005 1 1 /* 2 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2011, 2012, 2013, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 119 119 120 120 struct InlineCallFrame { 121 enum Kind { 122 Call, 123 Construct, 124 }; 125 126 static Kind kindFor(CodeSpecializationKind kind) 127 { 128 switch (kind) { 129 case CodeForCall: 130 return Call; 131 case CodeForConstruct: 132 return Construct; 133 } 134 RELEASE_ASSERT_NOT_REACHED(); 135 return Call; 136 } 137 138 static CodeSpecializationKind specializationKindFor(Kind kind) 139 { 140 switch (kind) { 141 case Call: 142 return CodeForCall; 143 case Construct: 144 return CodeForConstruct; 145 } 146 RELEASE_ASSERT_NOT_REACHED(); 147 return CodeForCall; 148 } 149 121 150 Vector<ValueRecovery> arguments; // Includes 'this'. 122 151 WriteBarrier<ScriptExecutable> executable; … … 125 154 BitVector capturedVars; // Indexed by the machine call frame's variable numbering. 126 155 signed stackOffset : 30; 127 bool isCall: 1;156 Kind kind : 1; 128 157 bool isClosureCall : 1; // If false then we know that callee/scope are constants and the DFG won't treat them as variables, i.e. they have to be recovered manually. 129 158 VirtualRegister argumentsRegister; // This is only set if the code uses arguments. The unmodified arguments register follows the unmodifiedArgumentsRegister() convention (see CodeBlock.h). … … 134 163 InlineCallFrame() 135 164 : stackOffset(0) 136 , isCall(false)165 , kind(Call) 137 166 , isClosureCall(false) 138 167 { 139 168 } 140 169 141 CodeSpecializationKind specializationKind() const { return specialization FromIsCall(isCall); }170 CodeSpecializationKind specializationKind() const { return specializationKindFor(kind); } 142 171 143 172 JSFunction* calleeConstant() const … … 210 239 namespace WTF { 211 240 241 void printInternal(PrintStream&, JSC::InlineCallFrame::Kind); 242 212 243 template<typename T> struct DefaultHash; 213 244 template<> struct DefaultHash<JSC::CodeOrigin> { -
branches/ftlopt/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r168780 r169005 3436 3436 m_inlineCallFrame->caller = byteCodeParser->currentCodeOrigin(); 3437 3437 m_inlineCallFrame->arguments.resize(argumentCountIncludingThis); // Set the number of arguments including this, but don't configure the value recoveries, yet. 3438 m_inlineCallFrame-> isCall = isCall(kind);3438 m_inlineCallFrame->kind = InlineCallFrame::kindFor(kind); 3439 3439 3440 3440 if (m_inlineCallFrame->caller.inlineCallFrame) -
branches/ftlopt/Source/JavaScriptCore/dfg/DFGOSRExitPreparation.cpp
r164229 r169005 1 1 /* 2 * Copyright (C) 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2013, 2014 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 46 46 static_cast<FunctionExecutable*>(codeOrigin.inlineCallFrame->executable.get()); 47 47 CodeBlock* codeBlock = executable->baselineCodeBlockFor( 48 codeOrigin.inlineCallFrame-> isCall ? CodeForCall : CodeForConstruct);48 codeOrigin.inlineCallFrame->specializationKind()); 49 49 50 50 if (codeBlock->jitType() == JSC::JITCode::BaselineJIT) -
branches/ftlopt/Source/JavaScriptCore/runtime/Arguments.h
r167641 r169005 1 1 /* 2 2 * Copyright (C) 1999-2000 Harri Porten ([email protected]) 3 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.3 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2014 Apple Inc. All rights reserved. 4 4 * Copyright (C) 2007 Cameron Zwarich ([email protected]) 5 5 * Copyright (C) 2007 Maks Orlovich … … 322 322 m_overrodeCaller = false; 323 323 m_isStrictMode = jsCast<FunctionExecutable*>(inlineCallFrame->executable.get())->isStrictMode(); 324 ASSERT(!jsCast<FunctionExecutable*>(inlineCallFrame->executable.get())->symbolTable(inlineCallFrame-> isCall ? CodeForCall : CodeForConstruct)->slowArguments());324 ASSERT(!jsCast<FunctionExecutable*>(inlineCallFrame->executable.get())->symbolTable(inlineCallFrame->specializationKind())->slowArguments()); 325 325 326 326 // The bytecode generator omits op_tear_off_activation in cases of no
Note:
See TracChangeset
for help on using the changeset viewer.