Changeset 236305 in webkit


Ignore:
Timestamp:
Sep 20, 2018 9:36:08 PM (6 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r236293.

Internal build still broken.

Reverted changeset:

"Add functions to measure memory footprint to JSC"
https://bugs.webkit.org/show_bug.cgi?id=189768
https://trac.webkit.org/changeset/236293

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r236296 r236305  
     12018-09-20  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r236293.
     4
     5        Internal build still broken.
     6
     7        Reverted changeset:
     8
     9        "Add functions to measure memory footprint to JSC"
     10        https://bugs.webkit.org/show_bug.cgi?id=189768
     11        https://trac.webkit.org/changeset/236293
     12
    1132018-09-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
    214
  • trunk/Source/JavaScriptCore/jsc.cpp

    r236293 r236305  
    128128#endif
    129129
    130 #if __has_include(<WebKitAdditions/MemoryFootprint.h>)
    131 #include <WebKitAdditions/MemoryFootprint.h>
    132 #else
    133 struct MemoryFootprint {
    134     uint64_t current;
    135     uint64_t peak;
    136    
    137     static MemoryFootprint now()
    138     {
    139         return { 0L, 0L };
    140     }
    141    
    142     static void resetPeak()
    143     {
    144     }
    145 };
    146 #endif
    147 
    148130#if !defined(PATH_MAX)
    149131#define PATH_MAX 4096
     
    286268static EncodedJSValue JSC_HOST_CALL functionForceGCSlowPaths(ExecState*);
    287269static EncodedJSValue JSC_HOST_CALL functionHeapSize(ExecState*);
    288 static EncodedJSValue JSC_HOST_CALL functionCreateMemoryFootprint(ExecState*);
    289 static EncodedJSValue JSC_HOST_CALL functionResetMemoryPeak(ExecState*);
    290270static EncodedJSValue JSC_HOST_CALL functionAddressOf(ExecState*);
    291271static EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*);
     
    505485        addFunction(vm, "forceGCSlowPaths", functionForceGCSlowPaths, 0);
    506486        addFunction(vm, "gcHeapSize", functionHeapSize, 0);
    507         addFunction(vm, "MemoryFootprint", functionCreateMemoryFootprint, 0);
    508         addFunction(vm, "resetMemoryPeak", functionResetMemoryPeak, 0);
    509487        addFunction(vm, "addressOf", functionAddressOf, 1);
    510488        addFunction(vm, "version", functionVersion, 1);
     
    12021180}
    12031181
    1204 class JSCMemoryFootprint : public JSDestructibleObject {
    1205     using Base = JSDestructibleObject;
    1206 public:
    1207     JSCMemoryFootprint(VM& vm, Structure* structure)
    1208         : Base(vm, structure)
    1209     { }
    1210 
    1211     static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
    1212     {
    1213         return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info());
    1214     }
    1215 
    1216     static JSCMemoryFootprint* create(VM& vm, JSGlobalObject* globalObject)
    1217     {
    1218         Structure* structure = createStructure(vm, globalObject, jsNull());
    1219         JSCMemoryFootprint* footprint = new (NotNull, allocateCell<JSCMemoryFootprint>(vm.heap, sizeof(JSCMemoryFootprint))) JSCMemoryFootprint(vm, structure);
    1220         footprint->finishCreation(vm);
    1221         return footprint;
    1222     }
    1223 
    1224     void finishCreation(VM& vm)
    1225     {
    1226         Base::finishCreation(vm);
    1227 
    1228         auto addProperty = [&] (VM& vm, const char* name, JSValue value) {
    1229             JSCMemoryFootprint::addProperty(vm, name, value);
    1230         };
    1231 
    1232         MemoryFootprint footprint = MemoryFootprint::now();
    1233 
    1234         // Report sizes in KBytes so that values up to GB are still integers.
    1235         addProperty(vm, "current", jsNumber(footprint.current / 1024));
    1236         addProperty(vm, "peak", jsNumber(footprint.peak / 1024));
    1237     }
    1238 
    1239     DECLARE_INFO;
    1240 
    1241 private:
    1242     void addProperty(VM& vm, const char* name, JSValue value)
    1243     {
    1244         Identifier identifier = Identifier::fromString(&vm, name);
    1245         putDirect(vm, identifier, value);
    1246     }
    1247 };
    1248 
    1249 const ClassInfo JSCMemoryFootprint::s_info = { "MemoryFootprint", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCMemoryFootprint) };
    1250 
    1251 EncodedJSValue JSC_HOST_CALL functionCreateMemoryFootprint(ExecState* exec)
    1252 {
    1253     VM& vm = exec->vm();
    1254     JSLockHolder lock(vm);
    1255     return JSValue::encode(JSCMemoryFootprint::create(vm, exec->lexicalGlobalObject()));
    1256 }
    1257 
    1258 EncodedJSValue JSC_HOST_CALL functionResetMemoryPeak(ExecState*)
    1259 {
    1260     MemoryFootprint::resetPeak();
    1261     return JSValue::encode(jsUndefined());
    1262 }
    1263 
    12641182// This function is not generally very helpful in 64-bit code as the tag and payload
    12651183// share a register. But in 32-bit JITed code the tag may not be checked if an
Note: See TracChangeset for help on using the changeset viewer.