Changeset 37891 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Oct 25, 2008, 12:59:47 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r37845 r37891 924 924 (*profiler)->willExecute(newCallFrame, programNode->sourceURL(), programNode->lineNo()); 925 925 926 m_reentryDepth++; 926 JSValue* result; 927 { 928 SamplingTool::CallRecord callRecord(m_sampler); 929 930 m_reentryDepth++; 927 931 #if ENABLE(CTI) 928 if (!codeBlock->ctiCode)929 CTI::compile(this, newCallFrame, codeBlock);930 JSValue*result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);932 if (!codeBlock->ctiCode) 933 CTI::compile(this, newCallFrame, codeBlock); 934 result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 931 935 #else 932 JSValue*result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);936 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 933 937 #endif 934 m_reentryDepth--; 935 936 MACHINE_SAMPLING_privateExecuteReturned(); 938 m_reentryDepth--; 939 } 937 940 938 941 if (*profiler) … … 987 990 (*profiler)->willExecute(newCallFrame, function); 988 991 989 m_reentryDepth++; 992 JSValue* result; 993 { 994 SamplingTool::CallRecord callRecord(m_sampler); 995 996 m_reentryDepth++; 990 997 #if ENABLE(CTI) 991 if (!codeBlock->ctiCode)992 CTI::compile(this, newCallFrame, codeBlock);993 JSValue*result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);998 if (!codeBlock->ctiCode) 999 CTI::compile(this, newCallFrame, codeBlock); 1000 result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 994 1001 #else 995 JSValue*result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);1002 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 996 1003 #endif 997 m_reentryDepth--; 1004 m_reentryDepth--; 1005 } 998 1006 999 1007 if (*profiler) 1000 1008 (*profiler)->didExecute(newCallFrame, function); 1001 1002 MACHINE_SAMPLING_privateExecuteReturned();1003 1009 1004 1010 m_registerFile.shrink(oldEnd); … … 1076 1082 (*profiler)->willExecute(newCallFrame, evalNode->sourceURL(), evalNode->lineNo()); 1077 1083 1078 m_reentryDepth++; 1084 JSValue* result; 1085 { 1086 SamplingTool::CallRecord callRecord(m_sampler); 1087 1088 m_reentryDepth++; 1079 1089 #if ENABLE(CTI) 1080 if (!codeBlock->ctiCode)1081 CTI::compile(this, newCallFrame, codeBlock);1082 JSValue*result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception);1090 if (!codeBlock->ctiCode) 1091 CTI::compile(this, newCallFrame, codeBlock); 1092 result = CTI::execute(codeBlock->ctiCode, &m_registerFile, newCallFrame, scopeChain->globalData, exception); 1083 1093 #else 1084 JSValue*result = privateExecute(Normal, &m_registerFile, newCallFrame, exception);1094 result = privateExecute(Normal, &m_registerFile, newCallFrame, exception); 1085 1095 #endif 1086 m_reentryDepth--; 1087 1088 MACHINE_SAMPLING_privateExecuteReturned(); 1096 m_reentryDepth--; 1097 } 1089 1098 1090 1099 if (*profiler) … … 1473 1482 } while (0) 1474 1483 1475 #if DUMP_OPCODE_STATS1484 #if ENABLE(OPCODE_STATS) 1476 1485 OpcodeStats::resetLastInstruction(); 1477 1486 #endif … … 1483 1492 tickCount = m_ticksUntilNextTimeoutCheck; \ 1484 1493 } 1494 1495 #if ENABLE(OPCODE_SAMPLING) 1496 #define SAMPLE(codeBlock, vPC) m_sampler->sample(codeBlock, vPC) 1497 #define CTI_SAMPLER ARG_globalData->machine->sampler() 1498 #else 1499 #define SAMPLE(codeBlock, vPC) 1500 #define CTI_SAMPLER 1501 #endif 1485 1502 1486 1503 #if HAVE(COMPUTED_GOTO) 1487 #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto *vPC->u.opcode1488 #if DUMP_OPCODE_STATS1504 #define NEXT_OPCODE SAMPLE(callFrame->codeBlock(), vPC); goto *vPC->u.opcode 1505 #if ENABLE(OPCODE_STATS) 1489 1506 #define BEGIN_OPCODE(opcode) opcode: OpcodeStats::recordInstruction(opcode); 1490 1507 #else … … 1493 1510 NEXT_OPCODE; 1494 1511 #else 1495 #define NEXT_OPCODE MACHINE_SAMPLING_sample(callFrame->codeBlock(), vPC); goto interpreterLoopStart1496 #if DUMP_OPCODE_STATS1512 #define NEXT_OPCODE SAMPLE(callFrame->codeBlock(), vPC); goto interpreterLoopStart 1513 #if ENABLE(OPCODE_STATS) 1497 1514 #define BEGIN_OPCODE(opcode) case opcode: OpcodeStats::recordInstruction(opcode); 1498 1515 #else … … 2959 2976 the JS timeout is reached. 2960 2977 */ 2961 #if DUMP_OPCODE_STATS2978 #if ENABLE(OPCODE_STATS) 2962 2979 OpcodeStats::resetLastInstruction(); 2963 2980 #endif … … 2973 2990 instruction. 2974 2991 */ 2975 #if DUMP_OPCODE_STATS2992 #if ENABLE(OPCODE_STATS) 2976 2993 OpcodeStats::resetLastInstruction(); 2977 2994 #endif … … 3354 3371 vPC = newCodeBlock->instructions.begin(); 3355 3372 3356 #if DUMP_OPCODE_STATS3373 #if ENABLE(OPCODE_STATS) 3357 3374 OpcodeStats::resetLastInstruction(); 3358 3375 #endif … … 3369 3386 newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, 0); 3370 3387 3371 MACHINE_SAMPLING_callingHostFunction(); 3372 3373 JSValue* returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); 3388 JSValue* returnValue; 3389 { 3390 SamplingTool::HostCallRecord callRecord(m_sampler); 3391 returnValue = callData.native.function(newCallFrame, asObject(v), thisValue, args); 3392 } 3374 3393 VM_CHECK_EXCEPTION(); 3375 3394 … … 3599 3618 vPC = newCodeBlock->instructions.begin(); 3600 3619 3601 #if DUMP_OPCODE_STATS3620 #if ENABLE(OPCODE_STATS) 3602 3621 OpcodeStats::resetLastInstruction(); 3603 3622 #endif … … 3613 3632 newCallFrame->init(0, vPC + 7, scopeChain, callFrame, dst, argCount, 0); 3614 3633 3615 MACHINE_SAMPLING_callingHostFunction(); 3616 3617 JSValue* returnValue = constructData.native.function(newCallFrame, asObject(v), args); 3618 3634 JSValue* returnValue; 3635 { 3636 SamplingTool::HostCallRecord callRecord(m_sampler); 3637 returnValue = constructData.native.function(newCallFrame, asObject(v), args); 3638 } 3619 3639 VM_CHECK_EXCEPTION(); 3620 3640 callFrame[dst] = returnValue; … … 4795 4815 ArgList argList(argv + 1, argCount - 1); 4796 4816 4797 CTI_MACHINE_SAMPLING_callingHostFunction(); 4798 4799 JSValue* returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList); 4817 JSValue* returnValue; 4818 { 4819 SamplingTool::HostCallRecord callRecord(CTI_SAMPLER); 4820 returnValue = callData.native.function(callFrame, asObject(funcVal), argv[0].jsValue(callFrame), argList); 4821 } 4800 4822 ARG_setCallFrame(previousCallFrame); 4801 4823 VM_CHECK_EXCEPTION(); … … 5000 5022 ArgList argList(callFrame->registers() + firstArg + 1, argCount - 1); 5001 5023 5002 CTI_MACHINE_SAMPLING_callingHostFunction(); 5003 5004 JSValue* returnValue = constructData.native.function(callFrame, asObject(constrVal), argList); 5024 JSValue* returnValue; 5025 { 5026 SamplingTool::HostCallRecord callRecord(CTI_SAMPLER); 5027 returnValue = constructData.native.function(callFrame, asObject(constrVal), argList); 5028 } 5005 5029 VM_CHECK_EXCEPTION(); 5006 5030
Note:
See TracChangeset
for help on using the changeset viewer.