ChangeLog-2012-10-02 848 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889
  1. 2012-10-02 Filip Pizlo <fpizlo@apple.com>
  2. REGRESSION(r128400): ASSERT (crash in release) @ app.asana.com
  3. https://bugs.webkit.org/show_bug.cgi?id=98175
  4. Reviewed by Oliver Hunt.
  5. It's bad karma to create a new structure while stealing another structure's property table
  6. while leaving the m_offset unset. Eventually someone will then steal your property table, and
  7. then you won't know how many properties you have anymore.
  8. * runtime/Structure.cpp:
  9. (JSC::Structure::nonPropertyTransition):
  10. 2012-10-02 Michael Saboff <msaboff@apple.com>
  11. Comment additions after r130109
  12. Rubber stamped by Geoffrey Garen.
  13. Updated comments to how array storage works.
  14. * runtime/ArrayStorage.h:
  15. * runtime/JSArray.cpp:
  16. 2012-10-01 Mark Hahnenberg <mhahnenberg@apple.com>
  17. Block freeing thread should sleep indefinitely when there's no work to do
  18. https://bugs.webkit.org/show_bug.cgi?id=98084
  19. Reviewed by Geoffrey Garen.
  20. Currently the block freeing thread wakes up once a second to check if there are any blocks
  21. for it to release back to the OS. This is wasteful. We should change it to sleep when it
  22. realizes there are no more blocks to free. Any thread that returns a block to the BlockAllocator
  23. should then notify the block freeing thread that there is more work to do now.
  24. * heap/BlockAllocator.cpp:
  25. (JSC::BlockAllocator::BlockAllocator):
  26. (JSC::BlockAllocator::blockFreeingThreadMain):
  27. * heap/BlockAllocator.h:
  28. (BlockAllocator):
  29. (JSC::BlockAllocator::deallocate):
  30. 2012-10-01 Michael Saboff <msaboff@apple.com>
  31. JSArray::unshiftCountSlowCase needs to clear array slots when adding space to end of array
  32. https://bugs.webkit.org/show_bug.cgi?id=98101
  33. Reviewed by Filip Pizlo.
  34. Cleared new array entries when adding to end due to shifting contents to lower memory. Also
  35. checnaged the order of moving array contents and metadata in the shift left case to avoid
  36. clobbering the metadata with array contents. Optimized the to only make a memmove if the
  37. count is non-zero.
  38. * runtime/JSArray.cpp:
  39. (JSC::JSArray::unshiftCountSlowCase):
  40. (JSC::JSArray::unshiftCount):
  41. 2012-10-01 Filip Pizlo <fpizlo@apple.com>
  42. Address a FIXME in JSArray::sort
  43. https://bugs.webkit.org/show_bug.cgi?id=98080
  44. <rdar://problem/12407844>
  45. Reviewed by Oliver Hunt.
  46. Get rid of fast sorting of sparse maps. I don't know that it's broken but I do know that we don't
  47. have coverage for it. Then also address the FIXME in JSArray::sort regarding side-effecting
  48. compare functions.
  49. * runtime/ArrayPrototype.cpp:
  50. (JSC::arrayProtoFuncSort):
  51. * runtime/JSArray.cpp:
  52. (JSC::JSArray::sortNumeric):
  53. (JSC::JSArray::sort):
  54. (JSC::JSArray::compactForSorting):
  55. * runtime/JSArray.h:
  56. (JSArray):
  57. * runtime/JSObject.h:
  58. (JSC::JSObject::hasSparseMap):
  59. (JSObject):
  60. 2012-10-01 Jonathan Liu <net147@gmail.com>
  61. Remove unused sys/mman.h include
  62. https://bugs.webkit.org/show_bug.cgi?id=97995
  63. Reviewed by Kentaro Hara.
  64. The sys/mman.h is not used and removing it improves portability as not
  65. all systems have sys/mman.h.
  66. * jit/ExecutableAllocatorFixedVMPool.cpp:
  67. 2012-09-28 Filip Pizlo <fpizlo@apple.com>
  68. ASSERTION in m_graph[tailNodeIndex].op() == Flush || m_graph[tailNodeIndex].op() == SetLocal on plus.google.com
  69. https://bugs.webkit.org/show_bug.cgi?id=97656
  70. Reviewed by Mark Hahnenberg.
  71. There were two bugs here:
  72. 1) In case of multiple GetLocals to the same captured variable, the bytecode parser would linke the first,
  73. rather than the last, of the GetLocals into the vars-at-tail table.
  74. 2) The constant folding phase was asserting that any GetLocal it eliminates must be linked into the
  75. vars-at-tail table, when for captured variables only the last of those should be.
  76. * dfg/DFGByteCodeParser.cpp:
  77. (JSC::DFG::ByteCodeParser::getLocal):
  78. * dfg/DFGConstantFoldingPhase.cpp:
  79. (JSC::DFG::ConstantFoldingPhase::foldConstants):
  80. 2012-09-28 Filip Pizlo <fpizlo@apple.com>
  81. DFGStructureHoistingPhase SetLocal assumes StructureTransitionWatchpoint has a structure set
  82. https://bugs.webkit.org/show_bug.cgi?id=97810
  83. Reviewed by Mark Hahnenberg.
  84. No tests because this can't happen in ToT: the structure check hoisting phase runs before any
  85. CFA or folding, so the only StructureTransitionWatchpoints it will see are the ones inserted
  86. by the parser. But the parser will only insert StructureTransitinWatchpoints on constants, which
  87. will not be subject to SetLocals.
  88. Still, it would be good to fix this in case things changed.
  89. * dfg/DFGStructureCheckHoistingPhase.cpp:
  90. (JSC::DFG::StructureCheckHoistingPhase::run):
  91. 2012-09-27 Mark Lam <mark.lam@apple.com>
  92. Put initializeHostCallReturnValue() behind #if ENABLE(JIT).
  93. Fixes non JIT builds.
  94. https://bugs.webkit.org/show_bug.cgi?id=97838.
  95. Reviewed by John Sullivan.
  96. * runtime/JSGlobalData.cpp:
  97. (JSC::JSGlobalData::JSGlobalData):
  98. 2012-09-27 Mark Lam <mark.lam@apple.com>
  99. Fixed CallFrameClosure::resetCallFrame() to use the valid
  100. range of argument index values.
  101. https://bugs.webkit.org/show_bug.cgi?id=97836.
  102. Reviewed by Gavin Barraclough.
  103. * interpreter/CallFrame.h:
  104. (ExecState):
  105. * interpreter/CallFrameClosure.h:
  106. (JSC::CallFrameClosure::resetCallFrame):
  107. 2012-09-27 Patrick Gansterer <paroga@webkit.org>
  108. Fix usage of COMPILER() macros
  109. https://bugs.webkit.org/show_bug.cgi?id=97642
  110. Reviewed by Geoffrey Garen.
  111. Add COMPILER(GCC) around compiler specific code and remove it from generic code.
  112. This allows us to implement the DFG code for other compilers to in a next step.
  113. * dfg/DFGOperations.cpp:
  114. * jit/HostCallReturnValue.h:
  115. 2012-09-27 Andreas Kling <kling@webkit.org>
  116. 3.20MB below FunctionParameters::create() on Membuster3.
  117. <http://webkit.org/b/97730>
  118. Reviewed by Anders Carlsson.
  119. Figure out the exact space needed for parameter identifiers and use reserveInitialCapacity().
  120. Reduces memory consumption on Membuster3 by ~1.60 MB.
  121. * parser/Nodes.cpp:
  122. (JSC::FunctionParameters::FunctionParameters):
  123. 2012-09-27 Csaba Osztrogonác <ossy@webkit.org>, Tor Arne Vestbø <vestbo@webkit.org>
  124. [Qt] Enable the LLInt on Linux
  125. https://bugs.webkit.org/show_bug.cgi?id=95749
  126. Reviewed by Simon Hausmann.
  127. * DerivedSources.pri:
  128. * JavaScriptCore.pro:
  129. * LLIntOffsetsExtractor.pro: Added.
  130. * Target.pri:
  131. 2012-09-27 Patrick Gansterer <paroga@webkit.org>
  132. [CMake] Fix build with static JavaScriptCore library
  133. * shell/CMakeLists.txt: Define STATICALLY_LINKED_WITH_JavaScriptCore if
  134. JavaScriptCore_LIBRARY_TYPE is set to STATIC.
  135. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  136. Proxy the global this in JSC
  137. https://bugs.webkit.org/show_bug.cgi?id=97734
  138. Reviewed by Filip Pizlo.
  139. Eeep – fix a bug - was leaving the global this proxy's structure's globalObject as 0,
  140. and setting the proxy's prototype as the global object, rather than its prototype.
  141. * jsc.cpp:
  142. (GlobalObject::create):
  143. * runtime/JSProxy.h:
  144. (JSC::JSProxy::createStructure):
  145. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  146. Speculative Windows build fix.
  147. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  148. 2012-09-26 Filip Pizlo <fpizlo@apple.com>
  149. Unreviewed, 32-bit build fix.
  150. * llint/LowLevelInterpreter32_64.asm:
  151. 2012-09-26 Filip Pizlo <fpizlo@apple.com>
  152. jneq_ptr shouldn't have a pointer
  153. https://bugs.webkit.org/show_bug.cgi?id=97739
  154. Reviewed by Oliver Hunt.
  155. Slamming pointers directly into bytecode is sometimes cool, but in this case it's
  156. unwieldy and confusing. Switched the instruction to use an enum instead. This has
  157. zero effect on code gen behavior in the JITs. In the LLInt, there is now more
  158. indirection, but that doesn't affect benchmarks.
  159. * CMakeLists.txt:
  160. * GNUmakefile.list.am:
  161. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  162. * JavaScriptCore.xcodeproj/project.pbxproj:
  163. * Target.pri:
  164. * bytecode/Instruction.h:
  165. (JSC::Instruction::Instruction):
  166. (Instruction):
  167. * bytecode/SpecialPointer.cpp: Added.
  168. (JSC):
  169. (JSC::actualPointerFor):
  170. * bytecode/SpecialPointer.h: Added.
  171. (JSC):
  172. (JSC::pointerIsFunction):
  173. (JSC::pointerIsCell):
  174. * bytecompiler/BytecodeGenerator.cpp:
  175. (JSC::BytecodeGenerator::emitJumpIfNotFunctionCall):
  176. (JSC::BytecodeGenerator::emitJumpIfNotFunctionApply):
  177. * dfg/DFGByteCodeParser.cpp:
  178. (JSC::DFG::ByteCodeParser::parseBlock):
  179. * jit/JITOpcodes.cpp:
  180. (JSC::JIT::emit_op_jneq_ptr):
  181. * jit/JITOpcodes32_64.cpp:
  182. (JSC::JIT::emit_op_jneq_ptr):
  183. * llint/LowLevelInterpreter32_64.asm:
  184. * llint/LowLevelInterpreter64.asm:
  185. * runtime/JSGlobalObject.cpp:
  186. (JSC::JSGlobalObject::reset):
  187. (JSC):
  188. * runtime/JSGlobalObject.h:
  189. (JSGlobalObject):
  190. (JSC::JSGlobalObject::actualPointerFor):
  191. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  192. REGRESSION (r129456): http/tests/security/xss-eval.html is failing on JSC platforms
  193. https://bugs.webkit.org/show_bug.cgi?id=97529
  194. Reviewed by Filip Pizlo.
  195. A recent patch changed JSC's EvalError behaviour; bring this more into line with other browsers.
  196. JSC currently throws an EvalError if you try to call eval with a this object that doesn't
  197. match the given eval function. This does not match other browsers, which generally just
  198. ignore the this value that was passed, and eval the string in the eval function's environment.
  199. * runtime/JSGlobalObjectFunctions.cpp:
  200. (JSC::globalFuncEval):
  201. - Remove EvalError, ignore passed this value.
  202. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  203. Proxy the global this in JSC
  204. https://bugs.webkit.org/show_bug.cgi?id=97734
  205. Reviewed by Oliver Hunt.
  206. Having jsc diverge from WebCore here is not beneficial; it potentially masks bugs and/or performance
  207. problems from command line testing.
  208. * jsc.cpp:
  209. (GlobalObject::create):
  210. - Create a this value proxy for the global object.
  211. * runtime/JSGlobalObject.h:
  212. (JSGlobalObject):
  213. - Make setGlobalThis protected.
  214. * runtime/JSProxy.h:
  215. (JSC::JSProxy::create):
  216. (JSC::JSProxy::target):
  217. (JSC::JSProxy::finishCreation):
  218. (JSProxy):
  219. - Allow proxy target to be a JSObject, add target to create method.
  220. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  221. Speculative Windows build fix.
  222. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  223. 2012-09-26 Filip Pizlo <fpizlo@apple.com>
  224. JSObject::ensureArrayStorage() ignores the possibility that extensions have been prevented
  225. https://bugs.webkit.org/show_bug.cgi?id=97719
  226. Reviewed by Gavin Barraclough.
  227. * runtime/JSObject.cpp:
  228. (JSC::JSObject::ensureArrayStorageSlow):
  229. (JSC):
  230. * runtime/JSObject.h:
  231. (JSC::JSObject::ensureArrayStorage):
  232. (JSObject):
  233. 2012-09-26 Gavin Barraclough <barraclough@apple.com>
  234. Generalize JSGlobalThis as JSProxy
  235. https://bugs.webkit.org/show_bug.cgi?id=97716
  236. Reviewed by Oliver Hunt.
  237. Generalize JSGlobalThis as JSProxy and move proxying functionality up from the window shell into JSProxy.
  238. * CMakeLists.txt:
  239. * GNUmakefile.list.am:
  240. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  241. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  242. * JavaScriptCore.xcodeproj/project.pbxproj:
  243. * Target.pri:
  244. * runtime/JSGlobalObject.cpp:
  245. (JSC::JSGlobalObject::toThisObject):
  246. - Hoist toThisObject from WebCore.
  247. (JSC):
  248. * runtime/JSGlobalObject.h:
  249. - removed include.
  250. (JSC::JSGlobalObject::finishCreation):
  251. - JSGlobalThis -> JSObject
  252. (JSGlobalObject):
  253. - Hoist toThisObject from WebCore.
  254. * runtime/JSGlobalThis.cpp: Removed.
  255. * runtime/JSGlobalThis.h: Removed.
  256. * runtime/JSObject.cpp:
  257. - removed include.
  258. * runtime/JSObject.h:
  259. (JSObject):
  260. (JSC::JSObject::isProxy):
  261. - isGlobalThis -> isProxy
  262. - GlobalThisType -> ProxyType
  263. * runtime/JSProxy.cpp: Copied from Source/JavaScriptCore/runtime/JSGlobalThis.cpp.
  264. (JSC):
  265. (JSC::JSProxy::visitChildren):
  266. (JSC::JSProxy::setTarget):
  267. (JSC::JSProxy::className):
  268. (JSC::JSProxy::getOwnPropertySlot):
  269. (JSC::JSProxy::getOwnPropertySlotByIndex):
  270. (JSC::JSProxy::getOwnPropertyDescriptor):
  271. (JSC::JSProxy::put):
  272. (JSC::JSProxy::putByIndex):
  273. (JSC::JSProxy::putDirectVirtual):
  274. (JSC::JSProxy::defineOwnProperty):
  275. (JSC::JSProxy::deleteProperty):
  276. (JSC::JSProxy::deletePropertyByIndex):
  277. (JSC::JSProxy::getPropertyNames):
  278. (JSC::JSProxy::getOwnPropertyNames):
  279. - Class cretaed from JSGlobalThis, JSDOMWindowShell.
  280. * runtime/JSProxy.h: Copied from Source/JavaScriptCore/runtime/JSGlobalThis.h.
  281. (JSC::JSProxy::create):
  282. (JSC::JSProxy::createStructure):
  283. (JSProxy):
  284. (JSC::JSProxy::target):
  285. (JSC::JSProxy::JSProxy):
  286. - Class cretaed from JSGlobalThis, JSDOMWindowShell.
  287. * runtime/JSType.h:
  288. - GlobalThisType -> ProxyType
  289. 2012-09-26 Michael Saboff <msaboff@apple.com>
  290. Add ability for JSArray::unshiftCount to unshift in middle of an array
  291. https://bugs.webkit.org/show_bug.cgi?id=97691
  292. Reviewed by Filip Pizlo.
  293. Changed JSArray::unshiftCount and unshiftCountSlowCase to handle unshifting from the middle of an
  294. array. Depending on where the unshift point is, either the front part of the array will be moved
  295. "left" or the back part will be moved right. Given that unshiftCount only works on contiguous
  296. arrays it is safe to use memmove for the moves.
  297. This change is worth 25% performance improvement on pdfjs. It doesn't seem to have any impact on
  298. any other benchmarks.
  299. * runtime/ArrayPrototype.cpp:
  300. (JSC::unshift):
  301. * runtime/JSArray.cpp:
  302. (JSC::JSArray::unshiftCountSlowCase):
  303. (JSC::JSArray::unshiftCount):
  304. * runtime/JSArray.h:
  305. (JSArray):
  306. 2012-09-26 Sheriff Bot <webkit.review.bot@gmail.com>
  307. Unreviewed, rolling out r129592.
  308. http://trac.webkit.org/changeset/129592
  309. https://bugs.webkit.org/show_bug.cgi?id=97670
  310. Failures in Chromium security tests (Requested by schenney on
  311. #webkit).
  312. * runtime/JSGlobalObjectFunctions.cpp:
  313. (JSC::globalFuncEval):
  314. 2012-09-25 Gavin Barraclough <barraclough@apple.com>
  315. REGRESSION (r129456): http/tests/security/xss-eval.html is failing on JSC platforms
  316. https://bugs.webkit.org/show_bug.cgi?id=97529
  317. Reviewed by Filip Pizlo.
  318. A recent patch changed JSC's EvalError behaviour; bring this more into line with other browsers.
  319. JSC currently throws an EvalError if you try to call eval with a this object that doesn't
  320. match the given eval function. This does not match other browsers, which generally just
  321. ignore the this value that was passed, and eval the string in the eval function's environment.
  322. * runtime/JSGlobalObjectFunctions.cpp:
  323. (JSC::globalFuncEval):
  324. - Remove EvalError, ignore passed this value.
  325. 2012-09-25 Filip Pizlo <fpizlo@apple.com>
  326. DFG ArrayPush, ArrayPop don't handle clobbering or having a bad time correctly
  327. https://bugs.webkit.org/show_bug.cgi?id=97535
  328. Reviewed by Oliver Hunt.
  329. * dfg/DFGAbstractState.cpp:
  330. (JSC::DFG::AbstractState::execute):
  331. * dfg/DFGByteCodeParser.cpp:
  332. (JSC::DFG::ByteCodeParser::handleIntrinsic):
  333. * dfg/DFGStructureCheckHoistingPhase.cpp:
  334. (JSC::DFG::StructureCheckHoistingPhase::run):
  335. 2012-09-25 Geoffrey Garen <ggaren@apple.com>
  336. JSC should dump object size inference statistics
  337. https://bugs.webkit.org/show_bug.cgi?id=97618
  338. Reviewed by Filip Pizlo.
  339. Added an option to dump object size inference statistics.
  340. To see statistics on live objects:
  341. jsc --showHeapStatistics=1
  342. To see cumulative statistics on all objects ever allocated:
  343. jsc --showHeapStatistics=1 --objectsAreImmortal=1
  344. (This is useful for showing GC churn caused by over-allocation.)
  345. To support this second mode, I refactored Zombies to separate out their
  346. immortality feature so I could reuse it.
  347. * heap/Heap.cpp:
  348. (JSC::MarkObject): Helper for making things immortal. We have to checked
  349. for being zapped because blocks start out in this state.
  350. (JSC::StorageStatistics): Gather statistics by walking the heap. Ignore
  351. arrays and hash tables for now because they're not our focus. (We'll
  352. remove these exceptions in future.)
  353. (JSC::Heap::collect): Moved zombify to the end so it wouldn't interfere
  354. with statistics gathering.
  355. (JSC::Heap::showStatistics):
  356. (JSC::Heap::markAllObjects): Factored out helper, so statistics could
  357. take advantage of immortal objects.
  358. (Zombify): Don't mark immortal objects -- that's another class's job now.
  359. (JSC::Zombify::operator()):
  360. (JSC::Heap::zombifyDeadObjects): Take advantage of forEachDeadCell instead
  361. of rolling our own.
  362. * heap/Heap.h:
  363. (Heap):
  364. * heap/MarkedSpace.h:
  365. (MarkedSpace):
  366. (JSC::MarkedSpace::forEachDeadCell): Added, so clients don't have to do
  367. the iteration logic themselves.
  368. * runtime/Options.cpp:
  369. (JSC::Options::initialize):
  370. * runtime/Options.h: New options, listed above. Make sure to initialize
  371. based on environment variable first, so we can override with specific settings.
  372. 2012-09-25 Filip Pizlo <fpizlo@apple.com>
  373. We shouldn't use the optimized versions of shift/unshift if the user is doing crazy things to the array
  374. https://bugs.webkit.org/show_bug.cgi?id=97603
  375. <rdar://problem/12370864>
  376. Reviewed by Gavin Barraclough.
  377. You changed the length behind our backs? No optimizations for you then!
  378. * runtime/ArrayPrototype.cpp:
  379. (JSC::shift):
  380. (JSC::unshift):
  381. * runtime/JSArray.cpp:
  382. (JSC::JSArray::shiftCount):
  383. 2012-09-25 Filip Pizlo <fpizlo@apple.com>
  384. JSC bindings appear to sometimes ignore the possibility of arrays being in sparse mode
  385. https://bugs.webkit.org/show_bug.cgi?id=95610
  386. Reviewed by Oliver Hunt.
  387. Add better support for quickly accessing the indexed storage from bindings.
  388. * runtime/JSObject.h:
  389. (JSC::JSObject::tryGetIndexQuickly):
  390. (JSObject):
  391. (JSC::JSObject::getDirectIndex):
  392. (JSC::JSObject::getIndex):
  393. 2012-09-25 Filip Pizlo <fpizlo@apple.com>
  394. Structure check hoisting phase doesn't know about the side-effecting nature of Arrayify
  395. https://bugs.webkit.org/show_bug.cgi?id=97537
  396. Reviewed by Mark Hahnenberg.
  397. No tests because if we use Arrayify then we also use PutByVal(BlankToXYZ), and the latter is
  398. already known to be side-effecting. So this bug shouldn't have had any symptoms, as far as I
  399. can tell.
  400. * dfg/DFGStructureCheckHoistingPhase.cpp:
  401. (JSC::DFG::StructureCheckHoistingPhase::run):
  402. 2012-09-25 Gavin Barraclough <barraclough@apple.com>
  403. Regression: put beyond vector length prefers prototype setters to sparse properties
  404. https://bugs.webkit.org/show_bug.cgi?id=97593
  405. Reviewed by Geoff Garen & Filip Pizlo.
  406. * runtime/JSObject.cpp:
  407. (JSC::JSObject::putByIndexBeyondVectorLength):
  408. - Check for self properties in the sparse map - if present, don't examine the protochain.
  409. 2012-09-24 Gavin Barraclough <barraclough@apple.com>
  410. https://bugs.webkit.org/show_bug.cgi?id=97530
  411. Regression, freeze applied to numeric properties of non-array objects
  412. Reviewed by Filip Pizlo.
  413. Object.freeze has a fast implementation in JSObject, but this hasn't been updated to take into account numeric properties in butterflies.
  414. For now, just fall back to the generic implementation if the object has numeric properties.
  415. * runtime/ObjectConstructor.cpp:
  416. (JSC::objectConstructorFreeze):
  417. - fallback if the object has a non-zero indexed property vector length.
  418. 2012-09-24 Gavin Barraclough <barraclough@apple.com>
  419. Bug in numeric accessors on global environment
  420. https://bugs.webkit.org/show_bug.cgi?id=97526
  421. Reviewed by Geoff Garen.
  422. I've hit this assert in test262 in browser, but haven't yet worked out how to repro in a test case :-/
  423. The sparsemap is failing to map back from the global object to the window shell.
  424. A test case would need to resolve a numeric property name against the global environment.
  425. (JSC::SparseArrayEntry::get):
  426. (JSC::SparseArrayEntry::put):
  427. - Add missing toThisObject calls.
  428. 2012-09-24 Filip Pizlo <fpizlo@apple.com>
  429. SerializedScriptValue isn't aware of indexed storage, but should be
  430. https://bugs.webkit.org/show_bug.cgi?id=97515
  431. <rdar://problem/12361874>
  432. Reviewed by Sam Weinig.
  433. Export a method that WebCore now uses.
  434. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  435. * runtime/JSObject.h:
  436. (JSObject):
  437. 2012-09-24 Gavin Barraclough <barraclough@apple.com>
  438. Remove JSObject::unwrappedGlobalObject(), JSObject::unwrappedObject()
  439. https://bugs.webkit.org/show_bug.cgi?id=97519
  440. Reviewed by Geoff Garen.
  441. unwrappedGlobalObject() was only needed because globalObject() doesn't always return a helpful result -
  442. specifically for WebCore's window shell the structure's globalObject is set to null. We can fix this by
  443. simply keeping the structure up to date as the window navigates, obviating the need for this function.
  444. The only other use of unwrappedObject() came from globalFuncEval(), and this can be trivially removed
  445. by flipping the way we perform this globalObject check (which we may also be able to remove!) - instead
  446. of getting the globalObject from the provided this value & comparing to the expected globalObject, we
  447. can get the this value from the expected globalObject, and compare to that provided.
  448. * runtime/JSGlobalObject.cpp:
  449. - Call globalObject() instead of unwrappedGlobalObject().
  450. * runtime/JSGlobalObjectFunctions.cpp:
  451. (JSC::globalFuncEval):
  452. - Changed to compare this object values, instead of globalObjects -
  453. this means we only need to be able to map globalObject -> this,
  454. and not vice versa.
  455. * runtime/JSObject.cpp:
  456. (JSC::JSObject::allowsAccessFrom):
  457. (JSC::JSObject::createInheritorID):
  458. - Call globalObject() instead of unwrappedGlobalObject().
  459. * runtime/JSObject.h:
  460. (JSObject):
  461. - Removed unwrappedGlobalObject(), unwrappedObject().
  462. 2012-09-24 Mark Lam <mark.lam@apple.com>
  463. Deleting the classic interpreter and cleaning up some build options.
  464. https://bugs.webkit.org/show_bug.cgi?id=96969.
  465. Reviewed by Geoffrey Garen.
  466. * bytecode/CodeBlock.cpp:
  467. (JSC::CodeBlock::dump):
  468. (JSC::CodeBlock::finalizeUnconditionally):
  469. (JSC::CodeBlock::stronglyVisitStrongReferences):
  470. (JSC):
  471. * bytecode/Instruction.h:
  472. (JSC::Instruction::Instruction):
  473. * interpreter/AbstractPC.cpp:
  474. (JSC::AbstractPC::AbstractPC):
  475. * interpreter/AbstractPC.h:
  476. (AbstractPC):
  477. * interpreter/CallFrame.h:
  478. (ExecState):
  479. * interpreter/Interpreter.cpp:
  480. (JSC):
  481. (JSC::Interpreter::Interpreter):
  482. (JSC::Interpreter::~Interpreter):
  483. (JSC::Interpreter::initialize):
  484. (JSC::Interpreter::isOpcode):
  485. (JSC::Interpreter::unwindCallFrame):
  486. (JSC::getLineNumberForCallFrame):
  487. (JSC::getCallerInfo):
  488. (JSC::getSourceURLFromCallFrame):
  489. (JSC::Interpreter::execute):
  490. (JSC::Interpreter::executeCall):
  491. (JSC::Interpreter::executeConstruct):
  492. (JSC::Interpreter::retrieveArgumentsFromVMCode):
  493. (JSC::Interpreter::retrieveCallerFromVMCode):
  494. (JSC::Interpreter::retrieveLastCaller):
  495. * interpreter/Interpreter.h:
  496. (JSC::Interpreter::getOpcodeID):
  497. (Interpreter):
  498. * jit/ExecutableAllocatorFixedVMPool.cpp:
  499. (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
  500. * offlineasm/asm.rb:
  501. * offlineasm/offsets.rb:
  502. * runtime/Executable.cpp:
  503. (JSC::EvalExecutable::compileInternal):
  504. (JSC::ProgramExecutable::compileInternal):
  505. (JSC::FunctionExecutable::compileForCallInternal):
  506. (JSC::FunctionExecutable::compileForConstructInternal):
  507. * runtime/Executable.h:
  508. (JSC::NativeExecutable::create):
  509. (NativeExecutable):
  510. (JSC::NativeExecutable::finishCreation):
  511. * runtime/JSGlobalData.cpp:
  512. (JSC):
  513. (JSC::JSGlobalData::JSGlobalData):
  514. (JSC::JSGlobalData::getHostFunction):
  515. * runtime/JSGlobalData.h:
  516. (JSGlobalData):
  517. (JSC::JSGlobalData::canUseJIT):
  518. (JSC::JSGlobalData::canUseRegExpJIT):
  519. * runtime/Options.cpp:
  520. (JSC::Options::initialize):
  521. 2012-09-24 Filip Pizlo <fpizlo@apple.com>
  522. Nested try/finally should not confuse the finally unpopper in BytecodeGenerator::emitComplexJumpScopes
  523. https://bugs.webkit.org/show_bug.cgi?id=97508
  524. <rdar://problem/12361132>
  525. Reviewed by Sam Weinig.
  526. We're reusing some vector for multiple iterations of a loop, but we were forgetting to clear its
  527. contents from one iteration to the next. Hence if you did multiple iterations of finally unpopping
  528. (like in a nested try/finally and a jump out of both of them) then you'd get a corrupted try
  529. context stack afterwards.
  530. * bytecompiler/BytecodeGenerator.cpp:
  531. (JSC::BytecodeGenerator::emitComplexJumpScopes):
  532. 2012-09-24 Filip Pizlo <fpizlo@apple.com>
  533. ValueToInt32 bool case does bad things to registers
  534. https://bugs.webkit.org/show_bug.cgi?id=97505
  535. <rdar://problem/12356331>
  536. Reviewed by Mark Hahnenberg.
  537. * dfg/DFGSpeculativeJIT.cpp:
  538. (JSC::DFG::SpeculativeJIT::compileValueToInt32):
  539. 2012-09-24 Mark Lam <mark.lam@apple.com>
  540. Add cloopDo instruction for debugging the llint C++ backend.
  541. https://bugs.webkit.org/show_bug.cgi?id=97502.
  542. Reviewed by Geoffrey Garen.
  543. * offlineasm/cloop.rb:
  544. * offlineasm/instructions.rb:
  545. * offlineasm/parser.rb:
  546. 2012-09-24 Filip Pizlo <fpizlo@apple.com>
  547. JSArray::putByIndex asserts with readonly property on prototype
  548. https://bugs.webkit.org/show_bug.cgi?id=97435
  549. <rdar://problem/12357084>
  550. Reviewed by Geoffrey Garen.
  551. Boy, there were some problems:
  552. - putDirectIndex() should know that it can set the index quickly even if it's a hole and we're
  553. in SlowPut mode, since that's the whole point of PutDirect.
  554. - We should have a fast path for putByIndex().
  555. - The LiteralParser should not use push(), since that may throw if we're having a bad time.
  556. * interpreter/Interpreter.cpp:
  557. (JSC::eval):
  558. * runtime/JSObject.h:
  559. (JSC::JSObject::putByIndexInline):
  560. (JSObject):
  561. (JSC::JSObject::putDirectIndex):
  562. * runtime/LiteralParser.cpp:
  563. (JSC::::parse):
  564. 2012-09-24 Mark Lam <mark.lam@apple.com>
  565. Added a missing "if VALUE_PROFILER" around an access to ArrayProfile record.
  566. https://bugs.webkit.org/show_bug.cgi?id=97496.
  567. Reviewed by Filip Pizlo.
  568. * llint/LowLevelInterpreter32_64.asm:
  569. * llint/LowLevelInterpreter64.asm:
  570. 2012-09-24 Geoffrey Garen <ggaren@apple.com>
  571. Inlined activation tear-off in the DFG
  572. https://bugs.webkit.org/show_bug.cgi?id=97487
  573. Reviewed by Filip Pizlo.
  574. * dfg/DFGOperations.cpp:
  575. * dfg/DFGOperations.h: Activation tear-off is always inlined now, so I
  576. removed its out-of-line implementation.
  577. * dfg/DFGSpeculativeJIT32_64.cpp:
  578. (JSC::DFG::SpeculativeJIT::compile):
  579. * dfg/DFGSpeculativeJIT64.cpp:
  580. (JSC::DFG::SpeculativeJIT::compile): Inlined the variable copy and update
  581. of JSVariableObject::m_registers. This usually turns into < 10 instructions,
  582. which is close to pure win as compared to the operation function call.
  583. * runtime/JSActivation.h:
  584. (JSActivation):
  585. (JSC::JSActivation::registersOffset):
  586. (JSC::JSActivation::tearOff):
  587. (JSC::JSActivation::isTornOff):
  588. (JSC):
  589. (JSC::JSActivation::storageOffset):
  590. (JSC::JSActivation::storage): Tiny bit of refactoring so the JIT can
  591. share the pointer math helper functions we use internally.
  592. 2012-09-24 Balazs Kilvady <kilvadyb@homejinni.com>
  593. MIPS: store8 functions added to MacroAssembler.
  594. MIPS store8 functions
  595. https://bugs.webkit.org/show_bug.cgi?id=97243
  596. Reviewed by Oliver Hunt.
  597. Add MIPS store8 functions.
  598. * assembler/MIPSAssembler.h:
  599. (JSC::MIPSAssembler::lhu): New function.
  600. (MIPSAssembler):
  601. (JSC::MIPSAssembler::sb): New function.
  602. (JSC::MIPSAssembler::sh): New function.
  603. * assembler/MacroAssemblerMIPS.h:
  604. (JSC::MacroAssemblerMIPS::store8): New function.
  605. (MacroAssemblerMIPS):
  606. (JSC::MacroAssemblerMIPS::store16): New function.
  607. 2012-09-23 Geoffrey Garen <ggaren@apple.com>
  608. PutScopedVar should not be marked as clobbering the world
  609. https://bugs.webkit.org/show_bug.cgi?id=97416
  610. Reviewed by Filip Pizlo.
  611. No performance change.
  612. PutScopedVar doesn't have arbitrary side-effects, so it shouldn't be marked
  613. as such.
  614. * dfg/DFGNodeType.h:
  615. (DFG):
  616. 2012-09-23 Geoffrey Garen <ggaren@apple.com>
  617. I accidentally the whole 32-bit :(.
  618. Unbreak the DFG in 32-bit with the 32-bit path I forgot in my last patch.
  619. * dfg/DFGSpeculativeJIT32_64.cpp:
  620. (JSC::DFG::SpeculativeJIT::compile):
  621. 2012-09-23 Byungwoo Lee <bw80.lee@gmail.com>
  622. Fix build warnings : -Wunused-parameter, -Wparentheses, -Wuninitialized.
  623. https://bugs.webkit.org/show_bug.cgi?id=97306
  624. Reviewed by Benjamin Poulain.
  625. Fix build warning about -Wunused-parameter on MachineStackMarker.cpp,
  626. LLIntSlowPaths.cpp, DatePrototype.cpp, Options.cpp by using
  627. UNUSED_PARAM() macro or remove parameter name.
  628. * heap/MachineStackMarker.cpp:
  629. (JSC::pthreadSignalHandlerSuspendResume):
  630. * llint/LLIntSlowPaths.cpp:
  631. (JSC::LLInt::entryOSR):
  632. * runtime/DatePrototype.cpp:
  633. (JSC::formatLocaleDate):
  634. * runtime/Options.cpp:
  635. (JSC::computeNumberOfGCMarkers):
  636. 2012-09-23 Gavin Barraclough <barraclough@apple.com>
  637. Sorting a non-array creates propreties (spec-violation)
  638. https://bugs.webkit.org/show_bug.cgi?id=25477
  639. Reviewed by Oliver Hunt.
  640. We're just calling get() to get properties, which is converting missing properties to
  641. undefined. Hole values should be retained, and moved to the end of the array.
  642. * runtime/ArrayPrototype.cpp:
  643. (JSC::getOrHole):
  644. - Helper function, returns JSValue() instead of undefined for missing properties.
  645. (JSC::arrayProtoFuncSort):
  646. - Implemented per 15.4.4.11, see comments above.
  647. 2012-09-23 Geoffrey Garen <ggaren@apple.com>
  648. CSE for access to closure variables (get_/put_scoped_var)
  649. https://bugs.webkit.org/show_bug.cgi?id=97414
  650. Reviewed by Oliver Hunt.
  651. I separated loading a scope from loading its storage pointer, so we can
  652. CSE the storage pointer load. Then, I copied the global var CSE and adjusted
  653. it for closure vars.
  654. * dfg/DFGAbstractState.cpp:
  655. (JSC::DFG::AbstractState::execute): Renamed GetScopeChain => GetScope to
  656. reflect renames from a few weeks ago.
  657. Added a case for the storage pointer load, similar to object storage pointer load.
  658. * dfg/DFGByteCodeParser.cpp:
  659. (JSC::DFG::ByteCodeParser::parseBlock): Added an independent node for
  660. the storage pointer.
  661. * dfg/DFGCSEPhase.cpp:
  662. (JSC::DFG::CSEPhase::scopedVarLoadElimination):
  663. (CSEPhase):
  664. (JSC::DFG::CSEPhase::scopedVarStoreElimination):
  665. (JSC::DFG::CSEPhase::getScopeLoadElimination):
  666. (JSC::DFG::CSEPhase::getScopeRegistersLoadElimination):
  667. (JSC::DFG::CSEPhase::setLocalStoreElimination):
  668. (JSC::DFG::CSEPhase::performNodeCSE): Copied globalVarLoad/StoreElimination
  669. and adapted the same logic to closure vars.
  670. * dfg/DFGNode.h:
  671. (JSC::DFG::Node::hasScopeChainDepth):
  672. (JSC::DFG::Node::scope):
  673. (Node):
  674. * dfg/DFGNodeType.h:
  675. (DFG): GetScopedVar and GetGlobalVar are no longer MustGenerate. I'm not
  676. sure why they ever were. But these are simple load operations so, if they're
  677. unused, they're truly dead.
  678. * dfg/DFGPredictionPropagationPhase.cpp:
  679. (JSC::DFG::PredictionPropagationPhase::propagate):
  680. * dfg/DFGSpeculativeJIT32_64.cpp:
  681. (JSC::DFG::SpeculativeJIT::compile):
  682. * dfg/DFGSpeculativeJIT64.cpp:
  683. (JSC::DFG::SpeculativeJIT::compile): Updated for renames and split-out
  684. node for getting the storage pointer.
  685. 2012-09-21 Geoffrey Garen <ggaren@apple.com>
  686. Unreviewed, rolled out a line I committed by accident.
  687. * interpreter/Interpreter.cpp:
  688. (JSC::Interpreter::execute):
  689. 2012-09-21 Geoffrey Garen <ggaren@apple.com>
  690. Optimized closures that capture arguments
  691. https://bugs.webkit.org/show_bug.cgi?id=97358
  692. Reviewed by Oliver Hunt.
  693. Previously, the activation object was responsible for capturing all
  694. arguments in a way that was convenient for the arguments object. Now,
  695. we move all captured variables into a contiguous region in the stack,
  696. allocate an activation for exactly that size, and make the arguments
  697. object responsible for knowing all the places to which arguments could
  698. have moved.
  699. This seems like the right tradeoff because
  700. (a) Closures are common and long-lived, so we want them to be small.
  701. (b) Our primary strategy for optimizing the arguments object is to make
  702. it go away. If you're allocating arguments objects, you're already having
  703. a bad time.
  704. (c) It's common to use either the arguments object or named argument
  705. closure, but not both.
  706. * bytecode/CodeBlock.cpp:
  707. (JSC::CodeBlock::dump):
  708. (JSC::CodeBlock::CodeBlock):
  709. * bytecode/CodeBlock.h:
  710. (JSC::CodeBlock::argumentsRegister):
  711. (JSC::CodeBlock::activationRegister):
  712. (JSC::CodeBlock::isCaptured):
  713. (JSC::CodeBlock::argumentIndexAfterCapture): m_numCapturedVars is gone
  714. now -- we have an explicit range instead.
  715. * bytecompiler/BytecodeGenerator.cpp:
  716. (JSC::BytecodeGenerator::BytecodeGenerator): Move captured arguments
  717. into the captured region of local variables for space efficiency. Record
  718. precise data about where they moved for the sake of the arguments object.
  719. Some of this data was previously wrong, but it didn't cause any problems
  720. because the arguments weren't actually moving.
  721. * dfg/DFGByteCodeParser.cpp:
  722. (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables): Don't
  723. assume that captured vars are in any particular location -- always ask
  724. the CodeBlock. This is better encapsulation.
  725. (JSC::DFG::ByteCodeParser::parseCodeBlock):
  726. * dfg/DFGSpeculativeJIT32_64.cpp:
  727. (JSC::DFG::SpeculativeJIT::compile):
  728. * dfg/DFGSpeculativeJIT64.cpp:
  729. (JSC::DFG::SpeculativeJIT::compile): I rename things sometimes.
  730. * runtime/Arguments.cpp:
  731. (JSC::Arguments::tearOff): Account for a particularly nasty edge case.
  732. (JSC::Arguments::didTearOffActivation): Don't allocate our slow arguments
  733. data on tear-off. We need to allocate it eagerly instead, since we need
  734. to know about displaced, captured arguments during access before tear-off.
  735. * runtime/Arguments.h:
  736. (JSC::Arguments::allocateSlowArguments):
  737. (JSC::Arguments::argument): Tell our slow arguments array where all arguments
  738. are, even if they are not captured. This simplifies some things, so we don't
  739. have to account explicitly for the full matrix of (not torn off, torn off)
  740. * (captured, not captured).
  741. (JSC::Arguments::finishCreation): Allocate our slow arguments array eagerly
  742. because we need to know about displaced, captured arguments during access
  743. before tear-off.
  744. * runtime/Executable.cpp:
  745. (JSC::FunctionExecutable::FunctionExecutable):
  746. (JSC::FunctionExecutable::compileForCallInternal):
  747. (JSC::FunctionExecutable::compileForConstructInternal):
  748. * runtime/Executable.h:
  749. (JSC::FunctionExecutable::parameterCount):
  750. (FunctionExecutable):
  751. * runtime/JSActivation.cpp:
  752. (JSC::JSActivation::visitChildren):
  753. * runtime/JSActivation.h:
  754. (JSActivation):
  755. (JSC::JSActivation::create):
  756. (JSC::JSActivation::JSActivation):
  757. (JSC::JSActivation::registerOffset):
  758. (JSC::JSActivation::tearOff):
  759. (JSC::JSActivation::allocationSize):
  760. (JSC::JSActivation::isValid): This is really the point of the patch. All
  761. the pointer math in Activations basically boils away, since we always
  762. copy a contiguous region of captured variables now.
  763. * runtime/SymbolTable.h:
  764. (JSC::SlowArgument::SlowArgument):
  765. (SlowArgument):
  766. (SharedSymbolTable):
  767. (JSC::SharedSymbolTable::captureCount):
  768. (JSC::SharedSymbolTable::SharedSymbolTable): AllOfTheThings capture mode
  769. is gone now -- that's the point of the patch. indexIfCaptured gets renamed
  770. to index because we always have an index, even if not captured. (The only
  771. time when the index is meaningless is when we're Deleted.)
  772. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  773. Eeeep - broke early boyer in bug#97382
  774. https://bugs.webkit.org/show_bug.cgi?id=97383
  775. Rubber stamped by Sam Weinig.
  776. missed a child3 -> child2!
  777. * dfg/DFGSpeculativeJIT.cpp:
  778. (JSC::DFG::SpeculativeJIT::compileInstanceOf):
  779. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  780. Unreviewed windows build fix.
  781. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  782. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  783. Pedantic test in Mozilla's JavaScript test suite fails. function-001.js function-001-n.js
  784. https://bugs.webkit.org/show_bug.cgi?id=27219
  785. Reviewed by Sam Weinig.
  786. These tests are just wrong.
  787. See ECMA 262 A.5, FunctionDelcaration does not require a semicolon.
  788. * tests/mozilla/expected.html:
  789. * tests/mozilla/js1_2/function/function-001-n.js:
  790. * tests/mozilla/js1_3/Script/function-001-n.js:
  791. * tests/mozilla/js1_3/regress/function-001-n.js:
  792. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  793. Remove redundant argument to op_instanceof
  794. https://bugs.webkit.org/show_bug.cgi?id=97382
  795. Reviewed by Geoff Garen.
  796. No longer needed after my last change.
  797. * bytecode/CodeBlock.cpp:
  798. (JSC::CodeBlock::dump):
  799. * bytecode/Opcode.h:
  800. (JSC):
  801. (JSC::padOpcodeName):
  802. * bytecompiler/BytecodeGenerator.cpp:
  803. (JSC::BytecodeGenerator::emitInstanceOf):
  804. * bytecompiler/BytecodeGenerator.h:
  805. (BytecodeGenerator):
  806. * bytecompiler/NodesCodegen.cpp:
  807. (JSC::InstanceOfNode::emitBytecode):
  808. * dfg/DFGAbstractState.cpp:
  809. (JSC::DFG::AbstractState::execute):
  810. * dfg/DFGByteCodeParser.cpp:
  811. (JSC::DFG::ByteCodeParser::parseBlock):
  812. * dfg/DFGSpeculativeJIT.cpp:
  813. (JSC::DFG::SpeculativeJIT::compileInstanceOf):
  814. * interpreter/Interpreter.cpp:
  815. (JSC::Interpreter::privateExecute):
  816. * jit/JITOpcodes.cpp:
  817. (JSC::JIT::emit_op_instanceof):
  818. (JSC::JIT::emitSlow_op_instanceof):
  819. * jit/JITOpcodes32_64.cpp:
  820. (JSC::JIT::emit_op_instanceof):
  821. (JSC::JIT::emitSlow_op_instanceof):
  822. * jit/JITStubs.cpp:
  823. (JSC::DEFINE_STUB_FUNCTION):
  824. * llint/LLIntSlowPaths.cpp:
  825. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  826. * llint/LowLevelInterpreter32_64.asm:
  827. * llint/LowLevelInterpreter64.asm:
  828. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  829. Unreviewed windows build fix.
  830. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  831. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  832. instanceof should not get the prototype for non-default HasInstance
  833. https://bugs.webkit.org/show_bug.cgi?id=68656
  834. Reviewed by Oliver Hunt.
  835. Instanceof is currently implemented as a sequance of three opcodes:
  836. check_has_instance
  837. get_by_id(prototype)
  838. op_instanceof
  839. There are three interesting types of base value that instanceof can be applied to:
  840. (A) Objects supporting default instanceof behaviour (functions, other than those created with bind)
  841. (B) Objects overriding the default instancecof behaviour with a custom one (API objects, bound functions)
  842. (C) Values that do not respond to the [[HasInstance]] trap.
  843. Currently check_has_instance handles case (C), leaving the op_instanceof opcode to handle (A) & (B). There are
  844. two problems with this apporach. Firstly, this is suboptimal for case (A), since we have to check for
  845. hasInstance support twice (once in check_has_instance, then for default behaviour in op_instanceof). Secondly,
  846. this means that in cases (B) we also perform the get_by_id, which is both suboptimal and an observable spec
  847. violation.
  848. The fix here is to move handing of non-default instanceof (cases (B)) to the check_has_instance op, leaving
  849. op_instanceof to handle only cases (A).
  850. * API/JSCallbackObject.h:
  851. (JSCallbackObject):
  852. * API/JSCallbackObjectFunctions.h:
  853. (JSC::::customHasInstance):
  854. * API/JSValueRef.cpp:
  855. (JSValueIsInstanceOfConstructor):
  856. - renamed hasInstance to customHasInstance
  857. * bytecode/CodeBlock.cpp:
  858. (JSC::CodeBlock::dump):
  859. - added additional parameters to check_has_instance opcode
  860. * bytecode/Opcode.h:
  861. (JSC):
  862. (JSC::padOpcodeName):
  863. - added additional parameters to check_has_instance opcode
  864. * bytecompiler/BytecodeGenerator.cpp:
  865. (JSC::BytecodeGenerator::emitCheckHasInstance):
  866. - added additional parameters to check_has_instance opcode
  867. * bytecompiler/BytecodeGenerator.h:
  868. (BytecodeGenerator):
  869. - added additional parameters to check_has_instance opcode
  870. * bytecompiler/NodesCodegen.cpp:
  871. (JSC::InstanceOfNode::emitBytecode):
  872. - added additional parameters to check_has_instance opcode
  873. * dfg/DFGByteCodeParser.cpp:
  874. (JSC::DFG::ByteCodeParser::parseBlock):
  875. - added additional parameters to check_has_instance opcode
  876. * interpreter/Interpreter.cpp:
  877. (JSC::isInvalidParamForIn):
  878. (JSC::Interpreter::privateExecute):
  879. - Add handling for non-default instanceof to op_check_has_instance
  880. * jit/JITInlineMethods.h:
  881. (JSC::JIT::emitArrayProfilingSiteForBytecodeIndex):
  882. - Fixed no-LLInt no_DFG build
  883. * jit/JITOpcodes.cpp:
  884. (JSC::JIT::emit_op_check_has_instance):
  885. (JSC::JIT::emitSlow_op_check_has_instance):
  886. - check for ImplementsDefaultHasInstance, handle additional arguments to op_check_has_instance.
  887. (JSC::JIT::emit_op_instanceof):
  888. (JSC::JIT::emitSlow_op_instanceof):
  889. - no need to check for ImplementsDefaultHasInstance.
  890. * jit/JITOpcodes32_64.cpp:
  891. (JSC::JIT::emit_op_check_has_instance):
  892. (JSC::JIT::emitSlow_op_check_has_instance):
  893. - check for ImplementsDefaultHasInstance, handle additional arguments to op_check_has_instance.
  894. (JSC::JIT::emit_op_instanceof):
  895. (JSC::JIT::emitSlow_op_instanceof):
  896. - no need to check for ImplementsDefaultHasInstance.
  897. * jit/JITStubs.cpp:
  898. (JSC::DEFINE_STUB_FUNCTION):
  899. * jit/JITStubs.h:
  900. - Add handling for non-default instanceof to op_check_has_instance
  901. * llint/LLIntSlowPaths.cpp:
  902. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  903. * llint/LowLevelInterpreter32_64.asm:
  904. * llint/LowLevelInterpreter64.asm:
  905. - move check for ImplementsDefaultHasInstance, handle additional arguments to op_check_has_instance.
  906. * runtime/ClassInfo.h:
  907. (MethodTable):
  908. (JSC):
  909. - renamed hasInstance to customHasInstance
  910. * runtime/CommonSlowPaths.h:
  911. (CommonSlowPaths):
  912. - removed opInstanceOfSlow (this was whittled down to one function call!)
  913. * runtime/JSBoundFunction.cpp:
  914. (JSC::JSBoundFunction::customHasInstance):
  915. * runtime/JSBoundFunction.h:
  916. (JSBoundFunction):
  917. - renamed hasInstance to customHasInstance, reimplemented.
  918. * runtime/JSCell.cpp:
  919. (JSC::JSCell::customHasInstance):
  920. * runtime/JSCell.h:
  921. (JSCell):
  922. * runtime/JSObject.cpp:
  923. (JSC::JSObject::hasInstance):
  924. (JSC):
  925. (JSC::JSObject::defaultHasInstance):
  926. * runtime/JSObject.h:
  927. (JSObject):
  928. 2012-09-21 Filip Pizlo <fpizlo@apple.com>
  929. Unreviewed, fix ARM build.
  930. * assembler/MacroAssemblerARMv7.h:
  931. (JSC::MacroAssemblerARMv7::store8):
  932. (MacroAssemblerARMv7):
  933. * offlineasm/armv7.rb:
  934. 2012-09-21 Filip Pizlo <fpizlo@apple.com>
  935. REGRESSION (r128400): Opening Google Web Fonts page hangs or crashes
  936. https://bugs.webkit.org/show_bug.cgi?id=97328
  937. Reviewed by Mark Hahnenberg.
  938. It's a bad idea to emit stub code that reallocates property storage when we're in indexed
  939. storage mode. DFGRepatch.cpp knew this and had the appropriate check in one of the places,
  940. but it didn't have it in all of the places.
  941. This change also adds some more handy disassembly support, which I used to find the bug.
  942. * assembler/LinkBuffer.h:
  943. (JSC):
  944. * dfg/DFGRepatch.cpp:
  945. (JSC::DFG::generateProtoChainAccessStub):
  946. (JSC::DFG::tryCacheGetByID):
  947. (JSC::DFG::tryBuildGetByIDList):
  948. (JSC::DFG::emitPutReplaceStub):
  949. (JSC::DFG::emitPutTransitionStub):
  950. (JSC::DFG::tryCachePutByID):
  951. * jit/JITStubRoutine.h:
  952. (JSC):
  953. 2012-09-21 Filip Pizlo <fpizlo@apple.com>
  954. DFG CSE assumes that a holy PutByVal does not interfere with GetArrayLength, when it clearly does
  955. https://bugs.webkit.org/show_bug.cgi?id=97373
  956. Reviewed by Mark Hahnenberg.
  957. * dfg/DFGCSEPhase.cpp:
  958. (JSC::DFG::CSEPhase::pureCSE):
  959. (JSC::DFG::CSEPhase::getArrayLengthElimination):
  960. (JSC::DFG::CSEPhase::putStructureStoreElimination):
  961. (JSC::DFG::CSEPhase::performNodeCSE):
  962. * dfg/DFGGraph.h:
  963. (Graph):
  964. 2012-09-21 Chris Rogers <crogers@google.com>
  965. Add Web Audio support for deprecated/legacy APIs
  966. https://bugs.webkit.org/show_bug.cgi?id=97050
  967. Reviewed by Eric Carlson.
  968. * Configurations/FeatureDefines.xcconfig:
  969. 2012-09-21 Gavin Barraclough <barraclough@apple.com>
  970. Global Math object should be configurable but isn't
  971. https://bugs.webkit.org/show_bug.cgi?id=55343
  972. Reviewed by Oliver Hunt.
  973. This has no performance impact.
  974. * runtime/JSGlobalObject.cpp:
  975. (JSC::JSGlobalObject::reset):
  976. - Make 'Math' a regular property.
  977. 2012-09-21 Chao-ying Fu <fu@mips.com>
  978. Add MIPS or32 function
  979. https://bugs.webkit.org/show_bug.cgi?id=97157
  980. Reviewed by Gavin Barraclough.
  981. Add a missing or32 function.
  982. * assembler/MacroAssemblerMIPS.h:
  983. (JSC::MacroAssemblerMIPS::or32): New function.
  984. (MacroAssemblerMIPS):
  985. 2012-09-20 Filip Pizlo <fpizlo@apple.com>
  986. CHECK_ARRAY_CONSISTENCY isn't being used or tested, so we should remove it
  987. https://bugs.webkit.org/show_bug.cgi?id=97260
  988. Rubber stamped by Geoffrey Garen.
  989. Supporting it will become difficult as we add more indexing types. It makes more
  990. sense to kill, especially since we don't appear to use it or test it, ever.
  991. * runtime/ArrayConventions.h:
  992. (JSC):
  993. * runtime/ArrayPrototype.cpp:
  994. (JSC::arrayProtoFuncSplice):
  995. * runtime/ArrayStorage.h:
  996. (JSC::ArrayStorage::copyHeaderFromDuringGC):
  997. (ArrayStorage):
  998. * runtime/FunctionPrototype.cpp:
  999. (JSC::functionProtoFuncBind):
  1000. * runtime/JSArray.cpp:
  1001. (JSC::createArrayButterflyInDictionaryIndexingMode):
  1002. (JSC::JSArray::setLength):
  1003. (JSC::JSArray::pop):
  1004. (JSC::JSArray::push):
  1005. (JSC::JSArray::sortNumeric):
  1006. (JSC::JSArray::sort):
  1007. (JSC::JSArray::compactForSorting):
  1008. * runtime/JSArray.h:
  1009. (JSArray):
  1010. (JSC::createArrayButterfly):
  1011. (JSC::JSArray::tryCreateUninitialized):
  1012. (JSC::constructArray):
  1013. * runtime/JSObject.cpp:
  1014. (JSC::JSObject::putByIndex):
  1015. (JSC::JSObject::createArrayStorage):
  1016. (JSC::JSObject::deletePropertyByIndex):
  1017. (JSC):
  1018. * runtime/JSObject.h:
  1019. (JSC::JSObject::initializeIndex):
  1020. (JSObject):
  1021. 2012-09-20 Mark Lam <mark.lam@apple.com>
  1022. Fixed a missing semicolon in the C++ llint backend.
  1023. https://bugs.webkit.org/show_bug.cgi?id=97252.
  1024. Reviewed by Geoff Garen.
  1025. * offlineasm/cloop.rb:
  1026. 2012-09-20 Geoffrey Garen <ggaren@apple.com>
  1027. Refactored the interpreter and JIT so they don't dictate closure layout
  1028. https://bugs.webkit.org/show_bug.cgi?id=97221
  1029. Reviewed by Oliver Hunt.
  1030. Capture may change the location of an argument for space efficiency. This
  1031. patch removes static assumptions about argument location from the interpreter
  1032. and JIT.
  1033. * bytecode/CodeBlock.h:
  1034. (JSC::CodeBlock::argumentIndexAfterCapture):
  1035. (JSC::ExecState::argumentAfterCapture): Factored out a helper function
  1036. so the compiler could share this logic.
  1037. * bytecompiler/NodesCodegen.cpp:
  1038. (JSC::BracketAccessorNode::emitBytecode): Don't emit optimized bracket
  1039. access on arguments if a parameter has been captured by name. This case is
  1040. rare and, where I've seen it in the wild, the optimization mostly failed
  1041. anyway due to arguments escape, so I didn't feel like writing and testing
  1042. five copies of the code that would handle it in the baseline engines.
  1043. The DFG can still synthesize this optimization even if we don't emit the
  1044. optimized bytecode for it.
  1045. * dfg/DFGArgumentsSimplificationPhase.cpp:
  1046. (JSC::DFG::ArgumentsSimplificationPhase::run):
  1047. * dfg/DFGAssemblyHelpers.h:
  1048. (JSC::DFG::AssemblyHelpers::symbolTableFor):
  1049. (AssemblyHelpers): Use the right helper function to account for the fact
  1050. that a parameter may have been captured by name and moved.
  1051. * dfg/DFGByteCodeParser.cpp:
  1052. (JSC::DFG::ByteCodeParser::parseBlock): ASSERT that we haven't inlined
  1053. a .apply on captured arguments. Once we do start inlining such things,
  1054. we'll need to do a little bit of math here to get them right.
  1055. * dfg/DFGSpeculativeJIT32_64.cpp:
  1056. (JSC::DFG::SpeculativeJIT::compile):
  1057. * dfg/DFGSpeculativeJIT64.cpp:
  1058. (JSC::DFG::SpeculativeJIT::compile): Added support for bracket access on
  1059. an arguments object where arguments have also been captured by name. We
  1060. load the true index of the argument from a side vector. Arguments elision
  1061. is very powerful in the DFG, so I wanted to keep it working, even in this
  1062. rare case.
  1063. * interpreter/Interpreter.cpp:
  1064. (JSC::loadVarargs): Use the right helper function to account for the fact
  1065. that a parameter may have been captured by name and moved.
  1066. * jit/JITCall.cpp:
  1067. (JSC::JIT::compileLoadVarargs):
  1068. * jit/JITCall32_64.cpp:
  1069. (JSC::JIT::compileLoadVarargs): Don't use the inline copy loop if some
  1070. of our arguments have moved, since it would copy stale values. (We still
  1071. optimize the actual call, and elide the arguments object.)
  1072. 2012-09-20 Gabor Rapcsanyi <rgabor@webkit.org>
  1073. [Qt] r129045 broke the ARM build
  1074. https://bugs.webkit.org/show_bug.cgi?id=97195
  1075. Reviewed by Zoltan Herczeg.
  1076. Implementing missing store8 function.
  1077. * assembler/MacroAssemblerARM.h:
  1078. (JSC::MacroAssemblerARM::store8):
  1079. (MacroAssemblerARM):
  1080. 2012-09-19 Geoffrey Garen <ggaren@apple.com>
  1081. OSR exit sometimes neglects to create the arguments object
  1082. https://bugs.webkit.org/show_bug.cgi?id=97162
  1083. Reviewed by Filip Pizlo.
  1084. No performance change.
  1085. I don't know of any case where this is a real problem in TOT, but it
  1086. will become a problem if we start compiling eval, with, or catch, and/or
  1087. sometimes stop doing arguments optimizations in the bytecode.
  1088. * dfg/DFGArgumentsSimplificationPhase.cpp:
  1089. (JSC::DFG::ArgumentsSimplificationPhase::run): Account for a
  1090. CreateArguments that has transformed into PhantomArguments. We used to
  1091. clear our reference to the CreateArguments node, but now we hold onto it,
  1092. so we need to account for it transforming.
  1093. Don't replace a SetLocal(CreateArguments) with a SetLocal(JSValue())
  1094. because that doesn't leave enough information behind for OSR exit to do
  1095. the right thing. Instead, maintain our reference to CreateArguments, and
  1096. rely on CreateArguments transforming into PhantomArguments after
  1097. optimization. SetLocal(PhantomArguments) is efficient, and it's a marker
  1098. for OSR exit to create the arguments object.
  1099. Don't ASSERT that all PhantomArguments are unreferenced because we now
  1100. leave them in the graph as SetLocal(PhantomArguments), and that's harmless.
  1101. * dfg/DFGArgumentsSimplificationPhase.h:
  1102. (NullableHashTraits):
  1103. (JSC::DFG::NullableHashTraits::emptyValue): Export our special hash table
  1104. for inline call frames so the OSR exit compiler can use it.
  1105. * dfg/DFGOSRExitCompiler32_64.cpp:
  1106. (JSC::DFG::OSRExitCompiler::compileExit):
  1107. * dfg/DFGOSRExitCompiler64.cpp:
  1108. (JSC::DFG::OSRExitCompiler::compileExit): Don't load the 'arguments'
  1109. register to decide if we need to create the arguments object. Optimization
  1110. may have eliminated the initializing store to this register, in which
  1111. case we'll load garbage. Instead, use the global knowledge that all call
  1112. frames that optimized out 'arguments' now need to create it, and use a hash
  1113. table to make sure we do so only once per call frame.
  1114. * dfg/DFGSpeculativeJIT64.cpp:
  1115. (JSC::DFG::SpeculativeJIT::compile): SetLocal(PhantomArguments) is unique
  1116. because we haven't just changed a value's format or elided a load or store;
  1117. instead, we've replaced an object with JSValue(). We could try to account
  1118. for this in a general way, but for now it's a special-case optimization,
  1119. so we give it a specific OSR hint instead.
  1120. 2012-09-19 Filip Pizlo <fpizlo@apple.com>
  1121. REGRESSION(r128802): It made some JS tests crash
  1122. https://bugs.webkit.org/show_bug.cgi?id=97001
  1123. Reviewed by Mark Hahnenberg.
  1124. * runtime/JSGlobalObject.cpp:
  1125. (JSC::JSGlobalObject::visitChildren):
  1126. 2012-09-19 Filip Pizlo <fpizlo@apple.com>
  1127. DFG should not assume that a ByVal access is generic just because it was unprofiled
  1128. https://bugs.webkit.org/show_bug.cgi?id=97088
  1129. Reviewed by Geoffrey Garen.
  1130. We were not disambiguating between "Undecided" in the sense that the array profile
  1131. has no useful information versus "Undecided" in the sense that the array profile
  1132. knows that the access has not executed. That's an important distinction, since
  1133. the former form of "Undecided" means that we should consult value profiling, while
  1134. the latter means that we should force exit unless the value profiling indicates
  1135. that the access must be generic (base is not cell or property is not int).
  1136. * dfg/DFGAbstractState.cpp:
  1137. (JSC::DFG::AbstractState::execute):
  1138. * dfg/DFGArrayMode.cpp:
  1139. (JSC::DFG::fromObserved):
  1140. (JSC::DFG::refineArrayMode):
  1141. (JSC::DFG::modeAlreadyChecked):
  1142. (JSC::DFG::modeToString):
  1143. * dfg/DFGArrayMode.h:
  1144. (JSC::DFG::canCSEStorage):
  1145. (JSC::DFG::modeIsSpecific):
  1146. (JSC::DFG::modeSupportsLength):
  1147. (JSC::DFG::benefitsFromStructureCheck):
  1148. 2012-09-19 Filip Pizlo <fpizlo@apple.com>
  1149. DFG should not emit PutByVal hole case unless it has to
  1150. https://bugs.webkit.org/show_bug.cgi?id=97080
  1151. Reviewed by Geoffrey Garen.
  1152. This causes us to generate less code for typical PutByVal's. But if profiling tells us
  1153. that the hole case is being hit, we generate the same code as we would have generated
  1154. before. This seems like a slight speed-up across the board.
  1155. * assembler/MacroAssemblerARMv7.h:
  1156. (JSC::MacroAssemblerARMv7::store8):
  1157. (MacroAssemblerARMv7):
  1158. * assembler/MacroAssemblerX86.h:
  1159. (MacroAssemblerX86):
  1160. (JSC::MacroAssemblerX86::store8):
  1161. * assembler/MacroAssemblerX86_64.h:
  1162. (MacroAssemblerX86_64):
  1163. (JSC::MacroAssemblerX86_64::store8):
  1164. * assembler/X86Assembler.h:
  1165. (X86Assembler):
  1166. (JSC::X86Assembler::movb_i8m):
  1167. * bytecode/ArrayProfile.h:
  1168. (JSC::ArrayProfile::ArrayProfile):
  1169. (JSC::ArrayProfile::addressOfMayStoreToHole):
  1170. (JSC::ArrayProfile::mayStoreToHole):
  1171. (ArrayProfile):
  1172. * dfg/DFGArrayMode.cpp:
  1173. (JSC::DFG::fromObserved):
  1174. (JSC::DFG::modeAlreadyChecked):
  1175. (JSC::DFG::modeToString):
  1176. * dfg/DFGArrayMode.h:
  1177. (DFG):
  1178. (JSC::DFG::mayStoreToHole):
  1179. * dfg/DFGSpeculativeJIT32_64.cpp:
  1180. (JSC::DFG::SpeculativeJIT::compile):
  1181. * dfg/DFGSpeculativeJIT64.cpp:
  1182. (JSC::DFG::SpeculativeJIT::compile):
  1183. * jit/JIT.h:
  1184. (JIT):
  1185. * jit/JITInlineMethods.h:
  1186. (JSC::JIT::emitArrayProfileStoreToHoleSpecialCase):
  1187. (JSC):
  1188. * jit/JITPropertyAccess.cpp:
  1189. (JSC::JIT::emit_op_put_by_val):
  1190. * jit/JITPropertyAccess32_64.cpp:
  1191. (JSC::JIT::emit_op_put_by_val):
  1192. * llint/LowLevelInterpreter32_64.asm:
  1193. * llint/LowLevelInterpreter64.asm:
  1194. 2012-09-18 Filip Pizlo <fpizlo@apple.com>
  1195. DFG should not call out to C++ every time that it tries to put to an object that doesn't yet have array storage
  1196. https://bugs.webkit.org/show_bug.cgi?id=96983
  1197. Reviewed by Oliver Hunt.
  1198. Introduce more polymorphism into the DFG's array mode support. Use that to
  1199. introduce the notion of effectul array modes, where the check for the mode
  1200. will perform actions necessary to ensure that we have the mode we want, if
  1201. the object is not already in that mode. Also added profiling support for
  1202. checking if an object is of a type that would not allow us to create array
  1203. storage (like a typed array or a string for example).
  1204. This is a ~2x speed-up on loops that transform an object that did not have
  1205. indexed storage into one that does.
  1206. * JSCTypedArrayStubs.h:
  1207. (JSC):
  1208. * bytecode/ArrayProfile.cpp:
  1209. (JSC::ArrayProfile::computeUpdatedPrediction):
  1210. * bytecode/ArrayProfile.h:
  1211. (JSC::ArrayProfile::ArrayProfile):
  1212. (JSC::ArrayProfile::mayInterceptIndexedAccesses):
  1213. (ArrayProfile):
  1214. * dfg/DFGAbstractState.cpp:
  1215. (JSC::DFG::AbstractState::execute):
  1216. * dfg/DFGArrayMode.cpp:
  1217. (JSC::DFG::fromObserved):
  1218. (DFG):
  1219. (JSC::DFG::modeAlreadyChecked):
  1220. (JSC::DFG::modeToString):
  1221. * dfg/DFGArrayMode.h:
  1222. (DFG):
  1223. (JSC::DFG::modeUsesButterfly):
  1224. (JSC::DFG::isSlowPutAccess):
  1225. (JSC::DFG::benefitsFromStructureCheck):
  1226. (JSC::DFG::isEffectful):
  1227. * dfg/DFGByteCodeParser.cpp:
  1228. (JSC::DFG::ByteCodeParser::getArrayMode):
  1229. (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks):
  1230. (JSC::DFG::ByteCodeParser::parseBlock):
  1231. * dfg/DFGCSEPhase.cpp:
  1232. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  1233. * dfg/DFGFixupPhase.cpp:
  1234. (JSC::DFG::FixupPhase::fixupNode):
  1235. (JSC::DFG::FixupPhase::checkArray):
  1236. * dfg/DFGGraph.h:
  1237. (JSC::DFG::Graph::byValIsPure):
  1238. * dfg/DFGNode.h:
  1239. (JSC::DFG::Node::hasArrayMode):
  1240. * dfg/DFGNodeType.h:
  1241. (DFG):
  1242. * dfg/DFGOperations.cpp:
  1243. * dfg/DFGOperations.h:
  1244. * dfg/DFGPredictionPropagationPhase.cpp:
  1245. (JSC::DFG::PredictionPropagationPhase::propagate):
  1246. * dfg/DFGSpeculativeJIT.cpp:
  1247. (JSC::DFG::SpeculativeJIT::checkArray):
  1248. (JSC::DFG::SpeculativeJIT::arrayify):
  1249. (DFG):
  1250. * dfg/DFGSpeculativeJIT.h:
  1251. (SpeculativeJIT):
  1252. * dfg/DFGSpeculativeJIT32_64.cpp:
  1253. (JSC::DFG::SpeculativeJIT::compile):
  1254. * dfg/DFGSpeculativeJIT64.cpp:
  1255. (JSC::DFG::SpeculativeJIT::compile):
  1256. * runtime/Arguments.h:
  1257. (Arguments):
  1258. * runtime/JSNotAnObject.h:
  1259. (JSNotAnObject):
  1260. * runtime/JSObject.h:
  1261. (JSObject):
  1262. (JSC::JSObject::ensureArrayStorage):
  1263. * runtime/JSString.h:
  1264. (JSC::JSString::createStructure):
  1265. 2012-09-18 Filip Pizlo <fpizlo@apple.com>
  1266. Include PhantomArguments in DFGDisassembly
  1267. https://bugs.webkit.org/show_bug.cgi?id=97043
  1268. Reviewed by Geoffrey Garen.
  1269. * dfg/DFGNode.h:
  1270. (JSC::DFG::Node::willHaveCodeGenOrOSR):
  1271. 2012-09-18 Filip Pizlo <fpizlo@apple.com>
  1272. REGRESSION(r128802): It made some JS tests crash
  1273. https://bugs.webkit.org/show_bug.cgi?id=97001
  1274. Reviewed by Mark Hahnenberg.
  1275. IndexingHeaderInlineMethods was incorrectly assuming that if the HasArrayStorage bit is clear, then that means that indexing payload capacity is zero.
  1276. * runtime/IndexingHeaderInlineMethods.h:
  1277. (JSC::IndexingHeader::preCapacity):
  1278. (JSC::IndexingHeader::indexingPayloadSizeInBytes):
  1279. 2012-09-18 Mark Hahnenberg <mhahnenberg@apple.com>
  1280. Use WTF::HasTrivialDestructor instead of compiler-specific versions in JSC::NeedsDestructor
  1281. https://bugs.webkit.org/show_bug.cgi?id=96980
  1282. Reviewed by Benjamin Poulain.
  1283. * runtime/JSCell.h:
  1284. (JSC):
  1285. (NeedsDestructor):
  1286. 2012-09-18 Filip Pizlo <fpizlo@apple.com>
  1287. DFGOperations doesn't use NativeCallFrameTracer in enough places
  1288. https://bugs.webkit.org/show_bug.cgi?id=96987
  1289. Reviewed by Mark Hahnenberg.
  1290. Anything that can GC should use it.
  1291. * dfg/DFGOperations.cpp:
  1292. 2012-09-18 Mark Lam <mark.lam@apple.com>
  1293. Not reviewed. Attempt at greening the WinCairo bot. Touching
  1294. LowLevelInterpreter.asm to trigger a rebuild of LLIntDesiredOffsets.
  1295. https://bugs.webkit.org/show_bug.cgi?id=96992.
  1296. * llint/LowLevelInterpreter.asm:
  1297. 2012-09-18 Peter Gal <galpeter@inf.u-szeged.hu>
  1298. [Qt] REGRESSION(r128790): It broke the ARM build
  1299. https://bugs.webkit.org/show_bug.cgi?id=96968
  1300. Reviewed by Filip Pizlo.
  1301. Implement the missing or32 method in the MacroAssemblerARM.h.
  1302. * assembler/MacroAssemblerARM.h:
  1303. (JSC::MacroAssemblerARM::or32):
  1304. (MacroAssemblerARM):
  1305. 2012-09-18 Mark Lam <mark.lam@apple.com>
  1306. Fix for WinCairo builds.
  1307. https://bugs.webkit.org/show_bug.cgi?id=96992.
  1308. Reviewed by Filip Pizlo.
  1309. Adding additional vcproj build targets in LLIntDesiredOffsets.vcproj,
  1310. LLIntOffsetsExtractor.vcproj, and LLIntAssembly.vcproj to match those
  1311. in jsc.vcproj.
  1312. * JavaScriptCore.vcproj/LLIntAssembly/LLIntAssembly.vcproj:
  1313. * JavaScriptCore.vcproj/LLIntDesiredOffsets/LLIntDesiredOffsets.vcproj:
  1314. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcproj:
  1315. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.vsprops: Added property svn:eol-style.
  1316. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebug.vsprops: Added property svn:eol-style.
  1317. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebugAll.vsprops: Added.
  1318. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebugCairoCFLite.vsprops: Added.
  1319. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorProduction.vsprops: Added.
  1320. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorRelease.vsprops: Added property svn:eol-style.
  1321. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorReleaseCairoCFLite.vsprops: Added.
  1322. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorReleasePGO.vsprops: Added.
  1323. 2012-09-18 Filip Pizlo <fpizlo@apple.com>
  1324. Unreviewed, fix sloppy English in comment.
  1325. * runtime/JSGlobalObject.cpp:
  1326. (JSC):
  1327. 2012-09-17 Csaba Osztrogonác <ossy@webkit.org>
  1328. Unreviewed, rolling out r128826 and r128813.
  1329. * API/JSCallbackConstructor.cpp:
  1330. (JSC):
  1331. (JSC::JSCallbackConstructor::JSCallbackConstructor):
  1332. * API/JSCallbackConstructor.h:
  1333. (JSCallbackConstructor):
  1334. * API/JSCallbackObject.cpp:
  1335. (JSC):
  1336. (JSC::::createStructure):
  1337. * API/JSCallbackObject.h:
  1338. (JSC::JSCallbackObject::create):
  1339. (JSCallbackObject):
  1340. * API/JSClassRef.cpp:
  1341. (OpaqueJSClass::prototype):
  1342. * API/JSObjectRef.cpp:
  1343. (JSObjectMake):
  1344. (JSObjectGetPrivate):
  1345. (JSObjectSetPrivate):
  1346. (JSObjectGetPrivateProperty):
  1347. (JSObjectSetPrivateProperty):
  1348. (JSObjectDeletePrivateProperty):
  1349. * API/JSValueRef.cpp:
  1350. (JSValueIsObjectOfClass):
  1351. * API/JSWeakObjectMapRefPrivate.cpp:
  1352. * GNUmakefile.list.am:
  1353. * JSCTypedArrayStubs.h:
  1354. (JSC):
  1355. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1356. * JavaScriptCore.xcodeproj/project.pbxproj:
  1357. * dfg/DFGSpeculativeJIT.h:
  1358. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  1359. (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):
  1360. * heap/Heap.cpp:
  1361. (JSC::Heap::isSafeToSweepStructures):
  1362. (JSC):
  1363. * heap/Heap.h:
  1364. (JSC::Heap::allocatorForObjectWithDestructor):
  1365. (Heap):
  1366. (JSC::Heap::allocateWithDestructor):
  1367. (JSC::Heap::allocateStructure):
  1368. (JSC):
  1369. * heap/IncrementalSweeper.cpp:
  1370. (JSC::IncrementalSweeper::IncrementalSweeper):
  1371. (JSC::IncrementalSweeper::sweepNextBlock):
  1372. (JSC::IncrementalSweeper::startSweeping):
  1373. (JSC::IncrementalSweeper::willFinishSweeping):
  1374. (JSC::IncrementalSweeper::structuresCanBeSwept):
  1375. (JSC):
  1376. * heap/IncrementalSweeper.h:
  1377. (IncrementalSweeper):
  1378. * heap/MarkedAllocator.cpp:
  1379. (JSC::MarkedAllocator::tryAllocateHelper):
  1380. (JSC::MarkedAllocator::allocateBlock):
  1381. * heap/MarkedAllocator.h:
  1382. (JSC::MarkedAllocator::cellsNeedDestruction):
  1383. (JSC::MarkedAllocator::onlyContainsStructures):
  1384. (MarkedAllocator):
  1385. (JSC::MarkedAllocator::MarkedAllocator):
  1386. (JSC::MarkedAllocator::init):
  1387. * heap/MarkedBlock.cpp:
  1388. (JSC::MarkedBlock::create):
  1389. (JSC::MarkedBlock::MarkedBlock):
  1390. (JSC):
  1391. (JSC::MarkedBlock::specializedSweep):
  1392. (JSC::MarkedBlock::sweep):
  1393. (JSC::MarkedBlock::sweepHelper):
  1394. * heap/MarkedBlock.h:
  1395. (JSC):
  1396. (MarkedBlock):
  1397. (JSC::MarkedBlock::cellsNeedDestruction):
  1398. (JSC::MarkedBlock::onlyContainsStructures):
  1399. * heap/MarkedSpace.cpp:
  1400. (JSC::MarkedSpace::MarkedSpace):
  1401. (JSC::MarkedSpace::resetAllocators):
  1402. (JSC::MarkedSpace::canonicalizeCellLivenessData):
  1403. (JSC::MarkedSpace::isPagedOut):
  1404. (JSC::MarkedSpace::freeBlock):
  1405. * heap/MarkedSpace.h:
  1406. (MarkedSpace):
  1407. (Subspace):
  1408. (JSC::MarkedSpace::allocatorFor):
  1409. (JSC::MarkedSpace::destructorAllocatorFor):
  1410. (JSC::MarkedSpace::allocateWithDestructor):
  1411. (JSC::MarkedSpace::allocateStructure):
  1412. (JSC::MarkedSpace::forEachBlock):
  1413. * heap/SlotVisitor.cpp:
  1414. * jit/JIT.h:
  1415. * jit/JITInlineMethods.h:
  1416. (JSC::JIT::emitAllocateBasicJSObject):
  1417. (JSC::JIT::emitAllocateJSFinalObject):
  1418. (JSC::JIT::emitAllocateJSArray):
  1419. * jsc.cpp:
  1420. (GlobalObject::create):
  1421. * runtime/Arguments.cpp:
  1422. (JSC):
  1423. * runtime/Arguments.h:
  1424. (Arguments):
  1425. (JSC::Arguments::Arguments):
  1426. * runtime/ErrorPrototype.cpp:
  1427. (JSC):
  1428. * runtime/Executable.h:
  1429. * runtime/InternalFunction.cpp:
  1430. (JSC):
  1431. (JSC::InternalFunction::InternalFunction):
  1432. * runtime/InternalFunction.h:
  1433. (InternalFunction):
  1434. * runtime/JSCell.h:
  1435. (JSC):
  1436. (JSC::allocateCell):
  1437. * runtime/JSDestructibleObject.h: Removed.
  1438. * runtime/JSGlobalObject.cpp:
  1439. (JSC::JSGlobalObject::reset):
  1440. (JSC):
  1441. * runtime/JSGlobalObject.h:
  1442. (JSGlobalObject):
  1443. (JSC::JSGlobalObject::createRareDataIfNeeded):
  1444. (JSC::JSGlobalObject::create):
  1445. * runtime/JSGlobalThis.h:
  1446. (JSGlobalThis):
  1447. (JSC::JSGlobalThis::JSGlobalThis):
  1448. * runtime/JSPropertyNameIterator.h:
  1449. * runtime/JSScope.cpp:
  1450. (JSC):
  1451. * runtime/JSString.h:
  1452. (JSC):
  1453. * runtime/JSWrapperObject.h:
  1454. (JSWrapperObject):
  1455. (JSC::JSWrapperObject::JSWrapperObject):
  1456. * runtime/MathObject.cpp:
  1457. (JSC):
  1458. * runtime/NameInstance.h:
  1459. (NameInstance):
  1460. * runtime/RegExp.h:
  1461. * runtime/RegExpObject.cpp:
  1462. (JSC):
  1463. * runtime/SparseArrayValueMap.h:
  1464. * runtime/Structure.h:
  1465. (JSC::Structure):
  1466. (JSC::JSCell::classInfo):
  1467. (JSC):
  1468. * runtime/StructureChain.h:
  1469. * runtime/SymbolTable.h:
  1470. * testRegExp.cpp:
  1471. (GlobalObject::create):
  1472. 2012-09-17 Geoffrey Garen <ggaren@apple.com>
  1473. Refactored the arguments object so it doesn't dictate closure layout
  1474. https://bugs.webkit.org/show_bug.cgi?id=96955
  1475. Reviewed by Oliver Hunt.
  1476. * bytecode/CodeBlock.h:
  1477. (JSC::ExecState::argumentAfterCapture): Helper function for accessing an
  1478. argument that has been moved for capture.
  1479. * bytecompiler/BytecodeGenerator.cpp:
  1480. (JSC::BytecodeGenerator::BytecodeGenerator): Generate metadata for arguments
  1481. that are captured. We don't move any arguments yet, but we do use this
  1482. metadata to tell the arguments object if an argument is stored in the
  1483. activation.
  1484. * dfg/DFGOperations.cpp:
  1485. * dfg/DFGSpeculativeJIT.cpp:
  1486. (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
  1487. (JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
  1488. * dfg/DFGSpeculativeJIT64.cpp:
  1489. (JSC::DFG::SpeculativeJIT::compile): Updated for the arguments object not
  1490. malloc'ing a separate backing store, and for a rename from deletedArguments
  1491. to slowArguments.
  1492. * interpreter/CallFrame.h:
  1493. (ExecState):
  1494. * interpreter/Interpreter.cpp:
  1495. (JSC::Interpreter::unwindCallFrame):
  1496. (JSC::Interpreter::privateExecute):
  1497. * jit/JITStubs.cpp:
  1498. (JSC::DEFINE_STUB_FUNCTION):
  1499. * llint/LLIntSlowPaths.cpp:
  1500. (JSC::LLInt::LLINT_SLOW_PATH_DECL): Updated for small interface changes.
  1501. * runtime/Arguments.cpp:
  1502. (JSC::Arguments::visitChildren):
  1503. (JSC::Arguments::copyToArguments):
  1504. (JSC::Arguments::fillArgList):
  1505. (JSC::Arguments::getOwnPropertySlotByIndex):
  1506. (JSC::Arguments::createStrictModeCallerIfNecessary):
  1507. (JSC::Arguments::createStrictModeCalleeIfNecessary):
  1508. (JSC::Arguments::getOwnPropertySlot):
  1509. (JSC::Arguments::getOwnPropertyDescriptor):
  1510. (JSC::Arguments::getOwnPropertyNames):
  1511. (JSC::Arguments::putByIndex):
  1512. (JSC::Arguments::put):
  1513. (JSC::Arguments::deletePropertyByIndex):
  1514. (JSC::Arguments::deleteProperty):
  1515. (JSC::Arguments::defineOwnProperty):
  1516. (JSC::Arguments::tearOff): Moved all data inline into the object, for speed,
  1517. and refactored all internal argument accesses to use helper functions, so
  1518. we can change the implementation without changing lots of code.
  1519. (JSC::Arguments::didTearOffActivation): This function needs to account
  1520. for arguments that were moved by the activation object. We do this accounting
  1521. through a side vector that tells us where our arguments will be in the
  1522. activation.
  1523. (JSC::Arguments::tearOffForInlineCallFrame):
  1524. * runtime/Arguments.h:
  1525. (Arguments):
  1526. (JSC::Arguments::length):
  1527. (JSC::Arguments::isTornOff):
  1528. (JSC::Arguments::Arguments):
  1529. (JSC::Arguments::allocateSlowArguments):
  1530. (JSC::Arguments::tryDeleteArgument):
  1531. (JSC::Arguments::trySetArgument):
  1532. (JSC::Arguments::tryGetArgument):
  1533. (JSC::Arguments::isDeletedArgument):
  1534. (JSC::Arguments::isArgument):
  1535. (JSC::Arguments::argument):
  1536. (JSC::Arguments::finishCreation):
  1537. * runtime/JSActivation.h:
  1538. (JSC::JSActivation::create):
  1539. (JSActivation):
  1540. (JSC::JSActivation::captureStart):
  1541. (JSC::JSActivation::storageSize):
  1542. (JSC::JSActivation::registerOffset):
  1543. (JSC::JSActivation::isValid): The activation object is no longer responsible
  1544. for copying extra arguments provided by the caller. The argumnents object
  1545. does this instead. This means we can allocate and initialize an activation
  1546. without worrying about the call frame's argument count.
  1547. * runtime/SymbolTable.h:
  1548. (JSC::SlowArgument::SlowArgument):
  1549. (SlowArgument):
  1550. (JSC):
  1551. (JSC::SharedSymbolTable::parameterCount):
  1552. (SharedSymbolTable):
  1553. (JSC::SharedSymbolTable::slowArguments):
  1554. (JSC::SharedSymbolTable::setSlowArguments): Added data structures to back
  1555. the algorithms above.
  1556. 2012-09-17 Filip Pizlo <fpizlo@apple.com>
  1557. 32-bit LLInt get_by_val does vector length checks incorrectly
  1558. https://bugs.webkit.org/show_bug.cgi?id=96893
  1559. <rdar://problem/12311678>
  1560. Reviewed by Mark Hahnenberg.
  1561. * llint/LowLevelInterpreter32_64.asm:
  1562. 2012-09-17 Filip Pizlo <fpizlo@apple.com>
  1563. We don't have a bad enough time if an object's prototype chain crosses global objects
  1564. https://bugs.webkit.org/show_bug.cgi?id=96962
  1565. Reviewed by Geoffrey Garen.
  1566. * runtime/JSGlobalObject.cpp:
  1567. (JSC):
  1568. 2012-09-17 Filip Pizlo <fpizlo@apple.com>
  1569. Unreviewed, fix a broken assertion in offlineasm.
  1570. * offlineasm/armv7.rb:
  1571. * offlineasm/backends.rb:
  1572. 2012-09-16 Mark Hahnenberg <mhahnenberg@apple.com>
  1573. Delayed structure sweep can leak structures without bound
  1574. https://bugs.webkit.org/show_bug.cgi?id=96546
  1575. Reviewed by Gavin Barraclough.
  1576. This patch gets rid of the separate Structure allocator in the MarkedSpace and adds two new destructor-only
  1577. allocators. We now have separate allocators for our three types of objects: those objects with no destructors,
  1578. those objects with destructors and with immortal structures, and those objects with destructors that don't have
  1579. immortal structures. All of the objects of the third type (destructors without immortal structures) now
  1580. inherit from a new class named JSDestructibleObject (which in turn is a subclass of JSNonFinalObject), which stores
  1581. the ClassInfo for these classes at a fixed offset for safe retrieval during sweeping/destruction.
  1582. * API/JSCallbackConstructor.cpp: Use JSDestructibleObject for JSCallbackConstructor.
  1583. (JSC):
  1584. (JSC::JSCallbackConstructor::JSCallbackConstructor):
  1585. * API/JSCallbackConstructor.h:
  1586. (JSCallbackConstructor):
  1587. * API/JSCallbackObject.cpp: Inherit from JSDestructibleObject for normal JSCallbackObjects and use a finalizer for
  1588. JSCallbackObject<JSGlobalObject>, since JSGlobalObject also uses a finalizer.
  1589. (JSC):
  1590. (JSC::::create): We need to move the create function for JSCallbackObject<JSGlobalObject> out of line so we can add
  1591. the finalizer for it. We don't want to add the finalizer is something like finishCreation in case somebody decides
  1592. to subclass this. We use this same technique for many other subclasses of JSGlobalObject.
  1593. (JSC::::createStructure):
  1594. * API/JSCallbackObject.h:
  1595. (JSCallbackObject):
  1596. (JSC):
  1597. * API/JSClassRef.cpp: Change all the JSCallbackObject<JSNonFinalObject> to use JSDestructibleObject instead.
  1598. (OpaqueJSClass::prototype):
  1599. * API/JSObjectRef.cpp: Ditto.
  1600. (JSObjectMake):
  1601. (JSObjectGetPrivate):
  1602. (JSObjectSetPrivate):
  1603. (JSObjectGetPrivateProperty):
  1604. (JSObjectSetPrivateProperty):
  1605. (JSObjectDeletePrivateProperty):
  1606. * API/JSValueRef.cpp: Ditto.
  1607. (JSValueIsObjectOfClass):
  1608. * API/JSWeakObjectMapRefPrivate.cpp: Ditto.
  1609. * JSCTypedArrayStubs.h:
  1610. (JSC):
  1611. * JavaScriptCore.xcodeproj/project.pbxproj:
  1612. * dfg/DFGSpeculativeJIT.h: Use the proper allocator type when doing inline allocation in the DFG.
  1613. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  1614. (JSC::DFG::SpeculativeJIT::emitAllocateJSFinalObject):
  1615. * heap/Heap.cpp:
  1616. (JSC):
  1617. * heap/Heap.h: Add accessors for the various types of allocators now. Also remove the isSafeToSweepStructures function
  1618. since it's always safe to sweep Structures now.
  1619. (JSC::Heap::allocatorForObjectWithNormalDestructor):
  1620. (JSC::Heap::allocatorForObjectWithImmortalStructureDestructor):
  1621. (Heap):
  1622. (JSC::Heap::allocateWithNormalDestructor):
  1623. (JSC):
  1624. (JSC::Heap::allocateWithImmortalStructureDestructor):
  1625. * heap/IncrementalSweeper.cpp: Remove all the logic to detect when it's safe to sweep Structures from the
  1626. IncrementalSweeper since it's always safe to sweep Structures now.
  1627. (JSC::IncrementalSweeper::IncrementalSweeper):
  1628. (JSC::IncrementalSweeper::sweepNextBlock):
  1629. (JSC::IncrementalSweeper::startSweeping):
  1630. (JSC::IncrementalSweeper::willFinishSweeping):
  1631. (JSC):
  1632. * heap/IncrementalSweeper.h:
  1633. (IncrementalSweeper):
  1634. * heap/MarkedAllocator.cpp: Remove the logic that was preventing us from sweeping Structures if it wasn't safe. Add
  1635. tracking of the specific destructor type of allocator.
  1636. (JSC::MarkedAllocator::tryAllocateHelper):
  1637. (JSC::MarkedAllocator::allocateBlock):
  1638. * heap/MarkedAllocator.h:
  1639. (JSC::MarkedAllocator::destructorType):
  1640. (MarkedAllocator):
  1641. (JSC::MarkedAllocator::MarkedAllocator):
  1642. (JSC::MarkedAllocator::init):
  1643. * heap/MarkedBlock.cpp: Add all the destructor type stuff to MarkedBlocks so that we do the right thing when sweeping.
  1644. We also use the stored destructor type to determine the right thing to do in all JSCell::classInfo() calls.
  1645. (JSC::MarkedBlock::create):
  1646. (JSC::MarkedBlock::MarkedBlock):
  1647. (JSC):
  1648. (JSC::MarkedBlock::specializedSweep):
  1649. (JSC::MarkedBlock::sweep):
  1650. (JSC::MarkedBlock::sweepHelper):
  1651. * heap/MarkedBlock.h:
  1652. (JSC):
  1653. (JSC::MarkedBlock::allocator):
  1654. (JSC::MarkedBlock::destructorType):
  1655. * heap/MarkedSpace.cpp: Add the new destructor allocators to MarkedSpace.
  1656. (JSC::MarkedSpace::MarkedSpace):
  1657. (JSC::MarkedSpace::resetAllocators):
  1658. (JSC::MarkedSpace::canonicalizeCellLivenessData):
  1659. (JSC::MarkedSpace::isPagedOut):
  1660. (JSC::MarkedSpace::freeBlock):
  1661. * heap/MarkedSpace.h:
  1662. (MarkedSpace):
  1663. (JSC::MarkedSpace::immortalStructureDestructorAllocatorFor):
  1664. (JSC::MarkedSpace::normalDestructorAllocatorFor):
  1665. (JSC::MarkedSpace::allocateWithImmortalStructureDestructor):
  1666. (JSC::MarkedSpace::allocateWithNormalDestructor):
  1667. (JSC::MarkedSpace::forEachBlock):
  1668. * heap/SlotVisitor.cpp: Add include because the symbol was needed in an inlined function.
  1669. * jit/JIT.h: Make sure we use the correct allocator when doing inline allocations in the baseline JIT.
  1670. * jit/JITInlineMethods.h:
  1671. (JSC::JIT::emitAllocateBasicJSObject):
  1672. (JSC::JIT::emitAllocateJSFinalObject):
  1673. (JSC::JIT::emitAllocateJSArray):
  1674. * jsc.cpp:
  1675. (GlobalObject::create): Add finalizer here since JSGlobalObject needs to use a finalizer instead of inheriting from
  1676. JSDestructibleObject.
  1677. * runtime/Arguments.cpp: Inherit from JSDestructibleObject.
  1678. (JSC):
  1679. * runtime/Arguments.h:
  1680. (Arguments):
  1681. (JSC::Arguments::Arguments):
  1682. * runtime/ErrorPrototype.cpp: Added an assert to make sure we have a trivial destructor.
  1683. (JSC):
  1684. * runtime/Executable.h: Indicate that all of the Executable* classes have immortal Structures.
  1685. (JSC):
  1686. * runtime/InternalFunction.cpp: Inherit from JSDestructibleObject.
  1687. (JSC):
  1688. (JSC::InternalFunction::InternalFunction):
  1689. * runtime/InternalFunction.h:
  1690. (InternalFunction):
  1691. * runtime/JSCell.h: Added the NEEDS_DESTRUCTOR macro to make it easier for classes to indicate that instead of being
  1692. allocated in a destructor MarkedAllocator that they will handle their destruction themselves through the
  1693. use of a finalizer.
  1694. (JSC):
  1695. (HasImmortalStructure): New template to help us determine at compile-time if a particular class
  1696. should be allocated in the immortal structure MarkedAllocator. The default value is false. In order
  1697. to be allocated in the immortal structure allocator, classes must specialize this template. Also added
  1698. a macro to make it easier for classes to specialize the template.
  1699. (JSC::allocateCell): Use the appropriate allocator depending on the destructor type.
  1700. * runtime/JSDestructibleObject.h: Added. New class that stores the ClassInfo of any subclass so that it can be
  1701. accessed safely when the object is being destroyed.
  1702. (JSC):
  1703. (JSDestructibleObject):
  1704. (JSC::JSDestructibleObject::classInfo):
  1705. (JSC::JSDestructibleObject::JSDestructibleObject):
  1706. (JSC::JSCell::classInfo): Checks the current MarkedBlock to see where it should get the ClassInfo from so that it's always safe.
  1707. * runtime/JSGlobalObject.cpp: JSGlobalObject now uses a finalizer instead of a destructor so that it can avoid forcing all
  1708. of its relatives in the inheritance hierarchy (e.g. JSScope) to use destructors as well.
  1709. (JSC::JSGlobalObject::reset):
  1710. * runtime/JSGlobalObject.h:
  1711. (JSGlobalObject):
  1712. (JSC::JSGlobalObject::createRareDataIfNeeded): Since we always create a finalizer now, we don't have to worry about adding one
  1713. for the m_rareData field when it's created.
  1714. (JSC::JSGlobalObject::create):
  1715. (JSC):
  1716. * runtime/JSGlobalThis.h: Inherit from JSDestructibleObject.
  1717. (JSGlobalThis):
  1718. (JSC::JSGlobalThis::JSGlobalThis):
  1719. * runtime/JSPropertyNameIterator.h: Has an immortal Structure.
  1720. (JSC):
  1721. * runtime/JSScope.cpp:
  1722. (JSC):
  1723. * runtime/JSString.h: Has an immortal Structure.
  1724. (JSC):
  1725. * runtime/JSWrapperObject.h: Inherit from JSDestructibleObject.
  1726. (JSWrapperObject):
  1727. (JSC::JSWrapperObject::JSWrapperObject):
  1728. * runtime/MathObject.cpp: Cleaning up some of the inheritance stuff.
  1729. (JSC):
  1730. * runtime/NameInstance.h: Inherit from JSDestructibleObject.
  1731. (NameInstance):
  1732. * runtime/RegExp.h: Has immortal Structure.
  1733. (JSC):
  1734. * runtime/RegExpObject.cpp: Inheritance cleanup.
  1735. (JSC):
  1736. * runtime/SparseArrayValueMap.h: Has immortal Structure.
  1737. (JSC):
  1738. * runtime/Structure.h: Has immortal Structure.
  1739. (JSC):
  1740. * runtime/StructureChain.h: Ditto.
  1741. (JSC):
  1742. * runtime/SymbolTable.h: Ditto.
  1743. (SharedSymbolTable):
  1744. (JSC):
  1745. 2012-09-17 Filip Pizlo <fpizlo@apple.com>
  1746. If a prototype has indexed setters and its instances have indexed storage, then all put_by_val's should have a bad time
  1747. https://bugs.webkit.org/show_bug.cgi?id=96596
  1748. Reviewed by Gavin Barraclough.
  1749. Added comprehensive support for accessors and read-only indexed properties on the
  1750. prototype chain. This is done without any performance regression on benchmarks that
  1751. we're aware of, by having the entire VM's strategy with respect to arrays tilted
  1752. heavily in favor of:
  1753. - The prototype chain of JSArrays never having any accessors or read-only indexed
  1754. properties. If that changes, you're going to have a bad time.
  1755. - Prototypes of non-JSArray objects either having no indexed accessors or read-only
  1756. indexed properties, or, having those indexed accessor thingies inserted before
  1757. any instance object (i.e. object with that prototype as its prototype) is created.
  1758. If you add indexed accessors or read-only indexed properties to an object that is
  1759. already used as a prototype, you're going to have a bad time.
  1760. See below for the exact definition of having a bad time.
  1761. Put another way, "fair" uses of indexed accessors and read-only indexed properties
  1762. are:
  1763. - Put indexed accessors and read-only indexed properties on an object that is never
  1764. used as a prototype. This will slow down accesses to that object, but will not
  1765. have any effect on any other object.
  1766. - Put those indexed accessor thingies on an object before it is used as a prototype
  1767. and then start instantiating objects that claim that object as their prototype.
  1768. This will slightly slow down indexed stores to the instance objects, and greatly
  1769. slow down all indexed accesses to the prototype, but will have no other effect.
  1770. In short, "fair" uses only affect the object itself and any instance objects. But
  1771. if you start using indexed accessors in more eclectic ways, you're going to have
  1772. a bad time.
  1773. Specifically, if an object that may be used as a prototype has an indexed accessor
  1774. added, the VM performs a whole-heap scan to find all objects that belong to the
  1775. same global object as the prototype you modified. If any of those objects has
  1776. indexed storage, their indexed storage is put into slow-put mode, just as if their
  1777. prototype chain had indexed accessors. This will happen even for objects that do
  1778. not currently have indexed accessors in their prototype chain. As well, all JSArray
  1779. allocations are caused to create arrays with slow-put storage, and all future
  1780. allocations of indexed storage for non-JSArray objects are also flipped to slow-put
  1781. mode. Note there are two aspects to having a bad time: (i) the whole-heap scan and
  1782. (ii) the poisoning of all indexed storage in the entire global object. (i) is
  1783. necessary for correctness. If we detect that an object that may be used as a
  1784. prototype has had an indexed accessor or indexed read-only property inserted into
  1785. it, then we need to ensure that henceforth all instances of that object inspect
  1786. the prototype chain whenever an indexed hole is stored to. But by default, indexed
  1787. stores do no such checking because doing so would be unnecessarily slow. So, we must
  1788. find all instances of the affected object and flip them into a different array
  1789. storage mode that omits all hole optimizations. Since prototypes never keep a list
  1790. of instance objects, the only way to find those objects is a whole-heap scan. But
  1791. (i) alone would be a potential disaster, if a program frequently allocated an
  1792. object without indexed accessors, then allocated a bunch of objects that used that
  1793. one as their prototype, and then added indexed accessors to the prototype. So, to
  1794. prevent massive heap scan storms in such awkward programs, having a bad time also
  1795. implies (ii): henceforth *all* objects belonging to that global object will use
  1796. slow put indexed storage, so that we don't ever have to scan the heap again. Note
  1797. that here we are using the global object as just an approximation of a program
  1798. module; it may be worth investigating in the future if other approximations can be
  1799. used instead.
  1800. * bytecode/ArrayProfile.h:
  1801. (JSC):
  1802. (JSC::arrayModeFromStructure):
  1803. * dfg/DFGAbstractState.cpp:
  1804. (JSC::DFG::AbstractState::execute):
  1805. * dfg/DFGArrayMode.cpp:
  1806. (JSC::DFG::fromObserved):
  1807. (JSC::DFG::modeAlreadyChecked):
  1808. (JSC::DFG::modeToString):
  1809. * dfg/DFGArrayMode.h:
  1810. (DFG):
  1811. (JSC::DFG::isSlowPutAccess):
  1812. * dfg/DFGSpeculativeJIT.cpp:
  1813. (JSC::DFG::SpeculativeJIT::checkArray):
  1814. * dfg/DFGSpeculativeJIT32_64.cpp:
  1815. (JSC::DFG::SpeculativeJIT::compile):
  1816. * dfg/DFGSpeculativeJIT64.cpp:
  1817. (JSC::DFG::SpeculativeJIT::compile):
  1818. * jit/JIT.h:
  1819. * jit/JITInlineMethods.h:
  1820. (JSC::JIT::emitAllocateJSArray):
  1821. * jit/JITOpcodes.cpp:
  1822. (JSC::JIT::emit_op_new_array):
  1823. * runtime/ArrayPrototype.cpp:
  1824. (JSC::ArrayPrototype::finishCreation):
  1825. (JSC::arrayProtoFuncSort):
  1826. * runtime/IndexingType.h:
  1827. (JSC):
  1828. (JSC::hasIndexedProperties):
  1829. (JSC::hasIndexingHeader):
  1830. (JSC::hasArrayStorage):
  1831. (JSC::shouldUseSlowPut):
  1832. * runtime/JSArray.cpp:
  1833. (JSC::JSArray::pop):
  1834. (JSC::JSArray::push):
  1835. (JSC::JSArray::fillArgList):
  1836. (JSC::JSArray::copyToArguments):
  1837. * runtime/JSArray.h:
  1838. (JSC::JSArray::createStructure):
  1839. * runtime/JSGlobalObject.cpp:
  1840. (JSC::JSGlobalObject::JSGlobalObject):
  1841. (JSC::JSGlobalObject::reset):
  1842. (JSC):
  1843. (JSC::JSGlobalObject::haveABadTime):
  1844. * runtime/JSGlobalObject.h:
  1845. (JSGlobalObject):
  1846. (JSC::JSGlobalObject::addressOfArrayStructure):
  1847. (JSC::JSGlobalObject::havingABadTimeWatchpoint):
  1848. (JSC::JSGlobalObject::isHavingABadTime):
  1849. * runtime/JSObject.cpp:
  1850. (JSC::JSObject::visitButterfly):
  1851. (JSC::JSObject::getOwnPropertySlotByIndex):
  1852. (JSC::JSObject::put):
  1853. (JSC::JSObject::putByIndex):
  1854. (JSC::JSObject::enterDictionaryIndexingMode):
  1855. (JSC::JSObject::notifyPresenceOfIndexedAccessors):
  1856. (JSC):
  1857. (JSC::JSObject::createArrayStorage):
  1858. (JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
  1859. (JSC::JSObject::switchToSlowPutArrayStorage):
  1860. (JSC::JSObject::setPrototype):
  1861. (JSC::JSObject::resetInheritorID):
  1862. (JSC::JSObject::inheritorID):
  1863. (JSC::JSObject::allowsAccessFrom):
  1864. (JSC::JSObject::deletePropertyByIndex):
  1865. (JSC::JSObject::getOwnPropertyNames):
  1866. (JSC::JSObject::unwrappedGlobalObject):
  1867. (JSC::JSObject::notifyUsedAsPrototype):
  1868. (JSC::JSObject::createInheritorID):
  1869. (JSC::JSObject::defineOwnIndexedProperty):
  1870. (JSC::JSObject::attemptToInterceptPutByIndexOnHoleForPrototype):
  1871. (JSC::JSObject::attemptToInterceptPutByIndexOnHole):
  1872. (JSC::JSObject::putByIndexBeyondVectorLength):
  1873. (JSC::JSObject::putDirectIndexBeyondVectorLength):
  1874. (JSC::JSObject::getNewVectorLength):
  1875. (JSC::JSObject::getOwnPropertyDescriptor):
  1876. * runtime/JSObject.h:
  1877. (JSC::JSObject::mayBeUsedAsPrototype):
  1878. (JSObject):
  1879. (JSC::JSObject::mayInterceptIndexedAccesses):
  1880. (JSC::JSObject::getArrayLength):
  1881. (JSC::JSObject::getVectorLength):
  1882. (JSC::JSObject::canGetIndexQuickly):
  1883. (JSC::JSObject::getIndexQuickly):
  1884. (JSC::JSObject::canSetIndexQuickly):
  1885. (JSC::JSObject::setIndexQuickly):
  1886. (JSC::JSObject::initializeIndex):
  1887. (JSC::JSObject::completeInitialization):
  1888. (JSC::JSObject::inSparseIndexingMode):
  1889. (JSC::JSObject::arrayStorage):
  1890. (JSC::JSObject::arrayStorageOrNull):
  1891. (JSC::JSObject::ensureArrayStorage):
  1892. (JSC):
  1893. (JSC::JSValue::putByIndex):
  1894. * runtime/JSValue.cpp:
  1895. (JSC::JSValue::putToPrimitive):
  1896. (JSC::JSValue::putToPrimitiveByIndex):
  1897. (JSC):
  1898. * runtime/JSValue.h:
  1899. (JSValue):
  1900. * runtime/ObjectPrototype.cpp:
  1901. (JSC::ObjectPrototype::finishCreation):
  1902. * runtime/SparseArrayValueMap.cpp:
  1903. (JSC::SparseArrayValueMap::putEntry):
  1904. (JSC::SparseArrayEntry::put):
  1905. (JSC):
  1906. * runtime/SparseArrayValueMap.h:
  1907. (JSC):
  1908. (SparseArrayEntry):
  1909. * runtime/Structure.cpp:
  1910. (JSC::Structure::anyObjectInChainMayInterceptIndexedAccesses):
  1911. (JSC):
  1912. (JSC::Structure::suggestedIndexingTransition):
  1913. * runtime/Structure.h:
  1914. (Structure):
  1915. (JSC::Structure::mayInterceptIndexedAccesses):
  1916. * runtime/StructureTransitionTable.h:
  1917. (JSC::newIndexingType):
  1918. 2012-09-17 Filip Pizlo <fpizlo@apple.com>
  1919. Array profiling has convergence issues
  1920. https://bugs.webkit.org/show_bug.cgi?id=96891
  1921. Reviewed by Gavin Barraclough.
  1922. Now each array profiling site merges in the indexing type it observed into
  1923. the m_observedArrayModes bitset. The ArrayProfile also uses this to detect
  1924. cases where the structure must have gone polymorphic (if the bitset is
  1925. polymorphic then the structure must be). This achieves something like the
  1926. best of both worlds: on the one hand, we get a probabilistic structure that
  1927. we can use to optimize the monomorphic structure case, but on the other hand,
  1928. we get an accurate view of the set of types that were encountered.
  1929. * assembler/MacroAssemblerARMv7.h:
  1930. (JSC::MacroAssemblerARMv7::or32):
  1931. (MacroAssemblerARMv7):
  1932. * assembler/MacroAssemblerX86.h:
  1933. (JSC::MacroAssemblerX86::or32):
  1934. (MacroAssemblerX86):
  1935. * assembler/MacroAssemblerX86_64.h:
  1936. (JSC::MacroAssemblerX86_64::or32):
  1937. (MacroAssemblerX86_64):
  1938. * assembler/X86Assembler.h:
  1939. (X86Assembler):
  1940. (JSC::X86Assembler::orl_rm):
  1941. * bytecode/ArrayProfile.cpp:
  1942. (JSC::ArrayProfile::computeUpdatedPrediction):
  1943. * bytecode/ArrayProfile.h:
  1944. (JSC::ArrayProfile::addressOfArrayModes):
  1945. (JSC::ArrayProfile::structureIsPolymorphic):
  1946. * jit/JIT.h:
  1947. (JIT):
  1948. * jit/JITInlineMethods.h:
  1949. (JSC):
  1950. (JSC::JIT::emitArrayProfilingSite):
  1951. * jit/JITPropertyAccess.cpp:
  1952. (JSC::JIT::emit_op_get_by_val):
  1953. (JSC::JIT::emit_op_put_by_val):
  1954. (JSC::JIT::privateCompilePatchGetArrayLength):
  1955. * jit/JITPropertyAccess32_64.cpp:
  1956. (JSC::JIT::emit_op_get_by_val):
  1957. (JSC::JIT::emit_op_put_by_val):
  1958. (JSC::JIT::privateCompilePatchGetArrayLength):
  1959. * llint/LowLevelInterpreter.asm:
  1960. * llint/LowLevelInterpreter32_64.asm:
  1961. * llint/LowLevelInterpreter64.asm:
  1962. 2012-09-17 Mark Lam <mark.lam@apple.com>
  1963. Not reviewed. Added svn:eol-style native to unbreak some build bots.
  1964. https://bugs.webkit.org/show_bug.cgi?id=96175.
  1965. * JavaScriptCore.vcproj/LLIntAssembly/LLIntAssembly.vcproj: Added property svn:eol-style.
  1966. * JavaScriptCore.vcproj/LLIntDesiredOffsets/LLIntDesiredOffsets.vcproj: Added property svn:eol-style.
  1967. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcproj: Added property svn:eol-style.
  1968. 2012-09-16 Mark Lam <mark.lam@apple.com>
  1969. Added MSVC project changes to enable building the llint.
  1970. https://bugs.webkit.org/show_bug.cgi?id=96175.
  1971. Reviewed by Geoff Garen.
  1972. This only adds the ability to build the llint, but currently, only the
  1973. C++ backend is supported. By default, the Windows port will remain
  1974. running with the baseline JIT. The llint will not be enabled.
  1975. * JavaScriptCore.vcproj/JavaScriptCore.sln:
  1976. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  1977. * JavaScriptCore.vcproj/LLIntAssembly: Added.
  1978. * JavaScriptCore.vcproj/LLIntAssembly/LLIntAssembly.make: Added.
  1979. * JavaScriptCore.vcproj/LLIntAssembly/LLIntAssembly.vcproj: Added.
  1980. * JavaScriptCore.vcproj/LLIntAssembly/build-LLIntAssembly.sh: Added.
  1981. * JavaScriptCore.vcproj/LLIntDesiredOffsets: Added.
  1982. * JavaScriptCore.vcproj/LLIntDesiredOffsets/LLIntDesiredOffsets.make: Added.
  1983. * JavaScriptCore.vcproj/LLIntDesiredOffsets/LLIntDesiredOffsets.vcproj: Added.
  1984. * JavaScriptCore.vcproj/LLIntDesiredOffsets/build-LLIntDesiredOffsets.sh: Added.
  1985. * JavaScriptCore.vcproj/LLIntOffsetsExtractor: Added.
  1986. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractor.vcproj: Added.
  1987. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorCommon.vsprops: Added.
  1988. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorDebug.vsprops: Added.
  1989. * JavaScriptCore.vcproj/LLIntOffsetsExtractor/LLIntOffsetsExtractorRelease.vsprops: Added.
  1990. 2012-09-16 Filip Pizlo <fpizlo@apple.com>
  1991. JSObject.cpp and JSArray.cpp have inconsistent tests for the invalid array index case
  1992. https://bugs.webkit.org/show_bug.cgi?id=96878
  1993. Reviewed by Sam Weinig.
  1994. Removed the uses of UNLIKELY() because I don't believe they are buying us anything,
  1995. since we're already on the slow path. Also found other places where we're testing for
  1996. the invalid array index case using unusual predicates rather than just using
  1997. MAX_ARRAY_INDEX. With this change, I believe that all of our tests for invalid
  1998. array indices (i.e. indices that should be treated as non-indexed properties)
  1999. uniformly use MAX_ARRAY_INDEX and PropertyName::NotAnIndex.
  2000. * runtime/JSArray.cpp:
  2001. (JSC::JSArray::push):
  2002. * runtime/JSObject.cpp:
  2003. (JSC::JSObject::putByIndex):
  2004. (JSC::JSObject::defineOwnIndexedProperty):
  2005. 2012-09-15 Filip Pizlo <fpizlo@apple.com>
  2006. Following the Butterfly refactoring, the comment for lastArraySize was not updated
  2007. https://bugs.webkit.org/show_bug.cgi?id=96877
  2008. Reviewed by Sam Weinig.
  2009. * runtime/JSObject.cpp:
  2010. (JSC):
  2011. 2012-09-15 Mark Lam <mark.lam@apple.com>
  2012. Fixed JSLock to use the platform abstraction for Mutex instead of
  2013. depending on pthreads.
  2014. https://bugs.webkit.org/show_bug.cgi?id=96858.
  2015. Reviewed by Filip Pizlo.
  2016. This fixes a synchronization problem on the Windows port and makes
  2017. it more reliable when running the layout tests.
  2018. * runtime/InitializeThreading.cpp:
  2019. (JSC::initializeThreadingOnce):
  2020. * runtime/JSLock.cpp:
  2021. (JSC):
  2022. (JSC::GlobalJSLock::GlobalJSLock):
  2023. (JSC::GlobalJSLock::~GlobalJSLock):
  2024. (JSC::GlobalJSLock::initialize):
  2025. * runtime/JSLock.h:
  2026. (GlobalJSLock):
  2027. (JSLock):
  2028. 2012-09-15 Filip Pizlo <fpizlo@apple.com>
  2029. Structure check hoisting fails to consider the possibility of conflicting checks on the source of the first assignment to the hoisted variable
  2030. https://bugs.webkit.org/show_bug.cgi?id=96872
  2031. Reviewed by Oliver Hunt.
  2032. This does a few related things:
  2033. - It turns off the use of ForceOSRExit for sure-to-fail CheckStructures, because
  2034. I noticed that this would sometimes happen for a ForwardCheckStructure. The
  2035. problem is that ForceOSRExit exits backwards, not forwards. Since the code that
  2036. led to those ForceOSRExit's being inserted was written out of paranoia rather
  2037. than need, I removed it. Specifically, I removed the m_isValid = false code
  2038. for CheckStructure/StructureTransitionWatchpoint in AbstractState.
  2039. - If a structure check causes a structure set to go empty, we don't want a
  2040. PutStructure to revive the set. It should instead be smart enough to realize
  2041. that an empty set implies that the code can't execute. This was the only "bug"
  2042. that the use of m_isValid = false was preventing.
  2043. - Finally, the main change: structure check hoisting looks at the source of the
  2044. SetLocals on structure-check-hoistable variables and ensures that the source
  2045. is not checked with a conflicting structure. This is O(n^2) but it does not
  2046. show up at all in performance tests.
  2047. The first two parts of this change were auxiliary bugs that were revealed by
  2048. the structure check hoister doing bad things.
  2049. * dfg/DFGAbstractState.cpp:
  2050. (JSC::DFG::AbstractState::initialize):
  2051. (JSC::DFG::AbstractState::execute):
  2052. * dfg/DFGStructureCheckHoistingPhase.cpp:
  2053. (JSC::DFG::StructureCheckHoistingPhase::run):
  2054. 2012-09-14 Filip Pizlo <fpizlo@apple.com>
  2055. All of the things in SparseArrayValueMap should be out-of-line
  2056. https://bugs.webkit.org/show_bug.cgi?id=96854
  2057. Reviewed by Andy Estes.
  2058. Those inline methods were buying us nothing.
  2059. * GNUmakefile.list.am:
  2060. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  2061. * JavaScriptCore.xcodeproj/project.pbxproj:
  2062. * runtime/JSArray.cpp:
  2063. * runtime/JSGlobalData.cpp:
  2064. * runtime/JSObject.cpp:
  2065. * runtime/RegExpMatchesArray.cpp:
  2066. * runtime/SparseArrayValueMap.cpp:
  2067. (JSC::SparseArrayValueMap::SparseArrayValueMap):
  2068. (JSC):
  2069. (JSC::SparseArrayValueMap::~SparseArrayValueMap):
  2070. (JSC::SparseArrayValueMap::finishCreation):
  2071. (JSC::SparseArrayValueMap::create):
  2072. (JSC::SparseArrayValueMap::destroy):
  2073. (JSC::SparseArrayValueMap::createStructure):
  2074. (JSC::SparseArrayValueMap::add):
  2075. (JSC::SparseArrayValueMap::putEntry):
  2076. (JSC::SparseArrayValueMap::putDirect):
  2077. (JSC::SparseArrayEntry::get):
  2078. (JSC::SparseArrayEntry::getNonSparseMode):
  2079. (JSC::SparseArrayValueMap::visitChildren):
  2080. * runtime/SparseArrayValueMapInlineMethods.h: Removed.
  2081. 2012-09-14 Mike West <mkwst@chromium.org>
  2082. JSC should throw a more descriptive exception when blocking 'eval' via CSP.
  2083. https://bugs.webkit.org/show_bug.cgi?id=94331
  2084. Reviewed by Geoffrey Garen.
  2085. Unless explicitly whitelisted, the 'script-src' Content Security Policy
  2086. directive blocks 'eval' and 'eval'-like constructs such as
  2087. 'new Function()'. When 'eval' is encountered in code, an 'EvalError' is
  2088. thrown, but the associated message is poor: "Eval is disabled" doesn't
  2089. give developers enough information about why their code isn't behaving
  2090. as expected.
  2091. This patch adds an 'errorMessage' parameter to the JavaScriptCore method
  2092. used to disable 'eval'; ContentSecurityPolicy has the opportunity to
  2093. pass in a more detailed and descriptive error that contains more context
  2094. for the developer.
  2095. * runtime/Executable.cpp:
  2096. (JSC::EvalExecutable::compileInternal):
  2097. Drop the hard-coded "Eval is disabled" error message in favor of
  2098. reading the error message off the global object.
  2099. * runtime/FunctionConstructor.cpp:
  2100. (JSC::FunctionConstructor::getCallData):
  2101. Drop the hard-coded "Function constructor is disabled" error message
  2102. in favor of reading the error message off the global object.
  2103. * runtime/JSGlobalObject.h:
  2104. (JSGlobalObject):
  2105. (JSC::JSGlobalObject::evalEnabled):
  2106. Making this accessor method const.
  2107. (JSC::JSGlobalObject::evalDisabledErrorMessage):
  2108. Accessor for the error message set via 'setEvalDisabled'.
  2109. (JSC::JSGlobalObject::setEvalEnabled):
  2110. Adding an 'errorMessage' parameter which is stored on the global
  2111. object, and used when exceptions are thrown.
  2112. 2012-09-14 Filip Pizlo <fpizlo@apple.com>
  2113. bbc homepage crashes immediately
  2114. https://bugs.webkit.org/show_bug.cgi?id=96812
  2115. <rdar://problem/12081386>
  2116. Reviewed by Oliver Hunt.
  2117. If you use the old storage pointer to write to space you thought was newly allocated,
  2118. you're going to have a bad time.
  2119. * runtime/JSArray.cpp:
  2120. (JSC::JSArray::unshiftCount):
  2121. 2012-09-14 Adam Barth <abarth@webkit.org>
  2122. Remove webkitPostMessage
  2123. https://bugs.webkit.org/show_bug.cgi?id=96577
  2124. Reviewed by Ojan Vafai.
  2125. Add ENABLE_LEGACY_VENDOR_PREFIXES flag.
  2126. * Configurations/FeatureDefines.xcconfig:
  2127. 2012-09-14 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  2128. [Qt] Make force_static_libs_as_shared work on Mac OS
  2129. We had to move a few LIBS += around that were in the wrong place,
  2130. and not caught when everything was just linked into the final
  2131. QtWebKit library.
  2132. Reviewed by Simon Hausmann.
  2133. * jsc.pro: No need for AppKit, we get it from WTF.pri
  2134. 2012-09-14 Kevin Funk <kevin.funk@kdab.com>
  2135. Fix interpreter build
  2136. https://bugs.webkit.org/show_bug.cgi?id=96617
  2137. Reviewed by Simon Hausmann.
  2138. Make compile.
  2139. * interpreter/Interpreter.cpp:
  2140. 2012-09-14 Parth Patel <parpatel@rim.com>
  2141. [BlackBerry] Switching from Slogger to Slogger2 requires changes in CMakeList of
  2142. webkit in order to include libraries of slog2
  2143. https://bugs.webkit.org/show_bug.cgi?id=96391
  2144. Reviewed by Yong Li.
  2145. Changes in Cmake files of JavaScriptCore of webkit to include slog2 libs in build
  2146. files of webkit in response to switching from Slogger to Slogger2.
  2147. * shell/PlatformBlackBerry.cmake:
  2148. 2012-09-14 Mark Hahnenberg <mhahnenberg@apple.com>
  2149. Remove the Zapped BlockState
  2150. https://bugs.webkit.org/show_bug.cgi?id=96708
  2151. Reviewed by Geoffrey Garen.
  2152. The Zapped block state is rather confusing. It indicates that a block is in one of two different states that we
  2153. can't tell the difference between:
  2154. 1) I have run all destructors of things that are zapped, and I have not allocated any more objects. This block
  2155. is ready for reclaiming if you so choose.
  2156. 2) I have run all the destructors of things that are zapped, but I have allocated more stuff since then, so it
  2157. is not safe to reclaim this block.
  2158. This state adds a lot of complexity to our state transition model for MarkedBlocks. We should get rid of it.
  2159. We can replace this state by making sure mark bits represent all of the liveness information we need when running
  2160. our conservative stack scan. Instead of zapping the free list when canonicalizing cell liveness data prior to
  2161. a conservative scan, we can instead mark all objects in the block except for those in the free list. This should
  2162. incur no performance penalty since we're doing it on a very small O(1) number of blocks at the beginning of the collection.
  2163. For the time being we still need to use zapping to determine whether we have run an object's destructor or not.
  2164. * heap/MarkedAllocator.cpp:
  2165. (JSC::MarkedAllocator::tryAllocateHelper): Renaming stuff.
  2166. * heap/MarkedAllocator.h: Renamed zapFreeList to canonicalizeCellLivenessData to match.
  2167. (MarkedAllocator):
  2168. (JSC::MarkedAllocator::canonicalizeCellLivenessData): Same as old zapFreeList, but just call canonicalize instead.
  2169. * heap/MarkedBlock.cpp:
  2170. (JSC::MarkedBlock::specializedSweep): Remove the check for Zapped block stuff. Also change the block state to Marked
  2171. instead of Zapped if we're not producing a FreeList since that's the only other state that really makes any sense.
  2172. (JSC::MarkedBlock::sweepHelper): Remove Zapped related code.
  2173. (SetAllMarksFunctor): Functor to set all the mark bits in the block since there's not a simple function to call on
  2174. the Bitmap itself.
  2175. (JSC::SetAllMarksFunctor::operator()):
  2176. (JSC):
  2177. (JSC::MarkedBlock::canonicalizeCellLivenessData): Remove all the stuff for Zapped. For FreeListed, set all the mark bits
  2178. and then clear the ones for the objects in the FreeList. This ensures that only the things that were in the FreeList
  2179. are considered to be dead by the conservative scan, just like if we were to have zapped the FreeList like before.
  2180. * heap/MarkedBlock.h:
  2181. (MarkedBlock):
  2182. (JSC::MarkedBlock::clearMarked): Add function to clear individual mark bits, since we need that functionality now.
  2183. (JSC):
  2184. (JSC::MarkedBlock::isLive): Remove code for Zapped stuff. Marked handles all interesting cases now.
  2185. (JSC::MarkedBlock::forEachCell): Add new iterator function that iterates over all cells in the block, regardless of
  2186. whether they're live or a dead.
  2187. * heap/MarkedSpace.cpp:
  2188. (JSC::MarkedSpace::canonicalizeCellLivenessData): Change to call the renamed canonicalize function.
  2189. 2012-09-13 Kevin Funk <kevin.funk@kdab.com>
  2190. Make compile with both OS(WINCE) and PLATFORM(QT) support
  2191. https://bugs.webkit.org/show_bug.cgi?id=95536
  2192. Reviewed by Simon Hausmann.
  2193. Do not link against advapi32 on wince
  2194. * jsc.pro:
  2195. 2012-09-13 Geoffrey Garen <ggaren@apple.com>
  2196. Refactored the DFG to make fewer assumptions about variable capture
  2197. https://bugs.webkit.org/show_bug.cgi?id=96680
  2198. Reviewed by Gavin Barraclough.
  2199. A variable capture optimization patch I'm working on broke DFG
  2200. correctness and the arguments simplification optimization phase, so I've
  2201. refactored both to make fewer assumptions about variable capture.
  2202. * bytecode/CodeBlock.h:
  2203. (JSC::CodeBlock::isCaptured): This is the new One True Way to find out
  2204. if a variable was captured. This gives us a single point of maintenance
  2205. as we chagne capture behavior.
  2206. * dfg/DFGAbstractState.cpp:
  2207. (JSC::DFG::AbstractState::clobberCapturedVars): Don't assume that captured
  2208. variables have any particular location. Instead, ask the One True Function.
  2209. * dfg/DFGArgumentsSimplificationPhase.cpp:
  2210. (JSC::DFG::ArgumentsSimplificationPhase::run):
  2211. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  2212. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize): Mechanical
  2213. changes to separate being captured from being 'arguments'. What used
  2214. to be
  2215. if (captured)
  2216. if (arguments)
  2217. x
  2218. y
  2219. is now
  2220. if (arguments)
  2221. x
  2222. y
  2223. else if (captured)
  2224. y
  2225. * dfg/DFGByteCodeParser.cpp:
  2226. (JSC::DFG::ByteCodeParser::getLocal):
  2227. (JSC::DFG::ByteCodeParser::setLocal):
  2228. (JSC::DFG::ByteCodeParser::getArgument):
  2229. (JSC::DFG::ByteCodeParser::setArgument):
  2230. (JSC::DFG::ByteCodeParser::flushDirect):
  2231. (JSC::DFG::ByteCodeParser::parseBlock):
  2232. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  2233. * dfg/DFGSpeculativeJIT.cpp:
  2234. (JSC::DFG::SpeculativeJIT::compile): Use the One True Function.
  2235. 2012-09-13 Benjamin Poulain <bpoulain@apple.com>
  2236. Improve the SourceProvider hierarchy
  2237. https://bugs.webkit.org/show_bug.cgi?id=95635
  2238. Reviewed by Geoffrey Garen.
  2239. SourceProvider was designed to have subclasses magically handling the data without
  2240. decoding all of it. The virtual methods length() and getRange() were based
  2241. on these assumptions.
  2242. In practice, the magic was in our head, there is no implementation that takes
  2243. advantage of that.
  2244. SourceProvider is modified to adopt WebCore's ScriptSourceProvider::source() and base
  2245. everything on it.
  2246. The code using SourceProvider is also simplified.
  2247. * interpreter/Interpreter.cpp:
  2248. (JSC::appendSourceToError): Keep a reference to the string instead of querying it for
  2249. each time it is used.
  2250. * parser/Lexer.cpp:
  2251. (JSC::::setCode):
  2252. (JSC::::sourceCode):
  2253. * parser/Parser.h:
  2254. (JSC::parse):
  2255. * parser/SourceCode.h:
  2256. (JSC::SourceCode::SourceCode):
  2257. (JSC::SourceCode::subExpression):
  2258. * parser/SourceProvider.h:
  2259. (SourceProvider):
  2260. (JSC::SourceProvider::getRange):
  2261. 2012-09-13 Filip Pizlo <fpizlo@apple.com>
  2262. DFG: Dead GetButterfly's shouldn't be subject to CSE
  2263. https://bugs.webkit.org/show_bug.cgi?id=96707
  2264. <rdar://problem/12296311>
  2265. Reviewed by Oliver Hunt.
  2266. There were a number of cases of this that creeped into the CSE: it would
  2267. match something even though it was dead.
  2268. * dfg/DFGCSEPhase.cpp:
  2269. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  2270. (JSC::DFG::CSEPhase::checkArrayElimination):
  2271. (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
  2272. (JSC::DFG::CSEPhase::getScopeChainLoadElimination):
  2273. (JSC::DFG::CSEPhase::getLocalLoadElimination):
  2274. 2012-09-13 Oliver Hunt <oliver@apple.com>
  2275. Make global const initialisation explicit in the bytecode
  2276. https://bugs.webkit.org/show_bug.cgi?id=96711
  2277. Reviewed by Gavin Barraclough.
  2278. Added op_init_global_const to make initialisation of global const
  2279. fields explicit. This will help us keep correct semantics in the
  2280. upcoming variable resolution refactoring.
  2281. * bytecode/CodeBlock.cpp:
  2282. (JSC::CodeBlock::dump):
  2283. * bytecode/Opcode.h:
  2284. (JSC):
  2285. (JSC::padOpcodeName):
  2286. * bytecompiler/BytecodeGenerator.cpp:
  2287. (JSC::BytecodeGenerator::emitInitGlobalConst):
  2288. (JSC):
  2289. * bytecompiler/BytecodeGenerator.h:
  2290. (BytecodeGenerator):
  2291. * bytecompiler/NodesCodegen.cpp:
  2292. (JSC::ConstDeclNode::emitCodeSingle):
  2293. * dfg/DFGByteCodeParser.cpp:
  2294. (JSC::DFG::ByteCodeParser::parseBlock):
  2295. * dfg/DFGCapabilities.h:
  2296. (JSC::DFG::canCompileOpcode):
  2297. * interpreter/Interpreter.cpp:
  2298. (JSC::Interpreter::privateExecute):
  2299. * jit/JIT.cpp:
  2300. (JSC::JIT::privateCompileMainPass):
  2301. (JSC::JIT::privateCompileSlowCases):
  2302. * llint/LowLevelInterpreter32_64.asm:
  2303. * llint/LowLevelInterpreter64.asm:
  2304. 2012-09-13 Mark Hahnenberg <mhahnenberg@apple.com>
  2305. Rename forEachCell to forEachLiveCell
  2306. https://bugs.webkit.org/show_bug.cgi?id=96685
  2307. Reviewed by Oliver Hunt.
  2308. forEachCell actually only iterates over live cells. We should rename it to
  2309. reflect what it actually does. This is also helpful because we want to add a new
  2310. forEachCell that actually does iterate each and every cell in a MarkedBlock
  2311. regardless of whether or not it is live.
  2312. * debugger/Debugger.cpp:
  2313. (JSC::Debugger::recompileAllJSFunctions):
  2314. * heap/Heap.cpp:
  2315. (JSC::Heap::globalObjectCount):
  2316. (JSC::Heap::objectTypeCounts):
  2317. * heap/MarkedBlock.h:
  2318. (MarkedBlock):
  2319. (JSC::MarkedBlock::forEachLiveCell):
  2320. * heap/MarkedSpace.h:
  2321. (MarkedSpace):
  2322. (JSC::MarkedSpace::forEachLiveCell):
  2323. * runtime/JSGlobalData.cpp:
  2324. (JSC::JSGlobalData::releaseExecutableMemory):
  2325. 2012-09-13 Filip Pizlo <fpizlo@apple.com>
  2326. [Qt][Win] REGRESSION(r128400): It broke the build
  2327. https://bugs.webkit.org/show_bug.cgi?id=96617
  2328. Reviewed by Simon Hausmann.
  2329. Changed "JSC::Array" to "JSC::ArrayClass" because it's not used often enough
  2330. for the brevity to be beneficial, and because "Array" causes too much namespace
  2331. pollution.
  2332. * runtime/IndexingType.h:
  2333. (JSC):
  2334. * runtime/JSArray.cpp:
  2335. (JSC::JSArray::pop):
  2336. (JSC::JSArray::push):
  2337. (JSC::JSArray::sortNumeric):
  2338. (JSC::JSArray::sort):
  2339. (JSC::JSArray::fillArgList):
  2340. (JSC::JSArray::copyToArguments):
  2341. (JSC::JSArray::compactForSorting):
  2342. * runtime/JSObject.cpp:
  2343. (JSC::JSObject::getOwnPropertySlotByIndex):
  2344. (JSC::JSObject::putByIndex):
  2345. (JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
  2346. (JSC::JSObject::deletePropertyByIndex):
  2347. (JSC::JSObject::getOwnPropertyNames):
  2348. (JSC::JSObject::putByIndexBeyondVectorLength):
  2349. (JSC::JSObject::putDirectIndexBeyondVectorLength):
  2350. (JSC::JSObject::getNewVectorLength):
  2351. (JSC::JSObject::getOwnPropertyDescriptor):
  2352. * runtime/JSObject.h:
  2353. (JSC::JSObject::getArrayLength):
  2354. (JSC::JSObject::getVectorLength):
  2355. (JSC::JSObject::canGetIndexQuickly):
  2356. (JSC::JSObject::canSetIndexQuickly):
  2357. (JSC::JSObject::inSparseIndexingMode):
  2358. (JSC::JSObject::ensureArrayStorage):
  2359. 2012-09-13 Filip Pizlo <fpizlo@apple.com>
  2360. Testing whether indexing type is ArrayWithArrayStorage should not compare against ArrayWithArrayStorage
  2361. https://bugs.webkit.org/show_bug.cgi?id=96611
  2362. Reviewed by Gavin Barraclough.
  2363. * dfg/DFGRepatch.cpp:
  2364. (JSC::DFG::tryCacheGetByID):
  2365. * dfg/DFGSpeculativeJIT.cpp:
  2366. (JSC::DFG::SpeculativeJIT::checkArray):
  2367. * jit/JITPropertyAccess.cpp:
  2368. (JSC::JIT::privateCompilePatchGetArrayLength):
  2369. * jit/JITPropertyAccess32_64.cpp:
  2370. (JSC::JIT::privateCompilePatchGetArrayLength):
  2371. * llint/LowLevelInterpreter32_64.asm:
  2372. * llint/LowLevelInterpreter64.asm:
  2373. 2012-09-09 Filip Pizlo <fpizlo@apple.com>
  2374. JSC should have property butterflies
  2375. https://bugs.webkit.org/show_bug.cgi?id=91933
  2376. Reviewed by Geoffrey Garen.
  2377. This changes the JSC object model. Previously, all objects had fast lookup for
  2378. named properties. Integer indexed properties were only fast if you used a
  2379. JSArray. With this change, all objects have fast indexed properties. This is
  2380. accomplished without any space overhead by using a bidirectional object layout,
  2381. aka butterflies. Each JSObject has a m_butterfly pointer where previously it
  2382. had a m_outOfLineStorage pointer. To the left of the location pointed to by
  2383. m_butterfly, we place all named out-of-line properties. To the right, we place
  2384. all indexed properties along with indexing meta-data. Though, some indexing
  2385. meta-data is placed in the 8-byte word immediately left of the pointed-to
  2386. location; this is in anticipation of the indexing meta-data being small enough
  2387. in the common case that m_butterfly always points to the first indexed
  2388. property.
  2389. This is performance neutral, except on tests that use indexed properties on
  2390. plain objects, where the speed-up is in excess of an order of magnitude.
  2391. One notable aspect of what this change brings is that it allows indexing
  2392. storage to morph over time. Currently this is only used to allow all non-array
  2393. objects to start out without any indexed storage. But it could be used for
  2394. some kinds of array type inference in the future.
  2395. * API/JSCallbackObject.h:
  2396. (JSCallbackObject):
  2397. * API/JSCallbackObjectFunctions.h:
  2398. (JSC::::getOwnPropertySlotByIndex):
  2399. (JSC):
  2400. (JSC::::getOwnNonIndexPropertyNames):
  2401. * API/JSObjectRef.cpp:
  2402. * CMakeLists.txt:
  2403. * GNUmakefile.list.am:
  2404. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2405. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  2406. * JavaScriptCore.xcodeproj/project.pbxproj:
  2407. * Target.pri:
  2408. * bytecode/ArrayProfile.h:
  2409. (JSC):
  2410. (JSC::arrayModeFromStructure):
  2411. * bytecompiler/BytecodeGenerator.cpp:
  2412. (JSC::BytecodeGenerator::emitDirectPutById):
  2413. * dfg/DFGAbstractState.cpp:
  2414. (JSC::DFG::AbstractState::execute):
  2415. * dfg/DFGAdjacencyList.h:
  2416. (JSC::DFG::AdjacencyList::AdjacencyList):
  2417. (AdjacencyList):
  2418. * dfg/DFGArrayMode.cpp:
  2419. (JSC::DFG::fromObserved):
  2420. (JSC::DFG::modeAlreadyChecked):
  2421. (JSC::DFG::modeToString):
  2422. * dfg/DFGArrayMode.h:
  2423. (DFG):
  2424. (JSC::DFG::modeUsesButterfly):
  2425. (JSC::DFG::modeIsJSArray):
  2426. (JSC::DFG::isInBoundsAccess):
  2427. (JSC::DFG::modeSupportsLength):
  2428. * dfg/DFGByteCodeParser.cpp:
  2429. (JSC::DFG::ByteCodeParser::handleGetByOffset):
  2430. (JSC::DFG::ByteCodeParser::parseBlock):
  2431. * dfg/DFGCSEPhase.cpp:
  2432. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  2433. (JSC::DFG::CSEPhase::performNodeCSE):
  2434. * dfg/DFGFixupPhase.cpp:
  2435. (JSC::DFG::FixupPhase::fixupNode):
  2436. (JSC::DFG::FixupPhase::addNode):
  2437. (FixupPhase):
  2438. (JSC::DFG::FixupPhase::checkArray):
  2439. * dfg/DFGGraph.h:
  2440. (JSC::DFG::Graph::byValIsPure):
  2441. * dfg/DFGNode.h:
  2442. (JSC::DFG::Node::Node):
  2443. (Node):
  2444. * dfg/DFGNodeType.h:
  2445. (DFG):
  2446. * dfg/DFGOperations.cpp:
  2447. (JSC::DFG::putByVal):
  2448. * dfg/DFGOperations.h:
  2449. * dfg/DFGPredictionPropagationPhase.cpp:
  2450. (JSC::DFG::PredictionPropagationPhase::propagate):
  2451. * dfg/DFGRepatch.cpp:
  2452. (JSC::DFG::generateProtoChainAccessStub):
  2453. (JSC::DFG::tryCacheGetByID):
  2454. (JSC::DFG::tryBuildGetByIDList):
  2455. (JSC::DFG::emitPutReplaceStub):
  2456. (JSC::DFG::emitPutTransitionStub):
  2457. (JSC::DFG::tryBuildPutByIdList):
  2458. * dfg/DFGSpeculativeJIT.cpp:
  2459. (JSC::DFG::SpeculativeJIT::checkArray):
  2460. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  2461. (JSC::DFG::SpeculativeJIT::compileGetArrayLength):
  2462. (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
  2463. (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
  2464. * dfg/DFGSpeculativeJIT.h:
  2465. (JSC::DFG::SpeculativeJIT::callOperation):
  2466. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  2467. * dfg/DFGSpeculativeJIT32_64.cpp:
  2468. (JSC::DFG::SpeculativeJIT::cachedGetById):
  2469. (JSC::DFG::SpeculativeJIT::cachedPutById):
  2470. (JSC::DFG::SpeculativeJIT::compile):
  2471. * dfg/DFGSpeculativeJIT64.cpp:
  2472. (JSC::DFG::SpeculativeJIT::cachedGetById):
  2473. (JSC::DFG::SpeculativeJIT::cachedPutById):
  2474. (JSC::DFG::SpeculativeJIT::compile):
  2475. * dfg/DFGStructureCheckHoistingPhase.cpp:
  2476. (JSC::DFG::StructureCheckHoistingPhase::run):
  2477. * heap/CopiedSpace.h:
  2478. (CopiedSpace):
  2479. * jit/JIT.h:
  2480. * jit/JITInlineMethods.h:
  2481. (JSC::JIT::emitAllocateBasicJSObject):
  2482. (JSC::JIT::emitAllocateBasicStorage):
  2483. (JSC::JIT::emitAllocateJSArray):
  2484. * jit/JITOpcodes.cpp:
  2485. (JSC::JIT::emit_op_new_array):
  2486. (JSC::JIT::emitSlow_op_new_array):
  2487. * jit/JITPropertyAccess.cpp:
  2488. (JSC::JIT::emit_op_get_by_val):
  2489. (JSC::JIT::compileGetDirectOffset):
  2490. (JSC::JIT::emit_op_put_by_val):
  2491. (JSC::JIT::compileGetByIdHotPath):
  2492. (JSC::JIT::emit_op_put_by_id):
  2493. (JSC::JIT::compilePutDirectOffset):
  2494. (JSC::JIT::privateCompilePatchGetArrayLength):
  2495. * jit/JITPropertyAccess32_64.cpp:
  2496. (JSC::JIT::emit_op_get_by_val):
  2497. (JSC::JIT::emit_op_put_by_val):
  2498. (JSC::JIT::compileGetByIdHotPath):
  2499. (JSC::JIT::emit_op_put_by_id):
  2500. (JSC::JIT::compilePutDirectOffset):
  2501. (JSC::JIT::compileGetDirectOffset):
  2502. (JSC::JIT::privateCompilePatchGetArrayLength):
  2503. * jit/JITStubs.cpp:
  2504. (JSC::DEFINE_STUB_FUNCTION):
  2505. * jsc.cpp:
  2506. * llint/LLIntSlowPaths.cpp:
  2507. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  2508. * llint/LowLevelInterpreter.asm:
  2509. * llint/LowLevelInterpreter32_64.asm:
  2510. * llint/LowLevelInterpreter64.asm:
  2511. * runtime/Arguments.cpp:
  2512. (JSC::Arguments::deletePropertyByIndex):
  2513. (JSC::Arguments::defineOwnProperty):
  2514. * runtime/ArrayConstructor.cpp:
  2515. * runtime/ArrayConventions.h: Added.
  2516. (JSC):
  2517. (JSC::isDenseEnoughForVector):
  2518. (JSC::indexingHeaderForArray):
  2519. (JSC::baseIndexingHeaderForArray):
  2520. * runtime/ArrayPrototype.cpp:
  2521. (JSC::ArrayPrototype::create):
  2522. (JSC):
  2523. (JSC::ArrayPrototype::ArrayPrototype):
  2524. (JSC::arrayProtoFuncToString):
  2525. (JSC::arrayProtoFuncJoin):
  2526. (JSC::arrayProtoFuncSort):
  2527. (JSC::arrayProtoFuncFilter):
  2528. (JSC::arrayProtoFuncMap):
  2529. (JSC::arrayProtoFuncEvery):
  2530. (JSC::arrayProtoFuncForEach):
  2531. (JSC::arrayProtoFuncSome):
  2532. (JSC::arrayProtoFuncReduce):
  2533. (JSC::arrayProtoFuncReduceRight):
  2534. * runtime/ArrayPrototype.h:
  2535. (ArrayPrototype):
  2536. (JSC::ArrayPrototype::createStructure):
  2537. * runtime/ArrayStorage.h: Added.
  2538. (JSC):
  2539. (ArrayStorage):
  2540. (JSC::ArrayStorage::ArrayStorage):
  2541. (JSC::ArrayStorage::from):
  2542. (JSC::ArrayStorage::butterfly):
  2543. (JSC::ArrayStorage::indexingHeader):
  2544. (JSC::ArrayStorage::length):
  2545. (JSC::ArrayStorage::setLength):
  2546. (JSC::ArrayStorage::vectorLength):
  2547. (JSC::ArrayStorage::setVectorLength):
  2548. (JSC::ArrayStorage::copyHeaderFromDuringGC):
  2549. (JSC::ArrayStorage::inSparseMode):
  2550. (JSC::ArrayStorage::lengthOffset):
  2551. (JSC::ArrayStorage::vectorLengthOffset):
  2552. (JSC::ArrayStorage::numValuesInVectorOffset):
  2553. (JSC::ArrayStorage::vectorOffset):
  2554. (JSC::ArrayStorage::indexBiasOffset):
  2555. (JSC::ArrayStorage::sparseMapOffset):
  2556. (JSC::ArrayStorage::sizeFor):
  2557. * runtime/Butterfly.h: Added.
  2558. (JSC):
  2559. (Butterfly):
  2560. (JSC::Butterfly::Butterfly):
  2561. (JSC::Butterfly::totalSize):
  2562. (JSC::Butterfly::fromBase):
  2563. (JSC::Butterfly::offsetOfIndexingHeader):
  2564. (JSC::Butterfly::offsetOfPublicLength):
  2565. (JSC::Butterfly::offsetOfVectorLength):
  2566. (JSC::Butterfly::indexingHeader):
  2567. (JSC::Butterfly::propertyStorage):
  2568. (JSC::Butterfly::indexingPayload):
  2569. (JSC::Butterfly::arrayStorage):
  2570. (JSC::Butterfly::offsetOfPropertyStorage):
  2571. (JSC::Butterfly::indexOfPropertyStorage):
  2572. (JSC::Butterfly::base):
  2573. * runtime/ButterflyInlineMethods.h: Added.
  2574. (JSC):
  2575. (JSC::Butterfly::createUninitialized):
  2576. (JSC::Butterfly::create):
  2577. (JSC::Butterfly::createUninitializedDuringCollection):
  2578. (JSC::Butterfly::base):
  2579. (JSC::Butterfly::growPropertyStorage):
  2580. (JSC::Butterfly::growArrayRight):
  2581. (JSC::Butterfly::resizeArray):
  2582. (JSC::Butterfly::unshift):
  2583. (JSC::Butterfly::shift):
  2584. * runtime/ClassInfo.h:
  2585. (MethodTable):
  2586. (JSC):
  2587. * runtime/IndexingHeader.h: Added.
  2588. (JSC):
  2589. (IndexingHeader):
  2590. (JSC::IndexingHeader::offsetOfIndexingHeader):
  2591. (JSC::IndexingHeader::offsetOfPublicLength):
  2592. (JSC::IndexingHeader::offsetOfVectorLength):
  2593. (JSC::IndexingHeader::IndexingHeader):
  2594. (JSC::IndexingHeader::vectorLength):
  2595. (JSC::IndexingHeader::setVectorLength):
  2596. (JSC::IndexingHeader::publicLength):
  2597. (JSC::IndexingHeader::setPublicLength):
  2598. (JSC::IndexingHeader::from):
  2599. (JSC::IndexingHeader::fromEndOf):
  2600. (JSC::IndexingHeader::propertyStorage):
  2601. (JSC::IndexingHeader::arrayStorage):
  2602. (JSC::IndexingHeader::butterfly):
  2603. * runtime/IndexingHeaderInlineMethods.h: Added.
  2604. (JSC):
  2605. (JSC::IndexingHeader::preCapacity):
  2606. (JSC::IndexingHeader::indexingPayloadSizeInBytes):
  2607. * runtime/IndexingType.h: Added.
  2608. (JSC):
  2609. (JSC::hasIndexingHeader):
  2610. * runtime/JSActivation.cpp:
  2611. (JSC::JSActivation::JSActivation):
  2612. (JSC::JSActivation::visitChildren):
  2613. (JSC::JSActivation::getOwnNonIndexPropertyNames):
  2614. * runtime/JSActivation.h:
  2615. (JSActivation):
  2616. (JSC::JSActivation::tearOff):
  2617. * runtime/JSArray.cpp:
  2618. (JSC):
  2619. (JSC::createArrayButterflyInDictionaryIndexingMode):
  2620. (JSC::JSArray::setLengthWritable):
  2621. (JSC::JSArray::defineOwnProperty):
  2622. (JSC::JSArray::getOwnPropertySlot):
  2623. (JSC::JSArray::getOwnPropertyDescriptor):
  2624. (JSC::JSArray::put):
  2625. (JSC::JSArray::deleteProperty):
  2626. (JSC::JSArray::getOwnNonIndexPropertyNames):
  2627. (JSC::JSArray::unshiftCountSlowCase):
  2628. (JSC::JSArray::setLength):
  2629. (JSC::JSArray::pop):
  2630. (JSC::JSArray::push):
  2631. (JSC::JSArray::shiftCount):
  2632. (JSC::JSArray::unshiftCount):
  2633. (JSC::JSArray::sortNumeric):
  2634. (JSC::JSArray::sort):
  2635. (JSC::JSArray::fillArgList):
  2636. (JSC::JSArray::copyToArguments):
  2637. (JSC::JSArray::compactForSorting):
  2638. * runtime/JSArray.h:
  2639. (JSC):
  2640. (JSArray):
  2641. (JSC::JSArray::JSArray):
  2642. (JSC::JSArray::length):
  2643. (JSC::JSArray::createStructure):
  2644. (JSC::JSArray::isLengthWritable):
  2645. (JSC::createArrayButterfly):
  2646. (JSC::JSArray::create):
  2647. (JSC::JSArray::tryCreateUninitialized):
  2648. * runtime/JSBoundFunction.cpp:
  2649. (JSC::boundFunctionCall):
  2650. (JSC::boundFunctionConstruct):
  2651. (JSC::JSBoundFunction::finishCreation):
  2652. * runtime/JSCell.cpp:
  2653. (JSC::JSCell::getOwnNonIndexPropertyNames):
  2654. (JSC):
  2655. * runtime/JSCell.h:
  2656. (JSCell):
  2657. * runtime/JSFunction.cpp:
  2658. (JSC::JSFunction::getOwnPropertySlot):
  2659. (JSC::JSFunction::getOwnPropertyDescriptor):
  2660. (JSC::JSFunction::getOwnNonIndexPropertyNames):
  2661. (JSC::JSFunction::defineOwnProperty):
  2662. * runtime/JSFunction.h:
  2663. (JSFunction):
  2664. * runtime/JSGlobalData.cpp:
  2665. (JSC::JSGlobalData::JSGlobalData):
  2666. * runtime/JSGlobalData.h:
  2667. (JSGlobalData):
  2668. * runtime/JSGlobalObject.cpp:
  2669. (JSC::JSGlobalObject::reset):
  2670. * runtime/JSONObject.cpp:
  2671. (JSC::Stringifier::Holder::appendNextProperty):
  2672. (JSC::Walker::walk):
  2673. * runtime/JSObject.cpp:
  2674. (JSC):
  2675. (JSC::JSObject::visitButterfly):
  2676. (JSC::JSObject::visitChildren):
  2677. (JSC::JSFinalObject::visitChildren):
  2678. (JSC::JSObject::getOwnPropertySlotByIndex):
  2679. (JSC::JSObject::put):
  2680. (JSC::JSObject::putByIndex):
  2681. (JSC::JSObject::enterDictionaryIndexingModeWhenArrayStorageAlreadyExists):
  2682. (JSC::JSObject::enterDictionaryIndexingMode):
  2683. (JSC::JSObject::createArrayStorage):
  2684. (JSC::JSObject::createInitialArrayStorage):
  2685. (JSC::JSObject::ensureArrayStorageExistsAndEnterDictionaryIndexingMode):
  2686. (JSC::JSObject::putDirectAccessor):
  2687. (JSC::JSObject::deleteProperty):
  2688. (JSC::JSObject::deletePropertyByIndex):
  2689. (JSC::JSObject::getOwnPropertyNames):
  2690. (JSC::JSObject::getOwnNonIndexPropertyNames):
  2691. (JSC::JSObject::preventExtensions):
  2692. (JSC::JSObject::fillGetterPropertySlot):
  2693. (JSC::JSObject::putIndexedDescriptor):
  2694. (JSC::JSObject::defineOwnIndexedProperty):
  2695. (JSC::JSObject::allocateSparseIndexMap):
  2696. (JSC::JSObject::deallocateSparseIndexMap):
  2697. (JSC::JSObject::putByIndexBeyondVectorLengthWithArrayStorage):
  2698. (JSC::JSObject::putByIndexBeyondVectorLength):
  2699. (JSC::JSObject::putDirectIndexBeyondVectorLengthWithArrayStorage):
  2700. (JSC::JSObject::putDirectIndexBeyondVectorLength):
  2701. (JSC::JSObject::getNewVectorLength):
  2702. (JSC::JSObject::increaseVectorLength):
  2703. (JSC::JSObject::checkIndexingConsistency):
  2704. (JSC::JSObject::growOutOfLineStorage):
  2705. (JSC::JSObject::getOwnPropertyDescriptor):
  2706. (JSC::putDescriptor):
  2707. (JSC::JSObject::putDirectMayBeIndex):
  2708. (JSC::JSObject::defineOwnNonIndexProperty):
  2709. (JSC::JSObject::defineOwnProperty):
  2710. (JSC::JSObject::getOwnPropertySlotSlow):
  2711. * runtime/JSObject.h:
  2712. (JSC::JSObject::getArrayLength):
  2713. (JSObject):
  2714. (JSC::JSObject::getVectorLength):
  2715. (JSC::JSObject::putDirectIndex):
  2716. (JSC::JSObject::canGetIndexQuickly):
  2717. (JSC::JSObject::getIndexQuickly):
  2718. (JSC::JSObject::canSetIndexQuickly):
  2719. (JSC::JSObject::setIndexQuickly):
  2720. (JSC::JSObject::initializeIndex):
  2721. (JSC::JSObject::completeInitialization):
  2722. (JSC::JSObject::inSparseIndexingMode):
  2723. (JSC::JSObject::butterfly):
  2724. (JSC::JSObject::outOfLineStorage):
  2725. (JSC::JSObject::offsetForLocation):
  2726. (JSC::JSObject::indexingShouldBeSparse):
  2727. (JSC::JSObject::butterflyOffset):
  2728. (JSC::JSObject::butterflyAddress):
  2729. (JSC::JSObject::arrayStorage):
  2730. (JSC::JSObject::arrayStorageOrZero):
  2731. (JSC::JSObject::ensureArrayStorage):
  2732. (JSC::JSObject::checkIndexingConsistency):
  2733. (JSC::JSNonFinalObject::JSNonFinalObject):
  2734. (JSC):
  2735. (JSC::JSObject::setButterfly):
  2736. (JSC::JSObject::setButterflyWithoutChangingStructure):
  2737. (JSC::JSObject::JSObject):
  2738. (JSC::JSObject::inlineGetOwnPropertySlot):
  2739. (JSC::JSObject::putDirectInternal):
  2740. (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
  2741. (JSC::JSObject::putDirectWithoutTransition):
  2742. (JSC::offsetInButterfly):
  2743. (JSC::offsetRelativeToPatchedStorage):
  2744. (JSC::indexRelativeToBase):
  2745. (JSC::offsetRelativeToBase):
  2746. * runtime/JSPropertyNameIterator.cpp:
  2747. (JSC::JSPropertyNameIterator::create):
  2748. * runtime/JSSymbolTableObject.cpp:
  2749. (JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
  2750. * runtime/JSSymbolTableObject.h:
  2751. (JSSymbolTableObject):
  2752. * runtime/JSTypeInfo.h:
  2753. (JSC):
  2754. (JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
  2755. (JSC::TypeInfo::overridesGetPropertyNames):
  2756. * runtime/LiteralParser.cpp:
  2757. (JSC::::parse):
  2758. * runtime/ObjectConstructor.cpp:
  2759. * runtime/ObjectPrototype.cpp:
  2760. (JSC::ObjectPrototype::ObjectPrototype):
  2761. (JSC):
  2762. * runtime/ObjectPrototype.h:
  2763. (ObjectPrototype):
  2764. * runtime/PropertyOffset.h:
  2765. (JSC::offsetInOutOfLineStorage):
  2766. * runtime/PropertyStorage.h: Added.
  2767. (JSC):
  2768. * runtime/PutDirectIndexMode.h: Added.
  2769. (JSC):
  2770. * runtime/RegExpMatchesArray.cpp:
  2771. (JSC::RegExpMatchesArray::RegExpMatchesArray):
  2772. (JSC):
  2773. (JSC::RegExpMatchesArray::create):
  2774. (JSC::RegExpMatchesArray::finishCreation):
  2775. * runtime/RegExpMatchesArray.h:
  2776. (RegExpMatchesArray):
  2777. (JSC::RegExpMatchesArray::createStructure):
  2778. * runtime/RegExpObject.cpp:
  2779. (JSC::RegExpObject::getOwnNonIndexPropertyNames):
  2780. * runtime/RegExpObject.h:
  2781. (RegExpObject):
  2782. * runtime/Reject.h: Added.
  2783. (JSC):
  2784. (JSC::reject):
  2785. * runtime/SparseArrayValueMap.cpp: Added.
  2786. (JSC):
  2787. * runtime/SparseArrayValueMap.h: Added.
  2788. (JSC):
  2789. (SparseArrayEntry):
  2790. (JSC::SparseArrayEntry::SparseArrayEntry):
  2791. (SparseArrayValueMap):
  2792. (JSC::SparseArrayValueMap::sparseMode):
  2793. (JSC::SparseArrayValueMap::setSparseMode):
  2794. (JSC::SparseArrayValueMap::lengthIsReadOnly):
  2795. (JSC::SparseArrayValueMap::setLengthIsReadOnly):
  2796. (JSC::SparseArrayValueMap::find):
  2797. (JSC::SparseArrayValueMap::remove):
  2798. (JSC::SparseArrayValueMap::notFound):
  2799. (JSC::SparseArrayValueMap::isEmpty):
  2800. (JSC::SparseArrayValueMap::contains):
  2801. (JSC::SparseArrayValueMap::size):
  2802. (JSC::SparseArrayValueMap::begin):
  2803. (JSC::SparseArrayValueMap::end):
  2804. * runtime/SparseArrayValueMapInlineMethods.h: Added.
  2805. (JSC):
  2806. (JSC::SparseArrayValueMap::SparseArrayValueMap):
  2807. (JSC::SparseArrayValueMap::~SparseArrayValueMap):
  2808. (JSC::SparseArrayValueMap::finishCreation):
  2809. (JSC::SparseArrayValueMap::create):
  2810. (JSC::SparseArrayValueMap::destroy):
  2811. (JSC::SparseArrayValueMap::createStructure):
  2812. (JSC::SparseArrayValueMap::add):
  2813. (JSC::SparseArrayValueMap::putEntry):
  2814. (JSC::SparseArrayValueMap::putDirect):
  2815. (JSC::SparseArrayEntry::get):
  2816. (JSC::SparseArrayEntry::getNonSparseMode):
  2817. (JSC::SparseArrayValueMap::visitChildren):
  2818. * runtime/StorageBarrier.h: Removed.
  2819. * runtime/StringObject.cpp:
  2820. (JSC::StringObject::putByIndex):
  2821. (JSC):
  2822. (JSC::StringObject::deletePropertyByIndex):
  2823. * runtime/StringObject.h:
  2824. (StringObject):
  2825. * runtime/StringPrototype.cpp:
  2826. * runtime/Structure.cpp:
  2827. (JSC::Structure::Structure):
  2828. (JSC::Structure::materializePropertyMap):
  2829. (JSC::Structure::nonPropertyTransition):
  2830. (JSC):
  2831. * runtime/Structure.h:
  2832. (Structure):
  2833. (JSC::Structure::indexingType):
  2834. (JSC::Structure::indexingTypeIncludingHistory):
  2835. (JSC::Structure::indexingTypeOffset):
  2836. (JSC::Structure::create):
  2837. * runtime/StructureTransitionTable.h:
  2838. (JSC):
  2839. (JSC::toAttributes):
  2840. (JSC::newIndexingType):
  2841. (JSC::StructureTransitionTable::Hash::hash):
  2842. * tests/mozilla/js1_6/Array/regress-304828.js:
  2843. 2012-09-12 Mark Lam <mark.lam@apple.com>
  2844. Refactor Opcodes to distinguish between core and extension opcodes.
  2845. https://bugs.webkit.org/show_bug.cgi?id=96466.
  2846. Reviewed by Filip Pizlo.
  2847. * bytecode/Opcode.h:
  2848. (JSC): Added FOR_EACH_CORE_OPCODE_ID() macro.
  2849. * llint/LowLevelInterpreter.h:
  2850. (JSC): Auto-generate llint opcode aliases using the
  2851. FOR_EACH_CORE_OPCODE_ID() macro.
  2852. 2012-09-11 Geoffrey Garen <ggaren@apple.com>
  2853. Second step to fixing the Windows build: Add new symbols.
  2854. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2855. 2012-09-11 Geoffrey Garen <ggaren@apple.com>
  2856. First step to fixing the Windows build: Remove old symbols.
  2857. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  2858. 2012-09-11 Geoffrey Garen <ggaren@apple.com>
  2859. Don't allocate a backing store just for a function's name
  2860. https://bugs.webkit.org/show_bug.cgi?id=96468
  2861. Reviewed by Oliver Hunt.
  2862. Treat function.name like function.length etc., and use a custom getter.
  2863. This saves space in closures.
  2864. * debugger/DebuggerCallFrame.cpp:
  2865. (JSC::DebuggerCallFrame::functionName):
  2866. * debugger/DebuggerCallFrame.h:
  2867. (DebuggerCallFrame): Updated for interface change.
  2868. * runtime/Executable.h:
  2869. (JSC::JSFunction::JSFunction): Do a little inlining.
  2870. * runtime/JSFunction.cpp:
  2871. (JSC::JSFunction::finishCreation): Gone now. That's the point of the patch.
  2872. (JSC::JSFunction::name):
  2873. (JSC::JSFunction::displayName):
  2874. (JSC::JSFunction::nameGetter):
  2875. (JSC::JSFunction::getOwnPropertySlot):
  2876. (JSC::JSFunction::getOwnPropertyDescriptor):
  2877. (JSC::JSFunction::getOwnPropertyNames):
  2878. (JSC::JSFunction::put):
  2879. (JSC::JSFunction::deleteProperty):
  2880. (JSC::JSFunction::defineOwnProperty): Added custom accessors for .name
  2881. just like .length and others.
  2882. * runtime/JSFunction.h:
  2883. (JSC::JSFunction::create):
  2884. (JSFunction): Updated for interface changes.
  2885. 2012-09-11 Mark Hahnenberg <mhahnenberg@apple.com>
  2886. IncrementalSweeper should not sweep/free Zapped blocks
  2887. https://bugs.webkit.org/show_bug.cgi?id=96464
  2888. Reviewed by Filip Pizlo.
  2889. This is not beneficial in terms of performance because there isn't any way a block can emerge
  2890. in the Zapped state from a call to Heap::collect() unless we run an eager sweep on it, in which
  2891. case we've already run all the destructors we possibly can. This also causes bugs since we don't
  2892. take zapped-ness into account when determining whether or not a block is empty to free it. The
  2893. incremental sweeper can then accidentally free blocks that it thinks are empty but are in fact
  2894. zapped with still-live objects in them.
  2895. * heap/MarkedBlock.h:
  2896. (JSC::MarkedBlock::needsSweeping): It is only valid to sweep a block if it is in the Marked state.
  2897. 2012-09-11 Geoffrey Garen <ggaren@apple.com>
  2898. JSActivation should inline allocate its registers, and eliminate
  2899. 'arguments' registers in the common case
  2900. https://bugs.webkit.org/show_bug.cgi?id=96427
  2901. Reviewed by Filip Pizlo.
  2902. This cuts the size class for simple closures down to 64 bytes.
  2903. * bytecompiler/BytecodeGenerator.cpp:
  2904. (JSC::BytecodeGenerator::BytecodeGenerator): Set the usesNonStrictEval
  2905. flag, which is new. Use a more specific test for whether a function
  2906. uses 'arguments', so we can avoid allocating, initializing, and tearing
  2907. off those registers in the common case. Distinguish between capturing
  2908. arguments and not, so we can avoid allocating space for arguments in
  2909. the torn-off object.
  2910. We can make this even more general in the future, with some bytecode
  2911. generator refactoring.
  2912. (JSC::BytecodeGenerator::resolve): Updated for new interface.
  2913. * bytecompiler/BytecodeGenerator.h:
  2914. (BytecodeGenerator):
  2915. (JSC::BytecodeGenerator::symbolTable): Updated some types.
  2916. * heap/Heap.cpp:
  2917. (JSC::Heap::isValidAllocation): Allow large allocations, now that they
  2918. are both supported and used.
  2919. * heap/Heap.h:
  2920. (Heap): Added a new form of allocateCell that specifies the full size
  2921. of the allocation, to allow for extra space on the end.
  2922. * interpreter/CallFrame.h:
  2923. (JSC::ExecState::argumentOffset):
  2924. (JSC::ExecState::argumentOffsetIncludingThis):
  2925. * interpreter/Interpreter.cpp:
  2926. (JSC::Interpreter::unwindCallFrame): Refactored this code to be more
  2927. specific about tearing off 'arguments' vs activations. This is something
  2928. I forgot in my last patch, and it is required now that we can have
  2929. acitvations without 'arguments' registers.
  2930. * runtime/Arguments.h:
  2931. (JSC::Arguments::setRegisters): No need for setRegisters anymore because
  2932. the activation object's storage doesn't change.
  2933. * runtime/JSActivation.cpp:
  2934. (JSC::JSActivation::JSActivation): Initialize our storage manually because
  2935. it's not declared to the C++ compiler.
  2936. (JSC::JSActivation::visitChildren): No copyAndAppend because our storage
  2937. is not out-of-line anymore.
  2938. (JSC::JSActivation::symbolTableGet):
  2939. (JSC::JSActivation::symbolTablePut):
  2940. (JSC::JSActivation::getOwnPropertyNames):
  2941. (JSC::JSActivation::symbolTablePutWithAttributes):
  2942. (JSC::JSActivation::getOwnPropertySlot):
  2943. (JSC::JSActivation::getOwnPropertyDescriptor):
  2944. (JSC::JSActivation::argumentsGetter): Refactored isTornOff() testing to
  2945. avoid using a data member and to avoid hard-coding any offset assumptions.
  2946. * runtime/JSActivation.h:
  2947. (JSC):
  2948. (JSActivation):
  2949. (JSC::JSActivation::create):
  2950. (JSC::JSActivation::isDynamicScope):
  2951. (JSC::JSActivation::captureStart):
  2952. (JSC::JSActivation::storageSize):
  2953. (JSC::JSActivation::storageSizeInBytes):
  2954. (JSC::JSActivation::registerOffset):
  2955. (JSC::JSActivation::tearOff):
  2956. (JSC::JSActivation::isTornOff):
  2957. (JSC::JSActivation::storage):
  2958. (JSC::JSActivation::allocationSize):
  2959. (JSC::JSActivation::isValid): New helper functions for doing the math
  2960. on our inline storage. Note that in the "AllOfTheThings" tear-off case,
  2961. the number of things is not known at compile time, so we store the
  2962. number in the argument count register. We can't just copy the raw contents
  2963. of the register beacuse we need a value that is safe for precise marking,
  2964. and the value in the register file has an invalid tag.
  2965. * runtime/JSCell.h:
  2966. (JSC::allocateCell): New function for allocating with extra storage
  2967. on the end.
  2968. * runtime/JSSymbolTableObject.h:
  2969. (JSC::JSSymbolTableObject::JSSymbolTableObject):
  2970. (JSC::JSSymbolTableObject::finishCreation):
  2971. * runtime/JSVariableObject.h:
  2972. (JSC::JSVariableObject::JSVariableObject):
  2973. (JSVariableObject): Make it easier for subclasses to use their symbol
  2974. tables during construction, by passing the table as a constructor argument.
  2975. * runtime/SymbolTable.h:
  2976. (JSC::SharedSymbolTable::usesNonStrictEval):
  2977. (JSC::SharedSymbolTable::setUsesNonStrictEval):
  2978. (SharedSymbolTable):
  2979. (JSC::SharedSymbolTable::captureMode):
  2980. (JSC::SharedSymbolTable::setCaptureMode):
  2981. (JSC::SharedSymbolTable::captureStart):
  2982. (JSC::SharedSymbolTable::setCaptureStart):
  2983. (JSC::SharedSymbolTable::captureEnd):
  2984. (JSC::SharedSymbolTable::setCaptureEnd):
  2985. (JSC::SharedSymbolTable::parameterCountIncludingThis):
  2986. (JSC::SharedSymbolTable::setParameterCountIncludingThis):
  2987. (JSC::SharedSymbolTable::SharedSymbolTable): Added data members to more
  2988. precisely describe what kind of capture is in play, and to avoid having
  2989. data members in the activation. We expect N activations per symbol table,
  2990. so this can be a big savings in heavy closure usage.
  2991. 2012-09-11 Ryuan Choi <ryuan.choi@samsung.com>
  2992. Fix build break with LLINT on 32bit machine after r128219
  2993. https://bugs.webkit.org/show_bug.cgi?id=96461
  2994. Unreviewed build fix.
  2995. * llint/LowLevelInterpreter32_64.asm: Fixed typo.
  2996. 2012-09-11 Michael Saboff <msaboff@apple.com>
  2997. Build fixed for http://trac.webkit.org/changeset/128243
  2998. Rubber stamped by Stephanie Lewis.
  2999. Added missing include file needed by 96422.
  3000. * icu/unicode/unorm2.h: Added.
  3001. 2012-09-11 Michael Saboff <msaboff@apple.com>
  3002. Build fixed for http://trac.webkit.org/changeset/128243
  3003. Rubber stamped by Stephanie Lewis.
  3004. Added missing include file needed by 96422.
  3005. * icu/unicode/ptypes.h: Added.
  3006. 2012-09-11 Michael Saboff <msaboff@apple.com>
  3007. Update ICU header files to more recent version
  3008. https://bugs.webkit.org/show_bug.cgi?id=96422
  3009. Reviewed by Geoff Garen.
  3010. Updated ICU header files to 4.6.1. Modifications made as part of the merge are:
  3011. platform.h - Changed ifndef / define / endif for U_HAVE_UINT8_T, U_HAVE_UINT16_T, U_HAVE_UINT32_T,
  3012. U_HAVE_UINT64_T, U_IS_BIG_ENDIAN and U_ENABLE_TRACING to match the existing platform.h
  3013. putil.h (line 132) - Changes defined(U_WINDOWS) to defined(WIN32) || defined(OS2) to match existing putil.h
  3014. ustring.h (line 945) - Wrapped macro argument cs with { (const UChar *)cs } to match existing ustring.h
  3015. utypes.h (line 545) - Changed defined(U_WINDOWS) to defined(WIN32) to match existing utypes.h
  3016. * icu/unicode/localpointer.h: Added.
  3017. * icu/unicode/parseerr.h:
  3018. * icu/unicode/platform.h:
  3019. * icu/unicode/putil.h:
  3020. * icu/unicode/uchar.h:
  3021. * icu/unicode/ucnv.h:
  3022. * icu/unicode/ucnv_err.h:
  3023. * icu/unicode/ucol.h:
  3024. * icu/unicode/uconfig.h:
  3025. * icu/unicode/uenum.h:
  3026. * icu/unicode/uiter.h:
  3027. * icu/unicode/uloc.h:
  3028. * icu/unicode/umachine.h:
  3029. * icu/unicode/unorm.h:
  3030. * icu/unicode/urename.h:
  3031. * icu/unicode/uscript.h:
  3032. * icu/unicode/uset.h:
  3033. * icu/unicode/ustring.h:
  3034. * icu/unicode/utf.h:
  3035. * icu/unicode/utf16.h:
  3036. * icu/unicode/utf8.h:
  3037. * icu/unicode/utypes.h:
  3038. * icu/unicode/uvernum.h: Added.
  3039. * icu/unicode/uversion.h:
  3040. 2012-09-11 Matt Lilek <mrl@apple.com>
  3041. OS X port should compile with newer versions of clang
  3042. https://bugs.webkit.org/show_bug.cgi?id=96434
  3043. m_identIsVarDecl is unused - remove it.
  3044. Reviewed by Anders Carlsson.
  3045. * parser/NodeConstructors.h:
  3046. (JSC::ForInNode::ForInNode):
  3047. * parser/Nodes.h:
  3048. (ForInNode):
  3049. 2012-09-11 Filip Pizlo <fpizlo@apple.com>
  3050. LLInt should optimize and profile array length accesses
  3051. https://bugs.webkit.org/show_bug.cgi?id=96417
  3052. Reviewed by Oliver Hunt.
  3053. This fixes the following hole in our array profiling strategy, where the array
  3054. is large (more than 1000 elements):
  3055. for (var i = 0; i < array.length; ++i) ...
  3056. The peeled use of array.length (in the array prologue) will execute only once
  3057. before DFG optimization kicks in from the loop's OSR point. Since it executed
  3058. only once, it executed in the LLInt. And prior to this patch, the LLInt did
  3059. not profile array.length accesses - so the DFG will assume, based on the lack
  3060. of profiling, that the access is in fact not an access to the JSArray length
  3061. property. That could then impede our ability to hoist the array structure
  3062. check, and may make us pessimistic in other ways as well, since the generic
  3063. GetById used for the array length access will be viewed as a side-effecting
  3064. operation.
  3065. * bytecode/CodeBlock.cpp:
  3066. (JSC::CodeBlock::printGetByIdCacheStatus):
  3067. (JSC::CodeBlock::finalizeUnconditionally):
  3068. * bytecode/GetByIdStatus.cpp:
  3069. (JSC::GetByIdStatus::computeFromLLInt):
  3070. * dfg/DFGByteCodeParser.cpp:
  3071. (JSC::DFG::ByteCodeParser::parseBlock):
  3072. * dfg/DFGCapabilities.h:
  3073. (JSC::DFG::canCompileOpcode):
  3074. * dfg/DFGFixupPhase.cpp:
  3075. (JSC::DFG::FixupPhase::fixupNode):
  3076. * jit/JIT.cpp:
  3077. (JSC::JIT::privateCompileMainPass):
  3078. (JSC::JIT::privateCompileSlowCases):
  3079. * llint/LLIntSlowPaths.cpp:
  3080. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  3081. * llint/LowLevelInterpreter.asm:
  3082. * llint/LowLevelInterpreter32_64.asm:
  3083. * llint/LowLevelInterpreter64.asm:
  3084. 2012-09-11 Raphael Kubo da Costa <rakuco@webkit.org>
  3085. [EFL] Rewrite the EFL-related Find modules
  3086. https://bugs.webkit.org/show_bug.cgi?id=95237
  3087. Reviewed by Kenneth Rohde Christiansen.
  3088. * CMakeLists.txt: Stop setting the LINK_FLAGS property.
  3089. * PlatformEfl.cmake: Ditto.
  3090. * shell/PlatformEfl.cmake: Ditto.
  3091. 2012-09-11 Raphael Kubo da Costa <rakuco@webkit.org>
  3092. [EFL] Unreviewed build fix after r128065.
  3093. * CMakeLists.txt: Link against WTF for FastMalloc symbols, which
  3094. are needed when building with SYSTEM_MALLOC off.
  3095. 2012-09-10 Mark Hahnenberg <mhahnenberg@apple.com>
  3096. Remove m_classInfo from JSCell
  3097. https://bugs.webkit.org/show_bug.cgi?id=96311
  3098. Reviewed by Oliver Hunt.
  3099. Now that no one is using the ClassInfo in JSCell, we can remove it for the greater good. This is a 1.5% win on v8v7 and
  3100. a 1.7% win on kraken, and is an overall performance progression.
  3101. * dfg/DFGSpeculativeJIT.h:
  3102. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): Had to rearrange the order of when we take things off the free list
  3103. and when we store the Structure in the object because we would clobber the free list otherwise. This made it not okay for
  3104. the structure argument and the scratch register to alias one another. Also removed the store of the ClassInfo pointer in the
  3105. object. Yay!
  3106. (SpeculativeJIT):
  3107. * dfg/DFGSpeculativeJIT32_64.cpp: Since it's no longer okay for for the scratch register and structure register to alias
  3108. one another as stated above, had to add an extra temporary for passing the Structure.
  3109. (JSC::DFG::SpeculativeJIT::compile):
  3110. * dfg/DFGSpeculativeJIT64.cpp: Ditto.
  3111. (JSC::DFG::SpeculativeJIT::compile):
  3112. * jit/JITInlineMethods.h:
  3113. (JSC::JIT::emitAllocateBasicJSObject): Similar changes to DFG's inline allocation except that it removed the object from
  3114. the free list first, so no changes were necessary there.
  3115. * llint/LowLevelInterpreter.asm: Change the constants for amount of inline storage to match PropertyOffset.h and remove
  3116. the store of the ClassInfo pointer during inline allocation.
  3117. * llint/LowLevelInterpreter32_64.asm:
  3118. * llint/LowLevelInterpreter64.asm:
  3119. * runtime/JSCell.h: Remove the m_classInfo field and associated methods.
  3120. (JSCell):
  3121. * runtime/JSObject.h:
  3122. (JSObject):
  3123. * runtime/PropertyOffset.h: Expand the number of inline storage properties to take up the extra space that we're freeing
  3124. with the removal of the ClassInfo pointer.
  3125. (JSC):
  3126. * runtime/Structure.h:
  3127. (JSC):
  3128. (JSC::JSCell::JSCell):
  3129. (JSC::JSCell::finishCreation):
  3130. 2012-09-10 Geoffrey Garen <ggaren@apple.com>
  3131. Added large allocation support to MarkedSpace
  3132. https://bugs.webkit.org/show_bug.cgi?id=96214
  3133. Originally reviewed by Oliver Hunt, then I added a design revision by
  3134. suggested by Phil Pizlo.
  3135. I expanded the imprecise size classes to cover up to 32KB, then added
  3136. an mmap-based allocator for everything bigger. There's a lot of tuning
  3137. we could do in these size classes, but currently they're almost
  3138. completely unused, so I haven't done any tuning.
  3139. Subtle point: the large allocator is a degenerate case of our free list
  3140. logic. Its list only ever contains zero or one items.
  3141. * heap/Heap.h:
  3142. (JSC::Heap::allocateStructure): Pipe in size information.
  3143. * heap/MarkedAllocator.cpp:
  3144. (JSC::MarkedAllocator::tryAllocateHelper): Handle the case where we
  3145. find a free item in the sweep list but the item isn't big enough. This
  3146. can happen in the large allocator because it mixes sizes.
  3147. (JSC::MarkedAllocator::tryAllocate):
  3148. (JSC::MarkedAllocator::allocateSlowCase): More piping.
  3149. (JSC::MarkedAllocator::allocateBlock): Handle the oversize case.
  3150. (JSC::MarkedAllocator::addBlock): I moved the call to didAddBlock here
  3151. because it made more sense.
  3152. * heap/MarkedAllocator.h:
  3153. (MarkedAllocator):
  3154. (JSC::MarkedAllocator::allocate):
  3155. * heap/MarkedSpace.cpp:
  3156. (JSC::MarkedSpace::MarkedSpace):
  3157. (JSC::MarkedSpace::resetAllocators):
  3158. (JSC::MarkedSpace::canonicalizeCellLivenessData):
  3159. (JSC::MarkedSpace::isPagedOut):
  3160. (JSC::MarkedSpace::freeBlock):
  3161. * heap/MarkedSpace.h:
  3162. (MarkedSpace):
  3163. (JSC::MarkedSpace::allocatorFor):
  3164. (JSC::MarkedSpace::destructorAllocatorFor):
  3165. (JSC::MarkedSpace::allocateWithoutDestructor):
  3166. (JSC::MarkedSpace::allocateWithDestructor):
  3167. (JSC::MarkedSpace::allocateStructure):
  3168. (JSC::MarkedSpace::forEachBlock):
  3169. * runtime/Structure.h:
  3170. (JSC::Structure): More piping.
  3171. 2012-09-10 Geoffrey Garen <ggaren@apple.com>
  3172. Try to fix the Windows (32-bit) build.
  3173. * jit/JITOpcodes.cpp:
  3174. (JSC::JIT::emit_op_tear_off_arguments):
  3175. * jit/JITOpcodes32_64.cpp:
  3176. (JSC::JIT::emit_op_tear_off_arguments): Get operands 1 and 2, not 1 and 1. :(
  3177. Also took this opportunity to rename to indicate that these values are
  3178. not destinations anymore.
  3179. 2012-09-10 Geoffrey Garen <ggaren@apple.com>
  3180. DFG misses arguments tear-off for function.arguments if 'arguments' is used
  3181. https://bugs.webkit.org/show_bug.cgi?id=96227
  3182. Reviewed by Gavin Barraclough.
  3183. We've decided not to allow function.arguments to alias the local
  3184. 'arguments' object, or a local var or function named 'arguments'.
  3185. Aliasing complicates the implementation (cf, this bug) and can produce
  3186. surprising behavior for web programmers.
  3187. Eliminating the aliasing has the side-effect of fixing this bug.
  3188. The compatibilty story: function.arguments is deprecated, was never
  3189. specified, and throws an exception in strict mode, so we expect it to
  3190. disappear over time. Firefox does not alias to 'arguments'; Chrome
  3191. does, but not if you use eval or with; IE does; Safari did.
  3192. * dfg/DFGByteCodeParser.cpp: Noticed a little cleanup while verifying
  3193. this code. Use the CodeBlock method for better encapsulation.
  3194. * interpreter/Interpreter.cpp:
  3195. (JSC::Interpreter::retrieveArgumentsFromVMCode): Behavior change: don't
  3196. alias.
  3197. * tests/mozilla/js1_4/Functions/function-001.js:
  3198. (TestFunction_4): Updated test expectations for changed behavior.
  3199. 2012-09-10 Filip Pizlo <fpizlo@apple.com>
  3200. offlineasm has some impossible to implement, and unused, instructions
  3201. https://bugs.webkit.org/show_bug.cgi?id=96310
  3202. Reviewed by Mark Hahnenberg.
  3203. * offlineasm/armv7.rb:
  3204. * offlineasm/instructions.rb:
  3205. * offlineasm/x86.rb:
  3206. 2012-09-09 Geoffrey Garen <ggaren@apple.com>
  3207. Refactored op_tear_off* to support activations that don't allocate space for 'arguments'
  3208. https://bugs.webkit.org/show_bug.cgi?id=96231
  3209. Reviewed by Gavin Barraclough.
  3210. This is a step toward smaller activations.
  3211. As a side-effect, this patch eliminates a load and branch from the hot path
  3212. of activation tear-off by moving it to the cold path of arguments tear-off. Our
  3213. optimizing assumptions are that activations are common and that reifying the
  3214. arguments object is less common.
  3215. * bytecode/CodeBlock.cpp:
  3216. (JSC::CodeBlock::dump):
  3217. * bytecode/Opcode.h:
  3218. (JSC::padOpcodeName): Updated for new opcode lengths.
  3219. * bytecompiler/BytecodeGenerator.cpp:
  3220. (JSC::BytecodeGenerator::BytecodeGenerator):
  3221. (JSC::BytecodeGenerator::addConstantValue): Added support for JSValue()
  3222. in the bytecode, which we use when we have 'arguments' but no activation.
  3223. (JSC::BytecodeGenerator::emitReturn): Always emit tear_off_arguments
  3224. if we've allocated the arguments registers. This allows tear_off_activation
  3225. not to worry about the arguments object anymore.
  3226. Also, pass the activation and arguments values directly to these opcodes
  3227. instead of requiring the opcodes to infer the values through special
  3228. registers. This gives us more flexibility to move or eliminate registers.
  3229. * dfg/DFGArgumentsSimplificationPhase.cpp:
  3230. (JSC::DFG::ArgumentsSimplificationPhase::run):
  3231. * dfg/DFGByteCodeParser.cpp:
  3232. (JSC::DFG::ByteCodeParser::parseBlock):
  3233. * dfg/DFGNode.h:
  3234. (Node): Updated for new opcode lengths.
  3235. * dfg/DFGOperations.cpp: Activation tear-off doesn't worry about the
  3236. arguments object anymore. If 'arguments' is in use and reified, it's
  3237. responsible for aliasing back to the activation object in tear_off_arguments.
  3238. * dfg/DFGOperations.h:
  3239. * dfg/DFGSpeculativeJIT.h:
  3240. (JSC::DFG::SpeculativeJIT::callOperation):
  3241. (SpeculativeJIT):
  3242. * dfg/DFGSpeculativeJIT32_64.cpp:
  3243. (JSC::DFG::SpeculativeJIT::compile):
  3244. * dfg/DFGSpeculativeJIT64.cpp:
  3245. (JSC::DFG::SpeculativeJIT::compile): Don't pass the arguments object to
  3246. activation tear-off; do pass the activation object to arguments tear-off.
  3247. * interpreter/Interpreter.cpp:
  3248. (JSC::Interpreter::privateExecute): Ditto.
  3249. * jit/JITOpcodes.cpp:
  3250. (JSC::JIT::emit_op_tear_off_activation):
  3251. (JSC::JIT::emit_op_tear_off_arguments):
  3252. * jit/JITOpcodes32_64.cpp:
  3253. (JSC::JIT::emit_op_tear_off_activation):
  3254. (JSC::JIT::emit_op_tear_off_arguments):
  3255. * jit/JITStubs.cpp:
  3256. (JSC::DEFINE_STUB_FUNCTION):
  3257. * llint/LLIntSlowPaths.cpp:
  3258. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  3259. * llint/LowLevelInterpreter32_64.asm:
  3260. * llint/LowLevelInterpreter64.asm: Same change in a few more execution engines.
  3261. 2012-09-10 Patrick Gansterer <paroga@webkit.org>
  3262. [JSC] Use StringBuilder::appendNumber() instead of String::number()
  3263. https://bugs.webkit.org/show_bug.cgi?id=96236
  3264. Reviewed by Benjamin Poulain.
  3265. * API/JSContextRef.cpp:
  3266. (JSContextCreateBacktrace):
  3267. 2012-09-06 Mark Hahnenberg <mhahnenberg@apple.com>
  3268. Combine MarkStack and SlotVisitor into single class
  3269. https://bugs.webkit.org/show_bug.cgi?id=96043
  3270. Reviewed by Geoff Garen.
  3271. Move all of MarkStack into SlotVisitor. The remaining stuff in MarkStack.cpp actually has to do
  3272. with MarkStack management/allocation. Cleaned up a few of the header files while I was at it.
  3273. * CMakeLists.txt:
  3274. * GNUmakefile.list.am:
  3275. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  3276. * JavaScriptCore.xcodeproj/project.pbxproj:
  3277. * Target.pri:
  3278. * bytecode/CodeBlock.cpp:
  3279. * dfg/DFGCommon.h:
  3280. * heap/GCThreadSharedData.cpp:
  3281. * heap/GCThreadSharedData.h:
  3282. (GCThreadSharedData):
  3283. * heap/HeapRootVisitor.h:
  3284. * heap/MarkStack.cpp:
  3285. (JSC):
  3286. * heap/MarkStack.h:
  3287. (JSC):
  3288. (MarkStackSegment):
  3289. (JSC::MarkStackSegment::data):
  3290. (JSC::MarkStackSegment::capacityFromSize):
  3291. (JSC::MarkStackSegment::sizeFromCapacity):
  3292. (MarkStackSegmentAllocator):
  3293. (MarkStackArray):
  3294. * heap/MarkStackInlineMethods.h:
  3295. (JSC::MarkStackArray::postIncTop):
  3296. (JSC):
  3297. (JSC::MarkStackArray::preDecTop):
  3298. (JSC::MarkStackArray::setTopForFullSegment):
  3299. (JSC::MarkStackArray::setTopForEmptySegment):
  3300. (JSC::MarkStackArray::top):
  3301. (JSC::MarkStackArray::validatePrevious):
  3302. (JSC::MarkStackArray::append):
  3303. (JSC::MarkStackArray::canRemoveLast):
  3304. (JSC::MarkStackArray::removeLast):
  3305. (JSC::MarkStackArray::isEmpty):
  3306. (JSC::MarkStackArray::size):
  3307. * heap/SlotVisitor.cpp: Added.
  3308. (JSC):
  3309. (JSC::SlotVisitor::SlotVisitor):
  3310. (JSC::SlotVisitor::~SlotVisitor):
  3311. (JSC::SlotVisitor::setup):
  3312. (JSC::SlotVisitor::reset):
  3313. (JSC::SlotVisitor::append):
  3314. (JSC::visitChildren):
  3315. (JSC::SlotVisitor::donateKnownParallel):
  3316. (JSC::SlotVisitor::drain):
  3317. (JSC::SlotVisitor::drainFromShared):
  3318. (JSC::SlotVisitor::mergeOpaqueRoots):
  3319. (JSC::SlotVisitor::startCopying):
  3320. (JSC::SlotVisitor::allocateNewSpaceSlow):
  3321. (JSC::SlotVisitor::allocateNewSpaceOrPin):
  3322. (JSC::JSString::tryHashConstLock):
  3323. (JSC::JSString::releaseHashConstLock):
  3324. (JSC::JSString::shouldTryHashConst):
  3325. (JSC::SlotVisitor::internalAppend):
  3326. (JSC::SlotVisitor::copyAndAppend):
  3327. (JSC::SlotVisitor::doneCopying):
  3328. (JSC::SlotVisitor::harvestWeakReferences):
  3329. (JSC::SlotVisitor::finalizeUnconditionalFinalizers):
  3330. (JSC::SlotVisitor::validate):
  3331. * heap/SlotVisitor.h:
  3332. (JSC):
  3333. (SlotVisitor):
  3334. (JSC::SlotVisitor::sharedData):
  3335. (JSC::SlotVisitor::isEmpty):
  3336. (JSC::SlotVisitor::visitCount):
  3337. (JSC::SlotVisitor::resetChildCount):
  3338. (JSC::SlotVisitor::childCount):
  3339. (JSC::SlotVisitor::incrementChildCount):
  3340. (ParallelModeEnabler):
  3341. (JSC::ParallelModeEnabler::ParallelModeEnabler):
  3342. (JSC::ParallelModeEnabler::~ParallelModeEnabler):
  3343. * heap/SlotVisitorInlineMethods.h:
  3344. (JSC::SlotVisitor::append):
  3345. (JSC):
  3346. (JSC::SlotVisitor::appendUnbarrieredPointer):
  3347. (JSC::SlotVisitor::appendUnbarrieredValue):
  3348. (JSC::SlotVisitor::internalAppend):
  3349. (JSC::SlotVisitor::addWeakReferenceHarvester):
  3350. (JSC::SlotVisitor::addUnconditionalFinalizer):
  3351. (JSC::SlotVisitor::addOpaqueRoot):
  3352. (JSC::SlotVisitor::containsOpaqueRoot):
  3353. (JSC::SlotVisitor::opaqueRootCount):
  3354. (JSC::SlotVisitor::mergeOpaqueRootsIfNecessary):
  3355. (JSC::SlotVisitor::mergeOpaqueRootsIfProfitable):
  3356. (JSC::SlotVisitor::donate):
  3357. (JSC::SlotVisitor::donateAndDrain):
  3358. * jit/JITWriteBarrier.h:
  3359. (JSC::SlotVisitor::append):
  3360. * jit/JumpReplacementWatchpoint.cpp:
  3361. * runtime/JSCell.h:
  3362. * runtime/Structure.h:
  3363. (JSC::SlotVisitor::internalAppend):
  3364. * runtime/WriteBarrier.h:
  3365. (JSC):
  3366. (JSC::SlotVisitor::append):
  3367. (JSC::SlotVisitor::appendValues):
  3368. * yarr/YarrJIT.cpp:
  3369. 2012-09-10 Hojong Han <hojong.han@samsung.com>
  3370. [EFL] JIT memory usage is not retrieved
  3371. https://bugs.webkit.org/show_bug.cgi?id=96095
  3372. Reviewed by Geoffrey Garen.
  3373. Fill JITBytes for EFL port.
  3374. * runtime/MemoryStatistics.cpp:
  3375. (JSC::globalMemoryStatistics):
  3376. 2012-09-10 Thiago Marcos P. Santos <thiago.santos@intel.com>
  3377. [CMake][EFL] Enable the LLInt
  3378. https://bugs.webkit.org/show_bug.cgi?id=92682
  3379. Reviewed by Csaba Osztrogonác.
  3380. Generate the headers needed by LLint when LLint is enabled.
  3381. * CMakeLists.txt:
  3382. 2012-09-10 Carlos Garcia Campos <cgarcia@igalia.com>
  3383. Unreviewed. Fix make distcheck.
  3384. * GNUmakefile.list.am: Add missing files.
  3385. 2012-09-09 Mark Lam <mark.lam@apple.com>
  3386. Fixed a few llint C++ interpreter bugs.
  3387. https://bugs.webkit.org/show_bug.cgi?id=96127.
  3388. Reviewed by Geoffrey Garen.
  3389. * llint/LLIntCLoop.h:
  3390. CLoop::execute()'s bootstrapOpcodeId does not need a default
  3391. value. There is no case when this function is called without
  3392. that parameter being specified.
  3393. * llint/LowLevelInterpreter.asm:
  3394. Moved the dispatchAfterCall() call to where it is needed.
  3395. For the C_LOOP back-end, it generates unreachable code.
  3396. * llint/LowLevelInterpreter.cpp:
  3397. #include <wtf/Assertions.h> because LLIntAssembly.h needs it.
  3398. (JSC):
  3399. Fixed bug in SIGN_BIT32() macro.
  3400. Placate a MSVC warning for t0, and t1 being uninitialized.
  3401. (JSC::CLoop::execute):
  3402. The bootstrapOpcodeId arg should always be specified.
  3403. MSVC doesn't like UNUSED_PARAM() for labels. Switch to using
  3404. the new UNUSED_LABEL() macro.
  3405. * offlineasm/cloop.rb:
  3406. * offlineasm/generate_offset_extractor.rb:
  3407. Resolved a compiler warning found via MSVC.
  3408. 2012-09-09 Patrick Gansterer <paroga@webkit.org>
  3409. Add StringBuilder::appendNumber() and use it
  3410. https://bugs.webkit.org/show_bug.cgi?id=96030
  3411. Reviewed by Eric Seidel.
  3412. Also fix a bunch of append() vs. appendLiteral() issues in the surrounding code.
  3413. * API/JSContextRef.cpp:
  3414. (JSContextCreateBacktrace):
  3415. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  3416. * interpreter/Interpreter.h:
  3417. (JSC::StackFrame::toString):
  3418. 2012-09-09 Patrick Gansterer <paroga@webkit.org>
  3419. Make the String initialization on the function side of String::number()
  3420. https://bugs.webkit.org/show_bug.cgi?id=95940
  3421. Reviewed by Benjamin Poulain.
  3422. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  3423. 2012-09-09 Geoffrey Garen <ggaren@apple.com>
  3424. Rolled out <http://trac.webkit.org/changeset/127939> because it broke
  3425. fast/js/named-function-expression.html.
  3426. Refactored bytecode generator initialization to support moving captured vars around
  3427. https://bugs.webkit.org/show_bug.cgi?id=96159
  3428. Reviewed by Gavin Barraclough.
  3429. 2012-09-08 Csaba Osztrogonác <ossy@webkit.org>
  3430. LLInt buildfix for case sensitive filesystems
  3431. https://bugs.webkit.org/show_bug.cgi?id=96099
  3432. Reviewed by Michael Saboff.
  3433. * llint/LowLevelInterpreter.cpp: Fix filenames.
  3434. 2012-09-07 Benjamin Poulain <bpoulain@apple.com>
  3435. Rename the ustring() accessor to string()
  3436. https://bugs.webkit.org/show_bug.cgi?id=95919
  3437. Reviewed by Geoffrey Garen.
  3438. Rename ustring() to string() to make the accessor name more logical after
  3439. r127191.
  3440. * API/JSBase.cpp:
  3441. (JSEvaluateScript):
  3442. (JSCheckScriptSyntax):
  3443. * API/JSObjectRef.cpp:
  3444. (JSObjectMakeFunctionWithCallback):
  3445. (JSObjectMakeFunction):
  3446. (JSObjectCopyPropertyNames):
  3447. * API/JSProfilerPrivate.cpp:
  3448. (JSStartProfiling):
  3449. (JSEndProfiling):
  3450. * API/JSValueRef.cpp:
  3451. (JSValueMakeString):
  3452. (JSValueMakeFromJSONString):
  3453. * API/OpaqueJSString.cpp:
  3454. (OpaqueJSString::string):
  3455. * API/OpaqueJSString.h:
  3456. (OpaqueJSString):
  3457. * bytecode/CodeBlock.cpp:
  3458. (JSC::idName):
  3459. (JSC::CodeBlock::dump):
  3460. * bytecompiler/BytecodeGenerator.cpp:
  3461. (JSC::BytecodeGenerator::emitLoad):
  3462. (JSC::BytecodeGenerator::addStringConstant):
  3463. * bytecompiler/NodesCodegen.cpp:
  3464. (JSC::RegExpNode::emitBytecode):
  3465. (JSC::processClauseList):
  3466. * dfg/DFGGraph.cpp:
  3467. (JSC::DFG::Graph::dump):
  3468. * interpreter/Interpreter.cpp:
  3469. (JSC::Interpreter::privateExecute):
  3470. * jit/JITStubs.cpp:
  3471. (JSC::DEFINE_STUB_FUNCTION):
  3472. * jsc.cpp:
  3473. (GlobalObject::addFunction):
  3474. (GlobalObject::addConstructableFunction):
  3475. * llint/LLIntSlowPaths.cpp:
  3476. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  3477. * parser/ASTBuilder.h:
  3478. (JSC::ASTBuilder::createRegExp):
  3479. * parser/Parser.cpp:
  3480. (JSC::::parsePrimaryExpression):
  3481. * parser/Parser.h:
  3482. (JSC::Scope::declareVariable):
  3483. (JSC::Scope::declareParameter):
  3484. (JSC::Scope::useVariable):
  3485. * parser/SyntaxChecker.h:
  3486. (JSC::SyntaxChecker::createRegExp):
  3487. * runtime/ExceptionHelpers.cpp:
  3488. (JSC::createUndefinedVariableError):
  3489. * runtime/Executable.cpp:
  3490. (JSC::FunctionExecutable::paramString):
  3491. * runtime/Executable.h:
  3492. (JSC::FunctionExecutable::finishCreation):
  3493. * runtime/FunctionPrototype.cpp:
  3494. (JSC::FunctionPrototype::addFunctionProperties):
  3495. * runtime/Identifier.h:
  3496. (JSC::Identifier::string):
  3497. * runtime/JSFunction.cpp:
  3498. (JSC::JSFunction::calculatedDisplayName):
  3499. * runtime/JSGlobalObject.cpp:
  3500. (JSC::JSGlobalObject::reset):
  3501. * runtime/JSONObject.cpp:
  3502. (JSC::PropertyNameForFunctionCall::value):
  3503. (JSC::Stringifier::Holder::appendNextProperty):
  3504. (JSC::Walker::walk):
  3505. * runtime/JSPropertyNameIterator.h:
  3506. (JSC::JSPropertyNameIterator::finishCreation):
  3507. * runtime/JSScope.cpp:
  3508. (JSC::JSScope::resolveBase):
  3509. * runtime/JSString.h:
  3510. (JSC::inlineJSValueNotStringtoString):
  3511. * runtime/LiteralParser.cpp:
  3512. (JSC::::parse):
  3513. * runtime/ObjectConstructor.cpp:
  3514. (JSC::ObjectConstructor::finishCreation):
  3515. (JSC::objectConstructorGetOwnPropertyNames):
  3516. (JSC::objectConstructorKeys):
  3517. * runtime/RegExpConstructor.cpp:
  3518. (JSC::RegExpConstructor::finishCreation):
  3519. 2012-09-07 Gavin Barraclough <barraclough@apple.com>
  3520. CALLFRAME_OFFSET and EXCEPTION_OFFSET are same in ctiTrampoline on ARM Thumb2
  3521. https://bugs.webkit.org/show_bug.cgi?id=82013
  3522. Reviewed by Geoff Garen.
  3523. Neither of these values need to be stored. At all.
  3524. * jit/JITStubs.cpp:
  3525. (JSC):
  3526. (JSC::ctiTrampoline):
  3527. (JSC::JITThunks::JITThunks):
  3528. - Nothing to see here. Move along.
  3529. 2012-09-07 Sheriff Bot <webkit.review.bot@gmail.com>
  3530. Unreviewed, rolling out r127938.
  3531. http://trac.webkit.org/changeset/127938
  3532. https://bugs.webkit.org/show_bug.cgi?id=96166
  3533. It broke the build (Requested by smfr on #webkit).
  3534. * llint/LowLevelInterpreter.cpp:
  3535. (JSC):
  3536. (JSC::CLoop::execute):
  3537. * offlineasm/cloop.rb:
  3538. 2012-09-07 Geoffrey Garen <ggaren@apple.com>
  3539. Refactored bytecode generator initialization to support moving captured vars around
  3540. https://bugs.webkit.org/show_bug.cgi?id=96159
  3541. Reviewed by Gavin Barraclough.
  3542. This patch separates the stages of allocating registers, declaring identifiers
  3543. in the symbol table, and initializing registers, so you can change
  3544. allocation decisions without breaking the world.
  3545. * bytecompiler/BytecodeGenerator.cpp:
  3546. (JSC::BytecodeGenerator::BytecodeGenerator): Call a set of helper functions
  3547. instead of inlining all the code, to help clarity.
  3548. (JSC::BytecodeGenerator::allocateCapturedVars):
  3549. (JSC::BytecodeGenerator::allocateUncapturedVars):
  3550. (JSC::BytecodeGenerator::allocateActivationVar):
  3551. (JSC::BytecodeGenerator::allocateArgumentsVars):
  3552. (JSC::BytecodeGenerator::allocateCalleeVarUndeclared):
  3553. (JSC::BytecodeGenerator::declareParameters):
  3554. (JSC::BytecodeGenerator::declareCallee):
  3555. (JSC::BytecodeGenerator::initCalleeVar):
  3556. (JSC::BytecodeGenerator::initArgumentsVars):
  3557. (JSC::BytecodeGenerator::initActivationVar):
  3558. (JSC::BytecodeGenerator::initThisParameter):
  3559. (JSC::BytecodeGenerator::initFunctionDeclarations):
  3560. (JSC::BytecodeGenerator::declareParameter):
  3561. (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
  3562. (JSC::BytecodeGenerator::createActivationIfNecessary): Factored these
  3563. helper functions out from pre-existing code.
  3564. * bytecompiler/BytecodeGenerator.h:
  3565. (BytecodeGenerator):
  3566. * parser/ASTBuilder.h:
  3567. (JSC::ASTBuilder::createFuncDeclStatement):
  3568. (JSC::ASTBuilder::addVar):
  3569. * parser/Nodes.h:
  3570. (JSC::DeclarationStacks::VarDeclaration::VarDeclaration):
  3571. (VarDeclaration):
  3572. (JSC::DeclarationStacks::FunctionDeclaration::FunctionDeclaration):
  3573. (FunctionDeclaration): Declaration stacks get a little more data now,
  3574. to support allocating registers before putting things in the symbol
  3575. table. I'm convinced that we should eventually just expand the symbol
  3576. table to understand these things.
  3577. 2012-09-07 Mark Lam <mark.lam@apple.com>
  3578. Fix a llint C++ interpreter bugs.
  3579. https://bugs.webkit.org/show_bug.cgi?id=96127.
  3580. Reviewed by Filip Pizlo.
  3581. * llint/LowLevelInterpreter.cpp:
  3582. (JSC):
  3583. (JSC::CLoop::execute):
  3584. * offlineasm/cloop.rb:
  3585. 2012-09-07 Gavin Barraclough <barraclough@apple.com>
  3586. Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError
  3587. https://bugs.webkit.org/show_bug.cgi?id=93873
  3588. Reviewed by Sam Weinig.
  3589. * runtime/ObjectPrototype.cpp:
  3590. (JSC::objectProtoFuncDefineGetter):
  3591. - throw TypeError instead of SyntaxError
  3592. (JSC::objectProtoFuncDefineSetter):
  3593. - throw TypeError instead of SyntaxError
  3594. 2012-09-06 Mark Hahnenberg <mhahnenberg@apple.com>
  3595. JSC should have a zombie mode
  3596. https://bugs.webkit.org/show_bug.cgi?id=96047
  3597. Reviewed by Geoffrey Garen.
  3598. To aid clients of JSC while they are debugging memory issues, we should add a zombie
  3599. mode that scribbles into objects in the MarkedSpace after they are found to be dead
  3600. to prevent a sort of "use after free" situation. As a first cut we should support a
  3601. mode that just scribbles on objects prior to their being reused (i.e. while they are
  3602. "zombies") and a mode in which, in addition to scribbling on zombies, once an object
  3603. has been marked its mark bit will never be cleared, thus giving us "immortal" zombies.
  3604. These two modes will be enabled through the use of environment variables. For now these
  3605. will be "JSZombieEnabled" and "JSImmortalZombieEnabled". Setting them to any value will
  3606. result in the use of the appropriate mode.
  3607. * heap/Heap.cpp:
  3608. (JSC::Heap::collect): Zombifies dead objects at the end of collection if zombie mode is enabled.
  3609. (ZombifyCellFunctor):
  3610. (JSC::ZombifyCellFunctor::ZombifyCellFunctor): Sets marked bits for dead objects if in immortal mode and writes 0xbbadbeef into them.
  3611. (JSC::ZombifyCellFunctor::operator()):
  3612. (JSC):
  3613. (ZombifyBlockFunctor):
  3614. (JSC::ZombifyBlockFunctor::operator()):
  3615. (JSC::Heap::zombifyDeadObjects): Eagerly sweeps so that we don't write garbage into an object before it
  3616. is finalized/destroyed.
  3617. * heap/Heap.h:
  3618. (Heap):
  3619. * heap/MarkedBlock.h:
  3620. (MarkedBlock):
  3621. (JSC::MarkedBlock::forEachDeadCell): Used to iterate over dead cells at the end of collection if zombie mode is enabled.
  3622. (JSC):
  3623. * runtime/Options.cpp:
  3624. (JSC::Options::initialize):
  3625. * runtime/Options.h:
  3626. (JSC):
  3627. 2012-09-05 Geoffrey Garen <ggaren@apple.com>
  3628. Rolled back in <http://trac.webkit.org/changeset/127698> with a fix for
  3629. fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html, which
  3630. is to make sure that function declarations don't put their names in scope.
  3631. Reviewed by Gavin Barraclough.
  3632. Named functions should not allocate scope objects for their names
  3633. https://bugs.webkit.org/show_bug.cgi?id=95659
  3634. Reviewed by Oliver Hunt.
  3635. 2012-09-06 Michael Saboff <msaboff@apple.com>
  3636. 16 bit JSRopeString up converts an 8 bit fibers to 16 bits during resolution
  3637. https://bugs.webkit.org/show_bug.cgi?id=95810
  3638. Reviewed by Benjamin Poulain.
  3639. Added 8 bit path that copies the contents of an 8 bit fiber to the 16 bit buffer
  3640. when resolving a 16 bit rope.
  3641. * runtime/JSString.cpp:
  3642. (JSC::JSRopeString::resolveRopeSlowCase):
  3643. 2012-09-06 Gavin Barraclough <barraclough@apple.com>
  3644. JS test suite puts incorrect limitations on Function.toString()
  3645. https://bugs.webkit.org/show_bug.cgi?id=3975
  3646. Reviewed by Geoff Garen.
  3647. The result of function toString is implementation defined;
  3648. these test cases were looking for specific whitespace formatting
  3649. that matches mozilla's, and for redundant braces to be inserted
  3650. around if/else blocks. Stop that.
  3651. * tests/mozilla/expected.html:
  3652. * tests/mozilla/js1_2/function/tostring-1.js:
  3653. (simplify):
  3654. - reduce whitespace differences
  3655. * tests/mozilla/js1_2/function/tostring-2.js:
  3656. (simplify):
  3657. - reduce whitespace differences
  3658. (TestOr):
  3659. (TestAnd):
  3660. - added braces to match expected output
  3661. 2012-09-06 Yuqiang Xian <yuqiang.xian@intel.com>
  3662. Performance regressions on 32-bit platforms with revisions 125637 and 126387
  3663. https://bugs.webkit.org/show_bug.cgi?id=95953
  3664. Reviewed by Filip Pizlo.
  3665. * jit/JITPropertyAccess32_64.cpp:
  3666. (JSC::JIT::emit_op_get_by_val): Fix the typo.
  3667. 2012-09-05 Geoffrey Garen <ggaren@apple.com>
  3668. Rolled out <http://trac.webkit.org/changeset/127698> because it broke
  3669. fast/dom/HTMLScriptElement/script-reexecution-pretty-diff.html
  3670. Named functions should not allocate scope objects for their names
  3671. https://bugs.webkit.org/show_bug.cgi?id=95659
  3672. Reviewed by Oliver Hunt.
  3673. 2012-09-06 Mark Lam <mark.lam@apple.com>
  3674. Renamed useYarrJIT() option to useRegExpJIT(). Also fixed regression in
  3675. which inadvertantly allows the ASM llint to use the baseline JIT when
  3676. useRegExpJIT() is true.
  3677. https://bugs.webkit.org/show_bug.cgi?id=95918.
  3678. Reviewed by Geoffrey Garen.
  3679. * runtime/JSGlobalData.cpp:
  3680. (JSC::enableAssembler):
  3681. (JSC::JSGlobalData::JSGlobalData):
  3682. * runtime/JSGlobalData.h:
  3683. (JSC::JSGlobalData::canUseJIT):
  3684. (JSC::JSGlobalData::canUseRegExpJIT):
  3685. (JSGlobalData):
  3686. * runtime/Options.cpp:
  3687. (JSC::Options::initialize):
  3688. * runtime/Options.h:
  3689. (JSC):
  3690. 2012-09-06 Patrick Gansterer <paroga@webkit.org>
  3691. Build fix for Interpreter after r127698.
  3692. * interpreter/Interpreter.cpp:
  3693. (JSC::Interpreter::privateExecute):
  3694. 2012-09-05 Geoffrey Garen <ggaren@apple.com>
  3695. Named functions should not allocate scope objects for their names
  3696. https://bugs.webkit.org/show_bug.cgi?id=95659
  3697. Reviewed by Oliver Hunt.
  3698. In most cases, we can merge a function expression's name into its symbol
  3699. table. This reduces memory footprint per closure from three objects
  3700. (function + activation + name scope) to two (function + activation),
  3701. speeds up closure allocation, and speeds up recursive calls.
  3702. In the case of a named function expression that contains a non-strict
  3703. eval, the rules are so bat-poop crazy that I don't know how to model
  3704. them without an extra object. Since functions now default to not having
  3705. such an object, this case needs to allocate the object on function
  3706. entry.
  3707. Therefore, this patch makes the slow case a bit slower so the fast case
  3708. can be faster and more memory-efficient. (Note that the slow case already
  3709. allocates an activation on entry, and until recently also allocated a
  3710. scope chain node on entry, so adding one allocation on entry shouldn't
  3711. break the bank.)
  3712. * bytecode/CodeBlock.cpp:
  3713. (JSC::CodeBlock::CodeBlock): Caught a missed initializer. No behavior change.
  3714. * bytecompiler/BytecodeGenerator.cpp:
  3715. (JSC::BytecodeGenerator::BytecodeGenerator): Put the callee in static scope
  3716. during compilation so it doesn't need to be in dynamic scope at runtime.
  3717. (JSC::BytecodeGenerator::resolveCallee):
  3718. (JSC::BytecodeGenerator::addCallee): Helper functions for either statically
  3719. resolving the callee or adding a dynamic scope that will resolve to it,
  3720. depending on whether you're in the fast path.
  3721. We move the callee into a var location if it's captured because activations
  3722. prefer to have contiguous ranges of captured variables.
  3723. * bytecompiler/BytecodeGenerator.h:
  3724. (JSC::BytecodeGenerator::registerFor):
  3725. (BytecodeGenerator):
  3726. * dfg/DFGOperations.cpp:
  3727. * interpreter/Interpreter.cpp:
  3728. (JSC::Interpreter::privateExecute):
  3729. * jit/JITStubs.cpp:
  3730. (JSC::DEFINE_STUB_FUNCTION):
  3731. * llint/LLIntSlowPaths.cpp:
  3732. (JSC::LLInt::LLINT_SLOW_PATH_DECL): This is the point of the patch: remove
  3733. one allocation in the case of a named function expression.
  3734. * parser/Parser.cpp:
  3735. (JSC::::Parser):
  3736. * parser/Parser.h:
  3737. (JSC::Scope::declareCallee):
  3738. (Scope):
  3739. (Parser):
  3740. (JSC::parse):
  3741. * runtime/Executable.cpp:
  3742. (JSC::EvalExecutable::compileInternal):
  3743. (JSC::ProgramExecutable::checkSyntax):
  3744. (JSC::ProgramExecutable::compileInternal):
  3745. (JSC::FunctionExecutable::produceCodeBlockFor):
  3746. (JSC::FunctionExecutable::fromGlobalCode): Pipe the callee's name through
  3747. the parser so we get accurate information on whether the callee was captured.
  3748. (JSC::FunctionExecutable::FunctionExecutable):
  3749. (JSC::EvalExecutable::compileInternal):
  3750. (JSC::ProgramExecutable::checkSyntax):
  3751. (JSC::ProgramExecutable::compileInternal):
  3752. (JSC::FunctionExecutable::produceCodeBlockFor):
  3753. (JSC::FunctionExecutable::fromGlobalCode):
  3754. * runtime/Executable.h:
  3755. (JSC::FunctionExecutable::create):
  3756. (FunctionExecutable):
  3757. (JSC::FunctionExecutable::finishCreation): I had to refactor function
  3758. creation to support the following function constructor quirk: the function
  3759. gets a name, but its name is not in lexical scope.
  3760. To simplify this, FunctionExecutable now automatically extracts all the
  3761. data it needs from the parsed node. The special "fromGlobalCode" path
  3762. used by the function constructor creates an anonymous function, and then
  3763. quirkily sets the value used by the .name property to be non-null, even
  3764. though the parsed name is null.
  3765. * runtime/JSNameScope.h:
  3766. (JSC::JSNameScope::create):
  3767. (JSC::JSNameScope::JSNameScope): Added support for explicitly specifying
  3768. your container scope. The compiler uses this for named function expressions.
  3769. 2012-09-05 Gavin Barraclough <barraclough@apple.com>
  3770. a = data[a]++; sets the wrong key in data
  3771. https://bugs.webkit.org/show_bug.cgi?id=91270
  3772. Reviewed by Oliver Hunt.
  3773. Postfix inc/dec is unsafely using finalDestination, can trample base/subscript prior to the result being put.
  3774. * bytecompiler/NodesCodegen.cpp:
  3775. (JSC::PostfixNode::emitResolve):
  3776. - Remove redundant parens.
  3777. (JSC::PostfixNode::emitBracket):
  3778. (JSC::PostfixNode::emitDot):
  3779. - Refactored to use tempDestination instead of finalDestination.
  3780. (JSC::PrefixNode::emitBracket):
  3781. (JSC::PrefixNode::emitDot):
  3782. - Should be using emitPreIncOrDec.
  3783. 2012-09-05 Gavin Barraclough <barraclough@apple.com>
  3784. Bug, assignment within subscript of prefix/postfix increment of bracket access
  3785. https://bugs.webkit.org/show_bug.cgi?id=95913
  3786. Reviewed by Oliver Hunt.
  3787. javascript:alert((function(){ var a = { x:1 }; var b = { x:1 }; a[a=b,"x"]++; return a.x; })())
  3788. * bytecompiler/NodesCodegen.cpp:
  3789. (JSC::PostfixNode::emitBracket):
  3790. (JSC::PrefixNode::emitBracket):
  3791. - Should check for assigments in the subscript when loading the base.
  3792. * parser/Nodes.h:
  3793. (JSC::BracketAccessorNode::subscriptHasAssignments):
  3794. (BracketAccessorNode):
  3795. - Used by emitBracket methods.
  3796. 2012-09-05 Gavin Barraclough <barraclough@apple.com>
  3797. Merge prefix/postfix nodes
  3798. https://bugs.webkit.org/show_bug.cgi?id=95898
  3799. Reviewed by Geoff Garen.
  3800. Simplify the AST.
  3801. This will also mean we have access to m_subscriptHasAssignments when generating a prefix/postfix op applied to a bracket access.
  3802. * bytecompiler/NodesCodegen.cpp:
  3803. (JSC::PostfixNode::emitResolve):
  3804. - was PostfixResolveNode::emitBytecode
  3805. (JSC::PostfixNode::emitBracket):
  3806. - was PostfixBracketNode::emitBytecode
  3807. (JSC::PostfixNode::emitDot):
  3808. - was PostfixDotNode::emitBytecode
  3809. (JSC::PostfixNode::emitBytecode):
  3810. - was PostfixErrorNode::emitBytecode, call resolve/bracket/dot version as appropriate.
  3811. (JSC::PrefixNode::emitResolve):
  3812. - was PrefixResolveNode::emitBytecode
  3813. (JSC::PrefixNode::emitBracket):
  3814. - was PrefixBracketNode::emitBytecode
  3815. (JSC::PrefixNode::emitDot):
  3816. - was PrefixDotNode::emitBytecode
  3817. (JSC::PrefixNode::emitBytecode):
  3818. - was PrefixErrorNode::emitBytecode, call resolve/bracket/dot version as appropriate.
  3819. * parser/ASTBuilder.h:
  3820. (JSC::ASTBuilder::makePrefixNode):
  3821. - Just makes a PrefixNode!
  3822. (JSC::ASTBuilder::makePostfixNode):
  3823. - Just makes a PostfixNode!
  3824. * parser/NodeConstructors.h:
  3825. (JSC::PostfixNode::PostfixNode):
  3826. - Added, merge of PostfixResolveNode/PostfixBracketNode/PostfixDotNode/PostfixErrorNode.
  3827. (JSC::PrefixNode::PrefixNode):
  3828. - Added, merge of PrefixResolveNode/PrefixBracketNode/PrefixDotNode/PrefixErrorNode.
  3829. * parser/Nodes.h:
  3830. (PostfixNode):
  3831. - Added, merge of PostfixResolveNode/PostfixBracketNode/PostfixDotNode/PostfixErrorNode.
  3832. (PrefixNode):
  3833. - Added, merge of PrefixResolveNode/PrefixBracketNode/PrefixDotNode/PrefixErrorNode.
  3834. 2012-09-05 Mark Hahnenberg <mhahnenberg@apple.com>
  3835. Remove use of JSCell::classInfoOffset() from tryCacheGetByID
  3836. https://bugs.webkit.org/show_bug.cgi?id=95860
  3837. Reviewed by Oliver Hunt.
  3838. We should just do the indirection through the Structure instead.
  3839. * dfg/DFGRepatch.cpp:
  3840. (JSC::DFG::tryCacheGetByID):
  3841. 2012-09-05 Geoffrey Garen <ggaren@apple.com>
  3842. Throw exceptions when assigning to const in strict mode
  3843. https://bugs.webkit.org/show_bug.cgi?id=95894
  3844. Reviewed by Oliver Hunt.
  3845. Currently, this never happens; but it will start happening once the
  3846. callee is a local const register. In this patch, there's no change in
  3847. behavior.
  3848. * bytecompiler/BytecodeGenerator.cpp:
  3849. (JSC::BytecodeGenerator::emitReadOnlyExceptionIfNeeded): Helper function
  3850. for doing the throwing.
  3851. * bytecompiler/BytecodeGenerator.h:
  3852. * bytecompiler/NodesCodegen.cpp:
  3853. (JSC::PostfixResolveNode::emitBytecode):
  3854. (JSC::PrefixResolveNode::emitBytecode):
  3855. (JSC::ReadModifyResolveNode::emitBytecode):
  3856. (JSC::AssignResolveNode::emitBytecode): Call the helper function.
  3857. 2012-09-05 Geoffrey Garen <ggaren@apple.com>
  3858. Refactored callee access in the DFG to support it in the general case
  3859. https://bugs.webkit.org/show_bug.cgi?id=95887
  3860. Reviewed by Phil Pizlo and Gavin Barraclough.
  3861. To support named function expressions, the DFG needs to understand the
  3862. callee register being used in arbitrary expressions, and not just
  3863. create_this.
  3864. * dfg/DFGByteCodeParser.cpp:
  3865. (JSC::DFG::ByteCodeParser::getDirect):
  3866. (JSC::DFG::ByteCodeParser::getCallee): Remap access to the callee register
  3867. into a GetCallee node. Otherwise, we get confused and think we have a
  3868. negatively indexed argument.
  3869. (ByteCodeParser):
  3870. (JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand): Inlining also
  3871. needs to remap, but to the callee in the inline frame, and not the caller's
  3872. callee.
  3873. (JSC::DFG::ByteCodeParser::parseBlock): Since we support the callee in
  3874. the general case now, there's no need to handle it in a special way for
  3875. create_this.
  3876. 2012-09-05 Mark Hahnenberg <mhahnenberg@apple.com>
  3877. Remove use of JSCell::classInfoOffset() from virtualForThunkGenerator
  3878. https://bugs.webkit.org/show_bug.cgi?id=95821
  3879. Reviewed by Oliver Hunt.
  3880. We can replace the load of the ClassInfo from the object with a load from the Structure.
  3881. * dfg/DFGThunks.cpp:
  3882. (JSC::DFG::virtualForThunkGenerator):
  3883. 2012-09-05 Benjamin Poulain <bpoulain@apple.com>
  3884. Fix the uses of String::operator+=() for Mac
  3885. https://bugs.webkit.org/show_bug.cgi?id=95818
  3886. Reviewed by Dan Bernstein.
  3887. * jsc.cpp:
  3888. (functionJSCStack): Use StringBuilder to create the stack dump, it is faster
  3889. and avoid String::operator+=().
  3890. * parser/Parser.h:
  3891. (JSC::Parser::updateErrorMessageSpecialCase):
  3892. (JSC::Parser::updateErrorMessage):
  3893. (JSC::Parser::updateErrorWithNameAndMessage):
  3894. Use the String operators (and makeString) to concatenate the strings.
  3895. 2012-09-05 Gabor Rapcsanyi <rgabor@webkit.org>
  3896. DFG JIT doesn't work properly on ARM hardfp
  3897. https://bugs.webkit.org/show_bug.cgi?id=95684
  3898. Reviewed by Filip Pizlo.
  3899. Add hardfp support to DFG JIT. The patch is created with the
  3900. help of Zoltan Herczeg.
  3901. * dfg/DFGCCallHelpers.h:
  3902. (CCallHelpers):
  3903. (JSC::DFG::CCallHelpers::setupArguments):
  3904. * dfg/DFGFPRInfo.h:
  3905. (FPRInfo):
  3906. * dfg/DFGSpeculativeJIT.h:
  3907. (SpeculativeJIT):
  3908. (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
  3909. (JSC::DFG::SpeculativeJIT::appendCallSetResult):
  3910. 2012-09-04 Mark Lam <mark.lam@apple.com>
  3911. Allow the YarrJIT to use the assembler even when useJIT() is false.
  3912. Introduce the useYarrJIT() option.
  3913. https://bugs.webkit.org/show_bug.cgi?id=95809.
  3914. Reviewed by Geoffrey Garen.
  3915. * runtime/JSGlobalData.cpp:
  3916. (JSC::enableAssembler):
  3917. * runtime/Options.cpp:
  3918. (JSC::Options::initialize):
  3919. * runtime/Options.h:
  3920. (JSC):
  3921. 2012-09-04 Gavin Barraclough <barraclough@apple.com>
  3922. inc/dec behave incorrectly operating on a resolved const
  3923. https://bugs.webkit.org/show_bug.cgi?id=95815
  3924. Reviewed by Geoff Garen.
  3925. There are two bugs here.
  3926. (1) When the value being incremented is const, and the result is ignored, we assume this cannot be observed, and emit no code.
  3927. However if the value being incremented is not a primitive & has a valueOf conversion, then this should be being called.
  3928. (2) In the case of a pre-increment of a const value where the result is not ignored, we'll move +/-1 to the destination, then
  3929. add the resolved const value being incremented to this. This is problematic if the destination is a local, and the const
  3930. value being incremented has a valueOf conversion that throws - the destination will be modified erroneously. Instead, we
  3931. need to use a temporary location.
  3932. * bytecompiler/NodesCodegen.cpp:
  3933. (JSC::PostfixResolveNode::emitBytecode):
  3934. (JSC::PrefixResolveNode::emitBytecode):
  3935. - always at least perform a toNumber conversion, use tempDestination when reducing inc/dec to an add +/-1.
  3936. 2012-09-04 Filip Pizlo <fpizlo@apple.com>
  3937. DFG GetByVal for JSArrays shouldn't OSR exit every time that the index is out of bound
  3938. https://bugs.webkit.org/show_bug.cgi?id=95717
  3939. Reviewed by Oliver Hunt.
  3940. Rolling back in after fixing the negative index case.
  3941. Make GetByVal for JSArrayOutOfBounds do meaningful things. The profiling was already
  3942. there so we should just use it!
  3943. * bytecode/DFGExitProfile.h:
  3944. (JSC::DFG::exitKindToString):
  3945. * dfg/DFGAbstractState.cpp:
  3946. (JSC::DFG::AbstractState::execute):
  3947. * dfg/DFGOperations.cpp:
  3948. * dfg/DFGOperations.h:
  3949. * dfg/DFGSpeculativeJIT.h:
  3950. (JSC::DFG::SpeculativeJIT::callOperation):
  3951. * dfg/DFGSpeculativeJIT32_64.cpp:
  3952. (JSC::DFG::SpeculativeJIT::compile):
  3953. * dfg/DFGSpeculativeJIT64.cpp:
  3954. (JSC::DFG::SpeculativeJIT::compile):
  3955. 2012-09-04 Sheriff Bot <webkit.review.bot@gmail.com>
  3956. Unreviewed, rolling out r127503.
  3957. http://trac.webkit.org/changeset/127503
  3958. https://bugs.webkit.org/show_bug.cgi?id=95788
  3959. broke some tests (fast/js/dfg-negative-array-index, fast/js
  3960. /dfg-put-by-val-setter-then-get-by-val) (Requested by thorton
  3961. on #webkit).
  3962. * bytecode/DFGExitProfile.h:
  3963. (JSC::DFG::exitKindToString):
  3964. * dfg/DFGAbstractState.cpp:
  3965. (JSC::DFG::AbstractState::execute):
  3966. * dfg/DFGOperations.cpp:
  3967. * dfg/DFGOperations.h:
  3968. * dfg/DFGSpeculativeJIT.h:
  3969. (JSC::DFG::SpeculativeJIT::callOperation):
  3970. * dfg/DFGSpeculativeJIT32_64.cpp:
  3971. (JSC::DFG::SpeculativeJIT::compile):
  3972. * dfg/DFGSpeculativeJIT64.cpp:
  3973. (JSC::DFG::SpeculativeJIT::compile):
  3974. 2012-09-04 Benjamin Poulain <bpoulain@apple.com>
  3975. Improve JSC use of Strings after the UString->String change
  3976. https://bugs.webkit.org/show_bug.cgi?id=95633
  3977. Reviewed by Geoffrey Garen.
  3978. This patch improve the use of strings in the JSC runtime.
  3979. The initialization of Identifier is left for future patches.
  3980. The improvements are the following:
  3981. -5% faster to raise one of the modified exception.
  3982. -3 times faster to execute Boolean::toString()
  3983. Most of the changes are just about using the new methods
  3984. for string literals.
  3985. With the changes, the binary on x86_64 gets 176 bytes smaller.
  3986. * API/JSCallbackObjectFunctions.h:
  3987. (JSC::::staticFunctionGetter):
  3988. (JSC::::callbackGetter):
  3989. * API/JSContextRef.cpp:
  3990. (JSContextCreateBacktrace):
  3991. * API/JSObjectRef.cpp:
  3992. (JSObjectMakeFunctionWithCallback):
  3993. * bytecode/CodeBlock.cpp:
  3994. (JSC::valueToSourceString):
  3995. (JSC::CodeBlock::nameForRegister):
  3996. * interpreter/Interpreter.cpp:
  3997. (JSC::Interpreter::addStackTraceIfNecessary):
  3998. * runtime/ArrayConstructor.cpp:
  3999. (JSC::constructArrayWithSizeQuirk):
  4000. * runtime/ArrayPrototype.cpp:
  4001. (JSC::shift):
  4002. (JSC::unshift):
  4003. (JSC::arrayProtoFuncPop):
  4004. (JSC::arrayProtoFuncReverse):
  4005. * runtime/BooleanPrototype.cpp:
  4006. (JSC::booleanProtoFuncToString): Instead of instanciating new strings, reuse the
  4007. keywords available in SmallStrings. Avoiding the creation of the JSString and StringImpl
  4008. makes the method significantly faster.
  4009. * runtime/DateConversion.cpp:
  4010. (JSC::formatDateTime):
  4011. * runtime/DatePrototype.cpp:
  4012. (JSC::formatLocaleDate):
  4013. (JSC::formateDateInstance):
  4014. (JSC::dateProtoFuncToISOString):
  4015. Change the way we use snprintf() for clarity and performance.
  4016. Instead of allocating one extra byte to put a zero "just in case", we use the size returned
  4017. by snprintf().
  4018. To prevent any overflow from a programming mistake, we explicitely test for overflow and
  4019. return an empty string.
  4020. (JSC::dateProtoFuncToJSON):
  4021. * runtime/Error.cpp:
  4022. (JSC::createNotEnoughArgumentsError):
  4023. (JSC::throwTypeError):
  4024. (JSC::throwSyntaxError):
  4025. * runtime/Error.h:
  4026. (JSC::StrictModeTypeErrorFunction::create):
  4027. * runtime/ErrorPrototype.cpp:
  4028. (JSC::ErrorPrototype::finishCreation):
  4029. (JSC::errorProtoFuncToString):
  4030. Using a null String is correct because (8) uses jsString(), (9) tests for a length of 0.
  4031. * runtime/ExceptionHelpers.cpp:
  4032. (JSC::InterruptedExecutionError::defaultValue):
  4033. (JSC::TerminatedExecutionError::defaultValue):
  4034. (JSC::createStackOverflowError):
  4035. (JSC::createOutOfMemoryError):
  4036. * runtime/Executable.cpp:
  4037. (JSC::EvalExecutable::compileInternal):
  4038. (JSC::FunctionExecutable::paramString):
  4039. * runtime/FunctionConstructor.cpp:
  4040. (JSC::constructFunction):
  4041. (JSC::constructFunctionSkippingEvalEnabledCheck):
  4042. * runtime/FunctionPrototype.h:
  4043. (JSC::FunctionPrototype::create):
  4044. Using a null String for the name is correct because InternalFunction uses jsString()
  4045. to create the name value.
  4046. * runtime/InternalFunction.cpp:
  4047. (JSC::InternalFunction::finishCreation):
  4048. There is no need to create an empty string for a null string, jsString() handle both
  4049. cases as empty JSString.
  4050. * runtime/JSArray.cpp:
  4051. (JSC::reject):
  4052. (JSC::SparseArrayValueMap::put):
  4053. (JSC::JSArray::put):
  4054. (JSC::JSArray::putByIndexBeyondVectorLength):
  4055. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  4056. (JSC::JSArray::setLength):
  4057. (JSC::JSArray::pop):
  4058. (JSC::JSArray::push):
  4059. * runtime/JSFunction.cpp:
  4060. (JSC::JSFunction::finishCreation): Same issue as InternalFunction::finishCreation.
  4061. (JSC::JSFunction::callerGetter):
  4062. (JSC::JSFunction::defineOwnProperty):
  4063. * runtime/JSGlobalData.cpp:
  4064. (JSC::enableAssembler): Use CFSTR() instead of CFStringCreateWithCString().
  4065. CFStringCreateWithCString() copy the content and may choose to decode the data.
  4066. CFSTR() is much more efficient.
  4067. * runtime/JSGlobalObject.cpp:
  4068. (JSC::JSGlobalObject::reset):
  4069. JSFunction uses jsString() to create the name, we can use null strings instead
  4070. of creating empty strings.
  4071. (JSC::JSGlobalObject::createThrowTypeError): ditto.
  4072. * runtime/JSGlobalObjectFunctions.cpp:
  4073. (JSC::encode):
  4074. (JSC::decode):
  4075. (JSC::globalFuncEval):
  4076. * runtime/JSONObject.cpp:
  4077. (JSC::Stringifier::appendStringifiedValue):
  4078. (JSC::Stringifier::Holder::appendNextProperty):
  4079. (JSC::JSONProtoFuncParse):
  4080. (JSC::JSONProtoFuncStringify):
  4081. * runtime/JSObject.cpp:
  4082. (JSC::JSObject::put):
  4083. (JSC::JSObject::defaultValue):
  4084. (JSC::JSObject::hasInstance):
  4085. (JSC::JSObject::defineOwnProperty):
  4086. * runtime/JSString.cpp:
  4087. Return an empty JSString to avoid the creation of a temporary empty String.
  4088. (JSC::JSRopeString::getIndexSlowCase):
  4089. * runtime/JSString.h:
  4090. (JSC): Remove the versions of jsNontrivialString() taking a char*. All the callers
  4091. have been replaced by calls using ASCIILiteral.
  4092. * runtime/JSValue.cpp:
  4093. (JSC::JSValue::putToPrimitive):
  4094. * runtime/LiteralParser.cpp:
  4095. (JSC::::Lexer::lex):
  4096. (JSC::::Lexer::lexString):
  4097. (JSC::::Lexer::lexNumber):
  4098. (JSC::::parse):
  4099. * runtime/LiteralParser.h:
  4100. (JSC::LiteralParser::getErrorMessage):
  4101. * runtime/NumberPrototype.cpp:
  4102. (JSC::numberProtoFuncToExponential):
  4103. (JSC::numberProtoFuncToFixed):
  4104. (JSC::numberProtoFuncToPrecision):
  4105. (JSC::numberProtoFuncToString):
  4106. * runtime/ObjectConstructor.cpp:
  4107. (JSC::objectConstructorGetPrototypeOf):
  4108. (JSC::objectConstructorGetOwnPropertyDescriptor):
  4109. (JSC::objectConstructorGetOwnPropertyNames):
  4110. (JSC::objectConstructorKeys):
  4111. (JSC::toPropertyDescriptor):
  4112. (JSC::objectConstructorDefineProperty):
  4113. (JSC::objectConstructorDefineProperties):
  4114. (JSC::objectConstructorCreate):
  4115. (JSC::objectConstructorSeal):
  4116. (JSC::objectConstructorFreeze):
  4117. (JSC::objectConstructorPreventExtensions):
  4118. (JSC::objectConstructorIsSealed):
  4119. (JSC::objectConstructorIsFrozen):
  4120. (JSC::objectConstructorIsExtensible):
  4121. * runtime/ObjectPrototype.cpp:
  4122. (JSC::objectProtoFuncDefineGetter):
  4123. (JSC::objectProtoFuncDefineSetter):
  4124. (JSC::objectProtoFuncToString):
  4125. * runtime/RegExpConstructor.cpp:
  4126. (JSC::constructRegExp):
  4127. * runtime/RegExpObject.cpp:
  4128. (JSC::reject):
  4129. (JSC::regExpObjectSource):
  4130. * runtime/RegExpPrototype.cpp:
  4131. (JSC::regExpProtoFuncCompile):
  4132. * runtime/StringObject.cpp:
  4133. (JSC::StringObject::defineOwnProperty):
  4134. * runtime/StringPrototype.cpp:
  4135. (JSC::jsSpliceSubstrings):
  4136. (JSC::jsSpliceSubstringsWithSeparators):
  4137. 2012-09-04 Filip Pizlo <fpizlo@apple.com>
  4138. DFG GetByVal for JSArrays shouldn't OSR exit every time that the index is out of bound
  4139. https://bugs.webkit.org/show_bug.cgi?id=95717
  4140. Reviewed by Oliver Hunt.
  4141. Make GetByVal for JSArrayOutOfBounds do meaningful things. The profiling was already
  4142. there so we should just use it!
  4143. * bytecode/DFGExitProfile.h:
  4144. (JSC::DFG::exitKindToString):
  4145. * dfg/DFGAbstractState.cpp:
  4146. (JSC::DFG::AbstractState::execute):
  4147. * dfg/DFGOperations.cpp:
  4148. * dfg/DFGOperations.h:
  4149. * dfg/DFGSpeculativeJIT.h:
  4150. (JSC::DFG::SpeculativeJIT::callOperation):
  4151. * dfg/DFGSpeculativeJIT32_64.cpp:
  4152. (JSC::DFG::SpeculativeJIT::compile):
  4153. * dfg/DFGSpeculativeJIT64.cpp:
  4154. (JSC::DFG::SpeculativeJIT::compile):
  4155. 2012-09-04 Zoltan Horvath <zoltan@webkit.org>
  4156. Extend the coverage of the Custom Allocation Framework in WTF and in JavaScriptCore
  4157. https://bugs.webkit.org/show_bug.cgi?id=95737
  4158. Reviewed by Eric Seidel.
  4159. Add WTF_MAKE_FAST_ALLOCATED macro to the following class declarations because these are instantiated by operator new.
  4160. * wtf/CryptographicallyRandomNumber.cpp: CryptographicallyRandomNumber is instantiated at wtf/CryptographicallyRandomNumber.cpp:162.
  4161. * heap/MachineStackMarker.cpp:
  4162. (MachineThreads::Thread): Thread is instantiated at heap/MachineStackMarker.cpp:196.
  4163. * jit/ExecutableAllocatorFixedVMPool.cpp:
  4164. (FixedVMPoolExecutableAllocator): FixedVMPoolExecutableAllocator is instantiated at jit/ExecutableAllocatorFixedVMPool.cpp:111
  4165. * parser/SourceProviderCache.h:
  4166. (SourceProviderCache): SourceProviderCache is instantiated at parser/SourceProvider.h:49.
  4167. * parser/SourceProviderCacheItem.h:
  4168. (SourceProviderCacheItem): SourceProviderCacheItem is instantiated at parser/Parser.cpp:843.
  4169. * runtime/GCActivityCallback.h:
  4170. (GCActivityCallback): GCActivityCallback is instantiated at runtime/GCActivityCallback.h:96.
  4171. * tools/CodeProfile.h:
  4172. (CodeProfile): CodeProfile is instantiated at JavaScriptCore/tools/CodeProfiling.cpp:140.
  4173. 2012-09-04 Mark Hahnenberg <mhahnenberg@apple.com>
  4174. Remove uses of ClassInfo from SpeculativeJIT::compileObjectOrOtherLogicalNot
  4175. https://bugs.webkit.org/show_bug.cgi?id=95510
  4176. Reviewed by Oliver Hunt.
  4177. More refactoring to get rid of ClassInfo checks in the DFG.
  4178. * dfg/DFGAbstractState.cpp:
  4179. (JSC::DFG::AbstractState::execute):
  4180. * dfg/DFGSpeculativeJIT.h:
  4181. (SpeculativeJIT):
  4182. * dfg/DFGSpeculativeJIT32_64.cpp:
  4183. (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot):
  4184. (JSC::DFG::SpeculativeJIT::compileLogicalNot):
  4185. * dfg/DFGSpeculativeJIT64.cpp:
  4186. (JSC::DFG::SpeculativeJIT::compileNonStringCellOrOtherLogicalNot):
  4187. (JSC::DFG::SpeculativeJIT::compileLogicalNot):
  4188. 2012-09-03 Patrick Gansterer <paroga@webkit.org>
  4189. Unreviewed. Build fix for ENABLE(CLASSIC_INTERPRETER) after r127393.
  4190. * interpreter/Interpreter.h:
  4191. 2012-09-02 Geoffrey Garen <ggaren@apple.com>
  4192. Fixed failures seen on Linux bots.
  4193. * jit/JITOpcodes.cpp:
  4194. (JSC::JIT::emit_op_push_with_scope):
  4195. * jit/JITOpcodes32_64.cpp:
  4196. (JSC::JIT::emit_op_push_with_scope):
  4197. * jit/JITStubs.cpp:
  4198. (JSC::DEFINE_STUB_FUNCTION):
  4199. * jit/JITStubs.h: push_*_scope doesn't have a destination operand anymore.
  4200. Accordingly, update these places in the baseline JIT, which I missed in my last patch.
  4201. 2012-09-02 Geoffrey Garen <ggaren@apple.com>
  4202. Refactored scope chain opcodes to support optimization for named function expressions
  4203. https://bugs.webkit.org/show_bug.cgi?id=95658
  4204. Reviewed by Sam Weinig.
  4205. Renamed
  4206. push_scope => push_with_scope
  4207. push_new_scope => push_name_scope
  4208. to clarify the difference between them.
  4209. Changed push_with_scope and push_name_scope not to save the new scope in
  4210. a temporary register, since doing so made optimization harder.
  4211. (The old behavior was a hold-over from when the scope chain wasn't
  4212. a GC object, and wouldn't be marked otherwise. Now, the scope chain is
  4213. marked because it is a GC object pointed to by the call frame.)
  4214. Changed push_name_scope to accept an operand specifying the attributes
  4215. for the named property, instead of assuming DontDelete, because a named
  4216. function expression needs ReadOnly|DontDelete.
  4217. * bytecompiler/BytecodeGenerator.cpp:
  4218. (JSC::BytecodeGenerator::highestUsedRegister): Removed this function,
  4219. which used to be related to preserving saved scope object temporaries,
  4220. because it had no callers.
  4221. 2012-09-01 Geoffrey Garen <ggaren@apple.com>
  4222. Rolled back out a piece of <http://trac.webkit.org/changeset/127293>
  4223. because it broke inspector tests on Windows.
  4224. Shrink activation objects by half
  4225. https://bugs.webkit.org/show_bug.cgi?id=95591
  4226. Reviewed by Sam Weinig.
  4227. 2012-09-01 Mark Lam <mark.lam@apple.com>
  4228. LLInt C loop backend.
  4229. https://bugs.webkit.org/show_bug.cgi?id=91052.
  4230. Reviewed by Filip Pizlo.
  4231. * JavaScriptCore.xcodeproj/project.pbxproj:
  4232. * bytecode/CodeBlock.cpp:
  4233. (JSC::CodeBlock::dump):
  4234. (JSC::CodeBlock::bytecodeOffset):
  4235. * interpreter/Interpreter.cpp:
  4236. (JSC::Interpreter::execute):
  4237. (JSC::Interpreter::executeCall):
  4238. (JSC::Interpreter::executeConstruct):
  4239. (JSC):
  4240. * interpreter/Interpreter.h:
  4241. * jit/JITStubs.h:
  4242. (JITStackFrame):
  4243. (JSC):
  4244. * llint/LLIntCLoop.cpp: Added.
  4245. (JSC):
  4246. (LLInt):
  4247. (JSC::LLInt::CLoop::initialize):
  4248. (JSC::LLInt::CLoop::catchRoutineFor):
  4249. (JSC::LLInt::CLoop::hostCodeEntryFor):
  4250. (JSC::LLInt::CLoop::jsCodeEntryWithArityCheckFor):
  4251. (JSC::LLInt::CLoop::jsCodeEntryFor):
  4252. * llint/LLIntCLoop.h: Added.
  4253. (JSC):
  4254. (LLInt):
  4255. (CLoop):
  4256. * llint/LLIntData.cpp:
  4257. (JSC::LLInt::initialize):
  4258. * llint/LLIntData.h:
  4259. (JSC):
  4260. * llint/LLIntOfflineAsmConfig.h:
  4261. * llint/LLIntOpcode.h:
  4262. * llint/LLIntThunks.cpp:
  4263. (LLInt):
  4264. * llint/LowLevelInterpreter.asm:
  4265. * llint/LowLevelInterpreter.cpp:
  4266. (LLInt):
  4267. (JSC::LLInt::Ints2Double):
  4268. (JSC):
  4269. (JSC::CLoop::execute):
  4270. * llint/LowLevelInterpreter.h:
  4271. (JSC):
  4272. * llint/LowLevelInterpreter32_64.asm:
  4273. * llint/LowLevelInterpreter64.asm:
  4274. * offlineasm/asm.rb:
  4275. * offlineasm/backends.rb:
  4276. * offlineasm/cloop.rb: Added.
  4277. * offlineasm/instructions.rb:
  4278. * runtime/Executable.h:
  4279. (ExecutableBase):
  4280. (JSC::ExecutableBase::hostCodeEntryFor):
  4281. (JSC::ExecutableBase::jsCodeEntryFor):
  4282. (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor):
  4283. (JSC::ExecutableBase::catchRoutineFor):
  4284. (NativeExecutable):
  4285. * runtime/JSValue.h:
  4286. (JSC):
  4287. (LLInt):
  4288. (JSValue):
  4289. * runtime/JSValueInlineMethods.h:
  4290. (JSC):
  4291. (JSC::JSValue::JSValue):
  4292. * runtime/Options.cpp:
  4293. (JSC::Options::initialize):
  4294. 2012-09-01 Geoffrey Garen <ggaren@apple.com>
  4295. Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
  4296. Shrink activation objects by half
  4297. https://bugs.webkit.org/show_bug.cgi?id=95591
  4298. Reviewed by Sam Weinig.
  4299. * runtime/JSActivation.h:
  4300. (JSActivation):
  4301. 2012-09-01 Geoffrey Garen <ggaren@apple.com>
  4302. Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
  4303. Shrink activation objects by half
  4304. https://bugs.webkit.org/show_bug.cgi?id=95591
  4305. Reviewed by Sam Weinig.
  4306. * runtime/JSActivation.cpp:
  4307. (JSC::JSActivation::JSActivation):
  4308. * runtime/JSGlobalObject.cpp:
  4309. (JSC::JSGlobalObject::JSGlobalObject):
  4310. (JSC::JSGlobalObject::setGlobalThis):
  4311. (JSC):
  4312. (JSC::JSGlobalObject::visitChildren):
  4313. * runtime/JSGlobalObject.h:
  4314. (JSGlobalObject):
  4315. (JSC::JSScope::globalThis):
  4316. (JSC):
  4317. (JSC::JSGlobalObject::globalThis):
  4318. * runtime/JSNameScope.h:
  4319. (JSC::JSNameScope::JSNameScope):
  4320. * runtime/JSScope.cpp:
  4321. (JSC::JSScope::visitChildren):
  4322. * runtime/JSScope.h:
  4323. (JSScope):
  4324. (JSC::JSScope::JSScope):
  4325. (JSC::JSScope::globalObject):
  4326. (JSC::JSScope::globalData):
  4327. * runtime/JSSegmentedVariableObject.h:
  4328. (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
  4329. * runtime/JSSymbolTableObject.h:
  4330. (JSC::JSSymbolTableObject::JSSymbolTableObject):
  4331. * runtime/JSVariableObject.h:
  4332. (JSC::JSVariableObject::JSVariableObject):
  4333. * runtime/JSWithScope.h:
  4334. (JSC::JSWithScope::JSWithScope):
  4335. * runtime/StrictEvalActivation.cpp:
  4336. (JSC::StrictEvalActivation::StrictEvalActivation):
  4337. 2012-09-01 Geoffrey Garen <ggaren@apple.com>
  4338. Rolled back out a piece of <http://trac.webkit.org/changeset/127293>
  4339. because it broke Window inspector tests.
  4340. Shrink activation objects by half
  4341. https://bugs.webkit.org/show_bug.cgi?id=95591
  4342. Reviewed by Sam Weinig.
  4343. * runtime/JSActivation.h:
  4344. (JSActivation):
  4345. 2012-08-31 Filip Pizlo <fpizlo@apple.com>
  4346. Unreviewed, attempt to fix Windows, take two.
  4347. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4348. 2012-08-31 Filip Pizlo <fpizlo@apple.com>
  4349. Unreviewed, attempt to fix Windows.
  4350. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4351. 2012-08-31 Filip Pizlo <fpizlo@apple.com>
  4352. JSArray::putDirectIndex should by default behave like JSObject::putDirect
  4353. https://bugs.webkit.org/show_bug.cgi?id=95630
  4354. Reviewed by Gavin Barraclough.
  4355. * interpreter/Interpreter.cpp:
  4356. (JSC::Interpreter::privateExecute):
  4357. * jit/JITStubs.cpp:
  4358. (JSC::DEFINE_STUB_FUNCTION):
  4359. * jsc.cpp:
  4360. (GlobalObject::finishCreation):
  4361. * llint/LLIntSlowPaths.cpp:
  4362. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  4363. * runtime/JSArray.cpp:
  4364. (JSC::SparseArrayValueMap::putDirect):
  4365. (JSC::JSArray::defineOwnNumericProperty):
  4366. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  4367. * runtime/JSArray.h:
  4368. (SparseArrayValueMap):
  4369. (JSArray):
  4370. (JSC::JSArray::putDirectIndex):
  4371. * runtime/JSONObject.cpp:
  4372. (JSC::Walker::walk):
  4373. * runtime/RegExpMatchesArray.cpp:
  4374. (JSC::RegExpMatchesArray::reifyAllProperties):
  4375. (JSC::RegExpMatchesArray::reifyMatchProperty):
  4376. * runtime/StringPrototype.cpp:
  4377. (JSC::splitStringByOneCharacterImpl):
  4378. (JSC::stringProtoFuncSplit):
  4379. 2012-08-31 Geoffrey Garen <ggaren@apple.com>
  4380. Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
  4381. Shrink activation objects by half
  4382. https://bugs.webkit.org/show_bug.cgi?id=95591
  4383. Reviewed by Sam Weinig.
  4384. * runtime/JSGlobalData.cpp:
  4385. (JSC::JSGlobalData::JSGlobalData):
  4386. * runtime/JSGlobalData.h:
  4387. (JSGlobalData):
  4388. * runtime/JSNameScope.h:
  4389. (JSC::JSNameScope::JSNameScope):
  4390. * runtime/JSWithScope.h:
  4391. (JSC::JSWithScope::JSWithScope):
  4392. * runtime/StrictEvalActivation.cpp:
  4393. (JSC::StrictEvalActivation::StrictEvalActivation):
  4394. 2012-08-31 Geoffrey Garen <ggaren@apple.com>
  4395. Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
  4396. Shrink activation objects by half
  4397. https://bugs.webkit.org/show_bug.cgi?id=95591
  4398. Reviewed by Sam Weinig.
  4399. * dfg/DFGAbstractState.cpp:
  4400. (JSC::DFG::AbstractState::execute):
  4401. * jit/JITOpcodes.cpp:
  4402. (JSC::JIT::emit_op_resolve_global_dynamic):
  4403. * llint/LowLevelInterpreter32_64.asm:
  4404. * llint/LowLevelInterpreter64.asm:
  4405. * runtime/JSActivation.cpp:
  4406. (JSC::JSActivation::JSActivation):
  4407. * runtime/JSGlobalData.cpp:
  4408. (JSC::JSGlobalData::JSGlobalData):
  4409. * runtime/JSGlobalData.h:
  4410. (JSGlobalData):
  4411. * runtime/JSGlobalObject.cpp:
  4412. (JSC::JSGlobalObject::reset):
  4413. (JSC::JSGlobalObject::visitChildren):
  4414. * runtime/JSGlobalObject.h:
  4415. (JSGlobalObject):
  4416. (JSC::JSGlobalObject::withScopeStructure):
  4417. (JSC::JSGlobalObject::strictEvalActivationStructure):
  4418. (JSC::JSGlobalObject::activationStructure):
  4419. (JSC::JSGlobalObject::nameScopeStructure):
  4420. 2012-08-31 Mark Hahnenberg <mhahnenberg@apple.com>
  4421. Remove use of ClassInfo in SpeculativeJIT::emitBranch
  4422. https://bugs.webkit.org/show_bug.cgi?id=95623
  4423. Reviewed by Filip Pizlo.
  4424. * dfg/DFGAbstractState.cpp:
  4425. (JSC::DFG::AbstractState::execute):
  4426. * dfg/DFGSpeculativeJIT.h:
  4427. (SpeculativeJIT):
  4428. * dfg/DFGSpeculativeJIT32_64.cpp:
  4429. (JSC::DFG::SpeculativeJIT::emitNonStringCellOrOtherBranch):
  4430. (JSC::DFG::SpeculativeJIT::emitBranch):
  4431. * dfg/DFGSpeculativeJIT64.cpp:
  4432. (JSC::DFG::SpeculativeJIT::emitNonStringCellOrOtherBranch):
  4433. (JSC::DFG::SpeculativeJIT::emitBranch):
  4434. 2012-08-31 Geoffrey Garen <ggaren@apple.com>
  4435. Rolled back in a piece of <http://trac.webkit.org/changeset/127293>.
  4436. Shrink activation objects by half
  4437. https://bugs.webkit.org/show_bug.cgi?id=95591
  4438. Reviewed by Sam Weinig.
  4439. * heap/MarkedBlock.cpp:
  4440. (JSC::MarkedBlock::MarkedBlock):
  4441. * heap/MarkedBlock.h:
  4442. (MarkedBlock):
  4443. (JSC::MarkedBlock::globalData):
  4444. (JSC):
  4445. * heap/WeakSet.cpp:
  4446. (JSC::WeakSet::addAllocator):
  4447. * heap/WeakSet.h:
  4448. (WeakSet):
  4449. (JSC::WeakSet::WeakSet):
  4450. (JSC::WeakSet::globalData):
  4451. * runtime/JSGlobalData.h:
  4452. (JSC::WeakSet::heap):
  4453. (JSC):
  4454. 2012-08-31 Mark Lam <mark.lam@apple.com>
  4455. Refactor LLInt and supporting code in preparation for the C Loop backend.
  4456. https://bugs.webkit.org/show_bug.cgi?id=95531.
  4457. Reviewed by Filip Pizlo.
  4458. * bytecode/GetByIdStatus.cpp:
  4459. (JSC::GetByIdStatus::computeFromLLInt):
  4460. * bytecode/PutByIdStatus.cpp:
  4461. (JSC::PutByIdStatus::computeFromLLInt):
  4462. * jit/JITExceptions.cpp:
  4463. (JSC::genericThrow): Use ExecutableBase::catchRoutineFor() to fetch
  4464. fetch the catch routine for a thrown exception. This will allow
  4465. us to redefine that for the C loop later, and still keep this
  4466. code readable.
  4467. * llint/LLIntOfflineAsmConfig.h: Moved ASM macros to
  4468. LowLevelInterpreter.cpp which is the only place they are used. This
  4469. will make it more convenient to redefine them for the C loop later.
  4470. * llint/LLIntSlowPaths.cpp:
  4471. (JSC::LLInt::setUpCall): Use ExecutableBase's hostCodeEntry()
  4472. jsCodeEntryFor(), and jsCodeWithArityCheckEntryFor() for computing
  4473. the entry points to functions being called.
  4474. * llint/LLIntSlowPaths.h:
  4475. (SlowPathReturnType):
  4476. (JSC::LLInt::encodeResult):
  4477. (LLInt):
  4478. (JSC::LLInt::decodeResult): Added. Needed by LLInt C Loop later.
  4479. * llint/LowLevelInterpreter.asm:
  4480. * llint/LowLevelInterpreter.cpp:
  4481. * llint/LowLevelInterpreter32_64.asm:
  4482. * llint/LowLevelInterpreter64.asm:
  4483. * offlineasm/asm.rb: Disambiguate between opcodes and other labels.
  4484. * offlineasm/config.rb:
  4485. * runtime/Executable.h:
  4486. (JSC::ExecutableBase::hostCodeEntryFor): Added.
  4487. (ExecutableBase):
  4488. (JSC::ExecutableBase::jsCodeEntryFor): Added.
  4489. (JSC::ExecutableBase::jsCodeWithArityCheckEntryFor): Added.
  4490. (JSC::ExecutableBase::catchRoutineFor): Added.
  4491. * runtime/JSValueInlineMethods.h:
  4492. (JSC):
  4493. 2012-08-31 Tony Chang <tony@chromium.org>
  4494. Remove ENABLE_CSS3_FLEXBOX compile time flag
  4495. https://bugs.webkit.org/show_bug.cgi?id=95382
  4496. Reviewed by Ojan Vafai.
  4497. Everyone is already enabling this by default and the spec has stablized.
  4498. * Configurations/FeatureDefines.xcconfig:
  4499. 2012-08-31 Geoffrey Garen <ggaren@apple.com>
  4500. Not reviewed.
  4501. Rolled out http://trac.webkit.org/changeset/127293 because it broke
  4502. inspector tests on Windows.
  4503. Shrink activation objects by half
  4504. https://bugs.webkit.org/show_bug.cgi?id=95591
  4505. Reviewed by Sam Weinig.
  4506. 2012-08-31 Geoffrey Garen <ggaren@apple.com>
  4507. Shrink activation objects by half
  4508. https://bugs.webkit.org/show_bug.cgi?id=95591
  4509. Reviewed by Sam Weinig.
  4510. Removed the global object, global data, and global this pointers from
  4511. JSScope, and changed an int to a bitfield. This gets the JSActivation
  4512. class down to 64 bytes, which in practice cuts it in half by getting it
  4513. out of the 128 byte size class.
  4514. Now, it's one extra indirection to get these pointers. These pointers
  4515. aren't accessed by JIT code, so I thought there would be no cost to the
  4516. extra indirection. However, some C++-heavy SunSpider tests regressed a
  4517. bit in an early version of the patch, which added even more indirection.
  4518. This suggests that calls to exec->globalData() and/or exec->lexicalGlobalObject()
  4519. are common and probably duplicated in lots of places, and could stand
  4520. further optimization in C++.
  4521. * dfg/DFGAbstractState.cpp:
  4522. (JSC::DFG::AbstractState::execute): Test against the specific activation
  4523. for our global object, since there's no VM-shared activation structure
  4524. anymore. This is guaranteed to have the same success rate as the old test
  4525. because activation scope is fixed at compile time.
  4526. * heap/MarkedBlock.cpp:
  4527. (JSC::MarkedBlock::MarkedBlock):
  4528. * heap/MarkedBlock.h:
  4529. (JSC::MarkedBlock::globalData):
  4530. * heap/WeakSet.cpp:
  4531. (JSC::WeakSet::addAllocator):
  4532. * heap/WeakSet.h:
  4533. (WeakSet):
  4534. (JSC::WeakSet::WeakSet):
  4535. (JSC::WeakSet::globalData): Store a JSGlobalData* instead of a Heap*
  4536. because JSGlobalData->Heap is just a constant fold in the addressing
  4537. mode, while Heap->JSGlobalData is an extra pointer dereference. (These
  4538. objects should eventually just merge.)
  4539. * jit/JITOpcodes.cpp:
  4540. (JSC::JIT::emit_op_resolve_global_dynamic): See DFGAbstractState.cpp.
  4541. * llint/LowLevelInterpreter32_64.asm:
  4542. * llint/LowLevelInterpreter64.asm: Load the activation structure from
  4543. the code block instead of the global data because the structure is not
  4544. VM-shared anymore. (See DFGAbstractState.cpp.)
  4545. * runtime/JSActivation.cpp:
  4546. (JSC::JSActivation::JSActivation):
  4547. * runtime/JSActivation.h:
  4548. (JSActivation): This is the point of the patch: Remove the data.
  4549. * runtime/JSGlobalData.cpp:
  4550. (JSC::JSGlobalData::JSGlobalData):
  4551. * runtime/JSGlobalData.h:
  4552. (JSGlobalData): No longer VM-shared. (See DFGAbstractState.cpp.)
  4553. (JSC::WeakSet::heap): (See WeakSet.h.)
  4554. * runtime/JSGlobalObject.cpp:
  4555. (JSC::JSGlobalObject::JSGlobalObject):
  4556. (JSC::JSGlobalObject::setGlobalThis):
  4557. (JSC::JSGlobalObject::reset):
  4558. (JSC::JSGlobalObject::visitChildren):
  4559. * runtime/JSGlobalObject.h:
  4560. (JSGlobalObject):
  4561. (JSC::JSGlobalObject::withScopeStructure):
  4562. (JSC::JSGlobalObject::strictEvalActivationStructure):
  4563. (JSC::JSGlobalObject::activationStructure):
  4564. (JSC::JSGlobalObject::nameScopeStructure):
  4565. (JSC::JSScope::globalThis):
  4566. (JSC::JSGlobalObject::globalThis): Data that used to be in the JSScope
  4567. class goes here now, so it's not duplicated across all activations.
  4568. * runtime/JSNameScope.h:
  4569. (JSC::JSNameScope::JSNameScope):
  4570. * runtime/JSScope.cpp:
  4571. (JSC::JSScope::visitChildren): This is the point of the patch: Remove the data.
  4572. * runtime/JSScope.h:
  4573. (JSScope):
  4574. (JSC::JSScope::JSScope):
  4575. (JSC::JSScope::globalObject):
  4576. (JSC::JSScope::globalData):
  4577. * runtime/JSSegmentedVariableObject.h:
  4578. (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
  4579. * runtime/JSSymbolTableObject.h:
  4580. (JSC::JSSymbolTableObject::JSSymbolTableObject):
  4581. * runtime/JSVariableObject.h:
  4582. (JSC::JSVariableObject::JSVariableObject):
  4583. * runtime/JSWithScope.h:
  4584. (JSC::JSWithScope::JSWithScope):
  4585. * runtime/StrictEvalActivation.cpp:
  4586. (JSC::StrictEvalActivation::StrictEvalActivation): Simplified now that
  4587. we don't need to pass so much data to JSScope.
  4588. 2012-08-31 Patrick Gansterer <paroga@webkit.org>
  4589. Build fix for WinCE after r127191.
  4590. * bytecode/JumpTable.h:
  4591. 2012-08-30 Filip Pizlo <fpizlo@apple.com>
  4592. ASSERTION FAILURE in JSC::JSGlobalData::float32ArrayDescriptor when running fast/js/dfg-float64array.html
  4593. https://bugs.webkit.org/show_bug.cgi?id=95398
  4594. Reviewed by Mark Hahnenberg.
  4595. Trying to get the build failure to be a bit more informative.
  4596. * runtime/JSGlobalData.h:
  4597. (JSGlobalData):
  4598. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4599. Try to fix the Qt build: add some #includes that, for some reason, only the Qt linker requires.
  4600. * runtime/BooleanObject.cpp:
  4601. * runtime/ErrorInstance.cpp:
  4602. * runtime/NameInstance.cpp:
  4603. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4604. Fix the Qt build: Removed a now-dead variable.
  4605. * interpreter/Interpreter.cpp:
  4606. (JSC::Interpreter::execute):
  4607. 2012-08-30 Benjamin Poulain <bpoulain@apple.com>
  4608. Ambiguous operator[] after r127191 on some compiler
  4609. https://bugs.webkit.org/show_bug.cgi?id=95509
  4610. Reviewed by Simon Fraser.
  4611. On some compilers, the operator[] conflicts with the Obj-C++ operators. This attempts to solve
  4612. the issue.
  4613. * runtime/JSString.h:
  4614. (JSC::jsSingleCharacterSubstring):
  4615. (JSC::jsString):
  4616. (JSC::jsSubstring8):
  4617. (JSC::jsSubstring):
  4618. (JSC::jsOwnedString):
  4619. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4620. Try to fix the Qt build: Remove the inline keyword at the declaration
  4621. site.
  4622. The Qt compiler seems to be confused, complaining about these functions
  4623. not being defined in a translation unit, even though no generated code
  4624. in the unit calls these functions. Maybe removing the keyword at the
  4625. declaration site will change its mind.
  4626. This shouldn't change the inlining decision at all: the definition is
  4627. still inline.
  4628. * interpreter/CallFrame.h:
  4629. (ExecState):
  4630. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4631. Undo Qt build fix guess, since it breaks other builds.
  4632. * runtime/JSArray.h:
  4633. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4634. Try to fix the Qt build: add an #include to JSArray.h, since
  4635. it's included by some of the files Qt complains about, and
  4636. some of is functions call the functions Qt complains about.
  4637. * runtime/JSArray.h:
  4638. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4639. Second step toward fixing the Windows build: Add new symbols.
  4640. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4641. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4642. Try to fix the Qt build: add an #include.
  4643. * bytecode/GetByIdStatus.cpp:
  4644. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4645. First step toward fixing the Windows build: Remove old symbols.
  4646. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  4647. 2012-08-30 Geoffrey Garen <ggaren@apple.com>
  4648. Use one object instead of two for closures, eliminating ScopeChainNode
  4649. https://bugs.webkit.org/show_bug.cgi?id=95501
  4650. Reviewed by Filip Pizlo.
  4651. This patch removes ScopeChainNode, and moves all the data and related
  4652. functions that used to be in ScopeChainNode into JSScope.
  4653. Most of this patch is mechanical changes to use a JSScope* where we used
  4654. to use a ScopeChainNode*. I've only specifically commented about items
  4655. that were non-mechanical.
  4656. * runtime/Completion.cpp:
  4657. (JSC::evaluate):
  4658. * runtime/Completion.h: Don't require an explicit scope chain argument
  4659. when evaluating code. Clients never wanted anything other than the
  4660. global scope, and other arbitrary scopes probably wouldn't work
  4661. correctly, anyway.
  4662. * runtime/JSScope.cpp:
  4663. * runtime/JSScope.h:
  4664. (JSC::JSScope::JSScope): JSScope now requires the data we used to pass to
  4665. ScopeChainNode, so it can link itself into the scope chain correctly.
  4666. * runtime/JSWithScope.h:
  4667. (JSC::JSWithScope::create):
  4668. (JSC::JSWithScope::JSWithScope): JSWithScope gets an extra constructor
  4669. for specifically supplying your own scope chain. The DOM needs this
  4670. interface for setting up the scope chain for certain event handlers.
  4671. Other clients always just push the JSWithScope to the head of the current
  4672. scope chain.
  4673. 2012-08-30 Mark Lam <mark.lam@apple.com>
  4674. Render unto #ifdef's that which belong to them.
  4675. https://bugs.webkit.org/show_bug.cgi?id=95482.
  4676. Reviewed by Filip Pizlo.
  4677. Refining / disambiguating between #ifdefs and adding some. For
  4678. example, ENABLE(JIT) is conflated with ENABLE(LLINT) in some places.
  4679. Also, we need to add ENABLE(COMPUTED_GOTO_OPCODES) to indicate that we
  4680. want interpreted opcodes to use COMPUTED GOTOs apart from ENABLE(LLINT)
  4681. and ENABLE(COMPUTED_GOTO_CLASSIC_INTERPRETER). Also cleaned up #ifdefs
  4682. in certain places which were previously incorrect.
  4683. * bytecode/CodeBlock.cpp:
  4684. (JSC):
  4685. (JSC::CodeBlock::bytecodeOffset):
  4686. * bytecode/CodeBlock.h:
  4687. (CodeBlock):
  4688. * bytecode/Opcode.h:
  4689. (JSC::padOpcodeName):
  4690. * config.h:
  4691. * dfg/DFGOperations.cpp:
  4692. * interpreter/AbstractPC.cpp:
  4693. (JSC::AbstractPC::AbstractPC):
  4694. * interpreter/CallFrame.h:
  4695. (ExecState):
  4696. * interpreter/Interpreter.cpp:
  4697. (JSC::Interpreter::~Interpreter):
  4698. (JSC::Interpreter::initialize):
  4699. (JSC::Interpreter::isOpcode):
  4700. (JSC::Interpreter::unwindCallFrame):
  4701. (JSC::getLineNumberForCallFrame):
  4702. (JSC::getCallerInfo):
  4703. (JSC::Interpreter::execute):
  4704. (JSC::Interpreter::executeCall):
  4705. (JSC::Interpreter::executeConstruct):
  4706. (JSC::Interpreter::privateExecute):
  4707. * interpreter/Interpreter.h:
  4708. (JSC::Interpreter::getOpcode):
  4709. (JSC::Interpreter::getOpcodeID):
  4710. (Interpreter):
  4711. * jit/HostCallReturnValue.h:
  4712. * jit/JITCode.h:
  4713. (JITCode):
  4714. * jit/JITExceptions.cpp:
  4715. * jit/JITExceptions.h:
  4716. * jit/JSInterfaceJIT.h:
  4717. * llint/LLIntData.h:
  4718. (JSC::LLInt::getOpcode):
  4719. * llint/LLIntEntrypoints.cpp:
  4720. (JSC::LLInt::getFunctionEntrypoint):
  4721. (JSC::LLInt::getEvalEntrypoint):
  4722. (JSC::LLInt::getProgramEntrypoint):
  4723. * llint/LLIntOffsetsExtractor.cpp:
  4724. (JSC::LLIntOffsetsExtractor::dummy):
  4725. * llint/LLIntSlowPaths.cpp:
  4726. (LLInt):
  4727. * runtime/JSGlobalData.cpp:
  4728. (JSC):
  4729. 2012-08-30 JungJik Lee <jungjik.lee@samsung.com>
  4730. [EFL][WK2] Add WebMemorySampler feature.
  4731. https://bugs.webkit.org/show_bug.cgi?id=91214
  4732. Reviewed by Kenneth Rohde Christiansen.
  4733. WebMemorySampler collects Javascript stack and JIT memory usage in globalMemoryStatistics.
  4734. * PlatformEfl.cmake:
  4735. 2012-08-30 Benjamin Poulain <bpoulain@apple.com>
  4736. Replace JSC::UString by WTF::String
  4737. https://bugs.webkit.org/show_bug.cgi?id=95271
  4738. Reviewed by Geoffrey Garen.
  4739. Having JSC::UString and WTF::String increase the complexity of working on WebKit, and
  4740. add useless conversions in the bindings. It also cause some code bloat.
  4741. The performance advantages of UString have been ported over in previous patches. This patch
  4742. is the last step: getting rid of UString.
  4743. In addition to the simplified code, this also reduce the binary size by 15kb on x86_64.
  4744. * API/OpaqueJSString.cpp:
  4745. (OpaqueJSString::ustring):
  4746. * runtime/Identifier.h:
  4747. (JSC::Identifier::ustring):
  4748. To avoid changing everything at once, the function named ustring() were kept as is. They
  4749. will be renamed in a follow up patch.
  4750. * runtime/JSString.h:
  4751. (JSC::JSString::string):
  4752. (JSC::JSValue::toWTFString):
  4753. (JSC::inlineJSValueNotStringtoString):
  4754. (JSC::JSValue::toWTFStringInline):
  4755. Since JSValue::toString() already exist (and return the JSString), the direct accessor is renamed
  4756. to ::toWTFString(). We may change ::string() to ::jsString() and ::toWTFString() to ::toString()
  4757. in the future.
  4758. * runtime/StringPrototype.cpp:
  4759. (JSC::substituteBackreferencesSlow): Replace the use of UString::getCharacters<>() by String::getCharactersWithUpconvert<>().
  4760. 2012-08-24 Mark Hahnenberg <mhahnenberg@apple.com>
  4761. Remove uses of ClassInfo in StrictEq and CompareEq in the DFG
  4762. https://bugs.webkit.org/show_bug.cgi?id=93401
  4763. Reviewed by Filip Pizlo.
  4764. Another incremental step in removing the dependence on ClassInfo pointers in object headers.
  4765. * bytecode/SpeculatedType.h:
  4766. (JSC::isCellOrOtherSpeculation):
  4767. (JSC):
  4768. * dfg/DFGAbstractState.cpp: Updated the CFA to reflect the changes to the backend.
  4769. (JSC::DFG::AbstractState::execute):
  4770. * dfg/DFGNode.h:
  4771. (Node):
  4772. (JSC::DFG::Node::shouldSpeculateString): Added this new function since it was conspicuously absent.
  4773. (JSC::DFG::Node::shouldSpeculateNonStringCellOrOther): Also add this function for use in the CFA.
  4774. * dfg/DFGSpeculativeJIT.cpp: Refactored how we handle CompareEq and CompareStrictEq in the DFG. We now just
  4775. check for Strings by comparing the object's Structure to the global Structure for strings. We only
  4776. check for MasqueradesAsUndefined if the watchpoint has fired. These changes allow us to remove our
  4777. uses of the ClassInfo pointer for compiling these nodes.
  4778. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
  4779. (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
  4780. (JSC::DFG::SpeculativeJIT::compare):
  4781. (JSC::DFG::SpeculativeJIT::compileStrictEq):
  4782. * dfg/DFGSpeculativeJIT.h:
  4783. (SpeculativeJIT):
  4784. * dfg/DFGSpeculativeJIT32_64.cpp: Same changes for 32 bit as for 64 bit.
  4785. (JSC::DFG::SpeculativeJIT::compileObjectEquality):
  4786. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  4787. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  4788. * dfg/DFGSpeculativeJIT64.cpp:
  4789. (JSC::DFG::SpeculativeJIT::compileObjectEquality):
  4790. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  4791. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  4792. 2012-08-30 Yong Li <yoli@rim.com>
  4793. [BlackBerry] Implement IncrementalSweeper for PLATFORM(BLACKBERRY)
  4794. https://bugs.webkit.org/show_bug.cgi?id=95469
  4795. Reviewed by Rob Buis.
  4796. RIM PR# 200595.
  4797. Share most code with USE(CF) and implement timer-related methods
  4798. for PLATFORM(BLACKBERRY).
  4799. * heap/IncrementalSweeper.cpp:
  4800. (JSC):
  4801. (JSC::IncrementalSweeper::IncrementalSweeper):
  4802. (JSC::IncrementalSweeper::create):
  4803. (JSC::IncrementalSweeper::scheduleTimer):
  4804. (JSC::IncrementalSweeper::cancelTimer):
  4805. (JSC::IncrementalSweeper::doSweep):
  4806. * heap/IncrementalSweeper.h:
  4807. (IncrementalSweeper):
  4808. 2012-08-30 Mark Lam <mark.lam@apple.com>
  4809. Fix broken classic intrpreter build.
  4810. https://bugs.webkit.org/show_bug.cgi?id=95484.
  4811. Reviewed by Filip Pizlo.
  4812. * interpreter/Interpreter.cpp:
  4813. (JSC::Interpreter::privateExecute):
  4814. 2012-08-30 Byungwoo Lee <bw80.lee@samsung.com>
  4815. Build warning : -Wsign-compare on DFGByteCodeParser.cpp.
  4816. https://bugs.webkit.org/show_bug.cgi?id=95418
  4817. Reviewed by Filip Pizlo.
  4818. There is a build warning '-Wsign-compare' on
  4819. findArgumentPositionForLocal() in DFGByteCodeParser.cpp.
  4820. For removing this warning, casting statement is added explicitly.
  4821. * dfg/DFGByteCodeParser.cpp:
  4822. (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
  4823. (JSC::DFG::ByteCodeParser::findArgumentPosition):
  4824. 2012-08-30 Yong Li <yoli@rim.com>
  4825. [BlackBerry] Set timer client on platform timer used in HeapTimer
  4826. https://bugs.webkit.org/show_bug.cgi?id=95464
  4827. Reviewed by Rob Buis.
  4828. Otherwise the timer won't work.
  4829. * heap/HeapTimer.cpp:
  4830. (JSC::HeapTimer::HeapTimer):
  4831. 2012-08-30 Julien BRIANCEAU <jbrianceau@nds.com>
  4832. [sh4] Add missing implementation for JavaScriptCore JIT
  4833. https://bugs.webkit.org/show_bug.cgi?id=95452
  4834. Reviewed by Oliver Hunt.
  4835. * assembler/MacroAssemblerSH4.h:
  4836. (JSC::MacroAssemblerSH4::isCompactPtrAlignedAddressOffset):
  4837. (MacroAssemblerSH4):
  4838. (JSC::MacroAssemblerSH4::add32):
  4839. (JSC::MacroAssemblerSH4::convertibleLoadPtr):
  4840. * assembler/SH4Assembler.h:
  4841. (JSC::SH4Assembler::labelIgnoringWatchpoints):
  4842. (SH4Assembler):
  4843. (JSC::SH4Assembler::replaceWithLoad):
  4844. (JSC::SH4Assembler::replaceWithAddressComputation):
  4845. 2012-08-30 Charles Wei <charles.wei@torchmobile.com.cn>
  4846. [BlackBerry] Eliminate build warnings
  4847. https://bugs.webkit.org/show_bug.cgi?id=95338
  4848. Reviewed by Filip Pizlo.
  4849. static_cast to the same type to eliminate the build time warnings.
  4850. * assembler/AssemblerBufferWithConstantPool.h:
  4851. (JSC::AssemblerBufferWithConstantPool::flushWithoutBarrier):
  4852. * assembler/MacroAssemblerARM.h:
  4853. (JSC::MacroAssemblerARM::branch32):
  4854. 2012-08-29 Mark Hahnenberg <mhahnenberg@apple.com>
  4855. Remove use of ClassInfo from compileGetByValOnArguments and compileGetArgumentsLength
  4856. https://bugs.webkit.org/show_bug.cgi?id=95131
  4857. Reviewed by Filip Pizlo.
  4858. * dfg/DFGSpeculativeJIT.cpp:
  4859. (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments): We don't need this speculation check. We can replace it
  4860. with an assert to guarantee this.
  4861. 2012-08-29 Mark Lam <mark.lam@apple.com>
  4862. Refactoring LLInt::Data.
  4863. https://bugs.webkit.org/show_bug.cgi?id=95316.
  4864. Reviewed by Geoff Garen.
  4865. This change allows its opcodeMap to be easily queried from any function
  4866. without needing to go through a GlobalData object. It also introduces
  4867. the LLInt::getCodePtr() methods that will be used by the LLInt C loop
  4868. later to redefine how llint symbols (opcodes and trampoline glue
  4869. labels) get resolved.
  4870. * assembler/MacroAssemblerCodeRef.h:
  4871. (MacroAssemblerCodePtr):
  4872. (JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
  4873. (MacroAssemblerCodeRef):
  4874. (JSC::MacroAssemblerCodeRef::createLLIntCodeRef):
  4875. * bytecode/CodeBlock.cpp:
  4876. (JSC::CodeBlock::adjustPCIfAtCallSite):
  4877. (JSC::CodeBlock::bytecodeOffset):
  4878. * bytecode/Opcode.h:
  4879. Remove the 'const' to simplify things and avoid having to do
  4880. additional casts and #ifdefs in many places.
  4881. * bytecode/ResolveGlobalStatus.cpp:
  4882. (JSC::computeForLLInt):
  4883. * bytecompiler/BytecodeGenerator.cpp:
  4884. (JSC::BytecodeGenerator::generate):
  4885. * interpreter/Interpreter.cpp:
  4886. (JSC::Interpreter::initialize):
  4887. * interpreter/Interpreter.h:
  4888. (Interpreter):
  4889. * jit/JITExceptions.cpp:
  4890. (JSC::genericThrow):
  4891. * llint/LLIntData.cpp:
  4892. (LLInt):
  4893. (JSC::LLInt::initialize):
  4894. * llint/LLIntData.h:
  4895. (JSC):
  4896. (LLInt):
  4897. (Data):
  4898. (JSC::LLInt::exceptionInstructions):
  4899. (JSC::LLInt::opcodeMap):
  4900. (JSC::LLInt::getOpcode):
  4901. (JSC::LLInt::getCodePtr):
  4902. (JSC::LLInt::Data::performAssertions):
  4903. * llint/LLIntExceptions.cpp:
  4904. (JSC::LLInt::returnToThrowForThrownException):
  4905. (JSC::LLInt::returnToThrow):
  4906. (JSC::LLInt::callToThrow):
  4907. * llint/LLIntSlowPaths.cpp:
  4908. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  4909. (JSC::LLInt::handleHostCall):
  4910. * runtime/InitializeThreading.cpp:
  4911. (JSC::initializeThreadingOnce): Initialize the singleton LLInt data.
  4912. * runtime/JSGlobalData.cpp:
  4913. (JSC::JSGlobalData::JSGlobalData):
  4914. * runtime/JSGlobalData.h:
  4915. (JSGlobalData): Removed the now unneeded LLInt::Data instance in
  4916. JSGlobalData.
  4917. * runtime/JSValue.h:
  4918. (JSValue):
  4919. 2012-08-29 Gavin Barraclough <barraclough@apple.com>
  4920. PutById uses DataLabel32, not DataLabelCompact
  4921. https://bugs.webkit.org/show_bug.cgi?id=95245
  4922. Reviewed by Geoff Garen.
  4923. JIT::resetPatchPutById calls the the wrong thing on x86-64 – this is moot right now,
  4924. since they currently both do the same thing, but if we were to ever make compact mean
  4925. 8-bit this could be a real problem. Also, relying on the object still being in eax
  4926. on entry to the transition stub isn't very robust - added nonArgGPR1 to at least make
  4927. this explicit.
  4928. * jit/JITPropertyAccess.cpp:
  4929. (JSC::JIT::emitSlow_op_put_by_id):
  4930. - copy regT0 to nonArgGPR1
  4931. (JSC::JIT::privateCompilePutByIdTransition):
  4932. - DataLabelCompact -> DataLabel32
  4933. (JSC::JIT::resetPatchPutById):
  4934. - reload regT0 from nonArgGPR1
  4935. * jit/JSInterfaceJIT.h:
  4936. (JSInterfaceJIT):
  4937. - added nonArgGPR1
  4938. 2012-08-28 Yong Li <yoli@rim.com>
  4939. ExecutableAllocator should be destructed after Heap
  4940. https://bugs.webkit.org/show_bug.cgi?id=95244
  4941. Reviewed by Rob Buis.
  4942. RIM PR# 199364.
  4943. Make ExecutableAllocator the first member in JSGlobalData.
  4944. Existing Web Worker tests can show the issue.
  4945. * runtime/JSGlobalData.cpp:
  4946. (JSC::JSGlobalData::JSGlobalData):
  4947. * runtime/JSGlobalData.h:
  4948. (JSGlobalData):
  4949. 2012-08-29 Geoffrey Garen <ggaren@apple.com>
  4950. Try to fix the Windows build.
  4951. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Export!
  4952. 2012-08-28 Geoffrey Garen <ggaren@apple.com>
  4953. Introduced JSWithScope, making all scope objects subclasses of JSScope
  4954. https://bugs.webkit.org/show_bug.cgi?id=95295
  4955. Reviewed by Filip Pizlo.
  4956. This is a step toward removing ScopeChainNode. With a uniform representation
  4957. for objects in the scope chain, we can move data from ScopeChainNode
  4958. into JSScope.
  4959. * CMakeLists.txt:
  4960. * GNUmakefile.list.am:
  4961. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  4962. * JavaScriptCore.xcodeproj/project.pbxproj:
  4963. * Target.pri: Build!
  4964. * interpreter/Interpreter.cpp:
  4965. (JSC::Interpreter::privateExecute):
  4966. * jit/JITStubs.cpp:
  4967. (JSC::DEFINE_STUB_FUNCTION):
  4968. * llint/LLIntSlowPaths.cpp:
  4969. (JSC::LLInt::LLINT_SLOW_PATH_DECL): Use an explicit JSWithScope object
  4970. for 'with' statements. Since 'with' can put any object in the scope
  4971. chain, we'll need an adapter object to hold the data ScopeChainNode
  4972. currently holds.
  4973. (JSGlobalData): Support for JSWithScope.
  4974. * runtime/JSScope.cpp:
  4975. (JSC::JSScope::objectAtScope):
  4976. * runtime/JSScope.h: Check for and unwrap JSWithScope.
  4977. * runtime/JSType.h: Support for JSWithScope.
  4978. * runtime/StrictEvalActivation.cpp:
  4979. (JSC::StrictEvalActivation::StrictEvalActivation):
  4980. * runtime/StrictEvalActivation.h:
  4981. (StrictEvalActivation): Inherit from JSScope, to make the scope chain uniform.
  4982. * runtime/JSWithScope.cpp: Added.
  4983. (JSC::JSWithScope::visitChildren):
  4984. * runtime/JSWithScope.h: Added.
  4985. (JSWithScope):
  4986. (JSC::JSWithScope::create):
  4987. (JSC::JSWithScope::object):
  4988. (JSC::JSWithScope::createStructure):
  4989. (JSC::JSWithScope::JSWithScope): New adapter object. Since this object
  4990. is never exposed to scripts, it doesn't need any meaningful implementation
  4991. of property access or other callbacks.
  4992. 2012-08-29 Patrick Gansterer <paroga@webkit.org>
  4993. Unreviewed. Build fix for !ENABLE(JIT) after r126962.
  4994. * interpreter/Interpreter.cpp:
  4995. (JSC::Interpreter::privateExecute):
  4996. 2012-08-28 Geoffrey Garen <ggaren@apple.com>
  4997. Added JSScope::objectInScope(), and refactored callers to use it
  4998. https://bugs.webkit.org/show_bug.cgi?id=95281
  4999. Reviewed by Gavin Barraclough.
  5000. This is a step toward removing ScopeChainNode. We need a layer of
  5001. indirection so that 'with' scopes can proxy for an object.
  5002. JSScope::objectInScope() will be that layer.
  5003. * bytecode/EvalCodeCache.h:
  5004. (JSC::EvalCodeCache::tryGet):
  5005. (JSC::EvalCodeCache::getSlow):
  5006. * bytecompiler/BytecodeGenerator.cpp:
  5007. (JSC::BytecodeGenerator::resolve):
  5008. (JSC::BytecodeGenerator::resolveConstDecl): . vs ->
  5009. * interpreter/Interpreter.cpp:
  5010. (JSC::Interpreter::unwindCallFrame):
  5011. (JSC::Interpreter::execute):
  5012. * runtime/JSScope.cpp:
  5013. (JSC::JSScope::resolve):
  5014. (JSC::JSScope::resolveSkip):
  5015. (JSC::JSScope::resolveGlobalDynamic):
  5016. (JSC::JSScope::resolveBase):
  5017. (JSC::JSScope::resolveWithBase):
  5018. (JSC::JSScope::resolveWithThis): Added JSScope::objectAtScope() calls.
  5019. * runtime/JSScope.h:
  5020. (JSScope):
  5021. (JSC::JSScope::objectAtScope):
  5022. (JSC):
  5023. (ScopeChainIterator):
  5024. (JSC::ScopeChainIterator::ScopeChainIterator):
  5025. (JSC::ScopeChainIterator::get):
  5026. (JSC::ScopeChainIterator::operator->):
  5027. (JSC::ScopeChainIterator::operator++):
  5028. (JSC::ScopeChainIterator::operator==):
  5029. (JSC::ScopeChainIterator::operator!=):
  5030. (JSC::ScopeChainNode::begin):
  5031. (JSC::ScopeChainNode::end): I moved ScopeChainIterator to this file
  5032. to resolve a circular #include problem. Eventually, I'll probably rename
  5033. it to JSScope::iterator, so I think it belongs here.
  5034. * runtime/ScopeChain.cpp:
  5035. (JSC::ScopeChainNode::print):
  5036. (JSC::ScopeChainNode::localDepth): . vs ->
  5037. * runtime/ScopeChain.h:
  5038. (ScopeChainNode): I made the 'object' data member private because it's
  5039. no longer safe to access -- you need to call JSScope::objectAtScope()
  5040. instead.
  5041. The JITs need to be friends because of the private declaration.
  5042. Subtly, JIT/LLInt code is correct without any changes because JIT/LLInt
  5043. code never compiles direct access to a with scope.
  5044. 2012-08-28 Mark Lam <mark.lam@apple.com>
  5045. Adding support for adding LLInt opcode extensions. This will be needed
  5046. by the LLInt C loop interpreter later.
  5047. https://bugs.webkit.org/show_bug.cgi?id=95277.
  5048. Reviewed by Geoffrey Garen.
  5049. * JavaScriptCore.xcodeproj/project.pbxproj:
  5050. * bytecode/Opcode.h:
  5051. * llint/LLIntOpcode.h: Added.
  5052. * llint/LowLevelInterpreter.h:
  5053. 2012-08-28 Gavin Barraclough <barraclough@apple.com>
  5054. Rolled out r126928, this broke stuff :'-(
  5055. * jit/JITPropertyAccess.cpp:
  5056. (JSC::JIT::privateCompilePutByIdTransition):
  5057. (JSC::JIT::resetPatchPutById):
  5058. 2012-08-28 Gavin Barraclough <barraclough@apple.com>
  5059. PutById uses DataLabel32, not DataLabelCompact
  5060. https://bugs.webkit.org/show_bug.cgi?id=95245
  5061. Reviewed by Geoff Garen.
  5062. JIT::resetPatchPutById calls the the wrong thing on x86-64 – this is moot right now,
  5063. since they currently both do the same thing, but if we were to ever make compact mean
  5064. 8-bit this could be a real problem. Also, don't rely on the object still being in eax
  5065. on entry to the transition stub – this isn't very robust.
  5066. * jit/JITPropertyAccess.cpp:
  5067. (JSC::JIT::privateCompilePutByIdTransition):
  5068. - DataLabelCompact -> DataLabel32
  5069. (JSC::JIT::resetPatchPutById):
  5070. - reload regT0 from the stack
  5071. 2012-08-28 Sheriff Bot <webkit.review.bot@gmail.com>
  5072. Unreviewed, rolling out r126914.
  5073. http://trac.webkit.org/changeset/126914
  5074. https://bugs.webkit.org/show_bug.cgi?id=95239
  5075. it breaks everything and fixes nothing (Requested by pizlo on
  5076. #webkit).
  5077. * API/JSCallbackObject.h:
  5078. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
  5079. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
  5080. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
  5081. * API/JSCallbackObjectFunctions.h:
  5082. (JSC::::getOwnPropertyNames):
  5083. * API/JSClassRef.cpp:
  5084. (OpaqueJSClass::~OpaqueJSClass):
  5085. (OpaqueJSClassContextData::OpaqueJSClassContextData):
  5086. (OpaqueJSClass::contextData):
  5087. * bytecode/CodeBlock.cpp:
  5088. (JSC::CodeBlock::dump):
  5089. (JSC::EvalCodeCache::visitAggregate):
  5090. (JSC::CodeBlock::nameForRegister):
  5091. * bytecode/JumpTable.h:
  5092. (JSC::StringJumpTable::offsetForValue):
  5093. (JSC::StringJumpTable::ctiForValue):
  5094. * bytecode/LazyOperandValueProfile.cpp:
  5095. (JSC::LazyOperandValueProfileParser::getIfPresent):
  5096. * bytecode/SamplingTool.cpp:
  5097. (JSC::SamplingTool::dump):
  5098. * bytecompiler/BytecodeGenerator.cpp:
  5099. (JSC::BytecodeGenerator::addVar):
  5100. (JSC::BytecodeGenerator::addGlobalVar):
  5101. (JSC::BytecodeGenerator::addConstant):
  5102. (JSC::BytecodeGenerator::addConstantValue):
  5103. (JSC::BytecodeGenerator::emitLoad):
  5104. (JSC::BytecodeGenerator::addStringConstant):
  5105. (JSC::BytecodeGenerator::emitLazyNewFunction):
  5106. * bytecompiler/NodesCodegen.cpp:
  5107. (JSC::PropertyListNode::emitBytecode):
  5108. * debugger/Debugger.cpp:
  5109. * dfg/DFGArgumentsSimplificationPhase.cpp:
  5110. (JSC::DFG::ArgumentsSimplificationPhase::run):
  5111. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  5112. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  5113. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  5114. (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
  5115. * dfg/DFGAssemblyHelpers.cpp:
  5116. (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
  5117. * dfg/DFGByteCodeCache.h:
  5118. (JSC::DFG::ByteCodeCache::~ByteCodeCache):
  5119. (JSC::DFG::ByteCodeCache::get):
  5120. * dfg/DFGByteCodeParser.cpp:
  5121. (JSC::DFG::ByteCodeParser::cellConstant):
  5122. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  5123. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5124. (JSC::DFG::StructureCheckHoistingPhase::run):
  5125. (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
  5126. (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
  5127. * heap/Heap.cpp:
  5128. (JSC::Heap::markProtectedObjects):
  5129. * heap/Heap.h:
  5130. (JSC::Heap::forEachProtectedCell):
  5131. * heap/JITStubRoutineSet.cpp:
  5132. (JSC::JITStubRoutineSet::markSlow):
  5133. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  5134. * heap/MarkStack.cpp:
  5135. (JSC::MarkStack::internalAppend):
  5136. * heap/Weak.h:
  5137. (JSC::weakRemove):
  5138. * jit/JIT.cpp:
  5139. (JSC::JIT::privateCompile):
  5140. * jit/JITStubs.cpp:
  5141. (JSC::JITThunks::ctiStub):
  5142. * parser/Parser.cpp:
  5143. (JSC::::parseStrictObjectLiteral):
  5144. * profiler/Profile.cpp:
  5145. (JSC::functionNameCountPairComparator):
  5146. (JSC::Profile::debugPrintDataSampleStyle):
  5147. * runtime/Identifier.cpp:
  5148. (JSC::Identifier::add):
  5149. * runtime/JSActivation.cpp:
  5150. (JSC::JSActivation::getOwnPropertyNames):
  5151. (JSC::JSActivation::symbolTablePutWithAttributes):
  5152. * runtime/JSArray.cpp:
  5153. (JSC::SparseArrayValueMap::put):
  5154. (JSC::SparseArrayValueMap::putDirect):
  5155. (JSC::SparseArrayValueMap::visitChildren):
  5156. (JSC::JSArray::enterDictionaryMode):
  5157. (JSC::JSArray::defineOwnNumericProperty):
  5158. (JSC::JSArray::getOwnPropertySlotByIndex):
  5159. (JSC::JSArray::getOwnPropertyDescriptor):
  5160. (JSC::JSArray::putByIndexBeyondVectorLength):
  5161. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  5162. (JSC::JSArray::deletePropertyByIndex):
  5163. (JSC::JSArray::getOwnPropertyNames):
  5164. (JSC::JSArray::setLength):
  5165. (JSC::JSArray::sort):
  5166. (JSC::JSArray::compactForSorting):
  5167. (JSC::JSArray::checkConsistency):
  5168. * runtime/JSSymbolTableObject.cpp:
  5169. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  5170. * runtime/JSSymbolTableObject.h:
  5171. (JSC::symbolTableGet):
  5172. (JSC::symbolTablePut):
  5173. (JSC::symbolTablePutWithAttributes):
  5174. * runtime/RegExpCache.cpp:
  5175. (JSC::RegExpCache::invalidateCode):
  5176. * runtime/WeakGCMap.h:
  5177. (JSC::WeakGCMap::clear):
  5178. (JSC::WeakGCMap::set):
  5179. * tools/ProfileTreeNode.h:
  5180. (JSC::ProfileTreeNode::sampleChild):
  5181. (JSC::ProfileTreeNode::childCount):
  5182. (JSC::ProfileTreeNode::dumpInternal):
  5183. (JSC::ProfileTreeNode::compareEntries):
  5184. 2012-08-28 Filip Pizlo <fpizlo@apple.com>
  5185. LLInt should not rely on ordering of global labels
  5186. https://bugs.webkit.org/show_bug.cgi?id=95221
  5187. Reviewed by Oliver Hunt.
  5188. * llint/LowLevelInterpreter.asm:
  5189. * llint/LowLevelInterpreter32_64.asm:
  5190. * llint/LowLevelInterpreter64.asm:
  5191. 2012-08-28 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
  5192. Rename first/second to key/value in HashMap iterators
  5193. https://bugs.webkit.org/show_bug.cgi?id=82784
  5194. Reviewed by Eric Seidel.
  5195. * API/JSCallbackObject.h:
  5196. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
  5197. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
  5198. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
  5199. * API/JSCallbackObjectFunctions.h:
  5200. (JSC::::getOwnPropertyNames):
  5201. * API/JSClassRef.cpp:
  5202. (OpaqueJSClass::~OpaqueJSClass):
  5203. (OpaqueJSClassContextData::OpaqueJSClassContextData):
  5204. (OpaqueJSClass::contextData):
  5205. * bytecode/CodeBlock.cpp:
  5206. (JSC::CodeBlock::dump):
  5207. (JSC::EvalCodeCache::visitAggregate):
  5208. (JSC::CodeBlock::nameForRegister):
  5209. * bytecode/JumpTable.h:
  5210. (JSC::StringJumpTable::offsetForValue):
  5211. (JSC::StringJumpTable::ctiForValue):
  5212. * bytecode/LazyOperandValueProfile.cpp:
  5213. (JSC::LazyOperandValueProfileParser::getIfPresent):
  5214. * bytecode/SamplingTool.cpp:
  5215. (JSC::SamplingTool::dump):
  5216. * bytecompiler/BytecodeGenerator.cpp:
  5217. (JSC::BytecodeGenerator::addVar):
  5218. (JSC::BytecodeGenerator::addGlobalVar):
  5219. (JSC::BytecodeGenerator::addConstant):
  5220. (JSC::BytecodeGenerator::addConstantValue):
  5221. (JSC::BytecodeGenerator::emitLoad):
  5222. (JSC::BytecodeGenerator::addStringConstant):
  5223. (JSC::BytecodeGenerator::emitLazyNewFunction):
  5224. * bytecompiler/NodesCodegen.cpp:
  5225. (JSC::PropertyListNode::emitBytecode):
  5226. * debugger/Debugger.cpp:
  5227. * dfg/DFGArgumentsSimplificationPhase.cpp:
  5228. (JSC::DFG::ArgumentsSimplificationPhase::run):
  5229. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  5230. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  5231. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  5232. (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
  5233. * dfg/DFGAssemblyHelpers.cpp:
  5234. (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
  5235. * dfg/DFGByteCodeCache.h:
  5236. (JSC::DFG::ByteCodeCache::~ByteCodeCache):
  5237. (JSC::DFG::ByteCodeCache::get):
  5238. * dfg/DFGByteCodeParser.cpp:
  5239. (JSC::DFG::ByteCodeParser::cellConstant):
  5240. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  5241. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5242. (JSC::DFG::StructureCheckHoistingPhase::run):
  5243. (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
  5244. (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
  5245. * heap/Heap.cpp:
  5246. (JSC::Heap::markProtectedObjects):
  5247. * heap/Heap.h:
  5248. (JSC::Heap::forEachProtectedCell):
  5249. * heap/JITStubRoutineSet.cpp:
  5250. (JSC::JITStubRoutineSet::markSlow):
  5251. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  5252. * heap/MarkStack.cpp:
  5253. (JSC::MarkStack::internalAppend):
  5254. * heap/Weak.h:
  5255. (JSC::weakRemove):
  5256. * jit/JIT.cpp:
  5257. (JSC::JIT::privateCompile):
  5258. * jit/JITStubs.cpp:
  5259. (JSC::JITThunks::ctiStub):
  5260. * parser/Parser.cpp:
  5261. (JSC::::parseStrictObjectLiteral):
  5262. * profiler/Profile.cpp:
  5263. (JSC::functionNameCountPairComparator):
  5264. (JSC::Profile::debugPrintDataSampleStyle):
  5265. * runtime/Identifier.cpp:
  5266. (JSC::Identifier::add):
  5267. * runtime/JSActivation.cpp:
  5268. (JSC::JSActivation::getOwnPropertyNames):
  5269. (JSC::JSActivation::symbolTablePutWithAttributes):
  5270. * runtime/JSArray.cpp:
  5271. (JSC::SparseArrayValueMap::put):
  5272. (JSC::SparseArrayValueMap::putDirect):
  5273. (JSC::SparseArrayValueMap::visitChildren):
  5274. (JSC::JSArray::enterDictionaryMode):
  5275. (JSC::JSArray::defineOwnNumericProperty):
  5276. (JSC::JSArray::getOwnPropertySlotByIndex):
  5277. (JSC::JSArray::getOwnPropertyDescriptor):
  5278. (JSC::JSArray::putByIndexBeyondVectorLength):
  5279. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  5280. (JSC::JSArray::deletePropertyByIndex):
  5281. (JSC::JSArray::getOwnPropertyNames):
  5282. (JSC::JSArray::setLength):
  5283. (JSC::JSArray::sort):
  5284. (JSC::JSArray::compactForSorting):
  5285. (JSC::JSArray::checkConsistency):
  5286. * runtime/JSSymbolTableObject.cpp:
  5287. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  5288. * runtime/JSSymbolTableObject.h:
  5289. (JSC::symbolTableGet):
  5290. (JSC::symbolTablePut):
  5291. (JSC::symbolTablePutWithAttributes):
  5292. * runtime/RegExpCache.cpp:
  5293. (JSC::RegExpCache::invalidateCode):
  5294. * runtime/WeakGCMap.h:
  5295. (JSC::WeakGCMap::clear):
  5296. (JSC::WeakGCMap::set):
  5297. * tools/ProfileTreeNode.h:
  5298. (JSC::ProfileTreeNode::sampleChild):
  5299. (JSC::ProfileTreeNode::childCount):
  5300. (JSC::ProfileTreeNode::dumpInternal):
  5301. (JSC::ProfileTreeNode::compareEntries):
  5302. 2012-08-28 Geoffrey Garen <ggaren@apple.com>
  5303. GCC warning in JSActivation is causing Mac EWS errors
  5304. https://bugs.webkit.org/show_bug.cgi?id=95103
  5305. Reviewed by Sam Weinig.
  5306. Try to fix a strict aliasing violation by using bitwise_cast. The
  5307. union in the cast should signal to the compiler that aliasing between
  5308. types is happening.
  5309. * runtime/JSActivation.cpp:
  5310. (JSC::JSActivation::visitChildren):
  5311. 2012-08-28 Geoffrey Garen <ggaren@apple.com>
  5312. Build fix: svn add two files I forgot in my last patch.
  5313. 2012-08-27 Geoffrey Garen <ggaren@apple.com>
  5314. Refactored and consolidated variable resolution functions
  5315. https://bugs.webkit.org/show_bug.cgi?id=95166
  5316. Reviewed by Filip Pizlo.
  5317. This patch does a few things:
  5318. (1) Introduces a new class, JSScope, which is the base class for all
  5319. objects that represent a scope in the scope chain.
  5320. (2) Refactors and consolidates duplicate implementations of variable
  5321. resolution into the JSScope class.
  5322. (3) Renames JSStaticScopeObject to JSNameScope because, as distinct from
  5323. something like a 'let' scope, JSStaticScopeObject only has storage for a
  5324. single name.
  5325. These changes makes logical sense to me as-is. I will also use them in an
  5326. upcoming optimization.
  5327. * CMakeLists.txt:
  5328. * GNUmakefile.list.am:
  5329. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  5330. * JavaScriptCore.xcodeproj/project.pbxproj:
  5331. * Target.pri: Build!
  5332. * bytecode/CodeBlock.cpp:
  5333. (JSC): Build fix for LLInt-only builds.
  5334. * bytecode/GlobalResolveInfo.h:
  5335. (GlobalResolveInfo): Use PropertyOffset to be consistent with other parts
  5336. of the engine.
  5337. * bytecompiler/NodesCodegen.cpp:
  5338. * dfg/DFGOperations.cpp: Use the shared code in JSScope instead of rolling
  5339. our own.
  5340. * interpreter/Interpreter.cpp:
  5341. (JSC::Interpreter::execute):
  5342. (JSC::Interpreter::createExceptionScope):
  5343. (JSC::Interpreter::privateExecute):
  5344. * interpreter/Interpreter.h: Use the shared code in JSScope instead of rolling
  5345. our own.
  5346. * jit/JITStubs.cpp:
  5347. (JSC::DEFINE_STUB_FUNCTION): Use the shared code in JSScope instead of rolling
  5348. our own.
  5349. * llint/LLIntSlowPaths.cpp:
  5350. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  5351. (LLInt): Use the shared code in JSScope instead of rolling our own. Note
  5352. that one of these slow paths calls the wrong helper function. I left it
  5353. that way to avoid a behavior change in a refactoring patch.
  5354. * parser/Nodes.cpp: Updated for rename.
  5355. * runtime/CommonSlowPaths.h:
  5356. (CommonSlowPaths): Removed resolve slow paths because were duplicative.
  5357. * runtime/JSGlobalData.cpp:
  5358. (JSC::JSGlobalData::JSGlobalData):
  5359. * runtime/JSGlobalData.h:
  5360. (JSGlobalData): Updated for renames.
  5361. * runtime/JSNameScope.cpp: Copied from Source/JavaScriptCore/runtime/JSStaticScopeObject.cpp.
  5362. (JSC):
  5363. (JSC::JSNameScope::visitChildren):
  5364. (JSC::JSNameScope::toThisObject):
  5365. (JSC::JSNameScope::put):
  5366. (JSC::JSNameScope::getOwnPropertySlot):
  5367. * runtime/JSNameScope.h: Copied from Source/JavaScriptCore/runtime/JSStaticScopeObject.h.
  5368. (JSC):
  5369. (JSC::JSNameScope::create):
  5370. (JSC::JSNameScope::createStructure):
  5371. (JSNameScope):
  5372. (JSC::JSNameScope::JSNameScope):
  5373. (JSC::JSNameScope::isDynamicScope): Used do-webcore-rename script here.
  5374. It is fabulous!
  5375. * runtime/JSObject.h:
  5376. (JSObject):
  5377. (JSC::JSObject::isNameScopeObject): More rename.
  5378. * runtime/JSScope.cpp: Added.
  5379. (JSC):
  5380. (JSC::JSScope::isDynamicScope):
  5381. (JSC::JSScope::resolve):
  5382. (JSC::JSScope::resolveSkip):
  5383. (JSC::JSScope::resolveGlobal):
  5384. (JSC::JSScope::resolveGlobalDynamic):
  5385. (JSC::JSScope::resolveBase):
  5386. (JSC::JSScope::resolveWithBase):
  5387. (JSC::JSScope::resolveWithThis):
  5388. * runtime/JSScope.h: Added.
  5389. (JSC):
  5390. (JSScope):
  5391. (JSC::JSScope::JSScope): All the code here is a port from the
  5392. Interpreter.cpp implementations of this functionality.
  5393. * runtime/JSStaticScopeObject.cpp: Removed.
  5394. * runtime/JSStaticScopeObject.h: Removed.
  5395. * runtime/JSSymbolTableObject.cpp:
  5396. (JSC):
  5397. * runtime/JSSymbolTableObject.h:
  5398. (JSSymbolTableObject):
  5399. * runtime/JSType.h: Updated for rename.
  5400. * runtime/Operations.h:
  5401. (JSC::resolveBase): Removed because it was duplicative.
  5402. 2012-08-28 Alban Browaeys <prahal@yahoo.com>
  5403. [GTK] LLint build fails with -g -02
  5404. https://bugs.webkit.org/show_bug.cgi?id=90098
  5405. Reviewed by Filip Pizlo.
  5406. Avoid duplicate offsets for llint, discarding them.
  5407. * offlineasm/offsets.rb:
  5408. 2012-08-27 Sheriff Bot <webkit.review.bot@gmail.com>
  5409. Unreviewed, rolling out r126836.
  5410. http://trac.webkit.org/changeset/126836
  5411. https://bugs.webkit.org/show_bug.cgi?id=95163
  5412. Broke all Apple ports, EFL, and Qt. (Requested by tkent on
  5413. #webkit).
  5414. * API/JSCallbackObject.h:
  5415. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
  5416. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
  5417. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
  5418. * API/JSCallbackObjectFunctions.h:
  5419. (JSC::::getOwnPropertyNames):
  5420. * API/JSClassRef.cpp:
  5421. (OpaqueJSClass::~OpaqueJSClass):
  5422. (OpaqueJSClassContextData::OpaqueJSClassContextData):
  5423. (OpaqueJSClass::contextData):
  5424. * bytecode/CodeBlock.cpp:
  5425. (JSC::CodeBlock::dump):
  5426. (JSC::EvalCodeCache::visitAggregate):
  5427. (JSC::CodeBlock::nameForRegister):
  5428. * bytecode/JumpTable.h:
  5429. (JSC::StringJumpTable::offsetForValue):
  5430. (JSC::StringJumpTable::ctiForValue):
  5431. * bytecode/LazyOperandValueProfile.cpp:
  5432. (JSC::LazyOperandValueProfileParser::getIfPresent):
  5433. * bytecode/SamplingTool.cpp:
  5434. (JSC::SamplingTool::dump):
  5435. * bytecompiler/BytecodeGenerator.cpp:
  5436. (JSC::BytecodeGenerator::addVar):
  5437. (JSC::BytecodeGenerator::addGlobalVar):
  5438. (JSC::BytecodeGenerator::addConstant):
  5439. (JSC::BytecodeGenerator::addConstantValue):
  5440. (JSC::BytecodeGenerator::emitLoad):
  5441. (JSC::BytecodeGenerator::addStringConstant):
  5442. (JSC::BytecodeGenerator::emitLazyNewFunction):
  5443. * bytecompiler/NodesCodegen.cpp:
  5444. (JSC::PropertyListNode::emitBytecode):
  5445. * debugger/Debugger.cpp:
  5446. * dfg/DFGArgumentsSimplificationPhase.cpp:
  5447. (JSC::DFG::ArgumentsSimplificationPhase::run):
  5448. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  5449. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  5450. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  5451. (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
  5452. * dfg/DFGAssemblyHelpers.cpp:
  5453. (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
  5454. * dfg/DFGByteCodeCache.h:
  5455. (JSC::DFG::ByteCodeCache::~ByteCodeCache):
  5456. (JSC::DFG::ByteCodeCache::get):
  5457. * dfg/DFGByteCodeParser.cpp:
  5458. (JSC::DFG::ByteCodeParser::cellConstant):
  5459. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  5460. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5461. (JSC::DFG::StructureCheckHoistingPhase::run):
  5462. (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
  5463. (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
  5464. * heap/Heap.cpp:
  5465. (JSC::Heap::markProtectedObjects):
  5466. * heap/Heap.h:
  5467. (JSC::Heap::forEachProtectedCell):
  5468. * heap/JITStubRoutineSet.cpp:
  5469. (JSC::JITStubRoutineSet::markSlow):
  5470. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  5471. * heap/MarkStack.cpp:
  5472. (JSC::MarkStack::internalAppend):
  5473. * heap/Weak.h:
  5474. (JSC::weakRemove):
  5475. * jit/JIT.cpp:
  5476. (JSC::JIT::privateCompile):
  5477. * jit/JITStubs.cpp:
  5478. (JSC::JITThunks::ctiStub):
  5479. * parser/Parser.cpp:
  5480. (JSC::::parseStrictObjectLiteral):
  5481. * profiler/Profile.cpp:
  5482. (JSC::functionNameCountPairComparator):
  5483. (JSC::Profile::debugPrintDataSampleStyle):
  5484. * runtime/Identifier.cpp:
  5485. (JSC::Identifier::add):
  5486. * runtime/JSActivation.cpp:
  5487. (JSC::JSActivation::getOwnPropertyNames):
  5488. (JSC::JSActivation::symbolTablePutWithAttributes):
  5489. * runtime/JSArray.cpp:
  5490. (JSC::SparseArrayValueMap::put):
  5491. (JSC::SparseArrayValueMap::putDirect):
  5492. (JSC::SparseArrayValueMap::visitChildren):
  5493. (JSC::JSArray::enterDictionaryMode):
  5494. (JSC::JSArray::defineOwnNumericProperty):
  5495. (JSC::JSArray::getOwnPropertySlotByIndex):
  5496. (JSC::JSArray::getOwnPropertyDescriptor):
  5497. (JSC::JSArray::putByIndexBeyondVectorLength):
  5498. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  5499. (JSC::JSArray::deletePropertyByIndex):
  5500. (JSC::JSArray::getOwnPropertyNames):
  5501. (JSC::JSArray::setLength):
  5502. (JSC::JSArray::sort):
  5503. (JSC::JSArray::compactForSorting):
  5504. (JSC::JSArray::checkConsistency):
  5505. * runtime/JSSymbolTableObject.cpp:
  5506. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  5507. * runtime/JSSymbolTableObject.h:
  5508. (JSC::symbolTableGet):
  5509. (JSC::symbolTablePut):
  5510. (JSC::symbolTablePutWithAttributes):
  5511. * runtime/RegExpCache.cpp:
  5512. (JSC::RegExpCache::invalidateCode):
  5513. * runtime/WeakGCMap.h:
  5514. (JSC::WeakGCMap::clear):
  5515. (JSC::WeakGCMap::set):
  5516. * tools/ProfileTreeNode.h:
  5517. (JSC::ProfileTreeNode::sampleChild):
  5518. (JSC::ProfileTreeNode::childCount):
  5519. (JSC::ProfileTreeNode::dumpInternal):
  5520. (JSC::ProfileTreeNode::compareEntries):
  5521. 2012-08-27 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
  5522. Rename first/second to key/value in HashMap iterators
  5523. https://bugs.webkit.org/show_bug.cgi?id=82784
  5524. Reviewed by Eric Seidel.
  5525. * API/JSCallbackObject.h:
  5526. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::getPrivateProperty):
  5527. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::setPrivateProperty):
  5528. (JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
  5529. * API/JSCallbackObjectFunctions.h:
  5530. (JSC::::getOwnPropertyNames):
  5531. * API/JSClassRef.cpp:
  5532. (OpaqueJSClass::~OpaqueJSClass):
  5533. (OpaqueJSClassContextData::OpaqueJSClassContextData):
  5534. (OpaqueJSClass::contextData):
  5535. * bytecode/CodeBlock.cpp:
  5536. (JSC::CodeBlock::dump):
  5537. (JSC::EvalCodeCache::visitAggregate):
  5538. (JSC::CodeBlock::nameForRegister):
  5539. * bytecode/JumpTable.h:
  5540. (JSC::StringJumpTable::offsetForValue):
  5541. (JSC::StringJumpTable::ctiForValue):
  5542. * bytecode/LazyOperandValueProfile.cpp:
  5543. (JSC::LazyOperandValueProfileParser::getIfPresent):
  5544. * bytecode/SamplingTool.cpp:
  5545. (JSC::SamplingTool::dump):
  5546. * bytecompiler/BytecodeGenerator.cpp:
  5547. (JSC::BytecodeGenerator::addVar):
  5548. (JSC::BytecodeGenerator::addGlobalVar):
  5549. (JSC::BytecodeGenerator::addConstant):
  5550. (JSC::BytecodeGenerator::addConstantValue):
  5551. (JSC::BytecodeGenerator::emitLoad):
  5552. (JSC::BytecodeGenerator::addStringConstant):
  5553. (JSC::BytecodeGenerator::emitLazyNewFunction):
  5554. * bytecompiler/NodesCodegen.cpp:
  5555. (JSC::PropertyListNode::emitBytecode):
  5556. * debugger/Debugger.cpp:
  5557. * dfg/DFGArgumentsSimplificationPhase.cpp:
  5558. (JSC::DFG::ArgumentsSimplificationPhase::run):
  5559. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  5560. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  5561. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  5562. (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
  5563. * dfg/DFGAssemblyHelpers.cpp:
  5564. (JSC::DFG::AssemblyHelpers::decodedCodeMapFor):
  5565. * dfg/DFGByteCodeCache.h:
  5566. (JSC::DFG::ByteCodeCache::~ByteCodeCache):
  5567. (JSC::DFG::ByteCodeCache::get):
  5568. * dfg/DFGByteCodeParser.cpp:
  5569. (JSC::DFG::ByteCodeParser::cellConstant):
  5570. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  5571. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5572. (JSC::DFG::StructureCheckHoistingPhase::run):
  5573. (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
  5574. (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
  5575. * heap/Heap.cpp:
  5576. (JSC::Heap::markProtectedObjects):
  5577. * heap/Heap.h:
  5578. (JSC::Heap::forEachProtectedCell):
  5579. * heap/JITStubRoutineSet.cpp:
  5580. (JSC::JITStubRoutineSet::markSlow):
  5581. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  5582. * heap/MarkStack.cpp:
  5583. (JSC::MarkStack::internalAppend):
  5584. * heap/Weak.h:
  5585. (JSC::weakRemove):
  5586. * jit/JIT.cpp:
  5587. (JSC::JIT::privateCompile):
  5588. * jit/JITStubs.cpp:
  5589. (JSC::JITThunks::ctiStub):
  5590. * parser/Parser.cpp:
  5591. (JSC::::parseStrictObjectLiteral):
  5592. * profiler/Profile.cpp:
  5593. (JSC::functionNameCountPairComparator):
  5594. (JSC::Profile::debugPrintDataSampleStyle):
  5595. * runtime/Identifier.cpp:
  5596. (JSC::Identifier::add):
  5597. * runtime/JSActivation.cpp:
  5598. (JSC::JSActivation::getOwnPropertyNames):
  5599. (JSC::JSActivation::symbolTablePutWithAttributes):
  5600. * runtime/JSArray.cpp:
  5601. (JSC::SparseArrayValueMap::put):
  5602. (JSC::SparseArrayValueMap::putDirect):
  5603. (JSC::SparseArrayValueMap::visitChildren):
  5604. (JSC::JSArray::enterDictionaryMode):
  5605. (JSC::JSArray::defineOwnNumericProperty):
  5606. (JSC::JSArray::getOwnPropertySlotByIndex):
  5607. (JSC::JSArray::getOwnPropertyDescriptor):
  5608. (JSC::JSArray::putByIndexBeyondVectorLength):
  5609. (JSC::JSArray::putDirectIndexBeyondVectorLength):
  5610. (JSC::JSArray::deletePropertyByIndex):
  5611. (JSC::JSArray::getOwnPropertyNames):
  5612. (JSC::JSArray::setLength):
  5613. (JSC::JSArray::sort):
  5614. (JSC::JSArray::compactForSorting):
  5615. (JSC::JSArray::checkConsistency):
  5616. * runtime/JSSymbolTableObject.cpp:
  5617. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  5618. * runtime/JSSymbolTableObject.h:
  5619. (JSC::symbolTableGet):
  5620. (JSC::symbolTablePut):
  5621. (JSC::symbolTablePutWithAttributes):
  5622. * runtime/RegExpCache.cpp:
  5623. (JSC::RegExpCache::invalidateCode):
  5624. * runtime/WeakGCMap.h:
  5625. (JSC::WeakGCMap::clear):
  5626. (JSC::WeakGCMap::set):
  5627. * tools/ProfileTreeNode.h:
  5628. (JSC::ProfileTreeNode::sampleChild):
  5629. (JSC::ProfileTreeNode::childCount):
  5630. (JSC::ProfileTreeNode::dumpInternal):
  5631. (JSC::ProfileTreeNode::compareEntries):
  5632. 2012-08-27 Filip Pizlo <fpizlo@apple.com>
  5633. Structure check hoisting should abstain if the OSR entry's must-handle value for the respective variable has a different structure
  5634. https://bugs.webkit.org/show_bug.cgi?id=95141
  5635. <rdar://problem/12170401>
  5636. Reviewed by Mark Hahnenberg.
  5637. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5638. (JSC::DFG::StructureCheckHoistingPhase::run):
  5639. 2012-08-27 Mark Hahnenberg <mhahnenberg@apple.com>
  5640. Remove use of ClassInfo from SpeculativeJIT::compileGetByValOnArguments
  5641. https://bugs.webkit.org/show_bug.cgi?id=95131
  5642. Reviewed by Filip Pizlo.
  5643. * dfg/DFGSpeculativeJIT.cpp:
  5644. (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments): We don't need this speculation check. We can replace it
  5645. with an assert to guarantee this.
  5646. 2012-08-27 Oliver Hunt <oliver@apple.com>
  5647. Remove opcode definition autogen for now
  5648. https://bugs.webkit.org/show_bug.cgi?id=95148
  5649. Reviewed by Mark Hahnenberg.
  5650. This isn't worth doing at the moment.
  5651. * DerivedSources.make:
  5652. * JavaScriptCore.xcodeproj/project.pbxproj:
  5653. * bytecode/Opcode.h:
  5654. (JSC):
  5655. (JSC::padOpcodeName):
  5656. * bytecode/OpcodeDefinitions.h: Removed.
  5657. * bytecode/opcodes: Removed.
  5658. * opcode_definition_generator.py: Removed.
  5659. * opcode_generator.py: Removed.
  5660. * opcode_parser.py: Removed.
  5661. 2012-08-27 Mark Hahnenberg <mhahnenberg@apple.com>
  5662. Remove uses of TypedArray ClassInfo from SpeculativeJIT::checkArgumentTypes
  5663. https://bugs.webkit.org/show_bug.cgi?id=95112
  5664. Reviewed by Filip Pizlo.
  5665. Removing these checks since we no longer need them.
  5666. * dfg/DFGAbstractState.cpp:
  5667. (JSC::DFG::AbstractState::initialize):
  5668. * dfg/DFGSpeculativeJIT.cpp:
  5669. (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
  5670. 2012-08-27 Benjamin Poulain <benjamin@webkit.org>
  5671. Add ECMAScript Number to String conversion to WTF::String
  5672. https://bugs.webkit.org/show_bug.cgi?id=95016
  5673. Reviewed by Geoffrey Garen.
  5674. Rename UString::number(double) to UString::numberToStringECMAScript(double) to
  5675. differenciate it from the fixed-width conversion performed by String::number().
  5676. * parser/ParserArena.h:
  5677. (JSC::IdentifierArena::makeNumericIdentifier):
  5678. * runtime/JSONObject.cpp:
  5679. (JSC::Stringifier::appendStringifiedValue):
  5680. * runtime/NumberPrototype.cpp:
  5681. (JSC::numberProtoFuncToExponential):
  5682. (JSC::numberProtoFuncToFixed):
  5683. (JSC::numberProtoFuncToPrecision):
  5684. (JSC::numberProtoFuncToString):
  5685. * runtime/NumericStrings.h:
  5686. (JSC::NumericStrings::add):
  5687. * runtime/UString.cpp:
  5688. (JSC::UString::numberToStringECMAScript):
  5689. * runtime/UString.h:
  5690. (UString):
  5691. 2012-08-27 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
  5692. Rename RegisterProtocolHandler API to NavigatorContentUtils
  5693. https://bugs.webkit.org/show_bug.cgi?id=94920
  5694. Reviewed by Adam Barth.
  5695. ENABLE_REGISTER_PROTOCOL_HANDLER is renamed to ENABLE_NAVIGATOR_CONTENT_UTILS.
  5696. * Configurations/FeatureDefines.xcconfig:
  5697. 2012-08-26 Filip Pizlo <fpizlo@apple.com>
  5698. Unreviewed, fix for builds without VALUE_PROFILING. I had forgotten that shouldEmitProfiling()
  5699. is designed to return true if DFG_JIT is disabled. I should be using canBeOptimized() instead.
  5700. * jit/JITCall.cpp:
  5701. (JSC::JIT::compileOpCall):
  5702. * jit/JITCall32_64.cpp:
  5703. (JSC::JIT::compileOpCall):
  5704. 2012-08-26 Geoffrey Garen <ggaren@apple.com>
  5705. Don't allocate space for arguments and call frame if arguments aren't captured
  5706. https://bugs.webkit.org/show_bug.cgi?id=95024
  5707. Reviewed by Phil Pizlo.
  5708. 27% on v8-real-earley.
  5709. * runtime/JSActivation.h:
  5710. (JSC::JSActivation::registerOffset): The offset is zero if we're skipping
  5711. the arguments and call frame because "offset" means space reserved for
  5712. those things.
  5713. (JSC::JSActivation::tearOff): Don't copy the scope chain and callee. We
  5714. don't need them for anything, and we're no longer guaranteed to have
  5715. space for them.
  5716. 2012-08-26 Geoffrey Garen <ggaren@apple.com>
  5717. Removed the NULL checks from visitChildren functions
  5718. https://bugs.webkit.org/show_bug.cgi?id=95021
  5719. Reviewed by Oliver Hunt.
  5720. As of http://trac.webkit.org/changeset/126624, all values are NULL-checked
  5721. during GC, so explicit NULL checks aren't needed anymore.
  5722. 2011-08-26 Geoffrey Garen <ggaren@apple.com>
  5723. Removed a JSC-specific hack from the web inspector
  5724. https://bugs.webkit.org/show_bug.cgi?id=95033
  5725. Reviewed by Filip Pizlo.
  5726. Added support for what the web inspector really wanted instead.
  5727. * runtime/JSActivation.cpp:
  5728. (JSC::JSActivation::symbolTableGet):
  5729. (JSC::JSActivation::symbolTablePut): Added some explanation for these
  5730. checks, which were non-obvious to me.
  5731. (JSC::JSActivation::getOwnPropertySlot): It's impossible to access the
  5732. arguments property of an activation after it's been torn off, since the
  5733. only way to tear off an activation is to instantiate a new function,
  5734. which has its own arguments property in scope. However, the inspector
  5735. get special access to activations, and may try to perform this access,
  5736. so we need a special guard to maintain coherence and avoid crashing in
  5737. case the activation optimized out the arguments property.
  5738. * runtime/JSActivation.cpp:
  5739. (JSC::JSActivation::symbolTableGet):
  5740. (JSC::JSActivation::symbolTablePut):
  5741. (JSC::JSActivation::getOwnPropertyNames):
  5742. (JSC::JSActivation::getOwnPropertyDescriptor): Provide getOwnPropertyNames
  5743. and getOwnPropertyDescriptor implementations, to meet the web inspector's
  5744. needs. (User code can never call these.)
  5745. 2012-08-24 Filip Pizlo <fpizlo@apple.com>
  5746. Finally inlining should correctly track the catch context
  5747. https://bugs.webkit.org/show_bug.cgi?id=94986
  5748. <rdar://problem/11753784>
  5749. Reviewed by Sam Weinig.
  5750. This fixes two behaviors:
  5751. 1) Throwing from a finally block. Previously, we would seem to reenter the finally
  5752. block - though only once.
  5753. 2) Executing a finally block from some nested context, for example due to a
  5754. 'continue', 'break', or 'return' in the try. This would execute the finally
  5755. block in the context of of the try block, which could lead to either scope depth
  5756. mismatches or reexecutions of the finally block on throw, similarly to (1) but
  5757. for different reasons.
  5758. * bytecompiler/BytecodeGenerator.cpp:
  5759. (JSC):
  5760. (JSC::BytecodeGenerator::pushFinallyContext):
  5761. (JSC::BytecodeGenerator::emitComplexJumpScopes):
  5762. (JSC::BytecodeGenerator::pushTry):
  5763. (JSC::BytecodeGenerator::popTryAndEmitCatch):
  5764. * bytecompiler/BytecodeGenerator.h:
  5765. (FinallyContext):
  5766. (TryData):
  5767. (JSC):
  5768. (TryContext):
  5769. (TryRange):
  5770. (BytecodeGenerator):
  5771. * bytecompiler/NodesCodegen.cpp:
  5772. (JSC::TryNode::emitBytecode):
  5773. 2012-08-26 Filip Pizlo <fpizlo@apple.com>
  5774. Array type checks and storage accesses should be uniformly represented and available to CSE
  5775. https://bugs.webkit.org/show_bug.cgi?id=95013
  5776. Reviewed by Oliver Hunt.
  5777. This uniformly breaks up all array accesses into up to three parts:
  5778. 1) The type check, using a newly introduced CheckArray node, in addition to possibly
  5779. a CheckStructure node. We were already inserting the CheckStructure prior to this
  5780. patch. The CheckArray node will be automatically eliminated if the thing it was
  5781. checking for had already been checked for, either intentionally (a CheckStructure
  5782. inserted based on the array profile of this access) or accidentally (some checks,
  5783. typically a CheckStructure, inserted for some unrelated operations). The
  5784. CheckArray node may not be inserted if the array type is non-specific (Generic or
  5785. ForceExit).
  5786. 2) The storage load using GetIndexedPropertyStorage. Previously, this only worked for
  5787. GetByVal. Now it works for all array accesses. The storage load may not be
  5788. inserted if the mode of array access does not permit CSE of storage loads (like
  5789. non-specific modes or Arguments).
  5790. 3) The access itself: one of GetByVal, PutByVal, PutByValAlias, ArrayPush, ArrayPop,
  5791. GetArrayLength, StringCharAt, or StringCharCodeAt.
  5792. This means that the type check can be subjected to CSE even if the CFA isn't smart
  5793. enough to reason about it (yet!). It also means that the storage load can always be
  5794. subjected to CSE; previously CSE on storage load only worked for array loads and not
  5795. other forms of access. Finally, it removes the bizarre behavior that
  5796. GetIndexedPropertyStorage previously had: previously, it was responsible for the type
  5797. check in some cases, but not others; this made reasoning about the CFA really
  5798. confusing.
  5799. This change also disables late refinement of array mode, since I decided that
  5800. supporting that feature is both confusing and likely unprofitable. The array modes are
  5801. now locked in in the first fixup run after prediction propagation. Of course,
  5802. refinements from Generic to something else would not have been a problem; we could
  5803. reenable those if we thought we really needed to.
  5804. * dfg/DFGAbstractState.cpp:
  5805. (JSC::DFG::AbstractState::execute):
  5806. * dfg/DFGArgumentsSimplificationPhase.cpp:
  5807. (JSC::DFG::ArgumentsSimplificationPhase::run):
  5808. * dfg/DFGArrayMode.cpp:
  5809. (JSC::DFG::fromStructure):
  5810. (DFG):
  5811. (JSC::DFG::refineArrayMode):
  5812. * dfg/DFGArrayMode.h:
  5813. (DFG):
  5814. (JSC::DFG::modeIsJSArray):
  5815. (JSC::DFG::lengthNeedsStorage):
  5816. (JSC::DFG::modeIsSpecific):
  5817. (JSC::DFG::modeSupportsLength):
  5818. * dfg/DFGByteCodeParser.cpp:
  5819. (JSC::DFG::ByteCodeParser::ByteCodeParser):
  5820. (JSC::DFG::ByteCodeParser::getArrayMode):
  5821. (ByteCodeParser):
  5822. (JSC::DFG::ByteCodeParser::getArrayModeAndEmitChecks):
  5823. (JSC::DFG::ByteCodeParser::handleIntrinsic):
  5824. (JSC::DFG::ByteCodeParser::parseBlock):
  5825. * dfg/DFGCFGSimplificationPhase.cpp:
  5826. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  5827. * dfg/DFGCSEPhase.cpp:
  5828. (JSC::DFG::CSEPhase::CSEPhase):
  5829. (JSC::DFG::CSEPhase::checkStructureElimination):
  5830. (CSEPhase):
  5831. (JSC::DFG::CSEPhase::checkArrayElimination):
  5832. (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
  5833. (JSC::DFG::CSEPhase::performNodeCSE):
  5834. (JSC::DFG::performCSE):
  5835. * dfg/DFGCSEPhase.h:
  5836. (DFG):
  5837. * dfg/DFGCommon.h:
  5838. * dfg/DFGConstantFoldingPhase.cpp:
  5839. (JSC::DFG::ConstantFoldingPhase::foldConstants):
  5840. * dfg/DFGDriver.cpp:
  5841. (JSC::DFG::compile):
  5842. * dfg/DFGFixupPhase.cpp:
  5843. (JSC::DFG::FixupPhase::fixupNode):
  5844. (JSC::DFG::FixupPhase::checkArray):
  5845. (FixupPhase):
  5846. (JSC::DFG::FixupPhase::blessArrayOperation):
  5847. * dfg/DFGGraph.cpp:
  5848. (JSC::DFG::Graph::Graph):
  5849. (DFG):
  5850. (JSC::DFG::Graph::dump):
  5851. (JSC::DFG::Graph::collectGarbage):
  5852. * dfg/DFGGraph.h:
  5853. (Graph):
  5854. (JSC::DFG::Graph::vote):
  5855. (JSC::DFG::Graph::substitute):
  5856. * dfg/DFGNode.h:
  5857. (JSC::DFG::Node::hasArrayMode):
  5858. (JSC::DFG::Node::setArrayMode):
  5859. * dfg/DFGNodeType.h:
  5860. (DFG):
  5861. * dfg/DFGOperations.cpp:
  5862. * dfg/DFGPhase.h:
  5863. (DFG):
  5864. * dfg/DFGPredictionPropagationPhase.cpp:
  5865. (JSC::DFG::PredictionPropagationPhase::propagate):
  5866. (JSC::DFG::PredictionPropagationPhase::mergeDefaultFlags):
  5867. * dfg/DFGSpeculativeJIT.cpp:
  5868. (JSC::DFG::SpeculativeJIT::checkArray):
  5869. (JSC::DFG::SpeculativeJIT::useChildren):
  5870. (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
  5871. (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
  5872. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  5873. (JSC::DFG::SpeculativeJIT::compileGetArrayLength):
  5874. * dfg/DFGSpeculativeJIT.h:
  5875. (SpeculativeJIT):
  5876. * dfg/DFGSpeculativeJIT32_64.cpp:
  5877. (JSC::DFG::SpeculativeJIT::compile):
  5878. * dfg/DFGSpeculativeJIT64.cpp:
  5879. (JSC::DFG::SpeculativeJIT::compile):
  5880. * dfg/DFGStructureCheckHoistingPhase.cpp:
  5881. (JSC::DFG::StructureCheckHoistingPhase::run):
  5882. 2012-08-26 Filip Pizlo <fpizlo@apple.com>
  5883. DFGGraph.h has a bogus comment about the nature of StorageAccessData
  5884. https://bugs.webkit.org/show_bug.cgi?id=95035
  5885. Reviewed by Oliver Hunt.
  5886. The comment is both wrong (storage access instructions don't reference CheckStructure)
  5887. and highly redundant: of course it's the case that two structures may have the same
  5888. identifier. Our interference analyses currently don't care about this and make the
  5889. conservative assumptions when necessary (same identifier, same object -> must be same
  5890. property; same identifier, may be same object -> may be the same property). Better to
  5891. remove the bogus comment since the code that operates over this data structure is
  5892. fairly self-explanatory already.
  5893. * dfg/DFGGraph.h:
  5894. (StorageAccessData):
  5895. 2012-08-25 Geoffrey Garen <ggaren@apple.com>
  5896. Try a little harder to fix the Linux build.
  5897. * runtime/JSActivation.cpp:
  5898. * runtime/JSActivation.h:
  5899. 2012-08-25 Geoffrey Garen <ggaren@apple.com>
  5900. Try to fix the Linux build.
  5901. * runtime/JSActivation.cpp:
  5902. 2012-08-25 Geoffrey Garen <ggaren@apple.com>
  5903. Don't use malloc / destructors for activation objects
  5904. https://bugs.webkit.org/show_bug.cgi?id=94897
  5905. Reviewed by Oliver Hunt.
  5906. 65% faster on v8-real-earley.
  5907. Lots of boilerplate here, but the jist is this:
  5908. (1) Use CopiedSpace instead of malloc to allocate the activation's
  5909. backing store.
  5910. (2) Use MarkedSpace instead of ref-counting to allocate the symbol table.
  5911. (3) ==> No more destructor.
  5912. * bytecode/CodeBlock.cpp:
  5913. (JSC::CodeBlock::CodeBlock):
  5914. (JSC::CodeBlock::stronglyVisitStrongReferences):
  5915. * bytecode/CodeBlock.h:
  5916. (JSC::CodeBlock::symbolTable):
  5917. (CodeBlock):
  5918. (JSC::GlobalCodeBlock::GlobalCodeBlock):
  5919. (JSC::FunctionCodeBlock::FunctionCodeBlock):
  5920. (FunctionCodeBlock): SymbolTable is a GC object now, so it gets a write
  5921. barrier and visit calls instead of ref-counting. I changed all CodeBlocks
  5922. to use shared symbol tables because the distinction between shared and
  5923. unshared hurt my head.
  5924. * bytecompiler/BytecodeGenerator.cpp:
  5925. (JSC::BytecodeGenerator::resolve):
  5926. (JSC::BytecodeGenerator::resolveConstDecl):
  5927. (JSC::BytecodeGenerator::emitPutStaticVar):
  5928. * dfg/DFGByteCodeParser.cpp:
  5929. (JSC::DFG::ByteCodeParser::parseBlock):
  5930. * dfg/DFGSpeculativeJIT32_64.cpp:
  5931. (JSC::DFG::SpeculativeJIT::compile):
  5932. * dfg/DFGSpeculativeJIT64.cpp:
  5933. (JSC::DFG::SpeculativeJIT::compile): Sometimes, a period just wants
  5934. to be an arrow. And then C++ is there to accommodate.
  5935. * jit/JITDriver.h:
  5936. (JSC::jitCompileFunctionIfAppropriate):
  5937. * runtime/Arguments.h:
  5938. (ArgumentsData):
  5939. (JSC::Arguments::setRegisters):
  5940. (Arguments):
  5941. (JSC::Arguments::argument):
  5942. (JSC::Arguments::finishCreation):
  5943. * runtime/Executable.cpp:
  5944. (JSC::FunctionExecutable::FunctionExecutable):
  5945. (JSC::ProgramExecutable::compileInternal):
  5946. (JSC::FunctionExecutable::compileForCallInternal):
  5947. (JSC::FunctionExecutable::compileForConstructInternal):
  5948. (JSC::FunctionExecutable::visitChildren):
  5949. * runtime/Executable.h:
  5950. (JSC::FunctionExecutable::symbolTable):
  5951. (FunctionExecutable):
  5952. * runtime/ExecutionHarness.h:
  5953. (JSC::prepareFunctionForExecution): I changed from WriteBarrier to
  5954. WriteBarrierBase so activations could reuse StorageBarrier and PropertyStorage.
  5955. * runtime/JSActivation.cpp:
  5956. (JSC::JSActivation::JSActivation):
  5957. (JSC::JSActivation::finishCreation): Allocate the symbol table here,
  5958. after we're fully constructed, to avoid GC during initialization.
  5959. (JSC::JSActivation::visitChildren):
  5960. (JSC::JSActivation::symbolTableGet):
  5961. (JSC::JSActivation::symbolTablePut):
  5962. (JSC::JSActivation::getOwnPropertyNames):
  5963. (JSC::JSActivation::symbolTablePutWithAttributes):
  5964. * runtime/JSActivation.h:
  5965. (JSC::JSActivation::create):
  5966. (JSActivation):
  5967. (JSC::JSActivation::registerOffset):
  5968. (JSC):
  5969. (JSC::JSActivation::registerArraySize):
  5970. (JSC::JSActivation::registerArraySizeInBytes):
  5971. (JSC::JSActivation::tearOff): Tear-off zero-initializes all uncopied
  5972. registers. This makes it safe to copyAndAppend the full buffer in
  5973. visitChildren, without any extra checks.
  5974. * runtime/JSCell.h:
  5975. (JSCell): Moved a shared default set of flags into this base class, so
  5976. I could use it in a few places.
  5977. * runtime/JSGlobalData.cpp:
  5978. (JSC::JSGlobalData::JSGlobalData):
  5979. * runtime/JSGlobalData.h:
  5980. (JSGlobalData): New structure for symbol tables.
  5981. * runtime/JSGlobalObject.cpp:
  5982. (JSC::JSGlobalObject::JSGlobalObject):
  5983. (JSC::JSGlobalObject::addStaticGlobals):
  5984. * runtime/JSGlobalObject.h:
  5985. (JSGlobalObject):
  5986. (JSC::JSGlobalObject::symbolTableHasProperty): We don't need an inline
  5987. symbol table -- JSSymbolTableObject will GC allocate one for us.
  5988. * runtime/JSObject.h:
  5989. (JSObject):
  5990. * runtime/JSSegmentedVariableObject.h:
  5991. (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
  5992. * runtime/JSStaticScopeObject.cpp:
  5993. (JSC):
  5994. (JSC::JSStaticScopeObject::visitChildren): NULL check our register store
  5995. because finishCreation allocates an object now, so we may get marked
  5996. before we've assigned to our register store.
  5997. * runtime/JSStaticScopeObject.h:
  5998. (JSC::JSStaticScopeObject::finishCreation):
  5999. (JSC::JSStaticScopeObject::JSStaticScopeObject):
  6000. (JSStaticScopeObject): No more destructor for this object, either, since
  6001. it no longer embeds a hash table.
  6002. * runtime/JSSymbolTableObject.cpp:
  6003. (JSC::JSSymbolTableObject::visitChildren):
  6004. (JSC::JSSymbolTableObject::deleteProperty):
  6005. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  6006. * runtime/JSSymbolTableObject.h:
  6007. (JSC::JSSymbolTableObject::symbolTable):
  6008. (JSSymbolTableObject):
  6009. (JSC::JSSymbolTableObject::JSSymbolTableObject):
  6010. (JSC::JSSymbolTableObject::finishCreation):
  6011. (JSC::symbolTableGet):
  6012. (JSC::symbolTablePut):
  6013. (JSC::symbolTablePutWithAttributes): SymbolTableObject allocates a symbol
  6014. table automatically if one isn't provided. (Activations provide their
  6015. own, which they get from compiled code.)
  6016. * runtime/JSVariableObject.cpp:
  6017. (JSC):
  6018. * runtime/JSVariableObject.h:
  6019. (JSC::JSVariableObject::registerAt):
  6020. (JSC::JSVariableObject::addressOfRegisters):
  6021. (JSVariableObject):
  6022. (JSC::JSVariableObject::JSVariableObject):
  6023. (JSC::JSVariableObject::finishCreation): Removed a bunch of obsolete code.
  6024. Activations manage their registers directly now.
  6025. * runtime/StorageBarrier.h:
  6026. (StorageBarrier):
  6027. (JSC::StorageBarrier::operator!):
  6028. * runtime/SymbolTable.cpp:
  6029. (JSC):
  6030. (JSC::SharedSymbolTable::destroy):
  6031. * runtime/SymbolTable.h:
  6032. (JSC::SharedSymbolTable::create):
  6033. (SharedSymbolTable):
  6034. (JSC::SharedSymbolTable::createStructure):
  6035. (JSC::SharedSymbolTable::SharedSymbolTable): Boilerplat code to
  6036. make shared symbol table GC-allocated.
  6037. 2012-08-25 Filip Pizlo <fpizlo@apple.com>
  6038. op_call should have ArrayProfiling for the benefit of array intrinsics
  6039. https://bugs.webkit.org/show_bug.cgi?id=95014
  6040. Reviewed by Sam Weinig.
  6041. This is a performance-neutral change that just adds the profiling but does not
  6042. use it, yet. If in the future we wanted to make this kind of profiling cheaper
  6043. we could move it into specialized thunks for the relevant array intrinsics, but
  6044. I figure that if this much simpler change gives us what we need without any
  6045. discernable performance penalty then that's for the best.
  6046. * bytecompiler/BytecodeGenerator.cpp:
  6047. (JSC::BytecodeGenerator::emitCall):
  6048. * jit/JITCall.cpp:
  6049. (JSC::JIT::compileOpCall):
  6050. * jit/JITCall32_64.cpp:
  6051. (JSC::JIT::compileOpCall):
  6052. * llint/LowLevelInterpreter.asm:
  6053. * llint/LowLevelInterpreter32_64.asm:
  6054. * llint/LowLevelInterpreter64.asm:
  6055. 2012-08-25 Filip Pizlo <fpizlo@apple.com>
  6056. The redundant phi elimination phase is not used and should be removed
  6057. https://bugs.webkit.org/show_bug.cgi?id=95006
  6058. Reviewed by Dan Bernstein.
  6059. Just removing dead code.
  6060. * CMakeLists.txt:
  6061. * GNUmakefile.list.am:
  6062. * JavaScriptCore.xcodeproj/project.pbxproj:
  6063. * Target.pri:
  6064. * dfg/DFGDriver.cpp:
  6065. * dfg/DFGRedundantPhiEliminationPhase.cpp: Removed.
  6066. * dfg/DFGRedundantPhiEliminationPhase.h: Removed.
  6067. 2012-08-24 Benjamin Poulain <bpoulain@apple.com>
  6068. Unify Number to StringImpl conversion
  6069. https://bugs.webkit.org/show_bug.cgi?id=94879
  6070. Reviewed by Geoffrey Garen.
  6071. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6072. * runtime/UString.cpp:
  6073. * runtime/UString.h:
  6074. (JSC::UString::number):
  6075. Update UString to directly use the common NumberToString implementation.
  6076. 2012-08-24 Oliver Hunt <oliver@apple.com>
  6077. Always null check cells before marking
  6078. https://bugs.webkit.org/show_bug.cgi?id=94968
  6079. Reviewed by Geoffrey Garen.
  6080. Originally we tried to minimise null checks by only null checking values
  6081. that we knew could be null, however given that we can't ever guarantee
  6082. when a GC will happen, we're better off just always assuming that a null
  6083. check will be necessary. This results in a much less fragile code base
  6084. as we can add GC allocations to object initialisers without having to
  6085. subsequently worry about whether the object we are initialising will need
  6086. to add a bunch of null checks in its visitChildren implementation.
  6087. * heap/MarkStack.cpp:
  6088. (JSC::MarkStack::internalAppend):
  6089. * heap/MarkStackInlineMethods.h:
  6090. (JSC::MarkStack::append):
  6091. (JSC::MarkStack::appendUnbarrieredPointer):
  6092. * runtime/Structure.h:
  6093. (JSC::MarkStack::internalAppend):
  6094. 2012-08-23 Oliver Hunt <oliver@apple.com>
  6095. Autogenerate Opcode definitions
  6096. https://bugs.webkit.org/show_bug.cgi?id=94840
  6097. Reviewed by Gavin Barraclough.
  6098. Start the process of autogenerating the code emission for the bytecode.
  6099. We'll just start with automatic generation of the list of Opcodes as that
  6100. requires the actual definition of the opcodes, and the logic for parsing
  6101. them.
  6102. Due to some rather annoying dependency cycles, this initial version has
  6103. the OpcodeDefinitions.h file checked into the tree, although with some
  6104. work I hope to be able to fix that.
  6105. * DerivedSources.make:
  6106. * JavaScriptCore.xcodeproj/project.pbxproj:
  6107. * bytecode/Opcode.h:
  6108. Include OpcodeDefinitions.h as our definitive source of info
  6109. about the opcodes.
  6110. * bytecode/OpcodeDefinitions.h: Added.
  6111. Autogenerated file
  6112. * bytecode/opcodes: Added.
  6113. The new opcode definition file
  6114. * opcode_definition_generator.py: Added.
  6115. (generateOpcodeDefinition):
  6116. (generate):
  6117. Module that generates the content for OpcodeDefinitions.h
  6118. * opcode_generator.py: Added.
  6119. (printUsage):
  6120. (main):
  6121. Driver script
  6122. * opcode_parser.py: Added.
  6123. Simple parser for the opcode definitions.
  6124. 2011-08-23 Geoffrey Garen <ggaren@apple.com>
  6125. Unreviewed, rolling out r126505.
  6126. http://trac.webkit.org/changeset/126505
  6127. https://bugs.webkit.org/show_bug.cgi?id=94840
  6128. Caused testapi to crash on launch
  6129. * DerivedSources.make:
  6130. * JavaScriptCore.xcodeproj/project.pbxproj:
  6131. * bytecode/Opcode.h:
  6132. (JSC):
  6133. (JSC::padOpcodeName):
  6134. * bytecode/OpcodeDefinitions.h: Removed.
  6135. * bytecode/opcodes: Removed.
  6136. * opcode_definition_generator.py: Removed.
  6137. * opcode_generator.py: Removed.
  6138. * opcode_parser.py: Removed.
  6139. 2012-08-23 Oliver Hunt <oliver@apple.com>
  6140. Autogenerate Opcode definitions
  6141. https://bugs.webkit.org/show_bug.cgi?id=94840
  6142. Reviewed by Gavin Barraclough.
  6143. Start the process of autogenerating the code emission for the bytecode.
  6144. We'll just start with automatic generation of the list of Opcodes as that
  6145. requires the actual definition of the opcodes, and the logic for parsing
  6146. them.
  6147. Due to some rather annoying dependency cycles, this initial version has
  6148. the OpcodeDefinitions.h file checked into the tree, although with some
  6149. work I hope to be able to fix that.
  6150. * DerivedSources.make:
  6151. * JavaScriptCore.xcodeproj/project.pbxproj:
  6152. * bytecode/Opcode.h:
  6153. Include OpcodeDefinitions.h as our definitive source of info
  6154. about the opcodes.
  6155. * bytecode/OpcodeDefinitions.h: Added.
  6156. Autogenerated file
  6157. * bytecode/opcodes: Added.
  6158. The new opcode definition file
  6159. * opcode_definition_generator.py: Added.
  6160. (generateOpcodeDefinition):
  6161. (generate):
  6162. Module that generates the content for OpcodeDefinitions.h
  6163. * opcode_generator.py: Added.
  6164. (printUsage):
  6165. (main):
  6166. Driver script
  6167. * opcode_parser.py: Added.
  6168. Simple parser for the opcode definitions.
  6169. 2012-08-23 Mark Hahnenberg <mhahnenberg@apple.com>
  6170. Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
  6171. https://bugs.webkit.org/show_bug.cgi?id=93884
  6172. Reviewed by Filip Pizlo.
  6173. With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
  6174. MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
  6175. we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
  6176. objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
  6177. For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
  6178. masquerade as undefined within frame B, but it will continue to masquerade in frame A.
  6179. There are two primary changes that are taking place here. One is to thread the ExecState* through
  6180. JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
  6181. JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
  6182. are distinct, then the object cannot MasqueradeAsUndefined.
  6183. The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
  6184. flag in the Structure is checked. For C++ code, this check has been factored into its own function in
  6185. Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
  6186. had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
  6187. through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
  6188. that are MasqueradesAsUndefined.
  6189. * API/JSValueRef.cpp:
  6190. (JSValueToBoolean):
  6191. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6192. * bytecode/Watchpoint.h:
  6193. (WatchpointSet):
  6194. * debugger/DebuggerCallFrame.h:
  6195. (JSC::DebuggerCallFrame::callFrame):
  6196. * dfg/DFGAbstractState.cpp:
  6197. (JSC::DFG::AbstractState::execute):
  6198. * dfg/DFGCFGSimplificationPhase.cpp:
  6199. (JSC::DFG::CFGSimplificationPhase::run):
  6200. * dfg/DFGOperations.cpp:
  6201. * dfg/DFGOperations.h:
  6202. * dfg/DFGSpeculativeJIT32_64.cpp:
  6203. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6204. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6205. (JSC::DFG::SpeculativeJIT::compile):
  6206. * dfg/DFGSpeculativeJIT64.cpp:
  6207. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6208. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6209. (JSC::DFG::SpeculativeJIT::compile):
  6210. * interpreter/Interpreter.cpp:
  6211. (JSC::Interpreter::privateExecute):
  6212. * jit/JITOpcodes.cpp:
  6213. (JSC::JIT::emit_op_is_undefined):
  6214. (JSC::JIT::emit_op_jeq_null):
  6215. (JSC::JIT::emit_op_jneq_null):
  6216. (JSC::JIT::emit_op_eq_null):
  6217. (JSC::JIT::emit_op_neq_null):
  6218. * jit/JITOpcodes32_64.cpp:
  6219. (JSC::JIT::emit_op_is_undefined):
  6220. (JSC::JIT::emit_op_jeq_null):
  6221. (JSC::JIT::emit_op_jneq_null):
  6222. (JSC::JIT::emit_op_eq_null):
  6223. (JSC::JIT::emit_op_neq_null):
  6224. * jit/JITStubs.cpp:
  6225. (JSC::DEFINE_STUB_FUNCTION):
  6226. * llint/LLIntSlowPaths.cpp:
  6227. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  6228. * llint/LowLevelInterpreter32_64.asm:
  6229. * llint/LowLevelInterpreter64.asm:
  6230. * runtime/ArrayPrototype.cpp:
  6231. (JSC::arrayProtoFuncFilter):
  6232. (JSC::arrayProtoFuncEvery):
  6233. (JSC::arrayProtoFuncSome):
  6234. * runtime/BooleanConstructor.cpp:
  6235. (JSC::constructBoolean):
  6236. (JSC::callBooleanConstructor):
  6237. * runtime/JSCell.h:
  6238. (JSCell):
  6239. * runtime/JSGlobalObject.cpp:
  6240. (JSC::JSGlobalObject::JSGlobalObject):
  6241. * runtime/JSGlobalObject.h:
  6242. (JSGlobalObject):
  6243. (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
  6244. * runtime/JSString.h:
  6245. (JSC::JSCell::toBoolean):
  6246. (JSC::JSValue::toBoolean):
  6247. * runtime/JSValue.h:
  6248. * runtime/ObjectConstructor.cpp:
  6249. (JSC::toPropertyDescriptor):
  6250. * runtime/Operations.cpp:
  6251. (JSC::jsTypeStringForValue):
  6252. (JSC::jsIsObjectType):
  6253. * runtime/Operations.h:
  6254. (JSC):
  6255. (JSC::JSValue::equalSlowCaseInline):
  6256. * runtime/RegExpConstructor.cpp:
  6257. (JSC::setRegExpConstructorMultiline):
  6258. * runtime/RegExpPrototype.cpp:
  6259. (JSC::regExpProtoFuncToString):
  6260. * runtime/Structure.h:
  6261. (Structure):
  6262. (JSC::Structure::globalObjectOffset):
  6263. (JSC::Structure::masqueradesAsUndefined):
  6264. (JSC):
  6265. 2012-08-23 Mark Rowe <mrowe@apple.com>
  6266. Make JavaScriptCore build with the latest version of clang.
  6267. Reviewed by Dan Bernstein.
  6268. * heap/MachineStackMarker.cpp:
  6269. (JSC::MachineThreads::MachineThreads): The m_heap member is only used within
  6270. assertions, so guard its initialization with !ASSERT_DISABLED.
  6271. * heap/MachineStackMarker.h:
  6272. (MachineThreads): Ditto for its declaration.
  6273. * jit/JITStubCall.h:
  6274. (JSC::JITStubCall::JITStubCall): The m_returnType member is only used within
  6275. assertions or if we're using JSVALUE32_64, so guard its uses with the appropriate
  6276. #if.
  6277. (JITStubCall): Ditto.
  6278. 2012-08-23 Christophe Dumez <christophe.dumez@intel.com>
  6279. Serialization of JavaScript values does not appear to respect new HTML5 Structured Clone semantics
  6280. https://bugs.webkit.org/show_bug.cgi?id=65292
  6281. Reviewed by Oliver Hunt.
  6282. Add function to construct a StringObject from a JSValue.
  6283. Similar functions already exist for NumberObject and
  6284. BooleanObject for example.
  6285. Export several symbols so address linking errors in
  6286. WebCore.
  6287. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6288. * runtime/BooleanObject.h:
  6289. (BooleanObject):
  6290. * runtime/NumberObject.h:
  6291. (NumberObject):
  6292. (JSC):
  6293. * runtime/StringObject.cpp:
  6294. (JSC::constructString):
  6295. (JSC):
  6296. * runtime/StringObject.h:
  6297. (JSC):
  6298. 2012-08-22 Filip Pizlo <fpizlo@apple.com>
  6299. Array accesses should remember what kind of array they are predicted to access
  6300. https://bugs.webkit.org/show_bug.cgi?id=94448
  6301. Reviewed by Gavin Barraclough.
  6302. Introduced the notion of DFG::Array::Mode, stored in node.arrayMode(), which allows nodes
  6303. to remember how they decided to access arrays. This permits the bytecode parser to "lock in"
  6304. the mode of access if it has profiling at its disposal, and it also allows the prediction
  6305. propagator to do a fixup of the array mode later in the optimization fixpoint.
  6306. This patch adds a healthy amount of new capability (specifically the ability of the parser
  6307. to lock in an array mode regardless of type predictions) and it also blows away a lot of
  6308. messy code.
  6309. * CMakeLists.txt:
  6310. * GNUmakefile.list.am:
  6311. * JavaScriptCore.xcodeproj/project.pbxproj:
  6312. * Target.pri:
  6313. * dfg/DFGAbstractState.cpp:
  6314. (JSC::DFG::AbstractState::execute):
  6315. * dfg/DFGArgumentsSimplificationPhase.cpp:
  6316. (JSC::DFG::ArgumentsSimplificationPhase::run):
  6317. * dfg/DFGArrayMode.cpp: Added.
  6318. (DFG):
  6319. (JSC::DFG::fromObserved):
  6320. (JSC::DFG::refineArrayMode):
  6321. (JSC::DFG::modeAlreadyChecked):
  6322. (JSC::DFG::modeToString):
  6323. * dfg/DFGArrayMode.h: Added.
  6324. (DFG):
  6325. (JSC::DFG::canCSEStorage):
  6326. (JSC::DFG::modeForPut):
  6327. (JSC::DFG::modesCompatibleForStorageLoad):
  6328. (JSC::DFG::modeSupportsLength):
  6329. * dfg/DFGByteCodeParser.cpp:
  6330. (ByteCodeParser):
  6331. (JSC::DFG::ByteCodeParser::getArrayModeWithoutOSRExit):
  6332. (JSC::DFG::ByteCodeParser::getArrayMode):
  6333. (JSC::DFG::ByteCodeParser::handleIntrinsic):
  6334. (JSC::DFG::ByteCodeParser::parseBlock):
  6335. * dfg/DFGCSEPhase.cpp:
  6336. (JSC::DFG::CSEPhase::getByValLoadElimination):
  6337. (JSC::DFG::CSEPhase::checkStructureLoadElimination):
  6338. (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
  6339. (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
  6340. (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
  6341. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  6342. (JSC::DFG::CSEPhase::performNodeCSE):
  6343. * dfg/DFGFixupPhase.cpp:
  6344. (JSC::DFG::FixupPhase::fixupNode):
  6345. * dfg/DFGGraph.cpp:
  6346. (JSC::DFG::Graph::dump):
  6347. * dfg/DFGGraph.h:
  6348. (JSC::DFG::Graph::byValIsPure):
  6349. (JSC::DFG::Graph::clobbersWorld):
  6350. * dfg/DFGNode.h:
  6351. (JSC::DFG::Node::hasArrayMode):
  6352. (Node):
  6353. (JSC::DFG::Node::arrayMode):
  6354. (JSC::DFG::Node::setArrayMode):
  6355. * dfg/DFGNodeType.h:
  6356. (DFG):
  6357. * dfg/DFGPredictionPropagationPhase.cpp:
  6358. (JSC::DFG::PredictionPropagationPhase::propagate):
  6359. * dfg/DFGSpeculativeJIT.cpp:
  6360. (JSC::DFG::SpeculativeJIT::typedArrayDescriptor):
  6361. (DFG):
  6362. (JSC::DFG::SpeculativeJIT::speculateArray):
  6363. (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
  6364. (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
  6365. (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
  6366. (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
  6367. (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
  6368. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  6369. (JSC::DFG::SpeculativeJIT::compileGetArrayLength):
  6370. * dfg/DFGSpeculativeJIT.h:
  6371. (SpeculativeJIT):
  6372. * dfg/DFGSpeculativeJIT32_64.cpp:
  6373. (JSC::DFG::SpeculativeJIT::compile):
  6374. * dfg/DFGSpeculativeJIT64.cpp:
  6375. (JSC::DFG::SpeculativeJIT::compile):
  6376. * dfg/DFGStructureCheckHoistingPhase.cpp:
  6377. (JSC::DFG::StructureCheckHoistingPhase::run):
  6378. 2012-08-22 Geoffrey Garen <ggaren@apple.com>
  6379. ThreadRestrictionVerifier should be opt-in, not opt-out
  6380. https://bugs.webkit.org/show_bug.cgi?id=94761
  6381. Reviewed by Mark Hahnenberg.
  6382. Removed explicit calls to disable the verifier, since it's off by default now.
  6383. * parser/SourceProvider.h:
  6384. (JSC::SourceProvider::SourceProvider):
  6385. (SourceProvider):
  6386. * runtime/SymbolTable.h:
  6387. (JSC::SharedSymbolTable::SharedSymbolTable):
  6388. 2012-08-22 Mark Hahnenberg <mhahnenberg@apple.com>
  6389. Separate MarkStackThreadSharedData from MarkStack
  6390. https://bugs.webkit.org/show_bug.cgi?id=94294
  6391. Reviewed by Filip Pizlo.
  6392. MarkStackThreadSharedData is soon going to have data to allow for a parallel copying
  6393. mode too, so to separate our concerns we should split it out into its own set of files
  6394. and rename it to GCThreadSharedData. For now this is purely a cosmetic refactoring.
  6395. * CMakeLists.txt:
  6396. * GNUmakefile.list.am:
  6397. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6398. * JavaScriptCore.xcodeproj/project.pbxproj:
  6399. * Target.pri:
  6400. * heap/GCThreadSharedData.cpp: Added.
  6401. (JSC):
  6402. (JSC::GCThreadSharedData::resetChildren):
  6403. (JSC::GCThreadSharedData::childVisitCount):
  6404. (JSC::GCThreadSharedData::markingThreadMain):
  6405. (JSC::GCThreadSharedData::markingThreadStartFunc):
  6406. (JSC::GCThreadSharedData::GCThreadSharedData):
  6407. (JSC::GCThreadSharedData::~GCThreadSharedData):
  6408. (JSC::GCThreadSharedData::reset):
  6409. * heap/GCThreadSharedData.h: Added.
  6410. (JSC):
  6411. (GCThreadSharedData):
  6412. * heap/Heap.h:
  6413. (Heap):
  6414. * heap/ListableHandler.h:
  6415. (ListableHandler):
  6416. * heap/MarkStack.cpp:
  6417. (JSC::MarkStack::MarkStack):
  6418. (JSC::MarkStack::~MarkStack):
  6419. * heap/MarkStack.h:
  6420. (JSC):
  6421. (MarkStack):
  6422. (JSC::MarkStack::sharedData):
  6423. * heap/MarkStackInlineMethods.h: Added.
  6424. (JSC):
  6425. (JSC::MarkStack::append):
  6426. (JSC::MarkStack::appendUnbarrieredPointer):
  6427. (JSC::MarkStack::appendUnbarrieredValue):
  6428. (JSC::MarkStack::internalAppend):
  6429. (JSC::MarkStack::addWeakReferenceHarvester):
  6430. (JSC::MarkStack::addUnconditionalFinalizer):
  6431. (JSC::MarkStack::addOpaqueRoot):
  6432. (JSC::MarkStack::containsOpaqueRoot):
  6433. (JSC::MarkStack::opaqueRootCount):
  6434. * heap/SlotVisitor.h:
  6435. (JSC):
  6436. (SlotVisitor):
  6437. (JSC::SlotVisitor::SlotVisitor):
  6438. 2012-08-22 Gabor Ballabas <gaborb@inf.u-szeged.hu>
  6439. Fix JSC build when DFG-JIT is disabled
  6440. https://bugs.webkit.org/show_bug.cgi?id=94694
  6441. Reviewed by Csaba Osztrogonác.
  6442. Adding an appropriate guard for fixing the build.
  6443. * bytecode/ResolveGlobalStatus.cpp:
  6444. (JSC):
  6445. 2012-08-21 Mark Lam <mark.lam@apple.com>
  6446. Introducing the VMInspector for VM debugging use.
  6447. https://bugs.webkit.org/show_bug.cgi?id=94613.
  6448. Reviewed by Filip Pizlo.
  6449. Adding some utility functions for debugging the VM. This code is
  6450. presently #ifdef'd out by default.
  6451. * CMakeLists.txt:
  6452. * GNUmakefile.list.am:
  6453. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6454. * JavaScriptCore.xcodeproj/project.pbxproj:
  6455. * interpreter/CallFrame.h:
  6456. (ExecState):
  6457. * interpreter/VMInspector.cpp: Added.
  6458. (JSC):
  6459. (JSC::VMInspector::getTypeName):
  6460. (JSC::VMInspector::dumpFrame0):
  6461. (JSC::VMInspector::dumpFrame):
  6462. (JSC::VMInspector::countFrames):
  6463. * interpreter/VMInspector.h: Added.
  6464. (JSC):
  6465. (VMInspector):
  6466. 2012-08-21 Filip Pizlo <fpizlo@apple.com>
  6467. A patchable GetById right after a watchpoint should have the appropriate nop padding
  6468. https://bugs.webkit.org/show_bug.cgi?id=94635
  6469. Reviewed by Mark Hahnenberg.
  6470. * assembler/AbstractMacroAssembler.h:
  6471. (JSC::AbstractMacroAssembler::padBeforePatch):
  6472. (AbstractMacroAssembler):
  6473. * assembler/MacroAssemblerARMv7.h:
  6474. (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
  6475. (JSC::MacroAssemblerARMv7::moveWithPatch):
  6476. (JSC::MacroAssemblerARMv7::patchableJump):
  6477. * assembler/MacroAssemblerX86.h:
  6478. (JSC::MacroAssemblerX86::moveWithPatch):
  6479. (JSC::MacroAssemblerX86::branchPtrWithPatch):
  6480. (JSC::MacroAssemblerX86::storePtrWithPatch):
  6481. * assembler/MacroAssemblerX86Common.h:
  6482. (JSC::MacroAssemblerX86Common::load32WithAddressOffsetPatch):
  6483. (JSC::MacroAssemblerX86Common::load32WithCompactAddressOffsetPatch):
  6484. (JSC::MacroAssemblerX86Common::loadCompactWithAddressOffsetPatch):
  6485. (JSC::MacroAssemblerX86Common::store32WithAddressOffsetPatch):
  6486. * assembler/MacroAssemblerX86_64.h:
  6487. (JSC::MacroAssemblerX86_64::loadPtrWithAddressOffsetPatch):
  6488. (JSC::MacroAssemblerX86_64::loadPtrWithCompactAddressOffsetPatch):
  6489. (JSC::MacroAssemblerX86_64::storePtrWithAddressOffsetPatch):
  6490. (JSC::MacroAssemblerX86_64::moveWithPatch):
  6491. * jit/JumpReplacementWatchpoint.cpp:
  6492. (JSC::JumpReplacementWatchpoint::fireInternal):
  6493. 2012-08-20 Mark Lam <mark.lam@apple.com>
  6494. Fix broken non-JIT build.
  6495. https://bugs.webkit.org/show_bug.cgi?id=94564.
  6496. Reviewed by Filip Pizlo.
  6497. Added some UNUSED_PARAM() macros to make the compiler happy.
  6498. * runtime/Executable.cpp:
  6499. (JSC::EvalExecutable::compileInternal):
  6500. (JSC::ProgramExecutable::compileInternal):
  6501. (JSC::FunctionExecutable::compileForCallInternal):
  6502. (JSC::FunctionExecutable::compileForConstructInternal):
  6503. 2012-08-20 Mark Lam <mark.lam@apple.com>
  6504. Fixed erroneous line number for LLint frame when throwing exceptions.
  6505. https://bugs.webkit.org/show_bug.cgi?id=94051.
  6506. Reviewed by Filip Pizlo.
  6507. For LLInt frames, before throwing an exception, adjust the PC from the
  6508. return PC back to the call PC if we are indeed at a call site.
  6509. * bytecode/CodeBlock.cpp:
  6510. (JSC::CodeBlock::adjustPCIfAtCallSite):
  6511. (JSC):
  6512. (JSC::CodeBlock::bytecodeOffset):
  6513. * bytecode/CodeBlock.h:
  6514. (CodeBlock):
  6515. * llint/LLIntExceptions.cpp:
  6516. (JSC::LLInt::fixupPCforExceptionIfNeeded):
  6517. (LLInt):
  6518. (JSC::LLInt::interpreterThrowInCaller):
  6519. (JSC::LLInt::returnToThrow):
  6520. (JSC::LLInt::callToThrow):
  6521. 2012-08-20 Filip Pizlo <fpizlo@apple.com>
  6522. fast/js/dfg-peephole-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html on 32-bit
  6523. https://bugs.webkit.org/show_bug.cgi?id=94538
  6524. Reviewed by Mark Hahnenberg.
  6525. * dfg/DFGSpeculativeJIT32_64.cpp:
  6526. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  6527. 2012-08-20 Filip Pizlo <fpizlo@apple.com>
  6528. fast/js/dfg-compare-final-object-to-final-object-or-other-when-both-proven-final-object.html crashes on 32-bit
  6529. https://bugs.webkit.org/show_bug.cgi?id=94026
  6530. Reviewed by Mark Hahnenberg.
  6531. * dfg/DFGSpeculativeJIT32_64.cpp:
  6532. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  6533. 2012-08-19 Filip Pizlo <fpizlo@apple.com>
  6534. The relationship between abstract values and structure transition watchpoints should be rationalized
  6535. https://bugs.webkit.org/show_bug.cgi?id=94205
  6536. Reviewed by Geoffrey Garen.
  6537. This patch does a number of things related to the handling of the abstract values
  6538. arrising from values with structures known to be watchpointable:
  6539. - This rationalizes the relationship between the structure that we know an object
  6540. to have *right now* based on having executed a check against that structure, and
  6541. the structure that we know the object could have *in the future* based on a type
  6542. check executed in the past over a structure that was watchpointable.
  6543. - We use the above to assert that structure transition watchpoints are being used
  6544. soundly.
  6545. - We use the above to strength reduce CheckStructure into StructureTransitionWatchpoint
  6546. whenever possible.
  6547. - This rationalizes the handling of CFA over constants that appeared in the bytecode.
  6548. If at compile-time the constant has a watchpointable structure, then we can prove
  6549. what structures it may have in the future. The analysis uses this to both assert
  6550. that structure transition watchpoints are being used correctly, and to find
  6551. opportunities for using them more aggressively.
  6552. The net effect of all of these changes is that OSR entry should work more smoothly.
  6553. It may also be a slight win due to strength reductions, though most of those strength
  6554. reductions would have already been done by the parser and the structure check hoister.
  6555. * GNUmakefile.list.am:
  6556. * JavaScriptCore.xcodeproj/project.pbxproj:
  6557. * dfg/DFGAbstractState.cpp:
  6558. (JSC::DFG::AbstractState::beginBasicBlock):
  6559. (JSC::DFG::AbstractState::execute):
  6560. * dfg/DFGAbstractValue.h:
  6561. (DFG):
  6562. (JSC::DFG::AbstractValue::clear):
  6563. (JSC::DFG::AbstractValue::isClear):
  6564. (JSC::DFG::AbstractValue::makeTop):
  6565. (JSC::DFG::AbstractValue::clobberStructures):
  6566. (JSC::DFG::AbstractValue::isTop):
  6567. (JSC::DFG::AbstractValue::setFuturePossibleStructure):
  6568. (AbstractValue):
  6569. (JSC::DFG::AbstractValue::filterFuturePossibleStructure):
  6570. (JSC::DFG::AbstractValue::setMostSpecific):
  6571. (JSC::DFG::AbstractValue::set):
  6572. (JSC::DFG::AbstractValue::operator==):
  6573. (JSC::DFG::AbstractValue::merge):
  6574. (JSC::DFG::AbstractValue::filter):
  6575. (JSC::DFG::AbstractValue::filterValueByType):
  6576. (JSC::DFG::AbstractValue::validateType):
  6577. (JSC::DFG::AbstractValue::validate):
  6578. (JSC::DFG::AbstractValue::checkConsistency):
  6579. (JSC::DFG::AbstractValue::dump):
  6580. * dfg/DFGArgumentsSimplificationPhase.cpp:
  6581. (JSC::DFG::ArgumentsSimplificationPhase::run):
  6582. * dfg/DFGCSEPhase.cpp:
  6583. (JSC::DFG::CSEPhase::checkStructureLoadElimination):
  6584. (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
  6585. (JSC::DFG::CSEPhase::performNodeCSE):
  6586. * dfg/DFGConstantFoldingPhase.cpp:
  6587. (JSC::DFG::ConstantFoldingPhase::foldConstants):
  6588. * dfg/DFGNode.h:
  6589. (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
  6590. (Node):
  6591. (JSC::DFG::Node::hasStructure):
  6592. * dfg/DFGNodeType.h:
  6593. (DFG):
  6594. * dfg/DFGOSREntry.cpp:
  6595. (JSC::DFG::prepareOSREntry):
  6596. * dfg/DFGPredictionPropagationPhase.cpp:
  6597. (JSC::DFG::PredictionPropagationPhase::propagate):
  6598. * dfg/DFGSpeculativeJIT.cpp:
  6599. (JSC::DFG::SpeculativeJIT::convertLastOSRExitToForward):
  6600. (JSC::DFG::SpeculativeJIT::forwardSpeculationWatchpoint):
  6601. (DFG):
  6602. (JSC::DFG::SpeculativeJIT::speculationWatchpointWithConditionalDirection):
  6603. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  6604. (JSC::DFG::SpeculativeJIT::speculateArray):
  6605. * dfg/DFGSpeculativeJIT.h:
  6606. (SpeculativeJIT):
  6607. * dfg/DFGSpeculativeJIT32_64.cpp:
  6608. (JSC::DFG::SpeculativeJIT::compile):
  6609. * dfg/DFGSpeculativeJIT64.cpp:
  6610. (JSC::DFG::SpeculativeJIT::compile):
  6611. * dfg/DFGStructureAbstractValue.h: Added.
  6612. (DFG):
  6613. (StructureAbstractValue):
  6614. (JSC::DFG::StructureAbstractValue::StructureAbstractValue):
  6615. (JSC::DFG::StructureAbstractValue::clear):
  6616. (JSC::DFG::StructureAbstractValue::makeTop):
  6617. (JSC::DFG::StructureAbstractValue::top):
  6618. (JSC::DFG::StructureAbstractValue::add):
  6619. (JSC::DFG::StructureAbstractValue::addAll):
  6620. (JSC::DFG::StructureAbstractValue::contains):
  6621. (JSC::DFG::StructureAbstractValue::isSubsetOf):
  6622. (JSC::DFG::StructureAbstractValue::doesNotContainAnyOtherThan):
  6623. (JSC::DFG::StructureAbstractValue::isSupersetOf):
  6624. (JSC::DFG::StructureAbstractValue::filter):
  6625. (JSC::DFG::StructureAbstractValue::isClear):
  6626. (JSC::DFG::StructureAbstractValue::isTop):
  6627. (JSC::DFG::StructureAbstractValue::isClearOrTop):
  6628. (JSC::DFG::StructureAbstractValue::isNeitherClearNorTop):
  6629. (JSC::DFG::StructureAbstractValue::size):
  6630. (JSC::DFG::StructureAbstractValue::at):
  6631. (JSC::DFG::StructureAbstractValue::operator[]):
  6632. (JSC::DFG::StructureAbstractValue::last):
  6633. (JSC::DFG::StructureAbstractValue::speculationFromStructures):
  6634. (JSC::DFG::StructureAbstractValue::hasSingleton):
  6635. (JSC::DFG::StructureAbstractValue::singleton):
  6636. (JSC::DFG::StructureAbstractValue::operator==):
  6637. (JSC::DFG::StructureAbstractValue::dump):
  6638. (JSC::DFG::StructureAbstractValue::topValue):
  6639. * dfg/DFGStructureCheckHoistingPhase.cpp:
  6640. (JSC::DFG::StructureCheckHoistingPhase::run):
  6641. 2012-08-17 Filip Pizlo <fpizlo@apple.com>
  6642. The current state of the call frame should be taken into account in the DFG for both predictions and proofs
  6643. https://bugs.webkit.org/show_bug.cgi?id=94412
  6644. Reviewed by Geoffrey Garen.
  6645. This ensures that no matter how smart the DFG gets, it'll always know through
  6646. which entrypoint OSR will try to enter, and with which values it will attempt
  6647. to do so. For prologue OSR, this has no effect other than adding the current
  6648. arguments to the argument predictions. For loop OSR, this makes our treatment
  6649. of the loop slightly more conservative - just conservative enough to ensure
  6650. that OSR succeeds.
  6651. * bytecode/CodeBlock.cpp:
  6652. (JSC::ProgramCodeBlock::compileOptimized):
  6653. (JSC::EvalCodeBlock::compileOptimized):
  6654. (JSC::FunctionCodeBlock::compileOptimized):
  6655. * bytecode/CodeBlock.h:
  6656. (CodeBlock):
  6657. (ProgramCodeBlock):
  6658. (EvalCodeBlock):
  6659. (FunctionCodeBlock):
  6660. * dfg/DFGAbstractState.cpp:
  6661. (JSC::DFG::AbstractState::initialize):
  6662. * dfg/DFGAbstractValue.h:
  6663. (JSC::DFG::AbstractValue::setMostSpecific):
  6664. (AbstractValue):
  6665. * dfg/DFGByteCodeParser.cpp:
  6666. (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
  6667. (JSC::DFG::ByteCodeParser::parse):
  6668. * dfg/DFGDriver.cpp:
  6669. (JSC::DFG::compile):
  6670. (JSC::DFG::tryCompile):
  6671. (JSC::DFG::tryCompileFunction):
  6672. * dfg/DFGDriver.h:
  6673. (DFG):
  6674. (JSC::DFG::tryCompile):
  6675. (JSC::DFG::tryCompileFunction):
  6676. * dfg/DFGGraph.h:
  6677. (JSC::DFG::Graph::Graph):
  6678. (Graph):
  6679. * jit/JITDriver.h:
  6680. (JSC::jitCompileIfAppropriate):
  6681. (JSC::jitCompileFunctionIfAppropriate):
  6682. * jit/JITStubs.cpp:
  6683. (JSC::DEFINE_STUB_FUNCTION):
  6684. * runtime/Executable.cpp:
  6685. (JSC::EvalExecutable::compileOptimized):
  6686. (JSC::EvalExecutable::compileInternal):
  6687. (JSC::ProgramExecutable::compileOptimized):
  6688. (JSC::ProgramExecutable::compileInternal):
  6689. (JSC::FunctionExecutable::compileOptimizedForCall):
  6690. (JSC::FunctionExecutable::compileOptimizedForConstruct):
  6691. (JSC::FunctionExecutable::compileForCallInternal):
  6692. (JSC::FunctionExecutable::compileForConstructInternal):
  6693. * runtime/Executable.h:
  6694. (EvalExecutable):
  6695. (ProgramExecutable):
  6696. (FunctionExecutable):
  6697. (JSC::FunctionExecutable::compileOptimizedFor):
  6698. * runtime/ExecutionHarness.h:
  6699. (JSC::prepareForExecution):
  6700. (JSC::prepareFunctionForExecution):
  6701. 2012-08-17 Filip Pizlo <fpizlo@apple.com>
  6702. DFG CSE should be more honest about when it changed the IR
  6703. https://bugs.webkit.org/show_bug.cgi?id=94408
  6704. Reviewed by Geoffrey Garen.
  6705. The CSE phase now always returns true if it changed the IR.
  6706. * dfg/DFGCSEPhase.cpp:
  6707. (JSC::DFG::CSEPhase::setReplacement):
  6708. (JSC::DFG::CSEPhase::eliminate):
  6709. (JSC::DFG::CSEPhase::performNodeCSE):
  6710. 2012-08-17 Filip Pizlo <fpizlo@apple.com>
  6711. DFG is still too pessimistic about what constitutes a side-effect on array accesses
  6712. https://bugs.webkit.org/show_bug.cgi?id=94309
  6713. Reviewed by Geoffrey Garen.
  6714. This change means that even if structure transition watchpoints are not used for
  6715. hoisting of clobbered structure checks, we still retain good performance on the
  6716. benchmarks we care about. That's important, since butterflies will likely make
  6717. most array structures not watchpointable.
  6718. * dfg/DFGAbstractState.cpp:
  6719. (JSC::DFG::AbstractState::execute):
  6720. * dfg/DFGStructureCheckHoistingPhase.cpp:
  6721. (JSC::DFG::StructureCheckHoistingPhase::run):
  6722. 2012-08-17 Milian Wolff <milian.wolff@kdab.com>
  6723. [Qt] QNX build fails due to ctype usage in system headers
  6724. https://bugs.webkit.org/show_bug.cgi?id=93849
  6725. Reviewed by Simon Hausmann.
  6726. Move the check for whether DisallowCType should be active or not
  6727. to the DisallowCType.h header. This way, we can update the list
  6728. of platforms or OSes which do not work with this header in a
  6729. central place. All users can now safely include the header
  6730. and do not need to place custom guards around it.
  6731. * config.h:
  6732. 2012-08-16 Simon Hausmann <simon.hausmann@nokia.com>
  6733. [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
  6734. https://bugs.webkit.org/show_bug.cgi?id=93872
  6735. Reviewed by Kenneth Rohde Christiansen.
  6736. * Target.pri: Add missing JSWeakObjectMap file to build.
  6737. 2012-08-16 Filip Pizlo <fpizlo@apple.com>
  6738. Structure check hoisting should be less expensive
  6739. https://bugs.webkit.org/show_bug.cgi?id=94201
  6740. Reviewed by Mark Hahnenberg.
  6741. This appears like a broad win on short-running programs.
  6742. * dfg/DFGArgumentsSimplificationPhase.cpp:
  6743. (JSC::DFG::ArgumentsSimplificationPhase::run):
  6744. * dfg/DFGCSEPhase.cpp:
  6745. (JSC::DFG::CSEPhase::performNodeCSE):
  6746. * dfg/DFGDriver.cpp:
  6747. (JSC::DFG::compile):
  6748. * dfg/DFGGraph.h:
  6749. (JSC::DFG::Graph::compareAndSwap):
  6750. (Graph):
  6751. (JSC::DFG::Graph::substitute):
  6752. (JSC::DFG::Graph::substituteGetLocal):
  6753. * dfg/DFGStructureCheckHoistingPhase.cpp:
  6754. (JSC::DFG::StructureCheckHoistingPhase::run):
  6755. 2012-08-16 Filip Pizlo <fpizlo@apple.com>
  6756. All op_resolve_global instructions should end up in the list of global resolve instructions
  6757. https://bugs.webkit.org/show_bug.cgi?id=94247
  6758. <rdar://problem/12103500>
  6759. Reviewed by Mark Hahnenberg.
  6760. * bytecompiler/BytecodeGenerator.cpp:
  6761. (JSC::BytecodeGenerator::emitResolveWithBase):
  6762. 2012-08-15 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
  6763. [css3-text] Add CSS3 Text decoration compile flag
  6764. https://bugs.webkit.org/show_bug.cgi?id=93863
  6765. Reviewed by Julien Chaffraix.
  6766. This patch handles the compile flag implementation, which will come disabled by
  6767. default, thus not exposing the CSS3 text decoration features to the web, unless
  6768. when explicitly enabling it with "--css3-text-decoration" build parameter.
  6769. * Configurations/FeatureDefines.xcconfig:
  6770. 2012-08-15 Sheriff Bot <webkit.review.bot@gmail.com>
  6771. Unreviewed, rolling out r125687.
  6772. http://trac.webkit.org/changeset/125687
  6773. https://bugs.webkit.org/show_bug.cgi?id=94147
  6774. It broke the whole world (Requested by Ossy_night on #webkit).
  6775. * API/JSValueRef.cpp:
  6776. (JSValueToBoolean):
  6777. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6778. * bytecode/Watchpoint.h:
  6779. (WatchpointSet):
  6780. * debugger/DebuggerCallFrame.h:
  6781. * dfg/DFGAbstractState.cpp:
  6782. (JSC::DFG::AbstractState::execute):
  6783. * dfg/DFGCFGSimplificationPhase.cpp:
  6784. (JSC::DFG::CFGSimplificationPhase::run):
  6785. * dfg/DFGOperations.cpp:
  6786. * dfg/DFGOperations.h:
  6787. * dfg/DFGSpeculativeJIT32_64.cpp:
  6788. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6789. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6790. (JSC::DFG::SpeculativeJIT::compile):
  6791. * dfg/DFGSpeculativeJIT64.cpp:
  6792. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6793. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6794. (JSC::DFG::SpeculativeJIT::compile):
  6795. * interpreter/Interpreter.cpp:
  6796. (JSC::Interpreter::privateExecute):
  6797. * jit/JITOpcodes.cpp:
  6798. (JSC::JIT::emit_op_is_undefined):
  6799. (JSC::JIT::emit_op_jeq_null):
  6800. (JSC::JIT::emit_op_jneq_null):
  6801. (JSC::JIT::emit_op_eq_null):
  6802. (JSC::JIT::emit_op_neq_null):
  6803. * jit/JITOpcodes32_64.cpp:
  6804. (JSC::JIT::emit_op_is_undefined):
  6805. (JSC::JIT::emit_op_jeq_null):
  6806. (JSC::JIT::emit_op_jneq_null):
  6807. (JSC::JIT::emit_op_eq_null):
  6808. (JSC::JIT::emit_op_neq_null):
  6809. * jit/JITStubs.cpp:
  6810. (JSC::DEFINE_STUB_FUNCTION):
  6811. * llint/LLIntSlowPaths.cpp:
  6812. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  6813. * llint/LowLevelInterpreter32_64.asm:
  6814. * llint/LowLevelInterpreter64.asm:
  6815. * runtime/ArrayPrototype.cpp:
  6816. (JSC::arrayProtoFuncFilter):
  6817. (JSC::arrayProtoFuncEvery):
  6818. (JSC::arrayProtoFuncSome):
  6819. * runtime/BooleanConstructor.cpp:
  6820. (JSC::constructBoolean):
  6821. (JSC::callBooleanConstructor):
  6822. * runtime/JSCell.h:
  6823. (JSCell):
  6824. * runtime/JSGlobalObject.cpp:
  6825. (JSC::JSGlobalObject::JSGlobalObject):
  6826. * runtime/JSGlobalObject.h:
  6827. (JSGlobalObject):
  6828. * runtime/JSString.h:
  6829. (JSC::JSCell::toBoolean):
  6830. (JSC::JSValue::toBoolean):
  6831. * runtime/JSValue.h:
  6832. * runtime/ObjectConstructor.cpp:
  6833. (JSC::toPropertyDescriptor):
  6834. * runtime/Operations.cpp:
  6835. (JSC::jsTypeStringForValue):
  6836. (JSC::jsIsObjectType):
  6837. * runtime/Operations.h:
  6838. (JSC):
  6839. (JSC::JSValue::equalSlowCaseInline):
  6840. * runtime/RegExpConstructor.cpp:
  6841. (JSC::setRegExpConstructorMultiline):
  6842. * runtime/RegExpPrototype.cpp:
  6843. (JSC::regExpProtoFuncToString):
  6844. * runtime/Structure.h:
  6845. 2012-08-15 Gabor Ballabas <gaborb@inf.u-szeged.hu>
  6846. Buildfix after r125541
  6847. https://bugs.webkit.org/show_bug.cgi?id=94097
  6848. Reviewed by Filip Pizlo.
  6849. r125541 has broken the traditional ARM port build of JSC.
  6850. * assembler/MacroAssemblerARM.h:
  6851. (JSC::MacroAssemblerARM::neg32):
  6852. (JSC::MacroAssemblerARM::xor32):
  6853. 2012-08-14 Mark Hahnenberg <mhahnenberg@apple.com>
  6854. Change behavior of MasqueradesAsUndefined to better accommodate DFG changes
  6855. https://bugs.webkit.org/show_bug.cgi?id=93884
  6856. Reviewed by Geoffrey Garen.
  6857. With some upcoming changes to the DFG to remove uses of ClassInfo, we will be changing the behavior of
  6858. MasqueradesAsUndefined. In order to make this change consistent across all of our execution engines,
  6859. we will make this change to MasqueradesAsUndefined as a separate patch. After this patch, MasqueradesAsUndefined
  6860. objects will only masquerade as undefined in their original context (i.e. their original JSGlobalObject).
  6861. For example, if an object that masquerades as undefined in frame A is passed to frame B, it will not
  6862. masquerade as undefined within frame B, but it will continue to masquerade in frame A.
  6863. There are two primary changes that are taking place here. One is to thread the ExecState* through
  6864. JSValue::toBoolean and JSCell::toBoolean so that JSCell::toBoolean can check the object's
  6865. JSGlobalObject to compare it to the lexical JSGlobalObject of the currently running code. If the two
  6866. are distinct, then the object cannot MasqueradeAsUndefined.
  6867. The other change is to perform this comparison of JSGlobalObjects everywhere where the MasqueradesAsUndefined
  6868. flag in the Structure is checked. For C++ code, this check has been factored into its own function in
  6869. Structure::masqueradesAsUndefined. We only perform this check in the DFG if the current JSGlobalObject has
  6870. had a MasqueradesAsUndefined object allocated within its context. This conditional compilation is managed
  6871. through the use of a WatchpointSet in each JSGlobalObject and alternate create() functions for JS DOM wrappers
  6872. that are MasqueradesAsUndefined.
  6873. * API/JSValueRef.cpp:
  6874. (JSValueToBoolean):
  6875. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  6876. * bytecode/Watchpoint.h:
  6877. (WatchpointSet):
  6878. * debugger/DebuggerCallFrame.h:
  6879. (JSC::DebuggerCallFrame::callFrame):
  6880. * dfg/DFGAbstractState.cpp:
  6881. (JSC::DFG::AbstractState::execute):
  6882. * dfg/DFGCFGSimplificationPhase.cpp:
  6883. (JSC::DFG::CFGSimplificationPhase::run):
  6884. * dfg/DFGOperations.cpp:
  6885. * dfg/DFGOperations.h:
  6886. * dfg/DFGSpeculativeJIT32_64.cpp:
  6887. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6888. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6889. (JSC::DFG::SpeculativeJIT::compile):
  6890. * dfg/DFGSpeculativeJIT64.cpp:
  6891. (JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompareNull):
  6892. (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
  6893. (JSC::DFG::SpeculativeJIT::compile):
  6894. * interpreter/Interpreter.cpp:
  6895. (JSC::Interpreter::privateExecute):
  6896. * jit/JITOpcodes.cpp:
  6897. (JSC::JIT::emit_op_is_undefined):
  6898. (JSC::JIT::emit_op_jeq_null):
  6899. (JSC::JIT::emit_op_jneq_null):
  6900. (JSC::JIT::emit_op_eq_null):
  6901. (JSC::JIT::emit_op_neq_null):
  6902. * jit/JITOpcodes32_64.cpp:
  6903. (JSC::JIT::emit_op_is_undefined):
  6904. (JSC::JIT::emit_op_jeq_null):
  6905. (JSC::JIT::emit_op_jneq_null):
  6906. (JSC::JIT::emit_op_eq_null):
  6907. (JSC::JIT::emit_op_neq_null):
  6908. * jit/JITStubs.cpp:
  6909. (JSC::DEFINE_STUB_FUNCTION):
  6910. * llint/LLIntSlowPaths.cpp:
  6911. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  6912. * llint/LowLevelInterpreter32_64.asm:
  6913. * llint/LowLevelInterpreter64.asm:
  6914. * runtime/ArrayPrototype.cpp:
  6915. (JSC::arrayProtoFuncFilter):
  6916. (JSC::arrayProtoFuncEvery):
  6917. (JSC::arrayProtoFuncSome):
  6918. * runtime/BooleanConstructor.cpp:
  6919. (JSC::constructBoolean):
  6920. (JSC::callBooleanConstructor):
  6921. * runtime/JSCell.h:
  6922. (JSCell):
  6923. * runtime/JSGlobalObject.cpp:
  6924. (JSC::JSGlobalObject::JSGlobalObject):
  6925. * runtime/JSGlobalObject.h:
  6926. (JSGlobalObject):
  6927. (JSC::JSGlobalObject::masqueradesAsUndefinedWatchpoint):
  6928. * runtime/JSString.h:
  6929. (JSC::JSCell::toBoolean):
  6930. (JSC::JSValue::toBoolean):
  6931. * runtime/JSValue.h:
  6932. * runtime/ObjectConstructor.cpp:
  6933. (JSC::toPropertyDescriptor):
  6934. * runtime/Operations.cpp:
  6935. (JSC::jsTypeStringForValue):
  6936. (JSC::jsIsObjectType):
  6937. * runtime/Operations.h:
  6938. (JSC):
  6939. (JSC::JSValue::equalSlowCaseInline):
  6940. * runtime/RegExpConstructor.cpp:
  6941. (JSC::setRegExpConstructorMultiline):
  6942. * runtime/RegExpPrototype.cpp:
  6943. (JSC::regExpProtoFuncToString):
  6944. * runtime/Structure.h:
  6945. (Structure):
  6946. (JSC::Structure::globalObjectOffset):
  6947. (JSC::Structure::masqueradesAsUndefined):
  6948. (JSC):
  6949. 2012-08-14 Filip Pizlo <fpizlo@apple.com>
  6950. Unreviewed, build fix for !ENABLE(DFG_JIT)
  6951. * jit/JITPropertyAccess.cpp:
  6952. (JSC::JIT::emit_op_get_by_val):
  6953. (JSC::JIT::emit_op_put_by_val):
  6954. (JSC::JIT::privateCompilePatchGetArrayLength):
  6955. * jit/JITPropertyAccess32_64.cpp:
  6956. (JSC::JIT::emit_op_get_by_val):
  6957. (JSC::JIT::emit_op_put_by_val):
  6958. (JSC::JIT::privateCompilePatchGetArrayLength):
  6959. * llint/LowLevelInterpreter32_64.asm:
  6960. * llint/LowLevelInterpreter64.asm:
  6961. 2012-08-13 Filip Pizlo <fpizlo@apple.com>
  6962. Array checks should use the structure, not the class info
  6963. https://bugs.webkit.org/show_bug.cgi?id=93150
  6964. Reviewed by Mark Hahnenberg.
  6965. This changes all array checks used in array accesses (get, put, get length,
  6966. push, pop) to use the structure, not the class info. Additionally, these
  6967. checks in the LLInt and baseline JIT record the structure in an ArrayProfile,
  6968. so that the DFG can know exactly what structure to check for.
  6969. * CMakeLists.txt:
  6970. * GNUmakefile.list.am:
  6971. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  6972. * JavaScriptCore.xcodeproj/project.pbxproj:
  6973. * Target.pri:
  6974. * bytecode/ArrayProfile.cpp: Added.
  6975. (JSC):
  6976. (JSC::ArrayProfile::computeUpdatedPrediction):
  6977. * bytecode/ArrayProfile.h: Added.
  6978. (JSC):
  6979. (JSC::arrayModeFromStructure):
  6980. (ArrayProfile):
  6981. (JSC::ArrayProfile::ArrayProfile):
  6982. (JSC::ArrayProfile::bytecodeOffset):
  6983. (JSC::ArrayProfile::addressOfLastSeenStructure):
  6984. (JSC::ArrayProfile::observeStructure):
  6985. (JSC::ArrayProfile::expectedStructure):
  6986. (JSC::ArrayProfile::structureIsPolymorphic):
  6987. (JSC::ArrayProfile::hasDefiniteStructure):
  6988. (JSC::ArrayProfile::observedArrayModes):
  6989. * bytecode/CodeBlock.cpp:
  6990. (JSC::CodeBlock::dump):
  6991. (JSC::CodeBlock::getArrayProfile):
  6992. (JSC):
  6993. (JSC::CodeBlock::getOrAddArrayProfile):
  6994. (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
  6995. * bytecode/CodeBlock.h:
  6996. (JSC::CodeBlock::executionEntryCount):
  6997. (JSC::CodeBlock::numberOfArrayProfiles):
  6998. (JSC::CodeBlock::arrayProfiles):
  6999. (JSC::CodeBlock::addArrayProfile):
  7000. (CodeBlock):
  7001. * bytecode/Instruction.h:
  7002. (JSC):
  7003. (JSC::Instruction::Instruction):
  7004. * bytecode/Opcode.h:
  7005. (JSC):
  7006. (JSC::padOpcodeName):
  7007. * bytecompiler/BytecodeGenerator.cpp:
  7008. (JSC::BytecodeGenerator::emitGetArgumentByVal):
  7009. (JSC::BytecodeGenerator::emitGetByVal):
  7010. (JSC::BytecodeGenerator::emitPutByVal):
  7011. * dfg/DFGAbstractState.cpp:
  7012. (JSC::DFG::AbstractState::initialize):
  7013. (JSC::DFG::AbstractState::execute):
  7014. * dfg/DFGAbstractValue.h:
  7015. (JSC::DFG::StructureAbstractValue::hasSingleton):
  7016. (StructureAbstractValue):
  7017. (JSC::DFG::StructureAbstractValue::singleton):
  7018. * dfg/DFGArgumentsSimplificationPhase.cpp:
  7019. (JSC::DFG::ArgumentsSimplificationPhase::run):
  7020. * dfg/DFGByteCodeParser.cpp:
  7021. (JSC::DFG::ByteCodeParser::parseBlock):
  7022. * dfg/DFGFixupPhase.cpp:
  7023. (JSC::DFG::FixupPhase::fixupNode):
  7024. * dfg/DFGSpeculativeJIT.cpp:
  7025. (JSC::DFG::SpeculativeJIT::speculateArray):
  7026. (DFG):
  7027. (JSC::DFG::SpeculativeJIT::compile):
  7028. (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
  7029. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  7030. * dfg/DFGSpeculativeJIT.h:
  7031. (SpeculativeJIT):
  7032. * dfg/DFGSpeculativeJIT32_64.cpp:
  7033. (JSC::DFG::SpeculativeJIT::compile):
  7034. * dfg/DFGSpeculativeJIT64.cpp:
  7035. (JSC::DFG::SpeculativeJIT::compile):
  7036. * dfg/DFGStructureCheckHoistingPhase.cpp:
  7037. (JSC::DFG::StructureCheckHoistingPhase::run):
  7038. * jit/JITPropertyAccess.cpp:
  7039. (JSC::JIT::emit_op_get_by_val):
  7040. (JSC::JIT::emit_op_put_by_val):
  7041. (JSC::JIT::privateCompilePatchGetArrayLength):
  7042. * jit/JITPropertyAccess32_64.cpp:
  7043. (JSC::JIT::emit_op_get_by_val):
  7044. (JSC::JIT::emit_op_put_by_val):
  7045. (JSC::JIT::privateCompilePatchGetArrayLength):
  7046. * llint/LLIntOffsetsExtractor.cpp:
  7047. * llint/LowLevelInterpreter32_64.asm:
  7048. * llint/LowLevelInterpreter64.asm:
  7049. * runtime/Structure.h:
  7050. (Structure):
  7051. (JSC::Structure::classInfoOffset):
  7052. 2012-08-14 Gabor Ballabas <gaborb@inf.u-szeged.hu>
  7053. Rename functions in the ARM port of DFG-JIT for better code readability.
  7054. https://bugs.webkit.org/show_bug.cgi?id=93609
  7055. Reviewed by Zoltan Herczeg.
  7056. Rename functions in the ARM port of DFG-JIT for better code
  7057. readability, and for following the WebKit coding style
  7058. wherever it is possible.
  7059. * assembler/ARMAssembler.cpp:
  7060. (JSC::ARMAssembler::genInt):
  7061. (JSC::ARMAssembler::getImm):
  7062. (JSC::ARMAssembler::moveImm):
  7063. (JSC::ARMAssembler::encodeComplexImm):
  7064. (JSC::ARMAssembler::dataTransfer32):
  7065. (JSC::ARMAssembler::baseIndexTransfer32):
  7066. (JSC::ARMAssembler::dataTransfer16):
  7067. (JSC::ARMAssembler::baseIndexTransfer16):
  7068. (JSC::ARMAssembler::dataTransferFloat):
  7069. (JSC::ARMAssembler::baseIndexTransferFloat):
  7070. * assembler/ARMAssembler.h:
  7071. (JSC::ARMAssembler::bitAnd):
  7072. (JSC::ARMAssembler::bitAnds):
  7073. (JSC::ARMAssembler::eor):
  7074. (JSC::ARMAssembler::eors):
  7075. (JSC::ARMAssembler::sub):
  7076. (JSC::ARMAssembler::subs):
  7077. (JSC::ARMAssembler::rsb):
  7078. (JSC::ARMAssembler::rsbs):
  7079. (JSC::ARMAssembler::add):
  7080. (JSC::ARMAssembler::adds):
  7081. (JSC::ARMAssembler::adc):
  7082. (JSC::ARMAssembler::adcs):
  7083. (JSC::ARMAssembler::sbc):
  7084. (JSC::ARMAssembler::sbcs):
  7085. (JSC::ARMAssembler::rsc):
  7086. (JSC::ARMAssembler::rscs):
  7087. (JSC::ARMAssembler::tst):
  7088. (JSC::ARMAssembler::teq):
  7089. (JSC::ARMAssembler::cmp):
  7090. (JSC::ARMAssembler::cmn):
  7091. (JSC::ARMAssembler::orr):
  7092. (JSC::ARMAssembler::orrs):
  7093. (JSC::ARMAssembler::mov):
  7094. (JSC::ARMAssembler::movw):
  7095. (JSC::ARMAssembler::movt):
  7096. (JSC::ARMAssembler::movs):
  7097. (JSC::ARMAssembler::bic):
  7098. (JSC::ARMAssembler::bics):
  7099. (JSC::ARMAssembler::mvn):
  7100. (JSC::ARMAssembler::mvns):
  7101. (JSC::ARMAssembler::mul):
  7102. (JSC::ARMAssembler::muls):
  7103. (JSC::ARMAssembler::mull):
  7104. (JSC::ARMAssembler::vmov_f64):
  7105. (JSC::ARMAssembler::vadd_f64):
  7106. (JSC::ARMAssembler::vdiv_f64):
  7107. (JSC::ARMAssembler::vsub_f64):
  7108. (JSC::ARMAssembler::vmul_f64):
  7109. (JSC::ARMAssembler::vcmp_f64):
  7110. (JSC::ARMAssembler::vsqrt_f64):
  7111. (JSC::ARMAssembler::vabs_f64):
  7112. (JSC::ARMAssembler::vneg_f64):
  7113. (JSC::ARMAssembler::ldrImmediate):
  7114. (JSC::ARMAssembler::ldrUniqueImmediate):
  7115. (JSC::ARMAssembler::dtrUp):
  7116. (JSC::ARMAssembler::dtrUpRegister):
  7117. (JSC::ARMAssembler::dtrDown):
  7118. (JSC::ARMAssembler::dtrDownRegister):
  7119. (JSC::ARMAssembler::halfDtrUp):
  7120. (JSC::ARMAssembler::halfDtrUpRegister):
  7121. (JSC::ARMAssembler::halfDtrDown):
  7122. (JSC::ARMAssembler::halfDtrDownRegister):
  7123. (JSC::ARMAssembler::doubleDtrUp):
  7124. (JSC::ARMAssembler::doubleDtrDown):
  7125. (JSC::ARMAssembler::push):
  7126. (JSC::ARMAssembler::pop):
  7127. (JSC::ARMAssembler::poke):
  7128. (JSC::ARMAssembler::peek):
  7129. (JSC::ARMAssembler::vmov_vfp64):
  7130. (JSC::ARMAssembler::vmov_arm64):
  7131. (JSC::ARMAssembler::vmov_vfp32):
  7132. (JSC::ARMAssembler::vmov_arm32):
  7133. (JSC::ARMAssembler::vcvt_f64_s32):
  7134. (JSC::ARMAssembler::vcvt_s32_f64):
  7135. (JSC::ARMAssembler::vcvt_u32_f64):
  7136. (JSC::ARMAssembler::vcvt_f64_f32):
  7137. (JSC::ARMAssembler::vcvt_f32_f64):
  7138. (JSC::ARMAssembler::clz):
  7139. (JSC::ARMAssembler::lslRegister):
  7140. (JSC::ARMAssembler::lsrRegister):
  7141. (JSC::ARMAssembler::asrRegister):
  7142. (JSC::ARMAssembler::align):
  7143. (JSC::ARMAssembler::loadBranchTarget):
  7144. (JSC::ARMAssembler::vmov):
  7145. * assembler/MacroAssemblerARM.cpp:
  7146. (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  7147. * assembler/MacroAssemblerARM.h:
  7148. (JSC::MacroAssemblerARM::add32):
  7149. (JSC::MacroAssemblerARM::and32):
  7150. (JSC::MacroAssemblerARM::lshift32):
  7151. (JSC::MacroAssemblerARM::mul32):
  7152. (JSC::MacroAssemblerARM::or32):
  7153. (JSC::MacroAssemblerARM::rshift32):
  7154. (JSC::MacroAssemblerARM::urshift32):
  7155. (JSC::MacroAssemblerARM::sub32):
  7156. (JSC::MacroAssemblerARM::xor32):
  7157. (JSC::MacroAssemblerARM::countLeadingZeros32):
  7158. (JSC::MacroAssemblerARM::convertibleLoadPtr):
  7159. (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
  7160. (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
  7161. (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
  7162. (JSC::MacroAssemblerARM::store32):
  7163. (JSC::MacroAssemblerARM::pop):
  7164. (JSC::MacroAssemblerARM::push):
  7165. (JSC::MacroAssemblerARM::move):
  7166. (JSC::MacroAssemblerARM::swap):
  7167. (JSC::MacroAssemblerARM::branch32):
  7168. (JSC::MacroAssemblerARM::branchTest32):
  7169. (JSC::MacroAssemblerARM::mull32):
  7170. (JSC::MacroAssemblerARM::branchSub32):
  7171. (JSC::MacroAssemblerARM::compare32):
  7172. (JSC::MacroAssemblerARM::test32):
  7173. (JSC::MacroAssemblerARM::load32):
  7174. (JSC::MacroAssemblerARM::relativeTableJump):
  7175. (JSC::MacroAssemblerARM::moveWithPatch):
  7176. (JSC::MacroAssemblerARM::loadDouble):
  7177. (JSC::MacroAssemblerARM::moveDouble):
  7178. (JSC::MacroAssemblerARM::addDouble):
  7179. (JSC::MacroAssemblerARM::divDouble):
  7180. (JSC::MacroAssemblerARM::subDouble):
  7181. (JSC::MacroAssemblerARM::mulDouble):
  7182. (JSC::MacroAssemblerARM::sqrtDouble):
  7183. (JSC::MacroAssemblerARM::absDouble):
  7184. (JSC::MacroAssemblerARM::negateDouble):
  7185. (JSC::MacroAssemblerARM::convertInt32ToDouble):
  7186. (JSC::MacroAssemblerARM::convertFloatToDouble):
  7187. (JSC::MacroAssemblerARM::convertDoubleToFloat):
  7188. (JSC::MacroAssemblerARM::branchDouble):
  7189. (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
  7190. (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
  7191. (JSC::MacroAssemblerARM::truncateDoubleToInt32):
  7192. (JSC::MacroAssemblerARM::truncateDoubleToUint32):
  7193. (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
  7194. (JSC::MacroAssemblerARM::branchDoubleNonZero):
  7195. (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
  7196. 2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
  7197. Unreviewed, rolling out r125444.
  7198. http://trac.webkit.org/changeset/125444
  7199. https://bugs.webkit.org/show_bug.cgi?id=93872
  7200. Broke some tests
  7201. * Target.pri:
  7202. 2012-08-13 Simon Hausmann <simon.hausmann@nokia.com>
  7203. [Qt] Replace use of internal Weak smart pointer with JSWeakObjectMap
  7204. https://bugs.webkit.org/show_bug.cgi?id=93872
  7205. Reviewed by Kenneth Rohde Christiansen.
  7206. * Target.pri: Add missing JSWeakObjectMap file to build.
  7207. 2012-08-13 Raphael Kubo da Costa <rakuco@webkit.org>
  7208. [CMake] Remove glib-related Find modules and write single new one instead.
  7209. https://bugs.webkit.org/show_bug.cgi?id=93786
  7210. Reviewed by Rob Buis.
  7211. * shell/PlatformEfl.cmake: Use GLIB_* instead of Glib_*.
  7212. 2012-08-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
  7213. Doesn't build with ENABLE_JIT=0
  7214. https://bugs.webkit.org/show_bug.cgi?id=85042
  7215. Reviewed by Eric Seidel.
  7216. Include headers without which CallFrame.h does not build, and
  7217. fix gcc warning about comparing unsigned int with 0.
  7218. * dfg/DFGDriver.cpp:
  7219. * interpreter/Interpreter.cpp:
  7220. (JSC::Interpreter::isOpcode):
  7221. 2012-08-10 Yong Li <yoli@rim.com>
  7222. [BlackBerry] GCActivityCallback should always schedule GC even allocated bytes is a small number
  7223. https://bugs.webkit.org/show_bug.cgi?id=93650
  7224. Reviewed by Rob Buis.
  7225. Even a small number of allocated JS objects could hold expensive resources.
  7226. * runtime/GCActivityCallbackBlackBerry.cpp:
  7227. (JSC::DefaultGCActivityCallback::didAllocate):
  7228. 2012-08-09 Yong Li <yoli@rim.com>
  7229. [QNX] Implement getCPUTime() for OS(QNX)
  7230. https://bugs.webkit.org/show_bug.cgi?id=93516
  7231. Reviewed by George Staikos.
  7232. Implement getCPUTime() with CLOCK_THREAD_CPUTIME_ID so it will tell
  7233. exactly how long the current thread has spent without being impacted
  7234. by other things.
  7235. * runtime/TimeoutChecker.cpp:
  7236. (JSC::getCPUTime):
  7237. 2012-08-08 Shane Stephens <shanestephens@google.com>
  7238. Compile flag for CSS Hierarchies
  7239. https://bugs.webkit.org/show_bug.cgi?id=92433
  7240. Reviewed by Tony Chang.
  7241. * Configurations/FeatureDefines.xcconfig:
  7242. 2012-08-08 Benjamin Poulain <bpoulain@apple.com>
  7243. Use char* instead of LChar* for the public interface of String construction from literals
  7244. https://bugs.webkit.org/show_bug.cgi?id=93402
  7245. Reviewed by Michael Saboff.
  7246. Update JSC' Identifier to use StringImpl::createFromLiteral with a char*.
  7247. * runtime/Identifier.cpp:
  7248. (JSC::IdentifierASCIIStringTranslator::translate):
  7249. 2012-08-08 Patrick Gansterer <paroga@webkit.org>
  7250. Remove ce_time.(cpp|h) from list of source files
  7251. https://bugs.webkit.org/show_bug.cgi?id=93446
  7252. Reviewed by Simon Hausmann.
  7253. r125004 removed the last dependency on functions defined in ce_time.cpp.
  7254. * Target.pri:
  7255. 2012-08-08 Patrick Gansterer <paroga@webkit.org>
  7256. [WIN] Use GetTimeZoneInformation() for getting the timezone name
  7257. https://bugs.webkit.org/show_bug.cgi?id=91936
  7258. Reviewed by Ryosuke Niwa.
  7259. The MS CRT implementation of strftime calls the same functions in the background.
  7260. Using them directly avoids the overhead of parsing the format string and removes
  7261. the dependency on strftime() for WinCE where this function does not exist.
  7262. * runtime/DateConversion.cpp:
  7263. (JSC::formatTime):
  7264. 2012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
  7265. Refactor magic numbers in the ARM port of DFG-JIT
  7266. https://bugs.webkit.org/show_bug.cgi?id=93348
  7267. Reviewed by Eric Seidel.
  7268. Introduce new names for hard-coded magic numbers.
  7269. Refactor constant with confusing names to more descriptive ones.
  7270. * assembler/ARMAssembler.cpp:
  7271. (JSC::ARMAssembler::patchConstantPoolLoad):
  7272. (JSC::ARMAssembler::getOp2):
  7273. (JSC::ARMAssembler::genInt):
  7274. (JSC::ARMAssembler::getImm):
  7275. (JSC::ARMAssembler::moveImm):
  7276. (JSC::ARMAssembler::encodeComplexImm):
  7277. (JSC::ARMAssembler::dataTransfer32):
  7278. (JSC::ARMAssembler::dataTransfer16):
  7279. (JSC::ARMAssembler::dataTransferFloat):
  7280. (JSC::ARMAssembler::executableCopy):
  7281. * assembler/ARMAssembler.h:
  7282. (JSC::ARMAssembler::emitInstruction):
  7283. (JSC::ARMAssembler::ands_r):
  7284. (JSC::ARMAssembler::eors_r):
  7285. (JSC::ARMAssembler::subs_r):
  7286. (JSC::ARMAssembler::rsbs_r):
  7287. (JSC::ARMAssembler::adds_r):
  7288. (JSC::ARMAssembler::adcs_r):
  7289. (JSC::ARMAssembler::sbcs_r):
  7290. (JSC::ARMAssembler::rscs_r):
  7291. (JSC::ARMAssembler::tst_r):
  7292. (JSC::ARMAssembler::teq_r):
  7293. (JSC::ARMAssembler::cmp_r):
  7294. (JSC::ARMAssembler::cmn_r):
  7295. (JSC::ARMAssembler::orrs_r):
  7296. (JSC::ARMAssembler::movs_r):
  7297. (JSC::ARMAssembler::bics_r):
  7298. (JSC::ARMAssembler::mvns_r):
  7299. (JSC::ARMAssembler::muls_r):
  7300. (JSC::ARMAssembler::ldr_imm):
  7301. (JSC::ARMAssembler::ldr_un_imm):
  7302. (JSC::ARMAssembler::dtr_u):
  7303. (JSC::ARMAssembler::dtr_ur):
  7304. (JSC::ARMAssembler::dtr_dr):
  7305. (JSC::ARMAssembler::dtrh_u):
  7306. (JSC::ARMAssembler::dtrh_ur):
  7307. (JSC::ARMAssembler::fdtr_u):
  7308. (JSC::ARMAssembler::push_r):
  7309. (JSC::ARMAssembler::pop_r):
  7310. (JSC::ARMAssembler::getLdrImmAddress):
  7311. (JSC::ARMAssembler::getLdrImmAddressOnPool):
  7312. (JSC::ARMAssembler::patchConstantPoolLoad):
  7313. (JSC::ARMAssembler::repatchCompact):
  7314. (JSC::ARMAssembler::replaceWithJump):
  7315. (JSC::ARMAssembler::replaceWithLoad):
  7316. (JSC::ARMAssembler::replaceWithAddressComputation):
  7317. (JSC::ARMAssembler::getOp2Byte):
  7318. (JSC::ARMAssembler::getOp2Half):
  7319. (JSC::ARMAssembler::getImm16Op2):
  7320. (JSC::ARMAssembler::placeConstantPoolBarrier):
  7321. (JSC::ARMAssembler::getConditionalField):
  7322. * assembler/MacroAssemblerARM.cpp:
  7323. (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  7324. * assembler/MacroAssemblerARM.h:
  7325. (JSC::MacroAssemblerARM::and32):
  7326. (JSC::MacroAssemblerARM::branch32):
  7327. (JSC::MacroAssemblerARM::branchTest32):
  7328. (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
  7329. 2012-08-07 Benjamin Poulain <benjamin@webkit.org>
  7330. Use the initialization from literal for JSC's Identifiers
  7331. https://bugs.webkit.org/show_bug.cgi?id=93193
  7332. Reviewed by Geoffrey Garen.
  7333. This patches modify Identifier ot take advantage of the new initialization from literal.
  7334. In addition to the memory savings (~600bytes per instance), this gives us a 2% speed
  7335. improvement on CommonIdentifiers on average.
  7336. * runtime/CommonIdentifiers.cpp:
  7337. (JSC::CommonIdentifiers::CommonIdentifiers):
  7338. Null and empty strings are forbidden for literal initialization. Use the most efficient constructors
  7339. instead of a literal.
  7340. * runtime/Identifier.cpp:
  7341. (IdentifierASCIIStringTranslator):
  7342. Rename IdentifierCStringTranslator to IdentifierASCIIStringTranslator to make the text encoding
  7343. explicit.
  7344. (JSC::IdentifierASCIIStringTranslator::hash):
  7345. (JSC::IdentifierASCIIStringTranslator::equal):
  7346. (JSC::IdentifierASCIIStringTranslator::translate): Use the fast initialization from literal.
  7347. (JSC::Identifier::add):
  7348. * runtime/Identifier.h:
  7349. (JSC::Identifier::Identifier):
  7350. 2012-08-07 Simon Hausmann <simon.hausmann@nokia.com>
  7351. [Qt][Win] Remove pthreads linkage
  7352. Reviewed by Csaba Osztrogonác.
  7353. After r124823 linkage to pthreads is not needed anymore for the Windows
  7354. build.
  7355. * JavaScriptCore.pri:
  7356. 2012-08-07 Gabor Ballabas <gaborb@inf.u-szeged.hu>
  7357. Refactor emit*Inst functions and introduce toARMWord functions in DFG-JIT's traditional ARM port
  7358. https://bugs.webkit.org/show_bug.cgi?id=93266
  7359. Reviewed by Csaba Osztrogonác.
  7360. First part of a bigger refactoring issue trying to make traditional
  7361. ARM DFG-JIT port easier to read and understand.
  7362. * assembler/ARMAssembler.h:
  7363. (JSC::ARMAssembler::emitInstruction):
  7364. (JSC::ARMAssembler::emitDoublePrecisionInstruction):
  7365. (JSC::ARMAssembler::emitSinglePrecisionInstruction):
  7366. (JSC::ARMAssembler::and_r):
  7367. (JSC::ARMAssembler::ands_r):
  7368. (JSC::ARMAssembler::eor_r):
  7369. (JSC::ARMAssembler::eors_r):
  7370. (JSC::ARMAssembler::sub_r):
  7371. (JSC::ARMAssembler::subs_r):
  7372. (JSC::ARMAssembler::rsb_r):
  7373. (JSC::ARMAssembler::rsbs_r):
  7374. (JSC::ARMAssembler::add_r):
  7375. (JSC::ARMAssembler::adds_r):
  7376. (JSC::ARMAssembler::adc_r):
  7377. (JSC::ARMAssembler::adcs_r):
  7378. (JSC::ARMAssembler::sbc_r):
  7379. (JSC::ARMAssembler::sbcs_r):
  7380. (JSC::ARMAssembler::rsc_r):
  7381. (JSC::ARMAssembler::rscs_r):
  7382. (JSC::ARMAssembler::tst_r):
  7383. (JSC::ARMAssembler::teq_r):
  7384. (JSC::ARMAssembler::cmp_r):
  7385. (JSC::ARMAssembler::cmn_r):
  7386. (JSC::ARMAssembler::orr_r):
  7387. (JSC::ARMAssembler::orrs_r):
  7388. (JSC::ARMAssembler::mov_r):
  7389. (JSC::ARMAssembler::movw_r):
  7390. (JSC::ARMAssembler::movt_r):
  7391. (JSC::ARMAssembler::movs_r):
  7392. (JSC::ARMAssembler::bic_r):
  7393. (JSC::ARMAssembler::bics_r):
  7394. (JSC::ARMAssembler::mvn_r):
  7395. (JSC::ARMAssembler::mvns_r):
  7396. (JSC::ARMAssembler::mul_r):
  7397. (JSC::ARMAssembler::muls_r):
  7398. (JSC::ARMAssembler::mull_r):
  7399. (JSC::ARMAssembler::vmov_f64_r):
  7400. (JSC::ARMAssembler::vadd_f64_r):
  7401. (JSC::ARMAssembler::vdiv_f64_r):
  7402. (JSC::ARMAssembler::vsub_f64_r):
  7403. (JSC::ARMAssembler::vmul_f64_r):
  7404. (JSC::ARMAssembler::vcmp_f64_r):
  7405. (JSC::ARMAssembler::vsqrt_f64_r):
  7406. (JSC::ARMAssembler::vabs_f64_r):
  7407. (JSC::ARMAssembler::vneg_f64_r):
  7408. (JSC::ARMAssembler::ldr_imm):
  7409. (JSC::ARMAssembler::ldr_un_imm):
  7410. (JSC::ARMAssembler::dtr_u):
  7411. (JSC::ARMAssembler::dtr_ur):
  7412. (JSC::ARMAssembler::dtr_d):
  7413. (JSC::ARMAssembler::dtr_dr):
  7414. (JSC::ARMAssembler::dtrh_u):
  7415. (JSC::ARMAssembler::dtrh_ur):
  7416. (JSC::ARMAssembler::dtrh_d):
  7417. (JSC::ARMAssembler::dtrh_dr):
  7418. (JSC::ARMAssembler::fdtr_u):
  7419. (JSC::ARMAssembler::fdtr_d):
  7420. (JSC::ARMAssembler::push_r):
  7421. (JSC::ARMAssembler::pop_r):
  7422. (JSC::ARMAssembler::vmov_vfp64_r):
  7423. (JSC::ARMAssembler::vmov_arm64_r):
  7424. (JSC::ARMAssembler::vmov_vfp32_r):
  7425. (JSC::ARMAssembler::vmov_arm32_r):
  7426. (JSC::ARMAssembler::vcvt_f64_s32_r):
  7427. (JSC::ARMAssembler::vcvt_s32_f64_r):
  7428. (JSC::ARMAssembler::vcvt_u32_f64_r):
  7429. (JSC::ARMAssembler::vcvt_f64_f32_r):
  7430. (JSC::ARMAssembler::vcvt_f32_f64_r):
  7431. (JSC::ARMAssembler::vmrs_apsr):
  7432. (JSC::ARMAssembler::clz_r):
  7433. (JSC::ARMAssembler::bx):
  7434. (JSC::ARMAssembler::blx):
  7435. (JSC::ARMAssembler::linkJump):
  7436. (JSC::ARMAssembler::toARMWord):
  7437. (ARMAssembler):
  7438. 2012-08-06 Patrick Gansterer <paroga@webkit.org>
  7439. [WIN] Remove dependency on pthread from MachineStackMarker
  7440. https://bugs.webkit.org/show_bug.cgi?id=68429
  7441. Reviewed by Geoffrey Garen.
  7442. Windows has no support for calling a destructor for thread specific data.
  7443. Since we need more control over creating and deleting thread specific keys
  7444. we can not simply extend WTF::ThreadSpecific with this functionality.
  7445. All thread specific keys created via the new API get stored in a list.
  7446. After a thread function finished we iterate over this list and call
  7447. the registered destructor for every item if needed.
  7448. * heap/MachineStackMarker.cpp: Use the new functions instead of pthread directly.
  7449. (JSC::MachineThreads::~MachineThreads):
  7450. (JSC::MachineThreads::makeUsableFromMultipleThreads):
  7451. (JSC::MachineThreads::addCurrentThread):
  7452. * heap/MachineStackMarker.h:
  7453. (MachineThreads):
  7454. 2012-08-06 Patrick Gansterer <paroga@webkit.org>
  7455. Unify JSC date and time formating functions
  7456. https://bugs.webkit.org/show_bug.cgi?id=92282
  7457. Reviewed by Geoffrey Garen.
  7458. Replace the existing functions for formating GregorianDateTime
  7459. with one single function. This removes some code duplications
  7460. in DatePrototype and is a preperation to fix encoding issues,
  7461. since we can add UChar* values to the resulting string now.
  7462. * runtime/DateConstructor.cpp:
  7463. (JSC::callDate):
  7464. * runtime/DateConversion.cpp:
  7465. (JSC::formatDateTime):
  7466. * runtime/DateConversion.h:
  7467. (JSC):
  7468. * runtime/DatePrototype.cpp:
  7469. (JSC::formateDateInstance):
  7470. (JSC::dateProtoFuncToString):
  7471. (JSC::dateProtoFuncToUTCString):
  7472. (JSC::dateProtoFuncToDateString):
  7473. (JSC::dateProtoFuncToTimeString):
  7474. (JSC::dateProtoFuncToGMTString):
  7475. 2012-08-06 Carlos Garcia Campos <cgarcia@igalia.com>
  7476. Unreviewed. Fix make distcheck.
  7477. * GNUmakefile.list.am: Add missing header file.
  7478. 2012-08-05 Peter Wang <peter.wang@torchmobile.com.cn>
  7479. Web Inspector: [JSC] implement setting breakpoints by line:column
  7480. https://bugs.webkit.org/show_bug.cgi?id=53003
  7481. Reviewed by Geoffrey Garen.
  7482. Add a counter to Lexer to record the column info of each Token. Add a column parameter to
  7483. op_debug, cti_op_debug, and _llint_op_debug byte-code command.
  7484. * bytecode/CodeBlock.cpp:
  7485. (JSC::CodeBlock::dump):
  7486. * bytecode/Opcode.h:
  7487. (JSC):
  7488. (JSC::padOpcodeName):
  7489. * bytecompiler/BytecodeGenerator.cpp:
  7490. (JSC::BytecodeGenerator::resolve):
  7491. (JSC::BytecodeGenerator::emitDebugHook):
  7492. * bytecompiler/BytecodeGenerator.h:
  7493. (BytecodeGenerator):
  7494. * bytecompiler/NodesCodegen.cpp:
  7495. (JSC::ArrayNode::toArgumentList):
  7496. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  7497. (JSC::ConstStatementNode::emitBytecode):
  7498. (JSC::EmptyStatementNode::emitBytecode):
  7499. (JSC::DebuggerStatementNode::emitBytecode):
  7500. (JSC::ExprStatementNode::emitBytecode):
  7501. (JSC::VarStatementNode::emitBytecode):
  7502. (JSC::IfNode::emitBytecode):
  7503. (JSC::IfElseNode::emitBytecode):
  7504. (JSC::DoWhileNode::emitBytecode):
  7505. (JSC::WhileNode::emitBytecode):
  7506. (JSC::ForNode::emitBytecode):
  7507. (JSC::ForInNode::emitBytecode):
  7508. (JSC::ContinueNode::emitBytecode):
  7509. (JSC::BreakNode::emitBytecode):
  7510. (JSC::ReturnNode::emitBytecode):
  7511. (JSC::WithNode::emitBytecode):
  7512. (JSC::SwitchNode::emitBytecode):
  7513. (JSC::LabelNode::emitBytecode):
  7514. (JSC::ThrowNode::emitBytecode):
  7515. (JSC::TryNode::emitBytecode):
  7516. (JSC::ProgramNode::emitBytecode):
  7517. (JSC::EvalNode::emitBytecode):
  7518. (JSC::FunctionBodyNode::emitBytecode):
  7519. * debugger/Debugger.h:
  7520. * interpreter/Interpreter.cpp:
  7521. (JSC::Interpreter::unwindCallFrame):
  7522. (JSC::Interpreter::throwException):
  7523. (JSC::Interpreter::debug):
  7524. (JSC::Interpreter::privateExecute):
  7525. * interpreter/Interpreter.h:
  7526. (Interpreter):
  7527. * jit/JITOpcodes.cpp:
  7528. (JSC::JIT::emit_op_debug):
  7529. * jit/JITOpcodes32_64.cpp:
  7530. (JSC::JIT::emit_op_debug):
  7531. * jit/JITStubs.cpp:
  7532. (JSC::DEFINE_STUB_FUNCTION):
  7533. * llint/LLIntSlowPaths.cpp:
  7534. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  7535. * llint/LowLevelInterpreter.asm:
  7536. * parser/ASTBuilder.h:
  7537. (ASTBuilder):
  7538. (JSC::ASTBuilder::createCommaExpr):
  7539. (JSC::ASTBuilder::createLogicalNot):
  7540. (JSC::ASTBuilder::createUnaryPlus):
  7541. (JSC::ASTBuilder::createVoid):
  7542. (JSC::ASTBuilder::thisExpr):
  7543. (JSC::ASTBuilder::createResolve):
  7544. (JSC::ASTBuilder::createObjectLiteral):
  7545. (JSC::ASTBuilder::createArray):
  7546. (JSC::ASTBuilder::createNumberExpr):
  7547. (JSC::ASTBuilder::createString):
  7548. (JSC::ASTBuilder::createBoolean):
  7549. (JSC::ASTBuilder::createNull):
  7550. (JSC::ASTBuilder::createBracketAccess):
  7551. (JSC::ASTBuilder::createDotAccess):
  7552. (JSC::ASTBuilder::createRegExp):
  7553. (JSC::ASTBuilder::createNewExpr):
  7554. (JSC::ASTBuilder::createConditionalExpr):
  7555. (JSC::ASTBuilder::createAssignResolve):
  7556. (JSC::ASTBuilder::createFunctionExpr):
  7557. (JSC::ASTBuilder::createFunctionBody):
  7558. (JSC::ASTBuilder::createGetterOrSetterProperty):
  7559. (JSC::ASTBuilder::createArgumentsList):
  7560. (JSC::ASTBuilder::createPropertyList):
  7561. (JSC::ASTBuilder::createFuncDeclStatement):
  7562. (JSC::ASTBuilder::createBlockStatement):
  7563. (JSC::ASTBuilder::createExprStatement):
  7564. (JSC::ASTBuilder::createIfStatement):
  7565. (JSC::ASTBuilder::createForLoop):
  7566. (JSC::ASTBuilder::createForInLoop):
  7567. (JSC::ASTBuilder::createEmptyStatement):
  7568. (JSC::ASTBuilder::createVarStatement):
  7569. (JSC::ASTBuilder::createReturnStatement):
  7570. (JSC::ASTBuilder::createBreakStatement):
  7571. (JSC::ASTBuilder::createContinueStatement):
  7572. (JSC::ASTBuilder::createTryStatement):
  7573. (JSC::ASTBuilder::createSwitchStatement):
  7574. (JSC::ASTBuilder::createWhileStatement):
  7575. (JSC::ASTBuilder::createDoWhileStatement):
  7576. (JSC::ASTBuilder::createLabelStatement):
  7577. (JSC::ASTBuilder::createWithStatement):
  7578. (JSC::ASTBuilder::createThrowStatement):
  7579. (JSC::ASTBuilder::createDebugger):
  7580. (JSC::ASTBuilder::createConstStatement):
  7581. (JSC::ASTBuilder::appendConstDecl):
  7582. (JSC::ASTBuilder::combineCommaNodes):
  7583. (JSC::ASTBuilder::appendBinaryOperation):
  7584. (JSC::ASTBuilder::createAssignment):
  7585. (JSC::ASTBuilder::createNumber):
  7586. (JSC::ASTBuilder::makeTypeOfNode):
  7587. (JSC::ASTBuilder::makeDeleteNode):
  7588. (JSC::ASTBuilder::makeNegateNode):
  7589. (JSC::ASTBuilder::makeBitwiseNotNode):
  7590. (JSC::ASTBuilder::makeMultNode):
  7591. (JSC::ASTBuilder::makeDivNode):
  7592. (JSC::ASTBuilder::makeModNode):
  7593. (JSC::ASTBuilder::makeAddNode):
  7594. (JSC::ASTBuilder::makeSubNode):
  7595. (JSC::ASTBuilder::makeLeftShiftNode):
  7596. (JSC::ASTBuilder::makeRightShiftNode):
  7597. (JSC::ASTBuilder::makeURightShiftNode):
  7598. (JSC::ASTBuilder::makeBitOrNode):
  7599. (JSC::ASTBuilder::makeBitAndNode):
  7600. (JSC::ASTBuilder::makeBitXOrNode):
  7601. (JSC::ASTBuilder::makeFunctionCallNode):
  7602. (JSC::ASTBuilder::makeBinaryNode):
  7603. (JSC::ASTBuilder::makeAssignNode):
  7604. (JSC::ASTBuilder::makePrefixNode):
  7605. (JSC::ASTBuilder::makePostfixNode):
  7606. * parser/Lexer.cpp:
  7607. (JSC::::setCode):
  7608. (JSC::::internalShift):
  7609. (JSC::::shift):
  7610. (JSC::::lex):
  7611. * parser/Lexer.h:
  7612. (Lexer):
  7613. (JSC::Lexer::currentColumnNumber):
  7614. (JSC::::lexExpectIdentifier):
  7615. * parser/NodeConstructors.h:
  7616. (JSC::Node::Node):
  7617. (JSC::ExpressionNode::ExpressionNode):
  7618. (JSC::StatementNode::StatementNode):
  7619. (JSC::NullNode::NullNode):
  7620. (JSC::BooleanNode::BooleanNode):
  7621. (JSC::NumberNode::NumberNode):
  7622. (JSC::StringNode::StringNode):
  7623. (JSC::RegExpNode::RegExpNode):
  7624. (JSC::ThisNode::ThisNode):
  7625. (JSC::ResolveNode::ResolveNode):
  7626. (JSC::ArrayNode::ArrayNode):
  7627. (JSC::PropertyListNode::PropertyListNode):
  7628. (JSC::ObjectLiteralNode::ObjectLiteralNode):
  7629. (JSC::BracketAccessorNode::BracketAccessorNode):
  7630. (JSC::DotAccessorNode::DotAccessorNode):
  7631. (JSC::ArgumentListNode::ArgumentListNode):
  7632. (JSC::NewExprNode::NewExprNode):
  7633. (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
  7634. (JSC::FunctionCallValueNode::FunctionCallValueNode):
  7635. (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
  7636. (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
  7637. (JSC::FunctionCallDotNode::FunctionCallDotNode):
  7638. (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
  7639. (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
  7640. (JSC::PrePostResolveNode::PrePostResolveNode):
  7641. (JSC::PostfixResolveNode::PostfixResolveNode):
  7642. (JSC::PostfixBracketNode::PostfixBracketNode):
  7643. (JSC::PostfixDotNode::PostfixDotNode):
  7644. (JSC::PostfixErrorNode::PostfixErrorNode):
  7645. (JSC::DeleteResolveNode::DeleteResolveNode):
  7646. (JSC::DeleteBracketNode::DeleteBracketNode):
  7647. (JSC::DeleteDotNode::DeleteDotNode):
  7648. (JSC::DeleteValueNode::DeleteValueNode):
  7649. (JSC::VoidNode::VoidNode):
  7650. (JSC::TypeOfResolveNode::TypeOfResolveNode):
  7651. (JSC::TypeOfValueNode::TypeOfValueNode):
  7652. (JSC::PrefixResolveNode::PrefixResolveNode):
  7653. (JSC::PrefixBracketNode::PrefixBracketNode):
  7654. (JSC::PrefixDotNode::PrefixDotNode):
  7655. (JSC::PrefixErrorNode::PrefixErrorNode):
  7656. (JSC::UnaryOpNode::UnaryOpNode):
  7657. (JSC::UnaryPlusNode::UnaryPlusNode):
  7658. (JSC::NegateNode::NegateNode):
  7659. (JSC::BitwiseNotNode::BitwiseNotNode):
  7660. (JSC::LogicalNotNode::LogicalNotNode):
  7661. (JSC::BinaryOpNode::BinaryOpNode):
  7662. (JSC::MultNode::MultNode):
  7663. (JSC::DivNode::DivNode):
  7664. (JSC::ModNode::ModNode):
  7665. (JSC::AddNode::AddNode):
  7666. (JSC::SubNode::SubNode):
  7667. (JSC::LeftShiftNode::LeftShiftNode):
  7668. (JSC::RightShiftNode::RightShiftNode):
  7669. (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
  7670. (JSC::LessNode::LessNode):
  7671. (JSC::GreaterNode::GreaterNode):
  7672. (JSC::LessEqNode::LessEqNode):
  7673. (JSC::GreaterEqNode::GreaterEqNode):
  7674. (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
  7675. (JSC::InstanceOfNode::InstanceOfNode):
  7676. (JSC::InNode::InNode):
  7677. (JSC::EqualNode::EqualNode):
  7678. (JSC::NotEqualNode::NotEqualNode):
  7679. (JSC::StrictEqualNode::StrictEqualNode):
  7680. (JSC::NotStrictEqualNode::NotStrictEqualNode):
  7681. (JSC::BitAndNode::BitAndNode):
  7682. (JSC::BitOrNode::BitOrNode):
  7683. (JSC::BitXOrNode::BitXOrNode):
  7684. (JSC::LogicalOpNode::LogicalOpNode):
  7685. (JSC::ConditionalNode::ConditionalNode):
  7686. (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
  7687. (JSC::AssignResolveNode::AssignResolveNode):
  7688. (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
  7689. (JSC::AssignBracketNode::AssignBracketNode):
  7690. (JSC::AssignDotNode::AssignDotNode):
  7691. (JSC::ReadModifyDotNode::ReadModifyDotNode):
  7692. (JSC::AssignErrorNode::AssignErrorNode):
  7693. (JSC::CommaNode::CommaNode):
  7694. (JSC::ConstStatementNode::ConstStatementNode):
  7695. (JSC::EmptyStatementNode::EmptyStatementNode):
  7696. (JSC::DebuggerStatementNode::DebuggerStatementNode):
  7697. (JSC::ExprStatementNode::ExprStatementNode):
  7698. (JSC::VarStatementNode::VarStatementNode):
  7699. (JSC::IfNode::IfNode):
  7700. (JSC::IfElseNode::IfElseNode):
  7701. (JSC::DoWhileNode::DoWhileNode):
  7702. (JSC::WhileNode::WhileNode):
  7703. (JSC::ForNode::ForNode):
  7704. (JSC::ContinueNode::ContinueNode):
  7705. (JSC::BreakNode::BreakNode):
  7706. (JSC::ReturnNode::ReturnNode):
  7707. (JSC::WithNode::WithNode):
  7708. (JSC::LabelNode::LabelNode):
  7709. (JSC::ThrowNode::ThrowNode):
  7710. (JSC::TryNode::TryNode):
  7711. (JSC::FuncExprNode::FuncExprNode):
  7712. (JSC::FuncDeclNode::FuncDeclNode):
  7713. (JSC::SwitchNode::SwitchNode):
  7714. (JSC::ConstDeclNode::ConstDeclNode):
  7715. (JSC::BlockNode::BlockNode):
  7716. (JSC::ForInNode::ForInNode):
  7717. * parser/Nodes.cpp:
  7718. (JSC::StatementNode::setLoc):
  7719. (JSC):
  7720. (JSC::ScopeNode::ScopeNode):
  7721. (JSC::ProgramNode::ProgramNode):
  7722. (JSC::ProgramNode::create):
  7723. (JSC::EvalNode::EvalNode):
  7724. (JSC::EvalNode::create):
  7725. (JSC::FunctionBodyNode::FunctionBodyNode):
  7726. (JSC::FunctionBodyNode::create):
  7727. * parser/Nodes.h:
  7728. (Node):
  7729. (JSC::Node::columnNo):
  7730. (ExpressionNode):
  7731. (StatementNode):
  7732. (JSC::StatementNode::column):
  7733. (NullNode):
  7734. (BooleanNode):
  7735. (NumberNode):
  7736. (StringNode):
  7737. (RegExpNode):
  7738. (ThisNode):
  7739. (ResolveNode):
  7740. (ArrayNode):
  7741. (PropertyListNode):
  7742. (ObjectLiteralNode):
  7743. (BracketAccessorNode):
  7744. (DotAccessorNode):
  7745. (ArgumentListNode):
  7746. (NewExprNode):
  7747. (EvalFunctionCallNode):
  7748. (FunctionCallValueNode):
  7749. (FunctionCallResolveNode):
  7750. (FunctionCallBracketNode):
  7751. (FunctionCallDotNode):
  7752. (CallFunctionCallDotNode):
  7753. (ApplyFunctionCallDotNode):
  7754. (PrePostResolveNode):
  7755. (PostfixResolveNode):
  7756. (PostfixBracketNode):
  7757. (PostfixDotNode):
  7758. (PostfixErrorNode):
  7759. (DeleteResolveNode):
  7760. (DeleteBracketNode):
  7761. (DeleteDotNode):
  7762. (DeleteValueNode):
  7763. (VoidNode):
  7764. (TypeOfResolveNode):
  7765. (TypeOfValueNode):
  7766. (PrefixResolveNode):
  7767. (PrefixBracketNode):
  7768. (PrefixDotNode):
  7769. (PrefixErrorNode):
  7770. (UnaryOpNode):
  7771. (UnaryPlusNode):
  7772. (NegateNode):
  7773. (BitwiseNotNode):
  7774. (LogicalNotNode):
  7775. (BinaryOpNode):
  7776. (MultNode):
  7777. (DivNode):
  7778. (ModNode):
  7779. (AddNode):
  7780. (SubNode):
  7781. (LeftShiftNode):
  7782. (RightShiftNode):
  7783. (UnsignedRightShiftNode):
  7784. (LessNode):
  7785. (GreaterNode):
  7786. (LessEqNode):
  7787. (GreaterEqNode):
  7788. (ThrowableBinaryOpNode):
  7789. (InstanceOfNode):
  7790. (InNode):
  7791. (EqualNode):
  7792. (NotEqualNode):
  7793. (StrictEqualNode):
  7794. (NotStrictEqualNode):
  7795. (BitAndNode):
  7796. (BitOrNode):
  7797. (BitXOrNode):
  7798. (LogicalOpNode):
  7799. (ConditionalNode):
  7800. (ReadModifyResolveNode):
  7801. (AssignResolveNode):
  7802. (ReadModifyBracketNode):
  7803. (AssignBracketNode):
  7804. (AssignDotNode):
  7805. (ReadModifyDotNode):
  7806. (AssignErrorNode):
  7807. (CommaNode):
  7808. (ConstDeclNode):
  7809. (ConstStatementNode):
  7810. (BlockNode):
  7811. (EmptyStatementNode):
  7812. (DebuggerStatementNode):
  7813. (ExprStatementNode):
  7814. (VarStatementNode):
  7815. (IfNode):
  7816. (IfElseNode):
  7817. (DoWhileNode):
  7818. (WhileNode):
  7819. (ForNode):
  7820. (ForInNode):
  7821. (ContinueNode):
  7822. (BreakNode):
  7823. (ReturnNode):
  7824. (WithNode):
  7825. (LabelNode):
  7826. (ThrowNode):
  7827. (TryNode):
  7828. (ScopeNode):
  7829. (ProgramNode):
  7830. (EvalNode):
  7831. (FunctionBodyNode):
  7832. (FuncExprNode):
  7833. (FuncDeclNode):
  7834. (SwitchNode):
  7835. * parser/Parser.cpp:
  7836. (JSC::::parseSourceElements):
  7837. (JSC::::parseVarDeclaration):
  7838. (JSC::::parseConstDeclaration):
  7839. (JSC::::parseDoWhileStatement):
  7840. (JSC::::parseWhileStatement):
  7841. (JSC::::parseVarDeclarationList):
  7842. (JSC::::parseConstDeclarationList):
  7843. (JSC::::parseForStatement):
  7844. (JSC::::parseBreakStatement):
  7845. (JSC::::parseContinueStatement):
  7846. (JSC::::parseReturnStatement):
  7847. (JSC::::parseThrowStatement):
  7848. (JSC::::parseWithStatement):
  7849. (JSC::::parseSwitchStatement):
  7850. (JSC::::parseTryStatement):
  7851. (JSC::::parseDebuggerStatement):
  7852. (JSC::::parseBlockStatement):
  7853. (JSC::::parseStatement):
  7854. (JSC::::parseFunctionBody):
  7855. (JSC::::parseFunctionInfo):
  7856. (JSC::::parseFunctionDeclaration):
  7857. (JSC::::parseExpressionOrLabelStatement):
  7858. (JSC::::parseExpressionStatement):
  7859. (JSC::::parseIfStatement):
  7860. (JSC::::parseExpression):
  7861. (JSC::::parseAssignmentExpression):
  7862. (JSC::::parseConditionalExpression):
  7863. (JSC::::parseBinaryExpression):
  7864. (JSC::::parseProperty):
  7865. (JSC::::parseObjectLiteral):
  7866. (JSC::::parseStrictObjectLiteral):
  7867. (JSC::::parseArrayLiteral):
  7868. (JSC::::parsePrimaryExpression):
  7869. (JSC::::parseArguments):
  7870. (JSC::::parseMemberExpression):
  7871. (JSC::::parseUnaryExpression):
  7872. * parser/Parser.h:
  7873. (JSC::Parser::next):
  7874. (JSC::Parser::nextExpectIdentifier):
  7875. (JSC::Parser::tokenStart):
  7876. (JSC::Parser::tokenLine):
  7877. (JSC::Parser::tokenEnd):
  7878. (JSC::Parser::tokenLocation):
  7879. (Parser):
  7880. (JSC::Parser::getTokenName):
  7881. (JSC::::parse):
  7882. * parser/ParserTokens.h:
  7883. (JSC::JSTokenLocation::JSTokenLocation):
  7884. (JSTokenLocation):
  7885. (JSToken):
  7886. * parser/SourceProviderCacheItem.h:
  7887. (JSC::SourceProviderCacheItem::closeBraceToken):
  7888. * parser/SyntaxChecker.h:
  7889. (JSC::SyntaxChecker::makeFunctionCallNode):
  7890. (JSC::SyntaxChecker::createCommaExpr):
  7891. (JSC::SyntaxChecker::makeAssignNode):
  7892. (JSC::SyntaxChecker::makePrefixNode):
  7893. (JSC::SyntaxChecker::makePostfixNode):
  7894. (JSC::SyntaxChecker::makeTypeOfNode):
  7895. (JSC::SyntaxChecker::makeDeleteNode):
  7896. (JSC::SyntaxChecker::makeNegateNode):
  7897. (JSC::SyntaxChecker::makeBitwiseNotNode):
  7898. (JSC::SyntaxChecker::createLogicalNot):
  7899. (JSC::SyntaxChecker::createUnaryPlus):
  7900. (JSC::SyntaxChecker::createVoid):
  7901. (JSC::SyntaxChecker::thisExpr):
  7902. (JSC::SyntaxChecker::createResolve):
  7903. (JSC::SyntaxChecker::createObjectLiteral):
  7904. (JSC::SyntaxChecker::createArray):
  7905. (JSC::SyntaxChecker::createNumberExpr):
  7906. (JSC::SyntaxChecker::createString):
  7907. (JSC::SyntaxChecker::createBoolean):
  7908. (JSC::SyntaxChecker::createNull):
  7909. (JSC::SyntaxChecker::createBracketAccess):
  7910. (JSC::SyntaxChecker::createDotAccess):
  7911. (JSC::SyntaxChecker::createRegExp):
  7912. (JSC::SyntaxChecker::createNewExpr):
  7913. (JSC::SyntaxChecker::createConditionalExpr):
  7914. (JSC::SyntaxChecker::createAssignResolve):
  7915. (JSC::SyntaxChecker::createFunctionExpr):
  7916. (JSC::SyntaxChecker::createFunctionBody):
  7917. (JSC::SyntaxChecker::createArgumentsList):
  7918. (JSC::SyntaxChecker::createPropertyList):
  7919. (JSC::SyntaxChecker::createFuncDeclStatement):
  7920. (JSC::SyntaxChecker::createBlockStatement):
  7921. (JSC::SyntaxChecker::createExprStatement):
  7922. (JSC::SyntaxChecker::createIfStatement):
  7923. (JSC::SyntaxChecker::createForLoop):
  7924. (JSC::SyntaxChecker::createForInLoop):
  7925. (JSC::SyntaxChecker::createEmptyStatement):
  7926. (JSC::SyntaxChecker::createVarStatement):
  7927. (JSC::SyntaxChecker::createReturnStatement):
  7928. (JSC::SyntaxChecker::createBreakStatement):
  7929. (JSC::SyntaxChecker::createContinueStatement):
  7930. (JSC::SyntaxChecker::createTryStatement):
  7931. (JSC::SyntaxChecker::createSwitchStatement):
  7932. (JSC::SyntaxChecker::createWhileStatement):
  7933. (JSC::SyntaxChecker::createWithStatement):
  7934. (JSC::SyntaxChecker::createDoWhileStatement):
  7935. (JSC::SyntaxChecker::createLabelStatement):
  7936. (JSC::SyntaxChecker::createThrowStatement):
  7937. (JSC::SyntaxChecker::createDebugger):
  7938. (JSC::SyntaxChecker::createConstStatement):
  7939. (JSC::SyntaxChecker::appendConstDecl):
  7940. (JSC::SyntaxChecker::createGetterOrSetterProperty):
  7941. (JSC::SyntaxChecker::combineCommaNodes):
  7942. (JSC::SyntaxChecker::operatorStackPop):
  7943. 2012-08-03 Filip Pizlo <fpizlo@apple.com>
  7944. Crashes in dfgBuildPutByIdList when clicking on just about anything on Google Maps
  7945. https://bugs.webkit.org/show_bug.cgi?id=92691
  7946. Reviewed by Mark Hahnenberg.
  7947. The state of the stubs was changing after we determined the type (by virtue of the slow path
  7948. function that was called), since the get or put (in this case put) could cause arbitrary
  7949. side effects. Perhaps a full-blown fix would be to eliminate our reliance of the slow path
  7950. function to determine what to do, but an easier fix for now is to have the slow path give up
  7951. if its assumptions were invalidated by a side effect.
  7952. * dfg/DFGOperations.cpp:
  7953. * jit/JITStubs.cpp:
  7954. (JSC::DEFINE_STUB_FUNCTION):
  7955. 2012-08-03 Filip Pizlo <fpizlo@apple.com>
  7956. DFG handling of get_by_id should always inject a ForceOSRExit node if there is no prediction
  7957. https://bugs.webkit.org/show_bug.cgi?id=93162
  7958. Reviewed by Mark Hahnenberg.
  7959. This simplifies the DFG IR by ensuring that all nodes that use value profiles will be preceded
  7960. by a ForceOSRExit if the value profile had no data.
  7961. * dfg/DFGByteCodeParser.cpp:
  7962. (JSC::DFG::ByteCodeParser::parseBlock):
  7963. 2012-08-03 Filip Pizlo <fpizlo@apple.com>
  7964. DFG::StructureCheckHoistingPhase keeps a Node& around for too long
  7965. https://bugs.webkit.org/show_bug.cgi?id=93157
  7966. Reviewed by Mark Hahnenberg.
  7967. * dfg/DFGStructureCheckHoistingPhase.cpp:
  7968. (JSC::DFG::StructureCheckHoistingPhase::run):
  7969. 2012-08-02 Patrick Gansterer <paroga@webkit.org>
  7970. Move getLocalTime() as static inline function to DateMath
  7971. https://bugs.webkit.org/show_bug.cgi?id=92955
  7972. Reviewed by Ryosuke Niwa.
  7973. getCurrentLocalTime() and getLocalTime() has been superseded with the
  7974. GregorianDateTime class. So we can move it into DateMath.cpp as an static inline
  7975. function. This allows us to remove the dependecy on time() and localtime()
  7976. for Windows CE, where this functions require the ce_time library to work.
  7977. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  7978. 2012-08-02 Filip Pizlo <fpizlo@apple.com>
  7979. ASSERTION FAILED: at(m_compileIndex).canExit() || m_isCheckingArgumentTypes
  7980. https://bugs.webkit.org/show_bug.cgi?id=91074
  7981. Reviewed by Mark Hahnenberg.
  7982. Fixes a bug where the speculative JIT was performing an unnecessary speculation that the
  7983. CFA had proven shouldn't be performed, leading to asserts that a node should not have
  7984. exit sites. This is a debug-only assert with no release symptom - we were just emitting
  7985. a check that was not reachable.
  7986. Also found, and fixed, a bug where structure check hoisting was slightly confusing the
  7987. CFA by inserting GetLocal's into the graph. CSE would clean the GetLocal's up, which
  7988. would make the backend happy - but the CFA would produce subtly wrong results.
  7989. * bytecode/SpeculatedType.h:
  7990. (JSC::isOtherOrEmptySpeculation):
  7991. (JSC):
  7992. * dfg/DFGDriver.cpp:
  7993. (JSC::DFG::compile):
  7994. * dfg/DFGGraph.cpp:
  7995. (JSC::DFG::Graph::dump):
  7996. * dfg/DFGSpeculativeJIT64.cpp:
  7997. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  7998. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  7999. 2012-08-02 Filip Pizlo <fpizlo@apple.com>
  8000. Unreviewed, build fix for DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE).
  8001. * dfg/DFGStructureCheckHoistingPhase.cpp:
  8002. (JSC::DFG::StructureCheckHoistingPhase::run):
  8003. 2012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
  8004. Remove all uses of ClassInfo for JSStrings in JIT code
  8005. https://bugs.webkit.org/show_bug.cgi?id=92935
  8006. Reviewed by Geoffrey Garen.
  8007. This is the first step in removing our dependence on in-object ClassInfo pointers
  8008. in JIT code. Most of the changes are to check the Structure, which is unique for
  8009. JSString primitives.
  8010. * bytecode/SpeculatedType.cpp:
  8011. (JSC::speculationFromClassInfo):
  8012. (JSC::speculationFromStructure): Changed to check the TypeInfo in the Structure
  8013. since there wasn't a JSGlobalData immediately available to grab the JSString
  8014. Structure out of.
  8015. * dfg/DFGSpeculativeJIT.cpp:
  8016. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  8017. * dfg/DFGSpeculativeJIT32_64.cpp:
  8018. (JSC::DFG::SpeculativeJIT::compile):
  8019. * dfg/DFGSpeculativeJIT64.cpp:
  8020. (JSC::DFG::SpeculativeJIT::compile):
  8021. * jit/JITInlineMethods.h:
  8022. (JSC::JIT::emitLoadCharacterString):
  8023. * jit/JITOpcodes.cpp:
  8024. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8025. (JSC::JIT::emit_op_to_primitive):
  8026. (JSC::JIT::emit_op_convert_this):
  8027. * jit/JITOpcodes32_64.cpp:
  8028. (JSC::JIT::privateCompileCTIMachineTrampolines):
  8029. (JSC::JIT::emit_op_to_primitive):
  8030. (JSC::JIT::emitSlow_op_eq):
  8031. (JSC::JIT::emitSlow_op_neq):
  8032. (JSC::JIT::compileOpStrictEq):
  8033. (JSC::JIT::emit_op_convert_this):
  8034. * jit/JITPropertyAccess.cpp:
  8035. (JSC::JIT::stringGetByValStubGenerator):
  8036. (JSC::JIT::emitSlow_op_get_by_val):
  8037. * jit/JITPropertyAccess32_64.cpp:
  8038. (JSC::JIT::stringGetByValStubGenerator):
  8039. (JSC::JIT::emitSlow_op_get_by_val):
  8040. * jit/SpecializedThunkJIT.h:
  8041. (JSC::SpecializedThunkJIT::loadJSStringArgument):
  8042. * jit/ThunkGenerators.cpp:
  8043. (JSC::stringCharLoad):
  8044. (JSC::charCodeAtThunkGenerator):
  8045. (JSC::charAtThunkGenerator):
  8046. 2012-08-02 Filip Pizlo <fpizlo@apple.com>
  8047. Unreviewed, missed a style goof in the previous patch: "NodeIndex nodeIndex"
  8048. in a method signature is painfully redundant.
  8049. * dfg/DFGSpeculativeJIT.h:
  8050. (SpeculativeJIT):
  8051. 2012-08-02 Filip Pizlo <fpizlo@apple.com>
  8052. DFGSpeculativeJIT.h has too many inline method bodies
  8053. https://bugs.webkit.org/show_bug.cgi?id=92957
  8054. Reviewed by Antti Koivisto.
  8055. * dfg/DFGSpeculativeJIT.cpp:
  8056. (JSC::DFG::SpeculativeJIT::speculationCheck):
  8057. (DFG):
  8058. (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
  8059. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  8060. (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
  8061. (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
  8062. (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
  8063. * dfg/DFGSpeculativeJIT.h:
  8064. (SpeculativeJIT):
  8065. 2012-08-01 Sheriff Bot <webkit.review.bot@gmail.com>
  8066. Unreviewed, rolling out r124406.
  8067. http://trac.webkit.org/changeset/124406
  8068. https://bugs.webkit.org/show_bug.cgi?id=92951
  8069. it set the Mac bots on fire (Requested by pizlo on #webkit).
  8070. * bytecode/Opcode.h:
  8071. (JSC):
  8072. (JSC::padOpcodeName):
  8073. * bytecompiler/BytecodeGenerator.cpp:
  8074. (JSC::BytecodeGenerator::emitDebugHook):
  8075. * bytecompiler/BytecodeGenerator.h:
  8076. (BytecodeGenerator):
  8077. * bytecompiler/NodesCodegen.cpp:
  8078. (JSC::ArrayNode::toArgumentList):
  8079. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  8080. (JSC::ConditionalNode::emitBytecode):
  8081. (JSC::ConstStatementNode::emitBytecode):
  8082. (JSC::EmptyStatementNode::emitBytecode):
  8083. (JSC::DebuggerStatementNode::emitBytecode):
  8084. (JSC::ExprStatementNode::emitBytecode):
  8085. (JSC::VarStatementNode::emitBytecode):
  8086. (JSC::IfNode::emitBytecode):
  8087. (JSC::IfElseNode::emitBytecode):
  8088. (JSC::DoWhileNode::emitBytecode):
  8089. (JSC::WhileNode::emitBytecode):
  8090. (JSC::ForNode::emitBytecode):
  8091. (JSC::ForInNode::emitBytecode):
  8092. (JSC::ContinueNode::emitBytecode):
  8093. (JSC::BreakNode::emitBytecode):
  8094. (JSC::ReturnNode::emitBytecode):
  8095. (JSC::WithNode::emitBytecode):
  8096. (JSC::SwitchNode::emitBytecode):
  8097. (JSC::LabelNode::emitBytecode):
  8098. (JSC::ThrowNode::emitBytecode):
  8099. (JSC::TryNode::emitBytecode):
  8100. (JSC::ProgramNode::emitBytecode):
  8101. (JSC::EvalNode::emitBytecode):
  8102. (JSC::FunctionBodyNode::emitBytecode):
  8103. * debugger/Debugger.h:
  8104. * interpreter/Interpreter.cpp:
  8105. (JSC::Interpreter::unwindCallFrame):
  8106. (JSC::Interpreter::throwException):
  8107. (JSC::Interpreter::debug):
  8108. * interpreter/Interpreter.h:
  8109. (Interpreter):
  8110. * jit/JITOpcodes.cpp:
  8111. (JSC::JIT::emit_op_debug):
  8112. * jit/JITOpcodes32_64.cpp:
  8113. (JSC::JIT::emit_op_debug):
  8114. * jit/JITStubs.cpp:
  8115. (JSC::DEFINE_STUB_FUNCTION):
  8116. * llint/LLIntSlowPaths.cpp:
  8117. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  8118. * parser/ASTBuilder.h:
  8119. (ASTBuilder):
  8120. (JSC::ASTBuilder::createCommaExpr):
  8121. (JSC::ASTBuilder::createLogicalNot):
  8122. (JSC::ASTBuilder::createUnaryPlus):
  8123. (JSC::ASTBuilder::createVoid):
  8124. (JSC::ASTBuilder::thisExpr):
  8125. (JSC::ASTBuilder::createResolve):
  8126. (JSC::ASTBuilder::createObjectLiteral):
  8127. (JSC::ASTBuilder::createArray):
  8128. (JSC::ASTBuilder::createNumberExpr):
  8129. (JSC::ASTBuilder::createString):
  8130. (JSC::ASTBuilder::createBoolean):
  8131. (JSC::ASTBuilder::createNull):
  8132. (JSC::ASTBuilder::createBracketAccess):
  8133. (JSC::ASTBuilder::createDotAccess):
  8134. (JSC::ASTBuilder::createRegExp):
  8135. (JSC::ASTBuilder::createNewExpr):
  8136. (JSC::ASTBuilder::createConditionalExpr):
  8137. (JSC::ASTBuilder::createAssignResolve):
  8138. (JSC::ASTBuilder::createFunctionExpr):
  8139. (JSC::ASTBuilder::createFunctionBody):
  8140. (JSC::ASTBuilder::createGetterOrSetterProperty):
  8141. (JSC::ASTBuilder::createArgumentsList):
  8142. (JSC::ASTBuilder::createPropertyList):
  8143. (JSC::ASTBuilder::createFuncDeclStatement):
  8144. (JSC::ASTBuilder::createBlockStatement):
  8145. (JSC::ASTBuilder::createExprStatement):
  8146. (JSC::ASTBuilder::createIfStatement):
  8147. (JSC::ASTBuilder::createForLoop):
  8148. (JSC::ASTBuilder::createForInLoop):
  8149. (JSC::ASTBuilder::createEmptyStatement):
  8150. (JSC::ASTBuilder::createVarStatement):
  8151. (JSC::ASTBuilder::createReturnStatement):
  8152. (JSC::ASTBuilder::createBreakStatement):
  8153. (JSC::ASTBuilder::createContinueStatement):
  8154. (JSC::ASTBuilder::createTryStatement):
  8155. (JSC::ASTBuilder::createSwitchStatement):
  8156. (JSC::ASTBuilder::createWhileStatement):
  8157. (JSC::ASTBuilder::createDoWhileStatement):
  8158. (JSC::ASTBuilder::createLabelStatement):
  8159. (JSC::ASTBuilder::createWithStatement):
  8160. (JSC::ASTBuilder::createThrowStatement):
  8161. (JSC::ASTBuilder::createDebugger):
  8162. (JSC::ASTBuilder::createConstStatement):
  8163. (JSC::ASTBuilder::appendConstDecl):
  8164. (JSC::ASTBuilder::combineCommaNodes):
  8165. (JSC::ASTBuilder::appendBinaryOperation):
  8166. (JSC::ASTBuilder::createAssignment):
  8167. (JSC::ASTBuilder::createNumber):
  8168. (JSC::ASTBuilder::makeTypeOfNode):
  8169. (JSC::ASTBuilder::makeDeleteNode):
  8170. (JSC::ASTBuilder::makeNegateNode):
  8171. (JSC::ASTBuilder::makeBitwiseNotNode):
  8172. (JSC::ASTBuilder::makeMultNode):
  8173. (JSC::ASTBuilder::makeDivNode):
  8174. (JSC::ASTBuilder::makeModNode):
  8175. (JSC::ASTBuilder::makeAddNode):
  8176. (JSC::ASTBuilder::makeSubNode):
  8177. (JSC::ASTBuilder::makeLeftShiftNode):
  8178. (JSC::ASTBuilder::makeRightShiftNode):
  8179. (JSC::ASTBuilder::makeURightShiftNode):
  8180. (JSC::ASTBuilder::makeBitOrNode):
  8181. (JSC::ASTBuilder::makeBitAndNode):
  8182. (JSC::ASTBuilder::makeBitXOrNode):
  8183. (JSC::ASTBuilder::makeFunctionCallNode):
  8184. (JSC::ASTBuilder::makeBinaryNode):
  8185. (JSC::ASTBuilder::makeAssignNode):
  8186. (JSC::ASTBuilder::makePrefixNode):
  8187. (JSC::ASTBuilder::makePostfixNode):
  8188. * parser/Lexer.cpp:
  8189. (JSC::::setCode):
  8190. (JSC::::internalShift):
  8191. (JSC::::shift):
  8192. (JSC::::lex):
  8193. * parser/Lexer.h:
  8194. (Lexer):
  8195. (JSC::::lexExpectIdentifier):
  8196. * parser/NodeConstructors.h:
  8197. (JSC::Node::Node):
  8198. (JSC::ExpressionNode::ExpressionNode):
  8199. (JSC::StatementNode::StatementNode):
  8200. (JSC::NullNode::NullNode):
  8201. (JSC::BooleanNode::BooleanNode):
  8202. (JSC::NumberNode::NumberNode):
  8203. (JSC::StringNode::StringNode):
  8204. (JSC::RegExpNode::RegExpNode):
  8205. (JSC::ThisNode::ThisNode):
  8206. (JSC::ResolveNode::ResolveNode):
  8207. (JSC::ArrayNode::ArrayNode):
  8208. (JSC::PropertyListNode::PropertyListNode):
  8209. (JSC::ObjectLiteralNode::ObjectLiteralNode):
  8210. (JSC::BracketAccessorNode::BracketAccessorNode):
  8211. (JSC::DotAccessorNode::DotAccessorNode):
  8212. (JSC::ArgumentListNode::ArgumentListNode):
  8213. (JSC::NewExprNode::NewExprNode):
  8214. (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
  8215. (JSC::FunctionCallValueNode::FunctionCallValueNode):
  8216. (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
  8217. (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
  8218. (JSC::FunctionCallDotNode::FunctionCallDotNode):
  8219. (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
  8220. (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
  8221. (JSC::PrePostResolveNode::PrePostResolveNode):
  8222. (JSC::PostfixResolveNode::PostfixResolveNode):
  8223. (JSC::PostfixBracketNode::PostfixBracketNode):
  8224. (JSC::PostfixDotNode::PostfixDotNode):
  8225. (JSC::PostfixErrorNode::PostfixErrorNode):
  8226. (JSC::DeleteResolveNode::DeleteResolveNode):
  8227. (JSC::DeleteBracketNode::DeleteBracketNode):
  8228. (JSC::DeleteDotNode::DeleteDotNode):
  8229. (JSC::DeleteValueNode::DeleteValueNode):
  8230. (JSC::VoidNode::VoidNode):
  8231. (JSC::TypeOfResolveNode::TypeOfResolveNode):
  8232. (JSC::TypeOfValueNode::TypeOfValueNode):
  8233. (JSC::PrefixResolveNode::PrefixResolveNode):
  8234. (JSC::PrefixBracketNode::PrefixBracketNode):
  8235. (JSC::PrefixDotNode::PrefixDotNode):
  8236. (JSC::PrefixErrorNode::PrefixErrorNode):
  8237. (JSC::UnaryOpNode::UnaryOpNode):
  8238. (JSC::UnaryPlusNode::UnaryPlusNode):
  8239. (JSC::NegateNode::NegateNode):
  8240. (JSC::BitwiseNotNode::BitwiseNotNode):
  8241. (JSC::LogicalNotNode::LogicalNotNode):
  8242. (JSC::BinaryOpNode::BinaryOpNode):
  8243. (JSC::MultNode::MultNode):
  8244. (JSC::DivNode::DivNode):
  8245. (JSC::ModNode::ModNode):
  8246. (JSC::AddNode::AddNode):
  8247. (JSC::SubNode::SubNode):
  8248. (JSC::LeftShiftNode::LeftShiftNode):
  8249. (JSC::RightShiftNode::RightShiftNode):
  8250. (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
  8251. (JSC::LessNode::LessNode):
  8252. (JSC::GreaterNode::GreaterNode):
  8253. (JSC::LessEqNode::LessEqNode):
  8254. (JSC::GreaterEqNode::GreaterEqNode):
  8255. (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
  8256. (JSC::InstanceOfNode::InstanceOfNode):
  8257. (JSC::InNode::InNode):
  8258. (JSC::EqualNode::EqualNode):
  8259. (JSC::NotEqualNode::NotEqualNode):
  8260. (JSC::StrictEqualNode::StrictEqualNode):
  8261. (JSC::NotStrictEqualNode::NotStrictEqualNode):
  8262. (JSC::BitAndNode::BitAndNode):
  8263. (JSC::BitOrNode::BitOrNode):
  8264. (JSC::BitXOrNode::BitXOrNode):
  8265. (JSC::LogicalOpNode::LogicalOpNode):
  8266. (JSC::ConditionalNode::ConditionalNode):
  8267. (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
  8268. (JSC::AssignResolveNode::AssignResolveNode):
  8269. (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
  8270. (JSC::AssignBracketNode::AssignBracketNode):
  8271. (JSC::AssignDotNode::AssignDotNode):
  8272. (JSC::ReadModifyDotNode::ReadModifyDotNode):
  8273. (JSC::AssignErrorNode::AssignErrorNode):
  8274. (JSC::CommaNode::CommaNode):
  8275. (JSC::ConstStatementNode::ConstStatementNode):
  8276. (JSC::EmptyStatementNode::EmptyStatementNode):
  8277. (JSC::DebuggerStatementNode::DebuggerStatementNode):
  8278. (JSC::ExprStatementNode::ExprStatementNode):
  8279. (JSC::VarStatementNode::VarStatementNode):
  8280. (JSC::IfNode::IfNode):
  8281. (JSC::IfElseNode::IfElseNode):
  8282. (JSC::DoWhileNode::DoWhileNode):
  8283. (JSC::WhileNode::WhileNode):
  8284. (JSC::ForNode::ForNode):
  8285. (JSC::ContinueNode::ContinueNode):
  8286. (JSC::BreakNode::BreakNode):
  8287. (JSC::ReturnNode::ReturnNode):
  8288. (JSC::WithNode::WithNode):
  8289. (JSC::LabelNode::LabelNode):
  8290. (JSC::ThrowNode::ThrowNode):
  8291. (JSC::TryNode::TryNode):
  8292. (JSC::FuncExprNode::FuncExprNode):
  8293. (JSC::FuncDeclNode::FuncDeclNode):
  8294. (JSC::SwitchNode::SwitchNode):
  8295. (JSC::ConstDeclNode::ConstDeclNode):
  8296. (JSC::BlockNode::BlockNode):
  8297. (JSC::ForInNode::ForInNode):
  8298. * parser/Nodes.cpp:
  8299. (JSC):
  8300. (JSC::StatementNode::setLoc):
  8301. (JSC::ScopeNode::ScopeNode):
  8302. (JSC::ProgramNode::ProgramNode):
  8303. (JSC::ProgramNode::create):
  8304. (JSC::EvalNode::EvalNode):
  8305. (JSC::EvalNode::create):
  8306. (JSC::FunctionBodyNode::FunctionBodyNode):
  8307. (JSC::FunctionBodyNode::create):
  8308. * parser/Nodes.h:
  8309. (Node):
  8310. (ExpressionNode):
  8311. (StatementNode):
  8312. (NullNode):
  8313. (BooleanNode):
  8314. (NumberNode):
  8315. (StringNode):
  8316. (RegExpNode):
  8317. (ThisNode):
  8318. (ResolveNode):
  8319. (ArrayNode):
  8320. (PropertyListNode):
  8321. (ObjectLiteralNode):
  8322. (BracketAccessorNode):
  8323. (DotAccessorNode):
  8324. (ArgumentListNode):
  8325. (NewExprNode):
  8326. (EvalFunctionCallNode):
  8327. (FunctionCallValueNode):
  8328. (FunctionCallResolveNode):
  8329. (FunctionCallBracketNode):
  8330. (FunctionCallDotNode):
  8331. (CallFunctionCallDotNode):
  8332. (ApplyFunctionCallDotNode):
  8333. (PrePostResolveNode):
  8334. (PostfixResolveNode):
  8335. (PostfixBracketNode):
  8336. (PostfixDotNode):
  8337. (PostfixErrorNode):
  8338. (DeleteResolveNode):
  8339. (DeleteBracketNode):
  8340. (DeleteDotNode):
  8341. (DeleteValueNode):
  8342. (VoidNode):
  8343. (TypeOfResolveNode):
  8344. (TypeOfValueNode):
  8345. (PrefixResolveNode):
  8346. (PrefixBracketNode):
  8347. (PrefixDotNode):
  8348. (PrefixErrorNode):
  8349. (UnaryOpNode):
  8350. (UnaryPlusNode):
  8351. (NegateNode):
  8352. (BitwiseNotNode):
  8353. (LogicalNotNode):
  8354. (BinaryOpNode):
  8355. (MultNode):
  8356. (DivNode):
  8357. (ModNode):
  8358. (AddNode):
  8359. (SubNode):
  8360. (LeftShiftNode):
  8361. (RightShiftNode):
  8362. (UnsignedRightShiftNode):
  8363. (LessNode):
  8364. (GreaterNode):
  8365. (LessEqNode):
  8366. (GreaterEqNode):
  8367. (ThrowableBinaryOpNode):
  8368. (InstanceOfNode):
  8369. (InNode):
  8370. (EqualNode):
  8371. (NotEqualNode):
  8372. (StrictEqualNode):
  8373. (NotStrictEqualNode):
  8374. (BitAndNode):
  8375. (BitOrNode):
  8376. (BitXOrNode):
  8377. (LogicalOpNode):
  8378. (ConditionalNode):
  8379. (ReadModifyResolveNode):
  8380. (AssignResolveNode):
  8381. (ReadModifyBracketNode):
  8382. (AssignBracketNode):
  8383. (AssignDotNode):
  8384. (ReadModifyDotNode):
  8385. (AssignErrorNode):
  8386. (CommaNode):
  8387. (ConstDeclNode):
  8388. (ConstStatementNode):
  8389. (BlockNode):
  8390. (EmptyStatementNode):
  8391. (DebuggerStatementNode):
  8392. (ExprStatementNode):
  8393. (VarStatementNode):
  8394. (IfNode):
  8395. (IfElseNode):
  8396. (DoWhileNode):
  8397. (WhileNode):
  8398. (ForNode):
  8399. (ForInNode):
  8400. (ContinueNode):
  8401. (BreakNode):
  8402. (ReturnNode):
  8403. (WithNode):
  8404. (LabelNode):
  8405. (ThrowNode):
  8406. (TryNode):
  8407. (ScopeNode):
  8408. (ProgramNode):
  8409. (EvalNode):
  8410. (FunctionBodyNode):
  8411. (FuncExprNode):
  8412. (FuncDeclNode):
  8413. (SwitchNode):
  8414. * parser/Parser.cpp:
  8415. (JSC::::parseSourceElements):
  8416. (JSC::::parseVarDeclaration):
  8417. (JSC::::parseConstDeclaration):
  8418. (JSC::::parseDoWhileStatement):
  8419. (JSC::::parseWhileStatement):
  8420. (JSC::::parseVarDeclarationList):
  8421. (JSC::::parseConstDeclarationList):
  8422. (JSC::::parseForStatement):
  8423. (JSC::::parseBreakStatement):
  8424. (JSC::::parseContinueStatement):
  8425. (JSC::::parseReturnStatement):
  8426. (JSC::::parseThrowStatement):
  8427. (JSC::::parseWithStatement):
  8428. (JSC::::parseSwitchStatement):
  8429. (JSC::::parseTryStatement):
  8430. (JSC::::parseDebuggerStatement):
  8431. (JSC::::parseBlockStatement):
  8432. (JSC::::parseStatement):
  8433. (JSC::::parseFunctionBody):
  8434. (JSC::::parseFunctionInfo):
  8435. (JSC::::parseFunctionDeclaration):
  8436. (JSC::::parseExpressionOrLabelStatement):
  8437. (JSC::::parseExpressionStatement):
  8438. (JSC::::parseIfStatement):
  8439. (JSC::::parseExpression):
  8440. (JSC::::parseAssignmentExpression):
  8441. (JSC::::parseConditionalExpression):
  8442. (JSC::::parseBinaryExpression):
  8443. (JSC::::parseProperty):
  8444. (JSC::::parseObjectLiteral):
  8445. (JSC::::parseStrictObjectLiteral):
  8446. (JSC::::parseArrayLiteral):
  8447. (JSC::::parsePrimaryExpression):
  8448. (JSC::::parseArguments):
  8449. (JSC::::parseMemberExpression):
  8450. (JSC::::parseUnaryExpression):
  8451. * parser/Parser.h:
  8452. (JSC::Parser::next):
  8453. (JSC::Parser::nextExpectIdentifier):
  8454. (JSC::Parser::tokenStart):
  8455. (JSC::Parser::tokenLine):
  8456. (JSC::Parser::tokenEnd):
  8457. (JSC::Parser::getTokenName):
  8458. (JSC::::parse):
  8459. * parser/ParserTokens.h:
  8460. (JSC::JSTokenInfo::JSTokenInfo):
  8461. (JSTokenInfo):
  8462. (JSToken):
  8463. * parser/SourceProviderCacheItem.h:
  8464. (JSC::SourceProviderCacheItem::closeBraceToken):
  8465. * parser/SyntaxChecker.h:
  8466. (JSC::SyntaxChecker::makeFunctionCallNode):
  8467. (JSC::SyntaxChecker::createCommaExpr):
  8468. (JSC::SyntaxChecker::makeAssignNode):
  8469. (JSC::SyntaxChecker::makePrefixNode):
  8470. (JSC::SyntaxChecker::makePostfixNode):
  8471. (JSC::SyntaxChecker::makeTypeOfNode):
  8472. (JSC::SyntaxChecker::makeDeleteNode):
  8473. (JSC::SyntaxChecker::makeNegateNode):
  8474. (JSC::SyntaxChecker::makeBitwiseNotNode):
  8475. (JSC::SyntaxChecker::createLogicalNot):
  8476. (JSC::SyntaxChecker::createUnaryPlus):
  8477. (JSC::SyntaxChecker::createVoid):
  8478. (JSC::SyntaxChecker::thisExpr):
  8479. (JSC::SyntaxChecker::createResolve):
  8480. (JSC::SyntaxChecker::createObjectLiteral):
  8481. (JSC::SyntaxChecker::createArray):
  8482. (JSC::SyntaxChecker::createNumberExpr):
  8483. (JSC::SyntaxChecker::createString):
  8484. (JSC::SyntaxChecker::createBoolean):
  8485. (JSC::SyntaxChecker::createNull):
  8486. (JSC::SyntaxChecker::createBracketAccess):
  8487. (JSC::SyntaxChecker::createDotAccess):
  8488. (JSC::SyntaxChecker::createRegExp):
  8489. (JSC::SyntaxChecker::createNewExpr):
  8490. (JSC::SyntaxChecker::createConditionalExpr):
  8491. (JSC::SyntaxChecker::createAssignResolve):
  8492. (JSC::SyntaxChecker::createFunctionExpr):
  8493. (JSC::SyntaxChecker::createFunctionBody):
  8494. (JSC::SyntaxChecker::createArgumentsList):
  8495. (JSC::SyntaxChecker::createPropertyList):
  8496. (JSC::SyntaxChecker::createFuncDeclStatement):
  8497. (JSC::SyntaxChecker::createBlockStatement):
  8498. (JSC::SyntaxChecker::createExprStatement):
  8499. (JSC::SyntaxChecker::createIfStatement):
  8500. (JSC::SyntaxChecker::createForLoop):
  8501. (JSC::SyntaxChecker::createForInLoop):
  8502. (JSC::SyntaxChecker::createEmptyStatement):
  8503. (JSC::SyntaxChecker::createVarStatement):
  8504. (JSC::SyntaxChecker::createReturnStatement):
  8505. (JSC::SyntaxChecker::createBreakStatement):
  8506. (JSC::SyntaxChecker::createContinueStatement):
  8507. (JSC::SyntaxChecker::createTryStatement):
  8508. (JSC::SyntaxChecker::createSwitchStatement):
  8509. (JSC::SyntaxChecker::createWhileStatement):
  8510. (JSC::SyntaxChecker::createWithStatement):
  8511. (JSC::SyntaxChecker::createDoWhileStatement):
  8512. (JSC::SyntaxChecker::createLabelStatement):
  8513. (JSC::SyntaxChecker::createThrowStatement):
  8514. (JSC::SyntaxChecker::createDebugger):
  8515. (JSC::SyntaxChecker::createConstStatement):
  8516. (JSC::SyntaxChecker::appendConstDecl):
  8517. (JSC::SyntaxChecker::createGetterOrSetterProperty):
  8518. (JSC::SyntaxChecker::combineCommaNodes):
  8519. (JSC::SyntaxChecker::operatorStackPop):
  8520. 2012-08-01 Peter Wang <peter.wang@torchmobile.com.cn>
  8521. Web Inspector: [JSC] implement setting breakpoints by line:column
  8522. https://bugs.webkit.org/show_bug.cgi?id=53003
  8523. Reviewed by Geoffrey Garen.
  8524. Add a counter in lexer to record the column of each token. Debugger will use column info
  8525. in "Pretty Print" debug mode of Inspector.
  8526. * bytecode/Opcode.h:
  8527. (JSC):
  8528. (JSC::padOpcodeName):
  8529. * bytecompiler/BytecodeGenerator.cpp:
  8530. (JSC::BytecodeGenerator::emitDebugHook):
  8531. * bytecompiler/BytecodeGenerator.h:
  8532. (BytecodeGenerator):
  8533. * bytecompiler/NodesCodegen.cpp:
  8534. (JSC::ArrayNode::toArgumentList):
  8535. (JSC::ApplyFunctionCallDotNode::emitBytecode):
  8536. (JSC::ConditionalNode::emitBytecode):
  8537. (JSC::ConstStatementNode::emitBytecode):
  8538. (JSC::EmptyStatementNode::emitBytecode):
  8539. (JSC::DebuggerStatementNode::emitBytecode):
  8540. (JSC::ExprStatementNode::emitBytecode):
  8541. (JSC::VarStatementNode::emitBytecode):
  8542. (JSC::IfNode::emitBytecode):
  8543. (JSC::IfElseNode::emitBytecode):
  8544. (JSC::DoWhileNode::emitBytecode):
  8545. (JSC::WhileNode::emitBytecode):
  8546. (JSC::ForNode::emitBytecode):
  8547. (JSC::ForInNode::emitBytecode):
  8548. (JSC::ContinueNode::emitBytecode):
  8549. (JSC::BreakNode::emitBytecode):
  8550. (JSC::ReturnNode::emitBytecode):
  8551. (JSC::WithNode::emitBytecode):
  8552. (JSC::SwitchNode::emitBytecode):
  8553. (JSC::LabelNode::emitBytecode):
  8554. (JSC::ThrowNode::emitBytecode):
  8555. (JSC::TryNode::emitBytecode):
  8556. (JSC::ProgramNode::emitBytecode):
  8557. (JSC::EvalNode::emitBytecode):
  8558. (JSC::FunctionBodyNode::emitBytecode):
  8559. * debugger/Debugger.h:
  8560. * interpreter/Interpreter.cpp:
  8561. (JSC::Interpreter::unwindCallFrame):
  8562. (JSC::Interpreter::throwException):
  8563. (JSC::Interpreter::debug):
  8564. * interpreter/Interpreter.h:
  8565. (Interpreter):
  8566. * jit/JITOpcodes.cpp:
  8567. (JSC::JIT::emit_op_debug):
  8568. * jit/JITOpcodes32_64.cpp:
  8569. (JSC::JIT::emit_op_debug):
  8570. * jit/JITStubs.cpp:
  8571. (JSC::DEFINE_STUB_FUNCTION):
  8572. * llint/LLIntSlowPaths.cpp:
  8573. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  8574. * parser/ASTBuilder.h:
  8575. (ASTBuilder):
  8576. (JSC::ASTBuilder::createCommaExpr):
  8577. (JSC::ASTBuilder::createLogicalNot):
  8578. (JSC::ASTBuilder::createUnaryPlus):
  8579. (JSC::ASTBuilder::createVoid):
  8580. (JSC::ASTBuilder::thisExpr):
  8581. (JSC::ASTBuilder::createResolve):
  8582. (JSC::ASTBuilder::createObjectLiteral):
  8583. (JSC::ASTBuilder::createArray):
  8584. (JSC::ASTBuilder::createNumberExpr):
  8585. (JSC::ASTBuilder::createString):
  8586. (JSC::ASTBuilder::createBoolean):
  8587. (JSC::ASTBuilder::createNull):
  8588. (JSC::ASTBuilder::createBracketAccess):
  8589. (JSC::ASTBuilder::createDotAccess):
  8590. (JSC::ASTBuilder::createRegExp):
  8591. (JSC::ASTBuilder::createNewExpr):
  8592. (JSC::ASTBuilder::createConditionalExpr):
  8593. (JSC::ASTBuilder::createAssignResolve):
  8594. (JSC::ASTBuilder::createFunctionExpr):
  8595. (JSC::ASTBuilder::createFunctionBody):
  8596. (JSC::ASTBuilder::createGetterOrSetterProperty):
  8597. (JSC::ASTBuilder::createArgumentsList):
  8598. (JSC::ASTBuilder::createPropertyList):
  8599. (JSC::ASTBuilder::createFuncDeclStatement):
  8600. (JSC::ASTBuilder::createBlockStatement):
  8601. (JSC::ASTBuilder::createExprStatement):
  8602. (JSC::ASTBuilder::createIfStatement):
  8603. (JSC::ASTBuilder::createForLoop):
  8604. (JSC::ASTBuilder::createForInLoop):
  8605. (JSC::ASTBuilder::createEmptyStatement):
  8606. (JSC::ASTBuilder::createVarStatement):
  8607. (JSC::ASTBuilder::createReturnStatement):
  8608. (JSC::ASTBuilder::createBreakStatement):
  8609. (JSC::ASTBuilder::createContinueStatement):
  8610. (JSC::ASTBuilder::createTryStatement):
  8611. (JSC::ASTBuilder::createSwitchStatement):
  8612. (JSC::ASTBuilder::createWhileStatement):
  8613. (JSC::ASTBuilder::createDoWhileStatement):
  8614. (JSC::ASTBuilder::createLabelStatement):
  8615. (JSC::ASTBuilder::createWithStatement):
  8616. (JSC::ASTBuilder::createThrowStatement):
  8617. (JSC::ASTBuilder::createDebugger):
  8618. (JSC::ASTBuilder::createConstStatement):
  8619. (JSC::ASTBuilder::appendConstDecl):
  8620. (JSC::ASTBuilder::combineCommaNodes):
  8621. (JSC::ASTBuilder::appendBinaryOperation):
  8622. (JSC::ASTBuilder::createAssignment):
  8623. (JSC::ASTBuilder::createNumber):
  8624. (JSC::ASTBuilder::makeTypeOfNode):
  8625. (JSC::ASTBuilder::makeDeleteNode):
  8626. (JSC::ASTBuilder::makeNegateNode):
  8627. (JSC::ASTBuilder::makeBitwiseNotNode):
  8628. (JSC::ASTBuilder::makeMultNode):
  8629. (JSC::ASTBuilder::makeDivNode):
  8630. (JSC::ASTBuilder::makeModNode):
  8631. (JSC::ASTBuilder::makeAddNode):
  8632. (JSC::ASTBuilder::makeSubNode):
  8633. (JSC::ASTBuilder::makeLeftShiftNode):
  8634. (JSC::ASTBuilder::makeRightShiftNode):
  8635. (JSC::ASTBuilder::makeURightShiftNode):
  8636. (JSC::ASTBuilder::makeBitOrNode):
  8637. (JSC::ASTBuilder::makeBitAndNode):
  8638. (JSC::ASTBuilder::makeBitXOrNode):
  8639. (JSC::ASTBuilder::makeFunctionCallNode):
  8640. (JSC::ASTBuilder::makeBinaryNode):
  8641. (JSC::ASTBuilder::makeAssignNode):
  8642. (JSC::ASTBuilder::makePrefixNode):
  8643. (JSC::ASTBuilder::makePostfixNode):
  8644. * parser/Lexer.cpp:
  8645. (JSC::::setCode):
  8646. (JSC::::internalShift):
  8647. (JSC::::shift):
  8648. (JSC::::lex):
  8649. * parser/Lexer.h:
  8650. (Lexer):
  8651. (JSC::Lexer::currentColumnNumber):
  8652. (JSC::::lexExpectIdentifier):
  8653. * parser/NodeConstructors.h:
  8654. (JSC::Node::Node):
  8655. (JSC::ExpressionNode::ExpressionNode):
  8656. (JSC::StatementNode::StatementNode):
  8657. (JSC::NullNode::NullNode):
  8658. (JSC::BooleanNode::BooleanNode):
  8659. (JSC::NumberNode::NumberNode):
  8660. (JSC::StringNode::StringNode):
  8661. (JSC::RegExpNode::RegExpNode):
  8662. (JSC::ThisNode::ThisNode):
  8663. (JSC::ResolveNode::ResolveNode):
  8664. (JSC::ArrayNode::ArrayNode):
  8665. (JSC::PropertyListNode::PropertyListNode):
  8666. (JSC::ObjectLiteralNode::ObjectLiteralNode):
  8667. (JSC::BracketAccessorNode::BracketAccessorNode):
  8668. (JSC::DotAccessorNode::DotAccessorNode):
  8669. (JSC::ArgumentListNode::ArgumentListNode):
  8670. (JSC::NewExprNode::NewExprNode):
  8671. (JSC::EvalFunctionCallNode::EvalFunctionCallNode):
  8672. (JSC::FunctionCallValueNode::FunctionCallValueNode):
  8673. (JSC::FunctionCallResolveNode::FunctionCallResolveNode):
  8674. (JSC::FunctionCallBracketNode::FunctionCallBracketNode):
  8675. (JSC::FunctionCallDotNode::FunctionCallDotNode):
  8676. (JSC::CallFunctionCallDotNode::CallFunctionCallDotNode):
  8677. (JSC::ApplyFunctionCallDotNode::ApplyFunctionCallDotNode):
  8678. (JSC::PrePostResolveNode::PrePostResolveNode):
  8679. (JSC::PostfixResolveNode::PostfixResolveNode):
  8680. (JSC::PostfixBracketNode::PostfixBracketNode):
  8681. (JSC::PostfixDotNode::PostfixDotNode):
  8682. (JSC::PostfixErrorNode::PostfixErrorNode):
  8683. (JSC::DeleteResolveNode::DeleteResolveNode):
  8684. (JSC::DeleteBracketNode::DeleteBracketNode):
  8685. (JSC::DeleteDotNode::DeleteDotNode):
  8686. (JSC::DeleteValueNode::DeleteValueNode):
  8687. (JSC::VoidNode::VoidNode):
  8688. (JSC::TypeOfResolveNode::TypeOfResolveNode):
  8689. (JSC::TypeOfValueNode::TypeOfValueNode):
  8690. (JSC::PrefixResolveNode::PrefixResolveNode):
  8691. (JSC::PrefixBracketNode::PrefixBracketNode):
  8692. (JSC::PrefixDotNode::PrefixDotNode):
  8693. (JSC::PrefixErrorNode::PrefixErrorNode):
  8694. (JSC::UnaryOpNode::UnaryOpNode):
  8695. (JSC::UnaryPlusNode::UnaryPlusNode):
  8696. (JSC::NegateNode::NegateNode):
  8697. (JSC::BitwiseNotNode::BitwiseNotNode):
  8698. (JSC::LogicalNotNode::LogicalNotNode):
  8699. (JSC::BinaryOpNode::BinaryOpNode):
  8700. (JSC::MultNode::MultNode):
  8701. (JSC::DivNode::DivNode):
  8702. (JSC::ModNode::ModNode):
  8703. (JSC::AddNode::AddNode):
  8704. (JSC::SubNode::SubNode):
  8705. (JSC::LeftShiftNode::LeftShiftNode):
  8706. (JSC::RightShiftNode::RightShiftNode):
  8707. (JSC::UnsignedRightShiftNode::UnsignedRightShiftNode):
  8708. (JSC::LessNode::LessNode):
  8709. (JSC::GreaterNode::GreaterNode):
  8710. (JSC::LessEqNode::LessEqNode):
  8711. (JSC::GreaterEqNode::GreaterEqNode):
  8712. (JSC::ThrowableBinaryOpNode::ThrowableBinaryOpNode):
  8713. (JSC::InstanceOfNode::InstanceOfNode):
  8714. (JSC::InNode::InNode):
  8715. (JSC::EqualNode::EqualNode):
  8716. (JSC::NotEqualNode::NotEqualNode):
  8717. (JSC::StrictEqualNode::StrictEqualNode):
  8718. (JSC::NotStrictEqualNode::NotStrictEqualNode):
  8719. (JSC::BitAndNode::BitAndNode):
  8720. (JSC::BitOrNode::BitOrNode):
  8721. (JSC::BitXOrNode::BitXOrNode):
  8722. (JSC::LogicalOpNode::LogicalOpNode):
  8723. (JSC::ConditionalNode::ConditionalNode):
  8724. (JSC::ReadModifyResolveNode::ReadModifyResolveNode):
  8725. (JSC::AssignResolveNode::AssignResolveNode):
  8726. (JSC::ReadModifyBracketNode::ReadModifyBracketNode):
  8727. (JSC::AssignBracketNode::AssignBracketNode):
  8728. (JSC::AssignDotNode::AssignDotNode):
  8729. (JSC::ReadModifyDotNode::ReadModifyDotNode):
  8730. (JSC::AssignErrorNode::AssignErrorNode):
  8731. (JSC::CommaNode::CommaNode):
  8732. (JSC::ConstStatementNode::ConstStatementNode):
  8733. (JSC::EmptyStatementNode::EmptyStatementNode):
  8734. (JSC::DebuggerStatementNode::DebuggerStatementNode):
  8735. (JSC::ExprStatementNode::ExprStatementNode):
  8736. (JSC::VarStatementNode::VarStatementNode):
  8737. (JSC::IfNode::IfNode):
  8738. (JSC::IfElseNode::IfElseNode):
  8739. (JSC::DoWhileNode::DoWhileNode):
  8740. (JSC::WhileNode::WhileNode):
  8741. (JSC::ForNode::ForNode):
  8742. (JSC::ContinueNode::ContinueNode):
  8743. (JSC::BreakNode::BreakNode):
  8744. (JSC::ReturnNode::ReturnNode):
  8745. (JSC::WithNode::WithNode):
  8746. (JSC::LabelNode::LabelNode):
  8747. (JSC::ThrowNode::ThrowNode):
  8748. (JSC::TryNode::TryNode):
  8749. (JSC::FuncExprNode::FuncExprNode):
  8750. (JSC::FuncDeclNode::FuncDeclNode):
  8751. (JSC::SwitchNode::SwitchNode):
  8752. (JSC::ConstDeclNode::ConstDeclNode):
  8753. (JSC::BlockNode::BlockNode):
  8754. (JSC::ForInNode::ForInNode):
  8755. * parser/Nodes.cpp:
  8756. (JSC::StatementNode::setLoc):
  8757. (JSC):
  8758. (JSC::ScopeNode::ScopeNode):
  8759. (JSC::ProgramNode::ProgramNode):
  8760. (JSC::ProgramNode::create):
  8761. (JSC::EvalNode::EvalNode):
  8762. (JSC::EvalNode::create):
  8763. (JSC::FunctionBodyNode::FunctionBodyNode):
  8764. (JSC::FunctionBodyNode::create):
  8765. * parser/Nodes.h:
  8766. (Node):
  8767. (JSC::Node::columnNo):
  8768. (ExpressionNode):
  8769. (StatementNode):
  8770. (JSC::StatementNode::column):
  8771. (NullNode):
  8772. (BooleanNode):
  8773. (NumberNode):
  8774. (StringNode):
  8775. (RegExpNode):
  8776. (ThisNode):
  8777. (ResolveNode):
  8778. (ArrayNode):
  8779. (PropertyListNode):
  8780. (ObjectLiteralNode):
  8781. (BracketAccessorNode):
  8782. (DotAccessorNode):
  8783. (ArgumentListNode):
  8784. (NewExprNode):
  8785. (EvalFunctionCallNode):
  8786. (FunctionCallValueNode):
  8787. (FunctionCallResolveNode):
  8788. (FunctionCallBracketNode):
  8789. (FunctionCallDotNode):
  8790. (CallFunctionCallDotNode):
  8791. (ApplyFunctionCallDotNode):
  8792. (PrePostResolveNode):
  8793. (PostfixResolveNode):
  8794. (PostfixBracketNode):
  8795. (PostfixDotNode):
  8796. (PostfixErrorNode):
  8797. (DeleteResolveNode):
  8798. (DeleteBracketNode):
  8799. (DeleteDotNode):
  8800. (DeleteValueNode):
  8801. (VoidNode):
  8802. (TypeOfResolveNode):
  8803. (TypeOfValueNode):
  8804. (PrefixResolveNode):
  8805. (PrefixBracketNode):
  8806. (PrefixDotNode):
  8807. (PrefixErrorNode):
  8808. (UnaryOpNode):
  8809. (UnaryPlusNode):
  8810. (NegateNode):
  8811. (BitwiseNotNode):
  8812. (LogicalNotNode):
  8813. (BinaryOpNode):
  8814. (MultNode):
  8815. (DivNode):
  8816. (ModNode):
  8817. (AddNode):
  8818. (SubNode):
  8819. (LeftShiftNode):
  8820. (RightShiftNode):
  8821. (UnsignedRightShiftNode):
  8822. (LessNode):
  8823. (GreaterNode):
  8824. (LessEqNode):
  8825. (GreaterEqNode):
  8826. (ThrowableBinaryOpNode):
  8827. (InstanceOfNode):
  8828. (InNode):
  8829. (EqualNode):
  8830. (NotEqualNode):
  8831. (StrictEqualNode):
  8832. (NotStrictEqualNode):
  8833. (BitAndNode):
  8834. (BitOrNode):
  8835. (BitXOrNode):
  8836. (LogicalOpNode):
  8837. (ConditionalNode):
  8838. (ReadModifyResolveNode):
  8839. (AssignResolveNode):
  8840. (ReadModifyBracketNode):
  8841. (AssignBracketNode):
  8842. (AssignDotNode):
  8843. (ReadModifyDotNode):
  8844. (AssignErrorNode):
  8845. (CommaNode):
  8846. (ConstDeclNode):
  8847. (ConstStatementNode):
  8848. (BlockNode):
  8849. (EmptyStatementNode):
  8850. (DebuggerStatementNode):
  8851. (ExprStatementNode):
  8852. (VarStatementNode):
  8853. (IfNode):
  8854. (IfElseNode):
  8855. (DoWhileNode):
  8856. (WhileNode):
  8857. (ForNode):
  8858. (ForInNode):
  8859. (ContinueNode):
  8860. (BreakNode):
  8861. (ReturnNode):
  8862. (WithNode):
  8863. (LabelNode):
  8864. (ThrowNode):
  8865. (TryNode):
  8866. (ScopeNode):
  8867. (ProgramNode):
  8868. (EvalNode):
  8869. (FunctionBodyNode):
  8870. (FuncExprNode):
  8871. (FuncDeclNode):
  8872. (SwitchNode):
  8873. * parser/Parser.cpp:
  8874. (JSC::::parseSourceElements):
  8875. (JSC::::parseVarDeclaration):
  8876. (JSC::::parseConstDeclaration):
  8877. (JSC::::parseDoWhileStatement):
  8878. (JSC::::parseWhileStatement):
  8879. (JSC::::parseVarDeclarationList):
  8880. (JSC::::parseConstDeclarationList):
  8881. (JSC::::parseForStatement):
  8882. (JSC::::parseBreakStatement):
  8883. (JSC::::parseContinueStatement):
  8884. (JSC::::parseReturnStatement):
  8885. (JSC::::parseThrowStatement):
  8886. (JSC::::parseWithStatement):
  8887. (JSC::::parseSwitchStatement):
  8888. (JSC::::parseTryStatement):
  8889. (JSC::::parseDebuggerStatement):
  8890. (JSC::::parseBlockStatement):
  8891. (JSC::::parseStatement):
  8892. (JSC::::parseFunctionBody):
  8893. (JSC::::parseFunctionInfo):
  8894. (JSC::::parseFunctionDeclaration):
  8895. (JSC::::parseExpressionOrLabelStatement):
  8896. (JSC::::parseExpressionStatement):
  8897. (JSC::::parseIfStatement):
  8898. (JSC::::parseExpression):
  8899. (JSC::::parseAssignmentExpression):
  8900. (JSC::::parseConditionalExpression):
  8901. (JSC::::parseBinaryExpression):
  8902. (JSC::::parseProperty):
  8903. (JSC::::parseObjectLiteral):
  8904. (JSC::::parseStrictObjectLiteral):
  8905. (JSC::::parseArrayLiteral):
  8906. (JSC::::parsePrimaryExpression):
  8907. (JSC::::parseArguments):
  8908. (JSC::::parseMemberExpression):
  8909. (JSC::::parseUnaryExpression):
  8910. * parser/Parser.h:
  8911. (JSC::Parser::next):
  8912. (JSC::Parser::nextExpectIdentifier):
  8913. (JSC::Parser::tokenStart):
  8914. (JSC::Parser::tokenLine):
  8915. (JSC::Parser::tokenEnd):
  8916. (JSC::Parser::tokenLocation):
  8917. (Parser):
  8918. (JSC::Parser::getTokenName):
  8919. (JSC::::parse):
  8920. * parser/ParserTokens.h:
  8921. (JSC::JSTokenLocation::JSTokenLocation):
  8922. (JSTokenLocation):
  8923. (JSToken):
  8924. * parser/SourceProviderCacheItem.h:
  8925. (JSC::SourceProviderCacheItem::closeBraceToken):
  8926. * parser/SyntaxChecker.h:
  8927. (JSC::SyntaxChecker::makeFunctionCallNode):
  8928. (JSC::SyntaxChecker::createCommaExpr):
  8929. (JSC::SyntaxChecker::makeAssignNode):
  8930. (JSC::SyntaxChecker::makePrefixNode):
  8931. (JSC::SyntaxChecker::makePostfixNode):
  8932. (JSC::SyntaxChecker::makeTypeOfNode):
  8933. (JSC::SyntaxChecker::makeDeleteNode):
  8934. (JSC::SyntaxChecker::makeNegateNode):
  8935. (JSC::SyntaxChecker::makeBitwiseNotNode):
  8936. (JSC::SyntaxChecker::createLogicalNot):
  8937. (JSC::SyntaxChecker::createUnaryPlus):
  8938. (JSC::SyntaxChecker::createVoid):
  8939. (JSC::SyntaxChecker::thisExpr):
  8940. (JSC::SyntaxChecker::createResolve):
  8941. (JSC::SyntaxChecker::createObjectLiteral):
  8942. (JSC::SyntaxChecker::createArray):
  8943. (JSC::SyntaxChecker::createNumberExpr):
  8944. (JSC::SyntaxChecker::createString):
  8945. (JSC::SyntaxChecker::createBoolean):
  8946. (JSC::SyntaxChecker::createNull):
  8947. (JSC::SyntaxChecker::createBracketAccess):
  8948. (JSC::SyntaxChecker::createDotAccess):
  8949. (JSC::SyntaxChecker::createRegExp):
  8950. (JSC::SyntaxChecker::createNewExpr):
  8951. (JSC::SyntaxChecker::createConditionalExpr):
  8952. (JSC::SyntaxChecker::createAssignResolve):
  8953. (JSC::SyntaxChecker::createFunctionExpr):
  8954. (JSC::SyntaxChecker::createFunctionBody):
  8955. (JSC::SyntaxChecker::createArgumentsList):
  8956. (JSC::SyntaxChecker::createPropertyList):
  8957. (JSC::SyntaxChecker::createFuncDeclStatement):
  8958. (JSC::SyntaxChecker::createBlockStatement):
  8959. (JSC::SyntaxChecker::createExprStatement):
  8960. (JSC::SyntaxChecker::createIfStatement):
  8961. (JSC::SyntaxChecker::createForLoop):
  8962. (JSC::SyntaxChecker::createForInLoop):
  8963. (JSC::SyntaxChecker::createEmptyStatement):
  8964. (JSC::SyntaxChecker::createVarStatement):
  8965. (JSC::SyntaxChecker::createReturnStatement):
  8966. (JSC::SyntaxChecker::createBreakStatement):
  8967. (JSC::SyntaxChecker::createContinueStatement):
  8968. (JSC::SyntaxChecker::createTryStatement):
  8969. (JSC::SyntaxChecker::createSwitchStatement):
  8970. (JSC::SyntaxChecker::createWhileStatement):
  8971. (JSC::SyntaxChecker::createWithStatement):
  8972. (JSC::SyntaxChecker::createDoWhileStatement):
  8973. (JSC::SyntaxChecker::createLabelStatement):
  8974. (JSC::SyntaxChecker::createThrowStatement):
  8975. (JSC::SyntaxChecker::createDebugger):
  8976. (JSC::SyntaxChecker::createConstStatement):
  8977. (JSC::SyntaxChecker::appendConstDecl):
  8978. (JSC::SyntaxChecker::createGetterOrSetterProperty):
  8979. (JSC::SyntaxChecker::combineCommaNodes):
  8980. (JSC::SyntaxChecker::operatorStackPop):
  8981. 2012-08-01 Filip Pizlo <fpizlo@apple.com>
  8982. DFG should hoist structure checks
  8983. https://bugs.webkit.org/show_bug.cgi?id=92696
  8984. Reviewed by Gavin Barraclough.
  8985. This hoists structure checks in the same way that we would hoist array checks, but with added
  8986. complexity to cope with the fact that the structure of an object may change. This is handled
  8987. by performing a side effects analysis over the region in which the respective variable is
  8988. live. If a structure clobbering side effect may happen then we either hoist the structure
  8989. checks and fall back on structure transition watchpoints (if the watchpoint set is still
  8990. valid), or we avoid hoisting altogether.
  8991. Doing this required teaching the CFA that we may have an expectation that an object has a
  8992. particular structure even after structure clobbering happens, in the sense that structure
  8993. proofs that were cobbered can be revived using watchpoints. CFA must know about this so that
  8994. OSR entry may know about it, since we cannot allow entry to happen if the variable has a
  8995. clobbered structure proof, will have a watchpoint to revive the proof, and the variable in
  8996. the baseline JIT has a completely unrelated structure.
  8997. This is mostly performance neutral.
  8998. * CMakeLists.txt:
  8999. * GNUmakefile.list.am:
  9000. * JavaScriptCore.xcodeproj/project.pbxproj:
  9001. * Target.pri:
  9002. * bytecode/ValueRecovery.h:
  9003. (JSC::ValueRecovery::isSet):
  9004. (JSC::ValueRecovery::operator!):
  9005. (ValueRecovery):
  9006. * dfg/DFGAbstractState.cpp:
  9007. (JSC::DFG::AbstractState::execute):
  9008. (JSC::DFG::AbstractState::clobberWorld):
  9009. (DFG):
  9010. (JSC::DFG::AbstractState::clobberCapturedVars):
  9011. * dfg/DFGAbstractState.h:
  9012. (AbstractState):
  9013. * dfg/DFGAbstractValue.h:
  9014. (JSC::DFG::AbstractValue::clear):
  9015. (JSC::DFG::AbstractValue::isClear):
  9016. (JSC::DFG::AbstractValue::makeTop):
  9017. (JSC::DFG::AbstractValue::isTop):
  9018. (JSC::DFG::AbstractValue::set):
  9019. (JSC::DFG::AbstractValue::operator==):
  9020. (JSC::DFG::AbstractValue::merge):
  9021. (JSC::DFG::AbstractValue::filter):
  9022. (JSC::DFG::AbstractValue::validate):
  9023. (JSC::DFG::AbstractValue::validateForEntry):
  9024. (AbstractValue):
  9025. (JSC::DFG::AbstractValue::checkConsistency):
  9026. (JSC::DFG::AbstractValue::dump):
  9027. * dfg/DFGByteCodeParser.cpp:
  9028. (JSC::DFG::ByteCodeParser::setLocal):
  9029. (JSC::DFG::ByteCodeParser::getArgument):
  9030. (JSC::DFG::ByteCodeParser::setArgument):
  9031. (JSC::DFG::ByteCodeParser::parseBlock):
  9032. (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
  9033. * dfg/DFGCSEPhase.cpp:
  9034. (JSC::DFG::CSEPhase::checkStructureLoadElimination):
  9035. (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
  9036. (JSC::DFG::CSEPhase::putStructureStoreElimination):
  9037. (JSC::DFG::CSEPhase::getLocalLoadElimination):
  9038. (JSC::DFG::CSEPhase::performNodeCSE):
  9039. * dfg/DFGDriver.cpp:
  9040. (JSC::DFG::compile):
  9041. * dfg/DFGGraph.cpp:
  9042. (JSC::DFG::Graph::dump):
  9043. * dfg/DFGGraph.h:
  9044. (JSC::DFG::Graph::vote):
  9045. (Graph):
  9046. * dfg/DFGNode.h:
  9047. (JSC::DFG::Node::convertToStructureTransitionWatchpoint):
  9048. (Node):
  9049. (JSC::DFG::Node::hasStructureSet):
  9050. * dfg/DFGNodeType.h:
  9051. (DFG):
  9052. * dfg/DFGOSREntry.cpp:
  9053. (JSC::DFG::prepareOSREntry):
  9054. * dfg/DFGPredictionPropagationPhase.cpp:
  9055. (JSC::DFG::PredictionPropagationPhase::propagate):
  9056. (PredictionPropagationPhase):
  9057. (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
  9058. * dfg/DFGSpeculativeJIT.h:
  9059. (SpeculativeJIT):
  9060. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  9061. (JSC::DFG::SpeculativeJIT::speculationCheckWithConditionalDirection):
  9062. (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecutionWithConditionalDirection):
  9063. (JSC::DFG::SpeculateCellOperand::SpeculateCellOperand):
  9064. (JSC::DFG::SpeculateCellOperand::gpr):
  9065. (SpeculateCellOperand):
  9066. * dfg/DFGSpeculativeJIT32_64.cpp:
  9067. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  9068. (JSC::DFG::SpeculativeJIT::compile):
  9069. * dfg/DFGSpeculativeJIT64.cpp:
  9070. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  9071. (JSC::DFG::SpeculativeJIT::compile):
  9072. * dfg/DFGStructureCheckHoistingPhase.cpp: Added.
  9073. (DFG):
  9074. (StructureCheckHoistingPhase):
  9075. (JSC::DFG::StructureCheckHoistingPhase::StructureCheckHoistingPhase):
  9076. (JSC::DFG::StructureCheckHoistingPhase::run):
  9077. (JSC::DFG::StructureCheckHoistingPhase::noticeStructureCheck):
  9078. (JSC::DFG::StructureCheckHoistingPhase::noticeClobber):
  9079. (JSC::DFG::StructureCheckHoistingPhase::clobber):
  9080. (CheckData):
  9081. (JSC::DFG::StructureCheckHoistingPhase::CheckData::CheckData):
  9082. (JSC::DFG::performStructureCheckHoisting):
  9083. * dfg/DFGStructureCheckHoistingPhase.h: Added.
  9084. (DFG):
  9085. * dfg/DFGVariableAccessData.h:
  9086. (VariableAccessData):
  9087. (JSC::DFG::VariableAccessData::VariableAccessData):
  9088. (JSC::DFG::VariableAccessData::mergeStructureCheckHoistingFailed):
  9089. (JSC::DFG::VariableAccessData::structureCheckHoistingFailed):
  9090. (JSC::DFG::VariableAccessData::clearVotes):
  9091. (JSC::DFG::VariableAccessData::vote):
  9092. (JSC::DFG::VariableAccessData::voteRatio):
  9093. (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
  9094. * runtime/Options.h:
  9095. (JSC):
  9096. 2012-08-01 Filip Pizlo <fpizlo@apple.com>
  9097. DFG should distinguish between PutByVal's that clobber the world and ones that don't
  9098. https://bugs.webkit.org/show_bug.cgi?id=92923
  9099. Reviewed by Mark Hahnenberg.
  9100. This is performance-neutral. I also confirmed that it's neutral if we make the
  9101. clobbering variant (PutByValSafe) clobber all knowledge of what is an array,
  9102. which should feed nicely into work on removing uses of ClassInfo.
  9103. * bytecode/DFGExitProfile.h:
  9104. * dfg/DFGAbstractState.cpp:
  9105. (JSC::DFG::AbstractState::execute):
  9106. * dfg/DFGByteCodeParser.cpp:
  9107. (JSC::DFG::ByteCodeParser::parseBlock):
  9108. * dfg/DFGCSEPhase.cpp:
  9109. (JSC::DFG::CSEPhase::getByValLoadElimination):
  9110. (JSC::DFG::CSEPhase::checkStructureLoadElimination):
  9111. (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
  9112. (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
  9113. (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
  9114. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  9115. (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
  9116. (JSC::DFG::CSEPhase::performNodeCSE):
  9117. * dfg/DFGFixupPhase.cpp:
  9118. (JSC::DFG::FixupPhase::fixupNode):
  9119. * dfg/DFGGraph.h:
  9120. (JSC::DFG::Graph::byValIsPure):
  9121. (JSC::DFG::Graph::clobbersWorld):
  9122. * dfg/DFGNodeType.h:
  9123. (DFG):
  9124. * dfg/DFGPredictionPropagationPhase.cpp:
  9125. (JSC::DFG::PredictionPropagationPhase::propagate):
  9126. * dfg/DFGSpeculativeJIT32_64.cpp:
  9127. (JSC::DFG::SpeculativeJIT::compile):
  9128. * dfg/DFGSpeculativeJIT64.cpp:
  9129. (JSC::DFG::SpeculativeJIT::compile):
  9130. 2012-08-01 Jian Li <jianli@chromium.org>
  9131. Add new CSS property "-webkit-widget-region" to expose dashboard region support for other port
  9132. https://bugs.webkit.org/show_bug.cgi?id=90298
  9133. Reviewed by Adam Barth.
  9134. * Configurations/FeatureDefines.xcconfig: Add ENABLE_WIDGET_REGION define.
  9135. 2012-08-01 Patrick Gansterer <paroga@webkit.org>
  9136. Replace WTF::getCurrentLocalTime() with GregorianDateTime::setToCurrentLocalTime()
  9137. https://bugs.webkit.org/show_bug.cgi?id=92286
  9138. Reviewed by Geoffrey Garen.
  9139. Add a method to GregorianDateTime to set its values to the current locale time.
  9140. Replacing all occurrences of getCurrentLocalTime with the new function allows
  9141. us to remove getCurrentLocalTime in a next step.
  9142. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  9143. 2012-08-01 Mark Hahnenberg <mhahnenberg@apple.com>
  9144. C++ code should get ClassInfo from the Structure
  9145. https://bugs.webkit.org/show_bug.cgi?id=92892
  9146. Reviewed by Geoffrey Garen.
  9147. In our march to remove ClassInfo from our JSCell object headers, we can switch
  9148. C++ code over to grabbing the ClassInfo from the Structure since it is finally
  9149. safe to do so now that Structure access is safe during finalization/destruction.
  9150. The remaining JIT code changes can be done in a separate patch.
  9151. * heap/MarkedBlock.cpp:
  9152. (JSC::MarkedBlock::callDestructor): We don't want to clear the Structure any more
  9153. since the Structure should still be valid at this point.
  9154. * heap/WeakSetInlines.h:
  9155. (JSC::WeakBlock::finalize): Ditto.
  9156. * runtime/JSCell.h:
  9157. (JSC):
  9158. * runtime/Structure.h:
  9159. (JSC::JSCell::classInfo): Move JSCell's classInfo() to Structure.h so it can be
  9160. inline. Use a different method of getting the JSCell's Structure based on
  9161. whether we're in GC_VALIDATION mode or not, since always using get() will cause
  9162. infinite recursion in GC_VALIDATION mode.
  9163. (JSC):
  9164. 2012-07-31 Mark Hahnenberg <mhahnenberg@apple.com>
  9165. MarkedBlock::sweep() should sweep another block if it can't sweep a Structure block
  9166. https://bugs.webkit.org/show_bug.cgi?id=92819
  9167. Reviewed by Geoffrey Garen.
  9168. If we are forced to allocate a new block for Structures because we are unable to safely
  9169. sweep our pre-existing Structure blocks, we should sweep another random block so that we
  9170. can start sweeping Structure blocks sooner.
  9171. * heap/IncrementalSweeper.cpp:
  9172. (JSC::IncrementalSweeper::doSweep): Change to use sweepNextBlock.
  9173. (JSC):
  9174. (JSC::IncrementalSweeper::sweepNextBlock):
  9175. * heap/IncrementalSweeper.h:
  9176. (IncrementalSweeper):
  9177. * heap/MarkedAllocator.cpp:
  9178. (JSC::MarkedAllocator::tryAllocateHelper): When we can't safely sweep
  9179. our Structure blocks, call sweepNextBlock instead.
  9180. 2012-07-31 Sam Weinig <sam@webkit.org>
  9181. Fix the Windows build.
  9182. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  9183. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9184. Maybe fix the GCC build.
  9185. * heap/HeapBlock.h:
  9186. (HeapBlock): Accommodate incorrect parsing in GCC.
  9187. 2012-07-31 Sam Weinig <sam@webkit.org>
  9188. Stop masking 8 bits off of the visited link hash. We need all the bits!
  9189. https://bugs.webkit.org/show_bug.cgi?id=92799
  9190. Reviewed by Anders Carlsson.
  9191. * runtime/Identifier.cpp:
  9192. (JSC::IdentifierCStringTranslator::hash):
  9193. (JSC::IdentifierLCharFromUCharTranslator::hash):
  9194. * runtime/Identifier.h:
  9195. (JSC::IdentifierCharBufferTranslator::hash):
  9196. Update for new function names.
  9197. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9198. Maybe break the Windows build.
  9199. Reviewed by Anders Carlsson.
  9200. Formally objected to by Sam Weinig.
  9201. * heap/HeapBlock.h:
  9202. (HeapBlock): Try to slightly improve this because we don't want Windows to control our lives.
  9203. 2012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
  9204. Structures should be swept after all other objects
  9205. https://bugs.webkit.org/show_bug.cgi?id=92679
  9206. Reviewed by Filip Pizlo.
  9207. In order to get rid of ClassInfo from our objects, we need to be able to safely get the
  9208. ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
  9209. Structure, but currently it is not safe to do so because the order of destruction of objects
  9210. is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
  9211. sweeping Structures after everything else.
  9212. * heap/Heap.cpp:
  9213. (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
  9214. If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
  9215. safe to sweep structures since we'll always do Structures last anyways due to the ordering of
  9216. MarkedSpace::forEachBlock.
  9217. (JSC):
  9218. (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
  9219. calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
  9220. these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
  9221. calls during lastChanceToFinalize().
  9222. * heap/Heap.h:
  9223. (Heap):
  9224. * heap/HeapTimer.h:
  9225. (HeapTimer):
  9226. * heap/IncrementalSweeper.cpp:
  9227. (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
  9228. This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
  9229. the first time.
  9230. (JSC):
  9231. (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
  9232. make our first pass. We now null out the slots as we sweep them so that we can quickly find the
  9233. Structures during the second pass.
  9234. (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
  9235. (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
  9236. the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
  9237. assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
  9238. iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
  9239. (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
  9240. * heap/IncrementalSweeper.h: Add declarations for new stuff.
  9241. (IncrementalSweeper):
  9242. * heap/MarkedAllocator.cpp:
  9243. (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
  9244. if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
  9245. the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
  9246. will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
  9247. Structure garbage.
  9248. (JSC::MarkedAllocator::addBlock):
  9249. * heap/MarkedAllocator.h:
  9250. (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
  9251. longer valid to allocate from, so we set the current block to null.
  9252. * heap/MarkedBlock.cpp:
  9253. (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
  9254. at an unsafe time.
  9255. * heap/MarkedSpace.cpp:
  9256. (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
  9257. (JSC):
  9258. * heap/MarkedSpace.h:
  9259. (JSC):
  9260. * runtime/JSGlobalData.cpp:
  9261. (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
  9262. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9263. Fix all the other builds I just broke. Maybe fix the Windows build.
  9264. * heap/HeapBlock.h:
  9265. (HeapBlock): WTF?
  9266. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9267. Maybe fix the Windows build.
  9268. * heap/HeapBlock.h:
  9269. (HeapBlock): WTF?
  9270. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9271. Maybe fix the Windows build.
  9272. * heap/HeapBlock.h:
  9273. (HeapBlock): WTF?
  9274. 2012-07-31 Geoffrey Garen <ggaren@apple.com>
  9275. Removed some public data and casting from the Heap
  9276. https://bugs.webkit.org/show_bug.cgi?id=92777
  9277. Reviewed by Oliver Hunt.
  9278. * heap/BlockAllocator.cpp:
  9279. (JSC::BlockAllocator::releaseFreeBlocks):
  9280. (JSC::BlockAllocator::blockFreeingThreadMain): Use the DeadBlock class
  9281. since HeapBlock is a template, and not a class, now. Call destroy()
  9282. instead of monkeying around with DeadBlock's internal data because
  9283. encapsulation is good.
  9284. * heap/BlockAllocator.h:
  9285. (DeadBlock): Added a class to represent a dead block, since HeapBlock is
  9286. a template now, and can't be instantiated directly.
  9287. (JSC::DeadBlock::DeadBlock):
  9288. (JSC::DeadBlock::create):
  9289. (BlockAllocator):
  9290. (JSC::BlockAllocator::allocate):
  9291. (JSC::BlockAllocator::deallocate): Use the DeadBlock class because
  9292. encapsulation is good.
  9293. * heap/CopiedBlock.h:
  9294. (CopiedBlock::destroy): No need for a destroy() function, since we
  9295. inherit one now.
  9296. (JSC::CopiedBlock::CopiedBlock):
  9297. (JSC::CopiedBlock::payloadEnd):
  9298. (JSC::CopiedBlock::capacity): Updated for some encapsulation inside
  9299. HeapBlock.
  9300. * heap/CopiedSpace.cpp:
  9301. (JSC::CopiedSpace::~CopiedSpace):
  9302. (JSC::CopiedSpace::doneCopying):
  9303. (JSC::CopiedSpace::size):
  9304. (JSC::CopiedSpace::capacity):
  9305. (JSC::isBlockListPagedOut): Removed a bunch of casting. This is no longer
  9306. necessary, now that our list and its nodes have the right type.
  9307. * heap/CopiedSpace.h: Use the right type in our data structures because
  9308. it improves clarity.
  9309. * heap/CopiedSpaceInlineMethods.h:
  9310. (JSC::CopiedSpace::startedCopying): Use swap to avoid duplicating it.
  9311. * heap/HeapBlock.h:
  9312. (HeapBlock): Made this a class template so we can return the right type
  9313. in linked list operations. Made our data private because encapsulation
  9314. is good.
  9315. (JSC::HeapBlock::destroy): Since we know our type, we can also eliminate
  9316. duplicate destroy() functions in our subclasses.
  9317. (JSC::HeapBlock::allocation): Added an accessor so we can hide our data.
  9318. By using const, this accessor prevents clients from accidentally deleting
  9319. our allocation.
  9320. * heap/MarkedAllocator.cpp:
  9321. (JSC::MarkedAllocator::isPagedOut):
  9322. (JSC::MarkedAllocator::tryAllocateHelper):
  9323. (JSC::MarkedAllocator::removeBlock): Removed a bunch of casting. This is
  9324. no longer necessary, now that our list and its nodes have the right type.
  9325. * heap/MarkedAllocator.h:
  9326. (MarkedAllocator):
  9327. (JSC::MarkedAllocator::reset):
  9328. (JSC::MarkedAllocator::forEachBlock): Use the right type, do less casting.
  9329. * heap/MarkedBlock.cpp:
  9330. (JSC::MarkedBlock::destroy): Removed this function because our parent
  9331. class provides it for us now.
  9332. (JSC::MarkedBlock::MarkedBlock):
  9333. * heap/MarkedBlock.h:
  9334. (MarkedBlock):
  9335. (JSC::MarkedBlock::capacity): Updated for encapsulation.
  9336. 2012-07-31 Filip Pizlo <fpizlo@apple.com>
  9337. DFG OSR exit profiling has unusual oversights
  9338. https://bugs.webkit.org/show_bug.cgi?id=92728
  9339. Reviewed by Geoffrey Garen.
  9340. * dfg/DFGOSRExit.cpp:
  9341. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  9342. * dfg/DFGSpeculativeJIT.h:
  9343. (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
  9344. * dfg/DFGSpeculativeJIT32_64.cpp:
  9345. (JSC::DFG::SpeculativeJIT::compile):
  9346. * dfg/DFGSpeculativeJIT64.cpp:
  9347. (JSC::DFG::SpeculativeJIT::compile):
  9348. 2012-07-31 Chao-ying Fu <fu@mips.com>
  9349. Add MIPS add32 function
  9350. https://bugs.webkit.org/show_bug.cgi?id=91522
  9351. Reviewed by Oliver Hunt.
  9352. Add isCompactPtrAlignedAddressOffset.
  9353. Add a new version of add32 that accepts AbsoluteAddress as inputs.
  9354. * assembler/MacroAssemblerMIPS.h:
  9355. (JSC::MacroAssemblerMIPS::isCompactPtrAlignedAddressOffset): New.
  9356. (MacroAssemblerMIPS):
  9357. (JSC::MacroAssemblerMIPS::add32): Support AbsoluteAddress as inputs.
  9358. 2012-07-30 Sheriff Bot <webkit.review.bot@gmail.com>
  9359. Unreviewed, rolling out r124123.
  9360. http://trac.webkit.org/changeset/124123
  9361. https://bugs.webkit.org/show_bug.cgi?id=92700
  9362. ASSERT crashes terminate webkit Layout tests (Requested by
  9363. msaboff on #webkit).
  9364. * heap/Heap.cpp:
  9365. * heap/Heap.h:
  9366. (Heap):
  9367. * heap/IncrementalSweeper.cpp:
  9368. (JSC::IncrementalSweeper::doSweep):
  9369. (JSC::IncrementalSweeper::startSweeping):
  9370. (JSC::IncrementalSweeper::IncrementalSweeper):
  9371. (JSC):
  9372. * heap/IncrementalSweeper.h:
  9373. (IncrementalSweeper):
  9374. * heap/MarkedAllocator.cpp:
  9375. (JSC::MarkedAllocator::tryAllocateHelper):
  9376. (JSC::MarkedAllocator::addBlock):
  9377. * heap/MarkedAllocator.h:
  9378. (JSC::MarkedAllocator::zapFreeList):
  9379. * heap/MarkedBlock.cpp:
  9380. (JSC::MarkedBlock::sweepHelper):
  9381. * heap/MarkedSpace.cpp:
  9382. * heap/MarkedSpace.h:
  9383. (JSC::MarkedSpace::sweep):
  9384. (JSC):
  9385. * runtime/JSGlobalData.cpp:
  9386. (JSC::JSGlobalData::~JSGlobalData):
  9387. 2012-07-30 Mark Hahnenberg <mhahnenberg@apple.com>
  9388. Structures should be swept after all other objects
  9389. https://bugs.webkit.org/show_bug.cgi?id=92679
  9390. Reviewed by Filip Pizlo.
  9391. In order to get rid of ClassInfo from our objects, we need to be able to safely get the
  9392. ClassInfo during the destruction of objects. We'd like to get the ClassInfo out of the
  9393. Structure, but currently it is not safe to do so because the order of destruction of objects
  9394. is not guaranteed to sweep objects before their corresponding Structure. We can fix this by
  9395. sweeping Structures after everything else.
  9396. * heap/Heap.cpp:
  9397. (JSC::Heap::isSafeToSweepStructures): Add a function that checks if it is safe to sweep Structures.
  9398. If the Heap's IncrementalSweeper member is null, that means we're shutting down this VM and it is
  9399. safe to sweep structures since we'll always do Structures last anyways due to the ordering of
  9400. MarkedSpace::forEachBlock.
  9401. (JSC):
  9402. (JSC::Heap::didStartVMShutdown): Add this intermediate function to the Heap that ~JSGlobalData now
  9403. calls rather than calling the two HeapTimer objects individually. This allows the Heap to null out
  9404. these pointers after it has invalidated them to prevent accidental use-after-free in the sweep()
  9405. calls during lastChanceToFinalize().
  9406. * heap/Heap.h:
  9407. (Heap):
  9408. * heap/HeapTimer.h:
  9409. (HeapTimer):
  9410. * heap/IncrementalSweeper.cpp:
  9411. (JSC::IncrementalSweeper::structuresCanBeSwept): Determines if it is currently safe to sweep Structures.
  9412. This decision is based on whether we have gotten to the end of the vector of blocks that need sweeping
  9413. the first time.
  9414. (JSC):
  9415. (JSC::IncrementalSweeper::doSweep): We add a second pass over the vector to sweep Structures after we
  9416. make our first pass. We now null out the slots as we sweep them so that we can quickly find the
  9417. Structures during the second pass.
  9418. (JSC::IncrementalSweeper::startSweeping): Initialize our new Structure sweeping index.
  9419. (JSC::IncrementalSweeper::willFinishSweeping): Callback that is called by MarkedSpace::sweep to notify
  9420. the IncrementalSweeper that we are going to sweep all of the remaining blocks in the Heap so it can
  9421. assume that everything is taken care of in the correct order. Since MarkedSpace::forEachBlock
  9422. iterates over the Structure blocks after all other blocks, the ordering property for sweeping Structures holds.
  9423. (JSC::IncrementalSweeper::IncrementalSweeper): Initialize Structure sweeping index.
  9424. * heap/IncrementalSweeper.h: Add declarations for new stuff.
  9425. (IncrementalSweeper):
  9426. * heap/MarkedAllocator.cpp:
  9427. (JSC::MarkedAllocator::tryAllocateHelper): We now check if the current block only contains structures and
  9428. if so and it isn't safe to sweep Structures according to the Heap, we just return early instead of doing
  9429. the normal lazy sweep. If this proves to be too much of a waste in the future we can add an extra clause that
  9430. will sweep some number of other blocks in place of the current block to mitigate the cost of the floating
  9431. Structure garbage.
  9432. (JSC::MarkedAllocator::addBlock):
  9433. * heap/MarkedAllocator.h:
  9434. (JSC::MarkedAllocator::zapFreeList): When we zap the free list in the MarkedAllocator, the current block is no
  9435. longer valid to allocate from, so we set the current block to null.
  9436. * heap/MarkedBlock.cpp:
  9437. (JSC::MarkedBlock::sweepHelper): Added a couple assertions to make sure that we weren't trying to sweep Structures
  9438. at an unsafe time.
  9439. * heap/MarkedSpace.cpp:
  9440. (JSC::MarkedSpace::sweep): Notify the IncrementalSweeper that the MarkedSpace will finish all currently remaining sweeping.
  9441. (JSC):
  9442. * heap/MarkedSpace.h:
  9443. (JSC):
  9444. * runtime/JSGlobalData.cpp:
  9445. (JSC::JSGlobalData::~JSGlobalData): Call the new Heap::didStartVMShutdown.
  9446. 2012-07-29 Filip Pizlo <fpizlo@apple.com>
  9447. PropertyNameArray::m_shouldCache is only assigned and never used
  9448. https://bugs.webkit.org/show_bug.cgi?id=92598
  9449. Reviewed by Dan Bernstein.
  9450. * runtime/PropertyNameArray.h:
  9451. (JSC::PropertyNameArray::PropertyNameArray):
  9452. (PropertyNameArray):
  9453. 2012-07-29 Rik Cabanier <cabanier@adobe.com>
  9454. Add ENABLE_CSS_COMPOSITING flag
  9455. https://bugs.webkit.org/show_bug.cgi?id=92553
  9456. Reviewed by Dirk Schulze.
  9457. Adds compiler flag CSS_COMPOSITING to build systems to enable CSS blending and compositing. See spec https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html
  9458. * Configurations/FeatureDefines.xcconfig:
  9459. 2012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
  9460. Split functionality of MarkedAllocator::m_currentBlock
  9461. https://bugs.webkit.org/show_bug.cgi?id=92550
  9462. Reviewed by Filip Pizlo.
  9463. MarkedAllocator::m_currentBlock serves two purposes right now; it indicates the block that is currently
  9464. being used for allocation and the beginning of the list of blocks that need to be swept. We should split
  9465. these two functionalities into two separate fields.
  9466. * heap/MarkedAllocator.cpp:
  9467. (JSC::MarkedAllocator::tryAllocateHelper): Use m_blocksToSweep instead of m_currentBlock as the
  9468. initializer/reference of the loop. Only change m_currentBlock when we know what the result will be.
  9469. (JSC::MarkedAllocator::addBlock): When we add a new block we know that both m_blocksToSweep and
  9470. m_currentBlock are null. In order to preserve the invariant that m_currentBlock <= m_blocksToSweep,
  9471. we assign both of them to point to the new block.
  9472. (JSC::MarkedAllocator::removeBlock): We need a separate check to see if the block we're removing is
  9473. m_blocksToSweep and if so, advance it to the next block in the list.
  9474. * heap/MarkedAllocator.h:
  9475. (MarkedAllocator): Initialize m_blocksToSweep.
  9476. (JSC::MarkedAllocator::MarkedAllocator):
  9477. (JSC::MarkedAllocator::reset): We set m_blocksToSweep to be the head of our list. This function is called
  9478. at the end of a collection, so all of the blocks in our allocator need to be swept. We need to sweep a
  9479. block before we can start allocating, so m_currentBlock is set to null. We also set the freeList to
  9480. the empty FreeList to emphasize the fact that we can't start allocating until we do some sweeping.
  9481. 2012-07-27 Mark Hahnenberg <mhahnenberg@apple.com>
  9482. Increase inline storage for JSFinalObjects by one
  9483. https://bugs.webkit.org/show_bug.cgi?id=92526
  9484. Reviewed by Geoffrey Garen.
  9485. Now that we've removed the inheritorID from objects, we can increase our inline storage for JSFinalObjects on
  9486. 64-bit platforms by 1.
  9487. * llint/LowLevelInterpreter.asm: Change the constant.
  9488. * runtime/PropertyOffset.h: Change the constant.
  9489. (JSC):
  9490. 2012-07-27 Jer Noble <jer.noble@apple.com>
  9491. Support a rational time class for use by media elements.
  9492. https://bugs.webkit.org/show_bug.cgi?id=88787
  9493. Re-export WTF::MediaTime from JavaScriptCore.
  9494. Reviewed by Eric Carlson.
  9495. * JavaScriptCore.order:
  9496. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  9497. 2012-07-26 Filip Pizlo <fpizlo@apple.com>
  9498. JSObject::reallocateStorageIfNecessary is neither used nor defined
  9499. https://bugs.webkit.org/show_bug.cgi?id=92417
  9500. Reviewed by Mark Rowe.
  9501. * runtime/JSObject.h:
  9502. (JSObject):
  9503. 2012-07-26 Mark Hahnenberg <mhahnenberg@apple.com>
  9504. Allocate Structures in a separate part of the Heap
  9505. https://bugs.webkit.org/show_bug.cgi?id=92420
  9506. Reviewed by Filip Pizlo.
  9507. To fix our issue with destruction/finalization of Structures before their objects, we can move Structures to a separate
  9508. part of the Heap that will be swept after all other objects. This first patch will just be separating Structures
  9509. out into their own separate MarkedAllocator. Everything else will behave identically.
  9510. * heap/Heap.h: New function to allocate Structures in the Heap.
  9511. (Heap):
  9512. (JSC):
  9513. (JSC::Heap::allocateStructure):
  9514. * heap/MarkedAllocator.cpp: Pass whether or not we're allocated Structures to the MarkedBlock.
  9515. (JSC::MarkedAllocator::allocateBlock):
  9516. * heap/MarkedAllocator.h: Add tracking for whether or not we're allocating only Structures.
  9517. (JSC::MarkedAllocator::onlyContainsStructures):
  9518. (MarkedAllocator):
  9519. (JSC::MarkedAllocator::MarkedAllocator):
  9520. (JSC::MarkedAllocator::init):
  9521. * heap/MarkedBlock.cpp: Add tracking for whether or not we're allocating only Structures. We need this to be able to
  9522. distinguish the various MarkedBlock types in MarkedSpace::allocatorFor(MarkedBlock*).
  9523. (JSC::MarkedBlock::create):
  9524. (JSC::MarkedBlock::MarkedBlock):
  9525. * heap/MarkedBlock.h:
  9526. (MarkedBlock):
  9527. (JSC::MarkedBlock::onlyContainsStructures):
  9528. (JSC):
  9529. * heap/MarkedSpace.cpp: Include the new Structure allocator in all the places that all the other allocators are used/modified.
  9530. (JSC::MarkedSpace::MarkedSpace):
  9531. (JSC::MarkedSpace::resetAllocators):
  9532. (JSC::MarkedSpace::canonicalizeCellLivenessData):
  9533. (JSC::MarkedSpace::isPagedOut):
  9534. * heap/MarkedSpace.h: Add new MarkedAllocator just for Structures.
  9535. (MarkedSpace):
  9536. (JSC::MarkedSpace::allocatorFor):
  9537. (JSC::MarkedSpace::allocateStructure):
  9538. (JSC):
  9539. (JSC::MarkedSpace::forEachBlock):
  9540. * runtime/Structure.h: Move all of the functions that call allocateCell<Structure> down below the explicit template specialization
  9541. for allocateCell<Structure>. The new inline specialization for allocateCell directly calls the allocateStructure() function in the
  9542. Heap.
  9543. (Structure):
  9544. (JSC::Structure):
  9545. (JSC):
  9546. (JSC::Structure::create):
  9547. (JSC::Structure::createStructure):
  9548. 2012-07-26 Filip Pizlo <fpizlo@apple.com>
  9549. JSArray has methods that are neither used nor defined
  9550. https://bugs.webkit.org/show_bug.cgi?id=92416
  9551. Reviewed by Simon Fraser.
  9552. * runtime/JSArray.h:
  9553. (JSArray):
  9554. 2012-07-26 Zoltan Herczeg <zherczeg@webkit.org>
  9555. [Qt][ARM]ARMAssembler needs buildfix afert r123417
  9556. https://bugs.webkit.org/show_bug.cgi?id=92086
  9557. Reviewed by Csaba Osztrogonác.
  9558. The ARM implementation of this should be optimized code path
  9559. is covered by a non-optimized code path. This patch fixes this,
  9560. and adds a new function which returns with the offset range.
  9561. * assembler/ARMAssembler.h:
  9562. (JSC::ARMAssembler::readPointer):
  9563. (ARMAssembler):
  9564. (JSC::ARMAssembler::repatchInt32):
  9565. (JSC::ARMAssembler::repatchCompact):
  9566. * assembler/MacroAssemblerARM.h:
  9567. (MacroAssemblerARM):
  9568. (JSC::MacroAssemblerARM::isCompactPtrAlignedAddressOffset):
  9569. (JSC::MacroAssemblerARM::load32WithCompactAddressOffsetPatch):
  9570. 2012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
  9571. Build fix for 32-bit after r123682
  9572. * runtime/JSObject.h: Need to pad out JSObjects on 32-bit so that they're the correct size since
  9573. we only removed one 4-byte word and we need to be 8-byte aligned.
  9574. (JSObject):
  9575. 2012-07-25 Filip Pizlo <fpizlo@apple.com>
  9576. JSC GC object copying APIs should allow for greater flexibility
  9577. https://bugs.webkit.org/show_bug.cgi?id=92316
  9578. Reviewed by Mark Hahnenberg.
  9579. It's now the case that visitChildren() methods can directly pin and allocate in new space during copying.
  9580. They can also do the copying and marking themselves. This new API is only used for JSObjects for now.
  9581. * JavaScriptCore.xcodeproj/project.pbxproj:
  9582. * heap/MarkStack.cpp:
  9583. (JSC::SlotVisitor::allocateNewSpaceSlow):
  9584. (JSC::SlotVisitor::allocateNewSpaceOrPin):
  9585. (JSC):
  9586. (JSC::SlotVisitor::copyAndAppend):
  9587. * heap/MarkStack.h:
  9588. (MarkStack):
  9589. (JSC::MarkStack::appendUnbarrieredValue):
  9590. (JSC):
  9591. * heap/SlotVisitor.h:
  9592. * heap/SlotVisitorInlineMethods.h: Added.
  9593. (JSC):
  9594. (JSC::SlotVisitor::checkIfShouldCopyAndPinOtherwise):
  9595. (JSC::SlotVisitor::allocateNewSpace):
  9596. * runtime/JSObject.cpp:
  9597. (JSC::JSObject::visitOutOfLineStorage):
  9598. (JSC):
  9599. (JSC::JSObject::visitChildren):
  9600. (JSC::JSFinalObject::visitChildren):
  9601. * runtime/JSObject.h:
  9602. (JSObject):
  9603. 2012-07-25 Mark Hahnenberg <mhahnenberg@apple.com>
  9604. Remove JSObject::m_inheritorID
  9605. https://bugs.webkit.org/show_bug.cgi?id=88378
  9606. Reviewed by Filip Pizlo.
  9607. This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
  9608. and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
  9609. Instead use a private named value in the object's property storage.
  9610. * dfg/DFGSpeculativeJIT.h:
  9611. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
  9612. * jit/JITInlineMethods.h:
  9613. (JSC::JIT::emitAllocateBasicJSObject): No need m_inheritorID to initialize!
  9614. * llint/LowLevelInterpreter.asm: No need m_inheritorID to initialize!
  9615. * runtime/JSGlobalData.h:
  9616. (JSGlobalData): Added private name 'm_inheritorIDKey'.
  9617. * runtime/JSGlobalThis.cpp:
  9618. (JSC::JSGlobalThis::setUnwrappedObject): resetInheritorID is now passed a JSGlobalData&.
  9619. * runtime/JSObject.cpp:
  9620. (JSC::JSObject::visitChildren): No m_inheritorID to be marked.
  9621. (JSC::JSFinalObject::visitChildren): No m_inheritorID to be marked.
  9622. (JSC::JSObject::createInheritorID): Store the newly created inheritorID in the property map. Make sure
  9623. it's got the DontEnum attribute!!
  9624. * runtime/JSObject.h:
  9625. (JSObject):
  9626. (JSC::JSObject::resetInheritorID): Remove the inheritorID from property storage.
  9627. (JSC):
  9628. (JSC::JSObject::inheritorID): Read the inheritorID from property storage.
  9629. 2012-07-25 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
  9630. Create a specialized pair for use in HashMap iterators
  9631. https://bugs.webkit.org/show_bug.cgi?id=92137
  9632. Reviewed by Ryosuke Niwa.
  9633. Update a couple of sites that relied on the fact that "contents" of iterators were
  9634. std::pairs.
  9635. * profiler/Profile.cpp:
  9636. (JSC): This code kept a vector of the pairs that were the "contents" of the iterators. This
  9637. is changed to use a KeyValuePair. We make use HashCount's ValueType (which represents only
  9638. the key) to get the proper key parameter for KeyValuePair.
  9639. * tools/ProfileTreeNode.h:
  9640. (ProfileTreeNode): Use HashMap::ValueType to declare the type of the contents of the hash
  9641. instead of declaring it manually. This will make use of the new KeyValuePair.
  9642. 2012-07-25 Patrick Gansterer <paroga@webkit.org>
  9643. REGRESSION(r123505): Date.getYear() returns the same as Date.getFullYear()
  9644. https://bugs.webkit.org/show_bug.cgi?id=92218
  9645. Reviewed by Csaba Osztrogonác.
  9646. * runtime/DatePrototype.cpp:
  9647. (JSC::dateProtoFuncGetYear): Added the missing offset of 1900 to the return value.
  9648. 2012-07-24 Filip Pizlo <fpizlo@apple.com>
  9649. REGRESSION(r123417): It made tests assert/crash on 32 bit
  9650. https://bugs.webkit.org/show_bug.cgi?id=92088
  9651. Reviewed by Mark Hahnenberg.
  9652. The pointer arithmetic was wrong, because negative numbers are hard to think about.
  9653. * dfg/DFGRepatch.cpp:
  9654. (JSC::DFG::emitPutTransitionStub):
  9655. * dfg/DFGSpeculativeJIT.cpp:
  9656. (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
  9657. 2012-07-24 Patrick Gansterer <paroga@webkit.org>
  9658. Store the full year in GregorianDateTime
  9659. https://bugs.webkit.org/show_bug.cgi?id=92067
  9660. Reviewed by Geoffrey Garen.
  9661. Use the full year instead of the offset from year 1900
  9662. for the year member variable of GregorianDateTime.
  9663. * runtime/DateConstructor.cpp:
  9664. (JSC::constructDate):
  9665. (JSC::dateUTC):
  9666. * runtime/DateConversion.cpp:
  9667. (JSC::formatDate):
  9668. (JSC::formatDateUTCVariant):
  9669. * runtime/DatePrototype.cpp:
  9670. (JSC::formatLocaleDate):
  9671. (JSC::fillStructuresUsingDateArgs):
  9672. (JSC::dateProtoFuncToISOString):
  9673. (JSC::dateProtoFuncGetFullYear):
  9674. (JSC::dateProtoFuncGetUTCFullYear):
  9675. (JSC::dateProtoFuncSetYear):
  9676. * runtime/JSDateMath.cpp:
  9677. (JSC::gregorianDateTimeToMS):
  9678. (JSC::msToGregorianDateTime):
  9679. 2012-07-24 Patrick Gansterer <paroga@webkit.org>
  9680. [WIN] Build fix after r123417.
  9681. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  9682. 2012-07-23 Patrick Gansterer <paroga@webkit.org>
  9683. Move GregorianDateTime from JSC to WTF namespace
  9684. https://bugs.webkit.org/show_bug.cgi?id=91948
  9685. Reviewed by Geoffrey Garen.
  9686. Moving GregorianDateTime into the WTF namespace allows us to us to
  9687. use it in WebCore too. The new class has the same behaviour as the
  9688. old struct. Only the unused timeZone member has been removed.
  9689. * runtime/DateConstructor.cpp:
  9690. * runtime/DateConversion.cpp:
  9691. * runtime/DateConversion.h:
  9692. * runtime/DateInstance.h:
  9693. * runtime/DatePrototype.cpp:
  9694. * runtime/JSDateMath.cpp:
  9695. * runtime/JSDateMath.h:
  9696. 2012-07-23 Filip Pizlo <fpizlo@apple.com>
  9697. Property storage should grow in reverse address direction, to support butterflies
  9698. https://bugs.webkit.org/show_bug.cgi?id=91788
  9699. Reviewed by Geoffrey Garen.
  9700. Changes property storage to grow to the left, and changes the property storage pointer to point
  9701. one 8-byte word (i.e. JSValue) to the right of the first value in the storage.
  9702. Also improved debug support somewhat, by adding a describe() function to the jsc command-line,
  9703. and a slow mode of object access in LLInt.
  9704. * assembler/ARMv7Assembler.h:
  9705. (JSC::ARMv7Assembler::repatchCompact):
  9706. * assembler/MacroAssemblerARMv7.h:
  9707. (MacroAssemblerARMv7):
  9708. (JSC::MacroAssemblerARMv7::isCompactPtrAlignedAddressOffset):
  9709. (JSC::MacroAssemblerARMv7::load32WithCompactAddressOffsetPatch):
  9710. * assembler/MacroAssemblerX86Common.h:
  9711. (JSC::MacroAssemblerX86Common::isCompactPtrAlignedAddressOffset):
  9712. (JSC::MacroAssemblerX86Common::repatchCompact):
  9713. * assembler/X86Assembler.h:
  9714. (JSC::X86Assembler::repatchCompact):
  9715. * bytecode/CodeBlock.cpp:
  9716. (JSC::dumpStructure):
  9717. * bytecode/GetByIdStatus.h:
  9718. (JSC::GetByIdStatus::GetByIdStatus):
  9719. * dfg/DFGOperations.cpp:
  9720. * dfg/DFGOperations.h:
  9721. * dfg/DFGRepatch.cpp:
  9722. (JSC::DFG::tryCacheGetByID):
  9723. (JSC::DFG::emitPutTransitionStub):
  9724. * dfg/DFGSpeculativeJIT.cpp:
  9725. (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
  9726. (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
  9727. * dfg/DFGSpeculativeJIT.h:
  9728. (JSC::DFG::SpeculativeJIT::callOperation):
  9729. * dfg/DFGSpeculativeJIT32_64.cpp:
  9730. (JSC::DFG::SpeculativeJIT::compile):
  9731. * dfg/DFGSpeculativeJIT64.cpp:
  9732. (JSC::DFG::SpeculativeJIT::compile):
  9733. * heap/ConservativeRoots.cpp:
  9734. (JSC::ConservativeRoots::genericAddPointer):
  9735. * heap/CopiedSpace.h:
  9736. (CopiedSpace):
  9737. * heap/CopiedSpaceInlineMethods.h:
  9738. (JSC::CopiedSpace::pinIfNecessary):
  9739. (JSC):
  9740. * jit/JITPropertyAccess.cpp:
  9741. (JSC::JIT::compileGetDirectOffset):
  9742. * jit/JITPropertyAccess32_64.cpp:
  9743. (JSC::JIT::compileGetDirectOffset):
  9744. * jit/JITStubs.cpp:
  9745. (JSC::JITThunks::tryCacheGetByID):
  9746. * jsc.cpp:
  9747. (GlobalObject::finishCreation):
  9748. (functionDescribe):
  9749. * llint/LLIntCommon.h:
  9750. * llint/LLIntSlowPaths.cpp:
  9751. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  9752. * llint/LowLevelInterpreter32_64.asm:
  9753. * llint/LowLevelInterpreter64.asm:
  9754. * runtime/JSObject.cpp:
  9755. (JSC::JSObject::visitChildren):
  9756. (JSC::JSFinalObject::visitChildren):
  9757. (JSC::JSObject::growOutOfLineStorage):
  9758. * runtime/JSObject.h:
  9759. (JSC::JSObject::getDirectLocation):
  9760. (JSC::JSObject::offsetForLocation):
  9761. * runtime/JSValue.h:
  9762. (JSValue):
  9763. * runtime/PropertyOffset.h:
  9764. (JSC::offsetInOutOfLineStorage):
  9765. 2012-07-23 Filip Pizlo <fpizlo@apple.com>
  9766. DFG is too aggressive in performing the specific value optimization on loads
  9767. https://bugs.webkit.org/show_bug.cgi?id=92034
  9768. Reviewed by Mark Hahnenberg.
  9769. This ensures that we don't do optimizations based on a structure having a specific
  9770. value, if there is no way to detect that the value is despecified. This is the
  9771. case for dictionaries, since despecifying a value in a dictionary does not lead to
  9772. a transition and so cannot be caught by either structure checks or structure
  9773. transition watchpoints.
  9774. * bytecode/GetByIdStatus.cpp:
  9775. (JSC::GetByIdStatus::computeFromLLInt):
  9776. (JSC::GetByIdStatus::computeForChain):
  9777. (JSC::GetByIdStatus::computeFor):
  9778. * bytecode/ResolveGlobalStatus.cpp:
  9779. (JSC::computeForStructure):
  9780. 2012-07-23 Filip Pizlo <fpizlo@apple.com>
  9781. REGRESSION(r123169): It made fast/js/dfg-inline-arguments-use-from-uninlined-code.html fail on 32 bit platforms
  9782. https://bugs.webkit.org/show_bug.cgi?id=92002
  9783. Reviewed by Mark Hahnenberg.
  9784. In the process of changing the nature of local variable typing, I forgot to modify one of the places where
  9785. we glue the DFG's notion of variable prediction to the runtime's notion of variable tagging.
  9786. * dfg/DFGSpeculativeJIT.cpp:
  9787. (JSC::DFG::SpeculativeJIT::compile):
  9788. 2012-07-23 Simon Fraser <simon.fraser@apple.com>
  9789. Part 2 of: Implement sticky positioning
  9790. https://bugs.webkit.org/show_bug.cgi?id=90046
  9791. Reviewed by Ojan Vafai.
  9792. Turn on ENABLE_CSS_STICKY_POSITION.
  9793. * Configurations/FeatureDefines.xcconfig:
  9794. 2012-07-23 Patrick Gansterer <paroga@webkit.org>
  9795. Move JSC::parseDate() from DateConversion to JSDateMath
  9796. https://bugs.webkit.org/show_bug.cgi?id=91982
  9797. Reviewed by Geoffrey Garen.
  9798. Moveing this function into the other files removes the dependency
  9799. on JSC spcific classes in DateConversion.{cpp|h}.
  9800. * runtime/DateConversion.cpp:
  9801. * runtime/DateConversion.h:
  9802. (JSC):
  9803. * runtime/JSDateMath.cpp:
  9804. (JSC::parseDate):
  9805. (JSC):
  9806. * runtime/JSDateMath.h:
  9807. (JSC):
  9808. 2012-07-23 Simon Fraser <simon.fraser@apple.com>
  9809. Part 1 of: Implement sticky positioning
  9810. https://bugs.webkit.org/show_bug.cgi?id=90046
  9811. Reviewed by Ojan Vafai.
  9812. Add ENABLE_CSS_STICKY_POSITION, defaulting to off initially.
  9813. Sort the ENABLE_CSS lines in the file. Make sure all the flags
  9814. are in FEATURE_DEFINES.
  9815. * Configurations/FeatureDefines.xcconfig:
  9816. 2012-07-23 Yong Li <yoli@rim.com>
  9817. [BlackBerry] Implement GCActivityCallback with platform timer
  9818. https://bugs.webkit.org/show_bug.cgi?id=90175
  9819. Reviewed by Rob Buis.
  9820. Use JSLock when performing GC to avoid assertions.
  9821. * runtime/GCActivityCallbackBlackBerry.cpp:
  9822. (JSC::DefaultGCActivityCallback::doWork):
  9823. 2012-07-23 Kent Tamura <tkent@chromium.org>
  9824. Rename ENABLE_METER_TAG and ENABLE_PROGRESS_TAG to ENABLE_METER_ELEMENT and ENABLE_PROGRESS_ELEMENT respectively
  9825. https://bugs.webkit.org/show_bug.cgi?id=91941
  9826. Reviewed by Kentaro Hara.
  9827. A flag name for an elmement should be ENABLE_*_ELEMENT.
  9828. * Configurations/FeatureDefines.xcconfig:
  9829. 2012-07-22 Kent Tamura <tkent@chromium.org>
  9830. Rename ENABLE_DETAILS to ENABLE_DETAILS_ELEMENT
  9831. https://bugs.webkit.org/show_bug.cgi?id=91928
  9832. Reviewed by Kentaro Hara.
  9833. A flag name for an elmement should be ENABLE_*_ELEMENT.
  9834. * Configurations/FeatureDefines.xcconfig:
  9835. 2012-07-21 Patrick Gansterer <paroga@webkit.org>
  9836. [WIN] Use GetDateFormat and GetTimeFormat instead of strftime
  9837. https://bugs.webkit.org/show_bug.cgi?id=83436
  9838. Reviewed by Brent Fulgham.
  9839. The MS CRT implementation of strftime calls the same two functions.
  9840. Using them directly avoids the overhead of parsing the format string and removes
  9841. the dependency on strftime() for WinCE where this function does not exist.
  9842. * runtime/DatePrototype.cpp:
  9843. (JSC::formatLocaleDate):
  9844. 2012-07-20 Kent Tamura <tkent@chromium.org>
  9845. Rename ENABLE_DATALIST to ENABLE_DATALIST_ELEMENT
  9846. https://bugs.webkit.org/show_bug.cgi?id=91846
  9847. Reviewed by Kentaro Hara.
  9848. A flag name for an elmement should be ENABLE_*_ELEMENT.
  9849. * Configurations/FeatureDefines.xcconfig:
  9850. 2012-07-20 Han Shen <shenhan@google.com>
  9851. [Chromium] Compilation fails under gcc 4.7
  9852. https://bugs.webkit.org/show_bug.cgi?id=90227
  9853. Reviewed by Tony Chang.
  9854. Disable warnings about c++0x compatibility in gcc newer than 4.6.
  9855. * JavaScriptCore.gyp/JavaScriptCore.gyp:
  9856. 2012-07-18 Filip Pizlo <fpizlo@apple.com>
  9857. DFG cell checks should be hoisted
  9858. https://bugs.webkit.org/show_bug.cgi?id=91717
  9859. Reviewed by Geoffrey Garen.
  9860. The DFG has always had the policy of hoisting array and integer checks to
  9861. the point of variable assignment. Eventually, we added doubles and booleans
  9862. to the mix. But cells should really be part of this as well, particularly
  9863. for 32-bit where accessing a known-type variable is dramatically cheaper
  9864. than accessing a variable whose types is only predicted but otherwise
  9865. unproven.
  9866. This appears to be a definite speed-up for V8 on 32-bit, a possible speed-up
  9867. for Kraken, and a possible slow-down for V8 on 64-bit (around 0.2% if at
  9868. all). Any slow-downs can, and should, be addressed by making the hoisting
  9869. logic cognizant of variables that are never used in a manner that requires
  9870. type checks, and by sinking argument checks to the point(s) of first use.
  9871. To make this work I had to change some OSR machinery, and special-case the
  9872. type predictions of the 'this' argument for constructors. OSR exit normally
  9873. assumes that arguments are boxed, which happens to be true because the
  9874. type prediction used for check hoisting is LUB'd with the type of the
  9875. argument that was passed in - so either the arguments are always stored to
  9876. with the full tag+payload, or if only the payload is stored then the tag
  9877. matches whatever the caller would have set. But not so with the 'this'
  9878. argument for constructors, which is not initialized by the caller. We
  9879. could make this more precise by having argument types for OSR be inferred
  9880. using similar machinery to other locals, but I figured that for this patch
  9881. I should use the surgical fix.
  9882. * assembler/MacroAssemblerX86_64.h:
  9883. (JSC::MacroAssemblerX86_64::branchTestPtr):
  9884. (MacroAssemblerX86_64):
  9885. * assembler/X86Assembler.h:
  9886. (JSC::X86Assembler::testq_rm):
  9887. (X86Assembler):
  9888. * dfg/DFGAbstractState.cpp:
  9889. (JSC::DFG::AbstractState::initialize):
  9890. (JSC::DFG::AbstractState::execute):
  9891. * dfg/DFGDriver.cpp:
  9892. (JSC::DFG::compile):
  9893. * dfg/DFGGraph.h:
  9894. (JSC::DFG::Graph::isCreatedThisArgument):
  9895. (Graph):
  9896. * dfg/DFGSpeculativeJIT.cpp:
  9897. (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
  9898. * dfg/DFGSpeculativeJIT32_64.cpp:
  9899. (JSC::DFG::SpeculativeJIT::compile):
  9900. * dfg/DFGSpeculativeJIT64.cpp:
  9901. (JSC::DFG::SpeculativeJIT::compile):
  9902. * dfg/DFGValueSource.h:
  9903. (JSC::DFG::ValueSource::forSpeculation):
  9904. 2012-07-19 Filip Pizlo <fpizlo@apple.com>
  9905. Fast path of storage resize should be removed from property storage reallocation, since it is only useful for arrays
  9906. https://bugs.webkit.org/show_bug.cgi?id=91796
  9907. Reviewed by Geoffrey Garen.
  9908. * dfg/DFGRepatch.cpp:
  9909. (JSC::DFG::emitPutTransitionStub):
  9910. * dfg/DFGSpeculativeJIT.cpp:
  9911. (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
  9912. * runtime/JSObject.cpp:
  9913. (JSC::JSObject::growOutOfLineStorage):
  9914. 2012-07-19 Mark Lam <mark.lam@apple.com>
  9915. Bug fixes and enhancements for OfflineASM annotation system.
  9916. https://bugs.webkit.org/show_bug.cgi?id=91690
  9917. Reviewed by Filip Pizlo.
  9918. * offlineasm/armv7.rb: added default handling of Instruction lower().
  9919. * offlineasm/asm.rb: added more support for annotations and more pretty printing.
  9920. * offlineasm/ast.rb: added more support for annotations.
  9921. * offlineasm/config.rb: added $preferredCommentStartColumn, simplified $enableInstrAnnotations.
  9922. * offlineasm/parser.rb: added more support for annotations.
  9923. * offlineasm/transform.rb: added more support for annotations.
  9924. * offlineasm/x86.rb: added default handling of Instruction lower().
  9925. 2012-07-19 Patrick Gansterer <paroga@webkit.org>
  9926. [WIN] Fix compilation of JSGlobalData.h with ENABLE(DFG_JIT)
  9927. https://bugs.webkit.org/show_bug.cgi?id=91243
  9928. Reviewed by Geoffrey Garen.
  9929. Disable MSVC warning 4200 "zero-sized array in struct/union" for JSC::ScratchBuffer.
  9930. * runtime/JSGlobalData.h:
  9931. (JSC):
  9932. 2012-07-19 Mark Lam <mark.lam@apple.com>
  9933. Fixed broken ENABLE_JIT=0 build.
  9934. https://bugs.webkit.org/show_bug.cgi?id=91725
  9935. Reviewed by Oliver Hunt.
  9936. * bytecode/Watchpoint.cpp:
  9937. * heap/JITStubRoutineSet.h:
  9938. (JSC):
  9939. (JITStubRoutineSet):
  9940. (JSC::JITStubRoutineSet::JITStubRoutineSet):
  9941. (JSC::JITStubRoutineSet::~JITStubRoutineSet):
  9942. (JSC::JITStubRoutineSet::add):
  9943. (JSC::JITStubRoutineSet::clearMarks):
  9944. (JSC::JITStubRoutineSet::mark):
  9945. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  9946. (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
  9947. 2012-07-19 Kristóf Kosztyó <kkristof@inf.u-szeged.hu>
  9948. [Qt] Unreviewed buildfix after r123042.
  9949. * interpreter/Interpreter.cpp:
  9950. (JSC::Interpreter::dumpRegisters):
  9951. 2012-07-18 Filip Pizlo <fpizlo@apple.com>
  9952. DFG should emit inline code for property storage (re)allocation
  9953. https://bugs.webkit.org/show_bug.cgi?id=91597
  9954. Reviewed by Oliver Hunt.
  9955. This adds two new ops to the DFG IR: AllocatePropertyStorage and
  9956. ReallocatePropertyStorage. It enables these to interact properly with
  9957. CSE so that a GetPropertyStorage on something for which we have
  9958. obviously done a (Re)AllocatePropertyStorage will result in the
  9959. GetPropertyStorage being eliminated. Other than that, the code
  9960. emitted for these ops is identical to the code we were emitting in
  9961. the corresponding PutById stub.
  9962. * dfg/DFGAbstractState.cpp:
  9963. (JSC::DFG::AbstractState::execute):
  9964. * dfg/DFGByteCodeParser.cpp:
  9965. (JSC::DFG::ByteCodeParser::parseBlock):
  9966. * dfg/DFGCSEPhase.cpp:
  9967. (JSC::DFG::CSEPhase::putStructureStoreElimination):
  9968. (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
  9969. * dfg/DFGNode.h:
  9970. (JSC::DFG::Node::hasStructureTransitionData):
  9971. * dfg/DFGNodeType.h:
  9972. (DFG):
  9973. * dfg/DFGOperations.cpp:
  9974. * dfg/DFGOperations.h:
  9975. * dfg/DFGPredictionPropagationPhase.cpp:
  9976. (JSC::DFG::PredictionPropagationPhase::propagate):
  9977. * dfg/DFGSpeculativeJIT.cpp:
  9978. (JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
  9979. (DFG):
  9980. (JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
  9981. * dfg/DFGSpeculativeJIT.h:
  9982. (JSC::DFG::SpeculativeJIT::callOperation):
  9983. (SpeculativeJIT):
  9984. * dfg/DFGSpeculativeJIT32_64.cpp:
  9985. (JSC::DFG::SpeculativeJIT::compile):
  9986. * dfg/DFGSpeculativeJIT64.cpp:
  9987. (JSC::DFG::SpeculativeJIT::compile):
  9988. * runtime/Structure.cpp:
  9989. (JSC::nextOutOfLineStorageCapacity):
  9990. * runtime/Structure.h:
  9991. (JSC):
  9992. 2012-07-16 Oliver Hunt <oliver@apple.com>
  9993. dumpCallFrame is broken in ToT
  9994. https://bugs.webkit.org/show_bug.cgi?id=91444
  9995. Reviewed by Gavin Barraclough.
  9996. Various changes have been made to the SF calling convention, but
  9997. dumpCallFrame has not been updated to reflect these changes.
  9998. That resulted in both bogus information, as well as numerous
  9999. assertions of sadness.
  10000. This patch makes dumpCallFrame actually work again and adds the
  10001. wonderful feature of telling you the name of the variable that a
  10002. register reflects, or what value it contains.
  10003. * bytecode/CodeBlock.cpp:
  10004. (JSC::CodeBlock::nameForRegister):
  10005. A really innefficient mechanism for finding the name of a local register.
  10006. This should only ever be used by debug code so this should be okay.
  10007. * bytecode/CodeBlock.h:
  10008. (CodeBlock):
  10009. * bytecompiler/BytecodeGenerator.cpp:
  10010. (JSC::BytecodeGenerator::generate):
  10011. Debug builds no longer throw away a functions symbol table, this allows
  10012. us to actually perform a register# to name mapping
  10013. * dfg/DFGJITCompiler.cpp:
  10014. (JSC::DFG::JITCompiler::link):
  10015. We weren't propogating the bytecode offset here leading to assertions
  10016. in debug builds when dumping bytecode of DFG compiled code.
  10017. * interpreter/Interpreter.cpp:
  10018. (JSC):
  10019. (JSC::Interpreter::dumpRegisters):
  10020. Rework to actually be correct.
  10021. (JSC::getCallerInfo):
  10022. Return the byteocde offset as well now, given we have to determine it
  10023. anyway.
  10024. (JSC::Interpreter::getStackTrace):
  10025. (JSC::Interpreter::retrieveCallerFromVMCode):
  10026. * interpreter/Interpreter.h:
  10027. (Interpreter):
  10028. * jsc.cpp:
  10029. (GlobalObject::finishCreation):
  10030. (functionDumpCallFrame):
  10031. Give debug builds of JSC a method for calling dumpCallFrame so we can
  10032. inspect a callframe without requiring us to break in a debugger.
  10033. 2012-07-18 Filip Pizlo <fpizlo@apple.com>
  10034. DFG 32-bit PutById transition stub storage reallocation case copies the first pointer of each JSValue instead of the whole JSValue
  10035. https://bugs.webkit.org/show_bug.cgi?id=91599
  10036. Reviewed by Geoffrey Garen.
  10037. * dfg/DFGRepatch.cpp:
  10038. (JSC::DFG::emitPutTransitionStub):
  10039. 2012-07-17 Filip Pizlo <fpizlo@apple.com>
  10040. DFG 32-bit PutById transition stub passes the payload/tag arguments to a DFG operation in the wrong order
  10041. https://bugs.webkit.org/show_bug.cgi?id=91576
  10042. Reviewed by Gavin Barraclough.
  10043. * dfg/DFGRepatch.cpp:
  10044. (JSC::DFG::emitPutTransitionStub):
  10045. 2012-07-17 Filip Pizlo <fpizlo@apple.com>
  10046. [Qt] REGRESSION(r122768, r122771): They broke jquery/data.html and inspector/elements/edit-dom-actions.html
  10047. https://bugs.webkit.org/show_bug.cgi?id=91476
  10048. Reviewed by Mark Hahnenberg.
  10049. The 32-bit repatching code was not correctly adapted to the new world where there may not always
  10050. be an available scratch register. Fixed it by ensuring that the scratch register we select does
  10051. not overlap with the value tag.
  10052. * dfg/DFGRepatch.cpp:
  10053. (JSC::DFG::generateProtoChainAccessStub):
  10054. (JSC::DFG::tryCacheGetByID):
  10055. (JSC::DFG::tryBuildGetByIDList):
  10056. (JSC::DFG::emitPutReplaceStub):
  10057. 2012-07-17 Gabor Rapcsanyi <rgabor@webkit.org>
  10058. Unreviewed buildfix from Zoltan Herczeg after 122768.
  10059. * dfg/DFGCCallHelpers.h:
  10060. (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
  10061. (CCallHelpers):
  10062. 2012-07-17 David Barr <davidbarr@chromium.org>
  10063. Introduce ENABLE_CSS_IMAGE_ORIENTATION compile flag
  10064. https://bugs.webkit.org/show_bug.cgi?id=89055
  10065. Reviewed by Kent Tamura.
  10066. The css3-images module is at candidate recommendation.
  10067. http://www.w3.org/TR/2012/CR-css3-images-20120417/#the-image-orientation
  10068. Add a configuration option for CSS image-orientation support, disabling it by default.
  10069. * Configurations/FeatureDefines.xcconfig:
  10070. 2012-07-16 Filip Pizlo <fpizlo@apple.com>
  10071. Unreviewed, roll out 122790 because it broke the Windows build. I'm not
  10072. sure what to do with exported symbols that are predicated on NDEBUG.
  10073. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  10074. * bytecode/CodeBlock.cpp:
  10075. (JSC):
  10076. * bytecode/CodeBlock.h:
  10077. (CodeBlock):
  10078. * bytecompiler/BytecodeGenerator.cpp:
  10079. (JSC::BytecodeGenerator::generate):
  10080. * dfg/DFGJITCompiler.cpp:
  10081. (JSC::DFG::JITCompiler::link):
  10082. * interpreter/Interpreter.cpp:
  10083. (JSC):
  10084. (JSC::Interpreter::dumpRegisters):
  10085. (JSC::getCallerInfo):
  10086. (JSC::Interpreter::getStackTrace):
  10087. (JSC::Interpreter::retrieveCallerFromVMCode):
  10088. * interpreter/Interpreter.h:
  10089. (Interpreter):
  10090. * jsc.cpp:
  10091. (GlobalObject::finishCreation):
  10092. 2012-07-16 Oliver Hunt <oliver@apple.com>
  10093. dumpCallFrame is broken in ToT
  10094. https://bugs.webkit.org/show_bug.cgi?id=91444
  10095. Reviewed by Gavin Barraclough.
  10096. Various changes have been made to the SF calling convention, but
  10097. dumpCallFrame has not been updated to reflect these changes.
  10098. That resulted in both bogus information, as well as numerous
  10099. assertions of sadness.
  10100. This patch makes dumpCallFrame actually work again and adds the
  10101. wonderful feature of telling you the name of the variable that a
  10102. register reflects, or what value it contains.
  10103. * bytecode/CodeBlock.cpp:
  10104. (JSC::CodeBlock::nameForRegister):
  10105. A really innefficient mechanism for finding the name of a local register.
  10106. This should only ever be used by debug code so this should be okay.
  10107. * bytecode/CodeBlock.h:
  10108. (CodeBlock):
  10109. * bytecompiler/BytecodeGenerator.cpp:
  10110. (JSC::BytecodeGenerator::generate):
  10111. Debug builds no longer throw away a functions symbol table, this allows
  10112. us to actually perform a register# to name mapping
  10113. * dfg/DFGJITCompiler.cpp:
  10114. (JSC::DFG::JITCompiler::link):
  10115. We weren't propogating the bytecode offset here leading to assertions
  10116. in debug builds when dumping bytecode of DFG compiled code.
  10117. * interpreter/Interpreter.cpp:
  10118. (JSC):
  10119. (JSC::Interpreter::dumpRegisters):
  10120. Rework to actually be correct.
  10121. (JSC::getCallerInfo):
  10122. Return the byteocde offset as well now, given we have to determine it
  10123. anyway.
  10124. (JSC::Interpreter::getStackTrace):
  10125. (JSC::Interpreter::retrieveCallerFromVMCode):
  10126. * interpreter/Interpreter.h:
  10127. (Interpreter):
  10128. * jsc.cpp:
  10129. (GlobalObject::finishCreation):
  10130. (functionDumpCallFrame):
  10131. Give debug builds of JSC a method for calling dumpCallFrame so we can
  10132. inspect a callframe without requiring us to break in a debugger.
  10133. 2012-07-16 Filip Pizlo <fpizlo@apple.com>
  10134. Unreviewed, adding forgotten files.
  10135. * dfg/DFGRegisterSet.h: Added.
  10136. (DFG):
  10137. (RegisterSet):
  10138. (JSC::DFG::RegisterSet::RegisterSet):
  10139. (JSC::DFG::RegisterSet::asPOD):
  10140. (JSC::DFG::RegisterSet::copyInfo):
  10141. (JSC::DFG::RegisterSet::set):
  10142. (JSC::DFG::RegisterSet::setGPRByIndex):
  10143. (JSC::DFG::RegisterSet::clear):
  10144. (JSC::DFG::RegisterSet::get):
  10145. (JSC::DFG::RegisterSet::getGPRByIndex):
  10146. (JSC::DFG::RegisterSet::getFreeGPR):
  10147. (JSC::DFG::RegisterSet::setFPRByIndex):
  10148. (JSC::DFG::RegisterSet::getFPRByIndex):
  10149. (JSC::DFG::RegisterSet::setByIndex):
  10150. (JSC::DFG::RegisterSet::getByIndex):
  10151. (JSC::DFG::RegisterSet::numberOfSetGPRs):
  10152. (JSC::DFG::RegisterSet::numberOfSetFPRs):
  10153. (JSC::DFG::RegisterSet::numberOfSetRegisters):
  10154. (JSC::DFG::RegisterSet::setBit):
  10155. (JSC::DFG::RegisterSet::clearBit):
  10156. (JSC::DFG::RegisterSet::getBit):
  10157. * dfg/DFGScratchRegisterAllocator.h: Added.
  10158. (DFG):
  10159. (ScratchRegisterAllocator):
  10160. (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
  10161. (JSC::DFG::ScratchRegisterAllocator::lock):
  10162. (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
  10163. (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
  10164. (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
  10165. (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
  10166. (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
  10167. (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
  10168. (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
  10169. (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
  10170. (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
  10171. 2012-07-15 Filip Pizlo <fpizlo@apple.com>
  10172. DFG PutById transition should handle storage allocation, and inline it
  10173. https://bugs.webkit.org/show_bug.cgi?id=91337
  10174. Reviewed by Oliver Hunt.
  10175. This enables the patching of DFG PutById to handle the out-of-line storage
  10176. allocation case. Furthermore, it inlines out-of-line storage allocation (and
  10177. reallocation) into the generated stubs.
  10178. To do this, this patch adds the ability to store the relevant register
  10179. allocation state (i.e. the set of in-use registers) in the structure stub
  10180. info so that the stub generation code can more flexibly select scratch
  10181. registers: sometimes it needs none, sometimes one - or sometimes up to
  10182. three. Moreover, to make the stub generation register allocation simple and
  10183. maintainable, this patch introduces a reusable scratch register allocator
  10184. class. This register allocator understands that some registers are in use by
  10185. the main path code and so must be spilled as necessary, other registers are
  10186. locked for use in the stub itself and so cannot even be spilled, while still
  10187. others may be allocated for scratch purposes. A scratch register that is
  10188. used must be spilled. If a register is locked, it cannot be used as a
  10189. scratch register. If a register is used, it can be used as a scratch
  10190. register so long as it is spilled.
  10191. This is a sub-1% speed-up on V8 and neutral elsewhere.
  10192. * GNUmakefile.list.am:
  10193. * JavaScriptCore.xcodeproj/project.pbxproj:
  10194. * assembler/MacroAssemblerCodeRef.h:
  10195. (FunctionPtr):
  10196. (JSC::FunctionPtr::FunctionPtr):
  10197. * bytecode/StructureStubInfo.h:
  10198. * dfg/DFGCCallHelpers.h:
  10199. (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
  10200. (CCallHelpers):
  10201. * dfg/DFGGPRInfo.h:
  10202. * dfg/DFGJITCompiler.cpp:
  10203. (JSC::DFG::JITCompiler::link):
  10204. * dfg/DFGJITCompiler.h:
  10205. (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
  10206. (PropertyAccessRecord):
  10207. * dfg/DFGOperations.cpp:
  10208. * dfg/DFGOperations.h:
  10209. * dfg/DFGRegisterBank.h:
  10210. (JSC::DFG::RegisterBank::isInUse):
  10211. (RegisterBank):
  10212. * dfg/DFGRegisterSet.h: Added.
  10213. (DFG):
  10214. (RegisterSet):
  10215. (JSC::DFG::RegisterSet::RegisterSet):
  10216. (JSC::DFG::RegisterSet::asPOD):
  10217. (JSC::DFG::RegisterSet::copyInfo):
  10218. (JSC::DFG::RegisterSet::set):
  10219. (JSC::DFG::RegisterSet::setGPRByIndex):
  10220. (JSC::DFG::RegisterSet::clear):
  10221. (JSC::DFG::RegisterSet::get):
  10222. (JSC::DFG::RegisterSet::getGPRByIndex):
  10223. (JSC::DFG::RegisterSet::getFreeGPR):
  10224. (JSC::DFG::RegisterSet::setFPRByIndex):
  10225. (JSC::DFG::RegisterSet::getFPRByIndex):
  10226. (JSC::DFG::RegisterSet::setByIndex):
  10227. (JSC::DFG::RegisterSet::getByIndex):
  10228. (JSC::DFG::RegisterSet::numberOfSetGPRs):
  10229. (JSC::DFG::RegisterSet::numberOfSetFPRs):
  10230. (JSC::DFG::RegisterSet::numberOfSetRegisters):
  10231. (JSC::DFG::RegisterSet::setBit):
  10232. (JSC::DFG::RegisterSet::clearBit):
  10233. (JSC::DFG::RegisterSet::getBit):
  10234. * dfg/DFGRepatch.cpp:
  10235. (JSC::DFG::generateProtoChainAccessStub):
  10236. (JSC::DFG::tryCacheGetByID):
  10237. (JSC::DFG::tryBuildGetByIDList):
  10238. (JSC::DFG::emitPutReplaceStub):
  10239. (JSC::DFG::emitPutTransitionStub):
  10240. (JSC::DFG::tryCachePutByID):
  10241. (JSC::DFG::tryBuildPutByIdList):
  10242. * dfg/DFGScratchRegisterAllocator.h: Added.
  10243. (DFG):
  10244. (ScratchRegisterAllocator):
  10245. (JSC::DFG::ScratchRegisterAllocator::ScratchRegisterAllocator):
  10246. (JSC::DFG::ScratchRegisterAllocator::lock):
  10247. (JSC::DFG::ScratchRegisterAllocator::allocateScratch):
  10248. (JSC::DFG::ScratchRegisterAllocator::allocateScratchGPR):
  10249. (JSC::DFG::ScratchRegisterAllocator::allocateScratchFPR):
  10250. (JSC::DFG::ScratchRegisterAllocator::didReuseRegisters):
  10251. (JSC::DFG::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
  10252. (JSC::DFG::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
  10253. (JSC::DFG::ScratchRegisterAllocator::desiredScratchBufferSize):
  10254. (JSC::DFG::ScratchRegisterAllocator::preserveUsedRegistersToScratchBuffer):
  10255. (JSC::DFG::ScratchRegisterAllocator::restoreUsedRegistersFromScratchBuffer):
  10256. * dfg/DFGSpeculativeJIT.h:
  10257. (SpeculativeJIT):
  10258. (JSC::DFG::SpeculativeJIT::usedRegisters):
  10259. * dfg/DFGSpeculativeJIT32_64.cpp:
  10260. (JSC::DFG::SpeculativeJIT::cachedGetById):
  10261. (JSC::DFG::SpeculativeJIT::cachedPutById):
  10262. (JSC::DFG::SpeculativeJIT::compile):
  10263. * dfg/DFGSpeculativeJIT64.cpp:
  10264. (JSC::DFG::SpeculativeJIT::cachedGetById):
  10265. (JSC::DFG::SpeculativeJIT::cachedPutById):
  10266. (JSC::DFG::SpeculativeJIT::compile):
  10267. * heap/CopiedAllocator.h:
  10268. (CopiedAllocator):
  10269. (JSC::CopiedAllocator::fastPathShouldSucceed):
  10270. (JSC):
  10271. 2012-07-16 Patrick Gansterer <paroga@webkit.org>
  10272. Add dfg switch to create_jit_stubs script
  10273. https://bugs.webkit.org/show_bug.cgi?id=91256
  10274. Reviewed by Geoffrey Garen.
  10275. * create_jit_stubs: Add a switch to enable or disable the generation of
  10276. stub functions in #if ENABLE(DFG_JIT) conditions.
  10277. 2012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
  10278. Unreviewed buildfix after r122729. Typo fix.
  10279. * assembler/MacroAssemblerARM.h:
  10280. (JSC::MacroAssemblerARM::add32):
  10281. 2012-07-16 Gabor Rapcsanyi <rgabor@webkit.org>
  10282. Unreviewed buildfix from Zoltan Herczeg after r122677.
  10283. Implement missing add32 function to MacroAssemblerARM.
  10284. * assembler/MacroAssemblerARM.h:
  10285. (JSC::MacroAssemblerARM::add32):
  10286. (MacroAssemblerARM):
  10287. 2012-07-14 Filip Pizlo <fpizlo@apple.com>
  10288. DFG PutByVal opcodes should accept more than 3 operands
  10289. https://bugs.webkit.org/show_bug.cgi?id=91332
  10290. Reviewed by Oliver Hunt.
  10291. Turned PutByVal/PutByValAlias into var-arg nodes, so that we can give them
  10292. 4 or more operands in the future.
  10293. * dfg/DFGAbstractState.cpp:
  10294. (JSC::DFG::AbstractState::execute):
  10295. * dfg/DFGByteCodeParser.cpp:
  10296. (JSC::DFG::ByteCodeParser::parseBlock):
  10297. * dfg/DFGCSEPhase.cpp:
  10298. (JSC::DFG::CSEPhase::getByValLoadElimination):
  10299. (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
  10300. (JSC::DFG::CSEPhase::performNodeCSE):
  10301. * dfg/DFGFixupPhase.cpp:
  10302. (JSC::DFG::FixupPhase::fixupNode):
  10303. (JSC::DFG::FixupPhase::fixDoubleEdge):
  10304. * dfg/DFGGraph.h:
  10305. (JSC::DFG::Graph::byValIsPure):
  10306. (JSC::DFG::Graph::varArgNumChildren):
  10307. (Graph):
  10308. (JSC::DFG::Graph::numChildren):
  10309. (JSC::DFG::Graph::varArgChild):
  10310. (JSC::DFG::Graph::child):
  10311. * dfg/DFGNodeType.h:
  10312. (DFG):
  10313. * dfg/DFGPredictionPropagationPhase.cpp:
  10314. (JSC::DFG::PredictionPropagationPhase::propagate):
  10315. * dfg/DFGSpeculativeJIT.cpp:
  10316. (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
  10317. (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
  10318. * dfg/DFGSpeculativeJIT32_64.cpp:
  10319. (JSC::DFG::SpeculativeJIT::compile):
  10320. * dfg/DFGSpeculativeJIT64.cpp:
  10321. (JSC::DFG::SpeculativeJIT::compile):
  10322. 2012-07-14 Filip Pizlo <fpizlo@apple.com>
  10323. Rationalize and optimize storage allocation
  10324. https://bugs.webkit.org/show_bug.cgi?id=91303
  10325. Reviewed by Oliver Hunt.
  10326. This implements a backwards bump allocator for copied space storage
  10327. allocation, shown in pseudo-code below:
  10328. pointer bump(size) {
  10329. pointer tmp = allocator->remaining;
  10330. tmp -= size;
  10331. if (tmp < 0)
  10332. fail;
  10333. allocator->remaining = tmp;
  10334. return allocator->payloadEnd - tmp - size;
  10335. }
  10336. The advantage of this allocator is that it:
  10337. - Only requires one comparison in the common case where size is known to
  10338. not be huge, and this comparison can be done by checking the sign bit
  10339. of the subtraction.
  10340. - Can be implemented even when only one register is available. This
  10341. register is reused for both temporary storage during allocation and
  10342. for the result.
  10343. - Preserves the behavior that memory in a block is filled in from lowest
  10344. address to highest address, which allows for a cheap reallocation fast
  10345. path.
  10346. - Is resilient against the block used for allocation being the last one
  10347. in virtual memory, thereby otherwise leading to the risk of overflow
  10348. in the bump pointer, despite only doing one branch.
  10349. In order to implement this allocator using the smallest possible chunk
  10350. of code, I refactored the copied space code so that all of the allocation
  10351. logic is in CopiedAllocator, and all of the state is in either
  10352. CopiedBlock or CopiedAllocator. This should make changing the allocation
  10353. fast path easier in the future.
  10354. In order to do this, I needed to add some new assembler support,
  10355. particularly for various forms of add(address, register) and negPtr().
  10356. This is performance neutral. The purpose of this change is to facilitate
  10357. further inlining of storage allocation without having to reserve
  10358. additional registers or emit too much code.
  10359. * assembler/MacroAssembler.h:
  10360. (JSC::MacroAssembler::addPtr):
  10361. (MacroAssembler):
  10362. (JSC::MacroAssembler::negPtr):
  10363. * assembler/MacroAssemblerARMv7.h:
  10364. (MacroAssemblerARMv7):
  10365. (JSC::MacroAssemblerARMv7::add32):
  10366. * assembler/MacroAssemblerX86.h:
  10367. (JSC::MacroAssemblerX86::add32):
  10368. (MacroAssemblerX86):
  10369. * assembler/MacroAssemblerX86_64.h:
  10370. (MacroAssemblerX86_64):
  10371. (JSC::MacroAssemblerX86_64::addPtr):
  10372. (JSC::MacroAssemblerX86_64::negPtr):
  10373. * assembler/X86Assembler.h:
  10374. (X86Assembler):
  10375. (JSC::X86Assembler::addl_mr):
  10376. (JSC::X86Assembler::addq_mr):
  10377. (JSC::X86Assembler::negq_r):
  10378. * heap/CopiedAllocator.h:
  10379. (CopiedAllocator):
  10380. (JSC::CopiedAllocator::isValid):
  10381. (JSC::CopiedAllocator::CopiedAllocator):
  10382. (JSC::CopiedAllocator::tryAllocate):
  10383. (JSC):
  10384. (JSC::CopiedAllocator::tryReallocate):
  10385. (JSC::CopiedAllocator::forceAllocate):
  10386. (JSC::CopiedAllocator::resetCurrentBlock):
  10387. (JSC::CopiedAllocator::setCurrentBlock):
  10388. (JSC::CopiedAllocator::currentCapacity):
  10389. * heap/CopiedBlock.h:
  10390. (CopiedBlock):
  10391. (JSC::CopiedBlock::create):
  10392. (JSC::CopiedBlock::zeroFillWilderness):
  10393. (JSC::CopiedBlock::CopiedBlock):
  10394. (JSC::CopiedBlock::payloadEnd):
  10395. (JSC):
  10396. (JSC::CopiedBlock::payloadCapacity):
  10397. (JSC::CopiedBlock::data):
  10398. (JSC::CopiedBlock::dataEnd):
  10399. (JSC::CopiedBlock::dataSize):
  10400. (JSC::CopiedBlock::wilderness):
  10401. (JSC::CopiedBlock::wildernessEnd):
  10402. (JSC::CopiedBlock::wildernessSize):
  10403. (JSC::CopiedBlock::size):
  10404. * heap/CopiedSpace.cpp:
  10405. (JSC::CopiedSpace::tryAllocateSlowCase):
  10406. (JSC::CopiedSpace::tryAllocateOversize):
  10407. (JSC::CopiedSpace::tryReallocate):
  10408. (JSC::CopiedSpace::doneFillingBlock):
  10409. (JSC::CopiedSpace::doneCopying):
  10410. * heap/CopiedSpace.h:
  10411. (CopiedSpace):
  10412. * heap/CopiedSpaceInlineMethods.h:
  10413. (JSC::CopiedSpace::startedCopying):
  10414. (JSC::CopiedSpace::allocateBlockForCopyingPhase):
  10415. (JSC::CopiedSpace::allocateBlock):
  10416. (JSC::CopiedSpace::tryAllocate):
  10417. (JSC):
  10418. * heap/MarkStack.cpp:
  10419. (JSC::SlotVisitor::startCopying):
  10420. (JSC::SlotVisitor::allocateNewSpace):
  10421. (JSC::SlotVisitor::doneCopying):
  10422. * heap/SlotVisitor.h:
  10423. (JSC::SlotVisitor::SlotVisitor):
  10424. * jit/JIT.h:
  10425. * jit/JITInlineMethods.h:
  10426. (JSC::JIT::emitAllocateBasicStorage):
  10427. (JSC::JIT::emitAllocateJSArray):
  10428. 2012-07-13 Mark Lam <mark.lam@apple.com>
  10429. OfflineASM Pretty printing and commenting enhancements.
  10430. https://bugs.webkit.org/show_bug.cgi?id=91281
  10431. Reviewed by Filip Pizlo.
  10432. Added some minor pretty printing in the OfflineASM.
  10433. Also added infrastruture for adding multiple types of comments and
  10434. annotations with the ability to enable/disable them in the generated
  10435. output as desired.
  10436. * GNUmakefile.list.am: add new file config.rb.
  10437. * llint/LLIntOfflineAsmConfig.h:
  10438. Added OFFLINE_ASM_BEGIN, OFFLINE_ASM_END, and OFFLINE_ASM_LOCAL_LABEL macros.
  10439. This will allow us to redefine these for other backends later.
  10440. * llint/LowLevelInterpreter32_64.asm:
  10441. Add a small example of instruction annotations for now.
  10442. * llint/LowLevelInterpreter64.asm:
  10443. Add a small example of instruction annotations for now.
  10444. * offlineasm/armv7.rb: Added handling of annotations.
  10445. * offlineasm/asm.rb:
  10446. Added machinery to dump the new comments and annotations.
  10447. Also added some indentations to make the output a little prettier.
  10448. * offlineasm/ast.rb: Added annotation field in class Instruction.
  10449. * offlineasm/backends.rb:
  10450. * offlineasm/config.rb: Added.
  10451. Currently only contains commenting options. This file is meant to be
  10452. a centralized place for build config values much like config.h for
  10453. JavaScriptCore.
  10454. * offlineasm/generate_offset_extractor.rb:
  10455. * offlineasm/instructions.rb:
  10456. * offlineasm/offsets.rb:
  10457. * offlineasm/opt.rb:
  10458. * offlineasm/parser.rb: Parse and record annotations.
  10459. * offlineasm/registers.rb:
  10460. * offlineasm/self_hash.rb:
  10461. * offlineasm/settings.rb:
  10462. * offlineasm/transform.rb:
  10463. * offlineasm/x86.rb: Added handling of annotations.
  10464. 2012-07-13 Filip Pizlo <fpizlo@apple.com>
  10465. ASSERTION FAILED: use.useKind() != DoubleUse
  10466. https://bugs.webkit.org/show_bug.cgi?id=91082
  10467. Reviewed by Geoffrey Garen.
  10468. The implementation of Branch() was unwisely relying on register allocation state
  10469. to decide what speculations to perform. That's never correct.
  10470. * dfg/DFGSpeculativeJIT32_64.cpp:
  10471. (JSC::DFG::SpeculativeJIT::compile):
  10472. * dfg/DFGSpeculativeJIT64.cpp:
  10473. (JSC::DFG::SpeculativeJIT::compile):
  10474. 2012-07-13 Sheriff Bot <webkit.review.bot@gmail.com>
  10475. Unreviewed, rolling out r122640.
  10476. http://trac.webkit.org/changeset/122640
  10477. https://bugs.webkit.org/show_bug.cgi?id=91298
  10478. LLInt apparently does not expect to mark these (Requested by
  10479. olliej on #webkit).
  10480. * bytecode/CodeBlock.cpp:
  10481. (JSC::CodeBlock::visitStructures):
  10482. (JSC::CodeBlock::stronglyVisitStrongReferences):
  10483. 2012-07-13 Oliver Hunt <oliver@apple.com>
  10484. LLInt fails to mark structures stored in the bytecode
  10485. https://bugs.webkit.org/show_bug.cgi?id=91296
  10486. Reviewed by Geoffrey Garen.
  10487. LLInt stores structures in the bytecode, so we need to visit the appropriate
  10488. instructions as we would if we were running in the classic interpreter.
  10489. This requires adding additional checks for the LLInt specific opcodes, and
  10490. the lint specific variants of operand ordering.
  10491. * bytecode/CodeBlock.cpp:
  10492. (JSC::CodeBlock::visitStructures):
  10493. (JSC::CodeBlock::stronglyVisitStrongReferences):
  10494. 2012-07-13 Yong Li <yoli@rim.com>
  10495. [BlackBerry] Implement GCActivityCallback with platform timer
  10496. https://bugs.webkit.org/show_bug.cgi?id=90175
  10497. Reviewed by Rob Buis.
  10498. Implement GCActivityCallback and HeapTimer for BlackBerry port.
  10499. * heap/HeapTimer.cpp:
  10500. (JSC):
  10501. (JSC::HeapTimer::HeapTimer):
  10502. (JSC::HeapTimer::~HeapTimer):
  10503. (JSC::HeapTimer::timerDidFire):
  10504. (JSC::HeapTimer::synchronize):
  10505. (JSC::HeapTimer::invalidate):
  10506. (JSC::HeapTimer::didStartVMShutdown):
  10507. * heap/HeapTimer.h:
  10508. (HeapTimer):
  10509. * runtime/GCActivityCallbackBlackBerry.cpp:
  10510. (JSC):
  10511. (JSC::DefaultGCActivityCallback::doWork):
  10512. (JSC::DefaultGCActivityCallback::didAllocate):
  10513. (JSC::DefaultGCActivityCallback::willCollect):
  10514. (JSC::DefaultGCActivityCallback::cancel):
  10515. 2012-07-13 Patrick Gansterer <paroga@webkit.org>
  10516. [WIN] Fix compilation of DFGRepatch.cpp
  10517. https://bugs.webkit.org/show_bug.cgi?id=91241
  10518. Reviewed by Geoffrey Garen.
  10519. Use intptr_t instead of uintptr_t when calling CodeLocationCommon::dataLabelPtrAtOffset(int)
  10520. to fix MSVC "unary minus operator applied to unsigned type, result still unsigned" warning.
  10521. * dfg/DFGRepatch.cpp:
  10522. (JSC::DFG::dfgResetGetByID):
  10523. (JSC::DFG::dfgResetPutByID):
  10524. 2012-07-13 Patrick Gansterer <paroga@webkit.org>
  10525. Fix ARM_TRADITIONAL JIT for COMPILER(MSVC) and COMPILER(RVCT) after r121885
  10526. https://bugs.webkit.org/show_bug.cgi?id=91238
  10527. Reviewed by Zoltan Herczeg.
  10528. r121885 changed the assembler instruction only for COMPILER(GCC).
  10529. Use the same instructions for the other compilers too.
  10530. * jit/JITStubs.cpp:
  10531. (JSC::ctiTrampoline):
  10532. (JSC::ctiTrampolineEnd):
  10533. (JSC::ctiVMThrowTrampoline):
  10534. 2012-07-12 Filip Pizlo <fpizlo@apple.com>
  10535. DFG property access stubs should use structure transition watchpoints
  10536. https://bugs.webkit.org/show_bug.cgi?id=91135
  10537. Reviewed by Geoffrey Garen.
  10538. This adds a Watchpoint subclass that will clear a structure stub (i.e.
  10539. a property access stub) when fired. The DFG stub generation code now
  10540. uses this optimization.
  10541. * CMakeLists.txt:
  10542. * GNUmakefile.list.am:
  10543. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  10544. * JavaScriptCore.xcodeproj/project.pbxproj:
  10545. * Target.pri:
  10546. * bytecode/CodeBlock.cpp:
  10547. (JSC):
  10548. (JSC::CodeBlock::finalizeUnconditionally):
  10549. (JSC::CodeBlock::resetStub):
  10550. (JSC::CodeBlock::resetStubInternal):
  10551. * bytecode/CodeBlock.h:
  10552. (JSC):
  10553. (CodeBlock):
  10554. * bytecode/StructureStubClearingWatchpoint.cpp: Added.
  10555. (JSC):
  10556. (JSC::StructureStubClearingWatchpoint::~StructureStubClearingWatchpoint):
  10557. (JSC::StructureStubClearingWatchpoint::push):
  10558. (JSC::StructureStubClearingWatchpoint::fireInternal):
  10559. (JSC::WatchpointsOnStructureStubInfo::~WatchpointsOnStructureStubInfo):
  10560. (JSC::WatchpointsOnStructureStubInfo::addWatchpoint):
  10561. (JSC::WatchpointsOnStructureStubInfo::ensureReferenceAndAddWatchpoint):
  10562. * bytecode/StructureStubClearingWatchpoint.h: Added.
  10563. (JSC):
  10564. (StructureStubClearingWatchpoint):
  10565. (JSC::StructureStubClearingWatchpoint::StructureStubClearingWatchpoint):
  10566. (WatchpointsOnStructureStubInfo):
  10567. (JSC::WatchpointsOnStructureStubInfo::WatchpointsOnStructureStubInfo):
  10568. (JSC::WatchpointsOnStructureStubInfo::codeBlock):
  10569. (JSC::WatchpointsOnStructureStubInfo::stubInfo):
  10570. * bytecode/StructureStubInfo.h:
  10571. (JSC::StructureStubInfo::reset):
  10572. (JSC::StructureStubInfo::addWatchpoint):
  10573. (StructureStubInfo):
  10574. * dfg/DFGRepatch.cpp:
  10575. (JSC::DFG::addStructureTransitionCheck):
  10576. (DFG):
  10577. (JSC::DFG::generateProtoChainAccessStub):
  10578. (JSC::DFG::emitPutTransitionStub):
  10579. * jit/JumpReplacementWatchpoint.h:
  10580. 2012-07-12 Filip Pizlo <fpizlo@apple.com>
  10581. DFG CFA may get overzealous in loops that have code that must exit
  10582. https://bugs.webkit.org/show_bug.cgi?id=91188
  10583. Reviewed by Gavin Barraclough.
  10584. Ensure that if the CFA assumes that an operation must exit, then it will always exit
  10585. no matter what happens after. That's necessary to preserve soundness.
  10586. Remove a broken fixup done by the DFG simplifier, where it was trying to say that the
  10587. variable-at-head was the first access in the second block in the merge, if the first
  10588. block did not read the variable. That's totally wrong, if the first block was in fact
  10589. doing a phantom read. I removed that fixup and instead hardened the rest of the
  10590. compiler.
  10591. * dfg/DFGAbstractState.cpp:
  10592. (JSC::DFG::AbstractState::endBasicBlock):
  10593. * dfg/DFGBasicBlock.h:
  10594. (JSC::DFG::BasicBlock::BasicBlock):
  10595. (BasicBlock):
  10596. * dfg/DFGCFAPhase.cpp:
  10597. (JSC::DFG::CFAPhase::performBlockCFA):
  10598. * dfg/DFGCFGSimplificationPhase.cpp:
  10599. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  10600. * dfg/DFGConstantFoldingPhase.cpp:
  10601. (JSC::DFG::ConstantFoldingPhase::ConstantFoldingPhase):
  10602. (JSC::DFG::ConstantFoldingPhase::run):
  10603. (ConstantFoldingPhase):
  10604. (JSC::DFG::ConstantFoldingPhase::foldConstants):
  10605. (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
  10606. * dfg/DFGVariableEventStream.cpp:
  10607. (JSC::DFG::VariableEventStream::reconstruct):
  10608. 2012-07-12 Allan Sandfeld Jensen <allan.jensen@nokia.com>
  10609. [Qt] Implement MemoryUsageSupport
  10610. https://bugs.webkit.org/show_bug.cgi?id=91094
  10611. Reviewed by Adam Barth.
  10612. Compile in MemoryStatistics so we can make use of the interface.
  10613. * Target.pri:
  10614. 2012-07-12 Csaba Osztrogonác <ossy@webkit.org>
  10615. Remove dead code after r122392.
  10616. https://bugs.webkit.org/show_bug.cgi?id=91049
  10617. Reviewed by Filip Pizlo.
  10618. * dfg/DFGSpeculativeJIT64.cpp:
  10619. (JSC::DFG::SpeculativeJIT::emitCall):
  10620. 2012-07-11 Adenilson Cavalcanti <cavalcantii@gmail.com>
  10621. Build fix + remove dead code
  10622. https://bugs.webkit.org/show_bug.cgi?id=91039
  10623. Reviewed by Filip Pizlo.
  10624. An unused variable was breaking compilation (thanks to warnings being treated as errors).
  10625. * dfg/DFGSpeculativeJIT32_64.cpp:
  10626. (JSC::DFG::SpeculativeJIT::emitCall):
  10627. 2012-07-11 Mark Rowe <mrowe@apple.com>
  10628. <http://webkit.org/b/91024> Build against the latest SDK when targeting older OS X versions.
  10629. Reviewed by Dan Bernstein.
  10630. The deployment target is already set to the version that we're targeting, and it's that setting
  10631. which determines which functionality from the SDK is available to us.
  10632. * Configurations/Base.xcconfig:
  10633. 2012-07-11 Filip Pizlo <fpizlo@apple.com>
  10634. DFG should have fast virtual calls
  10635. https://bugs.webkit.org/show_bug.cgi?id=90924
  10636. Reviewed by Gavin Barraclough.
  10637. Implements virtual call support in the style of the old JIT, with the
  10638. caveat that we still use the same slow path for both InternalFunction
  10639. calls and JSFunction calls. Also rationalized the way that our
  10640. CodeOrigin indices tie into exception checks (previously it was a
  10641. strange one-to-one mapping with fairly limited assertions; now it's a
  10642. one-to-many mapping for CodeOrigins to exception checks, respectively).
  10643. I also took the opportunity to clean up
  10644. CallLinkInfo::callReturnLocation, which previously was either a Call or
  10645. a NearCall. Now it's just a NearCall. As well, exceptions during slow
  10646. path call resolution are now handled by returning an exception throwing
  10647. thunk rather than returning null. And finally, I made a few things
  10648. public that were previously private-with-lots-of-friends, because I
  10649. truly despise the thought of listing each thunk generating function as
  10650. a friend of JSValue and friends.
  10651. * bytecode/CallLinkInfo.cpp:
  10652. (JSC::CallLinkInfo::unlink):
  10653. * bytecode/CallLinkInfo.h:
  10654. (CallLinkInfo):
  10655. * bytecode/CodeOrigin.h:
  10656. (JSC::CodeOrigin::CodeOrigin):
  10657. (JSC::CodeOrigin::isSet):
  10658. * dfg/DFGAssemblyHelpers.h:
  10659. (JSC::DFG::AssemblyHelpers::AssemblyHelpers):
  10660. * dfg/DFGCCallHelpers.h:
  10661. (JSC::DFG::CCallHelpers::CCallHelpers):
  10662. * dfg/DFGGPRInfo.h:
  10663. (GPRInfo):
  10664. * dfg/DFGJITCompiler.cpp:
  10665. (JSC::DFG::JITCompiler::link):
  10666. (JSC::DFG::JITCompiler::compileFunction):
  10667. * dfg/DFGJITCompiler.h:
  10668. (JSC::DFG::CallBeginToken::CallBeginToken):
  10669. (JSC::DFG::CallBeginToken::~CallBeginToken):
  10670. (CallBeginToken):
  10671. (JSC::DFG::CallBeginToken::set):
  10672. (JSC::DFG::CallBeginToken::registerWithExceptionCheck):
  10673. (JSC::DFG::CallBeginToken::codeOrigin):
  10674. (JSC::DFG::CallExceptionRecord::CallExceptionRecord):
  10675. (CallExceptionRecord):
  10676. (JSC::DFG::JITCompiler::currentCodeOriginIndex):
  10677. (JITCompiler):
  10678. (JSC::DFG::JITCompiler::beginCall):
  10679. (JSC::DFG::JITCompiler::notifyCall):
  10680. (JSC::DFG::JITCompiler::prepareForExceptionCheck):
  10681. (JSC::DFG::JITCompiler::addExceptionCheck):
  10682. (JSC::DFG::JITCompiler::addFastExceptionCheck):
  10683. * dfg/DFGOperations.cpp:
  10684. * dfg/DFGRepatch.cpp:
  10685. (JSC::DFG::dfgLinkFor):
  10686. * dfg/DFGSpeculativeJIT.h:
  10687. (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck):
  10688. * dfg/DFGSpeculativeJIT32_64.cpp:
  10689. (JSC::DFG::SpeculativeJIT::emitCall):
  10690. * dfg/DFGSpeculativeJIT64.cpp:
  10691. (JSC::DFG::SpeculativeJIT::emitCall):
  10692. * dfg/DFGThunks.cpp:
  10693. (JSC::DFG::emitPointerValidation):
  10694. (DFG):
  10695. (JSC::DFG::throwExceptionFromCallSlowPathGenerator):
  10696. (JSC::DFG::slowPathFor):
  10697. (JSC::DFG::linkForThunkGenerator):
  10698. (JSC::DFG::linkCallThunkGenerator):
  10699. (JSC::DFG::linkConstructThunkGenerator):
  10700. (JSC::DFG::virtualForThunkGenerator):
  10701. (JSC::DFG::virtualCallThunkGenerator):
  10702. (JSC::DFG::virtualConstructThunkGenerator):
  10703. * dfg/DFGThunks.h:
  10704. (DFG):
  10705. * jit/JIT.cpp:
  10706. (JSC::JIT::privateCompile):
  10707. (JSC::JIT::linkFor):
  10708. * runtime/Executable.h:
  10709. (ExecutableBase):
  10710. (JSC::ExecutableBase::offsetOfJITCodeFor):
  10711. (JSC::ExecutableBase::offsetOfNumParametersFor):
  10712. * runtime/JSValue.h:
  10713. (JSValue):
  10714. 2012-07-11 Filip Pizlo <fpizlo@apple.com>
  10715. Accidentally used the wrong license (3-clause instead of 2-clause) in some
  10716. files I just committed.
  10717. Rubber stamped by Oliver Hunt.
  10718. * bytecode/Watchpoint.cpp:
  10719. * bytecode/Watchpoint.h:
  10720. * jit/JumpReplacementWatchpoint.cpp:
  10721. * jit/JumpReplacementWatchpoint.h:
  10722. 2012-07-11 Filip Pizlo <fpizlo@apple.com>
  10723. Watchpoints and jump replacement should be decoupled
  10724. https://bugs.webkit.org/show_bug.cgi?id=91016
  10725. Reviewed by Oliver Hunt.
  10726. * CMakeLists.txt:
  10727. * GNUmakefile.list.am:
  10728. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  10729. * JavaScriptCore.xcodeproj/project.pbxproj:
  10730. * Target.pri:
  10731. * assembler/AbstractMacroAssembler.h:
  10732. (JSC):
  10733. (Label):
  10734. * bytecode/CodeBlock.h:
  10735. (JSC::CodeBlock::appendWatchpoint):
  10736. (JSC::CodeBlock::watchpoint):
  10737. (DFGData):
  10738. * bytecode/Watchpoint.cpp:
  10739. (JSC):
  10740. * bytecode/Watchpoint.h:
  10741. (JSC::Watchpoint::Watchpoint):
  10742. (Watchpoint):
  10743. (JSC::Watchpoint::fire):
  10744. * dfg/DFGSpeculativeJIT.h:
  10745. (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
  10746. * jit/JumpReplacementWatchpoint.cpp: Added.
  10747. (JSC):
  10748. (JSC::JumpReplacementWatchpoint::correctLabels):
  10749. (JSC::JumpReplacementWatchpoint::fireInternal):
  10750. * jit/JumpReplacementWatchpoint.h: Added.
  10751. (JSC):
  10752. (JumpReplacementWatchpoint):
  10753. (JSC::JumpReplacementWatchpoint::JumpReplacementWatchpoint):
  10754. (JSC::JumpReplacementWatchpoint::setDestination):
  10755. 2012-07-11 Kevin Ollivier <kevino@theolliviers.com>
  10756. [wx] Unreviewed build fix. Don't try to build udis86_itab.c since it's included by
  10757. another file.
  10758. * wscript:
  10759. 2012-07-11 Chao-ying Fu <fu@mips.com>
  10760. Add MIPS convertibleLoadPtr and other functions
  10761. https://bugs.webkit.org/show_bug.cgi?id=90714
  10762. Reviewed by Oliver Hunt.
  10763. * assembler/MIPSAssembler.h:
  10764. (JSC::MIPSAssembler::labelIgnoringWatchpoints):
  10765. (MIPSAssembler):
  10766. (JSC::MIPSAssembler::replaceWithLoad):
  10767. (JSC::MIPSAssembler::replaceWithAddressComputation):
  10768. * assembler/MacroAssemblerMIPS.h:
  10769. (JSC::MacroAssemblerMIPS::convertibleLoadPtr):
  10770. (MacroAssemblerMIPS):
  10771. 2012-07-11 Anders Carlsson <andersca@apple.com>
  10772. Add -Wtautological-compare and -Wsign-compare warning flags
  10773. https://bugs.webkit.org/show_bug.cgi?id=90994
  10774. Reviewed by Mark Rowe.
  10775. * Configurations/Base.xcconfig:
  10776. 2012-07-11 Benjamin Poulain <bpoulain@apple.com>
  10777. Simplify the copying of JSC ARMv7's LinkRecord
  10778. https://bugs.webkit.org/show_bug.cgi?id=90930
  10779. Reviewed by Filip Pizlo.
  10780. The class LinkRecord is used by value everywhere in ARMv7Assembler. The compiler uses
  10781. memmove() to move the objects.
  10782. The problem is memmove() is overkill for this object, moving the value can be done with
  10783. 3 load-store. This patch adds an operator= to the class doing more efficient copying.
  10784. This reduces the link time by 19%.
  10785. * assembler/ARMv7Assembler.h:
  10786. (JSC::ARMv7Assembler::LinkRecord::LinkRecord):
  10787. (JSC::ARMv7Assembler::LinkRecord::operator=):
  10788. (JSC::ARMv7Assembler::LinkRecord::from):
  10789. (JSC::ARMv7Assembler::LinkRecord::setFrom):
  10790. (JSC::ARMv7Assembler::LinkRecord::to):
  10791. (JSC::ARMv7Assembler::LinkRecord::type):
  10792. (JSC::ARMv7Assembler::LinkRecord::linkType):
  10793. (JSC::ARMv7Assembler::LinkRecord::setLinkType):
  10794. (JSC::ARMv7Assembler::LinkRecord::condition):
  10795. 2012-07-11 Andy Wingo <wingo@igalia.com>
  10796. jsc: Parse options before creating global data
  10797. https://bugs.webkit.org/show_bug.cgi?id=90975
  10798. Reviewed by Filip Pizlo.
  10799. This patch moves the options parsing in "jsc" before the creation
  10800. of the JSGlobalData, so that --useJIT=no has a chance to take
  10801. effect.
  10802. * jsc.cpp:
  10803. (CommandLine::parseArguments): Refactor to be a class, and take
  10804. argc and argv as constructor arguments.
  10805. (jscmain): Move arg parsing before JSGlobalData creation.
  10806. 2012-07-10 Filip Pizlo <fpizlo@apple.com>
  10807. REGRESSION(r122166): It made 170 tests crash on 32 bit platforms
  10808. https://bugs.webkit.org/show_bug.cgi?id=90852
  10809. Reviewed by Zoltan Herczeg.
  10810. If we can't use the range filter, we should still make sure that the
  10811. address is remotely sane, otherwise the hashtables will assert.
  10812. * jit/JITStubRoutine.h:
  10813. (JSC::JITStubRoutine::passesFilter):
  10814. 2012-07-10 Filip Pizlo <fpizlo@apple.com>
  10815. DFG recompilation heuristics should be based on count, not rate
  10816. https://bugs.webkit.org/show_bug.cgi?id=90146
  10817. Reviewed by Oliver Hunt.
  10818. Rolling r121511 back in after fixing the DFG's interpretation of op_div
  10819. profiling, with Gavin's rubber stamp.
  10820. This removes a bunch of code that was previously trying to prevent spurious
  10821. reoptimizations if a large enough majority of executions of a code block did
  10822. not result in OSR exit. It turns out that this code was purely harmful. This
  10823. patch removes all of that logic and replaces it with a dead-simple
  10824. heuristic: if you exit more than N times (where N is an exponential function
  10825. of the number of times the code block has already been recompiled) then we
  10826. will recompile.
  10827. This appears to be a broad ~1% win on many benchmarks large and small.
  10828. * bytecode/CodeBlock.cpp:
  10829. (JSC::CodeBlock::CodeBlock):
  10830. * bytecode/CodeBlock.h:
  10831. (JSC::CodeBlock::couldTakeSpecialFastCase):
  10832. (CodeBlock):
  10833. (JSC::CodeBlock::osrExitCounter):
  10834. (JSC::CodeBlock::countOSRExit):
  10835. (JSC::CodeBlock::addressOfOSRExitCounter):
  10836. (JSC::CodeBlock::offsetOfOSRExitCounter):
  10837. (JSC::CodeBlock::adjustedExitCountThreshold):
  10838. (JSC::CodeBlock::exitCountThresholdForReoptimization):
  10839. (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
  10840. (JSC::CodeBlock::shouldReoptimizeNow):
  10841. (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
  10842. * bytecode/ExecutionCounter.cpp:
  10843. (JSC::ExecutionCounter::setThreshold):
  10844. * bytecode/ExecutionCounter.h:
  10845. (ExecutionCounter):
  10846. (JSC::ExecutionCounter::clippedThreshold):
  10847. * dfg/DFGByteCodeParser.cpp:
  10848. (JSC::DFG::ByteCodeParser::makeDivSafe):
  10849. * dfg/DFGJITCompiler.cpp:
  10850. (JSC::DFG::JITCompiler::compileBody):
  10851. * dfg/DFGOSRExit.cpp:
  10852. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  10853. * dfg/DFGOSRExitCompiler.cpp:
  10854. (JSC::DFG::OSRExitCompiler::handleExitCounts):
  10855. * dfg/DFGOperations.cpp:
  10856. * jit/JITStubs.cpp:
  10857. (JSC::DEFINE_STUB_FUNCTION):
  10858. * runtime/Options.h:
  10859. (JSC):
  10860. 2012-07-09 Matt Falkenhagen <falken@chromium.org>
  10861. Add ENABLE_DIALOG_ELEMENT and skeleton files
  10862. https://bugs.webkit.org/show_bug.cgi?id=90521
  10863. Reviewed by Kent Tamura.
  10864. * Configurations/FeatureDefines.xcconfig:
  10865. 2012-07-09 Filip Pizlo <fpizlo@apple.com>
  10866. Unreviewed, roll out http://trac.webkit.org/changeset/121511
  10867. It made in-browser V8v7 10% slower.
  10868. * bytecode/CodeBlock.cpp:
  10869. (JSC::CodeBlock::CodeBlock):
  10870. * bytecode/CodeBlock.h:
  10871. (CodeBlock):
  10872. (JSC::CodeBlock::countSpeculationSuccess):
  10873. (JSC::CodeBlock::countSpeculationFailure):
  10874. (JSC::CodeBlock::speculativeSuccessCounter):
  10875. (JSC::CodeBlock::speculativeFailCounter):
  10876. (JSC::CodeBlock::forcedOSRExitCounter):
  10877. (JSC::CodeBlock::addressOfSpeculativeSuccessCounter):
  10878. (JSC::CodeBlock::addressOfSpeculativeFailCounter):
  10879. (JSC::CodeBlock::addressOfForcedOSRExitCounter):
  10880. (JSC::CodeBlock::offsetOfSpeculativeSuccessCounter):
  10881. (JSC::CodeBlock::offsetOfSpeculativeFailCounter):
  10882. (JSC::CodeBlock::offsetOfForcedOSRExitCounter):
  10883. (JSC::CodeBlock::largeFailCountThreshold):
  10884. (JSC::CodeBlock::largeFailCountThresholdForLoop):
  10885. (JSC::CodeBlock::shouldReoptimizeNow):
  10886. (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
  10887. * bytecode/ExecutionCounter.cpp:
  10888. (JSC::ExecutionCounter::setThreshold):
  10889. * bytecode/ExecutionCounter.h:
  10890. (ExecutionCounter):
  10891. * dfg/DFGJITCompiler.cpp:
  10892. (JSC::DFG::JITCompiler::compileBody):
  10893. * dfg/DFGOSRExit.cpp:
  10894. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  10895. * dfg/DFGOSRExitCompiler.cpp:
  10896. (JSC::DFG::OSRExitCompiler::handleExitCounts):
  10897. * dfg/DFGOperations.cpp:
  10898. * jit/JITStubs.cpp:
  10899. (JSC::DEFINE_STUB_FUNCTION):
  10900. * runtime/Options.h:
  10901. (JSC):
  10902. 2012-07-09 Filip Pizlo <fpizlo@apple.com>
  10903. DFG may get stuck in an infinite fix point if it constant folds a mispredicted node
  10904. https://bugs.webkit.org/show_bug.cgi?id=90829
  10905. <rdar://problem/11823843>
  10906. Reviewed by Oliver Hunt.
  10907. If a node is shown to have been mispredicted during CFA, then don't allow constant
  10908. folding to make the graph even more degenerate. Instead, pull back on constant folding
  10909. and allow the normal OSR machinery to fix our profiling so that a future recompilation
  10910. doesn't see the same mistake.
  10911. * dfg/DFGAbstractState.cpp:
  10912. (JSC::DFG::AbstractState::execute):
  10913. * dfg/DFGAbstractState.h:
  10914. (JSC::DFG::AbstractState::trySetConstant):
  10915. (AbstractState):
  10916. * dfg/DFGPhase.h:
  10917. (JSC::DFG::Phase::name):
  10918. (Phase):
  10919. (JSC::DFG::runAndLog):
  10920. (DFG):
  10921. (JSC::DFG::runPhase):
  10922. 2012-07-09 Filip Pizlo <fpizlo@apple.com>
  10923. It should be possible to jettison JIT stub routines even if they are currently running
  10924. https://bugs.webkit.org/show_bug.cgi?id=90731
  10925. Reviewed by Gavin Barraclough.
  10926. This gives the GC awareness of all JIT-generated stubs for inline caches. That
  10927. means that if you want to delete a JIT-generated stub, you don't have to worry
  10928. about whether or not it is currently running: if there is a chance that it might
  10929. be, the GC will kindly defer deletion until non-running-ness is proved.
  10930. * CMakeLists.txt:
  10931. * GNUmakefile.list.am:
  10932. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  10933. * JavaScriptCore.xcodeproj/project.pbxproj:
  10934. * Target.pri:
  10935. * bytecode/Instruction.h:
  10936. (JSC):
  10937. (PolymorphicStubInfo):
  10938. (JSC::PolymorphicAccessStructureList::PolymorphicStubInfo::set):
  10939. (JSC::PolymorphicAccessStructureList::PolymorphicAccessStructureList):
  10940. * bytecode/PolymorphicPutByIdList.cpp:
  10941. (JSC::PutByIdAccess::fromStructureStubInfo):
  10942. * bytecode/PolymorphicPutByIdList.h:
  10943. (JSC::PutByIdAccess::transition):
  10944. (JSC::PutByIdAccess::replace):
  10945. (JSC::PutByIdAccess::stubRoutine):
  10946. (PutByIdAccess):
  10947. (JSC::PolymorphicPutByIdList::currentSlowPathTarget):
  10948. * bytecode/StructureStubInfo.h:
  10949. (JSC::StructureStubInfo::reset):
  10950. * dfg/DFGRepatch.cpp:
  10951. (JSC::DFG::generateProtoChainAccessStub):
  10952. (JSC::DFG::tryCacheGetByID):
  10953. (JSC::DFG::tryBuildGetByIDList):
  10954. (JSC::DFG::tryBuildGetByIDProtoList):
  10955. (JSC::DFG::emitPutReplaceStub):
  10956. (JSC::DFG::emitPutTransitionStub):
  10957. (JSC::DFG::tryCachePutByID):
  10958. (JSC::DFG::tryBuildPutByIdList):
  10959. * heap/ConservativeRoots.cpp:
  10960. (JSC):
  10961. (DummyMarkHook):
  10962. (JSC::DummyMarkHook::mark):
  10963. (JSC::ConservativeRoots::add):
  10964. (CompositeMarkHook):
  10965. (JSC::CompositeMarkHook::CompositeMarkHook):
  10966. (JSC::CompositeMarkHook::mark):
  10967. * heap/ConservativeRoots.h:
  10968. (JSC):
  10969. (ConservativeRoots):
  10970. * heap/Heap.cpp:
  10971. (JSC::Heap::markRoots):
  10972. (JSC::Heap::deleteUnmarkedCompiledCode):
  10973. * heap/Heap.h:
  10974. (JSC):
  10975. (Heap):
  10976. * heap/JITStubRoutineSet.cpp: Added.
  10977. (JSC):
  10978. (JSC::JITStubRoutineSet::JITStubRoutineSet):
  10979. (JSC::JITStubRoutineSet::~JITStubRoutineSet):
  10980. (JSC::JITStubRoutineSet::add):
  10981. (JSC::JITStubRoutineSet::clearMarks):
  10982. (JSC::JITStubRoutineSet::markSlow):
  10983. (JSC::JITStubRoutineSet::deleteUnmarkedJettisonedStubRoutines):
  10984. (JSC::JITStubRoutineSet::traceMarkedStubRoutines):
  10985. * heap/JITStubRoutineSet.h: Added.
  10986. (JSC):
  10987. (JITStubRoutineSet):
  10988. (JSC::JITStubRoutineSet::mark):
  10989. * heap/MachineStackMarker.h:
  10990. (JSC):
  10991. * interpreter/RegisterFile.cpp:
  10992. (JSC::RegisterFile::gatherConservativeRoots):
  10993. * interpreter/RegisterFile.h:
  10994. (JSC):
  10995. * jit/ExecutableAllocator.cpp:
  10996. (JSC::DemandExecutableAllocator::DemandExecutableAllocator):
  10997. * jit/ExecutableAllocator.h:
  10998. (JSC):
  10999. * jit/ExecutableAllocatorFixedVMPool.cpp:
  11000. (JSC):
  11001. (JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):
  11002. * jit/GCAwareJITStubRoutine.cpp: Added.
  11003. (JSC):
  11004. (JSC::GCAwareJITStubRoutine::GCAwareJITStubRoutine):
  11005. (JSC::GCAwareJITStubRoutine::~GCAwareJITStubRoutine):
  11006. (JSC::GCAwareJITStubRoutine::observeZeroRefCount):
  11007. (JSC::GCAwareJITStubRoutine::deleteFromGC):
  11008. (JSC::GCAwareJITStubRoutine::markRequiredObjectsInternal):
  11009. (JSC::MarkingGCAwareJITStubRoutineWithOneObject::MarkingGCAwareJITStubRoutineWithOneObject):
  11010. (JSC::MarkingGCAwareJITStubRoutineWithOneObject::~MarkingGCAwareJITStubRoutineWithOneObject):
  11011. (JSC::MarkingGCAwareJITStubRoutineWithOneObject::markRequiredObjectsInternal):
  11012. (JSC::createJITStubRoutine):
  11013. * jit/GCAwareJITStubRoutine.h: Added.
  11014. (JSC):
  11015. (GCAwareJITStubRoutine):
  11016. (JSC::GCAwareJITStubRoutine::markRequiredObjects):
  11017. (MarkingGCAwareJITStubRoutineWithOneObject):
  11018. * jit/JITPropertyAccess.cpp:
  11019. (JSC::JIT::privateCompilePutByIdTransition):
  11020. (JSC::JIT::privateCompilePatchGetArrayLength):
  11021. (JSC::JIT::privateCompileGetByIdProto):
  11022. (JSC::JIT::privateCompileGetByIdSelfList):
  11023. (JSC::JIT::privateCompileGetByIdProtoList):
  11024. (JSC::JIT::privateCompileGetByIdChainList):
  11025. (JSC::JIT::privateCompileGetByIdChain):
  11026. * jit/JITPropertyAccess32_64.cpp:
  11027. (JSC::JIT::privateCompilePutByIdTransition):
  11028. (JSC::JIT::privateCompilePatchGetArrayLength):
  11029. (JSC::JIT::privateCompileGetByIdProto):
  11030. (JSC::JIT::privateCompileGetByIdSelfList):
  11031. (JSC::JIT::privateCompileGetByIdProtoList):
  11032. (JSC::JIT::privateCompileGetByIdChainList):
  11033. (JSC::JIT::privateCompileGetByIdChain):
  11034. * jit/JITStubRoutine.cpp: Added.
  11035. (JSC):
  11036. (JSC::JITStubRoutine::~JITStubRoutine):
  11037. (JSC::JITStubRoutine::observeZeroRefCount):
  11038. * jit/JITStubRoutine.h: Added.
  11039. (JSC):
  11040. (JITStubRoutine):
  11041. (JSC::JITStubRoutine::JITStubRoutine):
  11042. (JSC::JITStubRoutine::createSelfManagedRoutine):
  11043. (JSC::JITStubRoutine::code):
  11044. (JSC::JITStubRoutine::asCodePtr):
  11045. (JSC::JITStubRoutine::ref):
  11046. (JSC::JITStubRoutine::deref):
  11047. (JSC::JITStubRoutine::startAddress):
  11048. (JSC::JITStubRoutine::endAddress):
  11049. (JSC::JITStubRoutine::addressStep):
  11050. (JSC::JITStubRoutine::canPerformRangeFilter):
  11051. (JSC::JITStubRoutine::filteringStartAddress):
  11052. (JSC::JITStubRoutine::filteringExtentSize):
  11053. (JSC::JITStubRoutine::passesFilter):
  11054. * jit/JITStubs.cpp:
  11055. (JSC::DEFINE_STUB_FUNCTION):
  11056. (JSC::getPolymorphicAccessStructureListSlot):
  11057. 2012-07-09 Sheriff Bot <webkit.review.bot@gmail.com>
  11058. Unreviewed, rolling out r122107.
  11059. http://trac.webkit.org/changeset/122107
  11060. https://bugs.webkit.org/show_bug.cgi?id=90794
  11061. Build failure on Mac debug bots (Requested by falken_ on
  11062. #webkit).
  11063. * Configurations/FeatureDefines.xcconfig:
  11064. 2012-07-09 Matt Falkenhagen <falken@chromium.org>
  11065. Add ENABLE_DIALOG_ELEMENT and skeleton files
  11066. https://bugs.webkit.org/show_bug.cgi?id=90521
  11067. Reviewed by Kent Tamura.
  11068. * Configurations/FeatureDefines.xcconfig:
  11069. 2012-07-08 Ryosuke Niwa <rniwa@webkit.org>
  11070. gcc build fix after r121925.
  11071. * runtime/JSObject.h:
  11072. (JSC::JSFinalObject::finishCreation):
  11073. 2012-07-08 Zoltan Herczeg <zherczeg@webkit.org>
  11074. [Qt][ARM] Implementing missing macro assembler instructions after r121925
  11075. https://bugs.webkit.org/show_bug.cgi?id=90657
  11076. Reviewed by Csaba Osztrogonác.
  11077. Implementing convertibleLoadPtr, replaceWithLoad and
  11078. replaceWithAddressComputation.
  11079. * assembler/ARMAssembler.h:
  11080. (JSC::ARMAssembler::replaceWithLoad):
  11081. (ARMAssembler):
  11082. (JSC::ARMAssembler::replaceWithAddressComputation):
  11083. * assembler/MacroAssemblerARM.h:
  11084. (JSC::MacroAssemblerARM::convertibleLoadPtr):
  11085. (MacroAssemblerARM):
  11086. 2012-07-06 Filip Pizlo <fpizlo@apple.com>
  11087. WebKit Version 5.1.7 (6534.57.2, r121935): Double-click no longer works on OpenStreetMap
  11088. https://bugs.webkit.org/show_bug.cgi?id=90703
  11089. Reviewed by Michael Saboff.
  11090. It turns out that in my object model refactoring, I managed to fix get_by_pname in all
  11091. execution engines except 64-bit baseline JIT.
  11092. * jit/JITPropertyAccess.cpp:
  11093. (JSC::JIT::emit_op_get_by_pname):
  11094. 2012-07-06 Pravin D <pravind.2k4@gmail.com>
  11095. Build Error on Qt Linux build
  11096. https://bugs.webkit.org/show_bug.cgi?id=90699
  11097. Reviewed by Laszlo Gombos.
  11098. * parser/Parser.cpp:
  11099. (JSC::::parseForStatement):
  11100. Removed unused boolean variable as this was causing build error on Qt Linux.
  11101. 2012-07-06 Nuno Lopes <nlopes@apple.com>
  11102. Fix build with recent clang.
  11103. https://bugs.webkit.org/show_bug.cgi?id=90634
  11104. Reviewed by Oliver Hunt.
  11105. * jit/SpecializedThunkJIT.h:
  11106. (JSC::SpecializedThunkJIT::SpecializedThunkJIT):
  11107. (SpecializedThunkJIT):
  11108. * jit/ThunkGenerators.cpp:
  11109. (JSC::charCodeAtThunkGenerator):
  11110. (JSC::charAtThunkGenerator):
  11111. (JSC::fromCharCodeThunkGenerator):
  11112. (JSC::sqrtThunkGenerator):
  11113. (JSC::floorThunkGenerator):
  11114. (JSC::ceilThunkGenerator):
  11115. (JSC::roundThunkGenerator):
  11116. (JSC::expThunkGenerator):
  11117. (JSC::logThunkGenerator):
  11118. (JSC::absThunkGenerator):
  11119. (JSC::powThunkGenerator):
  11120. * parser/ASTBuilder.h:
  11121. (JSC::ASTBuilder::createAssignResolve):
  11122. (JSC::ASTBuilder::createForLoop):
  11123. (JSC::ASTBuilder::createForInLoop):
  11124. (JSC::ASTBuilder::makeAssignNode):
  11125. (JSC::ASTBuilder::makePrefixNode):
  11126. (JSC::ASTBuilder::makePostfixNode):
  11127. * parser/NodeConstructors.h:
  11128. (JSC::PostfixErrorNode::PostfixErrorNode):
  11129. (JSC::PrefixErrorNode::PrefixErrorNode):
  11130. (JSC::AssignResolveNode::AssignResolveNode):
  11131. (JSC::AssignErrorNode::AssignErrorNode):
  11132. (JSC::ForNode::ForNode):
  11133. (JSC::ForInNode::ForInNode):
  11134. * parser/Nodes.h:
  11135. (FunctionCallResolveNode):
  11136. (PostfixErrorNode):
  11137. (PrefixErrorNode):
  11138. (ReadModifyResolveNode):
  11139. (AssignResolveNode):
  11140. (AssignErrorNode):
  11141. (ForNode):
  11142. (ForInNode):
  11143. * parser/Parser.cpp:
  11144. (JSC::::parseVarDeclarationList):
  11145. (JSC::::parseForStatement):
  11146. * parser/SyntaxChecker.h:
  11147. (JSC::SyntaxChecker::createAssignResolve):
  11148. (JSC::SyntaxChecker::createForLoop):
  11149. 2012-07-06 Zoltan Herczeg <zherczeg@webkit.org>
  11150. [Qt][ARM] REGRESSION(r121885): It broke 30 jsc tests, 500+ layout tests
  11151. https://bugs.webkit.org/show_bug.cgi?id=90656
  11152. Reviewed by Csaba Osztrogonác.
  11153. Typo fixes.
  11154. * assembler/MacroAssemblerARM.cpp:
  11155. (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  11156. Rename getOp2Byte() -> getOp2Half()
  11157. * assembler/MacroAssemblerARMv7.h:
  11158. (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
  11159. Add a necessary space.
  11160. * jit/JITStubs.cpp:
  11161. (JSC):
  11162. Revert INLINE_ARM_FUNCTION macro.
  11163. 2012-07-05 Filip Pizlo <fpizlo@apple.com>
  11164. REGRESSION(r121925): It broke 5 sputnik tests on x86 platforms
  11165. https://bugs.webkit.org/show_bug.cgi?id=90658
  11166. Reviewed by Zoltan Herczeg.
  11167. Under the new object model, out-of-line property accesses such as those
  11168. in ResolveGlobal must account for the fact that the offset to the Kth
  11169. property is represented by K + inlineStorageCapacity. Hence, the property
  11170. loads in ResolveGlobal must have an additional -inlineStorageCapacity *
  11171. sizeof(JSValue) offset.
  11172. * dfg/DFGSpeculativeJIT32_64.cpp:
  11173. (JSC::DFG::SpeculativeJIT::compile):
  11174. 2012-07-05 Csaba Osztrogonác <ossy@webkit.org>
  11175. [Qt] Unreviewed 64 bit buildfix after r121925.
  11176. * bytecode/PutByIdStatus.cpp:
  11177. (JSC::PutByIdStatus::computeFromLLInt):
  11178. 2012-07-05 Michael Saboff <msaboff@apple.com>
  11179. JSString::tryHashConstLock() fails to get exclusive lock
  11180. https://bugs.webkit.org/show_bug.cgi?id=90639
  11181. Reviewed by Oliver Hunt.
  11182. Added check that the string is already locked even before compare and swap.
  11183. * heap/MarkStack.cpp:
  11184. (JSC::JSString::tryHashConstLock):
  11185. 2012-07-04 Filip Pizlo <fpizlo@apple.com>
  11186. Inline property storage should not be wasted when it is exhausted
  11187. https://bugs.webkit.org/show_bug.cgi?id=90347
  11188. Reviewed by Gavin Barraclough.
  11189. Previously, if we switched an object from using inline storage to out-of-line
  11190. storage, we would abandon the inline storage. This would have two main implications:
  11191. (i) all accesses to the object, even for properties that were previously in inline
  11192. storage, must now take an extra indirection; and (ii) we waste a non-trivial amount
  11193. of space since we must allocate additional out-of-line storage to hold properties
  11194. that would have fit in the inline storage. There's also the copying cost when
  11195. switching to out-of-line storage - we must copy all inline properties into ouf-of-line
  11196. storage.
  11197. This patch changes the way that object property storage works so that we can use both
  11198. inline and out-of-line storage concurrently. This is accomplished by introducing a
  11199. new notion of property offset. This PropertyOffset is a 32-bit signed integer and it
  11200. behaves as follows:
  11201. offset == -1: invalid offset, indicating a property that does not exist.
  11202. 0 <= offset <= inlineStorageCapacity: offset into inline storage.
  11203. inlineStorageCapacity < offset: offset into out-of-line storage.
  11204. Because non-final objects don't have inline storage, the only valid PropertyOffsets
  11205. for those objects' properties are -1 or > inlineStorageCapacity.
  11206. This now means that the decision to use inline or out-of-line storage for an access is
  11207. made based on the offset, rather than the structure. It also means that any access
  11208. where the offset is a variable must have an extra branch, unless the type of the
  11209. object is also known (if it's known to be a non-final object then we can just assert
  11210. that the offset is >= inlineStorageCapacity).
  11211. This looks like a big Kraken speed-up and a slight V8 speed-up.
  11212. * GNUmakefile.list.am:
  11213. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  11214. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  11215. * JavaScriptCore.xcodeproj/project.pbxproj:
  11216. * assembler/ARMv7Assembler.h:
  11217. (ARMv7Assembler):
  11218. (JSC::ARMv7Assembler::ldrWide8BitImmediate):
  11219. (JSC::ARMv7Assembler::replaceWithLoad):
  11220. (JSC::ARMv7Assembler::replaceWithAddressComputation):
  11221. * assembler/AbstractMacroAssembler.h:
  11222. (AbstractMacroAssembler):
  11223. (ConvertibleLoadLabel):
  11224. (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::ConvertibleLoadLabel):
  11225. (JSC::AbstractMacroAssembler::ConvertibleLoadLabel::isSet):
  11226. (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
  11227. (JSC::AbstractMacroAssembler::replaceWithLoad):
  11228. (JSC::AbstractMacroAssembler::replaceWithAddressComputation):
  11229. * assembler/CodeLocation.h:
  11230. (JSC):
  11231. (CodeLocationCommon):
  11232. (CodeLocationConvertibleLoad):
  11233. (JSC::CodeLocationConvertibleLoad::CodeLocationConvertibleLoad):
  11234. (JSC::CodeLocationCommon::convertibleLoadAtOffset):
  11235. * assembler/LinkBuffer.cpp:
  11236. (JSC::LinkBuffer::finalizeCodeWithDisassembly):
  11237. * assembler/LinkBuffer.h:
  11238. (LinkBuffer):
  11239. (JSC::LinkBuffer::locationOf):
  11240. * assembler/MacroAssemblerARMv7.h:
  11241. (MacroAssemblerARMv7):
  11242. (JSC::MacroAssemblerARMv7::convertibleLoadPtr):
  11243. * assembler/MacroAssemblerX86.h:
  11244. (JSC::MacroAssemblerX86::convertibleLoadPtr):
  11245. (MacroAssemblerX86):
  11246. * assembler/MacroAssemblerX86_64.h:
  11247. (JSC::MacroAssemblerX86_64::convertibleLoadPtr):
  11248. (MacroAssemblerX86_64):
  11249. * assembler/RepatchBuffer.h:
  11250. (RepatchBuffer):
  11251. (JSC::RepatchBuffer::replaceWithLoad):
  11252. (JSC::RepatchBuffer::replaceWithAddressComputation):
  11253. (JSC::RepatchBuffer::setLoadInstructionIsActive):
  11254. * assembler/X86Assembler.h:
  11255. (JSC::X86Assembler::replaceWithLoad):
  11256. (X86Assembler):
  11257. (JSC::X86Assembler::replaceWithAddressComputation):
  11258. * bytecode/CodeBlock.cpp:
  11259. (JSC::CodeBlock::printGetByIdOp):
  11260. (JSC::CodeBlock::dump):
  11261. (JSC::CodeBlock::finalizeUnconditionally):
  11262. * bytecode/GetByIdStatus.cpp:
  11263. (JSC::GetByIdStatus::computeFromLLInt):
  11264. (JSC::GetByIdStatus::computeForChain):
  11265. (JSC::GetByIdStatus::computeFor):
  11266. * bytecode/GetByIdStatus.h:
  11267. (JSC::GetByIdStatus::GetByIdStatus):
  11268. (JSC::GetByIdStatus::offset):
  11269. (GetByIdStatus):
  11270. * bytecode/Opcode.h:
  11271. (JSC):
  11272. (JSC::padOpcodeName):
  11273. * bytecode/PutByIdStatus.cpp:
  11274. (JSC::PutByIdStatus::computeFromLLInt):
  11275. (JSC::PutByIdStatus::computeFor):
  11276. * bytecode/PutByIdStatus.h:
  11277. (JSC::PutByIdStatus::PutByIdStatus):
  11278. (JSC::PutByIdStatus::offset):
  11279. (PutByIdStatus):
  11280. * bytecode/ResolveGlobalStatus.cpp:
  11281. (JSC):
  11282. (JSC::computeForStructure):
  11283. * bytecode/ResolveGlobalStatus.h:
  11284. (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
  11285. (JSC::ResolveGlobalStatus::offset):
  11286. (ResolveGlobalStatus):
  11287. * bytecode/StructureSet.h:
  11288. (StructureSet):
  11289. * bytecode/StructureStubInfo.h:
  11290. * dfg/DFGByteCodeParser.cpp:
  11291. (ByteCodeParser):
  11292. (JSC::DFG::ByteCodeParser::handleGetByOffset):
  11293. (JSC::DFG::ByteCodeParser::handleGetById):
  11294. (JSC::DFG::ByteCodeParser::parseBlock):
  11295. * dfg/DFGCapabilities.h:
  11296. (JSC::DFG::canCompileOpcode):
  11297. * dfg/DFGJITCompiler.cpp:
  11298. (JSC::DFG::JITCompiler::link):
  11299. * dfg/DFGJITCompiler.h:
  11300. (JSC::DFG::PropertyAccessRecord::PropertyAccessRecord):
  11301. (PropertyAccessRecord):
  11302. * dfg/DFGRepatch.cpp:
  11303. (JSC::DFG::dfgRepatchByIdSelfAccess):
  11304. (JSC::DFG::generateProtoChainAccessStub):
  11305. (JSC::DFG::tryCacheGetByID):
  11306. (JSC::DFG::tryBuildGetByIDList):
  11307. (JSC::DFG::tryBuildGetByIDProtoList):
  11308. (JSC::DFG::emitPutReplaceStub):
  11309. (JSC::DFG::emitPutTransitionStub):
  11310. (JSC::DFG::tryCachePutByID):
  11311. (JSC::DFG::tryBuildPutByIdList):
  11312. * dfg/DFGSpeculativeJIT.h:
  11313. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  11314. * dfg/DFGSpeculativeJIT32_64.cpp:
  11315. (JSC::DFG::SpeculativeJIT::cachedGetById):
  11316. (JSC::DFG::SpeculativeJIT::cachedPutById):
  11317. (JSC::DFG::SpeculativeJIT::compile):
  11318. * dfg/DFGSpeculativeJIT64.cpp:
  11319. (JSC::DFG::SpeculativeJIT::cachedGetById):
  11320. (JSC::DFG::SpeculativeJIT::cachedPutById):
  11321. (JSC::DFG::SpeculativeJIT::compile):
  11322. * heap/MarkStack.cpp:
  11323. (JSC::visitChildren):
  11324. * interpreter/Interpreter.cpp:
  11325. (JSC::Interpreter::tryCacheGetByID):
  11326. (JSC::Interpreter::privateExecute):
  11327. * jit/JIT.cpp:
  11328. (JSC::JIT::privateCompileMainPass):
  11329. (JSC::JIT::privateCompileSlowCases):
  11330. (JSC::PropertyStubCompilationInfo::copyToStubInfo):
  11331. * jit/JIT.h:
  11332. (JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
  11333. (JSC::JIT::compileGetByIdProto):
  11334. (JSC::JIT::compileGetByIdSelfList):
  11335. (JSC::JIT::compileGetByIdProtoList):
  11336. (JSC::JIT::compileGetByIdChainList):
  11337. (JSC::JIT::compileGetByIdChain):
  11338. (JSC::JIT::compilePutByIdTransition):
  11339. (JIT):
  11340. * jit/JITInlineMethods.h:
  11341. (JSC::JIT::emitAllocateBasicJSObject):
  11342. * jit/JITOpcodes.cpp:
  11343. (JSC::JIT::emit_op_resolve_global):
  11344. * jit/JITOpcodes32_64.cpp:
  11345. (JSC::JIT::emit_op_resolve_global):
  11346. * jit/JITPropertyAccess.cpp:
  11347. (JSC::JIT::compileGetDirectOffset):
  11348. (JSC::JIT::emit_op_method_check):
  11349. (JSC::JIT::compileGetByIdHotPath):
  11350. (JSC::JIT::emit_op_put_by_id):
  11351. (JSC::JIT::compilePutDirectOffset):
  11352. (JSC::JIT::privateCompilePutByIdTransition):
  11353. (JSC::JIT::patchGetByIdSelf):
  11354. (JSC::JIT::patchPutByIdReplace):
  11355. (JSC::JIT::privateCompileGetByIdProto):
  11356. (JSC::JIT::privateCompileGetByIdSelfList):
  11357. (JSC::JIT::privateCompileGetByIdProtoList):
  11358. (JSC::JIT::privateCompileGetByIdChainList):
  11359. (JSC::JIT::privateCompileGetByIdChain):
  11360. * jit/JITPropertyAccess32_64.cpp:
  11361. (JSC::JIT::emit_op_method_check):
  11362. (JSC::JIT::compileGetByIdHotPath):
  11363. (JSC::JIT::emit_op_put_by_id):
  11364. (JSC::JIT::compilePutDirectOffset):
  11365. (JSC::JIT::compileGetDirectOffset):
  11366. (JSC::JIT::privateCompilePutByIdTransition):
  11367. (JSC::JIT::patchGetByIdSelf):
  11368. (JSC::JIT::patchPutByIdReplace):
  11369. (JSC::JIT::privateCompileGetByIdProto):
  11370. (JSC::JIT::privateCompileGetByIdSelfList):
  11371. (JSC::JIT::privateCompileGetByIdProtoList):
  11372. (JSC::JIT::privateCompileGetByIdChainList):
  11373. (JSC::JIT::privateCompileGetByIdChain):
  11374. (JSC::JIT::emit_op_get_by_pname):
  11375. * jit/JITStubs.cpp:
  11376. (JSC::JITThunks::tryCacheGetByID):
  11377. (JSC::DEFINE_STUB_FUNCTION):
  11378. * llint/LLIntSlowPaths.cpp:
  11379. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  11380. * llint/LowLevelInterpreter.asm:
  11381. * llint/LowLevelInterpreter32_64.asm:
  11382. * llint/LowLevelInterpreter64.asm:
  11383. * offlineasm/x86.rb:
  11384. * runtime/JSGlobalObject.h:
  11385. (JSGlobalObject):
  11386. (JSC::JSGlobalObject::functionNameOffset):
  11387. * runtime/JSObject.cpp:
  11388. (JSC::JSObject::visitChildren):
  11389. (JSC):
  11390. (JSC::JSFinalObject::visitChildren):
  11391. (JSC::JSObject::put):
  11392. (JSC::JSObject::deleteProperty):
  11393. (JSC::JSObject::getPropertySpecificValue):
  11394. (JSC::JSObject::removeDirect):
  11395. (JSC::JSObject::growOutOfLineStorage):
  11396. (JSC::JSObject::getOwnPropertyDescriptor):
  11397. * runtime/JSObject.h:
  11398. (JSObject):
  11399. (JSC::JSObject::getDirect):
  11400. (JSC::JSObject::getDirectLocation):
  11401. (JSC::JSObject::hasInlineStorage):
  11402. (JSC::JSObject::inlineStorageUnsafe):
  11403. (JSC::JSObject::inlineStorage):
  11404. (JSC::JSObject::outOfLineStorage):
  11405. (JSC::JSObject::locationForOffset):
  11406. (JSC::JSObject::offsetForLocation):
  11407. (JSC::JSObject::getDirectOffset):
  11408. (JSC::JSObject::putDirectOffset):
  11409. (JSC::JSObject::putUndefinedAtDirectOffset):
  11410. (JSC::JSObject::addressOfOutOfLineStorage):
  11411. (JSC::JSObject::finishCreation):
  11412. (JSC::JSNonFinalObject::JSNonFinalObject):
  11413. (JSC::JSNonFinalObject::finishCreation):
  11414. (JSFinalObject):
  11415. (JSC::JSFinalObject::finishCreation):
  11416. (JSC::JSFinalObject::JSFinalObject):
  11417. (JSC::JSObject::offsetOfOutOfLineStorage):
  11418. (JSC::JSObject::setOutOfLineStorage):
  11419. (JSC::JSObject::JSObject):
  11420. (JSC):
  11421. (JSC::JSCell::fastGetOwnProperty):
  11422. (JSC::JSObject::putDirectInternal):
  11423. (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
  11424. (JSC::JSObject::putDirectWithoutTransition):
  11425. (JSC::offsetRelativeToPatchedStorage):
  11426. (JSC::indexRelativeToBase):
  11427. (JSC::offsetRelativeToBase):
  11428. * runtime/JSPropertyNameIterator.cpp:
  11429. (JSC::JSPropertyNameIterator::create):
  11430. * runtime/JSPropertyNameIterator.h:
  11431. (JSPropertyNameIterator):
  11432. (JSC::JSPropertyNameIterator::getOffset):
  11433. (JSC::JSPropertyNameIterator::finishCreation):
  11434. * runtime/JSValue.cpp:
  11435. (JSC::JSValue::putToPrimitive):
  11436. * runtime/Operations.h:
  11437. (JSC::normalizePrototypeChain):
  11438. * runtime/Options.cpp:
  11439. (JSC):
  11440. (JSC::Options::initialize):
  11441. * runtime/PropertyMapHashTable.h:
  11442. (PropertyMapEntry):
  11443. (JSC::PropertyMapEntry::PropertyMapEntry):
  11444. (PropertyTable):
  11445. (JSC::PropertyTable::PropertyTable):
  11446. (JSC::PropertyTable::getDeletedOffset):
  11447. (JSC::PropertyTable::addDeletedOffset):
  11448. (JSC::PropertyTable::nextOffset):
  11449. (JSC):
  11450. (JSC::PropertyTable::sizeInMemory):
  11451. * runtime/PropertyOffset.h: Added.
  11452. (JSC):
  11453. (JSC::checkOffset):
  11454. (JSC::validateOffset):
  11455. (JSC::isValidOffset):
  11456. (JSC::isInlineOffset):
  11457. (JSC::isOutOfLineOffset):
  11458. (JSC::offsetInInlineStorage):
  11459. (JSC::offsetInOutOfLineStorage):
  11460. (JSC::offsetInRespectiveStorage):
  11461. (JSC::numberOfOutOfLineSlotsForLastOffset):
  11462. (JSC::numberOfSlotsForLastOffset):
  11463. (JSC::nextPropertyOffsetFor):
  11464. (JSC::firstPropertyOffsetFor):
  11465. * runtime/PropertySlot.h:
  11466. (JSC::PropertySlot::cachedOffset):
  11467. (JSC::PropertySlot::setValue):
  11468. (JSC::PropertySlot::setCacheableGetterSlot):
  11469. (JSC::PropertySlot::clearOffset):
  11470. * runtime/PutPropertySlot.h:
  11471. (JSC::PutPropertySlot::setExistingProperty):
  11472. (JSC::PutPropertySlot::setNewProperty):
  11473. (JSC::PutPropertySlot::cachedOffset):
  11474. (PutPropertySlot):
  11475. * runtime/Structure.cpp:
  11476. (JSC::Structure::Structure):
  11477. (JSC::Structure::materializePropertyMap):
  11478. (JSC::nextOutOfLineStorageCapacity):
  11479. (JSC::Structure::growOutOfLineCapacity):
  11480. (JSC::Structure::suggestedNewOutOfLineStorageCapacity):
  11481. (JSC::Structure::addPropertyTransitionToExistingStructure):
  11482. (JSC::Structure::addPropertyTransition):
  11483. (JSC::Structure::removePropertyTransition):
  11484. (JSC::Structure::flattenDictionaryStructure):
  11485. (JSC::Structure::addPropertyWithoutTransition):
  11486. (JSC::Structure::removePropertyWithoutTransition):
  11487. (JSC::Structure::copyPropertyTableForPinning):
  11488. (JSC::Structure::get):
  11489. (JSC::Structure::putSpecificValue):
  11490. (JSC::Structure::remove):
  11491. * runtime/Structure.h:
  11492. (Structure):
  11493. (JSC::Structure::putWillGrowOutOfLineStorage):
  11494. (JSC::Structure::previousID):
  11495. (JSC::Structure::outOfLineCapacity):
  11496. (JSC::Structure::outOfLineSizeForKnownFinalObject):
  11497. (JSC::Structure::outOfLineSizeForKnownNonFinalObject):
  11498. (JSC::Structure::outOfLineSize):
  11499. (JSC::Structure::hasInlineStorage):
  11500. (JSC::Structure::inlineCapacity):
  11501. (JSC::Structure::inlineSizeForKnownFinalObject):
  11502. (JSC::Structure::inlineSize):
  11503. (JSC::Structure::totalStorageSize):
  11504. (JSC::Structure::totalStorageCapacity):
  11505. (JSC::Structure::firstValidOffset):
  11506. (JSC::Structure::lastValidOffset):
  11507. (JSC::Structure::isValidOffset):
  11508. (JSC::Structure::isEmpty):
  11509. (JSC::Structure::transitionCount):
  11510. (JSC::Structure::get):
  11511. 2012-07-05 Oliver Hunt <oliver@apple.com>
  11512. JSObjectCallAsFunction should thisConvert the provided thisObject
  11513. https://bugs.webkit.org/show_bug.cgi?id=90628
  11514. Reviewed by Gavin Barraclough.
  11515. Perform this conversion on the provided this object.
  11516. * API/JSObjectRef.cpp:
  11517. (JSObjectCallAsFunction):
  11518. 2012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
  11519. [Qt] Unreviewed buildfix after r121886. Typo fix.
  11520. * assembler/MacroAssemblerARM.cpp:
  11521. (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  11522. 2012-07-05 Zoltan Herczeg <zherczeg@webkit.org>
  11523. Port DFG JIT to traditional ARM
  11524. https://bugs.webkit.org/show_bug.cgi?id=90198
  11525. Reviewed by Filip Pizlo.
  11526. This patch contains the macro assembler part of the
  11527. DFG JIT support on ARM systems with fixed 32 bit instruction
  11528. width. A large amount of old code was refactored, and the ARMv4
  11529. or lower support is removed from the macro assembler.
  11530. Sunspider is improved by 8%, and V8 is 92%.
  11531. * assembler/ARMAssembler.cpp:
  11532. (JSC::ARMAssembler::dataTransfer32):
  11533. (JSC::ARMAssembler::baseIndexTransfer32):
  11534. (JSC):
  11535. (JSC::ARMAssembler::dataTransfer16):
  11536. (JSC::ARMAssembler::baseIndexTransfer16):
  11537. (JSC::ARMAssembler::dataTransferFloat):
  11538. (JSC::ARMAssembler::baseIndexTransferFloat):
  11539. (JSC::ARMAssembler::executableCopy):
  11540. * assembler/ARMAssembler.h:
  11541. (JSC::ARMAssembler::ARMAssembler):
  11542. (JSC::ARMAssembler::emitInst):
  11543. (JSC::ARMAssembler::vmov_f64_r):
  11544. (ARMAssembler):
  11545. (JSC::ARMAssembler::vabs_f64_r):
  11546. (JSC::ARMAssembler::vneg_f64_r):
  11547. (JSC::ARMAssembler::ldr_imm):
  11548. (JSC::ARMAssembler::ldr_un_imm):
  11549. (JSC::ARMAssembler::dtr_u):
  11550. (JSC::ARMAssembler::dtr_ur):
  11551. (JSC::ARMAssembler::dtr_d):
  11552. (JSC::ARMAssembler::dtr_dr):
  11553. (JSC::ARMAssembler::dtrh_u):
  11554. (JSC::ARMAssembler::dtrh_ur):
  11555. (JSC::ARMAssembler::dtrh_d):
  11556. (JSC::ARMAssembler::dtrh_dr):
  11557. (JSC::ARMAssembler::fdtr_u):
  11558. (JSC::ARMAssembler::fdtr_d):
  11559. (JSC::ARMAssembler::push_r):
  11560. (JSC::ARMAssembler::pop_r):
  11561. (JSC::ARMAssembler::poke_r):
  11562. (JSC::ARMAssembler::peek_r):
  11563. (JSC::ARMAssembler::vmov_vfp64_r):
  11564. (JSC::ARMAssembler::vmov_arm64_r):
  11565. (JSC::ARMAssembler::vmov_vfp32_r):
  11566. (JSC::ARMAssembler::vmov_arm32_r):
  11567. (JSC::ARMAssembler::vcvt_u32_f64_r):
  11568. (JSC::ARMAssembler::vcvt_f64_f32_r):
  11569. (JSC::ARMAssembler::vcvt_f32_f64_r):
  11570. (JSC::ARMAssembler::clz_r):
  11571. (JSC::ARMAssembler::bkpt):
  11572. (JSC::ARMAssembler::bx):
  11573. (JSC::ARMAssembler::blx):
  11574. (JSC::ARMAssembler::labelIgnoringWatchpoints):
  11575. (JSC::ARMAssembler::labelForWatchpoint):
  11576. (JSC::ARMAssembler::label):
  11577. (JSC::ARMAssembler::getLdrImmAddress):
  11578. (JSC::ARMAssembler::replaceWithJump):
  11579. (JSC::ARMAssembler::maxJumpReplacementSize):
  11580. (JSC::ARMAssembler::getOp2Byte):
  11581. (JSC::ARMAssembler::getOp2Half):
  11582. (JSC::ARMAssembler::RM):
  11583. (JSC::ARMAssembler::RS):
  11584. (JSC::ARMAssembler::RD):
  11585. (JSC::ARMAssembler::RN):
  11586. * assembler/AssemblerBufferWithConstantPool.h:
  11587. (JSC::AssemblerBufferWithConstantPool::ensureSpaceForAnyInstruction):
  11588. * assembler/MacroAssemblerARM.cpp:
  11589. (JSC::MacroAssemblerARM::load32WithUnalignedHalfWords):
  11590. * assembler/MacroAssemblerARM.h:
  11591. (JSC::MacroAssemblerARM::add32):
  11592. (MacroAssemblerARM):
  11593. (JSC::MacroAssemblerARM::and32):
  11594. (JSC::MacroAssemblerARM::lshift32):
  11595. (JSC::MacroAssemblerARM::mul32):
  11596. (JSC::MacroAssemblerARM::neg32):
  11597. (JSC::MacroAssemblerARM::rshift32):
  11598. (JSC::MacroAssemblerARM::urshift32):
  11599. (JSC::MacroAssemblerARM::xor32):
  11600. (JSC::MacroAssemblerARM::load8):
  11601. (JSC::MacroAssemblerARM::load8Signed):
  11602. (JSC::MacroAssemblerARM::load16):
  11603. (JSC::MacroAssemblerARM::load16Signed):
  11604. (JSC::MacroAssemblerARM::load32):
  11605. (JSC::MacroAssemblerARM::load32WithAddressOffsetPatch):
  11606. (JSC::MacroAssemblerARM::store32WithAddressOffsetPatch):
  11607. (JSC::MacroAssemblerARM::store8):
  11608. (JSC::MacroAssemblerARM::store16):
  11609. (JSC::MacroAssemblerARM::store32):
  11610. (JSC::MacroAssemblerARM::move):
  11611. (JSC::MacroAssemblerARM::jump):
  11612. (JSC::MacroAssemblerARM::branchAdd32):
  11613. (JSC::MacroAssemblerARM::mull32):
  11614. (JSC::MacroAssemblerARM::branchMul32):
  11615. (JSC::MacroAssemblerARM::nearCall):
  11616. (JSC::MacroAssemblerARM::compare32):
  11617. (JSC::MacroAssemblerARM::test32):
  11618. (JSC::MacroAssemblerARM::sub32):
  11619. (JSC::MacroAssemblerARM::call):
  11620. (JSC::MacroAssemblerARM::loadFloat):
  11621. (JSC::MacroAssemblerARM::loadDouble):
  11622. (JSC::MacroAssemblerARM::storeFloat):
  11623. (JSC::MacroAssemblerARM::storeDouble):
  11624. (JSC::MacroAssemblerARM::moveDouble):
  11625. (JSC::MacroAssemblerARM::addDouble):
  11626. (JSC::MacroAssemblerARM::divDouble):
  11627. (JSC::MacroAssemblerARM::subDouble):
  11628. (JSC::MacroAssemblerARM::mulDouble):
  11629. (JSC::MacroAssemblerARM::absDouble):
  11630. (JSC::MacroAssemblerARM::negateDouble):
  11631. (JSC::MacroAssemblerARM::convertInt32ToDouble):
  11632. (JSC::MacroAssemblerARM::convertFloatToDouble):
  11633. (JSC::MacroAssemblerARM::convertDoubleToFloat):
  11634. (JSC::MacroAssemblerARM::branchTruncateDoubleToInt32):
  11635. (JSC::MacroAssemblerARM::branchTruncateDoubleToUint32):
  11636. (JSC::MacroAssemblerARM::truncateDoubleToInt32):
  11637. (JSC::MacroAssemblerARM::truncateDoubleToUint32):
  11638. (JSC::MacroAssemblerARM::branchConvertDoubleToInt32):
  11639. (JSC::MacroAssemblerARM::branchDoubleNonZero):
  11640. (JSC::MacroAssemblerARM::branchDoubleZeroOrNaN):
  11641. (JSC::MacroAssemblerARM::invert):
  11642. (JSC::MacroAssemblerARM::replaceWithJump):
  11643. (JSC::MacroAssemblerARM::maxJumpReplacementSize):
  11644. (JSC::MacroAssemblerARM::call32):
  11645. * assembler/SH4Assembler.h:
  11646. (JSC::SH4Assembler::label):
  11647. * dfg/DFGAssemblyHelpers.h:
  11648. (JSC::DFG::AssemblyHelpers::debugCall):
  11649. (JSC::DFG::AssemblyHelpers::boxDouble):
  11650. (JSC::DFG::AssemblyHelpers::unboxDouble):
  11651. * dfg/DFGCCallHelpers.h:
  11652. (CCallHelpers):
  11653. (JSC::DFG::CCallHelpers::setupArguments):
  11654. * dfg/DFGFPRInfo.h:
  11655. (DFG):
  11656. * dfg/DFGGPRInfo.h:
  11657. (DFG):
  11658. (GPRInfo):
  11659. * dfg/DFGOperations.cpp:
  11660. (JSC):
  11661. * dfg/DFGSpeculativeJIT.h:
  11662. (SpeculativeJIT):
  11663. (JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult):
  11664. (JSC::DFG::SpeculativeJIT::appendCallSetResult):
  11665. * jit/JITStubs.cpp:
  11666. (JSC):
  11667. * jit/JITStubs.h:
  11668. (JITStackFrame):
  11669. * jit/JSInterfaceJIT.h:
  11670. (JSInterfaceJIT):
  11671. 2012-07-04 Anthony Scian <ascian@rim.com>
  11672. Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
  11673. https://bugs.webkit.org/show_bug.cgi?id=40118
  11674. Reviewed by Yong Li.
  11675. Added member functions to expose function name, urlString, and line #.
  11676. Refactored toString to make use of these member functions to reduce
  11677. duplicated code for future maintenance.
  11678. Manually tested refactoring of toString by tracing thrown exceptions.
  11679. * interpreter/Interpreter.h:
  11680. (JSC::StackFrame::toString):
  11681. (JSC::StackFrame::friendlySourceURL):
  11682. (JSC::StackFrame::friendlyFunctionName):
  11683. (JSC::StackFrame::friendlyLineNumber):
  11684. 2012-07-04 Andy Wingo <wingo@igalia.com>
  11685. [GTK] Enable parallel GC
  11686. https://bugs.webkit.org/show_bug.cgi?id=90568
  11687. Reviewed by Martin Robinson.
  11688. * runtime/Options.cpp: Include <algorithm.h> for std::min.
  11689. 2012-07-04 John Mellor <johnme@chromium.org>
  11690. Text Autosizing: Add compile flag and runtime setting
  11691. https://bugs.webkit.org/show_bug.cgi?id=87394
  11692. This patch renames Font Boosting to Text Autosizing.
  11693. Reviewed by Adam Barth.
  11694. * Configurations/FeatureDefines.xcconfig:
  11695. 2012-07-03 Michael Saboff <msaboff@apple.com>
  11696. Enh: Hash Const JSString in Backing Stores to Save Memory
  11697. https://bugs.webkit.org/show_bug.cgi?id=86024
  11698. Reviewed by Oliver Hunt.
  11699. During garbage collection, each marking thread keeps a HashMap of
  11700. strings. While visiting via MarkStack::copyAndAppend(), we check to
  11701. see if the string we are visiting is already in the HashMap. If not
  11702. we add it. If so, we change the reference to the current string we're
  11703. visiting to the prior string.
  11704. To reduce the performance impact of this change, two throttles have
  11705. ben added. 1) We only try hash consting if a significant number of new
  11706. strings have been created since the last hash const. Currently this is
  11707. set at 100 strings. 2) If a string is unique at the end of a marking
  11708. it will not be checked during further GC phases. In some cases this
  11709. won't catch all duplicates, but we are trying to catch the growth of
  11710. duplicate strings.
  11711. * heap/Heap.cpp:
  11712. (JSC::Heap::markRoots):
  11713. * heap/MarkStack.cpp:
  11714. (JSC::MarkStackThreadSharedData::resetChildren):
  11715. (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
  11716. (JSC::MarkStackThreadSharedData::reset):
  11717. (JSC::MarkStack::setup): Check to see if enough strings have been created
  11718. to hash const.
  11719. (JSC::MarkStack::reset): Added call to clear m_uniqueStrings.
  11720. (JSC::JSString::tryHashConstLock): New method to lock JSString for
  11721. hash consting.
  11722. (JSC::JSString::releaseHashConstLock): New unlock method.
  11723. (JSC::JSString::shouldTryHashConst): Set of checks to see if we should
  11724. try to hash const the string.
  11725. (JSC::MarkStack::internalAppend): New method that performs the hash consting.
  11726. (JSC::SlotVisitor::copyAndAppend): Changed to call the new hash
  11727. consting internalAppend().
  11728. * heap/MarkStack.h:
  11729. (MarkStackThreadSharedData):
  11730. (MarkStack):
  11731. * runtime/JSGlobalData.cpp:
  11732. (JSC::JSGlobalData::JSGlobalData):
  11733. * runtime/JSGlobalData.h:
  11734. (JSGlobalData):
  11735. (JSC::JSGlobalData::haveEnoughNewStringsToHashConst):
  11736. (JSC::JSGlobalData::resetNewStringsSinceLastHashConst):
  11737. * runtime/JSString.h:
  11738. (JSString): Changed from using bool flags to using an unsigned
  11739. m_flags field. This works better with the weakCompareAndSwap in
  11740. JSString::tryHashConstLock(). Changed the 8bitness setting and
  11741. checking to use new accessors.
  11742. (JSC::JSString::JSString):
  11743. (JSC::JSString::finishCreation):
  11744. (JSC::JSString::is8Bit): Updated for new m_flags.
  11745. (JSC::JSString::setIs8Bit): New setter.
  11746. New hash const flags accessors:
  11747. (JSC::JSString::isHashConstSingleton):
  11748. (JSC::JSString::clearHashConstSingleton):
  11749. (JSC::JSString::setHashConstSingleton):
  11750. (JSC::JSRopeString::finishCreation):
  11751. (JSC::JSRopeString::append):
  11752. 2012-07-03 Tony Chang <tony@chromium.org>
  11753. [chromium] Unreviewed, update .gitignore to handle VS2010 files.
  11754. * JavaScriptCore.gyp/.gitignore:
  11755. 2012-07-03 Mark Lam <mark.lam@apple.com>
  11756. Add ability to symbolically set and dump JSC VM options.
  11757. See comments in runtime/Options.h for details on how the options work.
  11758. https://bugs.webkit.org/show_bug.cgi?id=90420
  11759. Reviewed by Filip Pizlo.
  11760. * assembler/LinkBuffer.cpp:
  11761. (JSC::LinkBuffer::finalizeCodeWithDisassembly):
  11762. * assembler/LinkBuffer.h:
  11763. (JSC):
  11764. * bytecode/CodeBlock.cpp:
  11765. (JSC::CodeBlock::shouldOptimizeNow):
  11766. * bytecode/CodeBlock.h:
  11767. (JSC::CodeBlock::likelyToTakeSlowCase):
  11768. (JSC::CodeBlock::couldTakeSlowCase):
  11769. (JSC::CodeBlock::likelyToTakeSpecialFastCase):
  11770. (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
  11771. (JSC::CodeBlock::likelyToTakeAnySlowCase):
  11772. (JSC::CodeBlock::jitAfterWarmUp):
  11773. (JSC::CodeBlock::jitSoon):
  11774. (JSC::CodeBlock::reoptimizationRetryCounter):
  11775. (JSC::CodeBlock::countReoptimization):
  11776. (JSC::CodeBlock::counterValueForOptimizeAfterWarmUp):
  11777. (JSC::CodeBlock::counterValueForOptimizeAfterLongWarmUp):
  11778. (JSC::CodeBlock::optimizeSoon):
  11779. (JSC::CodeBlock::exitCountThresholdForReoptimization):
  11780. (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
  11781. * bytecode/ExecutionCounter.h:
  11782. (JSC::ExecutionCounter::clippedThreshold):
  11783. * dfg/DFGByteCodeParser.cpp:
  11784. (JSC::DFG::ByteCodeParser::handleInlining):
  11785. * dfg/DFGCapabilities.h:
  11786. (JSC::DFG::mightCompileEval):
  11787. (JSC::DFG::mightCompileProgram):
  11788. (JSC::DFG::mightCompileFunctionForCall):
  11789. (JSC::DFG::mightCompileFunctionForConstruct):
  11790. (JSC::DFG::mightInlineFunctionForCall):
  11791. (JSC::DFG::mightInlineFunctionForConstruct):
  11792. * dfg/DFGCommon.h:
  11793. (JSC::DFG::shouldShowDisassembly):
  11794. * dfg/DFGDriver.cpp:
  11795. (JSC::DFG::compile):
  11796. * dfg/DFGOSRExit.cpp:
  11797. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  11798. * dfg/DFGVariableAccessData.h:
  11799. (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
  11800. * heap/MarkStack.cpp:
  11801. (JSC::MarkStackSegmentAllocator::allocate):
  11802. (JSC::MarkStackSegmentAllocator::shrinkReserve):
  11803. (JSC::MarkStackArray::MarkStackArray):
  11804. (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
  11805. (JSC::SlotVisitor::donateKnownParallel):
  11806. (JSC::SlotVisitor::drain):
  11807. (JSC::SlotVisitor::drainFromShared):
  11808. * heap/MarkStack.h:
  11809. (JSC::MarkStack::mergeOpaqueRootsIfProfitable):
  11810. (JSC::MarkStack::addOpaqueRoot):
  11811. * heap/SlotVisitor.h:
  11812. (JSC::SlotVisitor::donate):
  11813. * jit/JIT.cpp:
  11814. (JSC::JIT::emitOptimizationCheck):
  11815. * jsc.cpp:
  11816. (printUsageStatement):
  11817. (parseArguments):
  11818. * runtime/InitializeThreading.cpp:
  11819. (JSC::initializeThreadingOnce):
  11820. * runtime/JSGlobalData.cpp:
  11821. (JSC::enableAssembler):
  11822. * runtime/JSGlobalObject.cpp:
  11823. (JSC::JSGlobalObject::JSGlobalObject):
  11824. * runtime/Options.cpp:
  11825. (JSC):
  11826. (JSC::overrideOptionWithHeuristic):
  11827. (JSC::Options::initialize):
  11828. (JSC::Options::setOption):
  11829. (JSC::Options::dumpAllOptions):
  11830. (JSC::Options::dumpOption):
  11831. * runtime/Options.h:
  11832. (JSC):
  11833. (Options):
  11834. (EntryInfo):
  11835. 2012-07-03 Jocelyn Turcotte <jocelyn.turcotte@nokia.com> Joel Dillon <joel.dillon@codethink.co.uk>
  11836. [Qt][Win] Fix broken QtWebKit5.lib linking
  11837. https://bugs.webkit.org/show_bug.cgi?id=88321
  11838. Reviewed by Kenneth Rohde Christiansen.
  11839. The goal is to have different ports build systems define STATICALLY_LINKED_WITH_WTF
  11840. when building JavaScriptCore, if both are packaged in the same DLL, instead
  11841. of relying on the code to handle this.
  11842. The effects of BUILDING_* and STATICALLY_LINKED_WITH_* are currently the same
  11843. except for a check in Source/JavaScriptCore/config.h.
  11844. Keeping the old way for the WX port as requested by the port's contributors.
  11845. For non-Windows ports there is no difference between IMPORT and EXPORT, no
  11846. change is needed.
  11847. * API/JSBase.h:
  11848. JS symbols shouldn't be included by WTF objects anymore. Remove the export when BUILDING_WTF.
  11849. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
  11850. Make sure that JavaScriptCore uses import symbols of WTF for the Win port.
  11851. * runtime/JSExportMacros.h:
  11852. 2012-07-02 Filip Pizlo <fpizlo@apple.com>
  11853. DFG OSR exit value recoveries should be computed lazily
  11854. https://bugs.webkit.org/show_bug.cgi?id=82155
  11855. Reviewed by Gavin Barraclough.
  11856. This change aims to reduce one aspect of DFG compile times: the fact
  11857. that we currently compute the value recoveries for each local and
  11858. argument on every speculation check. We compile many speculation checks,
  11859. so this can add up quick. The strategy that this change takes is to
  11860. have the DFG save just enough information about how the compiler is
  11861. choosing to represent state, that the DFG::OSRExitCompiler can reify
  11862. the value recoveries lazily.
  11863. This appears to be an 0.3% SunSpider speed-up and is neutral elsewhere.
  11864. I also took the opportunity to fix the sampling regions profiler (it
  11865. was missing an export macro) and to put in more sampling regions in
  11866. the DFG (which are disabled so long as ENABLE(SAMPLING_REGIONS) is
  11867. false).
  11868. * CMakeLists.txt:
  11869. * GNUmakefile.list.am:
  11870. * JavaScriptCore.xcodeproj/project.pbxproj:
  11871. * Target.pri:
  11872. * bytecode/CodeBlock.cpp:
  11873. (JSC):
  11874. (JSC::CodeBlock::shrinkDFGDataToFit):
  11875. * bytecode/CodeBlock.h:
  11876. (CodeBlock):
  11877. (JSC::CodeBlock::minifiedDFG):
  11878. (JSC::CodeBlock::variableEventStream):
  11879. (DFGData):
  11880. * bytecode/Operands.h:
  11881. (JSC::Operands::hasOperand):
  11882. (Operands):
  11883. (JSC::Operands::size):
  11884. (JSC::Operands::at):
  11885. (JSC::Operands::operator[]):
  11886. (JSC::Operands::isArgument):
  11887. (JSC::Operands::isVariable):
  11888. (JSC::Operands::argumentForIndex):
  11889. (JSC::Operands::variableForIndex):
  11890. (JSC::Operands::operandForIndex):
  11891. (JSC):
  11892. (JSC::dumpOperands):
  11893. * bytecode/SamplingTool.h:
  11894. (SamplingRegion):
  11895. * dfg/DFGByteCodeParser.cpp:
  11896. (JSC::DFG::parse):
  11897. * dfg/DFGCFAPhase.cpp:
  11898. (JSC::DFG::performCFA):
  11899. * dfg/DFGCSEPhase.cpp:
  11900. (JSC::DFG::performCSE):
  11901. * dfg/DFGFixupPhase.cpp:
  11902. (JSC::DFG::performFixup):
  11903. * dfg/DFGGenerationInfo.h:
  11904. (JSC::DFG::GenerationInfo::GenerationInfo):
  11905. (JSC::DFG::GenerationInfo::initConstant):
  11906. (JSC::DFG::GenerationInfo::initInteger):
  11907. (JSC::DFG::GenerationInfo::initJSValue):
  11908. (JSC::DFG::GenerationInfo::initCell):
  11909. (JSC::DFG::GenerationInfo::initBoolean):
  11910. (JSC::DFG::GenerationInfo::initDouble):
  11911. (JSC::DFG::GenerationInfo::initStorage):
  11912. (GenerationInfo):
  11913. (JSC::DFG::GenerationInfo::noticeOSRBirth):
  11914. (JSC::DFG::GenerationInfo::use):
  11915. (JSC::DFG::GenerationInfo::spill):
  11916. (JSC::DFG::GenerationInfo::setSpilled):
  11917. (JSC::DFG::GenerationInfo::fillJSValue):
  11918. (JSC::DFG::GenerationInfo::fillCell):
  11919. (JSC::DFG::GenerationInfo::fillInteger):
  11920. (JSC::DFG::GenerationInfo::fillBoolean):
  11921. (JSC::DFG::GenerationInfo::fillDouble):
  11922. (JSC::DFG::GenerationInfo::fillStorage):
  11923. (JSC::DFG::GenerationInfo::appendFill):
  11924. (JSC::DFG::GenerationInfo::appendSpill):
  11925. * dfg/DFGJITCompiler.cpp:
  11926. (JSC::DFG::JITCompiler::link):
  11927. (JSC::DFG::JITCompiler::compile):
  11928. (JSC::DFG::JITCompiler::compileFunction):
  11929. * dfg/DFGMinifiedGraph.h: Added.
  11930. (DFG):
  11931. (MinifiedGraph):
  11932. (JSC::DFG::MinifiedGraph::MinifiedGraph):
  11933. (JSC::DFG::MinifiedGraph::at):
  11934. (JSC::DFG::MinifiedGraph::append):
  11935. (JSC::DFG::MinifiedGraph::prepareAndShrink):
  11936. (JSC::DFG::MinifiedGraph::setOriginalGraphSize):
  11937. (JSC::DFG::MinifiedGraph::originalGraphSize):
  11938. * dfg/DFGMinifiedNode.cpp: Added.
  11939. (DFG):
  11940. (JSC::DFG::MinifiedNode::fromNode):
  11941. * dfg/DFGMinifiedNode.h: Added.
  11942. (DFG):
  11943. (JSC::DFG::belongsInMinifiedGraph):
  11944. (MinifiedNode):
  11945. (JSC::DFG::MinifiedNode::MinifiedNode):
  11946. (JSC::DFG::MinifiedNode::index):
  11947. (JSC::DFG::MinifiedNode::op):
  11948. (JSC::DFG::MinifiedNode::hasChild1):
  11949. (JSC::DFG::MinifiedNode::child1):
  11950. (JSC::DFG::MinifiedNode::hasConstant):
  11951. (JSC::DFG::MinifiedNode::hasConstantNumber):
  11952. (JSC::DFG::MinifiedNode::constantNumber):
  11953. (JSC::DFG::MinifiedNode::hasWeakConstant):
  11954. (JSC::DFG::MinifiedNode::weakConstant):
  11955. (JSC::DFG::MinifiedNode::getIndex):
  11956. (JSC::DFG::MinifiedNode::compareByNodeIndex):
  11957. (JSC::DFG::MinifiedNode::hasChild):
  11958. * dfg/DFGNode.h:
  11959. (Node):
  11960. * dfg/DFGOSRExit.cpp:
  11961. (JSC::DFG::OSRExit::OSRExit):
  11962. * dfg/DFGOSRExit.h:
  11963. (OSRExit):
  11964. * dfg/DFGOSRExitCompiler.cpp:
  11965. * dfg/DFGOSRExitCompiler.h:
  11966. (OSRExitCompiler):
  11967. * dfg/DFGOSRExitCompiler32_64.cpp:
  11968. (JSC::DFG::OSRExitCompiler::compileExit):
  11969. * dfg/DFGOSRExitCompiler64.cpp:
  11970. (JSC::DFG::OSRExitCompiler::compileExit):
  11971. * dfg/DFGPredictionPropagationPhase.cpp:
  11972. (JSC::DFG::performPredictionPropagation):
  11973. * dfg/DFGRedundantPhiEliminationPhase.cpp:
  11974. (JSC::DFG::performRedundantPhiElimination):
  11975. * dfg/DFGSpeculativeJIT.cpp:
  11976. (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
  11977. (DFG):
  11978. (JSC::DFG::SpeculativeJIT::fillStorage):
  11979. (JSC::DFG::SpeculativeJIT::noticeOSRBirth):
  11980. (JSC::DFG::SpeculativeJIT::compileMovHint):
  11981. (JSC::DFG::SpeculativeJIT::compile):
  11982. (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
  11983. * dfg/DFGSpeculativeJIT.h:
  11984. (DFG):
  11985. (JSC::DFG::SpeculativeJIT::use):
  11986. (SpeculativeJIT):
  11987. (JSC::DFG::SpeculativeJIT::spill):
  11988. (JSC::DFG::SpeculativeJIT::speculationCheck):
  11989. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  11990. (JSC::DFG::SpeculativeJIT::recordSetLocal):
  11991. * dfg/DFGSpeculativeJIT32_64.cpp:
  11992. (JSC::DFG::SpeculativeJIT::fillInteger):
  11993. (JSC::DFG::SpeculativeJIT::fillDouble):
  11994. (JSC::DFG::SpeculativeJIT::fillJSValue):
  11995. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  11996. (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
  11997. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  11998. (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
  11999. (JSC::DFG::SpeculativeJIT::compile):
  12000. * dfg/DFGSpeculativeJIT64.cpp:
  12001. (JSC::DFG::SpeculativeJIT::fillInteger):
  12002. (JSC::DFG::SpeculativeJIT::fillDouble):
  12003. (JSC::DFG::SpeculativeJIT::fillJSValue):
  12004. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  12005. (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
  12006. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  12007. (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
  12008. (JSC::DFG::SpeculativeJIT::compile):
  12009. * dfg/DFGValueRecoveryOverride.h: Added.
  12010. (DFG):
  12011. (ValueRecoveryOverride):
  12012. (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
  12013. * dfg/DFGValueSource.cpp: Added.
  12014. (DFG):
  12015. (JSC::DFG::ValueSource::dump):
  12016. * dfg/DFGValueSource.h: Added.
  12017. (DFG):
  12018. (JSC::DFG::dataFormatToValueSourceKind):
  12019. (JSC::DFG::valueSourceKindToDataFormat):
  12020. (JSC::DFG::isInRegisterFile):
  12021. (ValueSource):
  12022. (JSC::DFG::ValueSource::ValueSource):
  12023. (JSC::DFG::ValueSource::forPrediction):
  12024. (JSC::DFG::ValueSource::forDataFormat):
  12025. (JSC::DFG::ValueSource::isSet):
  12026. (JSC::DFG::ValueSource::kind):
  12027. (JSC::DFG::ValueSource::isInRegisterFile):
  12028. (JSC::DFG::ValueSource::dataFormat):
  12029. (JSC::DFG::ValueSource::valueRecovery):
  12030. (JSC::DFG::ValueSource::nodeIndex):
  12031. (JSC::DFG::ValueSource::nodeIndexFromKind):
  12032. (JSC::DFG::ValueSource::kindFromNodeIndex):
  12033. * dfg/DFGVariableEvent.cpp: Added.
  12034. (DFG):
  12035. (JSC::DFG::VariableEvent::dump):
  12036. (JSC::DFG::VariableEvent::dumpFillInfo):
  12037. (JSC::DFG::VariableEvent::dumpSpillInfo):
  12038. * dfg/DFGVariableEvent.h: Added.
  12039. (DFG):
  12040. (VariableEvent):
  12041. (JSC::DFG::VariableEvent::VariableEvent):
  12042. (JSC::DFG::VariableEvent::reset):
  12043. (JSC::DFG::VariableEvent::fillGPR):
  12044. (JSC::DFG::VariableEvent::fillPair):
  12045. (JSC::DFG::VariableEvent::fillFPR):
  12046. (JSC::DFG::VariableEvent::spill):
  12047. (JSC::DFG::VariableEvent::death):
  12048. (JSC::DFG::VariableEvent::setLocal):
  12049. (JSC::DFG::VariableEvent::movHint):
  12050. (JSC::DFG::VariableEvent::kind):
  12051. (JSC::DFG::VariableEvent::nodeIndex):
  12052. (JSC::DFG::VariableEvent::dataFormat):
  12053. (JSC::DFG::VariableEvent::gpr):
  12054. (JSC::DFG::VariableEvent::tagGPR):
  12055. (JSC::DFG::VariableEvent::payloadGPR):
  12056. (JSC::DFG::VariableEvent::fpr):
  12057. (JSC::DFG::VariableEvent::virtualRegister):
  12058. (JSC::DFG::VariableEvent::operand):
  12059. (JSC::DFG::VariableEvent::variableRepresentation):
  12060. * dfg/DFGVariableEventStream.cpp: Added.
  12061. (DFG):
  12062. (JSC::DFG::VariableEventStream::logEvent):
  12063. (MinifiedGenerationInfo):
  12064. (JSC::DFG::MinifiedGenerationInfo::MinifiedGenerationInfo):
  12065. (JSC::DFG::MinifiedGenerationInfo::update):
  12066. (JSC::DFG::VariableEventStream::reconstruct):
  12067. * dfg/DFGVariableEventStream.h: Added.
  12068. (DFG):
  12069. (VariableEventStream):
  12070. (JSC::DFG::VariableEventStream::appendAndLog):
  12071. * dfg/DFGVirtualRegisterAllocationPhase.cpp:
  12072. (JSC::DFG::performVirtualRegisterAllocation):
  12073. 2012-07-02 Filip Pizlo <fpizlo@apple.com>
  12074. DFG::ArgumentsSimplificationPhase should assert that the PhantomArguments nodes it creates are not shouldGenerate()
  12075. https://bugs.webkit.org/show_bug.cgi?id=90407
  12076. Reviewed by Mark Hahnenberg.
  12077. * dfg/DFGArgumentsSimplificationPhase.cpp:
  12078. (JSC::DFG::ArgumentsSimplificationPhase::run):
  12079. 2012-07-02 Gavin Barraclough <barraclough@apple.com>
  12080. Array.prototype.pop should throw if property is not configurable
  12081. https://bugs.webkit.org/show_bug.cgi?id=75788
  12082. Rubber Stamped by Oliver Hunt.
  12083. No real bug here any more, but the error we throw sometimes has a misleading message.
  12084. * runtime/JSArray.cpp:
  12085. (JSC::JSArray::pop):
  12086. 2012-06-29 Filip Pizlo <fpizlo@apple.com>
  12087. JSObject wastes too much memory on unused property slots
  12088. https://bugs.webkit.org/show_bug.cgi?id=90255
  12089. Reviewed by Mark Hahnenberg.
  12090. Rolling back in after applying a simple fix: it appears that
  12091. JSObject::setStructureAndReallocateStorageIfNecessary() was allocating more
  12092. property storage than necessary. Fixing this appears to resolve the crash.
  12093. This does a few things:
  12094. - JSNonFinalObject no longer has inline property storage.
  12095. - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
  12096. or 2x the inline storage for JSFinalObject.
  12097. - Property storage is only reallocated if it needs to be. Previously, we
  12098. would reallocate the property storage on any transition where the original
  12099. structure said shouldGrowProperyStorage(), but this led to spurious
  12100. reallocations when doing transitionless property adds and there are
  12101. deleted property slots available. That in turn led to crashes, because we
  12102. would switch to out-of-line storage even if the capacity matched the
  12103. criteria for inline storage.
  12104. - Inline JSFunction allocation is killed off because we don't have a good
  12105. way of inlining property storage allocation. This didn't hurt performance.
  12106. Killing off code is better than fixing it if that code wasn't doing any
  12107. good.
  12108. This looks like a 1% progression on V8.
  12109. * interpreter/Interpreter.cpp:
  12110. (JSC::Interpreter::privateExecute):
  12111. * jit/JIT.cpp:
  12112. (JSC::JIT::privateCompileSlowCases):
  12113. * jit/JIT.h:
  12114. * jit/JITInlineMethods.h:
  12115. (JSC::JIT::emitAllocateBasicJSObject):
  12116. (JSC):
  12117. * jit/JITOpcodes.cpp:
  12118. (JSC::JIT::emit_op_new_func):
  12119. (JSC):
  12120. (JSC::JIT::emit_op_new_func_exp):
  12121. * runtime/JSFunction.cpp:
  12122. (JSC::JSFunction::finishCreation):
  12123. * runtime/JSObject.h:
  12124. (JSC::JSObject::isUsingInlineStorage):
  12125. (JSObject):
  12126. (JSC::JSObject::finishCreation):
  12127. (JSC):
  12128. (JSC::JSNonFinalObject::hasInlineStorage):
  12129. (JSNonFinalObject):
  12130. (JSC::JSNonFinalObject::JSNonFinalObject):
  12131. (JSC::JSNonFinalObject::finishCreation):
  12132. (JSC::JSFinalObject::hasInlineStorage):
  12133. (JSC::JSFinalObject::finishCreation):
  12134. (JSC::JSObject::offsetOfInlineStorage):
  12135. (JSC::JSObject::setPropertyStorage):
  12136. (JSC::Structure::inlineStorageCapacity):
  12137. (JSC::Structure::isUsingInlineStorage):
  12138. (JSC::JSObject::putDirectInternal):
  12139. (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
  12140. (JSC::JSObject::putDirectWithoutTransition):
  12141. * runtime/Structure.cpp:
  12142. (JSC::Structure::Structure):
  12143. (JSC::nextPropertyStorageCapacity):
  12144. (JSC):
  12145. (JSC::Structure::growPropertyStorageCapacity):
  12146. (JSC::Structure::suggestedNewPropertyStorageSize):
  12147. * runtime/Structure.h:
  12148. (JSC::Structure::putWillGrowPropertyStorage):
  12149. (Structure):
  12150. 2012-06-29 Filip Pizlo <fpizlo@apple.com>
  12151. Webkit crashes in DFG on Google Docs when creating a new document
  12152. https://bugs.webkit.org/show_bug.cgi?id=90209
  12153. Reviewed by Gavin Barraclough.
  12154. Don't attempt to short-circuit Phantom(GetLocal) if the GetLocal is for a
  12155. captured variable.
  12156. * dfg/DFGCFGSimplificationPhase.cpp:
  12157. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  12158. 2012-06-30 Zan Dobersek <zandobersek@gmail.com>
  12159. Unreviewed, rolling out r121605.
  12160. http://trac.webkit.org/changeset/121605
  12161. https://bugs.webkit.org/show_bug.cgi?id=90336
  12162. Changes caused flaky crashes in sputnik/Unicode tests on Apple
  12163. WK1 and GTK Linux builders
  12164. * interpreter/Interpreter.cpp:
  12165. (JSC::Interpreter::privateExecute):
  12166. * jit/JIT.cpp:
  12167. (JSC::JIT::privateCompileSlowCases):
  12168. * jit/JIT.h:
  12169. * jit/JITInlineMethods.h:
  12170. (JSC::JIT::emitAllocateBasicJSObject):
  12171. (JSC::JIT::emitAllocateJSFinalObject):
  12172. (JSC):
  12173. (JSC::JIT::emitAllocateJSFunction):
  12174. * jit/JITOpcodes.cpp:
  12175. (JSC::JIT::emit_op_new_func):
  12176. (JSC::JIT::emitSlow_op_new_func):
  12177. (JSC):
  12178. (JSC::JIT::emit_op_new_func_exp):
  12179. (JSC::JIT::emitSlow_op_new_func_exp):
  12180. * runtime/JSFunction.cpp:
  12181. (JSC::JSFunction::finishCreation):
  12182. * runtime/JSObject.h:
  12183. (JSC::JSObject::isUsingInlineStorage):
  12184. (JSObject):
  12185. (JSC::JSObject::finishCreation):
  12186. (JSC):
  12187. (JSNonFinalObject):
  12188. (JSC::JSNonFinalObject::JSNonFinalObject):
  12189. (JSC::JSNonFinalObject::finishCreation):
  12190. (JSFinalObject):
  12191. (JSC::JSFinalObject::finishCreation):
  12192. (JSC::JSObject::offsetOfInlineStorage):
  12193. (JSC::JSObject::setPropertyStorage):
  12194. (JSC::Structure::isUsingInlineStorage):
  12195. (JSC::JSObject::putDirectInternal):
  12196. (JSC::JSObject::putDirectWithoutTransition):
  12197. (JSC::JSObject::transitionTo):
  12198. * runtime/Structure.cpp:
  12199. (JSC::Structure::Structure):
  12200. (JSC):
  12201. (JSC::Structure::growPropertyStorageCapacity):
  12202. (JSC::Structure::suggestedNewPropertyStorageSize):
  12203. * runtime/Structure.h:
  12204. (JSC::Structure::shouldGrowPropertyStorage):
  12205. (JSC::Structure::propertyStorageSize):
  12206. 2012-06-29 Mark Hahnenberg <mhahnenberg@apple.com>
  12207. Remove warning about protected values when the Heap is being destroyed
  12208. https://bugs.webkit.org/show_bug.cgi?id=90302
  12209. Reviewed by Geoffrey Garen.
  12210. Having to do book-keeping about whether values allocated from a certain
  12211. VM are or are not protected makes the JSC API much more difficult to use
  12212. correctly. Clients should be able to throw an entire VM away and not have
  12213. to worry about unprotecting all of the values that they protected earlier.
  12214. * heap/Heap.cpp:
  12215. (JSC::Heap::lastChanceToFinalize):
  12216. 2012-06-29 Filip Pizlo <fpizlo@apple.com>
  12217. JSObject wastes too much memory on unused property slots
  12218. https://bugs.webkit.org/show_bug.cgi?id=90255
  12219. Reviewed by Mark Hahnenberg.
  12220. This does a few things:
  12221. - JSNonFinalObject no longer has inline property storage.
  12222. - Initial out-of-line property storage size is 4 slots for JSNonFinalObject,
  12223. or 2x the inline storage for JSFinalObject.
  12224. - Property storage is only reallocated if it needs to be. Previously, we
  12225. would reallocate the property storage on any transition where the original
  12226. structure said shouldGrowProperyStorage(), but this led to spurious
  12227. reallocations when doing transitionless property adds and there are
  12228. deleted property slots available. That in turn led to crashes, because we
  12229. would switch to out-of-line storage even if the capacity matched the
  12230. criteria for inline storage.
  12231. - Inline JSFunction allocation is killed off because we don't have a good
  12232. way of inlining property storage allocation. This didn't hurt performance.
  12233. Killing off code is better than fixing it if that code wasn't doing any
  12234. good.
  12235. This looks like a 1% progression on V8.
  12236. * interpreter/Interpreter.cpp:
  12237. (JSC::Interpreter::privateExecute):
  12238. * jit/JIT.cpp:
  12239. (JSC::JIT::privateCompileSlowCases):
  12240. * jit/JIT.h:
  12241. * jit/JITInlineMethods.h:
  12242. (JSC::JIT::emitAllocateBasicJSObject):
  12243. (JSC):
  12244. * jit/JITOpcodes.cpp:
  12245. (JSC::JIT::emit_op_new_func):
  12246. (JSC):
  12247. (JSC::JIT::emit_op_new_func_exp):
  12248. * runtime/JSFunction.cpp:
  12249. (JSC::JSFunction::finishCreation):
  12250. * runtime/JSObject.h:
  12251. (JSC::JSObject::isUsingInlineStorage):
  12252. (JSObject):
  12253. (JSC::JSObject::finishCreation):
  12254. (JSC):
  12255. (JSC::JSNonFinalObject::hasInlineStorage):
  12256. (JSNonFinalObject):
  12257. (JSC::JSNonFinalObject::JSNonFinalObject):
  12258. (JSC::JSNonFinalObject::finishCreation):
  12259. (JSC::JSFinalObject::hasInlineStorage):
  12260. (JSC::JSFinalObject::finishCreation):
  12261. (JSC::JSObject::offsetOfInlineStorage):
  12262. (JSC::JSObject::setPropertyStorage):
  12263. (JSC::Structure::inlineStorageCapacity):
  12264. (JSC::Structure::isUsingInlineStorage):
  12265. (JSC::JSObject::putDirectInternal):
  12266. (JSC::JSObject::setStructureAndReallocateStorageIfNecessary):
  12267. (JSC::JSObject::putDirectWithoutTransition):
  12268. * runtime/Structure.cpp:
  12269. (JSC::Structure::Structure):
  12270. (JSC::nextPropertyStorageCapacity):
  12271. (JSC):
  12272. (JSC::Structure::growPropertyStorageCapacity):
  12273. (JSC::Structure::suggestedNewPropertyStorageSize):
  12274. * runtime/Structure.h:
  12275. (JSC::Structure::putWillGrowPropertyStorage):
  12276. (Structure):
  12277. 2012-06-28 Filip Pizlo <fpizlo@apple.com>
  12278. DFG recompilation heuristics should be based on count, not rate
  12279. https://bugs.webkit.org/show_bug.cgi?id=90146
  12280. Reviewed by Oliver Hunt.
  12281. This removes a bunch of code that was previously trying to prevent spurious
  12282. reoptimizations if a large enough majority of executions of a code block did
  12283. not result in OSR exit. It turns out that this code was purely harmful. This
  12284. patch removes all of that logic and replaces it with a dead-simple
  12285. heuristic: if you exit more than N times (where N is an exponential function
  12286. of the number of times the code block has already been recompiled) then we
  12287. will recompile.
  12288. This appears to be a broad ~1% win on many benchmarks large and small.
  12289. * bytecode/CodeBlock.cpp:
  12290. (JSC::CodeBlock::CodeBlock):
  12291. * bytecode/CodeBlock.h:
  12292. (JSC::CodeBlock::osrExitCounter):
  12293. (JSC::CodeBlock::countOSRExit):
  12294. (CodeBlock):
  12295. (JSC::CodeBlock::addressOfOSRExitCounter):
  12296. (JSC::CodeBlock::offsetOfOSRExitCounter):
  12297. (JSC::CodeBlock::adjustedExitCountThreshold):
  12298. (JSC::CodeBlock::exitCountThresholdForReoptimization):
  12299. (JSC::CodeBlock::exitCountThresholdForReoptimizationFromLoop):
  12300. (JSC::CodeBlock::shouldReoptimizeNow):
  12301. (JSC::CodeBlock::shouldReoptimizeFromLoopNow):
  12302. * bytecode/ExecutionCounter.cpp:
  12303. (JSC::ExecutionCounter::setThreshold):
  12304. * bytecode/ExecutionCounter.h:
  12305. (ExecutionCounter):
  12306. (JSC::ExecutionCounter::clippedThreshold):
  12307. * dfg/DFGJITCompiler.cpp:
  12308. (JSC::DFG::JITCompiler::compileBody):
  12309. * dfg/DFGOSRExit.cpp:
  12310. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  12311. * dfg/DFGOSRExitCompiler.cpp:
  12312. (JSC::DFG::OSRExitCompiler::handleExitCounts):
  12313. * dfg/DFGOperations.cpp:
  12314. * jit/JITStubs.cpp:
  12315. (JSC::DEFINE_STUB_FUNCTION):
  12316. * runtime/Options.cpp:
  12317. (Options):
  12318. (JSC::Options::initializeOptions):
  12319. * runtime/Options.h:
  12320. (Options):
  12321. 2012-06-28 Mark Lam <mark.lam@apple.com>
  12322. Adding a commenting utility to record BytecodeGenerator comments
  12323. with opcodes that are emitted. Presently, the comments can only
  12324. be constant strings. Adding comments for opcodes is optional.
  12325. If a comment is added, the comment will be printed following the
  12326. opcode when CodeBlock::dump() is called.
  12327. This utility is disabled by default, and is only meant for VM
  12328. development purposes. It should not be enabled for product builds.
  12329. To enable this utility, set ENABLE_BYTECODE_COMMENTS in CodeBlock.h
  12330. to 1.
  12331. https://bugs.webkit.org/show_bug.cgi?id=90095
  12332. Reviewed by Geoffrey Garen.
  12333. * GNUmakefile.list.am:
  12334. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  12335. * JavaScriptCore.xcodeproj/project.pbxproj:
  12336. * bytecode/CodeBlock.cpp:
  12337. (JSC::CodeBlock::dumpBytecodeCommentAndNewLine): Dumps the comment.
  12338. (JSC):
  12339. (JSC::CodeBlock::printUnaryOp): Add comment dumps.
  12340. (JSC::CodeBlock::printBinaryOp): Add comment dumps.
  12341. (JSC::CodeBlock::printConditionalJump): Add comment dumps.
  12342. (JSC::CodeBlock::printCallOp): Add comment dumps.
  12343. (JSC::CodeBlock::printPutByIdOp): Add comment dumps.
  12344. (JSC::CodeBlock::dump): Add comment dumps.
  12345. (JSC::CodeBlock::CodeBlock):
  12346. (JSC::CodeBlock::commentForBytecodeOffset):
  12347. Finds the comment for an opcode if available.
  12348. (JSC::CodeBlock::dumpBytecodeComments):
  12349. For debugging whether comments are collected.
  12350. It is not being called anywhere.
  12351. * bytecode/CodeBlock.h:
  12352. (CodeBlock):
  12353. (JSC::CodeBlock::bytecodeComments):
  12354. * bytecode/Comment.h: Added.
  12355. (JSC):
  12356. (Comment):
  12357. * bytecompiler/BytecodeGenerator.cpp:
  12358. (JSC::BytecodeGenerator::BytecodeGenerator):
  12359. (JSC::BytecodeGenerator::emitOpcode): Calls emitComment().
  12360. (JSC):
  12361. (JSC::BytecodeGenerator::emitComment): Adds comment to CodeBlock.
  12362. (JSC::BytecodeGenerator::prependComment):
  12363. Registers a comment for emitComemnt() to use later.
  12364. * bytecompiler/BytecodeGenerator.h:
  12365. (BytecodeGenerator):
  12366. (JSC::BytecodeGenerator::emitComment):
  12367. (JSC::BytecodeGenerator::prependComment):
  12368. These are inlined versions of these functions that nullify them
  12369. when ENABLE_BYTECODE_COMMENTS is 0.
  12370. (JSC::BytecodeGenerator::comments):
  12371. 2012-06-28 Oliver Hunt <oliver@apple.com>
  12372. 32bit DFG incorrectly claims an fpr is fillable even if it has not been proven double
  12373. https://bugs.webkit.org/show_bug.cgi?id=90127
  12374. Reviewed by Filip Pizlo.
  12375. The 32-bit version of fillSpeculateDouble doesn't handle Number->fpr loads
  12376. correctly. This patch fixes this by killing the fill info in the GenerationInfo
  12377. when the spillFormat doesn't guarantee the value is a double.
  12378. * dfg/DFGSpeculativeJIT32_64.cpp:
  12379. (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
  12380. 2012-06-28 Kent Tamura <tkent@chromium.org>
  12381. Classify form control states by their owner forms
  12382. https://bugs.webkit.org/show_bug.cgi?id=89950
  12383. Reviewed by Hajime Morita.
  12384. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  12385. Expose WTF::StringBuilder::canShrink()
  12386. 2012-06-27 Michael Saboff <msaboff@apple.com>
  12387. [Win] jscore-tests flakey
  12388. https://bugs.webkit.org/show_bug.cgi?id=88118
  12389. Reviewed by Jessie Berlin.
  12390. jsDriver.pl on windows intermittently doesn't get the returned value from jsc,
  12391. instead it gets 126. Added a new option to jsc (-x) which prints the exit
  12392. code before exiting. jsDriver.pl uses this option on Windows and parses the
  12393. exit code output for the exit code, removing it before comparing the actual
  12394. and expected outputs. Filed a follow on "FIXME" defect:
  12395. [WIN] Intermittent failure for jsc return value to propagate through jsDriver.pl
  12396. https://bugs.webkit.org/show_bug.cgi?id=90119
  12397. * jsc.cpp:
  12398. (CommandLine::CommandLine):
  12399. (CommandLine):
  12400. (printUsageStatement):
  12401. (parseArguments):
  12402. (jscmain):
  12403. * tests/mozilla/jsDriver.pl:
  12404. (execute_tests):
  12405. 2012-06-27 Sheriff Bot <webkit.review.bot@gmail.com>
  12406. Unreviewed, rolling out r121359.
  12407. http://trac.webkit.org/changeset/121359
  12408. https://bugs.webkit.org/show_bug.cgi?id=90115
  12409. Broke many inspector tests (Requested by jpfau on #webkit).
  12410. * interpreter/Interpreter.h:
  12411. (JSC::StackFrame::toString):
  12412. 2012-06-27 Filip Pizlo <fpizlo@apple.com>
  12413. Javascript SHA-512 gives wrong hash on second and subsequent runs unless Web Inspector Javascript Debugging is on
  12414. https://bugs.webkit.org/show_bug.cgi?id=90053
  12415. <rdar://problem/11764613>
  12416. Reviewed by Mark Hahnenberg.
  12417. The problem is that the code was assuming that the recovery should be Undefined if the source of
  12418. the SetLocal was !shouldGenerate(). But that's wrong, since the DFG optimizer may skip around a
  12419. UInt32ToNumber node (hence making it !shouldGenerate()) and keep the source of that node alive.
  12420. In that case we should base the recovery on the source of the UInt32ToNumber. The logic for this
  12421. was already in place but the fast check for !shouldGenerate() broke it.
  12422. * dfg/DFGSpeculativeJIT.cpp:
  12423. (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
  12424. 2012-06-27 Filip Pizlo <fpizlo@apple.com>
  12425. DFG disassembly should be easier to read
  12426. https://bugs.webkit.org/show_bug.cgi?id=90106
  12427. Reviewed by Mark Hahnenberg.
  12428. Did a few things:
  12429. - Options::showDFGDisassembly now shows OSR exit disassembly as well.
  12430. - Phi node dumping doesn't attempt to do line wrapping since it just made the dump harder
  12431. to read.
  12432. - DFG graph disassembly view shows a few additional node types that turn out to be
  12433. essential for understanding OSR exits.
  12434. Put together, these changes reinforce the philosophy that anything needed for computing
  12435. OSR exit is just as important as the machine code itself. Of course, we still don't take
  12436. that philosophy to its full extreme - for example Phantom nodes are not dumped. We may
  12437. revisit that in the future.
  12438. * assembler/LinkBuffer.cpp:
  12439. (JSC::LinkBuffer::finalizeCodeWithDisassembly):
  12440. * assembler/LinkBuffer.h:
  12441. (JSC):
  12442. * dfg/DFGDisassembler.cpp:
  12443. (JSC::DFG::Disassembler::dump):
  12444. * dfg/DFGGraph.cpp:
  12445. (JSC::DFG::Graph::dumpBlockHeader):
  12446. * dfg/DFGNode.h:
  12447. (JSC::DFG::Node::willHaveCodeGenOrOSR):
  12448. * dfg/DFGOSRExitCompiler.cpp:
  12449. * jit/JIT.cpp:
  12450. (JSC::JIT::privateCompile):
  12451. 2012-06-25 Mark Hahnenberg <mhahnenberg@apple.com>
  12452. JSLock should be per-JSGlobalData
  12453. https://bugs.webkit.org/show_bug.cgi?id=89123
  12454. Reviewed by Geoffrey Garen.
  12455. * API/APIShims.h:
  12456. (APIEntryShimWithoutLock):
  12457. (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
  12458. determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
  12459. HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
  12460. JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
  12461. its destruction has begun.
  12462. (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
  12463. (JSC::APIEntryShim::APIEntryShim):
  12464. (APIEntryShim):
  12465. (JSC::APIEntryShim::~APIEntryShim):
  12466. (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
  12467. Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
  12468. and before we've released it, which can only done in APIEntryShim.
  12469. (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
  12470. * API/JSContextRef.cpp:
  12471. (JSGlobalContextCreate):
  12472. (JSGlobalContextCreateInGroup):
  12473. (JSGlobalContextRelease):
  12474. (JSContextCreateBacktrace):
  12475. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  12476. * heap/CopiedSpace.cpp:
  12477. (JSC::CopiedSpace::tryAllocateSlowCase):
  12478. * heap/Heap.cpp:
  12479. (JSC::Heap::protect):
  12480. (JSC::Heap::unprotect):
  12481. (JSC::Heap::collect):
  12482. (JSC::Heap::setActivityCallback):
  12483. (JSC::Heap::activityCallback):
  12484. (JSC::Heap::sweeper):
  12485. * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
  12486. are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
  12487. and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
  12488. prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
  12489. (Heap):
  12490. * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
  12491. (JSC::HeapTimer::~HeapTimer):
  12492. (JSC::HeapTimer::invalidate):
  12493. (JSC):
  12494. (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
  12495. that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
  12496. HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
  12497. (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
  12498. out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
  12499. but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
  12500. we were interrupted between releasing our mutex and trying to grab the APILock.
  12501. * heap/HeapTimer.h:
  12502. (HeapTimer):
  12503. * heap/IncrementalSweeper.cpp:
  12504. (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
  12505. all of that for us.
  12506. (JSC::IncrementalSweeper::create):
  12507. * heap/IncrementalSweeper.h:
  12508. (IncrementalSweeper):
  12509. * heap/MarkedAllocator.cpp:
  12510. (JSC::MarkedAllocator::allocateSlowCase):
  12511. * heap/WeakBlock.cpp:
  12512. (JSC::WeakBlock::reap):
  12513. * jsc.cpp:
  12514. (functionGC):
  12515. (functionReleaseExecutableMemory):
  12516. (jscmain):
  12517. * runtime/Completion.cpp:
  12518. (JSC::checkSyntax):
  12519. (JSC::evaluate):
  12520. * runtime/GCActivityCallback.h:
  12521. (DefaultGCActivityCallback):
  12522. (JSC::DefaultGCActivityCallback::create):
  12523. * runtime/JSGlobalData.cpp:
  12524. (JSC::JSGlobalData::JSGlobalData):
  12525. (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
  12526. that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
  12527. it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
  12528. APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
  12529. (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
  12530. (JSC::JSGlobalData::sharedInstanceInternal):
  12531. * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
  12532. de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
  12533. (JSGlobalData):
  12534. (JSC::JSGlobalData::apiLock):
  12535. * runtime/JSGlobalObject.cpp:
  12536. (JSC::JSGlobalObject::~JSGlobalObject):
  12537. (JSC::JSGlobalObject::init):
  12538. * runtime/JSLock.cpp:
  12539. (JSC):
  12540. (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
  12541. (JSC::GlobalJSLock::~GlobalJSLock):
  12542. (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
  12543. it can successfully unlock it later without it disappearing from underneath it.
  12544. (JSC::JSLockHolder::~JSLockHolder):
  12545. (JSC::JSLock::JSLock):
  12546. (JSC::JSLock::~JSLock):
  12547. (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
  12548. actually waiting for long periods.
  12549. (JSC::JSLock::unlock):
  12550. (JSC::JSLock::currentThreadIsHoldingLock):
  12551. (JSC::JSLock::dropAllLocks):
  12552. (JSC::JSLock::dropAllLocksUnconditionally):
  12553. (JSC::JSLock::grabAllLocks):
  12554. (JSC::JSLock::DropAllLocks::DropAllLocks):
  12555. (JSC::JSLock::DropAllLocks::~DropAllLocks):
  12556. * runtime/JSLock.h:
  12557. (JSC):
  12558. (GlobalJSLock):
  12559. (JSLockHolder):
  12560. (JSLock):
  12561. (DropAllLocks):
  12562. * runtime/WeakGCMap.h:
  12563. (JSC::WeakGCMap::set):
  12564. * testRegExp.cpp:
  12565. (realMain):
  12566. 2012-06-27 Filip Pizlo <fpizlo@apple.com>
  12567. x86 disassembler confuses immediates with addresses
  12568. https://bugs.webkit.org/show_bug.cgi?id=90099
  12569. Reviewed by Mark Hahnenberg.
  12570. Prepend "$" to immediates to disambiguate between immediates and addresses. This is in
  12571. accordance with the gas and AT&T syntax.
  12572. * disassembler/udis86/udis86_syn-att.c:
  12573. (gen_operand):
  12574. 2012-06-27 Filip Pizlo <fpizlo@apple.com>
  12575. Add a comment clarifying Options::showDisassembly versus Options::showDFGDisassembly.
  12576. Rubber stamped by Mark Hahnenberg.
  12577. * runtime/Options.cpp:
  12578. (JSC::Options::initializeOptions):
  12579. 2012-06-27 Anthony Scian <ascian@rim.com>
  12580. Web Inspector [JSC]: Implement ScriptCallStack::stackTrace
  12581. https://bugs.webkit.org/show_bug.cgi?id=40118
  12582. Reviewed by Yong Li.
  12583. Added member functions to expose function name, urlString, and line #.
  12584. Refactored toString to make use of these member functions to reduce
  12585. duplicated code for future maintenance.
  12586. Manually tested refactoring of toString by tracing thrown exceptions.
  12587. * interpreter/Interpreter.h:
  12588. (StackFrame):
  12589. (JSC::StackFrame::toString):
  12590. (JSC::StackFrame::friendlySourceURL):
  12591. (JSC::StackFrame::friendlyFunctionName):
  12592. (JSC::StackFrame::friendlyLineNumber):
  12593. 2012-06-27 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
  12594. [Qt] Remove redundant c++11 warning suppression code
  12595. This is already handled in default_post.
  12596. Reviewed by Tor Arne Vestbø.
  12597. * Target.pri:
  12598. 2012-06-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
  12599. [Qt] Add missing heades to HEADERS
  12600. For JavaScriptCore there aren't any Qt specific files, so we include all
  12601. headers for easy editing in Qt Creator.
  12602. Reviewed by Simon Hausmann.
  12603. * Target.pri:
  12604. 2012-06-26 Dominic Cooney <dominicc@chromium.org>
  12605. [Chromium] Remove unused build scripts and empty folders for JavaScriptCore w/ gyp
  12606. https://bugs.webkit.org/show_bug.cgi?id=90029
  12607. Reviewed by Adam Barth.
  12608. * gyp: Removed.
  12609. * gyp/generate-derived-sources.sh: Removed.
  12610. * gyp/generate-dtrace-header.sh: Removed.
  12611. * gyp/run-if-exists.sh: Removed.
  12612. * gyp/update-info-plist.sh: Removed.
  12613. 2012-06-26 Geoffrey Garen <ggaren@apple.com>
  12614. Reduced (but did not eliminate) use of "berzerker GC"
  12615. https://bugs.webkit.org/show_bug.cgi?id=89237
  12616. Reviewed by Gavin Barraclough.
  12617. (PART 2)
  12618. This part turns off "berzerker GC" and turns on incremental shrinking.
  12619. * heap/IncrementalSweeper.cpp:
  12620. (JSC::IncrementalSweeper::doSweep): Free or shrink after sweeping to
  12621. maintain the behavior we used to get from the occasional berzerker GC,
  12622. which would run all finalizers and then free or shrink all blocks
  12623. synchronously.
  12624. * heap/MarkedBlock.h:
  12625. (JSC::MarkedBlock::needsSweeping): Sweep zapped blocks, too. It's always
  12626. safe to sweep a zapped block (that's the point of zapping), and it's
  12627. sometimes profitable. For example, consider this case: Block A does some
  12628. allocation (transitioning Block A from Marked to FreeListed), then GC
  12629. happens (transitioning Block A to Zapped), then all objects in Block A
  12630. are free, then the incremental sweeper visits Block A. If we skipped
  12631. Zapped blocks, we'd skip Block A, even though it would be profitable to
  12632. run its destructors and free its memory.
  12633. * runtime/GCActivityCallback.cpp:
  12634. (JSC::DefaultGCActivityCallback::doWork): Don't sweep eagerly; we'll do
  12635. this incrementally.
  12636. 2012-06-26 Filip Pizlo <fpizlo@apple.com>
  12637. DFG PutByValAlias is too aggressive
  12638. https://bugs.webkit.org/show_bug.cgi?id=90026
  12639. <rdar://problem/11751830>
  12640. Reviewed by Gavin Barraclough.
  12641. For CSE on normal arrays, we now treat PutByVal as impure. This does not appear to affect
  12642. performance by much.
  12643. For CSE on typed arrays, we fix PutByValAlias by making GetByVal speculate that the access
  12644. is within bounds. This also has the effect of making our out-of-bounds handling consistent
  12645. with WebCore.
  12646. * dfg/DFGCSEPhase.cpp:
  12647. (JSC::DFG::CSEPhase::performNodeCSE):
  12648. * dfg/DFGGraph.h:
  12649. (JSC::DFG::Graph::byValIsPure):
  12650. (JSC::DFG::Graph::clobbersWorld):
  12651. * dfg/DFGNodeType.h:
  12652. (DFG):
  12653. * dfg/DFGSpeculativeJIT.cpp:
  12654. (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
  12655. (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
  12656. 2012-06-26 Yong Li <yoli@rim.com>
  12657. [BlackBerry] Add JSC statistics into about:memory
  12658. https://bugs.webkit.org/show_bug.cgi?id=89779
  12659. Reviewed by Rob Buis.
  12660. Fix non-JIT build on BlackBerry broken by r121196.
  12661. * runtime/MemoryStatistics.cpp:
  12662. (JSC::globalMemoryStatistics):
  12663. 2012-06-25 Filip Pizlo <fpizlo@apple.com>
  12664. DFG::operationNewArray is unnecessarily slow, and may use the wrong array
  12665. prototype when inlined
  12666. https://bugs.webkit.org/show_bug.cgi?id=89821
  12667. Reviewed by Geoffrey Garen.
  12668. Fixes all array allocations to use the right structure, and hence the right prototype. Adds
  12669. inlining of new Array(...) with a non-zero number of arguments. Optimizes allocations of
  12670. empty arrays.
  12671. * dfg/DFGAbstractState.cpp:
  12672. (JSC::DFG::AbstractState::execute):
  12673. * dfg/DFGByteCodeParser.cpp:
  12674. (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
  12675. * dfg/DFGCCallHelpers.h:
  12676. (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
  12677. (CCallHelpers):
  12678. * dfg/DFGNodeType.h:
  12679. (DFG):
  12680. * dfg/DFGOperations.cpp:
  12681. * dfg/DFGOperations.h:
  12682. * dfg/DFGPredictionPropagationPhase.cpp:
  12683. (JSC::DFG::PredictionPropagationPhase::propagate):
  12684. * dfg/DFGSpeculativeJIT.h:
  12685. (JSC::DFG::SpeculativeJIT::callOperation):
  12686. * dfg/DFGSpeculativeJIT32_64.cpp:
  12687. (JSC::DFG::SpeculativeJIT::compile):
  12688. * dfg/DFGSpeculativeJIT64.cpp:
  12689. (JSC::DFG::SpeculativeJIT::compile):
  12690. * runtime/JSArray.h:
  12691. (JSC):
  12692. (JSC::constructArray):
  12693. * runtime/JSGlobalObject.h:
  12694. (JSC):
  12695. (JSC::constructArray):
  12696. 2012-06-26 Filip Pizlo <fpizlo@apple.com>
  12697. New fast/js/dfg-store-unexpected-value-into-argument-and-osr-exit.html fails on 32 bit
  12698. https://bugs.webkit.org/show_bug.cgi?id=89953
  12699. Reviewed by Zoltan Herczeg.
  12700. DFG 32-bit JIT was confused about the difference between a predicted type and a
  12701. proven type. This is easy to get confused about, since a local that is predicted int32
  12702. almost always means that the local must be an int32 since speculations are hoisted to
  12703. stores to locals. But that is less likely to be the case for arguments, where there is
  12704. an additional least-upper-bounding step: any store to an argument with a weird type
  12705. may force the argument to be any type.
  12706. This patch basically duplicates the functionality in DFGSpeculativeJIT64.cpp for
  12707. GetLocal: the decision of whether to load a local as an int32 (or as an array, or as
  12708. a boolean) is made based on the AbstractValue::m_type, which is a type proof, rather
  12709. than the VariableAccessData::prediction(), which is a predicted type.
  12710. * dfg/DFGSpeculativeJIT32_64.cpp:
  12711. (JSC::DFG::SpeculativeJIT::compile):
  12712. 2012-06-25 Filip Pizlo <fpizlo@apple.com>
  12713. JSC should try to make profiling deterministic because otherwise reproducing failures is
  12714. nearly impossible
  12715. https://bugs.webkit.org/show_bug.cgi?id=89940
  12716. Rubber stamped by Gavin Barraclough.
  12717. This rolls out the part of http://trac.webkit.org/changeset/121215 that introduced randomness
  12718. into the system. Now, instead of randomizing the tier-up threshold, we always set it to an
  12719. artificially low (and statically predetermined!) value. This gives most of the benefit of
  12720. threshold randomization without actually making the system behave completely differently on
  12721. each invocation.
  12722. * bytecode/ExecutionCounter.cpp:
  12723. (JSC::ExecutionCounter::setThreshold):
  12724. * runtime/Options.cpp:
  12725. (Options):
  12726. (JSC::Options::initializeOptions):
  12727. * runtime/Options.h:
  12728. (Options):
  12729. 2012-06-22 Filip Pizlo <fpizlo@apple.com>
  12730. Value profiling should use tier-up threshold randomization to get more coverage
  12731. https://bugs.webkit.org/show_bug.cgi?id=89802
  12732. Reviewed by Gavin Barraclough.
  12733. This patch causes both LLInt and Baseline JIT code to take the OSR slow path several
  12734. times before actually doing OSR. If we take the OSR slow path before the execution
  12735. count threshold is reached, then we just call CodeBlock::updateAllPredictions() to
  12736. compute the current latest least-upper-bound SpecType of all values seen in each
  12737. ValueProfile.
  12738. * bytecode/CodeBlock.cpp:
  12739. (JSC::CodeBlock::stronglyVisitStrongReferences):
  12740. (JSC::CodeBlock::updateAllPredictionsAndCountLiveness):
  12741. (JSC):
  12742. (JSC::CodeBlock::updateAllPredictions):
  12743. (JSC::CodeBlock::shouldOptimizeNow):
  12744. * bytecode/CodeBlock.h:
  12745. (JSC::CodeBlock::llintExecuteCounter):
  12746. (JSC::CodeBlock::jitExecuteCounter):
  12747. (CodeBlock):
  12748. (JSC::CodeBlock::updateAllPredictions):
  12749. * bytecode/ExecutionCounter.cpp:
  12750. (JSC::ExecutionCounter::setThreshold):
  12751. (JSC::ExecutionCounter::status):
  12752. (JSC):
  12753. * bytecode/ExecutionCounter.h:
  12754. (JSC::ExecutionCounter::count):
  12755. (ExecutionCounter):
  12756. * dfg/DFGAbstractState.cpp:
  12757. (JSC::DFG::AbstractState::execute):
  12758. * dfg/DFGOperations.cpp:
  12759. * dfg/DFGSpeculativeJIT.cpp:
  12760. (JSC::DFG::SpeculativeJIT::compile):
  12761. * jit/JITStubs.cpp:
  12762. (JSC::DEFINE_STUB_FUNCTION):
  12763. * llint/LLIntSlowPaths.cpp:
  12764. (JSC::LLInt::jitCompileAndSetHeuristics):
  12765. (JSC::LLInt::entryOSR):
  12766. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  12767. * runtime/JSGlobalObject.cpp:
  12768. (JSC::JSGlobalObject::JSGlobalObject):
  12769. (JSC):
  12770. * runtime/JSGlobalObject.h:
  12771. (JSGlobalObject):
  12772. (JSC::JSGlobalObject::weakRandomInteger):
  12773. * runtime/Options.cpp:
  12774. (Options):
  12775. (JSC::Options::initializeOptions):
  12776. * runtime/Options.h:
  12777. (Options):
  12778. * runtime/WeakRandom.h:
  12779. (WeakRandom):
  12780. (JSC::WeakRandom::seedUnsafe):
  12781. 2012-06-25 Yong Li <yoli@rim.com>
  12782. [BlackBerry] Add JSC statistics into about:memory
  12783. https://bugs.webkit.org/show_bug.cgi?id=89779
  12784. Reviewed by Rob Buis.
  12785. Add MemoryStatistics.cpp into build, and fill JITBytes for BlackBerry port.
  12786. * PlatformBlackBerry.cmake:
  12787. * runtime/MemoryStatistics.cpp:
  12788. (JSC::globalMemoryStatistics):
  12789. 2012-06-23 Sheriff Bot <webkit.review.bot@gmail.com>
  12790. Unreviewed, rolling out r121058.
  12791. http://trac.webkit.org/changeset/121058
  12792. https://bugs.webkit.org/show_bug.cgi?id=89809
  12793. Patch causes plugins tests to crash in GTK debug builds
  12794. (Requested by zdobersek on #webkit).
  12795. * API/APIShims.h:
  12796. (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock):
  12797. (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock):
  12798. (APIEntryShimWithoutLock):
  12799. (JSC::APIEntryShim::APIEntryShim):
  12800. (APIEntryShim):
  12801. (JSC::APICallbackShim::~APICallbackShim):
  12802. * API/JSContextRef.cpp:
  12803. (JSGlobalContextCreate):
  12804. (JSGlobalContextCreateInGroup):
  12805. (JSGlobalContextRelease):
  12806. (JSContextCreateBacktrace):
  12807. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  12808. * heap/CopiedSpace.cpp:
  12809. (JSC::CopiedSpace::tryAllocateSlowCase):
  12810. * heap/Heap.cpp:
  12811. (JSC::Heap::protect):
  12812. (JSC::Heap::unprotect):
  12813. (JSC::Heap::collect):
  12814. (JSC::Heap::setActivityCallback):
  12815. (JSC::Heap::activityCallback):
  12816. (JSC::Heap::sweeper):
  12817. * heap/Heap.h:
  12818. (Heap):
  12819. * heap/HeapTimer.cpp:
  12820. (JSC::HeapTimer::~HeapTimer):
  12821. (JSC::HeapTimer::invalidate):
  12822. (JSC::HeapTimer::timerDidFire):
  12823. (JSC):
  12824. * heap/HeapTimer.h:
  12825. (HeapTimer):
  12826. * heap/IncrementalSweeper.cpp:
  12827. (JSC::IncrementalSweeper::doWork):
  12828. (JSC::IncrementalSweeper::create):
  12829. * heap/IncrementalSweeper.h:
  12830. (IncrementalSweeper):
  12831. * heap/MarkedAllocator.cpp:
  12832. (JSC::MarkedAllocator::allocateSlowCase):
  12833. * heap/WeakBlock.cpp:
  12834. (JSC::WeakBlock::reap):
  12835. * jsc.cpp:
  12836. (functionGC):
  12837. (functionReleaseExecutableMemory):
  12838. (jscmain):
  12839. * runtime/Completion.cpp:
  12840. (JSC::checkSyntax):
  12841. (JSC::evaluate):
  12842. * runtime/GCActivityCallback.h:
  12843. (DefaultGCActivityCallback):
  12844. (JSC::DefaultGCActivityCallback::create):
  12845. * runtime/JSGlobalData.cpp:
  12846. (JSC::JSGlobalData::JSGlobalData):
  12847. (JSC::JSGlobalData::~JSGlobalData):
  12848. (JSC::JSGlobalData::sharedInstance):
  12849. (JSC::JSGlobalData::sharedInstanceInternal):
  12850. * runtime/JSGlobalData.h:
  12851. (JSGlobalData):
  12852. * runtime/JSGlobalObject.cpp:
  12853. (JSC::JSGlobalObject::~JSGlobalObject):
  12854. (JSC::JSGlobalObject::init):
  12855. * runtime/JSLock.cpp:
  12856. (JSC):
  12857. (JSC::createJSLockCount):
  12858. (JSC::JSLock::lockCount):
  12859. (JSC::setLockCount):
  12860. (JSC::JSLock::JSLock):
  12861. (JSC::JSLock::lock):
  12862. (JSC::JSLock::unlock):
  12863. (JSC::JSLock::currentThreadIsHoldingLock):
  12864. (JSC::JSLock::DropAllLocks::DropAllLocks):
  12865. (JSC::JSLock::DropAllLocks::~DropAllLocks):
  12866. * runtime/JSLock.h:
  12867. (JSC):
  12868. (JSLock):
  12869. (JSC::JSLock::JSLock):
  12870. (JSC::JSLock::~JSLock):
  12871. (DropAllLocks):
  12872. * runtime/WeakGCMap.h:
  12873. (JSC::WeakGCMap::set):
  12874. * testRegExp.cpp:
  12875. (realMain):
  12876. 2012-06-22 Alexandru Chiculita <achicu@adobe.com>
  12877. [CSS Shaders] Re-enable the CSS Shaders compile time flag on Safari Mac
  12878. https://bugs.webkit.org/show_bug.cgi?id=89781
  12879. Reviewed by Dean Jackson.
  12880. Added ENABLE_CSS_SHADERS flag as enabled by default on Safari for Mac.
  12881. * Configurations/FeatureDefines.xcconfig:
  12882. 2012-06-22 Filip Pizlo <fpizlo@apple.com>
  12883. DFG tier-up should happen in prologues, not epilogues
  12884. https://bugs.webkit.org/show_bug.cgi?id=89752
  12885. Reviewed by Geoffrey Garen.
  12886. This change has two outcomes:
  12887. 1) Slightly reduces the likelihood that a function will be optimized both
  12888. standalone and via inlining. Previously, if you had a call sequence like foo()
  12889. calls bar() exactly once, and nobody else calls bar(), then bar() would get
  12890. optimized first (because it returns first) and then foo() gets optimized. If foo()
  12891. can inline bar() then that means that bar() gets optimized twice. But now, if we
  12892. optimize in prologues, then foo() will be optimized first. If it inlines bar(),
  12893. that means that there will no longer be any calls to bar().
  12894. 2) It lets us kill some code in JITStubs. Epilogue tier-up was very different from
  12895. loop tier-up, since epilogue tier-up should not attempt OSR. But prologue tier-up
  12896. requires OSR (albeit really easy OSR since it's the top of the compilation unit),
  12897. so it becomes just like loop tier-up. As a result, we now have one optimization
  12898. hook (cti_optimize) instead of two (cti_optimize_from_loop and
  12899. cti_optimize_from_ret).
  12900. As a consequence of not having an optimization check in epilogues, the OSR exit
  12901. code must now trigger reoptimization itself instead of just signaling the epilogue
  12902. check to fire.
  12903. This also adds the ability to count the number of DFG compilations, which was
  12904. useful for debugging this patch and might be useful for other things in the future.
  12905. * bytecode/CodeBlock.cpp:
  12906. (JSC::CodeBlock::reoptimize):
  12907. (JSC):
  12908. * bytecode/CodeBlock.h:
  12909. (CodeBlock):
  12910. * dfg/DFGByteCodeParser.cpp:
  12911. (JSC::DFG::ByteCodeParser::parseCodeBlock):
  12912. * dfg/DFGDriver.cpp:
  12913. (DFG):
  12914. (JSC::DFG::getNumCompilations):
  12915. (JSC::DFG::compile):
  12916. * dfg/DFGDriver.h:
  12917. (DFG):
  12918. * dfg/DFGOSRExitCompiler.cpp:
  12919. (JSC::DFG::OSRExitCompiler::handleExitCounts):
  12920. * dfg/DFGOperations.cpp:
  12921. * dfg/DFGOperations.h:
  12922. * jit/JIT.cpp:
  12923. (JSC::JIT::emitOptimizationCheck):
  12924. * jit/JIT.h:
  12925. * jit/JITCall32_64.cpp:
  12926. (JSC::JIT::emit_op_ret):
  12927. (JSC::JIT::emit_op_ret_object_or_this):
  12928. * jit/JITOpcodes.cpp:
  12929. (JSC::JIT::emit_op_ret):
  12930. (JSC::JIT::emit_op_ret_object_or_this):
  12931. (JSC::JIT::emit_op_enter):
  12932. * jit/JITOpcodes32_64.cpp:
  12933. (JSC::JIT::emit_op_enter):
  12934. * jit/JITStubs.cpp:
  12935. (JSC::DEFINE_STUB_FUNCTION):
  12936. * jit/JITStubs.h:
  12937. 2012-06-20 Mark Hahnenberg <mhahnenberg@apple.com>
  12938. JSLock should be per-JSGlobalData
  12939. https://bugs.webkit.org/show_bug.cgi?id=89123
  12940. Reviewed by Gavin Barraclough.
  12941. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  12942. * API/APIShims.h:
  12943. (APIEntryShimWithoutLock):
  12944. (JSC::APIEntryShimWithoutLock::APIEntryShimWithoutLock): Added an extra parameter to the constructor to
  12945. determine whether we should ref the JSGlobalData or not. We want to ref all the time except for in the
  12946. HeapTimer class because timerDidFire could run after somebody has started to tear down that particular
  12947. JSGlobalData, so we wouldn't want to resurrect the ref count of that JSGlobalData from 0 back to 1 after
  12948. its destruction has begun.
  12949. (JSC::APIEntryShimWithoutLock::~APIEntryShimWithoutLock): Now derefs if it also refed.
  12950. (JSC::APIEntryShim::APIEntryShim):
  12951. (APIEntryShim):
  12952. (JSC::APIEntryShim::~APIEntryShim):
  12953. (JSC::APIEntryShim::init): Factored out common initialization code for the various APIEntryShim constructors.
  12954. Also moved the timeoutChecker stop and start here because we need to start after we've grabbed the API lock
  12955. and before we've released it, which can only done in APIEntryShim.
  12956. (JSC::APICallbackShim::~APICallbackShim): We no longer need to synchronize here.
  12957. * API/JSContextRef.cpp:
  12958. (JSGlobalContextCreate):
  12959. (JSGlobalContextCreateInGroup):
  12960. (JSGlobalContextRelease):
  12961. (JSContextCreateBacktrace):
  12962. * heap/CopiedSpace.cpp:
  12963. (JSC::CopiedSpace::tryAllocateSlowCase):
  12964. * heap/Heap.cpp:
  12965. (JSC::Heap::protect):
  12966. (JSC::Heap::unprotect):
  12967. (JSC::Heap::collect):
  12968. (JSC::Heap::setActivityCallback):
  12969. (JSC::Heap::activityCallback):
  12970. (JSC::Heap::sweeper):
  12971. * heap/Heap.h: Changed m_activityCallback and m_sweeper to be raw pointers rather than OwnPtrs because they
  12972. are now responsible for their own lifetime. Also changed the order of declaration of the GCActivityCallback
  12973. and the IncrementalSweeper to make sure they're the last things that get initialized during construction to
  12974. prevent any issues with uninitialized memory in the JSGlobalData/Heap they might care about.
  12975. (Heap):
  12976. * heap/HeapTimer.cpp: Refactored to allow for thread-safe operation and shutdown.
  12977. (JSC::HeapTimer::~HeapTimer):
  12978. (JSC::HeapTimer::invalidate):
  12979. (JSC):
  12980. (JSC::HeapTimer::didStartVMShutdown): Called at the beginning of ~JSGlobalData. If we're on the same thread
  12981. that the HeapTimer is running on, we kill the HeapTimer ourselves. If not, then we set some state in the
  12982. HeapTimer and schedule it to fire immediately so that it can notice and kill itself.
  12983. (JSC::HeapTimer::timerDidFire): We grab our mutex and check our JSGlobalData pointer. If it has been zero-ed
  12984. out, then we know the VM has started to shutdown and we should kill ourselves. Otherwise, grab the APIEntryShim,
  12985. but without ref-ing the JSGlobalData (we don't want to bring the JSGlobalData's ref-count from 0 to 1) in case
  12986. we were interrupted between releasing our mutex and trying to grab the APILock.
  12987. * heap/HeapTimer.h:
  12988. (HeapTimer):
  12989. * heap/IncrementalSweeper.cpp:
  12990. (JSC::IncrementalSweeper::doWork): We no longer need the API shim here since HeapTimer::timerDidFire handles
  12991. all of that for us.
  12992. (JSC::IncrementalSweeper::create):
  12993. * heap/IncrementalSweeper.h:
  12994. (IncrementalSweeper):
  12995. * heap/MarkedAllocator.cpp:
  12996. (JSC::MarkedAllocator::allocateSlowCase):
  12997. * heap/WeakBlock.cpp:
  12998. (JSC::WeakBlock::reap):
  12999. * jsc.cpp:
  13000. (functionGC):
  13001. (functionReleaseExecutableMemory):
  13002. (jscmain):
  13003. * runtime/Completion.cpp:
  13004. (JSC::checkSyntax):
  13005. (JSC::evaluate):
  13006. * runtime/GCActivityCallback.h:
  13007. (DefaultGCActivityCallback):
  13008. (JSC::DefaultGCActivityCallback::create):
  13009. * runtime/JSGlobalData.cpp:
  13010. (JSC::JSGlobalData::JSGlobalData):
  13011. (JSC::JSGlobalData::~JSGlobalData): Signals to the two HeapTimers (GCActivityCallback and IncrementalSweeper)
  13012. that the VM has started shutting down. It then waits until the HeapTimer is done with whatever activity
  13013. it needs to do before continuing with any further destruction. Also asserts that we do not currently hold the
  13014. APILock because this could potentially cause deadlock when we try to signal to the HeapTimers using their mutexes.
  13015. (JSC::JSGlobalData::sharedInstance): Protect the initialization for the shared instance with the GlobalJSLock.
  13016. (JSC::JSGlobalData::sharedInstanceInternal):
  13017. * runtime/JSGlobalData.h: Change to be ThreadSafeRefCounted so that we don't have to worry about refing and
  13018. de-refing JSGlobalDatas on separate threads since we don't do it that often anyways.
  13019. (JSGlobalData):
  13020. (JSC::JSGlobalData::apiLock):
  13021. * runtime/JSGlobalObject.cpp:
  13022. (JSC::JSGlobalObject::~JSGlobalObject):
  13023. (JSC::JSGlobalObject::init):
  13024. * runtime/JSLock.cpp:
  13025. (JSC):
  13026. (JSC::GlobalJSLock::GlobalJSLock): For accessing the shared instance.
  13027. (JSC::GlobalJSLock::~GlobalJSLock):
  13028. (JSC::JSLockHolder::JSLockHolder): MutexLocker for JSLock. Also refs the JSGlobalData to keep it alive so that
  13029. it can successfully unlock it later without it disappearing from underneath it.
  13030. (JSC::JSLockHolder::~JSLockHolder):
  13031. (JSC::JSLock::JSLock):
  13032. (JSC::JSLock::~JSLock):
  13033. (JSC::JSLock::lock): Uses the spin lock for guarding the lock count and owner thread fields. Uses the mutex for
  13034. actually waiting for long periods.
  13035. (JSC::JSLock::unlock):
  13036. (JSC::JSLock::currentThreadIsHoldingLock):
  13037. (JSC::JSLock::dropAllLocks):
  13038. (JSC::JSLock::dropAllLocksUnconditionally):
  13039. (JSC::JSLock::grabAllLocks):
  13040. (JSC::JSLock::DropAllLocks::DropAllLocks):
  13041. (JSC::JSLock::DropAllLocks::~DropAllLocks):
  13042. * runtime/JSLock.h:
  13043. (JSC):
  13044. (GlobalJSLock):
  13045. (JSLockHolder):
  13046. (JSLock):
  13047. (DropAllLocks):
  13048. * runtime/WeakGCMap.h:
  13049. (JSC::WeakGCMap::set):
  13050. * testRegExp.cpp:
  13051. (realMain):
  13052. 2012-06-22 Peter Beverloo <peter@chromium.org>
  13053. [Chromium] Disable c++0x compatibility warnings in JavaScriptCore.gyp when building for Android
  13054. https://bugs.webkit.org/show_bug.cgi?id=88853
  13055. Reviewed by Steve Block.
  13056. The Android exclusions were necessary to fix a gyp generation error, as
  13057. the gcc_version variable wasn't being defined for Android. Remove these
  13058. exceptions when Chromium is able to define the gcc_version variable.
  13059. * JavaScriptCore.gyp/JavaScriptCore.gyp:
  13060. 2012-06-21 Filip Pizlo <fpizlo@apple.com>
  13061. op_resolve_global should not prevent DFG inlining
  13062. https://bugs.webkit.org/show_bug.cgi?id=89726
  13063. Reviewed by Gavin Barraclough.
  13064. * bytecode/CodeBlock.cpp:
  13065. (JSC::CodeBlock::CodeBlock):
  13066. (JSC::CodeBlock::shrinkToFit):
  13067. * bytecode/GlobalResolveInfo.h:
  13068. (JSC::GlobalResolveInfo::GlobalResolveInfo):
  13069. (GlobalResolveInfo):
  13070. * dfg/DFGByteCodeParser.cpp:
  13071. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  13072. * dfg/DFGCapabilities.h:
  13073. (JSC::DFG::canInlineOpcode):
  13074. * dfg/DFGOperations.cpp:
  13075. * dfg/DFGOperations.h:
  13076. * dfg/DFGSpeculativeJIT.h:
  13077. (JSC::DFG::SpeculativeJIT::callOperation):
  13078. * dfg/DFGSpeculativeJIT32_64.cpp:
  13079. (JSC::DFG::SpeculativeJIT::compile):
  13080. * dfg/DFGSpeculativeJIT64.cpp:
  13081. (JSC::DFG::SpeculativeJIT::compile):
  13082. 2012-06-20 Filip Pizlo <fpizlo@apple.com>
  13083. DFG should inline 'new Array()'
  13084. https://bugs.webkit.org/show_bug.cgi?id=89632
  13085. Reviewed by Geoffrey Garen.
  13086. This adds support for treating InternalFunction like intrinsics. The code
  13087. to do so is actually quite clean, so I don't feel bad about perpetuating
  13088. the InternalFunction vs. JSFunction-with-NativeExecutable dichotomy.
  13089. Currently this newfound power is only used to inline 'new Array()'.
  13090. * dfg/DFGByteCodeParser.cpp:
  13091. (ByteCodeParser):
  13092. (JSC::DFG::ByteCodeParser::handleCall):
  13093. (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
  13094. (DFG):
  13095. * dfg/DFGGraph.h:
  13096. (JSC::DFG::Graph::isInternalFunctionConstant):
  13097. (JSC::DFG::Graph::valueOfInternalFunctionConstant):
  13098. 2012-06-21 Mark Hahnenberg <mhahnenberg@apple.com>
  13099. Adding copyrights to new files.
  13100. * heap/HeapTimer.cpp:
  13101. * heap/HeapTimer.h:
  13102. * heap/IncrementalSweeper.cpp:
  13103. * heap/IncrementalSweeper.h:
  13104. 2012-06-21 Arnaud Renevier <arno@renevier.net>
  13105. make sure headers are included only once per file
  13106. https://bugs.webkit.org/show_bug.cgi?id=88922
  13107. Reviewed by Alexey Proskuryakov.
  13108. * bytecode/CodeBlock.h:
  13109. * heap/MachineStackMarker.cpp:
  13110. * runtime/JSVariableObject.h:
  13111. 2012-06-21 Ryuan Choi <ryuan.choi@gmail.com>
  13112. [EFL][WK2] Make WebKit2/Efl headers and resources installable.
  13113. https://bugs.webkit.org/show_bug.cgi?id=88207
  13114. Reviewed by Chang Shu.
  13115. * shell/CMakeLists.txt: Use ${EXEC_INSTALL_DIR} instead of hardcoding "bin"
  13116. 2012-06-20 Geoffrey Garen <ggaren@apple.com>
  13117. Reduced (but did not eliminate) use of "berzerker GC"
  13118. https://bugs.webkit.org/show_bug.cgi?id=89237
  13119. Reviewed by Gavin Barraclough.
  13120. (PART 1)
  13121. This patch turned out to be crashy, so I'm landing the non-crashy bits
  13122. first.
  13123. This part is pre-requisite refactoring. I didn't actually turn off
  13124. "berzerker GC" or turn on incremental shrinking.
  13125. * heap/MarkedAllocator.cpp:
  13126. (JSC::MarkedAllocator::removeBlock): Make sure to clear the free list when
  13127. we throw away the block we're currently allocating out of. Otherwise, we'll
  13128. allocate out of a stale free list.
  13129. * heap/MarkedSpace.cpp:
  13130. (JSC::Free::Free):
  13131. (JSC::Free::operator()):
  13132. (JSC::Free::returnValue): Refactored this functor to use a shared helper
  13133. function, so we can share our implementation with the incremental sweeper.
  13134. Also changed to freeing individual blocks immediately instead of linking
  13135. them into a list for later freeing. This makes the programming interface
  13136. simpler, and it's slightly more efficient to boot.
  13137. (JSC::MarkedSpace::~MarkedSpace): Updated for rename.
  13138. (JSC::MarkedSpace::freeBlock):
  13139. (JSC::MarkedSpace::freeOrShrinkBlock): New helper functions to share behavior
  13140. with the incremental sweeper.
  13141. (JSC::MarkedSpace::shrink): Updated for new functor behavior.
  13142. * heap/MarkedSpace.h: Statically typed languages are awesome.
  13143. 2012-06-20 Filip Pizlo <fpizlo@apple.com>
  13144. DFG should optimize ResolveGlobal
  13145. https://bugs.webkit.org/show_bug.cgi?id=89617
  13146. Reviewed by Oliver Hunt.
  13147. This adds inlining of ResolveGlobal accesses that are known monomorphic. It also
  13148. adds the specific function optimization to ResolveGlobal, when it is inlined. And,
  13149. it makes internal functions act like specific functions, since that will be the
  13150. most common use-case of this optimization.
  13151. This is only a slighy speed-up (sub 1%), since we don't yet do the obvious thing
  13152. with this optimization, which is to completely inline common "globally resolved"
  13153. function and constructor calls, like "new Array()".
  13154. * CMakeLists.txt:
  13155. * GNUmakefile.list.am:
  13156. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  13157. * JavaScriptCore.xcodeproj/project.pbxproj:
  13158. * Target.pri:
  13159. * bytecode/CodeBlock.cpp:
  13160. (JSC::CodeBlock::globalResolveInfoForBytecodeOffset):
  13161. * bytecode/CodeBlock.h:
  13162. (CodeBlock):
  13163. (JSC::CodeBlock::numberOfGlobalResolveInfos):
  13164. * bytecode/GlobalResolveInfo.h:
  13165. (JSC::getGlobalResolveInfoBytecodeOffset):
  13166. (JSC):
  13167. * bytecode/ResolveGlobalStatus.cpp: Added.
  13168. (JSC):
  13169. (JSC::computeForStructure):
  13170. (JSC::computeForLLInt):
  13171. (JSC::ResolveGlobalStatus::computeFor):
  13172. * bytecode/ResolveGlobalStatus.h: Added.
  13173. (JSC):
  13174. (ResolveGlobalStatus):
  13175. (JSC::ResolveGlobalStatus::ResolveGlobalStatus):
  13176. (JSC::ResolveGlobalStatus::state):
  13177. (JSC::ResolveGlobalStatus::isSet):
  13178. (JSC::ResolveGlobalStatus::operator!):
  13179. (JSC::ResolveGlobalStatus::isSimple):
  13180. (JSC::ResolveGlobalStatus::takesSlowPath):
  13181. (JSC::ResolveGlobalStatus::structure):
  13182. (JSC::ResolveGlobalStatus::offset):
  13183. (JSC::ResolveGlobalStatus::specificValue):
  13184. * dfg/DFGByteCodeParser.cpp:
  13185. (ByteCodeParser):
  13186. (JSC::DFG::ByteCodeParser::handleGetByOffset):
  13187. (DFG):
  13188. (JSC::DFG::ByteCodeParser::handleGetById):
  13189. (JSC::DFG::ByteCodeParser::parseBlock):
  13190. * runtime/JSObject.cpp:
  13191. (JSC::getCallableObjectSlow):
  13192. (JSC):
  13193. (JSC::JSObject::put):
  13194. (JSC::JSObject::putDirectVirtual):
  13195. (JSC::JSObject::putDirectAccessor):
  13196. * runtime/JSObject.h:
  13197. (JSC):
  13198. (JSC::getCallableObject):
  13199. (JSC::JSObject::putOwnDataProperty):
  13200. (JSC::JSObject::putDirect):
  13201. (JSC::JSObject::putDirectWithoutTransition):
  13202. 2012-06-20 Filip Pizlo <fpizlo@apple.com>
  13203. Functions on global objects should be specializable
  13204. https://bugs.webkit.org/show_bug.cgi?id=89615
  13205. Reviewed by Oliver Hunt.
  13206. I tested to see if this brought back the bug in https://bugs.webkit.org/show_bug.cgi?id=33343,
  13207. and it didn't. Bug 33343 was the reason why we disabled global object function specialization
  13208. to begin with. So I'm guessing this is safe.
  13209. * runtime/JSGlobalObject.cpp:
  13210. (JSC::JSGlobalObject::init):
  13211. 2012-06-20 Filip Pizlo <fpizlo@apple.com>
  13212. build-webkit failure due to illegal 32-bit integer constants in code
  13213. generated by offlineasm
  13214. https://bugs.webkit.org/show_bug.cgi?id=89347
  13215. Reviewed by Geoffrey Garen.
  13216. The offending constants are the magic numbers used by offlineasm to find
  13217. offsets in the generated machine code. Added code to turn them into what
  13218. the C++ compiler will believe to be valid 32-bit values.
  13219. * offlineasm/offsets.rb:
  13220. 2012-06-19 Geoffrey Garen <ggaren@apple.com>
  13221. Made the incremental sweeper more aggressive
  13222. https://bugs.webkit.org/show_bug.cgi?id=89527
  13223. Reviewed by Oliver Hunt.
  13224. This is a pre-requisite to getting rid of "berzerker GC" because we need
  13225. the sweeper to reclaim memory in a timely fashion, or we'll see a memory
  13226. footprint regression.
  13227. * heap/IncrementalSweeper.h:
  13228. * heap/IncrementalSweeper.cpp:
  13229. (JSC::IncrementalSweeper::scheduleTimer): Since the time slice is predictable,
  13230. no need to use a data member to record it.
  13231. (JSC::IncrementalSweeper::doSweep): Sweep as many blocks as we can in a
  13232. small time slice. This is better than sweeping only one block per timer
  13233. fire because that strategy has a heavy timer overhead, and artificially
  13234. delays memory reclamation.
  13235. 2012-06-20 Filip Pizlo <fpizlo@apple.com>
  13236. DFG should be able to print disassembly interleaved with the IR
  13237. https://bugs.webkit.org/show_bug.cgi?id=89551
  13238. Reviewed by Geoffrey Garen.
  13239. This change also removes running Dominators unconditionally on every DFG
  13240. compile. Dominators are designed to be computed on-demand, and currently
  13241. the only demand is graph dumps.
  13242. * CMakeLists.txt:
  13243. * GNUmakefile.list.am:
  13244. * JavaScriptCore.xcodeproj/project.pbxproj:
  13245. * Target.pri:
  13246. * assembler/ARMv7Assembler.h:
  13247. (JSC::ARMv7Assembler::labelIgnoringWatchpoints):
  13248. (ARMv7Assembler):
  13249. * assembler/AbstractMacroAssembler.h:
  13250. (AbstractMacroAssembler):
  13251. (JSC::AbstractMacroAssembler::labelIgnoringWatchpoints):
  13252. * assembler/X86Assembler.h:
  13253. (X86Assembler):
  13254. (JSC::X86Assembler::labelIgnoringWatchpoints):
  13255. * dfg/DFGCommon.h:
  13256. (JSC::DFG::shouldShowDisassembly):
  13257. (DFG):
  13258. * dfg/DFGDisassembler.cpp: Added.
  13259. (DFG):
  13260. (JSC::DFG::Disassembler::Disassembler):
  13261. (JSC::DFG::Disassembler::dump):
  13262. (JSC::DFG::Disassembler::dumpDisassembly):
  13263. * dfg/DFGDisassembler.h: Added.
  13264. (DFG):
  13265. (Disassembler):
  13266. (JSC::DFG::Disassembler::setStartOfCode):
  13267. (JSC::DFG::Disassembler::setForBlock):
  13268. (JSC::DFG::Disassembler::setForNode):
  13269. (JSC::DFG::Disassembler::setEndOfMainPath):
  13270. (JSC::DFG::Disassembler::setEndOfCode):
  13271. * dfg/DFGDriver.cpp:
  13272. (JSC::DFG::compile):
  13273. * dfg/DFGGraph.cpp:
  13274. (JSC::DFG::Graph::dumpCodeOrigin):
  13275. (JSC::DFG::Graph::amountOfNodeWhiteSpace):
  13276. (DFG):
  13277. (JSC::DFG::Graph::printNodeWhiteSpace):
  13278. (JSC::DFG::Graph::dump):
  13279. (JSC::DFG::Graph::dumpBlockHeader):
  13280. * dfg/DFGGraph.h:
  13281. * dfg/DFGJITCompiler.cpp:
  13282. (JSC::DFG::JITCompiler::JITCompiler):
  13283. (DFG):
  13284. (JSC::DFG::JITCompiler::compile):
  13285. (JSC::DFG::JITCompiler::compileFunction):
  13286. * dfg/DFGJITCompiler.h:
  13287. (JITCompiler):
  13288. (JSC::DFG::JITCompiler::setStartOfCode):
  13289. (JSC::DFG::JITCompiler::setForBlock):
  13290. (JSC::DFG::JITCompiler::setForNode):
  13291. (JSC::DFG::JITCompiler::setEndOfMainPath):
  13292. (JSC::DFG::JITCompiler::setEndOfCode):
  13293. * dfg/DFGNode.h:
  13294. (Node):
  13295. (JSC::DFG::Node::willHaveCodeGen):
  13296. * dfg/DFGNodeFlags.cpp:
  13297. (JSC::DFG::nodeFlagsAsString):
  13298. * dfg/DFGSpeculativeJIT.cpp:
  13299. (JSC::DFG::SpeculativeJIT::compile):
  13300. * dfg/DFGSpeculativeJIT.h:
  13301. (SpeculativeJIT):
  13302. * runtime/Options.cpp:
  13303. (Options):
  13304. (JSC::Options::initializeOptions):
  13305. * runtime/Options.h:
  13306. (Options):
  13307. 2012-06-19 Filip Pizlo <fpizlo@apple.com>
  13308. JSC should be able to show disassembly for all generated JIT code
  13309. https://bugs.webkit.org/show_bug.cgi?id=89536
  13310. Reviewed by Gavin Barraclough.
  13311. Now instead of doing linkBuffer.finalizeCode(), you do
  13312. FINALIZE_CODE(linkBuffer, (... explanation ...)). FINALIZE_CODE() then
  13313. prints your explanation and the disassembled code, if
  13314. Options::showDisassembly is set to true.
  13315. * CMakeLists.txt:
  13316. * GNUmakefile.list.am:
  13317. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  13318. * JavaScriptCore.xcodeproj/project.pbxproj:
  13319. * Target.pri:
  13320. * assembler/LinkBuffer.cpp: Added.
  13321. (JSC):
  13322. (JSC::LinkBuffer::finalizeCodeWithoutDisassembly):
  13323. (JSC::LinkBuffer::finalizeCodeWithDisassembly):
  13324. (JSC::LinkBuffer::linkCode):
  13325. (JSC::LinkBuffer::performFinalization):
  13326. (JSC::LinkBuffer::dumpLinkStatistics):
  13327. (JSC::LinkBuffer::dumpCode):
  13328. * assembler/LinkBuffer.h:
  13329. (LinkBuffer):
  13330. (JSC):
  13331. * assembler/MacroAssemblerCodeRef.h:
  13332. (JSC::MacroAssemblerCodeRef::tryToDisassemble):
  13333. (MacroAssemblerCodeRef):
  13334. * dfg/DFGJITCompiler.cpp:
  13335. (JSC::DFG::JITCompiler::compile):
  13336. (JSC::DFG::JITCompiler::compileFunction):
  13337. * dfg/DFGOSRExitCompiler.cpp:
  13338. * dfg/DFGRepatch.cpp:
  13339. (JSC::DFG::generateProtoChainAccessStub):
  13340. (JSC::DFG::tryCacheGetByID):
  13341. (JSC::DFG::tryBuildGetByIDList):
  13342. (JSC::DFG::emitPutReplaceStub):
  13343. (JSC::DFG::emitPutTransitionStub):
  13344. * dfg/DFGThunks.cpp:
  13345. (JSC::DFG::osrExitGenerationThunkGenerator):
  13346. * disassembler/Disassembler.h:
  13347. (JSC):
  13348. (JSC::tryToDisassemble):
  13349. * disassembler/UDis86Disassembler.cpp:
  13350. (JSC::tryToDisassemble):
  13351. * jit/JIT.cpp:
  13352. (JSC::JIT::privateCompile):
  13353. * jit/JITCode.h:
  13354. (JSC::JITCode::tryToDisassemble):
  13355. * jit/JITOpcodes.cpp:
  13356. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13357. * jit/JITOpcodes32_64.cpp:
  13358. (JSC::JIT::privateCompileCTIMachineTrampolines):
  13359. (JSC::JIT::privateCompileCTINativeCall):
  13360. * jit/JITPropertyAccess.cpp:
  13361. (JSC::JIT::stringGetByValStubGenerator):
  13362. (JSC::JIT::privateCompilePutByIdTransition):
  13363. (JSC::JIT::privateCompilePatchGetArrayLength):
  13364. (JSC::JIT::privateCompileGetByIdProto):
  13365. (JSC::JIT::privateCompileGetByIdSelfList):
  13366. (JSC::JIT::privateCompileGetByIdProtoList):
  13367. (JSC::JIT::privateCompileGetByIdChainList):
  13368. (JSC::JIT::privateCompileGetByIdChain):
  13369. * jit/JITPropertyAccess32_64.cpp:
  13370. (JSC::JIT::stringGetByValStubGenerator):
  13371. (JSC::JIT::privateCompilePutByIdTransition):
  13372. (JSC::JIT::privateCompilePatchGetArrayLength):
  13373. (JSC::JIT::privateCompileGetByIdProto):
  13374. (JSC::JIT::privateCompileGetByIdSelfList):
  13375. (JSC::JIT::privateCompileGetByIdProtoList):
  13376. (JSC::JIT::privateCompileGetByIdChainList):
  13377. (JSC::JIT::privateCompileGetByIdChain):
  13378. * jit/SpecializedThunkJIT.h:
  13379. (JSC::SpecializedThunkJIT::finalize):
  13380. * jit/ThunkGenerators.cpp:
  13381. (JSC::charCodeAtThunkGenerator):
  13382. (JSC::charAtThunkGenerator):
  13383. (JSC::fromCharCodeThunkGenerator):
  13384. (JSC::sqrtThunkGenerator):
  13385. (JSC::floorThunkGenerator):
  13386. (JSC::ceilThunkGenerator):
  13387. (JSC::roundThunkGenerator):
  13388. (JSC::expThunkGenerator):
  13389. (JSC::logThunkGenerator):
  13390. (JSC::absThunkGenerator):
  13391. (JSC::powThunkGenerator):
  13392. * llint/LLIntThunks.cpp:
  13393. (JSC::LLInt::generateThunkWithJumpTo):
  13394. (JSC::LLInt::functionForCallEntryThunkGenerator):
  13395. (JSC::LLInt::functionForConstructEntryThunkGenerator):
  13396. (JSC::LLInt::functionForCallArityCheckThunkGenerator):
  13397. (JSC::LLInt::functionForConstructArityCheckThunkGenerator):
  13398. (JSC::LLInt::evalEntryThunkGenerator):
  13399. (JSC::LLInt::programEntryThunkGenerator):
  13400. * runtime/Options.cpp:
  13401. (Options):
  13402. (JSC::Options::initializeOptions):
  13403. * runtime/Options.h:
  13404. (Options):
  13405. * yarr/YarrJIT.cpp:
  13406. (JSC::Yarr::YarrGenerator::compile):
  13407. 2012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
  13408. [Qt][Mac] REGRESSION(r120742): It broke the build
  13409. https://bugs.webkit.org/show_bug.cgi?id=89516
  13410. Reviewed by Geoffrey Garen.
  13411. Removing GCActivityCallbackCF.cpp because it doesn't mesh well with cross-platform
  13412. code on Darwin (e.g. Qt). We now use plain ol' vanilla ifdefs to handle platforms
  13413. without CF support. These if-defs will probably disappear in the future when we
  13414. use cross-platform timers in HeapTimer.
  13415. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  13416. * JavaScriptCore.xcodeproj/project.pbxproj:
  13417. * runtime/GCActivityCallback.cpp:
  13418. (JSC):
  13419. (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
  13420. (JSC::DefaultGCActivityCallback::doWork):
  13421. (JSC::DefaultGCActivityCallback::scheduleTimer):
  13422. (JSC::DefaultGCActivityCallback::cancelTimer):
  13423. (JSC::DefaultGCActivityCallback::didAllocate):
  13424. (JSC::DefaultGCActivityCallback::willCollect):
  13425. (JSC::DefaultGCActivityCallback::cancel):
  13426. * runtime/GCActivityCallbackCF.cpp: Removed.
  13427. 2012-06-19 Filip Pizlo <fpizlo@apple.com>
  13428. DFG CFA forgets to notify subsequent phases of found constants if it proves LogicalNot to be a constant
  13429. https://bugs.webkit.org/show_bug.cgi?id=89511
  13430. <rdar://problem/11700089>
  13431. Reviewed by Geoffrey Garen.
  13432. * dfg/DFGAbstractState.cpp:
  13433. (JSC::DFG::AbstractState::execute):
  13434. 2012-06-19 Mark Lam <mark.lam@apple.com>
  13435. CodeBlock::needsCallReturnIndices() is no longer needed.
  13436. https://bugs.webkit.org/show_bug.cgi?id=89490
  13437. Reviewed by Geoffrey Garen.
  13438. * bytecode/CodeBlock.h:
  13439. (JSC::CodeBlock::needsCallReturnIndices): removed.
  13440. * dfg/DFGJITCompiler.cpp:
  13441. (JSC::DFG::JITCompiler::link):
  13442. * jit/JIT.cpp:
  13443. (JSC::JIT::privateCompile):
  13444. 2012-06-19 Filip Pizlo <fpizlo@apple.com>
  13445. Unreviewed, try to fix Windows build.
  13446. * JavaScriptCore.vcproj/JavaScriptCore/copy-files.cmd:
  13447. 2012-06-17 Filip Pizlo <fpizlo@apple.com>
  13448. It should be possible to look at disassembly
  13449. https://bugs.webkit.org/show_bug.cgi?id=89319
  13450. Reviewed by Sam Weinig.
  13451. This imports the udis86 disassembler library. The library is placed
  13452. behind an abstraction in disassembler/Disassembler.h, so that we can
  13453. in the future use other disassemblers (for other platforms) whenever
  13454. appropriate. As a first step, the disassembler is being invoked for
  13455. DFG verbose dumps.
  13456. If we ever want to merge a new version of udis86 in the future, I've
  13457. made notes about changes I made to the library in
  13458. disassembler/udis86/differences.txt.
  13459. * CMakeLists.txt:
  13460. * DerivedSources.make:
  13461. * GNUmakefile.list.am:
  13462. * JavaScriptCore.pri:
  13463. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  13464. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
  13465. * JavaScriptCore.xcodeproj/project.pbxproj:
  13466. * dfg/DFGJITCompiler.cpp:
  13467. (JSC::DFG::JITCompiler::compile):
  13468. (JSC::DFG::JITCompiler::compileFunction):
  13469. * disassembler: Added.
  13470. * disassembler/Disassembler.h: Added.
  13471. (JSC):
  13472. (JSC::tryToDisassemble):
  13473. * disassembler/UDis86Disassembler.cpp: Added.
  13474. (JSC):
  13475. (JSC::tryToDisassemble):
  13476. * disassembler/udis86: Added.
  13477. * disassembler/udis86/differences.txt: Added.
  13478. * disassembler/udis86/itab.py: Added.
  13479. (UdItabGenerator):
  13480. (UdItabGenerator.__init__):
  13481. (UdItabGenerator.toGroupId):
  13482. (UdItabGenerator.genLookupTable):
  13483. (UdItabGenerator.genLookupTableList):
  13484. (UdItabGenerator.genInsnTable):
  13485. (genItabH):
  13486. (genItabH.UD_ITAB_H):
  13487. (genItabC):
  13488. (genItab):
  13489. (main):
  13490. * disassembler/udis86/optable.xml: Added.
  13491. * disassembler/udis86/ud_opcode.py: Added.
  13492. (UdOpcodeTables):
  13493. (UdOpcodeTables.sizeOfTable):
  13494. (UdOpcodeTables.nameOfTable):
  13495. (UdOpcodeTables.updateTable):
  13496. (UdOpcodeTables.Insn):
  13497. (UdOpcodeTables.Insn.__init__):
  13498. (UdOpcodeTables.Insn.__init__.opcode):
  13499. (UdOpcodeTables.parse):
  13500. (UdOpcodeTables.addInsnDef):
  13501. (UdOpcodeTables.print_table):
  13502. (UdOpcodeTables.print_tree):
  13503. * disassembler/udis86/ud_optable.py: Added.
  13504. (UdOptableXmlParser):
  13505. (UdOptableXmlParser.parseDef):
  13506. (UdOptableXmlParser.parse):
  13507. (printFn):
  13508. (parse):
  13509. (main):
  13510. * disassembler/udis86/udis86.c: Added.
  13511. (ud_init):
  13512. (ud_disassemble):
  13513. (ud_set_mode):
  13514. (ud_set_vendor):
  13515. (ud_set_pc):
  13516. (ud):
  13517. (ud_insn_asm):
  13518. (ud_insn_off):
  13519. (ud_insn_hex):
  13520. (ud_insn_ptr):
  13521. (ud_insn_len):
  13522. * disassembler/udis86/udis86.h: Added.
  13523. * disassembler/udis86/udis86_decode.c: Added.
  13524. (eff_adr_mode):
  13525. (ud_lookup_mnemonic):
  13526. (decode_prefixes):
  13527. (modrm):
  13528. (resolve_operand_size):
  13529. (resolve_mnemonic):
  13530. (decode_a):
  13531. (decode_gpr):
  13532. (resolve_gpr64):
  13533. (resolve_gpr32):
  13534. (resolve_reg):
  13535. (decode_imm):
  13536. (decode_modrm_reg):
  13537. (decode_modrm_rm):
  13538. (decode_o):
  13539. (decode_operand):
  13540. (decode_operands):
  13541. (clear_insn):
  13542. (resolve_mode):
  13543. (gen_hex):
  13544. (decode_insn):
  13545. (decode_3dnow):
  13546. (decode_ssepfx):
  13547. (decode_ext):
  13548. (decode_opcode):
  13549. (ud_decode):
  13550. * disassembler/udis86/udis86_decode.h: Added.
  13551. (ud_itab_entry_operand):
  13552. (ud_itab_entry):
  13553. (ud_lookup_table_list_entry):
  13554. (sse_pfx_idx):
  13555. (mode_idx):
  13556. (modrm_mod_idx):
  13557. (vendor_idx):
  13558. (is_group_ptr):
  13559. (group_idx):
  13560. * disassembler/udis86/udis86_extern.h: Added.
  13561. * disassembler/udis86/udis86_input.c: Added.
  13562. (inp_buff_hook):
  13563. (inp_file_hook):
  13564. (ud):
  13565. (ud_set_user_opaque_data):
  13566. (ud_get_user_opaque_data):
  13567. (ud_set_input_buffer):
  13568. (ud_set_input_file):
  13569. (ud_input_skip):
  13570. (ud_input_end):
  13571. (ud_inp_next):
  13572. (ud_inp_back):
  13573. (ud_inp_peek):
  13574. (ud_inp_move):
  13575. (ud_inp_uint8):
  13576. (ud_inp_uint16):
  13577. (ud_inp_uint32):
  13578. (ud_inp_uint64):
  13579. * disassembler/udis86/udis86_input.h: Added.
  13580. * disassembler/udis86/udis86_itab_holder.c: Added.
  13581. * disassembler/udis86/udis86_syn-att.c: Added.
  13582. (opr_cast):
  13583. (gen_operand):
  13584. (ud_translate_att):
  13585. * disassembler/udis86/udis86_syn-intel.c: Added.
  13586. (opr_cast):
  13587. (gen_operand):
  13588. (ud_translate_intel):
  13589. * disassembler/udis86/udis86_syn.c: Added.
  13590. * disassembler/udis86/udis86_syn.h: Added.
  13591. (mkasm):
  13592. * disassembler/udis86/udis86_types.h: Added.
  13593. (ud_operand):
  13594. (ud):
  13595. * jit/JITCode.h:
  13596. (JITCode):
  13597. (JSC::JITCode::tryToDisassemble):
  13598. 2012-06-19 Mark Hahnenberg <mhahnenberg@apple.com>
  13599. GCActivityCallback and IncrementalSweeper should share code
  13600. https://bugs.webkit.org/show_bug.cgi?id=89400
  13601. Reviewed by Geoffrey Garen.
  13602. A lot of functionality is duplicated between GCActivityCallback and IncrementalSweeper.
  13603. We should extract the common functionality out into a separate class that both of them
  13604. can inherit from. This refactoring will be an even greater boon when we add the ability
  13605. to shut these two agents down in a thread-safe fashion
  13606. * CMakeLists.txt:
  13607. * GNUmakefile.list.am:
  13608. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  13609. * JavaScriptCore.xcodeproj/project.pbxproj:
  13610. * Target.pri:
  13611. * heap/Heap.cpp:
  13612. (JSC::Heap::Heap): Move initialization down so that the JSGlobalData has a valid Heap when
  13613. we're initializing the GCActivityCallback and the IncrementalSweeper.
  13614. * heap/Heap.h:
  13615. (Heap):
  13616. * heap/HeapTimer.cpp: Added.
  13617. (JSC):
  13618. (JSC::HeapTimer::HeapTimer): Initialize the various base class data that
  13619. DefaultGCActivityCallback::commonConstructor() used to do.
  13620. (JSC::HeapTimer::~HeapTimer): Call to invalidate().
  13621. (JSC::HeapTimer::synchronize): Same functionality as the old DefaultGCActivityCallback::synchronize().
  13622. Virtual so that non-CF subclasses can override.
  13623. (JSC::HeapTimer::invalidate): Tears down the runloop timer to prevent any future firing.
  13624. (JSC::HeapTimer::timerDidFire): Callback to pass to the timer function. Casts and calls the virtual doWork().
  13625. * heap/HeapTimer.h: Added. This is the class that serves as the common base class for
  13626. both GCActivityCallback and IncrementalSweeper. It handles setting up and tearing down run loops and synchronizing
  13627. across threads for its subclasses.
  13628. (JSC):
  13629. (HeapTimer):
  13630. * heap/IncrementalSweeper.cpp: Changes to accomodate the extraction of common functionality
  13631. between IncrementalSweeper and GCActivityCallback into a common ancestor.
  13632. (JSC):
  13633. (JSC::IncrementalSweeper::doWork):
  13634. (JSC::IncrementalSweeper::IncrementalSweeper):
  13635. (JSC::IncrementalSweeper::cancelTimer):
  13636. (JSC::IncrementalSweeper::create):
  13637. * heap/IncrementalSweeper.h:
  13638. (IncrementalSweeper):
  13639. * runtime/GCActivityCallback.cpp:
  13640. (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
  13641. (JSC::DefaultGCActivityCallback::doWork):
  13642. * runtime/GCActivityCallback.h:
  13643. (GCActivityCallback):
  13644. (JSC::GCActivityCallback::willCollect):
  13645. (JSC::GCActivityCallback::GCActivityCallback):
  13646. (JSC):
  13647. (DefaultGCActivityCallback): Remove the platform data struct. The platform data should be kept in
  13648. the class itself so as to be accessible by doWork(). Most of the platform data for CF is kept in
  13649. HeapTimer anyways, so we only need the m_delay field now.
  13650. * runtime/GCActivityCallbackBlackBerry.cpp:
  13651. (JSC):
  13652. (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
  13653. (JSC::DefaultGCActivityCallback::doWork):
  13654. (JSC::DefaultGCActivityCallback::didAllocate):
  13655. * runtime/GCActivityCallbackCF.cpp:
  13656. (JSC):
  13657. (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
  13658. (JSC::DefaultGCActivityCallback::doWork):
  13659. (JSC::DefaultGCActivityCallback::scheduleTimer):
  13660. (JSC::DefaultGCActivityCallback::cancelTimer):
  13661. (JSC::DefaultGCActivityCallback::didAllocate):
  13662. (JSC::DefaultGCActivityCallback::willCollect):
  13663. (JSC::DefaultGCActivityCallback::cancel):
  13664. 2012-06-19 Mike West <mkwst@chromium.org>
  13665. Introduce ENABLE_CSP_NEXT configuration flag.
  13666. https://bugs.webkit.org/show_bug.cgi?id=89300
  13667. Reviewed by Adam Barth.
  13668. The 1.0 draft of the Content Security Policy spec is just about to
  13669. move to Last Call. We'll hide work on the upcoming 1.1 spec behind
  13670. this ENABLE flag, disabled by default.
  13671. Spec: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html
  13672. * Configurations/FeatureDefines.xcconfig:
  13673. 2012-06-18 Mark Lam <mark.lam@apple.com>
  13674. Changed JSC to always record line number information so that error.stack
  13675. and window.onerror() can report proper line numbers.
  13676. https://bugs.webkit.org/show_bug.cgi?id=89410
  13677. Reviewed by Geoffrey Garen.
  13678. * bytecode/CodeBlock.cpp:
  13679. (JSC::CodeBlock::CodeBlock):
  13680. (JSC::CodeBlock::lineNumberForBytecodeOffset):
  13681. (JSC::CodeBlock::shrinkToFit): m_lineInfo is now available unconditionally.
  13682. * bytecode/CodeBlock.h:
  13683. (JSC::CodeBlock::addLineInfo):
  13684. (JSC::CodeBlock::hasLineInfo): Unused. Now removed.
  13685. (JSC::CodeBlock::needsCallReturnIndices):
  13686. (CodeBlock):
  13687. (RareData): Hoisted m_lineInfo out of m_rareData. m_lineInfo is now
  13688. filled in unconditionally.
  13689. * bytecompiler/BytecodeGenerator.h:
  13690. (JSC::BytecodeGenerator::addLineInfo):
  13691. 2012-06-18 Andy Estes <aestes@apple.com>
  13692. Fix r120663, which didn't land the change that was reviewed.
  13693. 2012-06-18 Andy Estes <aestes@apple.com>
  13694. [JSC] In JSGlobalData.cpp, enableAssembler() sometimes leaks two CF objects
  13695. https://bugs.webkit.org/show_bug.cgi?id=89415
  13696. Reviewed by Sam Weinig.
  13697. In the case where canUseJIT was a non-NULL CFBooleanRef,
  13698. enableAssembler() would leak both canUseJITKey and canUseJIT by
  13699. returning before calling CFRelease. Fix this by using RetainPtr.
  13700. * runtime/JSGlobalData.cpp:
  13701. (JSC::enableAssembler):
  13702. 2012-06-17 Geoffrey Garen <ggaren@apple.com>
  13703. GC copy phase spends needless cycles zero-filling blocks
  13704. https://bugs.webkit.org/show_bug.cgi?id=89128
  13705. Reviewed by Gavin Barraclough.
  13706. We only need to zero-fill when we're allocating memory that might not
  13707. get fully initialized before GC.
  13708. * heap/CopiedBlock.h:
  13709. (JSC::CopiedBlock::createNoZeroFill):
  13710. (JSC::CopiedBlock::create): Added a way to create without zero-filling.
  13711. This is our optimization.
  13712. (JSC::CopiedBlock::zeroFillToEnd):
  13713. (JSC::CopiedBlock::CopiedBlock): Split zero-filling out from creation,
  13714. so we can sometimes create without zero-filling.
  13715. * heap/CopiedSpace.cpp:
  13716. (JSC::CopiedSpace::init):
  13717. (JSC::CopiedSpace::tryAllocateSlowCase):
  13718. (JSC::CopiedSpace::doneCopying): Renamed addNewBlock to allocateBlock()
  13719. to clarify that the new block is always newly-allocated.
  13720. (JSC::CopiedSpace::doneFillingBlock): Make sure to zero-fill to the end
  13721. of a block that might be used in the future for allocation. (Most of the
  13722. time, this is a no-op, since we've already filled the block completely.)
  13723. (JSC::CopiedSpace::getFreshBlock): Removed this function because the
  13724. abstraction of "allocation must succeed" is no longer useful.
  13725. * heap/CopiedSpace.h: Updated declarations to match.
  13726. * heap/CopiedSpaceInlineMethods.h:
  13727. (JSC::CopiedSpace::allocateBlockForCopyingPhase): New function, which
  13728. knows that it can skip zero-filling.
  13729. Added tighter scoping to our lock, to improve parallelism.
  13730. (JSC::CopiedSpace::allocateBlock): Folded getFreshBlock functionality
  13731. into this function, for simplicity.
  13732. * heap/MarkStack.cpp:
  13733. (JSC::SlotVisitor::startCopying):
  13734. (JSC::SlotVisitor::allocateNewSpace): Use our new zero-fill-free helper
  13735. function for great good.
  13736. 2012-06-17 Filip Pizlo <fpizlo@apple.com>
  13737. DFG should attempt to use structure watchpoints for all inlined get_by_id's and put_by_id's
  13738. https://bugs.webkit.org/show_bug.cgi?id=89316
  13739. Reviewed by Oliver Hunt.
  13740. * dfg/DFGByteCodeParser.cpp:
  13741. (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
  13742. (ByteCodeParser):
  13743. (JSC::DFG::ByteCodeParser::handleGetById):
  13744. (JSC::DFG::ByteCodeParser::parseBlock):
  13745. 2012-06-15 Yong Li <yoli@rim.com>
  13746. [BlackBerry] Put platform-specific GC policy in GCActivityCallback
  13747. https://bugs.webkit.org/show_bug.cgi?id=89236
  13748. Reviewed by Rob Buis.
  13749. Add GCActivityCallbackBlackBerry.cpp and implement platform-specific
  13750. low memory GC policy there.
  13751. * PlatformBlackBerry.cmake:
  13752. * heap/Heap.h:
  13753. (JSC::Heap::isSafeToCollect): Added.
  13754. * runtime/GCActivityCallbackBlackBerry.cpp: Added.
  13755. (JSC):
  13756. (JSC::DefaultGCActivityCallbackPlatformData::DefaultGCActivityCallbackPlatformData):
  13757. (DefaultGCActivityCallbackPlatformData):
  13758. (JSC::DefaultGCActivityCallback::DefaultGCActivityCallback):
  13759. (JSC::DefaultGCActivityCallback::~DefaultGCActivityCallback):
  13760. (JSC::DefaultGCActivityCallback::didAllocate):
  13761. (JSC::DefaultGCActivityCallback::willCollect):
  13762. (JSC::DefaultGCActivityCallback::synchronize):
  13763. (JSC::DefaultGCActivityCallback::cancel):
  13764. 2012-06-15 Filip Pizlo <fpizlo@apple.com>
  13765. DFG should be able to set watchpoints on structure transitions in the
  13766. method check prototype chain
  13767. https://bugs.webkit.org/show_bug.cgi?id=89058
  13768. Adding the same assertion to 32-bit that I added to 64-bit. This change
  13769. does not affect correctness but it's a good thing for assertion coverage.
  13770. * dfg/DFGSpeculativeJIT32_64.cpp:
  13771. (JSC::DFG::SpeculativeJIT::compile):
  13772. 2012-06-13 Filip Pizlo <fpizlo@apple.com>
  13773. DFG should be able to set watchpoints on structure transitions in the
  13774. method check prototype chain
  13775. https://bugs.webkit.org/show_bug.cgi?id=89058
  13776. Reviewed by Gavin Barraclough.
  13777. This adds the ability to set watchpoints on Structures, and then does
  13778. the most modest thing we can do with this ability: the DFG now sets
  13779. watchpoints on structure transitions in the prototype chain of method
  13780. checks.
  13781. This appears to be a >1% speed-up on V8.
  13782. * bytecode/PutByIdStatus.cpp:
  13783. (JSC::PutByIdStatus::computeFromLLInt):
  13784. (JSC::PutByIdStatus::computeFor):
  13785. * bytecode/StructureSet.h:
  13786. (JSC::StructureSet::containsOnly):
  13787. (StructureSet):
  13788. * bytecode/Watchpoint.cpp:
  13789. (JSC::WatchpointSet::WatchpointSet):
  13790. (JSC::InlineWatchpointSet::add):
  13791. (JSC):
  13792. (JSC::InlineWatchpointSet::inflateSlow):
  13793. (JSC::InlineWatchpointSet::freeFat):
  13794. * bytecode/Watchpoint.h:
  13795. (WatchpointSet):
  13796. (JSC):
  13797. (InlineWatchpointSet):
  13798. (JSC::InlineWatchpointSet::InlineWatchpointSet):
  13799. (JSC::InlineWatchpointSet::~InlineWatchpointSet):
  13800. (JSC::InlineWatchpointSet::hasBeenInvalidated):
  13801. (JSC::InlineWatchpointSet::isStillValid):
  13802. (JSC::InlineWatchpointSet::startWatching):
  13803. (JSC::InlineWatchpointSet::notifyWrite):
  13804. (JSC::InlineWatchpointSet::isFat):
  13805. (JSC::InlineWatchpointSet::fat):
  13806. (JSC::InlineWatchpointSet::inflate):
  13807. * dfg/DFGAbstractState.cpp:
  13808. (JSC::DFG::AbstractState::execute):
  13809. * dfg/DFGByteCodeParser.cpp:
  13810. (JSC::DFG::ByteCodeParser::addStructureTransitionCheck):
  13811. (ByteCodeParser):
  13812. (JSC::DFG::ByteCodeParser::parseBlock):
  13813. * dfg/DFGCSEPhase.cpp:
  13814. (JSC::DFG::CSEPhase::structureTransitionWatchpointElimination):
  13815. (CSEPhase):
  13816. (JSC::DFG::CSEPhase::performNodeCSE):
  13817. * dfg/DFGCommon.h:
  13818. * dfg/DFGGraph.cpp:
  13819. (JSC::DFG::Graph::dump):
  13820. * dfg/DFGGraph.h:
  13821. (JSC::DFG::Graph::isCellConstant):
  13822. * dfg/DFGJITCompiler.h:
  13823. (JSC::DFG::JITCompiler::addWeakReferences):
  13824. (JITCompiler):
  13825. * dfg/DFGNode.h:
  13826. (JSC::DFG::Node::hasStructure):
  13827. (Node):
  13828. (JSC::DFG::Node::structure):
  13829. * dfg/DFGNodeType.h:
  13830. (DFG):
  13831. * dfg/DFGPredictionPropagationPhase.cpp:
  13832. (JSC::DFG::PredictionPropagationPhase::propagate):
  13833. * dfg/DFGRepatch.cpp:
  13834. (JSC::DFG::emitPutTransitionStub):
  13835. * dfg/DFGSpeculativeJIT64.cpp:
  13836. (JSC::DFG::SpeculativeJIT::compile):
  13837. * jit/JITStubs.cpp:
  13838. (JSC::JITThunks::tryCachePutByID):
  13839. * llint/LLIntSlowPaths.cpp:
  13840. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  13841. * runtime/Structure.cpp:
  13842. (JSC::Structure::Structure):
  13843. * runtime/Structure.h:
  13844. (JSC::Structure::transitionWatchpointSetHasBeenInvalidated):
  13845. (Structure):
  13846. (JSC::Structure::transitionWatchpointSetIsStillValid):
  13847. (JSC::Structure::addTransitionWatchpoint):
  13848. (JSC::Structure::notifyTransitionFromThisStructure):
  13849. (JSC::JSCell::setStructure):
  13850. * runtime/SymbolTable.cpp:
  13851. (JSC::SymbolTableEntry::attemptToWatch):
  13852. 2012-06-13 Filip Pizlo <fpizlo@apple.com>
  13853. DFG should be able to set watchpoints on global variables
  13854. https://bugs.webkit.org/show_bug.cgi?id=88692
  13855. Reviewed by Geoffrey Garen.
  13856. Rolling back in after fixing Windows build issues, and implementing
  13857. branchTest8 for the Qt port's strange assemblers.
  13858. This implements global variable constant folding by allowing the optimizing
  13859. compiler to set a "watchpoint" on globals that it wishes to constant fold.
  13860. If the watchpoint fires, then an OSR exit is forced by overwriting the
  13861. machine code that the optimizing compiler generated with a jump.
  13862. As such, this patch is adding quite a bit of stuff:
  13863. - Jump replacement on those hardware targets supported by the optimizing
  13864. JIT. It is now possible to patch in a jump instruction over any recorded
  13865. watchpoint label. The jump must be "local" in the sense that it must be
  13866. within the range of the largest jump distance supported by a one
  13867. instruction jump.
  13868. - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
  13869. that records the location where a jump must be inserted and the
  13870. destination to which it should jump. Watchpoints can be added to a
  13871. WatchpointSet. The WatchpointSet can be fired all at once, which plants
  13872. all jumps. WatchpointSet also remembers if it had ever been invalidated,
  13873. which allows for monotonicity: we typically don't want to optimize using
  13874. watchpoints on something for which watchpoints had previously fired. The
  13875. act of notifying a WatchpointSet has a trivial fast path in case no
  13876. Watchpoints are registered (one-byte load+branch).
  13877. - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
  13878. except that you don't have to emit branches. But, you need to know what
  13879. WatchpointSet to add the resulting Watchpoint to. Not everything that
  13880. you could write a speculationCheck() for will have a WatchpointSet that
  13881. would get notified if the condition you were speculating against became
  13882. invalid.
  13883. - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
  13884. do so without incurring any space overhead for those entries that don't
  13885. have WatchpointSets.
  13886. - The bytecode generator infers all global function variables to be
  13887. watchable, and makes all stores perform the WatchpointSet's write check,
  13888. and marks all loads as being potentially watchable (i.e. you can compile
  13889. them to a watchpoint and a constant).
  13890. Put together, this allows for fully sleazy inlining of calls to globally
  13891. declared functions. The inline prologue will no longer contain the load of
  13892. the function, or any checks of the function you're calling. I.e. it's
  13893. pretty much like the kind of inlining you would see in Java or C++.
  13894. Furthermore, the watchpointing functionality is built to be fairly general,
  13895. and should allow setting watchpoints on all sorts of interesting things
  13896. in the future.
  13897. The sleazy inlining means that we will now sometimes inline in code paths
  13898. that have never executed. Previously, to inline we would have either had
  13899. to have executed the call (to read the call's inline cache) or have
  13900. executed the method check (to read the method check's inline cache). Now,
  13901. we might inline when the callee is a watched global variable. This
  13902. revealed some humorous bugs. First, constant folding disagreed with CFA
  13903. over what kinds of operations can clobber (example: code path A is dead
  13904. but stores a String into variable X, all other code paths store 0 into
  13905. X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
  13906. clobbering constant, but constant folding thought it was clobbering
  13907. because it saw the String prediction). Second, inlining would crash if
  13908. the inline callee had not been compiled. This patch fixes both bugs,
  13909. since otherwise run-javascriptcore-tests would report regressions.
  13910. * CMakeLists.txt:
  13911. * GNUmakefile.list.am:
  13912. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  13913. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  13914. * JavaScriptCore.xcodeproj/project.pbxproj:
  13915. * Target.pri:
  13916. * assembler/ARMv7Assembler.h:
  13917. (ARMv7Assembler):
  13918. (JSC::ARMv7Assembler::ARMv7Assembler):
  13919. (JSC::ARMv7Assembler::labelForWatchpoint):
  13920. (JSC::ARMv7Assembler::label):
  13921. (JSC::ARMv7Assembler::replaceWithJump):
  13922. (JSC::ARMv7Assembler::maxJumpReplacementSize):
  13923. * assembler/AbstractMacroAssembler.h:
  13924. (JSC):
  13925. (AbstractMacroAssembler):
  13926. (Label):
  13927. (JSC::AbstractMacroAssembler::watchpointLabel):
  13928. (JSC::AbstractMacroAssembler::readPointer):
  13929. * assembler/AssemblerBuffer.h:
  13930. * assembler/MacroAssemblerARM.h:
  13931. (JSC::MacroAssemblerARM::branchTest8):
  13932. (MacroAssemblerARM):
  13933. (JSC::MacroAssemblerARM::replaceWithJump):
  13934. (JSC::MacroAssemblerARM::maxJumpReplacementSize):
  13935. * assembler/MacroAssemblerARMv7.h:
  13936. (JSC::MacroAssemblerARMv7::load8Signed):
  13937. (JSC::MacroAssemblerARMv7::load16Signed):
  13938. (MacroAssemblerARMv7):
  13939. (JSC::MacroAssemblerARMv7::replaceWithJump):
  13940. (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
  13941. (JSC::MacroAssemblerARMv7::branchTest8):
  13942. (JSC::MacroAssemblerARMv7::jump):
  13943. (JSC::MacroAssemblerARMv7::makeBranch):
  13944. * assembler/MacroAssemblerMIPS.h:
  13945. (JSC::MacroAssemblerMIPS::branchTest8):
  13946. (MacroAssemblerMIPS):
  13947. (JSC::MacroAssemblerMIPS::replaceWithJump):
  13948. (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
  13949. * assembler/MacroAssemblerSH4.h:
  13950. (JSC::MacroAssemblerSH4::branchTest8):
  13951. (MacroAssemblerSH4):
  13952. (JSC::MacroAssemblerSH4::replaceWithJump):
  13953. (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
  13954. * assembler/MacroAssemblerX86.h:
  13955. (MacroAssemblerX86):
  13956. (JSC::MacroAssemblerX86::branchTest8):
  13957. * assembler/MacroAssemblerX86Common.h:
  13958. (JSC::MacroAssemblerX86Common::replaceWithJump):
  13959. (MacroAssemblerX86Common):
  13960. (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
  13961. * assembler/MacroAssemblerX86_64.h:
  13962. (MacroAssemblerX86_64):
  13963. (JSC::MacroAssemblerX86_64::branchTest8):
  13964. * assembler/X86Assembler.h:
  13965. (JSC::X86Assembler::X86Assembler):
  13966. (X86Assembler):
  13967. (JSC::X86Assembler::cmpb_im):
  13968. (JSC::X86Assembler::testb_im):
  13969. (JSC::X86Assembler::labelForWatchpoint):
  13970. (JSC::X86Assembler::label):
  13971. (JSC::X86Assembler::replaceWithJump):
  13972. (JSC::X86Assembler::maxJumpReplacementSize):
  13973. (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
  13974. * bytecode/CodeBlock.cpp:
  13975. (JSC):
  13976. (JSC::CodeBlock::printGetByIdCacheStatus):
  13977. (JSC::CodeBlock::dump):
  13978. * bytecode/CodeBlock.h:
  13979. (JSC::CodeBlock::appendOSRExit):
  13980. (JSC::CodeBlock::appendSpeculationRecovery):
  13981. (CodeBlock):
  13982. (JSC::CodeBlock::appendWatchpoint):
  13983. (JSC::CodeBlock::numberOfWatchpoints):
  13984. (JSC::CodeBlock::watchpoint):
  13985. (DFGData):
  13986. * bytecode/DFGExitProfile.h:
  13987. (JSC::DFG::exitKindToString):
  13988. (JSC::DFG::exitKindIsCountable):
  13989. * bytecode/GetByIdStatus.cpp:
  13990. (JSC::GetByIdStatus::computeForChain):
  13991. * bytecode/Instruction.h:
  13992. (Instruction):
  13993. (JSC::Instruction::Instruction):
  13994. * bytecode/Opcode.h:
  13995. (JSC):
  13996. (JSC::padOpcodeName):
  13997. * bytecode/Watchpoint.cpp: Added.
  13998. (JSC):
  13999. (JSC::Watchpoint::~Watchpoint):
  14000. (JSC::Watchpoint::correctLabels):
  14001. (JSC::Watchpoint::fire):
  14002. (JSC::WatchpointSet::WatchpointSet):
  14003. (JSC::WatchpointSet::~WatchpointSet):
  14004. (JSC::WatchpointSet::add):
  14005. (JSC::WatchpointSet::notifyWriteSlow):
  14006. (JSC::WatchpointSet::fireAllWatchpoints):
  14007. * bytecode/Watchpoint.h: Added.
  14008. (JSC):
  14009. (Watchpoint):
  14010. (JSC::Watchpoint::Watchpoint):
  14011. (JSC::Watchpoint::setDestination):
  14012. (WatchpointSet):
  14013. (JSC::WatchpointSet::isStillValid):
  14014. (JSC::WatchpointSet::hasBeenInvalidated):
  14015. (JSC::WatchpointSet::startWatching):
  14016. (JSC::WatchpointSet::notifyWrite):
  14017. (JSC::WatchpointSet::addressOfIsWatched):
  14018. * bytecompiler/BytecodeGenerator.cpp:
  14019. (JSC::ResolveResult::checkValidity):
  14020. (JSC::BytecodeGenerator::addGlobalVar):
  14021. (JSC::BytecodeGenerator::BytecodeGenerator):
  14022. (JSC::BytecodeGenerator::resolve):
  14023. (JSC::BytecodeGenerator::emitResolve):
  14024. (JSC::BytecodeGenerator::emitResolveWithBase):
  14025. (JSC::BytecodeGenerator::emitResolveWithThis):
  14026. (JSC::BytecodeGenerator::emitGetStaticVar):
  14027. (JSC::BytecodeGenerator::emitPutStaticVar):
  14028. * bytecompiler/BytecodeGenerator.h:
  14029. (BytecodeGenerator):
  14030. * bytecompiler/NodesCodegen.cpp:
  14031. (JSC::FunctionCallResolveNode::emitBytecode):
  14032. (JSC::PostfixResolveNode::emitBytecode):
  14033. (JSC::PrefixResolveNode::emitBytecode):
  14034. (JSC::ReadModifyResolveNode::emitBytecode):
  14035. (JSC::AssignResolveNode::emitBytecode):
  14036. (JSC::ConstDeclNode::emitCodeSingle):
  14037. * dfg/DFGAbstractState.cpp:
  14038. (JSC::DFG::AbstractState::execute):
  14039. (JSC::DFG::AbstractState::clobberStructures):
  14040. * dfg/DFGAbstractState.h:
  14041. (AbstractState):
  14042. (JSC::DFG::AbstractState::didClobber):
  14043. * dfg/DFGByteCodeParser.cpp:
  14044. (JSC::DFG::ByteCodeParser::handleInlining):
  14045. (JSC::DFG::ByteCodeParser::parseBlock):
  14046. * dfg/DFGCCallHelpers.h:
  14047. (CCallHelpers):
  14048. (JSC::DFG::CCallHelpers::setupArguments):
  14049. * dfg/DFGCSEPhase.cpp:
  14050. (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
  14051. (CSEPhase):
  14052. (JSC::DFG::CSEPhase::globalVarStoreElimination):
  14053. (JSC::DFG::CSEPhase::performNodeCSE):
  14054. * dfg/DFGCapabilities.h:
  14055. (JSC::DFG::canCompileOpcode):
  14056. * dfg/DFGConstantFoldingPhase.cpp:
  14057. (JSC::DFG::ConstantFoldingPhase::run):
  14058. * dfg/DFGCorrectableJumpPoint.h:
  14059. (JSC::DFG::CorrectableJumpPoint::isSet):
  14060. (CorrectableJumpPoint):
  14061. * dfg/DFGJITCompiler.cpp:
  14062. (JSC::DFG::JITCompiler::linkOSRExits):
  14063. (JSC::DFG::JITCompiler::link):
  14064. * dfg/DFGNode.h:
  14065. (JSC::DFG::Node::hasIdentifierNumberForCheck):
  14066. (Node):
  14067. (JSC::DFG::Node::identifierNumberForCheck):
  14068. (JSC::DFG::Node::hasRegisterPointer):
  14069. * dfg/DFGNodeType.h:
  14070. (DFG):
  14071. * dfg/DFGOSRExit.cpp:
  14072. (JSC::DFG::OSRExit::OSRExit):
  14073. * dfg/DFGOSRExit.h:
  14074. (OSRExit):
  14075. * dfg/DFGOperations.cpp:
  14076. * dfg/DFGOperations.h:
  14077. * dfg/DFGPredictionPropagationPhase.cpp:
  14078. (JSC::DFG::PredictionPropagationPhase::propagate):
  14079. * dfg/DFGSpeculativeJIT.h:
  14080. (JSC::DFG::SpeculativeJIT::callOperation):
  14081. (JSC::DFG::SpeculativeJIT::appendCall):
  14082. (SpeculativeJIT):
  14083. (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
  14084. * dfg/DFGSpeculativeJIT32_64.cpp:
  14085. (JSC::DFG::SpeculativeJIT::compile):
  14086. * dfg/DFGSpeculativeJIT64.cpp:
  14087. (JSC::DFG::SpeculativeJIT::compile):
  14088. * interpreter/Interpreter.cpp:
  14089. (JSC::Interpreter::privateExecute):
  14090. * jit/JIT.cpp:
  14091. (JSC::JIT::privateCompileMainPass):
  14092. (JSC::JIT::privateCompileSlowCases):
  14093. * jit/JIT.h:
  14094. * jit/JITPropertyAccess.cpp:
  14095. (JSC::JIT::emit_op_put_global_var_check):
  14096. (JSC):
  14097. (JSC::JIT::emitSlow_op_put_global_var_check):
  14098. * jit/JITPropertyAccess32_64.cpp:
  14099. (JSC::JIT::emit_op_put_global_var_check):
  14100. (JSC):
  14101. (JSC::JIT::emitSlow_op_put_global_var_check):
  14102. * jit/JITStubs.cpp:
  14103. (JSC::DEFINE_STUB_FUNCTION):
  14104. (JSC):
  14105. * jit/JITStubs.h:
  14106. * llint/LLIntSlowPaths.cpp:
  14107. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  14108. (LLInt):
  14109. * llint/LLIntSlowPaths.h:
  14110. (LLInt):
  14111. * llint/LowLevelInterpreter32_64.asm:
  14112. * llint/LowLevelInterpreter64.asm:
  14113. * runtime/JSObject.cpp:
  14114. (JSC::JSObject::removeDirect):
  14115. * runtime/JSObject.h:
  14116. (JSObject):
  14117. * runtime/JSSymbolTableObject.h:
  14118. (JSC::symbolTableGet):
  14119. (JSC::symbolTablePut):
  14120. (JSC::symbolTablePutWithAttributes):
  14121. * runtime/SymbolTable.cpp: Added.
  14122. (JSC):
  14123. (JSC::SymbolTableEntry::copySlow):
  14124. (JSC::SymbolTableEntry::freeFatEntrySlow):
  14125. (JSC::SymbolTableEntry::couldBeWatched):
  14126. (JSC::SymbolTableEntry::attemptToWatch):
  14127. (JSC::SymbolTableEntry::addressOfIsWatched):
  14128. (JSC::SymbolTableEntry::addWatchpoint):
  14129. (JSC::SymbolTableEntry::notifyWriteSlow):
  14130. (JSC::SymbolTableEntry::inflateSlow):
  14131. * runtime/SymbolTable.h:
  14132. (JSC):
  14133. (SymbolTableEntry):
  14134. (Fast):
  14135. (JSC::SymbolTableEntry::Fast::Fast):
  14136. (JSC::SymbolTableEntry::Fast::isNull):
  14137. (JSC::SymbolTableEntry::Fast::getIndex):
  14138. (JSC::SymbolTableEntry::Fast::isReadOnly):
  14139. (JSC::SymbolTableEntry::Fast::getAttributes):
  14140. (JSC::SymbolTableEntry::Fast::isFat):
  14141. (JSC::SymbolTableEntry::SymbolTableEntry):
  14142. (JSC::SymbolTableEntry::~SymbolTableEntry):
  14143. (JSC::SymbolTableEntry::operator=):
  14144. (JSC::SymbolTableEntry::isNull):
  14145. (JSC::SymbolTableEntry::getIndex):
  14146. (JSC::SymbolTableEntry::getFast):
  14147. (JSC::SymbolTableEntry::getAttributes):
  14148. (JSC::SymbolTableEntry::isReadOnly):
  14149. (JSC::SymbolTableEntry::watchpointSet):
  14150. (JSC::SymbolTableEntry::notifyWrite):
  14151. (FatEntry):
  14152. (JSC::SymbolTableEntry::FatEntry::FatEntry):
  14153. (JSC::SymbolTableEntry::isFat):
  14154. (JSC::SymbolTableEntry::fatEntry):
  14155. (JSC::SymbolTableEntry::inflate):
  14156. (JSC::SymbolTableEntry::bits):
  14157. (JSC::SymbolTableEntry::freeFatEntry):
  14158. (JSC::SymbolTableEntry::pack):
  14159. (JSC::SymbolTableEntry::isValidIndex):
  14160. 2012-06-13 Sheriff Bot <webkit.review.bot@gmail.com>
  14161. Unreviewed, rolling out r120172.
  14162. http://trac.webkit.org/changeset/120172
  14163. https://bugs.webkit.org/show_bug.cgi?id=88976
  14164. The patch causes compilation failures on Gtk, Qt and Apple Win
  14165. bots (Requested by zdobersek on #webkit).
  14166. * CMakeLists.txt:
  14167. * GNUmakefile.list.am:
  14168. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  14169. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  14170. * JavaScriptCore.xcodeproj/project.pbxproj:
  14171. * Target.pri:
  14172. * assembler/ARMv7Assembler.h:
  14173. (JSC::ARMv7Assembler::nop):
  14174. (JSC::ARMv7Assembler::label):
  14175. (JSC::ARMv7Assembler::readPointer):
  14176. (ARMv7Assembler):
  14177. * assembler/AbstractMacroAssembler.h:
  14178. (JSC):
  14179. (AbstractMacroAssembler):
  14180. (Label):
  14181. * assembler/AssemblerBuffer.h:
  14182. * assembler/MacroAssemblerARM.h:
  14183. * assembler/MacroAssemblerARMv7.h:
  14184. (JSC::MacroAssemblerARMv7::nop):
  14185. (JSC::MacroAssemblerARMv7::jump):
  14186. (JSC::MacroAssemblerARMv7::makeBranch):
  14187. * assembler/MacroAssemblerMIPS.h:
  14188. * assembler/MacroAssemblerSH4.h:
  14189. * assembler/MacroAssemblerX86.h:
  14190. (MacroAssemblerX86):
  14191. (JSC::MacroAssemblerX86::moveWithPatch):
  14192. * assembler/MacroAssemblerX86Common.h:
  14193. * assembler/MacroAssemblerX86_64.h:
  14194. (JSC::MacroAssemblerX86_64::branchTest8):
  14195. * assembler/X86Assembler.h:
  14196. (JSC::X86Assembler::cmpb_im):
  14197. (JSC::X86Assembler::codeSize):
  14198. (JSC::X86Assembler::label):
  14199. (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
  14200. * bytecode/CodeBlock.cpp:
  14201. (JSC::CodeBlock::dump):
  14202. * bytecode/CodeBlock.h:
  14203. (JSC::CodeBlock::appendOSRExit):
  14204. (JSC::CodeBlock::appendSpeculationRecovery):
  14205. (DFGData):
  14206. * bytecode/DFGExitProfile.h:
  14207. (JSC::DFG::exitKindToString):
  14208. (JSC::DFG::exitKindIsCountable):
  14209. * bytecode/Instruction.h:
  14210. * bytecode/Opcode.h:
  14211. (JSC):
  14212. (JSC::padOpcodeName):
  14213. * bytecode/Watchpoint.cpp: Removed.
  14214. * bytecode/Watchpoint.h: Removed.
  14215. * bytecompiler/BytecodeGenerator.cpp:
  14216. (JSC::ResolveResult::checkValidity):
  14217. (JSC::BytecodeGenerator::addGlobalVar):
  14218. (JSC::BytecodeGenerator::BytecodeGenerator):
  14219. (JSC::BytecodeGenerator::resolve):
  14220. (JSC::BytecodeGenerator::emitResolve):
  14221. (JSC::BytecodeGenerator::emitResolveWithBase):
  14222. (JSC::BytecodeGenerator::emitResolveWithThis):
  14223. (JSC::BytecodeGenerator::emitGetStaticVar):
  14224. (JSC::BytecodeGenerator::emitPutStaticVar):
  14225. * bytecompiler/BytecodeGenerator.h:
  14226. (BytecodeGenerator):
  14227. * bytecompiler/NodesCodegen.cpp:
  14228. (JSC::FunctionCallResolveNode::emitBytecode):
  14229. (JSC::PostfixResolveNode::emitBytecode):
  14230. (JSC::PrefixResolveNode::emitBytecode):
  14231. (JSC::ReadModifyResolveNode::emitBytecode):
  14232. (JSC::AssignResolveNode::emitBytecode):
  14233. (JSC::ConstDeclNode::emitCodeSingle):
  14234. * dfg/DFGAbstractState.cpp:
  14235. (JSC::DFG::AbstractState::execute):
  14236. (JSC::DFG::AbstractState::clobberStructures):
  14237. * dfg/DFGAbstractState.h:
  14238. (AbstractState):
  14239. * dfg/DFGByteCodeParser.cpp:
  14240. (JSC::DFG::ByteCodeParser::handleInlining):
  14241. (JSC::DFG::ByteCodeParser::parseBlock):
  14242. * dfg/DFGCCallHelpers.h:
  14243. (JSC::DFG::CCallHelpers::setupArguments):
  14244. * dfg/DFGCSEPhase.cpp:
  14245. (JSC::DFG::CSEPhase::globalVarStoreElimination):
  14246. (JSC::DFG::CSEPhase::performNodeCSE):
  14247. * dfg/DFGCapabilities.h:
  14248. (JSC::DFG::canCompileOpcode):
  14249. * dfg/DFGConstantFoldingPhase.cpp:
  14250. (JSC::DFG::ConstantFoldingPhase::run):
  14251. * dfg/DFGCorrectableJumpPoint.h:
  14252. * dfg/DFGJITCompiler.cpp:
  14253. (JSC::DFG::JITCompiler::linkOSRExits):
  14254. (JSC::DFG::JITCompiler::link):
  14255. * dfg/DFGNode.h:
  14256. (JSC::DFG::Node::hasRegisterPointer):
  14257. * dfg/DFGNodeType.h:
  14258. (DFG):
  14259. * dfg/DFGOSRExit.cpp:
  14260. (JSC::DFG::OSRExit::OSRExit):
  14261. * dfg/DFGOSRExit.h:
  14262. (OSRExit):
  14263. * dfg/DFGOperations.cpp:
  14264. * dfg/DFGOperations.h:
  14265. * dfg/DFGPredictionPropagationPhase.cpp:
  14266. (JSC::DFG::PredictionPropagationPhase::propagate):
  14267. * dfg/DFGSpeculativeJIT.h:
  14268. (JSC::DFG::SpeculativeJIT::callOperation):
  14269. (JSC::DFG::SpeculativeJIT::appendCallSetResult):
  14270. (JSC::DFG::SpeculativeJIT::speculationCheck):
  14271. * dfg/DFGSpeculativeJIT32_64.cpp:
  14272. (JSC::DFG::SpeculativeJIT::compile):
  14273. * dfg/DFGSpeculativeJIT64.cpp:
  14274. (JSC::DFG::SpeculativeJIT::compile):
  14275. * jit/JIT.cpp:
  14276. (JSC::JIT::privateCompileMainPass):
  14277. (JSC::JIT::privateCompileSlowCases):
  14278. * jit/JIT.h:
  14279. * jit/JITPropertyAccess.cpp:
  14280. * jit/JITPropertyAccess32_64.cpp:
  14281. * jit/JITStubs.cpp:
  14282. * jit/JITStubs.h:
  14283. * llint/LLIntSlowPaths.cpp:
  14284. * llint/LLIntSlowPaths.h:
  14285. (LLInt):
  14286. * llint/LowLevelInterpreter32_64.asm:
  14287. * llint/LowLevelInterpreter64.asm:
  14288. * runtime/JSObject.cpp:
  14289. (JSC::JSObject::removeDirect):
  14290. * runtime/JSObject.h:
  14291. (JSObject):
  14292. * runtime/JSSymbolTableObject.h:
  14293. (JSC::symbolTableGet):
  14294. (JSC::symbolTablePut):
  14295. (JSC::symbolTablePutWithAttributes):
  14296. * runtime/SymbolTable.cpp: Removed.
  14297. * runtime/SymbolTable.h:
  14298. (JSC):
  14299. (JSC::SymbolTableEntry::isNull):
  14300. (JSC::SymbolTableEntry::getIndex):
  14301. (SymbolTableEntry):
  14302. (JSC::SymbolTableEntry::getAttributes):
  14303. (JSC::SymbolTableEntry::isReadOnly):
  14304. (JSC::SymbolTableEntry::pack):
  14305. (JSC::SymbolTableEntry::isValidIndex):
  14306. 2012-06-12 Filip Pizlo <fpizlo@apple.com>
  14307. DFG should be able to set watchpoints on global variables
  14308. https://bugs.webkit.org/show_bug.cgi?id=88692
  14309. Reviewed by Geoffrey Garen.
  14310. This implements global variable constant folding by allowing the optimizing
  14311. compiler to set a "watchpoint" on globals that it wishes to constant fold.
  14312. If the watchpoint fires, then an OSR exit is forced by overwriting the
  14313. machine code that the optimizing compiler generated with a jump.
  14314. As such, this patch is adding quite a bit of stuff:
  14315. - Jump replacement on those hardware targets supported by the optimizing
  14316. JIT. It is now possible to patch in a jump instruction over any recorded
  14317. watchpoint label. The jump must be "local" in the sense that it must be
  14318. within the range of the largest jump distance supported by a one
  14319. instruction jump.
  14320. - WatchpointSets and Watchpoints. A Watchpoint is a doubly-linked list node
  14321. that records the location where a jump must be inserted and the
  14322. destination to which it should jump. Watchpoints can be added to a
  14323. WatchpointSet. The WatchpointSet can be fired all at once, which plants
  14324. all jumps. WatchpointSet also remembers if it had ever been invalidated,
  14325. which allows for monotonicity: we typically don't want to optimize using
  14326. watchpoints on something for which watchpoints had previously fired. The
  14327. act of notifying a WatchpointSet has a trivial fast path in case no
  14328. Watchpoints are registered (one-byte load+branch).
  14329. - SpeculativeJIT::speculationWatchpoint(). It's like speculationCheck(),
  14330. except that you don't have to emit branches. But, you need to know what
  14331. WatchpointSet to add the resulting Watchpoint to. Not everything that
  14332. you could write a speculationCheck() for will have a WatchpointSet that
  14333. would get notified if the condition you were speculating against became
  14334. invalid.
  14335. - SymbolTableEntry now has the ability to refer to a WatchpointSet. It can
  14336. do so without incurring any space overhead for those entries that don't
  14337. have WatchpointSets.
  14338. - The bytecode generator infers all global function variables to be
  14339. watchable, and makes all stores perform the WatchpointSet's write check,
  14340. and marks all loads as being potentially watchable (i.e. you can compile
  14341. them to a watchpoint and a constant).
  14342. Put together, this allows for fully sleazy inlining of calls to globally
  14343. declared functions. The inline prologue will no longer contain the load of
  14344. the function, or any checks of the function you're calling. I.e. it's
  14345. pretty much like the kind of inlining you would see in Java or C++.
  14346. Furthermore, the watchpointing functionality is built to be fairly general,
  14347. and should allow setting watchpoints on all sorts of interesting things
  14348. in the future.
  14349. The sleazy inlining means that we will now sometimes inline in code paths
  14350. that have never executed. Previously, to inline we would have either had
  14351. to have executed the call (to read the call's inline cache) or have
  14352. executed the method check (to read the method check's inline cache). Now,
  14353. we might inline when the callee is a watched global variable. This
  14354. revealed some humorous bugs. First, constant folding disagreed with CFA
  14355. over what kinds of operations can clobber (example: code path A is dead
  14356. but stores a String into variable X, all other code paths store 0 into
  14357. X, and then you do CompareEq(X, 0) - CFA will say that this is a non-
  14358. clobbering constant, but constant folding thought it was clobbering
  14359. because it saw the String prediction). Second, inlining would crash if
  14360. the inline callee had not been compiled. This patch fixes both bugs,
  14361. since otherwise run-javascriptcore-tests would report regressions.
  14362. * CMakeLists.txt:
  14363. * GNUmakefile.list.am:
  14364. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  14365. * JavaScriptCore.xcodeproj/project.pbxproj:
  14366. * Target.pri:
  14367. * assembler/ARMv7Assembler.h:
  14368. (ARMv7Assembler):
  14369. (JSC::ARMv7Assembler::ARMv7Assembler):
  14370. (JSC::ARMv7Assembler::labelForWatchpoint):
  14371. (JSC::ARMv7Assembler::label):
  14372. (JSC::ARMv7Assembler::replaceWithJump):
  14373. (JSC::ARMv7Assembler::maxJumpReplacementSize):
  14374. * assembler/AbstractMacroAssembler.h:
  14375. (JSC):
  14376. (AbstractMacroAssembler):
  14377. (Label):
  14378. (JSC::AbstractMacroAssembler::watchpointLabel):
  14379. * assembler/AssemblerBuffer.h:
  14380. * assembler/MacroAssemblerARM.h:
  14381. (JSC::MacroAssemblerARM::replaceWithJump):
  14382. (MacroAssemblerARM):
  14383. (JSC::MacroAssemblerARM::maxJumpReplacementSize):
  14384. * assembler/MacroAssemblerARMv7.h:
  14385. (MacroAssemblerARMv7):
  14386. (JSC::MacroAssemblerARMv7::replaceWithJump):
  14387. (JSC::MacroAssemblerARMv7::maxJumpReplacementSize):
  14388. (JSC::MacroAssemblerARMv7::branchTest8):
  14389. (JSC::MacroAssemblerARMv7::jump):
  14390. (JSC::MacroAssemblerARMv7::makeBranch):
  14391. * assembler/MacroAssemblerMIPS.h:
  14392. (JSC::MacroAssemblerMIPS::replaceWithJump):
  14393. (MacroAssemblerMIPS):
  14394. (JSC::MacroAssemblerMIPS::maxJumpReplacementSize):
  14395. * assembler/MacroAssemblerSH4.h:
  14396. (JSC::MacroAssemblerSH4::replaceWithJump):
  14397. (MacroAssemblerSH4):
  14398. (JSC::MacroAssemblerSH4::maxJumpReplacementSize):
  14399. * assembler/MacroAssemblerX86.h:
  14400. (MacroAssemblerX86):
  14401. (JSC::MacroAssemblerX86::branchTest8):
  14402. * assembler/MacroAssemblerX86Common.h:
  14403. (JSC::MacroAssemblerX86Common::replaceWithJump):
  14404. (MacroAssemblerX86Common):
  14405. (JSC::MacroAssemblerX86Common::maxJumpReplacementSize):
  14406. * assembler/MacroAssemblerX86_64.h:
  14407. (MacroAssemblerX86_64):
  14408. (JSC::MacroAssemblerX86_64::branchTest8):
  14409. * assembler/X86Assembler.h:
  14410. (JSC::X86Assembler::X86Assembler):
  14411. (X86Assembler):
  14412. (JSC::X86Assembler::cmpb_im):
  14413. (JSC::X86Assembler::testb_im):
  14414. (JSC::X86Assembler::labelForWatchpoint):
  14415. (JSC::X86Assembler::label):
  14416. (JSC::X86Assembler::replaceWithJump):
  14417. (JSC::X86Assembler::maxJumpReplacementSize):
  14418. (JSC::X86Assembler::X86InstructionFormatter::memoryModRM):
  14419. * bytecode/CodeBlock.cpp:
  14420. (JSC::CodeBlock::dump):
  14421. * bytecode/CodeBlock.h:
  14422. (JSC::CodeBlock::appendOSRExit):
  14423. (JSC::CodeBlock::appendSpeculationRecovery):
  14424. (CodeBlock):
  14425. (JSC::CodeBlock::appendWatchpoint):
  14426. (JSC::CodeBlock::numberOfWatchpoints):
  14427. (JSC::CodeBlock::watchpoint):
  14428. (DFGData):
  14429. * bytecode/DFGExitProfile.h:
  14430. (JSC::DFG::exitKindToString):
  14431. (JSC::DFG::exitKindIsCountable):
  14432. * bytecode/Instruction.h:
  14433. (Instruction):
  14434. (JSC::Instruction::Instruction):
  14435. * bytecode/Opcode.h:
  14436. (JSC):
  14437. (JSC::padOpcodeName):
  14438. * bytecode/Watchpoint.cpp: Added.
  14439. (JSC):
  14440. (JSC::Watchpoint::~Watchpoint):
  14441. (JSC::Watchpoint::correctLabels):
  14442. (JSC::Watchpoint::fire):
  14443. (JSC::WatchpointSet::WatchpointSet):
  14444. (JSC::WatchpointSet::~WatchpointSet):
  14445. (JSC::WatchpointSet::add):
  14446. (JSC::WatchpointSet::notifyWriteSlow):
  14447. (JSC::WatchpointSet::fireAllWatchpoints):
  14448. * bytecode/Watchpoint.h: Added.
  14449. (JSC):
  14450. (Watchpoint):
  14451. (JSC::Watchpoint::Watchpoint):
  14452. (JSC::Watchpoint::setDestination):
  14453. (WatchpointSet):
  14454. (JSC::WatchpointSet::isStillValid):
  14455. (JSC::WatchpointSet::hasBeenInvalidated):
  14456. (JSC::WatchpointSet::startWatching):
  14457. (JSC::WatchpointSet::notifyWrite):
  14458. (JSC::WatchpointSet::addressOfIsWatched):
  14459. * bytecompiler/BytecodeGenerator.cpp:
  14460. (JSC::ResolveResult::checkValidity):
  14461. (JSC::BytecodeGenerator::addGlobalVar):
  14462. (JSC::BytecodeGenerator::BytecodeGenerator):
  14463. (JSC::BytecodeGenerator::resolve):
  14464. (JSC::BytecodeGenerator::emitResolve):
  14465. (JSC::BytecodeGenerator::emitResolveWithBase):
  14466. (JSC::BytecodeGenerator::emitResolveWithThis):
  14467. (JSC::BytecodeGenerator::emitGetStaticVar):
  14468. (JSC::BytecodeGenerator::emitPutStaticVar):
  14469. * bytecompiler/BytecodeGenerator.h:
  14470. (BytecodeGenerator):
  14471. * bytecompiler/NodesCodegen.cpp:
  14472. (JSC::FunctionCallResolveNode::emitBytecode):
  14473. (JSC::PostfixResolveNode::emitBytecode):
  14474. (JSC::PrefixResolveNode::emitBytecode):
  14475. (JSC::ReadModifyResolveNode::emitBytecode):
  14476. (JSC::AssignResolveNode::emitBytecode):
  14477. (JSC::ConstDeclNode::emitCodeSingle):
  14478. * dfg/DFGAbstractState.cpp:
  14479. (JSC::DFG::AbstractState::execute):
  14480. (JSC::DFG::AbstractState::clobberStructures):
  14481. * dfg/DFGAbstractState.h:
  14482. (AbstractState):
  14483. (JSC::DFG::AbstractState::didClobber):
  14484. * dfg/DFGByteCodeParser.cpp:
  14485. (JSC::DFG::ByteCodeParser::handleInlining):
  14486. (JSC::DFG::ByteCodeParser::parseBlock):
  14487. * dfg/DFGCCallHelpers.h:
  14488. (CCallHelpers):
  14489. (JSC::DFG::CCallHelpers::setupArguments):
  14490. * dfg/DFGCSEPhase.cpp:
  14491. (JSC::DFG::CSEPhase::globalVarWatchpointElimination):
  14492. (CSEPhase):
  14493. (JSC::DFG::CSEPhase::globalVarStoreElimination):
  14494. (JSC::DFG::CSEPhase::performNodeCSE):
  14495. * dfg/DFGCapabilities.h:
  14496. (JSC::DFG::canCompileOpcode):
  14497. * dfg/DFGConstantFoldingPhase.cpp:
  14498. (JSC::DFG::ConstantFoldingPhase::run):
  14499. * dfg/DFGCorrectableJumpPoint.h:
  14500. (JSC::DFG::CorrectableJumpPoint::isSet):
  14501. (CorrectableJumpPoint):
  14502. * dfg/DFGJITCompiler.cpp:
  14503. (JSC::DFG::JITCompiler::linkOSRExits):
  14504. (JSC::DFG::JITCompiler::link):
  14505. * dfg/DFGNode.h:
  14506. (JSC::DFG::Node::hasIdentifierNumberForCheck):
  14507. (Node):
  14508. (JSC::DFG::Node::identifierNumberForCheck):
  14509. (JSC::DFG::Node::hasRegisterPointer):
  14510. * dfg/DFGNodeType.h:
  14511. (DFG):
  14512. * dfg/DFGOSRExit.cpp:
  14513. (JSC::DFG::OSRExit::OSRExit):
  14514. * dfg/DFGOSRExit.h:
  14515. (OSRExit):
  14516. * dfg/DFGOperations.cpp:
  14517. * dfg/DFGOperations.h:
  14518. * dfg/DFGPredictionPropagationPhase.cpp:
  14519. (JSC::DFG::PredictionPropagationPhase::propagate):
  14520. * dfg/DFGSpeculativeJIT.h:
  14521. (JSC::DFG::SpeculativeJIT::callOperation):
  14522. (JSC::DFG::SpeculativeJIT::appendCall):
  14523. (SpeculativeJIT):
  14524. (JSC::DFG::SpeculativeJIT::speculationWatchpoint):
  14525. * dfg/DFGSpeculativeJIT32_64.cpp:
  14526. (JSC::DFG::SpeculativeJIT::compile):
  14527. * dfg/DFGSpeculativeJIT64.cpp:
  14528. (JSC::DFG::SpeculativeJIT::compile):
  14529. * jit/JIT.cpp:
  14530. (JSC::JIT::privateCompileMainPass):
  14531. (JSC::JIT::privateCompileSlowCases):
  14532. * jit/JIT.h:
  14533. * jit/JITPropertyAccess.cpp:
  14534. (JSC::JIT::emit_op_put_global_var_check):
  14535. (JSC):
  14536. (JSC::JIT::emitSlow_op_put_global_var_check):
  14537. * jit/JITPropertyAccess32_64.cpp:
  14538. (JSC::JIT::emit_op_put_global_var_check):
  14539. (JSC):
  14540. (JSC::JIT::emitSlow_op_put_global_var_check):
  14541. * jit/JITStubs.cpp:
  14542. (JSC::JITThunks::JITThunks):
  14543. (JSC::DEFINE_STUB_FUNCTION):
  14544. (JSC):
  14545. * jit/JITStubs.h:
  14546. * llint/LLIntSlowPaths.cpp:
  14547. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  14548. (LLInt):
  14549. * llint/LLIntSlowPaths.h:
  14550. (LLInt):
  14551. * llint/LowLevelInterpreter32_64.asm:
  14552. * llint/LowLevelInterpreter64.asm:
  14553. * runtime/JSObject.cpp:
  14554. (JSC::JSObject::removeDirect):
  14555. * runtime/JSObject.h:
  14556. (JSObject):
  14557. * runtime/JSSymbolTableObject.h:
  14558. (JSC::symbolTableGet):
  14559. (JSC::symbolTablePut):
  14560. (JSC::symbolTablePutWithAttributes):
  14561. * runtime/SymbolTable.cpp: Added.
  14562. (JSC):
  14563. (JSC::SymbolTableEntry::copySlow):
  14564. (JSC::SymbolTableEntry::freeFatEntrySlow):
  14565. (JSC::SymbolTableEntry::couldBeWatched):
  14566. (JSC::SymbolTableEntry::attemptToWatch):
  14567. (JSC::SymbolTableEntry::addressOfIsWatched):
  14568. (JSC::SymbolTableEntry::addWatchpoint):
  14569. (JSC::SymbolTableEntry::notifyWriteSlow):
  14570. (JSC::SymbolTableEntry::inflateSlow):
  14571. * runtime/SymbolTable.h:
  14572. (JSC):
  14573. (SymbolTableEntry):
  14574. (Fast):
  14575. (JSC::SymbolTableEntry::Fast::Fast):
  14576. (JSC::SymbolTableEntry::Fast::isNull):
  14577. (JSC::SymbolTableEntry::Fast::getIndex):
  14578. (JSC::SymbolTableEntry::Fast::isReadOnly):
  14579. (JSC::SymbolTableEntry::Fast::getAttributes):
  14580. (JSC::SymbolTableEntry::Fast::isFat):
  14581. (JSC::SymbolTableEntry::SymbolTableEntry):
  14582. (JSC::SymbolTableEntry::~SymbolTableEntry):
  14583. (JSC::SymbolTableEntry::operator=):
  14584. (JSC::SymbolTableEntry::isNull):
  14585. (JSC::SymbolTableEntry::getIndex):
  14586. (JSC::SymbolTableEntry::getFast):
  14587. (JSC::SymbolTableEntry::getAttributes):
  14588. (JSC::SymbolTableEntry::isReadOnly):
  14589. (JSC::SymbolTableEntry::watchpointSet):
  14590. (JSC::SymbolTableEntry::notifyWrite):
  14591. (FatEntry):
  14592. (JSC::SymbolTableEntry::FatEntry::FatEntry):
  14593. (JSC::SymbolTableEntry::isFat):
  14594. (JSC::SymbolTableEntry::fatEntry):
  14595. (JSC::SymbolTableEntry::inflate):
  14596. (JSC::SymbolTableEntry::bits):
  14597. (JSC::SymbolTableEntry::freeFatEntry):
  14598. (JSC::SymbolTableEntry::pack):
  14599. (JSC::SymbolTableEntry::isValidIndex):
  14600. 2012-06-12 Filip Pizlo <fpizlo@apple.com>
  14601. Unreviewed build fix for ARMv7 debug builds.
  14602. * jit/JITStubs.cpp:
  14603. (JSC::JITThunks::JITThunks):
  14604. 2012-06-12 Geoffrey Garen <ggaren@apple.com>
  14605. Build fix for case-sensitive file systems: use the right case.
  14606. * heap/ListableHandler.h:
  14607. 2012-06-11 Geoffrey Garen <ggaren@apple.com>
  14608. GC should be 1.7X faster
  14609. https://bugs.webkit.org/show_bug.cgi?id=88840
  14610. Reviewed by Oliver Hunt.
  14611. I profiled, and removed anything that showed up as a concurrency
  14612. bottleneck. Then, I added 3 threads to our max thread count, since we
  14613. can scale up to more threads now.
  14614. * heap/BlockAllocator.cpp:
  14615. (JSC::BlockAllocator::BlockAllocator):
  14616. (JSC::BlockAllocator::~BlockAllocator):
  14617. (JSC::BlockAllocator::releaseFreeBlocks):
  14618. (JSC::BlockAllocator::waitForRelativeTimeWhileHoldingLock):
  14619. (JSC::BlockAllocator::waitForRelativeTime):
  14620. (JSC::BlockAllocator::blockFreeingThreadMain):
  14621. * heap/BlockAllocator.h:
  14622. (BlockAllocator):
  14623. (JSC::BlockAllocator::allocate):
  14624. (JSC::BlockAllocator::deallocate): Use a spin lock for the common case
  14625. where we're just popping a linked list. (A pthread mutex would sleep our
  14626. thread even if the lock were only contended for a microsecond.)
  14627. Scope the lock to avoid holding it while allocating VM, since that's a
  14628. slow activity and it doesn't modify any of our data structures.
  14629. We still use a pthread mutex to handle our condition variable since we
  14630. have to, and it's not a hot path.
  14631. * heap/CopiedSpace.cpp:
  14632. (JSC::CopiedSpace::CopiedSpace):
  14633. (JSC::CopiedSpace::doneFillingBlock):
  14634. * heap/CopiedSpace.h:
  14635. (JSC::CopiedSpace::CopiedSpace): Use a spin lock for the to space lock,
  14636. since it just guards linked list and hash table manipulation.
  14637. * heap/MarkStack.cpp:
  14638. (JSC::MarkStackSegmentAllocator::MarkStackSegmentAllocator):
  14639. (JSC::MarkStackSegmentAllocator::allocate):
  14640. (JSC::MarkStackSegmentAllocator::release):
  14641. (JSC::MarkStackSegmentAllocator::shrinkReserve): Use a spin lock, since
  14642. we're just managing a linked list.
  14643. (JSC::MarkStackArray::donateSomeCellsTo): Changed donation to be proportional
  14644. to our current stack size. This fixes cases where we used to donate too
  14645. much. Interestingly, donating too much was starving the donor (when it
  14646. ran out of work later) *and* the recipient (since it had to wait on a
  14647. long donation operation to complete before it could acquire the lock).
  14648. In the worst case, we're still guaranteed to donate N cells in roughly log N time.
  14649. This change also fixes cases where we used to donate too little, since
  14650. we would always keep a fixed minimum number of cells. In the worst case,
  14651. with N marking threads, would could have N large object graph roots in
  14652. our stack for the duration of GC, and scale to only 1 thread.
  14653. It's an interesting observation that a single object in the mark stack
  14654. might represent an arbitrarily large object graph -- and only the act
  14655. of marking can find out.
  14656. (JSC::MarkStackArray::stealSomeCellsFrom): Steal in proportion to idle
  14657. threads. Once again, this fixes cases where constants could cause us
  14658. to steal too much or too little.
  14659. (JSC::SlotVisitor::donateKnownParallel): Always wake up other threads
  14660. if they're idle. We can afford to do this because we're conservative
  14661. about when we donate.
  14662. (JSC::SlotVisitor::drainFromShared):
  14663. * heap/MarkStack.h:
  14664. (MarkStackSegmentAllocator):
  14665. (MarkStackArray):
  14666. (JSC):
  14667. * heap/SlotVisitor.h: Merged the "should I donate?" decision into a
  14668. single function, for simplicity.
  14669. * runtime/Options.cpp:
  14670. (minimumNumberOfScansBetweenRebalance): Reduced the delay before donation
  14671. a lot. We can afford to do this because, in the common case, donation is
  14672. a single branch that decides not to donate.
  14673. (cpusToUse): Use more CPUs now, since we scale better now.
  14674. * runtime/Options.h:
  14675. (Options): Removed now-unused variables.
  14676. 2012-06-12 Filip Pizlo <fpizlo@apple.com>
  14677. REGRESSION(120121): inspector tests crash in DFG
  14678. https://bugs.webkit.org/show_bug.cgi?id=88941
  14679. Reviewed by Geoffrey Garen.
  14680. The CFG simplifier has two different ways of fixing up GetLocal, Phantom, and Flush. If we've
  14681. already fixed up the node one way, we shouldn't try the other way. The reason why we shouldn't
  14682. is that the second way depends on the node referring to other nodes in the to-be-jettisoned
  14683. block. After fixup they potentially will refer to nodes in the block being merged to.
  14684. * dfg/DFGCFGSimplificationPhase.cpp:
  14685. (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
  14686. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  14687. 2012-06-12 Leo Yang <leo.yang@torchmobile.com.cn>
  14688. Dynamic hash table in DOMObjectHashTableMap is wrong in multiple threads
  14689. https://bugs.webkit.org/show_bug.cgi?id=87334
  14690. Reviewed by Geoffrey Garen.
  14691. Add a copy member function to JSC::HasTable. This function will copy all data
  14692. members except for *table* which contains thread specific data that prevents
  14693. up copying it. When you want to copy a JSC::HashTable that was constructed
  14694. on another thread you should call JSC::HashTable::copy().
  14695. * runtime/Lookup.h:
  14696. (JSC::HashTable::copy):
  14697. (HashTable):
  14698. 2012-06-12 Filip Pizlo <fpizlo@apple.com>
  14699. DFG should not ASSERT if you have a double use of a variable that is not revealed to be a double
  14700. until after CFG simplification
  14701. https://bugs.webkit.org/show_bug.cgi?id=88927
  14702. <rdar://problem/11513971>
  14703. Reviewed by Geoffrey Garen.
  14704. Speculation fixup needs to run if simplification did things, because simplification can change
  14705. predictions - particularly if you had a control flow path that stored weird things into a
  14706. variable, but that path got axed by the simplifier.
  14707. Running fixup in the fixpoint requires making it idempotent, which it previously wasn't. Only
  14708. one place needed to be changed, namely the un-MustGenerate-ion of ValueToInt32.
  14709. * dfg/DFGDriver.cpp:
  14710. (JSC::DFG::compile):
  14711. * dfg/DFGFixupPhase.cpp:
  14712. (JSC::DFG::FixupPhase::fixupNode):
  14713. 2012-06-12 Filip Pizlo <fpizlo@apple.com>
  14714. REGRESSION (r119779): Javascript TypeError: 'undefined' is not an object
  14715. https://bugs.webkit.org/show_bug.cgi?id=88783
  14716. <rdar://problem/11640299>
  14717. Reviewed by Geoffrey Garen.
  14718. If you don't keep alive the base of an object access over the various checks
  14719. you do for the prototype chain, you're going to have a bad time.
  14720. * dfg/DFGByteCodeParser.cpp:
  14721. (JSC::DFG::ByteCodeParser::handleGetById):
  14722. 2012-06-12 Hojong Han <hojong.han@samsung.com>
  14723. Property names of the built-in object cannot be retrieved
  14724. after trying to delete one of its properties
  14725. https://bugs.webkit.org/show_bug.cgi?id=86461
  14726. Reviewed by Gavin Barraclough.
  14727. * runtime/JSObject.cpp:
  14728. (JSC::getClassPropertyNames):
  14729. (JSC::JSObject::getOwnPropertyNames):
  14730. 2012-06-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
  14731. [CMAKE][EFL] Remove duplicated executable output path
  14732. https://bugs.webkit.org/show_bug.cgi?id=88765
  14733. Reviewed by Daniel Bates.
  14734. CMake files for EFL port have redefined executable output path. However, EFL port doesn't
  14735. need to define again because it is already defined in top-level CMake file.
  14736. * shell/CMakeLists.txt:
  14737. 2012-06-11 Carlos Garcia Campos <cgarcia@igalia.com>
  14738. Unreviewed. Fix make distcheck issues.
  14739. * GNUmakefile.list.am: Remove non existent header file.
  14740. 2012-06-10 Patrick Gansterer <paroga@webkit.org>
  14741. Unreviewed. Build fix for !ENABLE(JIT) after r119844 and r119925.
  14742. * runtime/Executable.h:
  14743. (ExecutableBase):
  14744. (JSC::ExecutableBase::clearCodeVirtual):
  14745. 2012-06-10 Patrick Gansterer <paroga@webkit.org>
  14746. Unreviewed. Build fix for !ENABLE(JIT) after r119844.
  14747. * runtime/Executable.h:
  14748. (ExecutableBase):
  14749. (JSC):
  14750. 2012-06-09 Dominic Cooney <dominicc@chromium.org>
  14751. [Chromium] Remove JavaScriptCore dependencies from gyp
  14752. https://bugs.webkit.org/show_bug.cgi?id=88510
  14753. Reviewed by Adam Barth.
  14754. Chromium doesn't support JSC any more and there doesn't seem to be
  14755. a strong interest in using GYP as the common build system in other
  14756. ports.
  14757. * JavaScriptCore.gyp/JavaScriptCore.gyp: WebCore still depends on YARR interpreter.
  14758. * JavaScriptCore.gypi: Only include YARR source.
  14759. * gyp/JavaScriptCore.gyp: Removed.
  14760. * gyp/gtk.gyp: Removed.
  14761. 2012-06-09 Geoffrey Garen <ggaren@apple.com>
  14762. Unreviewed, rolling back in part2 of r118646.
  14763. This patch removes eager finalization.
  14764. Weak pointer finalization should be lazy
  14765. https://bugs.webkit.org/show_bug.cgi?id=87599
  14766. Reviewed by Sam Weinig.
  14767. * heap/Heap.cpp:
  14768. (JSC::Heap::collect): Don't finalize eagerly -- we'll do it lazily.
  14769. * heap/MarkedBlock.cpp:
  14770. (JSC::MarkedBlock::sweep): Do sweep weak sets when sweeping a block,
  14771. since we won't get another chance.
  14772. * heap/MarkedBlock.h:
  14773. (JSC::MarkedBlock::sweepWeakSet):
  14774. * heap/MarkedSpace.cpp:
  14775. (MarkedSpace::WeakSetSweep):
  14776. * heap/MarkedSpace.h:
  14777. (JSC::MarkedSpace::sweepWeakSets): Removed now-unused code.
  14778. 2012-06-09 Sukolsak Sakshuwong <sukolsak@google.com>
  14779. Add UNDO_MANAGER flag
  14780. https://bugs.webkit.org/show_bug.cgi?id=87908
  14781. Reviewed by Tony Chang.
  14782. * Configurations/FeatureDefines.xcconfig:
  14783. 2012-06-08 Geoffrey Garen <ggaren@apple.com>
  14784. Unreviewed, rolling back in part1 of r118646.
  14785. This patch includes everything necessary for lazy finalization, but
  14786. keeps eager finalization enabled for the time being.
  14787. Weak pointer finalization should be lazy
  14788. https://bugs.webkit.org/show_bug.cgi?id=87599
  14789. Reviewed by Sam Weinig.
  14790. * heap/MarkedBlock.cpp:
  14791. * heap/MarkedBlock.h:
  14792. (JSC::MarkedBlock::resetAllocator):
  14793. * heap/MarkedSpace.cpp:
  14794. (JSC::MarkedSpace::resetAllocators):
  14795. * heap/MarkedSpace.h:
  14796. (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
  14797. It will happen automatically when a weak set is swept. It's simpler to
  14798. have only one canonical way for this to happen, and it wasn't buying
  14799. us anything to do it eagerly.
  14800. * heap/WeakBlock.cpp:
  14801. (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
  14802. the sweep would be a no-op. If even one finalizer is pending, we need to
  14803. run it, since we won't get another chance.
  14804. * heap/WeakSet.cpp:
  14805. (JSC::WeakSet::sweep): This loop can be simpler now that
  14806. WeakBlock::sweep() does what we mean.
  14807. Reset our allocator after a sweep because this is the optimal time to
  14808. start trying to recycle old weak pointers.
  14809. (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
  14810. allocator because we've swept already, and forcing a new sweep would be
  14811. wasteful.
  14812. * heap/WeakSet.h:
  14813. (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
  14814. because the shrink may have removed the block the allocator was going to
  14815. allocate out of.
  14816. 2012-06-08 Gavin Barraclough <barraclough@apple.com>
  14817. Unreviewed roll out r119795.
  14818. This broke jquery/core.html
  14819. * dfg/DFGSpeculativeJIT.h:
  14820. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  14821. * jit/JITInlineMethods.h:
  14822. (JSC::JIT::emitAllocateBasicJSObject):
  14823. * llint/LowLevelInterpreter.asm:
  14824. * runtime/JSGlobalData.h:
  14825. (JSGlobalData):
  14826. * runtime/JSGlobalThis.cpp:
  14827. (JSC::JSGlobalThis::setUnwrappedObject):
  14828. * runtime/JSObject.cpp:
  14829. (JSC::JSObject::visitChildren):
  14830. (JSC::JSObject::createInheritorID):
  14831. * runtime/JSObject.h:
  14832. (JSObject):
  14833. (JSC::JSObject::resetInheritorID):
  14834. (JSC):
  14835. (JSC::JSObject::offsetOfInheritorID):
  14836. (JSC::JSObject::inheritorID):
  14837. 2012-06-08 Filip Pizlo <fpizlo@apple.com>
  14838. PredictedType should be called SpeculatedType
  14839. https://bugs.webkit.org/show_bug.cgi?id=88477
  14840. Unreviewed, fix a renaming goof from http://trac.webkit.org/changeset/119660.
  14841. I accidentally renamed ByteCodeParser::getPrediction to
  14842. ByteCodeParser::getSpeculation. That was not the intent. This changes it
  14843. back.
  14844. * dfg/DFGByteCodeParser.cpp:
  14845. (JSC::DFG::ByteCodeParser::addCall):
  14846. (JSC::DFG::ByteCodeParser::getPredictionWithoutOSRExit):
  14847. (JSC::DFG::ByteCodeParser::getPrediction):
  14848. (JSC::DFG::ByteCodeParser::handleCall):
  14849. (JSC::DFG::ByteCodeParser::parseBlock):
  14850. 2012-06-08 Andy Wingo <wingo@igalia.com>
  14851. Explictly mark stubs called by JIT as being internal
  14852. https://bugs.webkit.org/show_bug.cgi?id=88552
  14853. Reviewed by Filip Pizlo.
  14854. * dfg/DFGOSRExitCompiler.h:
  14855. * dfg/DFGOperations.cpp:
  14856. * dfg/DFGOperations.h:
  14857. * jit/HostCallReturnValue.h:
  14858. * jit/JITStubs.cpp:
  14859. * jit/JITStubs.h:
  14860. * jit/ThunkGenerators.cpp:
  14861. * llint/LLIntSlowPaths.h: Mark a bunch of stubs as being
  14862. WTF_INTERNAL. Change most calls to SYMBOL_STRING_RELOCATION to
  14863. LOCAL_REFERENCE, or GLOBAL_REFERENCE in the case of the wrappers
  14864. to truly global symbols.
  14865. * offlineasm/asm.rb: Generate LOCAL_REFERENCE instead of
  14866. SYMBOL_STRING_RELOCATION.
  14867. 2012-06-08 Geoffrey Garen <ggaren@apple.com>
  14868. Don't rely on weak pointers for eager CodeBlock finalization
  14869. https://bugs.webkit.org/show_bug.cgi?id=88465
  14870. Reviewed by Gavin Barraclough.
  14871. This is incompatible with lazy weak pointer finalization.
  14872. I considered just making CodeBlock finalization lazy-friendly, but it
  14873. turns out that the heap is already way up in CodeBlock's business when
  14874. it comes to finalization, so I decided to finish the job and move full
  14875. responsibility for CodeBlock finalization into the heap.
  14876. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Maybe this
  14877. will build.
  14878. * debugger/Debugger.cpp: Updated for rename.
  14879. * heap/Heap.cpp:
  14880. (JSC::Heap::deleteAllCompiledCode): Renamed for consistency. Fixed a bug
  14881. where we would not delete code for a code block that had been previously
  14882. jettisoned. I don't know if this happens in practice -- I mostly did
  14883. this to improve consistency with deleteUnmarkedCompiledCode.
  14884. (JSC::Heap::deleteUnmarkedCompiledCode): New function, responsible for
  14885. eager finalization of unmarked code blocks.
  14886. (JSC::Heap::collect): Updated for rename. Updated to call
  14887. deleteUnmarkedCompiledCode(), which takes care of jettisoned DFG code
  14888. blocks too.
  14889. (JSC::Heap::addCompiledCode): Renamed, since this points to all code
  14890. now, not just functions.
  14891. * heap/Heap.h:
  14892. (Heap): Keep track of all user code, not just functions. This is a
  14893. negligible additional overhead, since most code is function code.
  14894. * runtime/Executable.cpp:
  14895. (JSC::*::finalize): Removed these functions, since we don't rely on
  14896. weak pointer finalization anymore.
  14897. (JSC::FunctionExecutable::FunctionExecutable): Moved linked-list stuff
  14898. into base class so all executables can be in the list.
  14899. (JSC::EvalExecutable::clearCode):
  14900. (JSC::ProgramExecutable::clearCode):
  14901. (JSC::FunctionExecutable::clearCode): All we need to do is delete our
  14902. CodeBlock -- that will delete all of its internal data structures.
  14903. (JSC::FunctionExecutable::clearCodeIfNotCompiling): Factored out a helper
  14904. function to improve clarity.
  14905. * runtime/Executable.h:
  14906. (JSC::ExecutableBase): Moved linked-list stuff
  14907. into base class so all executables can be in the list.
  14908. (JSC::NativeExecutable::create):
  14909. (NativeExecutable):
  14910. (ScriptExecutable):
  14911. (JSC::ScriptExecutable::finishCreation):
  14912. (JSC::EvalExecutable::create):
  14913. (EvalExecutable):
  14914. (JSC::ProgramExecutable::create):
  14915. (ProgramExecutable):
  14916. (FunctionExecutable):
  14917. (JSC::FunctionExecutable::create): Don't use a finalizer -- the heap
  14918. will call us back to destroy our code block.
  14919. (JSC::FunctionExecutable::discardCode): Renamed to clearCodeIfNotCompiling()
  14920. for clarity.
  14921. (JSC::FunctionExecutable::isCompiling): New helper function, for clarity.
  14922. (JSC::ScriptExecutable::clearCodeVirtual): New helper function, since
  14923. the heap needs to make polymorphic calls to clear code.
  14924. * runtime/JSGlobalData.cpp:
  14925. (JSC::StackPreservingRecompiler::operator()):
  14926. * runtime/JSGlobalObject.cpp:
  14927. (JSC::DynamicGlobalObjectScope::DynamicGlobalObjectScope): Updated for
  14928. renames.
  14929. 2012-06-07 Filip Pizlo <fpizlo@apple.com>
  14930. DFG should inline prototype chain accesses, and do the right things if the
  14931. specific function optimization is available
  14932. https://bugs.webkit.org/show_bug.cgi?id=88594
  14933. Reviewed by Gavin Barraclough.
  14934. Looks like a 3% win on V8.
  14935. * bytecode/CodeBlock.h:
  14936. (JSC::Structure::prototypeForLookup):
  14937. (JSC):
  14938. * bytecode/GetByIdStatus.cpp:
  14939. (JSC::GetByIdStatus::computeFromLLInt):
  14940. (JSC):
  14941. (JSC::GetByIdStatus::computeForChain):
  14942. (JSC::GetByIdStatus::computeFor):
  14943. * bytecode/GetByIdStatus.h:
  14944. (JSC::GetByIdStatus::GetByIdStatus):
  14945. (JSC::GetByIdStatus::isSimple):
  14946. (JSC::GetByIdStatus::chain):
  14947. (JSC::GetByIdStatus::specificValue):
  14948. (GetByIdStatus):
  14949. * bytecode/StructureSet.h:
  14950. (StructureSet):
  14951. (JSC::StructureSet::singletonStructure):
  14952. * bytecode/StructureStubInfo.h:
  14953. (JSC::StructureStubInfo::initGetByIdProto):
  14954. (JSC::StructureStubInfo::initGetByIdChain):
  14955. * dfg/DFGByteCodeParser.cpp:
  14956. (JSC::DFG::ByteCodeParser::handleGetById):
  14957. * dfg/DFGRepatch.cpp:
  14958. (JSC::DFG::tryCacheGetByID):
  14959. * jit/JITStubs.cpp:
  14960. (JSC::JITThunks::tryCacheGetByID):
  14961. * runtime/JSGlobalObject.h:
  14962. (JSC::Structure::prototypeForLookup):
  14963. (JSC):
  14964. * runtime/Structure.h:
  14965. (Structure):
  14966. 2012-06-07 Gavin Barraclough <barraclough@apple.com>
  14967. Remove JSObject::m_inheritorID
  14968. https://bugs.webkit.org/show_bug.cgi?id=88378
  14969. Reviewed by Geoff Garen.
  14970. This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
  14971. and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
  14972. Instead use a private named value in the object's property storage.
  14973. * dfg/DFGSpeculativeJIT.h:
  14974. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  14975. - No need m_inheritorID to initialize!
  14976. * jit/JITInlineMethods.h:
  14977. (JSC::JIT::emitAllocateBasicJSObject):
  14978. - No need m_inheritorID to initialize!
  14979. * llint/LowLevelInterpreter.asm:
  14980. - No need m_inheritorID to initialize!
  14981. * runtime/JSGlobalData.h:
  14982. (JSGlobalData):
  14983. - Added private name 'm_inheritorIDKey'.
  14984. * runtime/JSGlobalThis.cpp:
  14985. (JSC::JSGlobalThis::setUnwrappedObject):
  14986. - resetInheritorID is now passed a JSGlobalData&.
  14987. * runtime/JSObject.cpp:
  14988. (JSC::JSObject::visitChildren):
  14989. - No m_inheritorID to be marked.
  14990. (JSC::JSObject::createInheritorID):
  14991. - Store the newly created inheritorID in the property map.
  14992. * runtime/JSObject.h:
  14993. (JSC::JSObject::resetInheritorID):
  14994. - Remove the inheritorID from property storage.
  14995. (JSC::JSObject::inheritorID):
  14996. - Read the inheritorID from property storage.
  14997. 2012-06-07 Gavin Barraclough <barraclough@apple.com>
  14998. Math.pow on iOS does not support denormal numbers.
  14999. https://bugs.webkit.org/show_bug.cgi?id=88592
  15000. Reviewed by Filip Pizlo.
  15001. Import an implementation from fdlibm, detect cases where it is safe to use the system
  15002. implementation & where we should fall back to fdlibm.
  15003. * runtime/MathObject.cpp:
  15004. (JSC::isDenormal):
  15005. (JSC::isEdgeCase):
  15006. (JSC::mathPow):
  15007. - On iOS, detect cases where denormal support may be required & use fdlibm in these cases.
  15008. (JSC::mathProtoFuncPow):
  15009. - Changed to use mathPow.
  15010. (JSC::fdlibmScalbn):
  15011. (JSC::fdlibmPow):
  15012. - These functions imported from fdlibm; original style retained to ease future merging.
  15013. 2012-06-07 Patrick Gansterer <paroga@webkit.org>
  15014. Unreviewed. Build fix for !ENABLE(JIT) after r119441.
  15015. * interpreter/Interpreter.cpp:
  15016. (JSC::Interpreter::privateExecute):
  15017. 2012-06-07 Andy Wingo <wingo@igalia.com>
  15018. Unreviewed build fix after r119593.
  15019. * llint/LLIntOfflineAsmConfig.h (OFFLINE_ASM_GLOBAL_LABEL): Fix
  15020. uses of "name" to be "label", the macro's parameter. Otherwise we
  15021. serialize mentions of the literal symbol "name" into the objcode.
  15022. Causes a build error using GNU ld (not gold).
  15023. 2012-06-06 Ryosuke Niwa <rniwa@webkit.org>
  15024. Chromium build fix attempt. Why do we need to list these files in gyp!?
  15025. * JavaScriptCore.gypi:
  15026. 2012-06-06 Filip Pizlo <fpizlo@apple.com>
  15027. PredictedType should be called SpeculatedType
  15028. https://bugs.webkit.org/show_bug.cgi?id=88477
  15029. Rubber stamped by Gavin Barraclough.
  15030. * CMakeLists.txt:
  15031. * GNUmakefile.list.am:
  15032. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  15033. * JavaScriptCore.xcodeproj/project.pbxproj:
  15034. * Target.pri:
  15035. * bytecode/CodeBlock.cpp:
  15036. (JSC::CodeBlock::shouldOptimizeNow):
  15037. (JSC::CodeBlock::dumpValueProfiles):
  15038. * bytecode/CodeBlock.h:
  15039. (JSC::CodeBlock::valueProfilePredictionForBytecodeOffset):
  15040. * bytecode/LazyOperandValueProfile.cpp:
  15041. (JSC::LazyOperandValueProfileParser::prediction):
  15042. * bytecode/LazyOperandValueProfile.h:
  15043. (LazyOperandValueProfileParser):
  15044. * bytecode/PredictedType.cpp: Removed.
  15045. * bytecode/PredictedType.h: Removed.
  15046. * bytecode/SpeculatedType.cpp: Copied from Source/JavaScriptCore/bytecode/PredictedType.cpp.
  15047. (JSC::speculationToString):
  15048. (JSC::speculationToAbbreviatedString):
  15049. (JSC::speculationFromClassInfo):
  15050. (JSC::speculationFromStructure):
  15051. (JSC::speculationFromCell):
  15052. (JSC::speculationFromValue):
  15053. * bytecode/SpeculatedType.h: Copied from Source/JavaScriptCore/bytecode/PredictedType.h.
  15054. (JSC):
  15055. (JSC::isAnySpeculation):
  15056. (JSC::isCellSpeculation):
  15057. (JSC::isObjectSpeculation):
  15058. (JSC::isFinalObjectSpeculation):
  15059. (JSC::isFinalObjectOrOtherSpeculation):
  15060. (JSC::isFixedIndexedStorageObjectSpeculation):
  15061. (JSC::isStringSpeculation):
  15062. (JSC::isArraySpeculation):
  15063. (JSC::isFunctionSpeculation):
  15064. (JSC::isInt8ArraySpeculation):
  15065. (JSC::isInt16ArraySpeculation):
  15066. (JSC::isInt32ArraySpeculation):
  15067. (JSC::isUint8ArraySpeculation):
  15068. (JSC::isUint8ClampedArraySpeculation):
  15069. (JSC::isUint16ArraySpeculation):
  15070. (JSC::isUint32ArraySpeculation):
  15071. (JSC::isFloat32ArraySpeculation):
  15072. (JSC::isFloat64ArraySpeculation):
  15073. (JSC::isArgumentsSpeculation):
  15074. (JSC::isActionableIntMutableArraySpeculation):
  15075. (JSC::isActionableFloatMutableArraySpeculation):
  15076. (JSC::isActionableTypedMutableArraySpeculation):
  15077. (JSC::isActionableMutableArraySpeculation):
  15078. (JSC::isActionableArraySpeculation):
  15079. (JSC::isArrayOrOtherSpeculation):
  15080. (JSC::isMyArgumentsSpeculation):
  15081. (JSC::isInt32Speculation):
  15082. (JSC::isDoubleRealSpeculation):
  15083. (JSC::isDoubleSpeculation):
  15084. (JSC::isNumberSpeculation):
  15085. (JSC::isBooleanSpeculation):
  15086. (JSC::isOtherSpeculation):
  15087. (JSC::isEmptySpeculation):
  15088. (JSC::mergeSpeculations):
  15089. (JSC::mergeSpeculation):
  15090. * bytecode/StructureSet.h:
  15091. (JSC::StructureSet::speculationFromStructures):
  15092. * bytecode/ValueProfile.h:
  15093. (JSC::ValueProfileBase::ValueProfileBase):
  15094. (JSC::ValueProfileBase::dump):
  15095. (JSC::ValueProfileBase::computeUpdatedPrediction):
  15096. (ValueProfileBase):
  15097. * dfg/DFGAbstractState.cpp:
  15098. (JSC::DFG::AbstractState::initialize):
  15099. (JSC::DFG::AbstractState::execute):
  15100. (JSC::DFG::AbstractState::mergeStateAtTail):
  15101. * dfg/DFGAbstractState.h:
  15102. (JSC::DFG::AbstractState::speculateInt32Unary):
  15103. (JSC::DFG::AbstractState::speculateNumberUnary):
  15104. (JSC::DFG::AbstractState::speculateBooleanUnary):
  15105. (JSC::DFG::AbstractState::speculateInt32Binary):
  15106. (JSC::DFG::AbstractState::speculateNumberBinary):
  15107. * dfg/DFGAbstractValue.h:
  15108. (JSC::DFG::StructureAbstractValue::filter):
  15109. (JSC::DFG::StructureAbstractValue::speculationFromStructures):
  15110. (JSC::DFG::AbstractValue::AbstractValue):
  15111. (JSC::DFG::AbstractValue::clear):
  15112. (JSC::DFG::AbstractValue::isClear):
  15113. (JSC::DFG::AbstractValue::makeTop):
  15114. (JSC::DFG::AbstractValue::clobberStructures):
  15115. (JSC::DFG::AbstractValue::isTop):
  15116. (JSC::DFG::AbstractValue::set):
  15117. (JSC::DFG::AbstractValue::merge):
  15118. (JSC::DFG::AbstractValue::filter):
  15119. (JSC::DFG::AbstractValue::validateIgnoringValue):
  15120. (JSC::DFG::AbstractValue::validate):
  15121. (JSC::DFG::AbstractValue::checkConsistency):
  15122. (JSC::DFG::AbstractValue::dump):
  15123. (AbstractValue):
  15124. * dfg/DFGArgumentPosition.h:
  15125. (JSC::DFG::ArgumentPosition::ArgumentPosition):
  15126. (JSC::DFG::ArgumentPosition::mergeArgumentAwareness):
  15127. (JSC::DFG::ArgumentPosition::prediction):
  15128. (ArgumentPosition):
  15129. * dfg/DFGArgumentsSimplificationPhase.cpp:
  15130. (JSC::DFG::ArgumentsSimplificationPhase::run):
  15131. * dfg/DFGByteCodeParser.cpp:
  15132. (ByteCodeParser):
  15133. (JSC::DFG::ByteCodeParser::injectLazyOperandSpeculation):
  15134. (JSC::DFG::ByteCodeParser::getLocal):
  15135. (JSC::DFG::ByteCodeParser::getArgument):
  15136. (JSC::DFG::ByteCodeParser::addCall):
  15137. (JSC::DFG::ByteCodeParser::getSpeculationWithoutOSRExit):
  15138. (JSC::DFG::ByteCodeParser::getSpeculation):
  15139. (InlineStackEntry):
  15140. (JSC::DFG::ByteCodeParser::handleCall):
  15141. (JSC::DFG::ByteCodeParser::handleIntrinsic):
  15142. (JSC::DFG::ByteCodeParser::handleGetById):
  15143. (JSC::DFG::ByteCodeParser::parseBlock):
  15144. (JSC::DFG::ByteCodeParser::fixVariableAccessSpeculations):
  15145. (JSC::DFG::ByteCodeParser::parse):
  15146. * dfg/DFGCSEPhase.cpp:
  15147. (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
  15148. (JSC::DFG::CSEPhase::performNodeCSE):
  15149. * dfg/DFGConstantFoldingPhase.cpp:
  15150. (JSC::DFG::ConstantFoldingPhase::run):
  15151. * dfg/DFGFixupPhase.cpp:
  15152. (JSC::DFG::FixupPhase::fixupNode):
  15153. (JSC::DFG::FixupPhase::fixDoubleEdge):
  15154. * dfg/DFGGraph.cpp:
  15155. (JSC::DFG::Graph::nameOfVariableAccessData):
  15156. (JSC::DFG::Graph::dump):
  15157. (JSC::DFG::Graph::predictArgumentTypes):
  15158. * dfg/DFGGraph.h:
  15159. (JSC::DFG::Graph::getJSConstantSpeculation):
  15160. (JSC::DFG::Graph::isPredictedNumerical):
  15161. (JSC::DFG::Graph::byValIsPure):
  15162. * dfg/DFGJITCompiler.h:
  15163. (JSC::DFG::JITCompiler::getSpeculation):
  15164. * dfg/DFGNode.h:
  15165. (JSC::DFG::Node::Node):
  15166. (JSC::DFG::Node::getHeapPrediction):
  15167. (JSC::DFG::Node::predictHeap):
  15168. (JSC::DFG::Node::prediction):
  15169. (JSC::DFG::Node::predict):
  15170. (JSC::DFG::Node::shouldSpeculateInteger):
  15171. (JSC::DFG::Node::shouldSpeculateDouble):
  15172. (JSC::DFG::Node::shouldSpeculateNumber):
  15173. (JSC::DFG::Node::shouldSpeculateBoolean):
  15174. (JSC::DFG::Node::shouldSpeculateFinalObject):
  15175. (JSC::DFG::Node::shouldSpeculateFinalObjectOrOther):
  15176. (JSC::DFG::Node::shouldSpeculateArray):
  15177. (JSC::DFG::Node::shouldSpeculateArguments):
  15178. (JSC::DFG::Node::shouldSpeculateInt8Array):
  15179. (JSC::DFG::Node::shouldSpeculateInt16Array):
  15180. (JSC::DFG::Node::shouldSpeculateInt32Array):
  15181. (JSC::DFG::Node::shouldSpeculateUint8Array):
  15182. (JSC::DFG::Node::shouldSpeculateUint8ClampedArray):
  15183. (JSC::DFG::Node::shouldSpeculateUint16Array):
  15184. (JSC::DFG::Node::shouldSpeculateUint32Array):
  15185. (JSC::DFG::Node::shouldSpeculateFloat32Array):
  15186. (JSC::DFG::Node::shouldSpeculateFloat64Array):
  15187. (JSC::DFG::Node::shouldSpeculateArrayOrOther):
  15188. (JSC::DFG::Node::shouldSpeculateObject):
  15189. (JSC::DFG::Node::shouldSpeculateCell):
  15190. (Node):
  15191. * dfg/DFGPredictionPropagationPhase.cpp:
  15192. (JSC::DFG::PredictionPropagationPhase::setPrediction):
  15193. (JSC::DFG::PredictionPropagationPhase::mergePrediction):
  15194. (JSC::DFG::PredictionPropagationPhase::propagate):
  15195. (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
  15196. * dfg/DFGSpeculativeJIT.cpp:
  15197. (JSC::DFG::SpeculativeJIT::fillStorage):
  15198. (JSC::DFG::SpeculativeJIT::writeBarrier):
  15199. (JSC::DFG::GPRTemporary::GPRTemporary):
  15200. (JSC::DFG::FPRTemporary::FPRTemporary):
  15201. (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
  15202. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
  15203. (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
  15204. (JSC::DFG::SpeculativeJIT::compile):
  15205. (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
  15206. (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
  15207. (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
  15208. (JSC::DFG::SpeculativeJIT::compileValueToInt32):
  15209. (JSC::DFG::SpeculativeJIT::compileDoubleAsInt32):
  15210. (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
  15211. (JSC::DFG::SpeculativeJIT::compileGetTypedArrayLength):
  15212. (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
  15213. (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
  15214. (JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
  15215. (JSC::DFG::SpeculativeJIT::compilePutByValForFloatTypedArray):
  15216. (JSC::DFG::SpeculativeJIT::compileInstanceOf):
  15217. (JSC::DFG::SpeculativeJIT::compileAdd):
  15218. (JSC::DFG::SpeculativeJIT::compileArithSub):
  15219. (JSC::DFG::SpeculativeJIT::compileArithNegate):
  15220. (JSC::DFG::SpeculativeJIT::compileArithMul):
  15221. (JSC::DFG::SpeculativeJIT::compileArithMod):
  15222. (JSC::DFG::SpeculativeJIT::compare):
  15223. (JSC::DFG::SpeculativeJIT::compileStrictEq):
  15224. (JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
  15225. (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
  15226. (JSC::DFG::SpeculativeJIT::compileGetArgumentsLength):
  15227. (JSC::DFG::SpeculativeJIT::compileRegExpExec):
  15228. * dfg/DFGSpeculativeJIT.h:
  15229. (DFG):
  15230. (JSC::DFG::ValueSource::forSpeculation):
  15231. (SpeculativeJIT):
  15232. (GPRTemporary):
  15233. (FPRTemporary):
  15234. (JSC::DFG::SpecDoubleOperand::SpecDoubleOperand):
  15235. (JSC::DFG::SpecDoubleOperand::~SpecDoubleOperand):
  15236. (JSC::DFG::SpecDoubleOperand::fpr):
  15237. (JSC::DFG::SpecCellOperand::SpecCellOperand):
  15238. (JSC::DFG::SpecCellOperand::~SpecCellOperand):
  15239. (JSC::DFG::SpecCellOperand::gpr):
  15240. (JSC::DFG::SpecBooleanOperand::SpecBooleanOperand):
  15241. (JSC::DFG::SpecBooleanOperand::~SpecBooleanOperand):
  15242. (JSC::DFG::SpecBooleanOperand::gpr):
  15243. * dfg/DFGSpeculativeJIT32_64.cpp:
  15244. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  15245. (JSC::DFG::SpeculativeJIT::fillSpecDouble):
  15246. (JSC::DFG::SpeculativeJIT::fillSpecCell):
  15247. (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
  15248. (JSC::DFG::SpeculativeJIT::compileObjectEquality):
  15249. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  15250. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  15251. (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
  15252. (JSC::DFG::SpeculativeJIT::compileLogicalNot):
  15253. (JSC::DFG::SpeculativeJIT::emitBranch):
  15254. (JSC::DFG::SpeculativeJIT::compile):
  15255. * dfg/DFGSpeculativeJIT64.cpp:
  15256. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  15257. (JSC::DFG::SpeculativeJIT::fillSpecDouble):
  15258. (JSC::DFG::SpeculativeJIT::fillSpecCell):
  15259. (JSC::DFG::SpeculativeJIT::fillSpecBoolean):
  15260. (JSC::DFG::SpeculativeJIT::compileObjectEquality):
  15261. (JSC::DFG::SpeculativeJIT::compileObjectToObjectOrOtherEquality):
  15262. (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectToObjectOrOtherEquality):
  15263. (JSC::DFG::SpeculativeJIT::compileDoubleCompare):
  15264. (JSC::DFG::SpeculativeJIT::compileLogicalNot):
  15265. (JSC::DFG::SpeculativeJIT::emitBranch):
  15266. (JSC::DFG::SpeculativeJIT::compile):
  15267. * dfg/DFGVariableAccessData.h:
  15268. (JSC::DFG::VariableAccessData::VariableAccessData):
  15269. (JSC::DFG::VariableAccessData::predict):
  15270. (JSC::DFG::VariableAccessData::nonUnifiedPrediction):
  15271. (JSC::DFG::VariableAccessData::prediction):
  15272. (JSC::DFG::VariableAccessData::argumentAwarePrediction):
  15273. (JSC::DFG::VariableAccessData::mergeArgumentAwarePrediction):
  15274. (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
  15275. (JSC::DFG::VariableAccessData::makePredictionForDoubleFormat):
  15276. (VariableAccessData):
  15277. 2012-06-06 Filip Pizlo <fpizlo@apple.com>
  15278. Global object variable accesses should not require an extra load
  15279. https://bugs.webkit.org/show_bug.cgi?id=88385
  15280. Reviewed by Gavin Barraclough and Geoffrey Garen.
  15281. Previously, if you wanted to access a global variable, you'd first have
  15282. to load the register array from the appropriate global object and then
  15283. either load or store at an offset to the register array. This is because
  15284. JSGlobalObject inherited from JSVariableObject, and JSVariableObject is
  15285. designed with the pessimistic assumption that its register array may
  15286. point into the call stack. This is never the case for global objects.
  15287. Hence, even though the global object may add more registers at any time,
  15288. it does not need to store them in a contiguous array. It can use a
  15289. SegmentedVector or similar.
  15290. This patch refactors global objects and variable objects as follows:
  15291. - The functionality to track variables in an indexable array using a
  15292. SymbolTable to map names to indices is moved into JSSymbolTableObject,
  15293. which is now a supertype of JSVariableObject. JSVariableObject is now
  15294. just a holder for a registers array and implements the registerAt()
  15295. method that is left abstract in JSSymbolTableObject. Because all users
  15296. of JSVariableObject know whether they are a JSStaticScopeObject,
  15297. JSActivation, or JSGlobalObject, this "abstract" method is not virtual;
  15298. instead the utility methods that would call registerAt() are now
  15299. template functions that require you to know statically what subtype of
  15300. JSSymbolTableObject you're using (JSVariableObject or something else),
  15301. so that registerAt() can be statically bound.
  15302. - A new class is added called JSSegmentedVariableObject, which only
  15303. differs from JSVariableObject in how it allocates registers. It uses a
  15304. SegmentedVector instead of manually managing a pointer to a contiguous
  15305. slab of registers. This changes the interface somewhat; for example
  15306. with JSVariableObject if you wanted to add a register you had to do
  15307. it yourself since the JSVariableObject didn't know how the registers
  15308. array ought to be allocated. With JSSegmentedVariableObject you can
  15309. just call addRegisters(). JSSegmentedVariableObject preserves the
  15310. invariant that once you get a pointer into a register, that pointer
  15311. will continue to be valid so long as the JSSegmentedVariableObject is
  15312. alive. This allows the JITs and interpreters to skip the extra load.
  15313. - JSGlobalObject now inherits from JSSegmentedVariableObject. For now
  15314. (and possibly forever) it is the only subtype of this new class.
  15315. - The bytecode format is changed so that get_global_var and
  15316. put_global_var have a pointer to the register directly rather than
  15317. having an index. A convenience method is provided in
  15318. JSSegmentedVariableObject to get the index given a a pointer, which is
  15319. used for assertions and debug dumps.
  15320. This appears to be a 1% across the board win.
  15321. * CMakeLists.txt:
  15322. * GNUmakefile.list.am:
  15323. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  15324. * JavaScriptCore.xcodeproj/project.pbxproj:
  15325. * Target.pri:
  15326. * bytecode/CodeBlock.cpp:
  15327. (JSC::CodeBlock::dump):
  15328. * bytecode/Instruction.h:
  15329. (Instruction):
  15330. (JSC::Instruction::Instruction):
  15331. * bytecompiler/BytecodeGenerator.cpp:
  15332. (JSC::ResolveResult::registerPointer):
  15333. (JSC):
  15334. (JSC::BytecodeGenerator::BytecodeGenerator):
  15335. (JSC::BytecodeGenerator::retrieveLastUnaryOp):
  15336. (JSC::BytecodeGenerator::resolve):
  15337. (JSC::BytecodeGenerator::resolveConstDecl):
  15338. (JSC::BytecodeGenerator::emitGetStaticVar):
  15339. (JSC::BytecodeGenerator::emitPutStaticVar):
  15340. * bytecompiler/BytecodeGenerator.h:
  15341. (ResolveResult):
  15342. (BytecodeGenerator):
  15343. * dfg/DFGAssemblyHelpers.h:
  15344. (AssemblyHelpers):
  15345. * dfg/DFGByteCodeParser.cpp:
  15346. (JSC::DFG::ByteCodeParser::parseBlock):
  15347. * dfg/DFGCSEPhase.cpp:
  15348. (JSC::DFG::CSEPhase::globalVarLoadElimination):
  15349. (JSC::DFG::CSEPhase::globalVarStoreElimination):
  15350. (JSC::DFG::CSEPhase::performNodeCSE):
  15351. * dfg/DFGGraph.cpp:
  15352. (JSC::DFG::Graph::dump):
  15353. * dfg/DFGGraph.h:
  15354. (JSC::DFG::Graph::globalObjectFor):
  15355. (Graph):
  15356. * dfg/DFGNode.h:
  15357. (JSC::DFG::Node::hasVarNumber):
  15358. (Node):
  15359. (JSC::DFG::Node::hasRegisterPointer):
  15360. (JSC::DFG::Node::registerPointer):
  15361. * dfg/DFGSpeculativeJIT32_64.cpp:
  15362. (JSC::DFG::SpeculativeJIT::compile):
  15363. * dfg/DFGSpeculativeJIT64.cpp:
  15364. (JSC::DFG::SpeculativeJIT::compile):
  15365. * heap/Heap.h:
  15366. (Heap):
  15367. (JSC::Heap::isWriteBarrierEnabled):
  15368. (JSC):
  15369. * interpreter/Interpreter.cpp:
  15370. (JSC::Interpreter::execute):
  15371. (JSC::Interpreter::privateExecute):
  15372. * jit/JITPropertyAccess.cpp:
  15373. (JSC::JIT::emit_op_get_global_var):
  15374. (JSC::JIT::emit_op_put_global_var):
  15375. * jit/JITPropertyAccess32_64.cpp:
  15376. (JSC::JIT::emit_op_get_global_var):
  15377. (JSC::JIT::emit_op_put_global_var):
  15378. * llint/LowLevelInterpreter32_64.asm:
  15379. * llint/LowLevelInterpreter64.asm:
  15380. * runtime/JSGlobalObject.cpp:
  15381. (JSC):
  15382. (JSC::JSGlobalObject::put):
  15383. (JSC::JSGlobalObject::putDirectVirtual):
  15384. (JSC::JSGlobalObject::defineOwnProperty):
  15385. (JSC::JSGlobalObject::visitChildren):
  15386. (JSC::JSGlobalObject::addStaticGlobals):
  15387. (JSC::JSGlobalObject::getOwnPropertySlot):
  15388. (JSC::JSGlobalObject::getOwnPropertyDescriptor):
  15389. * runtime/JSGlobalObject.h:
  15390. (JSGlobalObject):
  15391. (JSC::JSGlobalObject::JSGlobalObject):
  15392. (JSC):
  15393. (JSC::JSGlobalObject::hasOwnPropertyForWrite):
  15394. * runtime/JSSegmentedVariableObject.cpp: Added.
  15395. (JSC):
  15396. (JSC::JSSegmentedVariableObject::findRegisterIndex):
  15397. (JSC::JSSegmentedVariableObject::addRegisters):
  15398. (JSC::JSSegmentedVariableObject::visitChildren):
  15399. * runtime/JSSegmentedVariableObject.h: Added.
  15400. (JSC):
  15401. (JSSegmentedVariableObject):
  15402. (JSC::JSSegmentedVariableObject::registerAt):
  15403. (JSC::JSSegmentedVariableObject::assertRegisterIsInThisObject):
  15404. (JSC::JSSegmentedVariableObject::JSSegmentedVariableObject):
  15405. (JSC::JSSegmentedVariableObject::finishCreation):
  15406. * runtime/JSStaticScopeObject.cpp:
  15407. (JSC::JSStaticScopeObject::put):
  15408. (JSC::JSStaticScopeObject::putDirectVirtual):
  15409. (JSC::JSStaticScopeObject::getOwnPropertySlot):
  15410. * runtime/JSSymbolTableObject.cpp: Added.
  15411. (JSC):
  15412. (JSC::JSSymbolTableObject::destroy):
  15413. (JSC::JSSymbolTableObject::deleteProperty):
  15414. (JSC::JSSymbolTableObject::getOwnPropertyNames):
  15415. (JSC::JSSymbolTableObject::putDirectVirtual):
  15416. (JSC::JSSymbolTableObject::isDynamicScope):
  15417. * runtime/JSSymbolTableObject.h: Added.
  15418. (JSC):
  15419. (JSSymbolTableObject):
  15420. (JSC::JSSymbolTableObject::symbolTable):
  15421. (JSC::JSSymbolTableObject::JSSymbolTableObject):
  15422. (JSC::JSSymbolTableObject::finishCreation):
  15423. (JSC::symbolTableGet):
  15424. (JSC::symbolTablePut):
  15425. (JSC::symbolTablePutWithAttributes):
  15426. * runtime/JSVariableObject.cpp:
  15427. (JSC):
  15428. * runtime/JSVariableObject.h:
  15429. (JSVariableObject):
  15430. (JSC::JSVariableObject::JSVariableObject):
  15431. (JSC::JSVariableObject::finishCreation):
  15432. (JSC):
  15433. * runtime/WriteBarrier.h:
  15434. 2012-06-06 Filip Pizlo <fpizlo@apple.com>
  15435. DFG arguments access slow path should not crash if the arguments haven't been created
  15436. https://bugs.webkit.org/show_bug.cgi?id=88471
  15437. Reviewed by Gavin Barraclough.
  15438. * dfg/DFGCCallHelpers.h:
  15439. (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
  15440. (CCallHelpers):
  15441. * dfg/DFGOperations.cpp:
  15442. * dfg/DFGOperations.h:
  15443. * dfg/DFGSpeculativeJIT.h:
  15444. (JSC::DFG::SpeculativeJIT::callOperation):
  15445. * dfg/DFGSpeculativeJIT32_64.cpp:
  15446. (JSC::DFG::SpeculativeJIT::compile):
  15447. * dfg/DFGSpeculativeJIT64.cpp:
  15448. (JSC::DFG::SpeculativeJIT::compile):
  15449. 2012-06-06 Michael Saboff <msaboff@apple.com>
  15450. ENH: Add Logging to GC Marking Phase
  15451. https://bugs.webkit.org/show_bug.cgi?id=88364
  15452. Reviewed by Filip Pizlo.
  15453. Log GC marking to stderr or a file. The logging in controlled
  15454. with the define ENABLE_OBJECT_MARK_LOGGING in wtf/Platform.h.
  15455. If DATA_LOG_TO_FILE in wtf/DataLog.cpp is set to 1, output is
  15456. logged to a file otherwise it is logged to stderr.
  15457. When logging is enabled, the GC is built single threaded since the
  15458. log output from the various threads isn't buffered and output in a
  15459. thread safe manner.
  15460. * heap/Heap.cpp:
  15461. (JSC::Heap::markRoots):
  15462. * heap/MarkStack.cpp:
  15463. (JSC::MarkStackThreadSharedData::resetChildren):
  15464. (JSC::MarkStackThreadSharedData::childVisitCount):
  15465. (JSC::MarkStackThreadSharedData::markingThreadMain):
  15466. (JSC::MarkStackThreadSharedData::markingThreadStartFunc):
  15467. (JSC::MarkStackThreadSharedData::MarkStackThreadSharedData):
  15468. (JSC::MarkStackThreadSharedData::reset):
  15469. * heap/MarkStack.h:
  15470. (MarkStackThreadSharedData):
  15471. (MarkStack):
  15472. (JSC::MarkStack::sharedData):
  15473. (JSC::MarkStack::resetChildCount):
  15474. (JSC::MarkStack::childCount):
  15475. (JSC::MarkStack::incrementChildCount):
  15476. * runtime/JSArray.cpp:
  15477. (JSC::JSArray::visitChildren):
  15478. * runtime/JSCell.cpp:
  15479. (JSC::JSCell::className):
  15480. * runtime/JSCell.h:
  15481. (JSCell):
  15482. (JSC::JSCell::visitChildren):
  15483. * runtime/JSString.cpp:
  15484. (JSC::JSString::visitChildren):
  15485. * runtime/JSString.h:
  15486. (JSString):
  15487. * runtime/Structure.h:
  15488. (JSC::MarkStack::internalAppend):
  15489. 2012-06-06 Gavin Barraclough <barraclough@apple.com>
  15490. Assigning to a static property should not change iteration order
  15491. https://bugs.webkit.org/show_bug.cgi?id=88401
  15492. Reviewed by Geoff Garen.
  15493. A specific iteration order is not defined by the spec, but test-262 somewhat tenuously
  15494. requires that it is at least stable, e.g. ch10/10.4/10.4.2/S10.4.2_A1.1_T1.js
  15495. Whilst it is not clear that this behavior really arises from the specification, it
  15496. would seem like common sense to conform to this.
  15497. The problem here is that we allow properties in the structure to shadow those in the
  15498. static table, and we iterate the properties in the structure first - which means that
  15499. as values of existing properties are modified, their iteration order changes too.
  15500. The easy fix is to iterate the properties from the static table first. This has a
  15501. further benefit, since it will mean that user added properties will come after those
  15502. present in the static table (respected the expected insertion-order).
  15503. * runtime/JSObject.cpp:
  15504. (JSC::JSObject::getOwnPropertyNames):
  15505. - Iterate static properties first.
  15506. 2012-06-06 Andy Wingo <wingo@igalia.com>
  15507. Ensure consistent order of evaluation in LLInt slow paths
  15508. https://bugs.webkit.org/show_bug.cgi?id=88409
  15509. Reviewed by Geoffrey Garen.
  15510. * llint/LLIntSlowPaths.cpp:
  15511. (slow_path_mul)
  15512. (slow_path_sub)
  15513. (slow_path_div)
  15514. (slow_path_mod)
  15515. (slow_path_lshift)
  15516. (slow_path_rshift)
  15517. (slow_path_urshift)
  15518. (slow_path_bitand)
  15519. (slow_path_bitor)
  15520. (slow_path_bitxor): Avoid calling toNumber, toInt32, or toUInt32
  15521. multiple times without intervening sequence points. Fixes
  15522. fast/js/exception-sequencing-binops.html with GCC 4.7 on x86-64
  15523. Linux, which reordered evaluation of the arguments to fmod.
  15524. 2012-06-06 Andy Wingo <wingo@igalia.com>
  15525. [GTK] Enable the LLInt
  15526. https://bugs.webkit.org/show_bug.cgi?id=88315
  15527. Reviewed by Filip Pizlo.
  15528. * GNUmakefile.am: Add rules to generate LLIntDesiredOffsets.h and
  15529. LLIntAssembly.h.
  15530. * GNUmakefile.list.am: Add offlineasm and llint files to the
  15531. dist. Add LLInt source files to the build.
  15532. * llint/LowLevelInterpreter.asm (crash): Generate a store of
  15533. 0xbbadbeef to a register, not to a constant. Otherwise, gas was
  15534. failing to assemble result.
  15535. * offlineasm/asm.rb (labelReference): Generate a
  15536. SYMBOL_STRING_RELOCATION instead of a SYMBOL_STRING, so that we go
  15537. through the PLT on ELF systems.
  15538. 2012-06-06 Andy Wingo <wingo@igalia.com>
  15539. REGRESSION (r106478): None of the Paper.js JavaScript examples work
  15540. https://bugs.webkit.org/show_bug.cgi?id=87158
  15541. Reviewed by Michael Saboff.
  15542. * bytecompiler/BytecodeGenerator.cpp:
  15543. (JSC::BytecodeGenerator::resolve): If we have to bail out to
  15544. dynamicResolve(), only skip static scopes from the head of the
  15545. scope chain. Before, we were also skipping activations with
  15546. direct eval as well, which was incorrect.
  15547. 2012-06-06 Dan Bernstein <mitz@apple.com>
  15548. Reverted r119567, the fix for <http://webkit.org/b/88378>, because it broke the 32-bit build.
  15549. * dfg/DFGSpeculativeJIT.h:
  15550. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  15551. * jit/JITInlineMethods.h:
  15552. (JSC::JIT::emitAllocateBasicJSObject):
  15553. * llint/LowLevelInterpreter.asm:
  15554. * runtime/JSGlobalData.h:
  15555. (JSGlobalData):
  15556. * runtime/JSGlobalThis.cpp:
  15557. (JSC::JSGlobalThis::setUnwrappedObject):
  15558. * runtime/JSObject.cpp:
  15559. (JSC::JSObject::visitChildren):
  15560. (JSC::JSObject::createInheritorID):
  15561. * runtime/JSObject.h:
  15562. (JSObject):
  15563. (JSC::JSObject::resetInheritorID):
  15564. (JSC):
  15565. (JSC::JSObject::offsetOfInheritorID):
  15566. (JSC::JSObject::inheritorID):
  15567. 2012-06-05 Yuqiang Xian <yuqiang.xian@intel.com>
  15568. Improve Math.round and Math.floor intrinsic
  15569. https://bugs.webkit.org/show_bug.cgi?id=88314
  15570. Reviewed by Filip Pizlo.
  15571. Currently we call a native function from the JIT code to complete the
  15572. "round" and "floor" operations. We could inline some fast paths
  15573. especially for those positive values on the platforms where floating
  15574. point truncation is supported.
  15575. This brings 3% gain on Kraken, especially 32% on audio-oscillator,
  15576. and slight win on SunSpider, measured on IA32.
  15577. * jit/ThunkGenerators.cpp:
  15578. (JSC::floorThunkGenerator):
  15579. (JSC):
  15580. (JSC::roundThunkGenerator):
  15581. 2012-06-05 Gavin Barraclough <barraclough@apple.com>
  15582. Remove JSObject::m_inheritorID
  15583. https://bugs.webkit.org/show_bug.cgi?id=88378
  15584. Reviewed by Geoff Garen.
  15585. This is rarely used, and not performance critical (the commonly accessed copy is cached on JSFunction),
  15586. and most objects don't need an inheritorID (this value is only used if the object is used as a prototype).
  15587. Instead use a private named value in the object's property storage.
  15588. * dfg/DFGSpeculativeJIT.h:
  15589. (JSC::DFG::SpeculativeJIT::emitAllocateBasicJSObject):
  15590. - No need m_inheritorID to initialize!
  15591. * jit/JITInlineMethods.h:
  15592. (JSC::JIT::emitAllocateBasicJSObject):
  15593. - No need m_inheritorID to initialize!
  15594. * llint/LowLevelInterpreter.asm:
  15595. - No need m_inheritorID to initialize!
  15596. * runtime/JSGlobalData.h:
  15597. (JSGlobalData):
  15598. - Added private name 'm_inheritorIDKey'.
  15599. * runtime/JSGlobalThis.cpp:
  15600. (JSC::JSGlobalThis::setUnwrappedObject):
  15601. - resetInheritorID is now passed a JSGlobalData&.
  15602. * runtime/JSObject.cpp:
  15603. (JSC::JSObject::visitChildren):
  15604. - No m_inheritorID to be marked.
  15605. (JSC::JSObject::createInheritorID):
  15606. - Store the newly created inheritorID in the property map.
  15607. * runtime/JSObject.h:
  15608. (JSC::JSObject::resetInheritorID):
  15609. - Remove the inheritorID from property storage.
  15610. (JSC::JSObject::inheritorID):
  15611. - Read the inheritorID from property storage.
  15612. 2012-06-05 Filip Pizlo <fpizlo@apple.com>
  15613. DFG CFG simplification should not attempt to deref nodes inside of an unreachable subgraph
  15614. https://bugs.webkit.org/show_bug.cgi?id=88362
  15615. Reviewed by Gavin Barraclough.
  15616. * dfg/DFGCFGSimplificationPhase.cpp:
  15617. (JSC::DFG::CFGSimplificationPhase::fixPhis):
  15618. (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
  15619. 2012-06-05 Mark Hahnenberg <mhahnenberg@apple.com>
  15620. Entry into JSC should CRASH() if the Heap is busy
  15621. https://bugs.webkit.org/show_bug.cgi?id=88355
  15622. Reviewed by Geoffrey Garen.
  15623. Interpreter::execute() returns jsNull() right now if we try to enter it while
  15624. the Heap is busy (e.g. with a collection), which is okay, but some code paths
  15625. that call Interpreter::execute() allocate objects before checking if the Heap
  15626. is busy. Attempting to execute JS code while the Heap is busy should not be
  15627. allowed and should be enforced by a release-mode CRASH() to prevent vague,
  15628. unhelpful backtraces later on if somebody makes a mistake. Normally, recursively
  15629. executing JS code is okay, e.g. for evals, but it should not occur during a
  15630. Heap allocation or collection because the Heap is not guaranteed to be in a
  15631. consistent state (especially during collections). We are protected from
  15632. executing JS on the same Heap concurrently on two separate threads because
  15633. they must each take a JSLock first. However, we are not protected from reentrant
  15634. execution of JS on the same thread because JSLock allows reentrancy. Therefore,
  15635. we should fail early if we detect an entrance into JS code while the Heap is busy.
  15636. * heap/Heap.cpp: Changed Heap::collect so that it sets the m_operationInProgress field
  15637. at the beginning of collection and then unsets it at the end so that it is set at all
  15638. times throughout the duration of a collection rather than sporadically during various
  15639. phases. There is no reason to unset during a collection because our collector does
  15640. not currently support running additional JS between the phases of a collection.
  15641. (JSC::Heap::getConservativeRegisterRoots):
  15642. (JSC::Heap::markRoots):
  15643. (JSC::Heap::collect):
  15644. * interpreter/Interpreter.cpp:
  15645. (JSC::Interpreter::execute): Crash if the Heap is busy.
  15646. * runtime/Completion.cpp: Crash if the Heap is busy. We do it here before we call
  15647. Interpreter::execute() because we do some allocation prior to calling execute() which
  15648. could cause Heap corruption if, for example, that allocation caused a collection.
  15649. (JSC::evaluate):
  15650. 2012-06-05 Dongwoo Im <dw.im@samsung.com>
  15651. Add 'isProtocolHandlerRegistered' and 'unregisterProtocolHandler'.
  15652. https://bugs.webkit.org/show_bug.cgi?id=73176
  15653. Reviewed by Adam Barth.
  15654. Two more APIs are added in Custom Scheme Handler specification.
  15655. http://dev.w3.org/html5/spec/Overview.html#custom-handlers
  15656. One is 'isProtocolHandlerRegistered' to query whether the specific URL
  15657. is registered or not.
  15658. The other is 'unregisterProtocolHandler' to remove the registered URL.
  15659. * Configurations/FeatureDefines.xcconfig: Add a macro 'ENABLE_CUSTOM_SCHEME_HANDLER'.
  15660. 2012-06-04 Filip Pizlo <fpizlo@apple.com>
  15661. DFG CFG simplification should correct the variables at the head of the predecessor block
  15662. https://bugs.webkit.org/show_bug.cgi?id=88284
  15663. Reviewed by Geoffrey Garen.
  15664. * dfg/DFGCFGSimplificationPhase.cpp:
  15665. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  15666. 2012-06-04 Geoffrey Garen <ggaren@apple.com>
  15667. Unreviewed.
  15668. Rolled out r119364 because it's still causing crashes (when running
  15669. v8-earley in release builds of DRT)
  15670. This time for sure!
  15671. * heap/Heap.cpp:
  15672. (JSC::Heap::collect):
  15673. * heap/MarkedBlock.cpp:
  15674. (JSC::MarkedBlock::sweep):
  15675. * heap/MarkedBlock.h:
  15676. (JSC::MarkedBlock::resetAllocator):
  15677. (JSC):
  15678. * heap/MarkedSpace.cpp:
  15679. (JSC::ResetAllocator::operator()):
  15680. (JSC):
  15681. (JSC::MarkedSpace::resetAllocators):
  15682. (JSC::MarkedSpace::sweepWeakSets):
  15683. * heap/MarkedSpace.h:
  15684. (MarkedSpace):
  15685. * heap/WeakBlock.cpp:
  15686. (JSC::WeakBlock::sweep):
  15687. * heap/WeakSet.cpp:
  15688. (JSC::WeakSet::sweep):
  15689. (JSC::WeakSet::tryFindAllocator):
  15690. * heap/WeakSet.h:
  15691. (JSC::WeakSet::shrink):
  15692. 2012-06-04 Filip Pizlo <fpizlo@apple.com>
  15693. DFG arguments simplification should have rationalized handling of TearOffArguments
  15694. https://bugs.webkit.org/show_bug.cgi?id=88206
  15695. Reviewed by Geoffrey Garen.
  15696. - Accesses to the unmodified arguments register ought to have the same effect on
  15697. alias/escape analysis of arguments as accesses to the mutable arguments register.
  15698. - The existence of TearOffArguments should not get in the way of arguments aliasing.
  15699. - TearOffArguments should be eliminated if CreateArguments is eliminated.
  15700. * dfg/DFGArgumentsSimplificationPhase.cpp:
  15701. (JSC::DFG::ArgumentsSimplificationPhase::run):
  15702. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  15703. 2012-06-04 Gavin Barraclough <barraclough@apple.com>
  15704. Remove enabledProfilerReference
  15705. https://bugs.webkit.org/show_bug.cgi?id=88258
  15706. Reviewed by Michael Saboff.
  15707. Make the enabled profiler a member of JSGlobalData, and switch code that accesses it to do so directly
  15708. via the JSGlobalData, rather than holding a Profiler** reference to it. Do not pass the Profiler**
  15709. reference to JIT code. This patch does not change the stack layout on entry into JIT code (passing an
  15710. unused void* instead), since this is an intrusive change better handled in a separate patch.
  15711. * interpreter/Interpreter.cpp:
  15712. (JSC::Interpreter::throwException):
  15713. (JSC::Interpreter::execute):
  15714. (JSC::Interpreter::executeCall):
  15715. (JSC::Interpreter::executeConstruct):
  15716. (JSC::Interpreter::privateExecute):
  15717. * jit/JITCode.h:
  15718. (JSC::JITCode::execute):
  15719. - Don't pass Profiler** to JIT code.
  15720. * jit/JITOpcodes.cpp:
  15721. (JSC::JIT::emit_op_profile_will_call):
  15722. (JSC::JIT::emit_op_profile_did_call):
  15723. * jit/JITOpcodes32_64.cpp:
  15724. (JSC::JIT::emit_op_profile_will_call):
  15725. (JSC::JIT::emit_op_profile_did_call):
  15726. * jit/JITStubs.cpp:
  15727. (JSC):
  15728. (JSC::ctiTrampoline):
  15729. (JSC::ctiVMThrowTrampoline):
  15730. (JSC::ctiOpThrowNotCaught):
  15731. (JSC::JITThunks::JITThunks):
  15732. (JSC::DEFINE_STUB_FUNCTION):
  15733. - For ARM_THUMB2, rename ENABLE_PROFILER_REFERENCE_OFFSET to FIRST_STACK_ARGUMENT (which is how it is being used).
  15734. - For MIPS, remove ENABLE_PROFILER_REFERENCE_OFFSET.
  15735. * jit/JITStubs.h:
  15736. (JITStackFrame):
  15737. (JSC):
  15738. - Renamed enabledProfilerReference to unusedX.
  15739. * llint/LLIntSlowPaths.cpp:
  15740. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  15741. * llint/LowLevelInterpreter.asm:
  15742. * profiler/Profiler.cpp:
  15743. (JSC):
  15744. (JSC::Profiler::startProfiling):
  15745. (JSC::Profiler::stopProfiling):
  15746. * profiler/Profiler.h:
  15747. (Profiler):
  15748. - Removed s_sharedEnabledProfilerReference, enabledProfilerReference().
  15749. * runtime/JSGlobalData.cpp:
  15750. (JSC::JSGlobalData::JSGlobalData):
  15751. * runtime/JSGlobalData.h:
  15752. (JSC):
  15753. (JSC::JSGlobalData::enabledProfiler):
  15754. (JSGlobalData):
  15755. - Added m_enabledProfiler, enabledProfiler().
  15756. * runtime/JSGlobalObject.cpp:
  15757. (JSC::JSGlobalObject::~JSGlobalObject):
  15758. 2012-06-04 Filip Pizlo <fpizlo@apple.com>
  15759. get_argument_by_val should be profiled everywhere
  15760. https://bugs.webkit.org/show_bug.cgi?id=88205
  15761. Reviewed by Geoffrey Garen.
  15762. * jit/JITOpcodes32_64.cpp:
  15763. (JSC::JIT::emitSlow_op_get_argument_by_val):
  15764. * llint/LLIntSlowPaths.cpp:
  15765. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  15766. 2012-06-04 Filip Pizlo <fpizlo@apple.com>
  15767. DFG arguments simplification takes unkindly to direct accesses to the arguments register
  15768. https://bugs.webkit.org/show_bug.cgi?id=88261
  15769. Reviewed by Geoffrey Garen.
  15770. Fixed arguments simplification for direct accesses to the arguments register, which may
  15771. arise if CSE had not run. Fixed CSE so that it does run prior to arguments simplification,
  15772. by making it a full-fledged member of the fixpoint. Fixed other issues in arguments
  15773. simplification, like realizing that it needs to bail if there is a direct assignment to
  15774. the arguments register, and failing to turn CreateArguments into PhantomArguments. Also
  15775. fixed CSE's handling of store elimination of captured locals in the presence of a
  15776. GetMyArgumentByVal (or one of its friends), and fixed CSE to correctly fixup variables at
  15777. tail if the Flush it removes is the last operation on a local in a basic block.
  15778. * bytecode/CodeBlock.cpp:
  15779. (JSC::CodeBlock::dump):
  15780. * dfg/DFGArgumentsSimplificationPhase.cpp:
  15781. (JSC::DFG::ArgumentsSimplificationPhase::run):
  15782. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  15783. * dfg/DFGCSEPhase.cpp:
  15784. (JSC::DFG::CSEPhase::run):
  15785. (JSC::DFG::CSEPhase::setLocalStoreElimination):
  15786. (JSC::DFG::CSEPhase::performNodeCSE):
  15787. (CSEPhase):
  15788. * dfg/DFGDriver.cpp:
  15789. (JSC::DFG::compile):
  15790. 2012-06-04 Anders Carlsson <andersca@apple.com>
  15791. Fix a struct/class mismatch.
  15792. * heap/Handle.h:
  15793. (Handle):
  15794. 2012-06-04 David Kilzer <ddkilzer@apple.com>
  15795. BUILD FIX: FeatureDefines.xcconfig should match across projects
  15796. * Configurations/FeatureDefines.xcconfig:
  15797. - Add missing ENABLE_LEGACY_CSS_VENDOR_PREFIXES.
  15798. 2012-06-02 Geoffrey Garen <ggaren@apple.com>
  15799. Weak pointer finalization should be lazy
  15800. https://bugs.webkit.org/show_bug.cgi?id=87599
  15801. Reviewed by Sam Weinig.
  15802. This time for sure!
  15803. * heap/Heap.cpp:
  15804. (JSC::Heap::collect): Don't sweep eagerly -- we'll sweep lazily instead.
  15805. * heap/MarkedBlock.cpp:
  15806. (JSC::MarkedBlock::sweep): Sweep our weak set before we sweep our other
  15807. destructors -- this is our last chance to run weak set finalizers before
  15808. we recycle our memory.
  15809. * heap/MarkedBlock.h:
  15810. (JSC::MarkedBlock::resetAllocator):
  15811. * heap/MarkedSpace.cpp:
  15812. (JSC::MarkedSpace::resetAllocators):
  15813. * heap/MarkedSpace.h:
  15814. (JSC::MarkedSpace::resetAllocators): Don't force allocator reset anymore.
  15815. It will happen automatically when a weak set is swept. It's simpler to
  15816. have only one canonical way for this to happen, and it wasn't buying
  15817. us anything to do it eagerly.
  15818. * heap/WeakBlock.cpp:
  15819. (JSC::WeakBlock::sweep): Don't short-circuit a sweep unless we know
  15820. the sweep would be a no-op. If even one finalizer is pending, we need to
  15821. run it, since we won't get another chance.
  15822. * heap/WeakSet.cpp:
  15823. (JSC::WeakSet::sweep): This loop can be simpler now that
  15824. WeakBlock::sweep() does what we mean.
  15825. Reset our allocator after a sweep because this is the optimal time to
  15826. start trying to recycle old weak pointers.
  15827. (JSC::WeakSet::tryFindAllocator): Don't sweep when searching for an
  15828. allocator because we've swept already, and forcing a new sweep would be
  15829. wasteful.
  15830. * heap/WeakSet.h:
  15831. (JSC::WeakSet::shrink): Be sure to reset our allocator after a shrink
  15832. because the shrink may have removed the block the allocator was going to
  15833. allocate out of.
  15834. 2012-06-02 Filip Pizlo <fpizlo@apple.com>
  15835. If the DFG bytecode parser detects that op_method_check has gone polymorphic, it
  15836. shouldn't revert all the way to GetById/GetByIdFlush
  15837. https://bugs.webkit.org/show_bug.cgi?id=88176
  15838. Reviewed by Geoffrey Garen.
  15839. Refactored the code so that the op_method_check case of the parser gracefully falls
  15840. through to all of the goodness of the normal op_get_by_id case.
  15841. * dfg/DFGByteCodeParser.cpp:
  15842. (ByteCodeParser):
  15843. (JSC::DFG::ByteCodeParser::handleGetById):
  15844. (DFG):
  15845. (JSC::DFG::ByteCodeParser::parseBlock):
  15846. 2012-06-02 Filip Pizlo <fpizlo@apple.com>
  15847. DFG CSE should be able to eliminate unnecessary flushes of arguments and captured variables
  15848. https://bugs.webkit.org/show_bug.cgi?id=87929
  15849. Reviewed by Geoffrey Garen.
  15850. Slight speed-up on V8. Big win (up to 50%) on programs that inline very small functions.
  15851. This required a bunch of changes:
  15852. - The obvious change is making CSE essentially ignore whether or not the set of
  15853. operations between the Flush and the SetLocal can exit, and instead focus on whether or
  15854. not that set of operations can clobber the world or access local variables. This code
  15855. is now refactored to return a set of flags indicating any of these events, and the CSE
  15856. decides what to do based on those flags. If the set of operations is non-clobbering
  15857. and non-accessing, then the Flush is turned into a Phantom on the child of the
  15858. SetLocal. This expands the liveness of the relevant variable but virtually guarantees
  15859. that it will be register allocated and not flushed to the stack. So, yeah, this patch
  15860. is a lot of work to save a few stores to the stack.
  15861. - Previously, CheckArgumentsNotCreated was optimized "lazily" in that you only knew if
  15862. it was a no-op if you were holding onto a CFA abstract state. But this would make the
  15863. CSE act pessimistically, since it doesn't use the CFA. Hence, this patch changes the
  15864. constant folding phase into something more broad; it now fixes up
  15865. CheckArgumentsNotCreated nodes by turning them into phantoms if it knows that they are
  15866. no-ops.
  15867. - Arguments simplification was previously relying on this very strange PhantomArguments
  15868. node, which had two different meanings: for normal execution it meant the empty value
  15869. but for OSR exit it meant that the arguments should be reified. This produces problems
  15870. when set SetLocals to the captured arguments registers are CSE'd away, since we'd be
  15871. triggering reification of arguments without having initialized the arguments registers
  15872. to empty. The cleanest solution was to fix PhantomArguments to have one meaning:
  15873. namely, arguments reification on OSR exit. Hence, this patch changes arguments
  15874. simplification to change SetLocal of CreateArguments on the arguments registers to be
  15875. a SetLocal of Empty.
  15876. - Argument value recoveries were previously derived from the value source of the
  15877. arguments at the InlineStart. But that relies on all SetLocals to arguments having
  15878. been flushed. It's possible that we could have elided the SetLocal to the arguments
  15879. at the callsite because there were subsequent SetLocals to the arguments inside of the
  15880. callee, in which case the InlineStart would get the wrong information. Hence, this
  15881. patch changes argument value recovery computation to operate over the ArgumentPositions
  15882. directly.
  15883. - But that doesn't actually work, because previously, there was no way to link an
  15884. InlineStart back to the corresponding ArgumentPositions, at least not without some
  15885. ugliness. So this patch instates the rule that the m_argumentPositions vector consists
  15886. of disjoint subsequences such that each subsequence corresponds to an inline callsite
  15887. and can be identified by its first index, and within each subsequence are the
  15888. ArgumentPositions of all of the arguments ordered by argument index. This required
  15889. flipping the order in which ArgumentPositions are added to the vector, and giving
  15890. InlineStart an operand that indicates the start of that inline callsite's
  15891. ArgumentPosition subsequence.
  15892. - This patch also revealed a nasty bug in the reification of arguments in inline call
  15893. frames on OSR exit. Since the reification was happening after the values of virtual
  15894. registers were recovered, the value recoveries of the inline arguments were wrong.
  15895. Hence using operationCreateInlinedArguments is wrong. For example a value recovery
  15896. might say that you have to box a double, but if we had already boxed it then boxing
  15897. it a second time will result in garbage. The specific case of this bug was this patch
  15898. uncovered was that now it is possible for an inline call frame to not have any valid
  15899. value recoveries for any inline arguments, if the optimization elides all argument
  15900. flushes, while at the same time optimizing away arguments creation. Then OSR exit
  15901. would try to recover the arguments using the inline call frame, which had bogus
  15902. information, and humorous crashes would ensue. This patch fixes this issue by moving
  15903. arguments reification to after call frame reification, so that arguments reification
  15904. can always use operationCreateArguments instead of operationCreateInlinedArguments.
  15905. - This patch may turn a Flush into a Phantom. That's kind of the whole point. But that
  15906. broke forward speculation checks, which knew to look for a Flush prior to a SetLocal
  15907. but didn't know that there could alternatively be a Phantom in place of the Flush.
  15908. This patch fixes that by augmenting the forward speculation check logic.
  15909. - Finally, in the process of having fun with all of the above, I realized that my DFG
  15910. validation was not actually running on every phase like I had originally designed it
  15911. to. In fact it was only running just after bytecode parsing. I initially tried to
  15912. make it run in every phase but found that this causes some tests to timeout
  15913. (specifically the evil fuzzing ones), so I decided on a compromise where: (i) in
  15914. release mode validation never runs, (ii) in debug mode validation will run just
  15915. after parsing and just before the backend, and (iii) it's possible with a simple
  15916. switch to enable validation to run on every phase.
  15917. Luckily all of the above issues were already covered by the 77 or so DFG-specific
  15918. layout tests. Hence, this patch does not introduce any new tests despite being so
  15919. meaty.
  15920. * dfg/DFGAbstractState.cpp:
  15921. (JSC::DFG::AbstractState::execute):
  15922. * dfg/DFGArgumentPosition.h:
  15923. (JSC::DFG::ArgumentPosition::prediction):
  15924. (JSC::DFG::ArgumentPosition::doubleFormatState):
  15925. (JSC::DFG::ArgumentPosition::shouldUseDoubleFormat):
  15926. (ArgumentPosition):
  15927. * dfg/DFGArgumentsSimplificationPhase.cpp:
  15928. (JSC::DFG::ArgumentsSimplificationPhase::run):
  15929. * dfg/DFGByteCodeParser.cpp:
  15930. (JSC::DFG::ByteCodeParser::handleInlining):
  15931. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  15932. * dfg/DFGCSEPhase.cpp:
  15933. (JSC::DFG::CSEPhase::SetLocalStoreEliminationResult::SetLocalStoreEliminationResult):
  15934. (SetLocalStoreEliminationResult):
  15935. (JSC::DFG::CSEPhase::setLocalStoreElimination):
  15936. (JSC::DFG::CSEPhase::performNodeCSE):
  15937. * dfg/DFGCommon.h:
  15938. * dfg/DFGConstantFoldingPhase.cpp:
  15939. (JSC::DFG::ConstantFoldingPhase::run):
  15940. * dfg/DFGDriver.cpp:
  15941. (JSC::DFG::compile):
  15942. * dfg/DFGNode.h:
  15943. (Node):
  15944. (JSC::DFG::Node::hasArgumentPositionStart):
  15945. (JSC::DFG::Node::argumentPositionStart):
  15946. * dfg/DFGOSRExitCompiler32_64.cpp:
  15947. (JSC::DFG::OSRExitCompiler::compileExit):
  15948. * dfg/DFGOSRExitCompiler64.cpp:
  15949. (JSC::DFG::OSRExitCompiler::compileExit):
  15950. * dfg/DFGPhase.cpp:
  15951. (DFG):
  15952. * dfg/DFGPhase.h:
  15953. (Phase):
  15954. * dfg/DFGSpeculativeJIT.cpp:
  15955. (JSC::DFG::SpeculativeJIT::compile):
  15956. * dfg/DFGSpeculativeJIT.h:
  15957. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  15958. * dfg/DFGSpeculativeJIT32_64.cpp:
  15959. (JSC::DFG::SpeculativeJIT::compile):
  15960. * dfg/DFGSpeculativeJIT64.cpp:
  15961. (JSC::DFG::SpeculativeJIT::compile):
  15962. 2012-06-02 Geoffrey Garen <ggaren@apple.com>
  15963. DOM string cache should hash pointers, not characters
  15964. https://bugs.webkit.org/show_bug.cgi?id=88175
  15965. Reviewed by Phil Pizlo and Sam Weinig.
  15966. * heap/Weak.h:
  15967. (JSC::weakAdd):
  15968. (JSC::weakRemove): Made these function templates slightly more generic
  15969. to accommodate new client types.
  15970. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  15971. DFG CFA should know that PutByVal can clobber the world
  15972. https://bugs.webkit.org/show_bug.cgi?id=88155
  15973. Reviewed by Gavin Barraclough.
  15974. * dfg/DFGAbstractState.cpp:
  15975. (JSC::DFG::AbstractState::execute):
  15976. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  15977. DFG CFA should mark basic blocks as having constants if local accesses yield constants
  15978. https://bugs.webkit.org/show_bug.cgi?id=88153
  15979. Reviewed by Gavin Barraclough.
  15980. * dfg/DFGAbstractState.cpp:
  15981. (JSC::DFG::AbstractState::execute):
  15982. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  15983. DFG arguments simplification phase uses a node.codeOrigin after appending a node
  15984. https://bugs.webkit.org/show_bug.cgi?id=88151
  15985. Reviewed by Geoffrey Garen.
  15986. The right thing to do is to save the CodeOrigin before appending to the graph.
  15987. * dfg/DFGArgumentsSimplificationPhase.cpp:
  15988. (JSC::DFG::ArgumentsSimplificationPhase::run):
  15989. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  15990. DFG should not emit unnecessary speculation checks when performing an int32 to double conversion on
  15991. a value that is proved to be a number, predicted to be an int32, but not proved to be an int32
  15992. https://bugs.webkit.org/show_bug.cgi?id=88146
  15993. Reviewed by Gavin Barraclough.
  15994. * dfg/DFGSpeculativeJIT.cpp:
  15995. (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
  15996. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  15997. DFG constant folding search for the last local access skips the immediately previous local access
  15998. https://bugs.webkit.org/show_bug.cgi?id=88141
  15999. Reviewed by Michael Saboff.
  16000. If you use a loop in the style of:
  16001. for (i = start; i--;)
  16002. then you need to remember that the first value of 'i' that the loop body will see is 'start - 1'.
  16003. Hence the following is probably wrong:
  16004. for (i = start - 1; i--;)
  16005. * dfg/DFGConstantFoldingPhase.cpp:
  16006. (JSC::DFG::ConstantFoldingPhase::run):
  16007. 2012-06-01 Filip Pizlo <fpizlo@apple.com>
  16008. DFG constant folding should be OK with GetLocal of captured variables having a constant
  16009. https://bugs.webkit.org/show_bug.cgi?id=88137
  16010. Reviewed by Gavin Barraclough.
  16011. * dfg/DFGConstantFoldingPhase.cpp:
  16012. (JSC::DFG::ConstantFoldingPhase::run):
  16013. 2012-05-31 Mark Hahnenberg <mhahnenberg@apple.com>
  16014. JSGlobalObject does not mark m_privateNameStructure
  16015. https://bugs.webkit.org/show_bug.cgi?id=88023
  16016. Rubber stamped by Gavin Barraclough.
  16017. * runtime/JSGlobalObject.cpp:
  16018. (JSC::JSGlobalObject::visitChildren): We need to mark this so it doesn't get
  16019. inadvertently garbage collected.
  16020. 2012-05-31 Erik Arvidsson <arv@chromium.org>
  16021. Make DOM Exceptions Errors
  16022. https://bugs.webkit.org/show_bug.cgi?id=85078
  16023. Reviewed by Oliver Hunt.
  16024. WebIDL mandates that exceptions should have Error.prototype on its prototype chain.
  16025. For JSC we have access to the Error.prototype from the binding code.
  16026. For V8 we set a field in the WrapperTypeInfo and when the constructor function is created we
  16027. set the prototype as needed.
  16028. Updated test: fast/dom/DOMException/prototype-object.html
  16029. * JavaScriptCore.xcodeproj/project.pbxproj:
  16030. * runtime/JSGlobalObject.cpp:
  16031. (JSC::JSGlobalObject::reset):
  16032. * runtime/JSGlobalObject.h:
  16033. (JSC):
  16034. (JSGlobalObject):
  16035. (JSC::JSGlobalObject::errorPrototype):
  16036. 2012-05-31 Andy Wingo <wingo@igalia.com>
  16037. Fix reference to unset variable in debug mode
  16038. https://bugs.webkit.org/show_bug.cgi?id=87981
  16039. Reviewed by Geoffrey Garen.
  16040. * runtime/JSONObject.cpp (Stringifier::Holder::Holder):
  16041. Initialize m_size in debug mode, as we check it later in an assert.
  16042. 2012-05-30 Mark Hahnenberg <mhahnenberg@apple.com>
  16043. Heap should sweep incrementally
  16044. https://bugs.webkit.org/show_bug.cgi?id=85429
  16045. We shouldn't have to wait for the opportunistic GC timer to fire in order
  16046. to call object destructors. Instead, we should incrementally sweep some
  16047. subset of the blocks requiring sweeping periodically. We tie this sweeping
  16048. to a timer rather than to collections because we want to reclaim this memory
  16049. even if we stop allocating. This way, our memory usage scales smoothly with
  16050. actual use, regardless of whether we've recently done an opportunistic GC or not.
  16051. Reviewed by Geoffrey Garen.
  16052. * CMakeLists.txt:
  16053. * GNUmakefile.list.am:
  16054. * JavaScriptCore.gypi:
  16055. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  16056. * JavaScriptCore.xcodeproj/project.pbxproj:
  16057. * Target.pri:
  16058. * heap/Heap.cpp:
  16059. (JSC::Heap::Heap):
  16060. (JSC::Heap::collect): We no longer sweep during a full sweep. We only shrink now,
  16061. which we will switch over to being done during incremental sweeping too as soon as
  16062. all finalizers can be run lazily (and, by extension, incrementally).
  16063. (JSC::Heap::sweeper):
  16064. (JSC):
  16065. * heap/Heap.h:
  16066. (JSC):
  16067. (Heap):
  16068. * heap/IncrementalSweeper.cpp: Added.
  16069. (JSC):
  16070. (JSC::IncrementalSweeper::timerDidFire): The IncrementalSweeper works very similarly to
  16071. GCActivityCallback. It is tied to a run-loop based timer that fires periodically based
  16072. on how long the previous sweep increment took to run. The IncrementalSweeper doesn't do
  16073. anything if the platform doesn't support CoreFoundation.
  16074. (JSC::IncrementalSweeper::IncrementalSweeper):
  16075. (JSC::IncrementalSweeper::~IncrementalSweeper):
  16076. (JSC::IncrementalSweeper::create):
  16077. (JSC::IncrementalSweeper::scheduleTimer):
  16078. (JSC::IncrementalSweeper::cancelTimer):
  16079. (JSC::IncrementalSweeper::doSweep): Iterates over the snapshot of the MarkedSpace taken
  16080. during the last collection, checking to see which blocks need sweeping. If it successfully
  16081. gets to the end of the blocks that need sweeping then it cancels the timer.
  16082. (JSC::IncrementalSweeper::startSweeping): We take a snapshot of the Heap and store it in
  16083. a Vector that the incremental sweep will iterate over. We also reset our index into this Vector.
  16084. * heap/IncrementalSweeper.h: Added.
  16085. (JSC):
  16086. (IncrementalSweeper):
  16087. * heap/MarkedBlock.h:
  16088. (JSC::MarkedBlock::needsSweeping): If a block is in the Marked state it needs sweeping
  16089. to be usable and to run any destructors that need to be run.
  16090. 2012-05-30 Patrick Gansterer <paroga@webkit.org>
  16091. [WINCE] Fix JSString after r115516.
  16092. https://bugs.webkit.org/show_bug.cgi?id=87892
  16093. Reviewed by Geoffrey Garen.
  16094. r115516 splitted JSString into two classes, with addition nested classes.
  16095. Add a workaround for the WinCE compiler since it can't resolve the friend class
  16096. declerations corretly and denies the access to protected members of JSString.
  16097. * runtime/JSString.h:
  16098. (JSC::JSRopeString::RopeBuilder::append):
  16099. (JSC::JSRopeString::append):
  16100. (JSRopeString):
  16101. 2012-05-30 Oliver Hunt <oliver@apple.com>
  16102. Really provide error information with the inspector disabled
  16103. https://bugs.webkit.org/show_bug.cgi?id=87910
  16104. Reviewed by Filip Pizlo.
  16105. Don't bother checking for anything other than pre-existing error info.
  16106. In the absence of complete line number information you'll only get the
  16107. line a function starts on, but at least it's something.
  16108. * interpreter/Interpreter.cpp:
  16109. (JSC::Interpreter::throwException):
  16110. 2012-05-30 Filip Pizlo <fpizlo@apple.com>
  16111. LLInt broken on x86-32 with JIT turned off
  16112. https://bugs.webkit.org/show_bug.cgi?id=87906
  16113. Reviewed by Geoffrey Garen.
  16114. Fixed the code to not clobber registers that contain important things, like the call frame.
  16115. * llint/LowLevelInterpreter32_64.asm:
  16116. 2012-05-30 Filip Pizlo <fpizlo@apple.com>
  16117. ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
  16118. https://bugs.webkit.org/show_bug.cgi?id=87887
  16119. Reviewed by Darin Adler.
  16120. Better fix - we now never call SourceProvider::asID() if SourceProvider* is 0.
  16121. * parser/Nodes.h:
  16122. (JSC::ScopeNode::sourceID):
  16123. * parser/SourceCode.h:
  16124. (JSC::SourceCode::providerID):
  16125. (SourceCode):
  16126. * parser/SourceProvider.h:
  16127. (SourceProvider):
  16128. (JSC::SourceProvider::asID):
  16129. * runtime/Executable.h:
  16130. (JSC::ScriptExecutable::sourceID):
  16131. 2012-05-30 Filip Pizlo <fpizlo@apple.com>
  16132. ScriptDebugServer wants sourceIDs that are non-zero because that's what HashMaps want, so JSC should placate it
  16133. https://bugs.webkit.org/show_bug.cgi?id=87887
  16134. Reviewed by Geoffrey Garen.
  16135. * parser/SourceProvider.h:
  16136. (JSC::SourceProvider::asID):
  16137. 2012-05-30 Oliver Hunt <oliver@apple.com>
  16138. DFG does not correctly handle exceptions caught in the LLInt
  16139. https://bugs.webkit.org/show_bug.cgi?id=87885
  16140. Reviewed by Filip Pizlo.
  16141. Make the DFG use genericThrow, rather than reimplementing a small portion of it.
  16142. Also make the LLInt slow paths validate that their PC is correct.
  16143. * dfg/DFGOperations.cpp:
  16144. * llint/LLIntSlowPaths.cpp:
  16145. (LLInt):
  16146. 2012-05-29 Filip Pizlo <fpizlo@apple.com>
  16147. DFG CFA should infer types and values of captured variables
  16148. https://bugs.webkit.org/show_bug.cgi?id=87813
  16149. Reviewed by Gavin Barraclough.
  16150. Slight speed-up in V8/earley-boyer (~1%).
  16151. * bytecode/CodeBlock.h:
  16152. (JSC::CodeBlock::argumentsAreCaptured):
  16153. (JSC::CodeBlock::argumentIsCaptured):
  16154. (CodeBlock):
  16155. * dfg/DFGAbstractState.cpp:
  16156. (DFG):
  16157. (JSC::DFG::AbstractState::beginBasicBlock):
  16158. (JSC::DFG::AbstractState::initialize):
  16159. (JSC::DFG::AbstractState::endBasicBlock):
  16160. (JSC::DFG::AbstractState::execute):
  16161. (JSC::DFG::AbstractState::clobberWorld):
  16162. (JSC::DFG::AbstractState::clobberStructures):
  16163. (JSC::DFG::AbstractState::mergeStateAtTail):
  16164. (JSC::DFG::AbstractState::merge):
  16165. (JSC::DFG::AbstractState::mergeToSuccessors):
  16166. * dfg/DFGAbstractState.h:
  16167. (JSC::DFG::AbstractState::variables):
  16168. (AbstractState):
  16169. * dfg/DFGSpeculativeJIT32_64.cpp:
  16170. (JSC::DFG::SpeculativeJIT::compile):
  16171. * dfg/DFGSpeculativeJIT64.cpp:
  16172. (JSC::DFG::SpeculativeJIT::compile):
  16173. 2012-05-30 Patrick Gansterer <paroga@webkit.org>
  16174. Unreviewed. Build fix for !ENABLE(JIT) after r117823.
  16175. * bytecode/CodeBlock.cpp:
  16176. (JSC::CodeBlock::dump):
  16177. 2012-05-30 Sheriff Bot <webkit.review.bot@gmail.com>
  16178. Unreviewed, rolling out r118868.
  16179. http://trac.webkit.org/changeset/118868
  16180. https://bugs.webkit.org/show_bug.cgi?id=87828
  16181. introduced ~20 crashes on Mac and Qt bots (Requested by pizlo_
  16182. on #webkit).
  16183. * heap/Heap.cpp:
  16184. (JSC::Heap::collect):
  16185. * heap/MarkedBlock.cpp:
  16186. (JSC::MarkedBlock::sweep):
  16187. * heap/MarkedBlock.h:
  16188. (JSC::MarkedBlock::sweepWeakSet):
  16189. (JSC):
  16190. * heap/MarkedSpace.cpp:
  16191. (JSC::SweepWeakSet::operator()):
  16192. (JSC):
  16193. (JSC::MarkedSpace::sweepWeakSets):
  16194. * heap/MarkedSpace.h:
  16195. (MarkedSpace):
  16196. 2012-05-29 Geoffrey Garen <ggaren@apple.com>
  16197. Rolled back in r118646, now that
  16198. https://bugs.webkit.org/show_bug.cgi?id=87784 is fixed.
  16199. http://trac.webkit.org/changeset/118646
  16200. https://bugs.webkit.org/show_bug.cgi?id=87599
  16201. * heap/Heap.cpp:
  16202. (JSC::Heap::collect):
  16203. * heap/MarkedBlock.cpp:
  16204. (JSC::MarkedBlock::sweep):
  16205. * heap/MarkedBlock.h:
  16206. (JSC):
  16207. * heap/MarkedSpace.cpp:
  16208. (JSC):
  16209. * heap/MarkedSpace.h:
  16210. (MarkedSpace):
  16211. 2012-05-29 Filip Pizlo <fpizlo@apple.com>
  16212. DFG should keep captured variables alive until the (inline) return.
  16213. https://bugs.webkit.org/show_bug.cgi?id=87205
  16214. Reviewed by Gavin Barraclough.
  16215. Changes the way we do flushing for captured variables and arguments. Instead of flushing
  16216. each SetLocal immediately, we flush at kill points. So a SetLocal will cause a Flush of
  16217. whatever was live in the variable previously, and a return will cause a Flush of all
  16218. captured variables and all arguments.
  16219. * dfg/DFGByteCodeParser.cpp:
  16220. (JSC::DFG::ByteCodeParser::setDirect):
  16221. (JSC::DFG::ByteCodeParser::set):
  16222. (JSC::DFG::ByteCodeParser::setLocal):
  16223. (JSC::DFG::ByteCodeParser::getArgument):
  16224. (JSC::DFG::ByteCodeParser::setArgument):
  16225. (JSC::DFG::ByteCodeParser::findArgumentPositionForArgument):
  16226. (ByteCodeParser):
  16227. (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
  16228. (JSC::DFG::ByteCodeParser::findArgumentPosition):
  16229. (JSC::DFG::ByteCodeParser::flush):
  16230. (JSC::DFG::ByteCodeParser::flushDirect):
  16231. (JSC::DFG::ByteCodeParser::flushArgumentsAndCapturedVariables):
  16232. (JSC::DFG::ByteCodeParser::handleInlining):
  16233. (JSC::DFG::ByteCodeParser::parseBlock):
  16234. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  16235. * dfg/DFGCSEPhase.cpp:
  16236. (JSC::DFG::CSEPhase::setLocalStoreElimination):
  16237. (JSC::DFG::CSEPhase::performNodeCSE):
  16238. * dfg/DFGSpeculativeJIT.cpp:
  16239. (JSC::DFG::SpeculativeJIT::compile):
  16240. * dfg/DFGSpeculativeJIT.h:
  16241. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  16242. 2012-05-29 Geoffrey Garen <ggaren@apple.com>
  16243. WeakGCMap should be lazy-finalization-safe
  16244. https://bugs.webkit.org/show_bug.cgi?id=87784
  16245. Reviewed by Darin Adler.
  16246. * runtime/WeakGCMap.h:
  16247. (JSC::WeakGCMap::get): Since this is a map of raw WeakImpl pointers, and
  16248. not Weak<T>, we need to verify manually that the WeakImpl is live before
  16249. we return its payload.
  16250. 2012-05-29 Mark Hahnenberg <mhahnenberg@apple.com>
  16251. CopiedSpace::doneCopying could start another collection
  16252. https://bugs.webkit.org/show_bug.cgi?id=86538
  16253. Reviewed by Geoffrey Garen.
  16254. It's possible that if we don't have anything at the head of to-space
  16255. after a collection and the BlockAllocator doesn't have any fresh blocks
  16256. to give us right now we could start another collection while still in
  16257. the middle of the first collection when we call CopiedSpace::addNewBlock().
  16258. One way to resolve this would be to have Heap::shouldCollect() check that
  16259. m_operationInProgress is NoOperation. This would prevent the path in
  16260. getFreshBlock() that starts the collection if we're already in the middle of one.
  16261. I could not come up with a test case to reproduce this crash on ToT.
  16262. * heap/Heap.h:
  16263. (JSC::Heap::shouldCollect): We shouldn't collect if we're already in the middle
  16264. of a collection, i.e. the current operation should be NoOperation.
  16265. 2012-05-29 David Barr <davidbarr@chromium.org>
  16266. Introduce ENABLE_CSS_IMAGE_RESOLUTION compile flag
  16267. https://bugs.webkit.org/show_bug.cgi?id=87685
  16268. Reviewed by Eric Seidel.
  16269. Add a configuration option for CSS image-resolution support, disabling it by default.
  16270. * Configurations/FeatureDefines.xcconfig:
  16271. 2012-05-28 Sheriff Bot <webkit.review.bot@gmail.com>
  16272. Unreviewed, rolling out r118646.
  16273. http://trac.webkit.org/changeset/118646
  16274. https://bugs.webkit.org/show_bug.cgi?id=87691
  16275. broke V8 raytrace benchmark (Requested by pizlo_ on #webkit).
  16276. * heap/Heap.cpp:
  16277. (JSC::Heap::collect):
  16278. * heap/MarkedBlock.cpp:
  16279. (JSC::MarkedBlock::sweep):
  16280. * heap/MarkedBlock.h:
  16281. (JSC::MarkedBlock::sweepWeakSet):
  16282. (JSC):
  16283. * heap/MarkedSpace.cpp:
  16284. (JSC::SweepWeakSet::operator()):
  16285. (JSC):
  16286. (JSC::MarkedSpace::sweepWeakSets):
  16287. * heap/MarkedSpace.h:
  16288. (MarkedSpace):
  16289. 2012-05-28 Filip Pizlo <fpizlo@apple.com>
  16290. DFG should not generate code for code that the CFA proves to be unreachable
  16291. https://bugs.webkit.org/show_bug.cgi?id=87682
  16292. Reviewed by Sam Weinig.
  16293. This also fixes a small performance bug where CFA was not marking blocks
  16294. as having constants (and hence not triggering constant folding) if the only
  16295. constants were on GetLocals.
  16296. And fixing that bug revealed another bug: constant folding was assuming that
  16297. a GetLocal must be the first access to a local in a basic block. This isn't
  16298. true. The first access may be a Flush. This patch fixes that issue using the
  16299. safest approach possible, since we don't need to be clever for something that
  16300. only happens in one of our benchmarks.
  16301. * dfg/DFGAbstractState.cpp:
  16302. (JSC::DFG::AbstractState::execute):
  16303. * dfg/DFGConstantFoldingPhase.cpp:
  16304. (JSC::DFG::ConstantFoldingPhase::run):
  16305. * dfg/DFGJITCompiler.h:
  16306. (JSC::DFG::JITCompiler::noticeOSREntry):
  16307. * dfg/DFGSpeculativeJIT.cpp:
  16308. (JSC::DFG::SpeculativeJIT::compile):
  16309. 2012-05-28 Carlos Garcia Campos <cgarcia@igalia.com>
  16310. Unreviewed. Fix make distcheck.
  16311. * GNUmakefile.list.am: Add missing header file.
  16312. 2012-05-27 Geoffrey Garen <ggaren@apple.com>
  16313. Weak pointer finalization should be lazy
  16314. https://bugs.webkit.org/show_bug.cgi?id=87599
  16315. Reviewed by Darin Adler.
  16316. * heap/Heap.cpp:
  16317. (JSC::Heap::collect): Don't force immediate finalization -- it will
  16318. happen lazily.
  16319. * heap/MarkedBlock.cpp:
  16320. (JSC::MarkedBlock::sweep): Sweep a block's weak set when sweeping the
  16321. block. The weak set may not have been swept yet, and this is our last
  16322. chance to run weak finalizers before we recycle the memory they reference.
  16323. * heap/MarkedBlock.h:
  16324. * heap/MarkedSpace.cpp:
  16325. (JSC::MarkedBlock::sweepWeakSets):
  16326. * heap/MarkedSpace.h:
  16327. (JSC::MarkedSpace::sweepWeakSets): Nixed sweepWeakSets because it's unused
  16328. now.
  16329. 2012-05-26 Geoffrey Garen <ggaren@apple.com>
  16330. WebKit should be lazy-finalization-safe (esp. the DOM) v2
  16331. https://bugs.webkit.org/show_bug.cgi?id=87581
  16332. Reviewed by Oliver Hunt.
  16333. * heap/MarkedBlock.cpp:
  16334. (JSC::MarkedBlock::callDestructor):
  16335. * heap/WeakBlock.h:
  16336. * heap/WeakSetInlines.h:
  16337. (JSC::WeakBlock::finalize): Since we don't guarantee destruction order,
  16338. it's not valid to access GC pointers like the Structure pointer during
  16339. finalization. We NULL out the structure pointer in debug builds to try
  16340. to make this programming mistake more obvious.
  16341. * API/JSCallbackConstructor.cpp:
  16342. (JSC::JSCallbackConstructor::destroy):
  16343. * API/JSCallbackObject.cpp:
  16344. (JSC::::destroy):
  16345. (JSC::JSCallbackObjectData::finalize):
  16346. * runtime/Arguments.cpp:
  16347. (JSC::Arguments::destroy):
  16348. * runtime/DateInstance.cpp:
  16349. (JSC::DateInstance::destroy):
  16350. * runtime/Error.cpp:
  16351. (JSC::StrictModeTypeErrorFunction::destroy):
  16352. * runtime/Executable.cpp:
  16353. (JSC::ExecutableBase::destroy):
  16354. (JSC::NativeExecutable::destroy):
  16355. (JSC::ScriptExecutable::destroy):
  16356. (JSC::EvalExecutable::destroy):
  16357. (JSC::ProgramExecutable::destroy):
  16358. (JSC::FunctionExecutable::destroy):
  16359. * runtime/JSGlobalObject.cpp:
  16360. (JSC::JSGlobalObject::destroy):
  16361. * runtime/JSPropertyNameIterator.cpp:
  16362. (JSC::JSPropertyNameIterator::destroy):
  16363. * runtime/JSStaticScopeObject.cpp:
  16364. (JSC::JSStaticScopeObject::destroy):
  16365. * runtime/JSString.cpp:
  16366. (JSC::JSString::destroy):
  16367. * runtime/JSVariableObject.cpp:
  16368. (JSC::JSVariableObject::destroy):
  16369. * runtime/NameInstance.cpp:
  16370. (JSC::NameInstance::destroy):
  16371. * runtime/RegExp.cpp:
  16372. (JSC::RegExp::destroy):
  16373. * runtime/RegExpConstructor.cpp:
  16374. (JSC::RegExpConstructor::destroy):
  16375. * runtime/Structure.cpp:
  16376. (JSC::Structure::destroy):
  16377. * runtime/StructureChain.cpp:
  16378. (JSC::StructureChain::destroy): Use static_cast instead of jsCast because
  16379. jsCast does Structure-based validation, and our Structure is not guaranteed
  16380. to be alive when we get finalized.
  16381. 2012-05-22 Filip Pizlo <fpizlo@apple.com>
  16382. DFG CSE should eliminate redundant WeakJSConstants
  16383. https://bugs.webkit.org/show_bug.cgi?id=87179
  16384. Reviewed by Gavin Barraclough.
  16385. Merged r118141 from dfgopt.
  16386. * dfg/DFGCSEPhase.cpp:
  16387. (JSC::DFG::CSEPhase::weakConstantCSE):
  16388. (CSEPhase):
  16389. (JSC::DFG::CSEPhase::performNodeCSE):
  16390. * dfg/DFGNode.h:
  16391. (JSC::DFG::Node::weakConstant):
  16392. 2012-05-22 Filip Pizlo <fpizlo@apple.com>
  16393. DFG CSE should do redundant store elimination
  16394. https://bugs.webkit.org/show_bug.cgi?id=87161
  16395. Reviewed by Oliver Hunt.
  16396. Merge r118138 from dfgopt.
  16397. This patch adds redundant store elimination. For example, consider this
  16398. code:
  16399. o.x = 42;
  16400. o.x = 84;
  16401. If o.x is speculated to be a well-behaved field, the first assignment is
  16402. unnecessary, since the second just overwrites it. We would like to
  16403. eliminate the first assignment in these cases. The need for this
  16404. optimization arises mostly from stores that our runtime requires. For
  16405. example:
  16406. o = {f:1, g:2, h:3};
  16407. This will have four assignments to the structure for the newly created
  16408. object - one assignment for the empty structure, one for {f}, one for
  16409. {f, g}, and one for {f, g, h}. We would like to only have the last of
  16410. those assigments in this case.
  16411. Intriguingly, doing so for captured variables breaks the way arguments
  16412. simplification used to work. Consider that prior to either arguments
  16413. simplification or store elimination we will have IR that looks like:
  16414. a: SetLocal(r0, Empty)
  16415. b: SetLocal(r1, Empty)
  16416. c: GetLocal(r0)
  16417. d: CreateArguments(@c)
  16418. e: SetLocal(r0, @d)
  16419. f: SetLocal(r1, @d)
  16420. Then redundant store elimination will eliminate the stores that
  16421. initialize the arguments registers to Empty, but then arguments
  16422. simplification eliminates the stores that initialize the arguments to
  16423. the newly created arguments - and at this point we no longer have any
  16424. stores to the arguments register, leading to hilarious crashes. This
  16425. patch therefore changes arguments simplification to replace
  16426. CreateArguments with JSConstant(Empty) rather than eliminating the
  16427. SetLocals. But this revealed bugs where arguments simplification was
  16428. being overzealous, so I fixed those bugs.
  16429. This is a minor speed-up on V8/early and a handful of other tests.
  16430. * bytecode/CodeBlock.h:
  16431. (JSC::CodeBlock::uncheckedActivationRegister):
  16432. * dfg/DFGAbstractState.cpp:
  16433. (JSC::DFG::AbstractState::execute):
  16434. * dfg/DFGArgumentsSimplificationPhase.cpp:
  16435. (JSC::DFG::ArgumentsSimplificationPhase::run):
  16436. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  16437. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
  16438. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  16439. * dfg/DFGCSEPhase.cpp:
  16440. (JSC::DFG::CSEPhase::globalVarStoreElimination):
  16441. (CSEPhase):
  16442. (JSC::DFG::CSEPhase::putStructureStoreElimination):
  16443. (JSC::DFG::CSEPhase::putByOffsetStoreElimination):
  16444. (JSC::DFG::CSEPhase::setLocalStoreElimination):
  16445. (JSC::DFG::CSEPhase::setReplacement):
  16446. (JSC::DFG::CSEPhase::eliminate):
  16447. (JSC::DFG::CSEPhase::performNodeCSE):
  16448. * dfg/DFGGraph.h:
  16449. (JSC::DFG::Graph::uncheckedActivationRegisterFor):
  16450. (Graph):
  16451. * dfg/DFGNode.h:
  16452. (JSC::DFG::Node::isPhantomArguments):
  16453. (Node):
  16454. (JSC::DFG::Node::hasConstant):
  16455. (JSC::DFG::Node::valueOfJSConstant):
  16456. (JSC::DFG::Node::hasStructureTransitionData):
  16457. * dfg/DFGNodeType.h:
  16458. (DFG):
  16459. * dfg/DFGPredictionPropagationPhase.cpp:
  16460. (JSC::DFG::PredictionPropagationPhase::propagate):
  16461. * dfg/DFGSpeculativeJIT.cpp:
  16462. (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
  16463. * dfg/DFGSpeculativeJIT32_64.cpp:
  16464. (JSC::DFG::SpeculativeJIT::compile):
  16465. * dfg/DFGSpeculativeJIT64.cpp:
  16466. (JSC::DFG::SpeculativeJIT::compile):
  16467. 2012-05-21 Filip Pizlo <fpizlo@apple.com>
  16468. DFG ConvertThis should just be a CheckStructure if the structure is known
  16469. https://bugs.webkit.org/show_bug.cgi?id=87057
  16470. Reviewed by Gavin Barraclough.
  16471. Merged r118021 from dfgopt.
  16472. This gives ValueProfile the ability to track singleton values - i.e. profiling
  16473. sites that always see the same value.
  16474. That is then used to profile the structure in op_convert_this.
  16475. This is then used to optimize op_convert_this into a CheckStructure if the
  16476. structure is always the same.
  16477. That then results in better CSE in inlined code that uses 'this', since
  16478. previously we couldn't CSE accesses on 'this' from different inline call frames.
  16479. Also fixed a bug where we were unnecessarily flushing 'this'.
  16480. * bytecode/CodeBlock.cpp:
  16481. (JSC::CodeBlock::dump):
  16482. (JSC::CodeBlock::stronglyVisitStrongReferences):
  16483. * bytecode/LazyOperandValueProfile.cpp:
  16484. (JSC::CompressedLazyOperandValueProfileHolder::computeUpdatedPredictions):
  16485. * bytecode/LazyOperandValueProfile.h:
  16486. (CompressedLazyOperandValueProfileHolder):
  16487. * bytecode/Opcode.h:
  16488. (JSC):
  16489. (JSC::padOpcodeName):
  16490. * bytecode/ValueProfile.h:
  16491. (JSC::ValueProfileBase::ValueProfileBase):
  16492. (JSC::ValueProfileBase::dump):
  16493. (JSC::ValueProfileBase::computeUpdatedPrediction):
  16494. (ValueProfileBase):
  16495. * bytecompiler/BytecodeGenerator.cpp:
  16496. (JSC::BytecodeGenerator::BytecodeGenerator):
  16497. * dfg/DFGByteCodeParser.cpp:
  16498. (JSC::DFG::ByteCodeParser::setArgument):
  16499. (JSC::DFG::ByteCodeParser::parseBlock):
  16500. * jit/JITOpcodes.cpp:
  16501. (JSC::JIT::emit_op_convert_this):
  16502. (JSC::JIT::emitSlow_op_convert_this):
  16503. * jit/JITOpcodes32_64.cpp:
  16504. (JSC::JIT::emit_op_convert_this):
  16505. (JSC::JIT::emitSlow_op_convert_this):
  16506. * llint/LLIntSlowPaths.cpp:
  16507. (JSC::LLInt::LLINT_SLOW_PATH_DECL):
  16508. * llint/LowLevelInterpreter32_64.asm:
  16509. * llint/LowLevelInterpreter64.asm:
  16510. * runtime/JSValue.h:
  16511. (JSValue):
  16512. * runtime/Structure.h:
  16513. (JSC::JSValue::structureOrUndefined):
  16514. (JSC):
  16515. 2012-05-24 Tim Horton <timothy_horton@apple.com>
  16516. Add feature defines for web-facing parts of CSS Regions and Exclusions
  16517. https://bugs.webkit.org/show_bug.cgi?id=87442
  16518. <rdar://problem/10887709>
  16519. Reviewed by Dan Bernstein.
  16520. * Configurations/FeatureDefines.xcconfig:
  16521. 2012-05-24 Geoffrey Garen <ggaren@apple.com>
  16522. WebKit should be lazy-finalization-safe (esp. the DOM)
  16523. https://bugs.webkit.org/show_bug.cgi?id=87456
  16524. Reviewed by Filip Pizlo.
  16525. Lazy finalization adds one twist to weak pointer use:
  16526. A HashMap of weak pointers may contain logically null entries.
  16527. (Weak pointers behave as-if null once their payloads die.)
  16528. Insertion must not assume that a pre-existing entry is
  16529. necessarily valid, and iteration must not assume that all
  16530. entries can be dereferenced.
  16531. (Previously, I thought that it also added a second twist:
  16532. A demand-allocated weak pointer may replace a dead payload
  16533. before the payload's finalizer runs. In that case, when the
  16534. payload's finalizer runs, the payload has already been
  16535. overwritten, and the finalizer should not clear the payload,
  16536. which now points to something new.
  16537. But that's not the case here, since we cancel the old payload's
  16538. finalizer when we over-write it. I've added ASSERTs to verify this
  16539. assumption, in case it ever changes.)
  16540. * API/JSClassRef.cpp:
  16541. (OpaqueJSClass::prototype): No need to specify null; that's the default.
  16542. * API/JSWeakObjectMapRefPrivate.cpp: Use remove, since take() is gone.
  16543. * heap/PassWeak.h:
  16544. (WeakImplAccessor::was): This is no longer a debug-only function, since
  16545. it's required to reason about lazily finalized pointers.
  16546. * heap/Weak.h:
  16547. (JSC::weakAdd):
  16548. (JSC::weakRemove):
  16549. (JSC::weakClear): Added these helper functions for the common idioms of
  16550. what clients want to do in their weak pointer finalizers.
  16551. * jit/JITStubs.cpp:
  16552. (JSC::JITThunks::hostFunctionStub): Use the new idioms. Otherwise, we
  16553. would return NULL for a "zombie" executable weak pointer that was waiting
  16554. for finalization (item (2)), and finalizing a dead executable weak pointer
  16555. would potentially destroy a new, live one (item (1)).
  16556. * runtime/RegExpCache.cpp:
  16557. (JSC::RegExpCache::lookupOrCreate):
  16558. (JSC::RegExpCache::finalize): Ditto.
  16559. (JSC::RegExpCache::invalidateCode): Check for null while iterating. (See
  16560. item (2).)
  16561. * runtime/Structure.cpp:
  16562. (JSC::StructureTransitionTable::contains):
  16563. (JSC::StructureTransitionTable::add): Use get and set instead of add and
  16564. contains, since add and contains are not compatible with lazy finalization.
  16565. * runtime/WeakGCMap.h:
  16566. (WeakGCMap):
  16567. (JSC::WeakGCMap::clear):
  16568. (JSC::WeakGCMap::remove): Removed a bunch of code that was incompatible with
  16569. lazy finalization because I didn't feel like making it compatible, and I had
  16570. no way to test it.
  16571. 2012-05-24 Filip Pizlo <fpizlo@apple.com>
  16572. REGRESSION (r118013-r118031): Loops/Reloads under www.yahoo.com, quits after three tries with error
  16573. https://bugs.webkit.org/show_bug.cgi?id=87327
  16574. Reviewed by Geoffrey Garen.
  16575. If you use AbstractValue::filter(StructureSet) to test subset relationships between TOP and a
  16576. set containing >=2 elements, you're going to have a bad time.
  16577. That's because AbstractValue considers a set with >=2 elements to be equivalent to TOP, in order
  16578. to save space and speed up convergence. So filtering has no effect in this case, which made
  16579. the code think that the abstract value was proving that the structure check was unnecessary.
  16580. The correct thing to do is to use isSubsetOf() on the StructureAbstractValue, which does the
  16581. right thingies for TOP and >=2 elements.
  16582. * dfg/DFGAbstractState.cpp:
  16583. (JSC::DFG::AbstractState::execute):
  16584. * dfg/DFGSpeculativeJIT32_64.cpp:
  16585. (JSC::DFG::SpeculativeJIT::compile):
  16586. * dfg/DFGSpeculativeJIT64.cpp:
  16587. (JSC::DFG::SpeculativeJIT::compile):
  16588. 2012-05-24 Filip Pizlo <fpizlo@apple.com>
  16589. new test fast/js/dfg-arguments-mixed-alias.html fails on JSVALUE32_64
  16590. https://bugs.webkit.org/show_bug.cgi?id=87378
  16591. Reviewed by Gavin Barraclough.
  16592. - Captured variable tracking forgot did not consistently handle arguments, leading to OSR
  16593. badness.
  16594. - Nodes capable of exiting were tracked in a non-monotonic way, leading to compiler errors.
  16595. * dfg/DFGByteCodeParser.cpp:
  16596. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  16597. * dfg/DFGCSEPhase.cpp:
  16598. (JSC::DFG::CSEPhase::CSEPhase):
  16599. (CSEPhase):
  16600. (JSC::DFG::performCSE):
  16601. * dfg/DFGCSEPhase.h:
  16602. (DFG):
  16603. * dfg/DFGCommon.h:
  16604. * dfg/DFGDriver.cpp:
  16605. (JSC::DFG::compile):
  16606. * dfg/DFGGraph.cpp:
  16607. (JSC::DFG::Graph::resetExitStates):
  16608. (DFG):
  16609. * dfg/DFGGraph.h:
  16610. (Graph):
  16611. * dfg/DFGPhase.h:
  16612. (DFG):
  16613. (JSC::DFG::runPhase):
  16614. 2012-05-24 Geoffrey Garen <ggaren@apple.com>
  16615. Made WeakSet per-block instead of per-heap
  16616. https://bugs.webkit.org/show_bug.cgi?id=87401
  16617. Reviewed by Oliver Hunt.
  16618. This allows us fast access to the set of all weak pointers for a block,
  16619. which is a step toward lazy finalization.
  16620. No performance change.
  16621. * heap/Heap.cpp:
  16622. (JSC::Heap::Heap):
  16623. (JSC::Heap::lastChanceToFinalize): Removed the per-heap weak set, since
  16624. it's per-block now.
  16625. (JSC::Heap::markRoots): Delegate weak set visiting to the marked space,
  16626. since it knows how to iterate all blocks.
  16627. (JSC::Heap::collect): Moved the reaping outside of markRoots, since it
  16628. doesn't mark anything.
  16629. Make sure to reset allocators after shrinking, since shrinking may
  16630. deallocate the current allocator.
  16631. * heap/Heap.h:
  16632. (Heap): No more per-heap weak set, since it's per-block now.
  16633. * heap/MarkedBlock.cpp:
  16634. (JSC::MarkedBlock::MarkedBlock):
  16635. * heap/MarkedBlock.h:
  16636. (MarkedBlock):
  16637. (JSC::MarkedBlock::lastChanceToFinalize): Migrated finalization logic
  16638. here from the heap, so the heap doesn't need to know about our internal
  16639. data structures like our weak set.
  16640. (JSC::MarkedBlock::heap):
  16641. (JSC::MarkedBlock::weakSet):
  16642. (JSC::MarkedBlock::shrink):
  16643. (JSC::MarkedBlock::resetAllocator):
  16644. (JSC::MarkedBlock::visitWeakSet):
  16645. (JSC::MarkedBlock::reapWeakSet):
  16646. (JSC::MarkedBlock::sweepWeakSet):
  16647. * heap/MarkedSpace.cpp:
  16648. (JSC::VisitWeakSet::VisitWeakSet):
  16649. (JSC::VisitWeakSet::operator()):
  16650. (VisitWeakSet):
  16651. (JSC):
  16652. (JSC::ReapWeakSet::operator()):
  16653. (JSC::SweepWeakSet::operator()):
  16654. (JSC::LastChanceToFinalize::operator()):
  16655. (JSC::MarkedSpace::lastChanceToFinalize):
  16656. (JSC::ResetAllocator::operator()):
  16657. (JSC::MarkedSpace::resetAllocators):
  16658. (JSC::MarkedSpace::visitWeakSets):
  16659. (JSC::MarkedSpace::reapWeakSets):
  16660. (JSC::MarkedSpace::sweepWeakSets):
  16661. (JSC::Shrink::operator()):
  16662. (JSC::MarkedSpace::shrink):
  16663. * heap/MarkedSpace.h:
  16664. (MarkedSpace): Make sure to account for our weak sets when sweeping,
  16665. shrinking, etc.
  16666. * heap/WeakSet.cpp:
  16667. (JSC):
  16668. * heap/WeakSet.h:
  16669. (WeakSet):
  16670. (JSC::WeakSet::heap):
  16671. (JSC):
  16672. (JSC::WeakSet::lastChanceToFinalize):
  16673. (JSC::WeakSet::visit):
  16674. (JSC::WeakSet::reap):
  16675. (JSC::WeakSet::shrink):
  16676. (JSC::WeakSet::resetAllocator): Inlined some things since they're called
  16677. once per block now instead of once per heap.
  16678. * heap/WeakSetInlines.h:
  16679. (JSC::WeakSet::allocate): Use the per-block weak set since there is no
  16680. per-heap weak set anymore.
  16681. 2012-05-24 Gavin Barraclough <barraclough@apple.com>
  16682. Fix arm build
  16683. Rubber stamped by Geoff Garen
  16684. * dfg/DFGGPRInfo.h:
  16685. (GPRInfo):
  16686. 2012-05-24 Gavin Barraclough <barraclough@apple.com>
  16687. Move cacheFlush from ExecutableAllocator to Assembler classes
  16688. https://bugs.webkit.org/show_bug.cgi?id=87420
  16689. Reviewed by Oliver Hunt.
  16690. Makes more sense there, & remove a pile of #ifdefs.
  16691. * assembler/ARMAssembler.cpp:
  16692. (JSC):
  16693. (JSC::ARMAssembler::cacheFlush):
  16694. * assembler/ARMAssembler.h:
  16695. (ARMAssembler):
  16696. (JSC::ARMAssembler::cacheFlush):
  16697. * assembler/ARMv7Assembler.h:
  16698. (JSC::ARMv7Assembler::relinkJump):
  16699. (JSC::ARMv7Assembler::cacheFlush):
  16700. (ARMv7Assembler):
  16701. (JSC::ARMv7Assembler::setInt32):
  16702. (JSC::ARMv7Assembler::setUInt7ForLoad):
  16703. * assembler/AbstractMacroAssembler.h:
  16704. (JSC::AbstractMacroAssembler::cacheFlush):
  16705. * assembler/LinkBuffer.h:
  16706. (JSC::LinkBuffer::performFinalization):
  16707. * assembler/MIPSAssembler.h:
  16708. (JSC::MIPSAssembler::relinkJump):
  16709. (JSC::MIPSAssembler::relinkCall):
  16710. (JSC::MIPSAssembler::repatchInt32):
  16711. (JSC::MIPSAssembler::cacheFlush):
  16712. (MIPSAssembler):
  16713. * assembler/SH4Assembler.h:
  16714. (JSC::SH4Assembler::repatchCompact):
  16715. (JSC::SH4Assembler::cacheFlush):
  16716. (SH4Assembler):
  16717. * assembler/X86Assembler.h:
  16718. (X86Assembler):
  16719. (JSC::X86Assembler::cacheFlush):
  16720. * jit/ExecutableAllocator.cpp:
  16721. (JSC):
  16722. * jit/ExecutableAllocator.h:
  16723. (ExecutableAllocator):
  16724. 2012-05-24 John Mellor <johnme@chromium.org>
  16725. Font Boosting: Add compile flag and runtime setting
  16726. https://bugs.webkit.org/show_bug.cgi?id=87394
  16727. Reviewed by Adam Barth.
  16728. Add ENABLE_FONT_BOOSTING.
  16729. * Configurations/FeatureDefines.xcconfig:
  16730. 2012-05-24 Allan Sandfeld Jensen <allan.jensen@nokia.com>
  16731. cti_vm_throw gets kicked out by gcc 4.6 -flto
  16732. https://bugs.webkit.org/show_bug.cgi?id=56088
  16733. Reviewed by Darin Adler.
  16734. Add REFERENCED_FROM_ASM to functions only referenced from assembler.
  16735. * dfg/DFGOperations.cpp:
  16736. * jit/HostCallReturnValue.h:
  16737. * jit/JITStubs.h:
  16738. * jit/ThunkGenerators.cpp:
  16739. 2012-05-24 Filip Pizlo <fpizlo@apple.com>
  16740. Incorrect merge of r117542 from dfg opt branch in r118323 is leading to fast/js/dfg-arguments-osr-exit.html failing
  16741. https://bugs.webkit.org/show_bug.cgi?id=87350
  16742. Reviewed by Maciej Stachowiak.
  16743. The dfgopt branch introduced the notion of a local variable being killed because it was aliased
  16744. to the Arguments object as in cases like:
  16745. var a = arguments;
  16746. return a.length;
  16747. This required changes to OSR exit handling - if the variable is dead but aliased to arguments, then
  16748. OSR exit should reify the arguments. But meanwhile, in tip of tree we introduced special handling for
  16749. dead variables on OSR exit. When the two were merged in r118323, the structure of the if/else branches
  16750. ended up being such that we would treat dead arguments variables as totally dead as opposed to treating
  16751. them as variables that need arguments reification.
  16752. This fixes the structure of the relevant if/else block so that variables that are dead-but-arguments
  16753. end up being treated as reified arguments objects, while variables that are dead but not aliased to
  16754. arguments are treated as tip of tree would have treated them (initialize to Undefined).
  16755. * dfg/DFGSpeculativeJIT.cpp:
  16756. (JSC::DFG::SpeculativeJIT::compile):
  16757. 2012-05-24 Csaba Osztrogonác <ossy@webkit.org>
  16758. Unreviewed 32 bit buildfix after r118325.
  16759. * dfg/DFGSpeculativeJIT32_64.cpp:
  16760. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): Use ASSERT_UNUSED instead ASSERT.
  16761. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16762. DFG operationTearOffActivation should return after handling the null activation case
  16763. https://bugs.webkit.org/show_bug.cgi?id=87348
  16764. <rdar://problem/11522295>
  16765. Reviewed by Oliver Hunt.
  16766. * dfg/DFGOperations.cpp:
  16767. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16768. Unreviewed, merge the arguments fix in r118138 to get bots green.
  16769. * dfg/DFGArgumentsSimplificationPhase.cpp:
  16770. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  16771. 2012-05-20 Filip Pizlo <fpizlo@apple.com>
  16772. DFG CFA should record if a node can OSR exit
  16773. https://bugs.webkit.org/show_bug.cgi?id=86905
  16774. Reviewed by Oliver Hunt.
  16775. Merged r117931 from dfgopt.
  16776. Adds a NodeFlag that denotes nodes that are known to not have OSR exits.
  16777. This ought to aid any backwards analyses that need to know when a
  16778. backward flow merge might happen due to a side exit.
  16779. Also added assertions into speculationCheck() that ensure that we did not
  16780. mark a node as non-exiting and then promptly compile in an exit. This
  16781. helped catch some minor bugs where we were doing unnecessary speculation
  16782. checks.
  16783. This is a perf-neutral change. The speculation checks that this removes
  16784. were not on hot paths of major benchmarks.
  16785. * bytecode/PredictedType.h:
  16786. (JSC):
  16787. (JSC::isAnyPrediction):
  16788. * dfg/DFGAbstractState.cpp:
  16789. (JSC::DFG::AbstractState::execute):
  16790. * dfg/DFGAbstractState.h:
  16791. (JSC::DFG::AbstractState::speculateInt32Unary):
  16792. (AbstractState):
  16793. (JSC::DFG::AbstractState::speculateNumberUnary):
  16794. (JSC::DFG::AbstractState::speculateBooleanUnary):
  16795. (JSC::DFG::AbstractState::speculateInt32Binary):
  16796. (JSC::DFG::AbstractState::speculateNumberBinary):
  16797. * dfg/DFGNode.h:
  16798. (JSC::DFG::Node::mergeFlags):
  16799. (JSC::DFG::Node::filterFlags):
  16800. (Node):
  16801. (JSC::DFG::Node::setCanExit):
  16802. (JSC::DFG::Node::canExit):
  16803. * dfg/DFGNodeFlags.cpp:
  16804. (JSC::DFG::nodeFlagsAsString):
  16805. * dfg/DFGNodeFlags.h:
  16806. (DFG):
  16807. * dfg/DFGSpeculativeJIT.cpp:
  16808. (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
  16809. (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
  16810. (JSC::DFG::SpeculativeJIT::compileValueToInt32):
  16811. * dfg/DFGSpeculativeJIT.h:
  16812. (JSC::DFG::SpeculativeJIT::speculationCheck):
  16813. (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
  16814. (JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
  16815. (SpeculativeJIT):
  16816. * dfg/DFGSpeculativeJIT32_64.cpp:
  16817. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  16818. (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
  16819. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  16820. (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
  16821. (JSC::DFG::SpeculativeJIT::compile):
  16822. * dfg/DFGSpeculativeJIT64.cpp:
  16823. (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
  16824. (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
  16825. (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
  16826. (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
  16827. (JSC::DFG::SpeculativeJIT::compile):
  16828. 2012-05-20 Filip Pizlo <fpizlo@apple.com>
  16829. DFG should not do unnecessary indirections when storing to objects
  16830. https://bugs.webkit.org/show_bug.cgi?id=86959
  16831. Reviewed by Oliver Hunt.
  16832. Merged r117819 from dfgopt.
  16833. * dfg/DFGByteCodeParser.cpp:
  16834. (JSC::DFG::ByteCodeParser::parseBlock):
  16835. * dfg/DFGCSEPhase.cpp:
  16836. (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
  16837. * dfg/DFGSpeculativeJIT32_64.cpp:
  16838. (JSC::DFG::SpeculativeJIT::compile):
  16839. * dfg/DFGSpeculativeJIT64.cpp:
  16840. (JSC::DFG::SpeculativeJIT::compile):
  16841. 2012-05-17 Filip Pizlo <fpizlo@apple.com>
  16842. DFG should optimize aliased uses of the Arguments object of the current call frame
  16843. https://bugs.webkit.org/show_bug.cgi?id=86552
  16844. Reviewed by Geoff Garen.
  16845. Merged r117542 and r117543 from dfgopt.
  16846. Performs must-alias and escape analysis on uses of CreateArguments, and if
  16847. a variable is must-aliased to CreateArguments and does not escape, then we
  16848. turn all uses of that variable into direct arguments accesses.
  16849. 36% speed-up on V8/earley leading to a 2.3% speed-up overall in V8.
  16850. * bytecode/CodeBlock.h:
  16851. (JSC::CodeBlock::uncheckedArgumentsRegister):
  16852. * bytecode/ValueRecovery.h:
  16853. (JSC::ValueRecovery::argumentsThatWereNotCreated):
  16854. (ValueRecovery):
  16855. (JSC::ValueRecovery::dump):
  16856. * dfg/DFGAbstractState.cpp:
  16857. (JSC::DFG::AbstractState::execute):
  16858. * dfg/DFGAdjacencyList.h:
  16859. (AdjacencyList):
  16860. (JSC::DFG::AdjacencyList::removeEdgeFromBag):
  16861. * dfg/DFGArgumentsSimplificationPhase.cpp:
  16862. (JSC::DFG::ArgumentsSimplificationPhase::run):
  16863. (ArgumentsSimplificationPhase):
  16864. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
  16865. (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUses):
  16866. (JSC::DFG::ArgumentsSimplificationPhase::observeProperArgumentsUse):
  16867. (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
  16868. (JSC::DFG::ArgumentsSimplificationPhase::removeArgumentsReferencingPhantomChild):
  16869. * dfg/DFGAssemblyHelpers.h:
  16870. (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
  16871. (AssemblyHelpers):
  16872. * dfg/DFGByteCodeParser.cpp:
  16873. (JSC::DFG::ByteCodeParser::parseBlock):
  16874. * dfg/DFGCFGSimplificationPhase.cpp:
  16875. (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
  16876. * dfg/DFGGPRInfo.h:
  16877. (GPRInfo):
  16878. * dfg/DFGGraph.cpp:
  16879. (JSC::DFG::Graph::collectGarbage):
  16880. (DFG):
  16881. * dfg/DFGGraph.h:
  16882. (Graph):
  16883. (JSC::DFG::Graph::executableFor):
  16884. (JSC::DFG::Graph::argumentsRegisterFor):
  16885. (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
  16886. (JSC::DFG::Graph::clobbersWorld):
  16887. * dfg/DFGNode.h:
  16888. (JSC::DFG::Node::hasHeapPrediction):
  16889. * dfg/DFGNodeType.h:
  16890. (DFG):
  16891. * dfg/DFGOSRExitCompiler.cpp:
  16892. * dfg/DFGOSRExitCompiler.h:
  16893. (JSC::DFG::OSRExitCompiler::OSRExitCompiler):
  16894. (OSRExitCompiler):
  16895. * dfg/DFGOSRExitCompiler32_64.cpp:
  16896. (JSC::DFG::OSRExitCompiler::compileExit):
  16897. * dfg/DFGOSRExitCompiler64.cpp:
  16898. (JSC::DFG::OSRExitCompiler::compileExit):
  16899. * dfg/DFGOperations.cpp:
  16900. * dfg/DFGPredictionPropagationPhase.cpp:
  16901. (JSC::DFG::PredictionPropagationPhase::propagate):
  16902. * dfg/DFGSpeculativeJIT.cpp:
  16903. (JSC::DFG::ValueSource::dump):
  16904. (JSC::DFG::SpeculativeJIT::compile):
  16905. (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
  16906. * dfg/DFGSpeculativeJIT.h:
  16907. * dfg/DFGSpeculativeJIT32_64.cpp:
  16908. (JSC::DFG::SpeculativeJIT::compile):
  16909. * dfg/DFGSpeculativeJIT64.cpp:
  16910. (JSC::DFG::SpeculativeJIT::compile):
  16911. * dfg/DFGVariableAccessData.h:
  16912. (JSC::DFG::VariableAccessData::VariableAccessData):
  16913. (JSC::DFG::VariableAccessData::mergeIsArgumentsAlias):
  16914. (VariableAccessData):
  16915. (JSC::DFG::VariableAccessData::isArgumentsAlias):
  16916. * jit/JITOpcodes.cpp:
  16917. (JSC::JIT::emitSlow_op_get_argument_by_val):
  16918. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16919. DFGCapabilities should not try to get an arguments register from code blocks that don't have one
  16920. https://bugs.webkit.org/show_bug.cgi?id=87332
  16921. Reviewed by Andy Estes.
  16922. * dfg/DFGCapabilities.h:
  16923. (JSC::DFG::canInlineOpcode):
  16924. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16925. DFG should have sparse conditional constant propagation
  16926. https://bugs.webkit.org/show_bug.cgi?id=86580
  16927. Reviewed by Oliver Hunt.
  16928. Merged r117370 from dfgopt.
  16929. This enhances CFA so that if it suspects at any point during the fixpoint that a
  16930. branch will only go one way, then it only propagates in that one way.
  16931. This vastly increases the opportunities for CFG simplification. For example, it
  16932. enables us to evaporate this loop:
  16933. for (var i = 0; i < 1; ++i) doThings(i);
  16934. As a result, it uncovered loads of bugs in the CFG simplifier. In particular:
  16935. - Phi fixup was assuming that all Phis worth fixing up are shouldGenerate().
  16936. That's not true; we also fixup Phis that are dead.
  16937. - GetLocal fixup was assuming that it's only necessary to rewire links to a
  16938. GetLocal, and that the GetLocal's own links don't need to be rewired. Untrue,
  16939. because the GetLocal may not be rewirable (first block has no GetLocal for r42
  16940. but second block does have a GetLocal), in which case it will refer to a Phi
  16941. in the second block. We need it to refer to a Phi from the first block to
  16942. ensure that subsequent transformations work.
  16943. - Tail operand fixup was ignoring the fact that Phis in successors may contain
  16944. references to the children of our tail variables. Hence, successor Phi child
  16945. substitution needs to use the original second block variable table as its
  16946. prior, rather than trying to reconstruct the prior later (since by that point
  16947. the children of the second block's tail variables will have been fixed up, so
  16948. we will not know what the prior would have been).
  16949. * dfg/DFGAbstractState.cpp:
  16950. (JSC::DFG::AbstractState::beginBasicBlock):
  16951. (JSC::DFG::AbstractState::endBasicBlock):
  16952. (JSC::DFG::AbstractState::reset):
  16953. (JSC::DFG::AbstractState::execute):
  16954. (JSC::DFG::AbstractState::mergeToSuccessors):
  16955. * dfg/DFGAbstractState.h:
  16956. (JSC::DFG::AbstractState::branchDirectionToString):
  16957. (AbstractState):
  16958. * dfg/DFGCFGSimplificationPhase.cpp:
  16959. (JSC::DFG::CFGSimplificationPhase::run):
  16960. (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
  16961. (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::OperandSubstitution):
  16962. (OperandSubstitution):
  16963. (JSC::DFG::CFGSimplificationPhase::skipGetLocal):
  16964. (JSC::DFG::CFGSimplificationPhase::recordPossibleIncomingReference):
  16965. (CFGSimplificationPhase):
  16966. (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
  16967. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  16968. * dfg/DFGGraph.h:
  16969. (JSC::DFG::Graph::changeEdge):
  16970. 2012-05-23 Ojan Vafai <ojan@chromium.org>
  16971. add back the ability to disable flexbox
  16972. https://bugs.webkit.org/show_bug.cgi?id=87147
  16973. Reviewed by Tony Chang.
  16974. * Configurations/FeatureDefines.xcconfig:
  16975. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16976. Unreviewed, fix Windows build.
  16977. * bytecode/CodeBlock.h:
  16978. * dfg/DFGCapabilities.h:
  16979. (JSC::DFG::canCompileOpcode):
  16980. (JSC::DFG::canCompileOpcodes):
  16981. * dfg/DFGCommon.h:
  16982. (DFG):
  16983. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  16984. DFG should optimize inlined uses of arguments.length and arguments[i]
  16985. https://bugs.webkit.org/show_bug.cgi?id=86327
  16986. Reviewed by Gavin Barraclough.
  16987. Merged r117017 from dfgopt.
  16988. Turns inlined uses of arguments.length into a constant.
  16989. Turns inlined uses of arguments[constant] into a direct reference to the
  16990. argument.
  16991. Big win on micro-benchmarks. Not yet a win on V8 because the hot uses of
  16992. arguments.length and arguments[i] are aliased. I'll leave the aliasing
  16993. optimizations to a later patch.
  16994. * CMakeLists.txt:
  16995. * GNUmakefile.list.am:
  16996. * JavaScriptCore.xcodeproj/project.pbxproj:
  16997. * Target.pri:
  16998. * bytecode/DFGExitProfile.h:
  16999. (FrequentExitSite):
  17000. (JSC::DFG::FrequentExitSite::FrequentExitSite):
  17001. (JSC::DFG::QueryableExitProfile::hasExitSite):
  17002. (QueryableExitProfile):
  17003. * dfg/DFGAbstractState.cpp:
  17004. (JSC::DFG::AbstractState::execute):
  17005. * dfg/DFGArgumentsSimplificationPhase.cpp: Added.
  17006. (DFG):
  17007. (ArgumentsSimplificationPhase):
  17008. (JSC::DFG::ArgumentsSimplificationPhase::ArgumentsSimplificationPhase):
  17009. (JSC::DFG::ArgumentsSimplificationPhase::run):
  17010. (JSC::DFG::performArgumentsSimplification):
  17011. * dfg/DFGArgumentsSimplificationPhase.h: Added.
  17012. (DFG):
  17013. * dfg/DFGAssemblyHelpers.cpp:
  17014. (JSC::DFG::AssemblyHelpers::executableFor):
  17015. (DFG):
  17016. * dfg/DFGAssemblyHelpers.h:
  17017. (AssemblyHelpers):
  17018. * dfg/DFGByteCodeParser.cpp:
  17019. (JSC::DFG::ByteCodeParser::parseBlock):
  17020. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  17021. * dfg/DFGCSEPhase.cpp:
  17022. (JSC::DFG::CSEPhase::getLocalLoadElimination):
  17023. (JSC::DFG::CSEPhase::performNodeCSE):
  17024. * dfg/DFGDriver.cpp:
  17025. (JSC::DFG::compile):
  17026. * dfg/DFGGraph.h:
  17027. (JSC::DFG::Graph::Graph):
  17028. (JSC::DFG::Graph::executableFor):
  17029. (Graph):
  17030. (JSC::DFG::Graph::clobbersWorld):
  17031. * dfg/DFGNode.h:
  17032. (JSC::DFG::Node::convertToConstant):
  17033. (JSC::DFG::Node::convertToGetLocalUnlinked):
  17034. (Node):
  17035. (JSC::DFG::Node::unlinkedLocal):
  17036. * dfg/DFGNodeType.h:
  17037. (DFG):
  17038. * dfg/DFGOSRExit.cpp:
  17039. (JSC::DFG::OSRExit::considerAddingAsFrequentExitSiteSlow):
  17040. * dfg/DFGPredictionPropagationPhase.cpp:
  17041. (JSC::DFG::PredictionPropagationPhase::propagate):
  17042. * dfg/DFGSpeculativeJIT32_64.cpp:
  17043. (JSC::DFG::SpeculativeJIT::compile):
  17044. * dfg/DFGSpeculativeJIT64.cpp:
  17045. (JSC::DFG::SpeculativeJIT::compile):
  17046. 2012-05-13 Filip Pizlo <fpizlo@apple.com>
  17047. DFG should be able to optimize foo.apply(bar, arguments)
  17048. https://bugs.webkit.org/show_bug.cgi?id=86306
  17049. Reviewed by Gavin Barraclough.
  17050. Merge r116912 from dfgopt.
  17051. Enables compilation of op_jneq_ptr and some forms of op_call_varargs.
  17052. Also includes a bunch of bug fixes that were made necessary by the increased
  17053. pressure on the CFG simplifier.
  17054. This is a 1-2% win on V8.
  17055. * bytecode/CodeBlock.cpp:
  17056. (JSC::CodeBlock::printCallOp):
  17057. (JSC::CodeBlock::CodeBlock):
  17058. (JSC::ProgramCodeBlock::canCompileWithDFGInternal):
  17059. (JSC::EvalCodeBlock::canCompileWithDFGInternal):
  17060. (JSC::FunctionCodeBlock::canCompileWithDFGInternal):
  17061. * bytecode/CodeBlock.h:
  17062. (CodeBlock):
  17063. (JSC::CodeBlock::canCompileWithDFG):
  17064. (JSC::CodeBlock::canCompileWithDFGState):
  17065. (ProgramCodeBlock):
  17066. (EvalCodeBlock):
  17067. (FunctionCodeBlock):
  17068. * dfg/DFGAbstractState.cpp:
  17069. (JSC::DFG::AbstractState::execute):
  17070. * dfg/DFGByteCodeParser.cpp:
  17071. (JSC::DFG::ByteCodeParser::parseBlock):
  17072. (JSC::DFG::ByteCodeParser::processPhiStack):
  17073. (JSC::DFG::ByteCodeParser::parse):
  17074. * dfg/DFGCFGSimplificationPhase.cpp:
  17075. (JSC::DFG::CFGSimplificationPhase::run):
  17076. (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
  17077. (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
  17078. (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
  17079. * dfg/DFGCSEPhase.cpp:
  17080. (JSC::DFG::CSEPhase::getLocalLoadElimination):
  17081. (CSEPhase):
  17082. (JSC::DFG::CSEPhase::setReplacement):
  17083. (JSC::DFG::CSEPhase::performNodeCSE):
  17084. * dfg/DFGCapabilities.cpp:
  17085. (JSC::DFG::debugFail):
  17086. (DFG):
  17087. (JSC::DFG::canHandleOpcodes):
  17088. (JSC::DFG::canCompileOpcodes):
  17089. (JSC::DFG::canInlineOpcodes):
  17090. * dfg/DFGCapabilities.h:
  17091. (JSC::DFG::canCompileOpcode):
  17092. (JSC::DFG::canInlineOpcode):
  17093. (DFG):
  17094. (JSC::DFG::canCompileOpcodes):
  17095. (JSC::DFG::canCompileEval):
  17096. (JSC::DFG::canCompileProgram):
  17097. (JSC::DFG::canCompileFunctionForCall):
  17098. (JSC::DFG::canCompileFunctionForConstruct):
  17099. * dfg/DFGCommon.h:
  17100. * dfg/DFGGraph.cpp:
  17101. (JSC::DFG::Graph::dump):
  17102. * dfg/DFGNodeType.h:
  17103. (DFG):
  17104. * dfg/DFGPredictionPropagationPhase.cpp:
  17105. (JSC::DFG::PredictionPropagationPhase::propagate):
  17106. * dfg/DFGSpeculativeJIT32_64.cpp:
  17107. (JSC::DFG::SpeculativeJIT::compile):
  17108. * dfg/DFGSpeculativeJIT64.cpp:
  17109. (JSC::DFG::SpeculativeJIT::emitCall):
  17110. (JSC::DFG::SpeculativeJIT::compile):
  17111. * dfg/DFGValidate.cpp:
  17112. (Validate):
  17113. (JSC::DFG::Validate::validate):
  17114. (JSC::DFG::Validate::checkOperand):
  17115. (JSC::DFG::Validate::reportValidationContext):
  17116. * jit/JIT.cpp:
  17117. (JSC::JIT::emitOptimizationCheck):
  17118. (JSC::JIT::privateCompileSlowCases):
  17119. (JSC::JIT::privateCompile):
  17120. * jit/JIT.h:
  17121. * jit/JITArithmetic.cpp:
  17122. (JSC::JIT::compileBinaryArithOp):
  17123. * jit/JITPropertyAccess.cpp:
  17124. (JSC::JIT::privateCompilePutByIdTransition):
  17125. * jit/JITPropertyAccess32_64.cpp:
  17126. (JSC::JIT::privateCompilePutByIdTransition):
  17127. * tools/CodeProfile.cpp:
  17128. (JSC::CodeProfile::sample):
  17129. 2012-05-23 Geoffrey Garen <ggaren@apple.com>
  17130. Refactored WeakBlock to use malloc, clarify behavior
  17131. https://bugs.webkit.org/show_bug.cgi?id=87318
  17132. Reviewed by Filip Pizlo.
  17133. We want to use malloc so we can make these smaller than 4KB,
  17134. since an individual MarkedBlock will usually have fewer than
  17135. 4KB worth of weak pointers.
  17136. * heap/Heap.cpp:
  17137. (JSC::Heap::markRoots): Renamed visitLiveWeakImpls to visit, since
  17138. we no longer need to distinguish from "visitDeadWeakImpls".
  17139. Renamed "visitDeadWeakImpls" to "reap" because we're not actually
  17140. doing any visiting -- we're just tagging things as dead.
  17141. * heap/WeakBlock.cpp:
  17142. (JSC::WeakBlock::create):
  17143. (JSC::WeakBlock::destroy):
  17144. (JSC::WeakBlock::WeakBlock): Malloc!
  17145. (JSC::WeakBlock::visit):
  17146. (JSC::WeakBlock::reap): Renamed as above.
  17147. * heap/WeakBlock.h:
  17148. (WeakBlock): Reduced to 3KB, as explained above.
  17149. * heap/WeakSet.cpp:
  17150. (JSC::WeakSet::visit):
  17151. (JSC::WeakSet::reap):
  17152. * heap/WeakSet.h:
  17153. (WeakSet): Updated for renames, and to match WebKit style.
  17154. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  17155. Use after free in JSC::DFG::ByteCodeParser::processPhiStack
  17156. https://bugs.webkit.org/show_bug.cgi?id=87312
  17157. <rdar://problem/11518848>
  17158. Reviewed by Oliver Hunt.
  17159. * dfg/DFGByteCodeParser.cpp:
  17160. (JSC::DFG::ByteCodeParser::processPhiStack):
  17161. (JSC::DFG::ByteCodeParser::parse):
  17162. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  17163. It should be possible to make C function calls from DFG code on ARM in debug mode
  17164. https://bugs.webkit.org/show_bug.cgi?id=87313
  17165. Reviewed by Gavin Barraclough.
  17166. * dfg/DFGSpeculativeJIT.h:
  17167. (SpeculativeJIT):
  17168. 2012-05-11 Filip Pizlo <fpizlo@apple.com>
  17169. DFG should be able to inline functions that use arguments reflectively
  17170. https://bugs.webkit.org/show_bug.cgi?id=86132
  17171. Reviewed by Oliver Hunt.
  17172. Merged r116838 from dfgopt.
  17173. This turns on inlining of functions that use arguments reflectively, but it
  17174. does not do any of the obvious optimizations that this exposes. I'll save that
  17175. for another patch - the important thing for now is that this contains all of
  17176. the plumbing necessary to make this kind of inlining sound even in bizarro
  17177. cases like an inline callee escaping the arguments object to parts of the
  17178. inline caller where the arguments are otherwise dead. Or even more fun cases
  17179. like where you've inlined to an inline stack that is three-deep, and the
  17180. function on top of the inline stack reflectively accesses the arguments of a
  17181. function that is in the middle of the inline stack. Any subsequent
  17182. optimizations that we do for the obvious cases of arguments usage in inline
  17183. functions will have to take care not to break the baseline functionality that
  17184. this patch plumbs together.
  17185. * bytecode/CodeBlock.cpp:
  17186. (JSC::CodeBlock::printCallOp):
  17187. (JSC::CodeBlock::dump):
  17188. * bytecode/CodeBlock.h:
  17189. * dfg/DFGAssemblyHelpers.h:
  17190. (JSC::DFG::AssemblyHelpers::argumentsRegisterFor):
  17191. (AssemblyHelpers):
  17192. * dfg/DFGByteCodeParser.cpp:
  17193. (InlineStackEntry):
  17194. (JSC::DFG::ByteCodeParser::handleCall):
  17195. (JSC::DFG::ByteCodeParser::handleInlining):
  17196. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  17197. (JSC::DFG::ByteCodeParser::parse):
  17198. * dfg/DFGCCallHelpers.h:
  17199. (JSC::DFG::CCallHelpers::setupArgumentsWithExecState):
  17200. (CCallHelpers):
  17201. * dfg/DFGCapabilities.h:
  17202. (JSC::DFG::canInlineOpcode):
  17203. * dfg/DFGDriver.cpp:
  17204. (JSC::DFG::compile):
  17205. * dfg/DFGFixupPhase.cpp:
  17206. (JSC::DFG::FixupPhase::fixupNode):
  17207. * dfg/DFGOperations.cpp:
  17208. * dfg/DFGOperations.h:
  17209. * dfg/DFGSpeculativeJIT.h:
  17210. (JSC::DFG::SpeculativeJIT::callOperation):
  17211. * dfg/DFGSpeculativeJIT32_64.cpp:
  17212. (JSC::DFG::SpeculativeJIT::compile):
  17213. * dfg/DFGSpeculativeJIT64.cpp:
  17214. (JSC::DFG::SpeculativeJIT::compile):
  17215. * interpreter/CallFrame.cpp:
  17216. (JSC):
  17217. (JSC::CallFrame::someCodeBlockForPossiblyInlinedCode):
  17218. * interpreter/CallFrame.h:
  17219. (ExecState):
  17220. (JSC::ExecState::someCodeBlockForPossiblyInlinedCode):
  17221. * interpreter/Interpreter.cpp:
  17222. (JSC::Interpreter::retrieveArgumentsFromVMCode):
  17223. * runtime/Arguments.cpp:
  17224. (JSC::Arguments::tearOff):
  17225. (JSC):
  17226. (JSC::Arguments::tearOffForInlineCallFrame):
  17227. * runtime/Arguments.h:
  17228. (Arguments):
  17229. (JSC::Arguments::create):
  17230. (JSC::Arguments::finishCreation):
  17231. (JSC):
  17232. 2012-05-23 Filip Pizlo <fpizlo@apple.com>
  17233. Every OSR exit on ARM results in a crash
  17234. https://bugs.webkit.org/show_bug.cgi?id=87307
  17235. Reviewed by Geoffrey Garen.
  17236. * dfg/DFGThunks.cpp:
  17237. (JSC::DFG::osrExitGenerationThunkGenerator):
  17238. 2012-05-23 Geoffrey Garen <ggaren@apple.com>
  17239. Refactored heap tear-down to use normal value semantics (i.e., destructors)
  17240. https://bugs.webkit.org/show_bug.cgi?id=87302
  17241. Reviewed by Oliver Hunt.
  17242. This is a step toward incremental DOM finalization.
  17243. * heap/CopiedSpace.cpp:
  17244. (JSC::CopiedSpace::~CopiedSpace):
  17245. * heap/CopiedSpace.h:
  17246. (CopiedSpace): Just use our destructor, instead of relying on the heap
  17247. to send us a special message at a special time.
  17248. * heap/Heap.cpp:
  17249. (JSC::Heap::Heap): Use OwnPtr for m_markListSet because this is not Sparta.
  17250. (JSC::Heap::~Heap): No need for delete or freeAllBlocks because normal
  17251. destructors do this work automatically now.
  17252. (JSC::Heap::lastChanceToFinalize): Just call lastChanceToFinalize on our
  17253. sub-objects, and assume it does the right thing. This improves encapsulation,
  17254. so we can add items requiring finalization to our sub-objects.
  17255. * heap/Heap.h: Moved m_blockAllocator to get the right destruction order.
  17256. * heap/MarkedSpace.cpp:
  17257. (Take):
  17258. (JSC):
  17259. (JSC::Take::Take):
  17260. (JSC::Take::operator()):
  17261. (JSC::Take::returnValue): Moved to the top of the file so it can be used
  17262. in another function.
  17263. (JSC::MarkedSpace::~MarkedSpace): Delete all outstanding memory, like a good
  17264. destructor should.
  17265. (JSC::MarkedSpace::lastChanceToFinalize): Moved some code here from the heap,
  17266. since it pertains to our internal implementation details.
  17267. * heap/MarkedSpace.h:
  17268. (MarkedSpace):
  17269. * heap/WeakBlock.cpp:
  17270. (JSC::WeakBlock::lastChanceToFinalize):
  17271. * heap/WeakBlock.h:
  17272. (WeakBlock):
  17273. * heap/WeakSet.cpp:
  17274. (JSC::WeakSet::lastChanceToFinalize):
  17275. * heap/WeakSet.h:
  17276. (WeakSet): Stop using a special freeAllBlocks() callback and just implement
  17277. lastChanceToFinalize.
  17278. 2011-05-22 Geoffrey Garen <ggaren@apple.com>
  17279. Encapsulated some calculations for whether portions of the heap are empty
  17280. https://bugs.webkit.org/show_bug.cgi?id=87210
  17281. Reviewed by Gavin Barraclough.
  17282. This is a step toward incremental DOM finalization.
  17283. * heap/Heap.cpp:
  17284. (JSC::Heap::~Heap): Explicitly call freeAllBlocks() instead of relying
  17285. implicitly on all blocks thinking they're empty. In future, we may
  17286. choose to tear down the heap without first setting all data structures
  17287. to "empty".
  17288. * heap/MarkedBlock.h:
  17289. (JSC::MarkedBlock::isEmpty):
  17290. (JSC::MarkedBlock::gatherDirtyCells): Renamed markCountIsZero to isEmpty,
  17291. in preparation for making it check for outstanding finalizers in addition
  17292. to marked cells.
  17293. * heap/MarkedSpace.cpp:
  17294. (Take):
  17295. (JSC::Take::Take):
  17296. (JSC::Take::operator()):
  17297. (JSC::Take::returnValue):
  17298. (JSC::MarkedSpace::shrink):
  17299. (JSC::MarkedSpace::freeAllBlocks): Refactored the "Take" functor to support
  17300. a conditional isEmpty check, so it dould be shared by shrink() and freeAllBlocks().
  17301. * heap/WeakBlock.cpp:
  17302. (JSC::WeakBlock::WeakBlock):
  17303. (JSC::WeakBlock::visitLiveWeakImpls):
  17304. (JSC::WeakBlock::visitDeadWeakImpls):
  17305. * heap/WeakBlock.h:
  17306. (WeakBlock):
  17307. (JSC::WeakBlock::isEmpty):
  17308. * heap/WeakSet.cpp:
  17309. (JSC::WeakSet::sweep):
  17310. (JSC::WeakSet::shrink): Use isEmpty(), in preparation for changes in
  17311. its implementation.
  17312. 2012-05-23 Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
  17313. [Qt] Remove references to $$QT_SOURCE_TREE
  17314. With a modularized Qt, it's ambigious. What we really want is qtbase,
  17315. which qtcore is a proxy for (we assume it will always live in qtbase).
  17316. Reviewed by Tor Arne Vestbø.
  17317. * JavaScriptCore.pri:
  17318. * Target.pri:
  17319. 2012-05-09 Filip Pizlo <fpizlo@apple.com>
  17320. DFG should allow inlining in case of certain arity mismatches
  17321. https://bugs.webkit.org/show_bug.cgi?id=86059
  17322. Reviewed by Geoff Garen.
  17323. Merge r116620 from dfgopt.
  17324. * dfg/DFGByteCodeParser.cpp:
  17325. (JSC::DFG::ByteCodeParser::handleInlining):
  17326. 2012-05-08 Filip Pizlo <fpizlo@apple.com>
  17327. DFG variable capture analysis should work even if the variables arose through inlining
  17328. https://bugs.webkit.org/show_bug.cgi?id=85945
  17329. Reviewed by Oliver Hunt.
  17330. Merged r116555 from dfgopt.
  17331. This just changes how the DFG queries whether a variable is captured. It does not
  17332. change any user-visible behavior.
  17333. As part of this change, I further solidified the policy that the CFA behaves in an
  17334. undefined way for captured locals and queries about their values will not yield
  17335. reliable results. This will likely be changed in the future, but for now it makes
  17336. sense.
  17337. One fun part about this change is that it recognizes that the same variable may
  17338. be both captured and not, at the same time, because their live interval spans
  17339. inlining boundaries. This only happens in the case of arguments to functions that
  17340. capture their arguments, and this change treats them with just the right touch of
  17341. conservatism: they will be treated as if captured by the caller as well as the
  17342. callee.
  17343. Finally, this also adds captured variable reasoning to the InlineCallFrame, which
  17344. I thought might be useful for later tooling.
  17345. This is perf-neutral, since it does it does not make the DFG take advantage of this
  17346. new functionality in any way. In particular, it is still the case that the DFG will
  17347. not inline functions that use arguments reflectively or that create activations.
  17348. * bytecode/CodeBlock.h:
  17349. (CodeBlock):
  17350. (JSC::CodeBlock::needsActivation):
  17351. (JSC::CodeBlock::argumentIsCaptured):
  17352. (JSC::CodeBlock::localIsCaptured):
  17353. (JSC::CodeBlock::isCaptured):
  17354. * bytecode/CodeOrigin.h:
  17355. (InlineCallFrame):
  17356. * dfg/DFGAbstractState.cpp:
  17357. (JSC::DFG::AbstractState::initialize):
  17358. (JSC::DFG::AbstractState::endBasicBlock):
  17359. (JSC::DFG::AbstractState::execute):
  17360. (JSC::DFG::AbstractState::merge):
  17361. * dfg/DFGByteCodeParser.cpp:
  17362. (JSC::DFG::ByteCodeParser::newVariableAccessData):
  17363. (JSC::DFG::ByteCodeParser::getLocal):
  17364. (JSC::DFG::ByteCodeParser::setLocal):
  17365. (JSC::DFG::ByteCodeParser::getArgument):
  17366. (JSC::DFG::ByteCodeParser::setArgument):
  17367. (JSC::DFG::ByteCodeParser::flushArgument):
  17368. (JSC::DFG::ByteCodeParser::parseBlock):
  17369. (JSC::DFG::ByteCodeParser::processPhiStack):
  17370. (JSC::DFG::ByteCodeParser::fixVariableAccessPredictions):
  17371. (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
  17372. * dfg/DFGCFGSimplificationPhase.cpp:
  17373. (CFGSimplificationPhase):
  17374. (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
  17375. (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
  17376. (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
  17377. * dfg/DFGCommon.h:
  17378. * dfg/DFGFixupPhase.cpp:
  17379. (JSC::DFG::FixupPhase::fixupNode):
  17380. * dfg/DFGGraph.cpp:
  17381. (JSC::DFG::Graph::nameOfVariableAccessData):
  17382. * dfg/DFGGraph.h:
  17383. (JSC::DFG::Graph::needsActivation):
  17384. (JSC::DFG::Graph::usesArguments):
  17385. * dfg/DFGPredictionPropagationPhase.cpp:
  17386. (JSC::DFG::PredictionPropagationPhase::doRoundOfDoubleVoting):
  17387. * dfg/DFGSpeculativeJIT.cpp:
  17388. (JSC::DFG::SpeculativeJIT::compile):
  17389. * dfg/DFGSpeculativeJIT32_64.cpp:
  17390. (JSC::DFG::SpeculativeJIT::compile):
  17391. * dfg/DFGSpeculativeJIT64.cpp:
  17392. (JSC::DFG::SpeculativeJIT::compile):
  17393. * dfg/DFGVariableAccessData.h:
  17394. (JSC::DFG::VariableAccessData::VariableAccessData):
  17395. (JSC::DFG::VariableAccessData::mergeIsCaptured):
  17396. (VariableAccessData):
  17397. (JSC::DFG::VariableAccessData::isCaptured):
  17398. 2012-05-08 Filip Pizlo <fpizlo@apple.com>
  17399. DFG should support op_get_argument_by_val and op_get_arguments_length
  17400. https://bugs.webkit.org/show_bug.cgi?id=85911
  17401. Reviewed by Oliver Hunt.
  17402. Merged r116467 from dfgopt.
  17403. This adds a simple and relatively conservative implementation of op_get_argument_by_val
  17404. and op_get_arguments_length. We can optimize these later. For now it's great to have
  17405. the additional coverage.
  17406. This patch appears to be perf-neutral.
  17407. * dfg/DFGAbstractState.cpp:
  17408. (JSC::DFG::AbstractState::execute):
  17409. * dfg/DFGAssemblyHelpers.h:
  17410. (JSC::DFG::AssemblyHelpers::addressFor):
  17411. (JSC::DFG::AssemblyHelpers::tagFor):
  17412. (JSC::DFG::AssemblyHelpers::payloadFor):
  17413. * dfg/DFGByteCodeParser.cpp:
  17414. (JSC::DFG::ByteCodeParser::parseBlock):
  17415. * dfg/DFGCapabilities.h:
  17416. (JSC::DFG::canCompileOpcode):
  17417. (JSC::DFG::canInlineOpcode):
  17418. * dfg/DFGNode.h:
  17419. (JSC::DFG::Node::hasHeapPrediction):
  17420. * dfg/DFGNodeType.h:
  17421. (DFG):
  17422. * dfg/DFGOperations.cpp:
  17423. * dfg/DFGOperations.h:
  17424. * dfg/DFGPredictionPropagationPhase.cpp:
  17425. (JSC::DFG::PredictionPropagationPhase::propagate):
  17426. * dfg/DFGSpeculativeJIT.h:
  17427. (JSC::DFG::SpeculativeJIT::callOperation):
  17428. (SpeculativeJIT):
  17429. * dfg/DFGSpeculativeJIT32_64.cpp:
  17430. (JSC::DFG::SpeculativeJIT::compile):
  17431. * dfg/DFGSpeculativeJIT64.cpp:
  17432. (JSC::DFG::SpeculativeJIT::compile):
  17433. * jit/JITOpcodes.cpp:
  17434. (JSC::JIT::emit_op_get_argument_by_val):
  17435. * jit/JITOpcodes32_64.cpp:
  17436. (JSC::JIT::emit_op_get_argument_by_val):
  17437. * llint/LowLevelInterpreter32_64.asm:
  17438. * llint/LowLevelInterpreter64.asm:
  17439. 2012-05-07 Filip Pizlo <fpizlo@apple.com>
  17440. DFG should support op_tear_off_arguments
  17441. https://bugs.webkit.org/show_bug.cgi?id=85847
  17442. Reviewed by Michael Saboff.
  17443. Merged r116378 from dfgopt.
  17444. * dfg/DFGAbstractState.cpp:
  17445. (JSC::DFG::AbstractState::execute):
  17446. * dfg/DFGByteCodeParser.cpp:
  17447. (JSC::DFG::ByteCodeParser::parseBlock):
  17448. * dfg/DFGCapabilities.h:
  17449. (JSC::DFG::canCompileOpcode):
  17450. (JSC::DFG::canInlineOpcode):
  17451. * dfg/DFGNodeType.h:
  17452. (DFG):
  17453. * dfg/DFGOperations.cpp:
  17454. * dfg/DFGOperations.h:
  17455. * dfg/DFGPredictionPropagationPhase.cpp:
  17456. (JSC::DFG::PredictionPropagationPhase::propagate):
  17457. * dfg/DFGSpeculativeJIT.h:
  17458. (SpeculativeJIT):
  17459. (JSC::DFG::SpeculativeJIT::callOperation):
  17460. * dfg/DFGSpeculativeJIT32_64.cpp:
  17461. (JSC::DFG::SpeculativeJIT::compile):
  17462. * dfg/DFGSpeculativeJIT64.cpp:
  17463. (JSC::DFG::SpeculativeJIT::compile):
  17464. 2012-05-22 Mark Hahnenberg <mhahnenberg@apple.com>
  17465. CopiedSpace::contains doesn't check for oversize blocks
  17466. https://bugs.webkit.org/show_bug.cgi?id=87180
  17467. Reviewed by Geoffrey Garen.
  17468. When doing a conservative scan we use CopiedSpace::contains to determine if a particular
  17469. address points into the CopiedSpace. Currently contains() only checks if the address
  17470. points to a block in to-space, which means that pointers to oversize blocks may not get scanned.
  17471. * heap/CopiedSpace.cpp:
  17472. (JSC::CopiedSpace::tryAllocateOversize):
  17473. (JSC::CopiedSpace::tryReallocateOversize):
  17474. (JSC::CopiedSpace::doneFillingBlock):
  17475. (JSC::CopiedSpace::doneCopying):
  17476. * heap/CopiedSpace.h: Refactored CopiedSpace so that all blocks (oversize and to-space) are
  17477. in a single hash set and bloom filter for membership testing.
  17478. (CopiedSpace):
  17479. * heap/CopiedSpaceInlineMethods.h:
  17480. (JSC::CopiedSpace::contains): We check for the normal block first. Since the oversize blocks are
  17481. only page aligned, rather than block aligned, we have to re-mask the ptr to check if it's in
  17482. CopiedSpace. Also added a helper function of the same name that takes a CopiedBlock* and checks
  17483. if it's in CopiedSpace so that check isn't typed out twice.
  17484. (JSC):
  17485. (JSC::CopiedSpace::startedCopying):
  17486. (JSC::CopiedSpace::addNewBlock):
  17487. 2012-05-22 Geoffrey Garen <ggaren@apple.com>
  17488. CopiedBlock and MarkedBlock should have proper value semantics (i.e., destructors)
  17489. https://bugs.webkit.org/show_bug.cgi?id=87172
  17490. Reviewed by Oliver Hunt and Phil Pizlo.
  17491. This enables MarkedBlock to own non-trivial sub-objects that require
  17492. destruction. It also fixes a FIXME about casting a CopiedBlock to a
  17493. MarkedBlock at destroy time.
  17494. CopiedBlock and MarkedBlock now accept an allocation chunk at create
  17495. time and return it at destroy time. Their client is expected to
  17496. allocate, recycle, and destroy these chunks.
  17497. * heap/BlockAllocator.cpp:
  17498. (JSC::BlockAllocator::releaseFreeBlocks):
  17499. (JSC::BlockAllocator::blockFreeingThreadMain): Don't call MarkedBlock::destroy
  17500. because we expect that to be called before a block is put on our free
  17501. list now. Do manually deallocate our allocation chunk because that's
  17502. our job now.
  17503. * heap/BlockAllocator.h:
  17504. (BlockAllocator):
  17505. (JSC::BlockAllocator::allocate): Allocate never fails now. This is a
  17506. cleaner abstraction because only one object does all the VM allocation
  17507. and deallocation. Caching is an implementation detail.
  17508. (JSC::BlockAllocator::deallocate): We take an allocation chunk argument
  17509. instead of a block because we now expect the block to have been destroyed
  17510. before we recycle its memory. For convenience, we still use the HeapBlock
  17511. class as our linked list node. This is OK because HeapBlock is a POD type.
  17512. * heap/CopiedBlock.h:
  17513. (CopiedBlock):
  17514. (JSC::CopiedBlock::create):
  17515. (JSC::CopiedBlock::destroy):
  17516. (JSC::CopiedBlock::CopiedBlock): Added proper create and destroy functions,
  17517. to match MarkedBlock.
  17518. * heap/CopiedSpace.cpp:
  17519. (JSC::CopiedSpace::tryAllocateOversize):
  17520. (JSC::CopiedSpace::tryReallocateOversize):
  17521. (JSC::CopiedSpace::doneCopying):
  17522. (JSC::CopiedSpace::getFreshBlock):
  17523. (JSC::CopiedSpace::freeAllBlocks):
  17524. * heap/CopiedSpaceInlineMethods.h:
  17525. (JSC::CopiedSpace::recycleBlock): Make sure to call destroy before
  17526. returning a block to the BlockAllocator. Otherwise, our destructors
  17527. won't run. (If we get this wrong now, we'll get a compile error.)
  17528. * heap/HeapBlock.h:
  17529. (JSC::HeapBlock::HeapBlock): const!
  17530. * heap/MarkedAllocator.cpp:
  17531. (JSC::MarkedAllocator::allocateBlock): No need to distinguish between
  17532. create and recycle -- MarkedBlock always accepts memory allocated by
  17533. its client now.
  17534. * heap/MarkedBlock.cpp:
  17535. (JSC::MarkedBlock::create): Don't allocate memory -- we assume that we're
  17536. passed already-allocated memory, to clarify the responsibility for VM
  17537. recycling.
  17538. (JSC::MarkedBlock::destroy): Do run our destructor before giving back
  17539. our VM -- that is the whole point of this patch.
  17540. (JSC::MarkedBlock::MarkedBlock):
  17541. * heap/MarkedBlock.h:
  17542. (MarkedBlock):
  17543. * heap/MarkedSpace.cpp: const!
  17544. (JSC::MarkedSpace::freeBlocks): Make sure to call destroy before
  17545. returning a block to the BlockAllocator. Otherwise, our destructors
  17546. won't run. (If we get this wrong now, we'll get a compile error.)
  17547. == Rolled over to ChangeLog-2012-05-22 ==