2002-01-24 10:27 UTC+0000 Dave Pearson <davep@davep.org>

* source/rtl/profiler.prg
     * HBProfileLowLevel:gatherOPCodes() wasn't making a call to
       HBProfile:ignoreSymbol() to allow for opcode filtering in sub
       classes. Fixed.
     * Improved the formatting of OPCODE names so that they sort
       properly.
This commit is contained in:
Dave Pearson
2002-01-24 10:30:07 +00:00
parent a804426ddd
commit ef342897c2
2 changed files with 25 additions and 4 deletions

View File

@@ -8,6 +8,14 @@
2002-12-01 23:12 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
* tests/testpers.prg
2002-01-25 00:40 UTC-0800 Brian Hays <bhays@abacuslaw.com>
* HBProfileLowLevel:gatherOPCodes() wasn't making a call to
* added arg to StrTran in LoadFromText() to limit conversion of
"=" to ":=" to only the first instance, so data containing
a "=" doesn't get changed
* fixed ValToText() so data containing embedded quotes doesn't
Tests if the string contains a " and uses single quotes
instead, or use [] if it contains both.
Future enhancement should cover if contains all 3....

View File

@@ -307,7 +307,6 @@ End Class
Method describe Class HBProfileOPCode
Return( "OPCode" )
////////////////////////////////////////////////////////////////////////////
// Class: HBProfile
@@ -558,18 +557,32 @@ End Class
/////
Method gather Class HBProfileLowLevel
Return( ::super:gather():gatherOPCodes() )
Local lProfile := __setProfiler( .F. )
// Gather functions and methods.
::super:gather()
// Also gather opcodes.
::gatherOPCodes()
__setProfiler( lProfile )
Return( self )
/////
Method gatherOPCodes Class HBProfileLowLevel
Local nMax := __opcount()
Local cName
Local nOP
// Loop over all the harbour OP codes. Note that they start at 0.
For nOP := 0 To ( nMax - 1 )
// Add it to the profile.
aadd( ::aProfile, HBProfileOPCode():new( "OPCODE( " + alltrim( str( nOP ) ) + " )", __OpGetPrf( nOP ) ) )
// If we're not ignoring this opcode.
If !::ignoreSymbol( cName := "OPCODE( " + padl( nOP, 3 ) + " )" )
// Add it to the profile.
aadd( ::aProfile, HBProfileOPCode():new( cName, __OpGetPrf( nOP ) ) )
EndIf
Next
Return( self )