Changeset 179392 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Jan 29, 2015, 8:28:36 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r179357 r179392 1 1 /* 2 * Copyright (C) 2011 -2015Apple 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 … … 676 676 m_parameterSlots = parameterSlots; 677 677 678 int dummyThisArgument = op == Call || op == NativeCall ? 0 : 1;678 int dummyThisArgument = op == Call || op == NativeCall || op == ProfiledCall ? 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 (Options::verboseDFGByteCodeParsing()) 1048 dataLog(" Handling call at ", currentCodeOrigin(), ": ", callLinkStatus, "\n"); 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 } 1049 1058 1050 1059 if (!callLinkStatus.canOptimize()) { … … 1068 1077 #if ENABLE(FTL_NATIVE_CALL_INLINING) 1069 1078 if (isFTL(m_graph.m_plan.mode) && Options::optimizeNativeCalls() && callLinkStatus.size() == 1 && !callLinkStatus.couldTakeSlowPath()) { 1070 CallVariant callee = callLinkStatus[0] ;1079 CallVariant callee = callLinkStatus[0].callee(); 1071 1080 JSFunction* function = callee.function(); 1072 1081 CodeSpecializationKind specializationKind = InlineCallFrame::specializationKindFor(kind); … … 1075 1084 callOpInfo = OpInfo(m_graph.freeze(function)); 1076 1085 1077 if (op == Call )1086 if (op == Call || op == ProfiledCall) 1078 1087 op = NativeCall; 1079 1088 else { 1080 ASSERT(op == Construct );1089 ASSERT(op == Construct || op == ProfiledConstruct); 1081 1090 op = NativeConstruct; 1082 1091 } … … 1418 1427 if (!callLinkStatus.couldTakeSlowPath() && callLinkStatus.size() == 1) { 1419 1428 emitFunctionChecks( 1420 callLinkStatus[0] , callTargetNode, registerOffset, specializationKind);1429 callLinkStatus[0].callee(), callTargetNode, registerOffset, specializationKind); 1421 1430 bool result = attemptToInlineCall( 1422 callTargetNode, resultOperand, callLinkStatus[0] , registerOffset,1431 callTargetNode, resultOperand, callLinkStatus[0].callee(), registerOffset, 1423 1432 argumentCountIncludingThis, nextOffset, kind, CallerDoesNormalLinking, prediction, 1424 1433 inliningBalance); 1425 1434 if (!result && !callLinkStatus.isProved()) 1426 undoFunctionChecks(callLinkStatus[0] );1435 undoFunctionChecks(callLinkStatus[0].callee()); 1427 1436 if (verbose) { 1428 1437 dataLog("Done inlining (simple).\n"); … … 1454 1463 bool allAreDirectCalls = true; 1455 1464 for (unsigned i = callLinkStatus.size(); i--;) { 1456 if (callLinkStatus[i]. isClosureCall())1465 if (callLinkStatus[i].callee().isClosureCall()) 1457 1466 allAreDirectCalls = false; 1458 1467 else … … 1467 1476 else { 1468 1477 // FIXME: We should be able to handle this case, but it's tricky and we don't know of cases 1469 // where it would be beneficial. It might be best to handle these cases as if all calls were 1470 // closure calls. 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. 1471 1481 // https://bugs.webkit.org/show_bug.cgi?id=136020 1472 1482 if (verbose) { … … 1508 1518 Vector<BasicBlock*> landingBlocks; 1509 1519 1510 // We ma yforce this true if we give up on inlining any of the edges.1520 // We make force this true if we give up on inlining any of the edges. 1511 1521 bool couldTakeSlowPath = callLinkStatus.couldTakeSlowPath(); 1512 1522 … … 1524 1534 1525 1535 bool inliningResult = attemptToInlineCall( 1526 myCallTargetNode, resultOperand, callLinkStatus[i] , registerOffset,1536 myCallTargetNode, resultOperand, callLinkStatus[i].callee(), registerOffset, 1527 1537 argumentCountIncludingThis, nextOffset, kind, CallerLinksManually, prediction, 1528 1538 inliningBalance); … … 1543 1553 JSCell* thingToCaseOn; 1544 1554 if (allAreDirectCalls) 1545 thingToCaseOn = callLinkStatus[i]. nonExecutableCallee();1555 thingToCaseOn = callLinkStatus[i].callee().nonExecutableCallee(); 1546 1556 else { 1547 1557 ASSERT(allAreClosureCalls); 1548 thingToCaseOn = callLinkStatus[i]. executable();1558 thingToCaseOn = callLinkStatus[i].callee().executable(); 1549 1559 } 1550 1560 data.cases.append(SwitchCase(m_graph.freeze(thingToCaseOn), block.get())); … … 1558 1568 1559 1569 if (verbose) 1560 dataLog("Finished inlining ", callLinkStatus[i] , " at ", currentCodeOrigin(), ".\n");1570 dataLog("Finished inlining ", callLinkStatus[i].callee(), " at ", currentCodeOrigin(), ".\n"); 1561 1571 } 1562 1572
Note:
See TracChangeset
for help on using the changeset viewer.