Changeset 36863 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Sep 24, 2008, 1:38:55 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-24 Geoffrey Garen <[email protected]>

Reviewed by Darin Adler.


Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
the objects it retains

  • API/JSBase.h: Filled in some missing function names.
  • API/tests/testapi.c: Test the new SPI a little.
  • API/JSSPI.cpp: Add the new SPI.
  • API/JSSPI.h: Add the new SPI.
  • JavaScriptCore.exp: Add the new SPI.
  • JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
Location:
trunk/JavaScriptCore
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/JSBase.cpp

    r36263 r36863  
    2626#include "config.h"
    2727#include "JSBase.h"
     28#include "JSBasePrivate.h"
    2829
    2930#include "APICast.h"
     
    103104    // the collector is busy.
    104105}
     106
     107void JSReportExtraMemoryCost(JSContextRef ctx, size_t size)
     108{
     109    ExecState* exec = toJS(ctx);
     110    exec->globalData().heap->registerThread();
     111    JSLock lock(exec);
     112
     113    exec->globalData().heap->reportExtraMemoryCost(size);
     114}
  • trunk/JavaScriptCore/API/tests/testapi.c

    r36784 r36863  
    2525
    2626#include "JavaScriptCore.h"
     27#include "JSBasePrivate.h"
    2728#include <math.h>
    2829#include <wtf/Assertions.h>
     
    584585    JSGlobalContextRetain(context);
    585586    JSGlobalContextRelease(context);
     587   
     588    JSReportExtraMemoryCost(context, 0);
     589    JSReportExtraMemoryCost(context, 1);
     590    JSReportExtraMemoryCost(context, 1024);
    586591
    587592    JSObjectRef globalObject = JSContextGetGlobalObject(context);
  • trunk/JavaScriptCore/ChangeLog

    r36859 r36863  
     12008-09-24  Geoffrey Garen  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4       
     5        Fixed <rdar://problem/5605532> Need a SPI for telling JS the size of
     6        the objects it retains
     7
     8        * API/JSBase.h: Filled in some missing function names.
     9
     10        * API/tests/testapi.c: Test the new SPI a little.
     11
     12        * API/JSSPI.cpp: Add the new SPI.
     13        * API/JSSPI.h: Add the new SPI.
     14        * JavaScriptCore.exp: Add the new SPI.
     15        * JavaScriptCore.xcodeproj/project.pbxproj: Add the new SPI.
     16
    1172008-09-24  Geoffrey Garen  <[email protected]>
    218
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r36851 r36863  
    4343_JSPropertyNameArrayRelease
    4444_JSPropertyNameArrayRetain
     45_JSReportExtraMemoryCost
    4546_JSStartProfiling
    4647_JSStringCopyCFString
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r36755 r36863  
    3838                06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06D358A10DAAD9C4003B174E /* MainThreadMac.mm */; };
    3939                140B7D1D0DC69AF7009C42B8 /* JSActivation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14DA818F0D99FD2000B0A4FB /* JSActivation.cpp */; };
     40                140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    4041                141211310A48794D00480255 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
    4142                141211340A48795800480255 /* minidom.c in Sources */ = {isa = PBXBuildFile; fileRef = 141211020A48780900480255 /* minidom.c */; };
     
    444445                06D358A20DAAD9C4003B174E /* MainThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainThread.cpp; sourceTree = "<group>"; };
    445446                06D358A30DAAD9C4003B174E /* MainThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainThread.h; sourceTree = "<group>"; };
     447                140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBasePrivate.h; sourceTree = "<group>"; };
    446448                141211020A48780900480255 /* minidom.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = minidom.c; path = tests/minidom.c; sourceTree = "<group>"; };
    447449                1412110D0A48788700480255 /* minidom.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = minidom.js; path = tests/minidom.js; sourceTree = "<group>"; };
     
    919921                        isa = PBXGroup;
    920922                        children = (
     923                                140D17D60E8AD4A9000CD17D /* JSBasePrivate.h */,
    921924                                1482B78A0A4305AB00517CFC /* APICast.h */,
    922925                                1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */,
     
    15931596                                147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
    15941597                                7E2ADD8E0E79AAD500D50C51 /* CharacterClassConstructor.h in Headers */,
     1598                                140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */,
    15951599                        );
    15961600                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.