Changeset 179478 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Feb 2, 2015, 10:38:08 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r179392 r179478 1 1 /* 2 * Copyright (C) 2011 , 2012, 2013, 2014Apple Inc. All rights reserved.2 * Copyright (C) 2011-2015 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 676 676 m_parameterSlots = parameterSlots; 677 677 678 int dummyThisArgument = op == Call || op == NativeCall || op == ProfiledCall? 0 : 1;678 int dummyThisArgument = op == Call || op == NativeCall ? 0 : 1; 679 679 for (int i = 0 + dummyThisArgument; i < argCount; ++i) 680 680 addVarArgChild(get(virtualRegisterForArgument(i, registerOffset))); … … 1045 1045 callLinkStatus = CallLinkStatus(callTarget->asJSValue()).setIsProved(true); 1046 1046 1047 if ((!callLinkStatus.canOptimize() || callLinkStatus.size() != 1) 1048 && !isFTL(m_graph.m_plan.mode) && Options::useFTLJIT() 1049 && InlineCallFrame::isNormalCall(kind) 1050 && CallEdgeLog::isEnabled() 1051 && Options::dfgDoesCallEdgeProfiling()) { 1052 ASSERT(op == Call || op == Construct); 1053 if (op == Call) 1054 op = ProfiledCall; 1055 else 1056 op = ProfiledConstruct; 1057 } 1047 if (Options::verboseDFGByteCodeParsing()) 1048 dataLog(" Handling call at ", currentCodeOrigin(), ": ", callLinkStatus, "\n"); 1058 1049 1059 1050 if (!callLinkStatus.canOptimize()) { … … 1077 1068 #if ENABLE(FTL_NATIVE_CALL_INLINING) 1078 1069 if (isFTL(m_graph.m_plan.mode) && Options::optimizeNativeCalls() && callLinkStatus.size() == 1 && !callLinkStatus.couldTakeSlowPath()) { 1079 CallVariant callee = callLinkStatus[0] .callee();1070 CallVariant callee = callLinkStatus[0]; 1080 1071 JSFunction* function = callee.function(); 1081 1072 CodeSpecializationKind specializationKind = InlineCallFrame::specializationKindFor(kind); … … 1084 1075 callOpInfo = OpInfo(m_graph.freeze(function)); 1085 1076 1086 if (op == Call || op == ProfiledCall)1077 if (op == Call) 1087 1078 op = NativeCall; 1088 1079 else { 1089 ASSERT(op == Construct || op == ProfiledConstruct);1080 ASSERT(op == Construct); 1090 1081 op = NativeConstruct; 1091 1082 } … … 1427 1418 if (!callLinkStatus.couldTakeSlowPath() && callLinkStatus.size() == 1) { 1428 1419 emitFunctionChecks( 1429 callLinkStatus[0] .callee(), callTargetNode, registerOffset, specializationKind);1420 callLinkStatus[0], callTargetNode, registerOffset, specializationKind); 1430 1421 bool result = attemptToInlineCall( 1431 callTargetNode, resultOperand, callLinkStatus[0] .callee(), registerOffset,1422 callTargetNode, resultOperand, callLinkStatus[0], registerOffset, 1432 1423 argumentCountIncludingThis, nextOffset, kind, CallerDoesNormalLinking, prediction, 1433 1424 inliningBalance); 1434 1425 if (!result && !callLinkStatus.isProved()) 1435 undoFunctionChecks(callLinkStatus[0] .callee());1426 undoFunctionChecks(callLinkStatus[0]); 1436 1427 if (verbose) { 1437 1428 dataLog("Done inlining (simple).\n"); … … 1463 1454 bool allAreDirectCalls = true; 1464 1455 for (unsigned i = callLinkStatus.size(); i--;) { 1465 if (callLinkStatus[i]. callee().isClosureCall())1456 if (callLinkStatus[i].isClosureCall()) 1466 1457 allAreDirectCalls = false; 1467 1458 else … … 1476 1467 else { 1477 1468 // FIXME: We should be able to handle this case, but it's tricky and we don't know of cases 1478 // where it would be beneficial. Also, CallLinkStatus would make all callees appear like 1479 // closure calls if any calls were closure calls - except for calls to internal functions. 1480 // So this will only arise if some callees are internal functions and others are closures. 1469 // where it would be beneficial. It might be best to handle these cases as if all calls were 1470 // closure calls. 1481 1471 // https://bugs.webkit.org/show_bug.cgi?id=136020 1482 1472 if (verbose) { … … 1518 1508 Vector<BasicBlock*> landingBlocks; 1519 1509 1520 // We ma keforce this true if we give up on inlining any of the edges.1510 // We may force this true if we give up on inlining any of the edges. 1521 1511 bool couldTakeSlowPath = callLinkStatus.couldTakeSlowPath(); 1522 1512 … … 1534 1524 1535 1525 bool inliningResult = attemptToInlineCall( 1536 myCallTargetNode, resultOperand, callLinkStatus[i] .callee(), registerOffset,1526 myCallTargetNode, resultOperand, callLinkStatus[i], registerOffset, 1537 1527 argumentCountIncludingThis, nextOffset, kind, CallerLinksManually, prediction, 1538 1528 inliningBalance); … … 1553 1543 JSCell* thingToCaseOn; 1554 1544 if (allAreDirectCalls) 1555 thingToCaseOn = callLinkStatus[i]. callee().nonExecutableCallee();1545 thingToCaseOn = callLinkStatus[i].nonExecutableCallee(); 1556 1546 else { 1557 1547 ASSERT(allAreClosureCalls); 1558 thingToCaseOn = callLinkStatus[i]. callee().executable();1548 thingToCaseOn = callLinkStatus[i].executable(); 1559 1549 } 1560 1550 data.cases.append(SwitchCase(m_graph.freeze(thingToCaseOn), block.get())); … … 1568 1558 1569 1559 if (verbose) 1570 dataLog("Finished inlining ", callLinkStatus[i] .callee(), " at ", currentCodeOrigin(), ".\n");1560 dataLog("Finished inlining ", callLinkStatus[i], " at ", currentCodeOrigin(), ".\n"); 1571 1561 } 1572 1562
Note:
See TracChangeset
for help on using the changeset viewer.