Changeset 199084 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Apr 5, 2016, 4:50:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r199076 r199084 24 24 25 25 #include "ArrayPrototype.h" 26 #include "BuiltinExecutables.h"27 26 #include "ButterflyInlines.h" 28 27 #include "BytecodeGenerator.h" … … 34 33 #include "Exception.h" 35 34 #include "ExceptionHelpers.h" 36 #include "GetterSetter.h"37 35 #include "HeapProfiler.h" 38 36 #include "HeapSnapshotBuilder.h" … … 555 553 static EncodedJSValue JSC_HOST_CALL functionCreateImpureGetter(ExecState*); 556 554 static EncodedJSValue JSC_HOST_CALL functionCreateCustomGetterObject(ExecState*); 557 static EncodedJSValue JSC_HOST_CALL functionCreateBuiltin(ExecState*);558 555 static EncodedJSValue JSC_HOST_CALL functionSetImpureGetterDelegate(ExecState*); 559 556 … … 576 573 static EncodedJSValue JSC_HOST_CALL functionHeapSize(ExecState*); 577 574 static EncodedJSValue JSC_HOST_CALL functionAddressOf(ExecState*); 578 static EncodedJSValue JSC_HOST_CALL functionGetGetterSetter(ExecState*);579 575 #ifndef NDEBUG 580 576 static EncodedJSValue JSC_HOST_CALL functionDumpCallFrame(ExecState*); … … 748 744 addFunction(vm, "gcHeapSize", functionHeapSize, 0); 749 745 addFunction(vm, "addressOf", functionAddressOf, 1); 750 addFunction(vm, "getGetterSetter", functionGetGetterSetter, 2);751 746 #ifndef NDEBUG 752 747 addFunction(vm, "dumpCallFrame", functionDumpCallFrame, 0); … … 798 793 addFunction(vm, "createImpureGetter", functionCreateImpureGetter, 1); 799 794 addFunction(vm, "createCustomGetterObject", functionCreateCustomGetterObject, 0); 800 addFunction(vm, "createBuiltin", functionCreateBuiltin, 2);801 795 addFunction(vm, "setImpureGetterDelegate", functionSetImpureGetterDelegate, 2); 802 796 … … 1339 1333 } 1340 1334 1341 static EncodedJSValue JSC_HOST_CALL functionGetGetterSetter(ExecState* exec)1342 {1343 JSValue value = exec->argument(0);1344 if (!value.isObject())1345 return JSValue::encode(jsUndefined());1346 1347 JSValue property = exec->argument(1);1348 if (!property.isString())1349 return JSValue::encode(jsUndefined());1350 1351 Identifier ident = Identifier::fromString(&exec->vm(), property.toString(exec)->value(exec));1352 1353 PropertySlot slot(value, PropertySlot::InternalMethodType::VMInquiry);1354 value.getPropertySlot(exec, ident, slot);1355 1356 JSValue result;1357 if (slot.isCacheableGetter())1358 result = slot.getterSetter();1359 else1360 result = jsNull();1361 1362 return JSValue::encode(result);1363 }1364 1365 1335 EncodedJSValue JSC_HOST_CALL functionVersion(ExecState*) 1366 1336 { … … 1750 1720 return JSValue::encode(exec->vm().throwException(exec, error)); 1751 1721 return JSValue::encode(jsUndefined()); 1752 }1753 1754 EncodedJSValue JSC_HOST_CALL functionCreateBuiltin(ExecState* exec)1755 {1756 if (exec->argumentCount() < 1 || !exec->argument(0).isString())1757 return JSValue::encode(jsUndefined());1758 1759 String functionText = exec->argument(0).toString(exec)->value(exec);1760 if (exec->hadException())1761 return JSValue::encode(JSValue());1762 1763 VM& vm = exec->vm();1764 const SourceCode& source = makeSource(functionText);1765 JSFunction* func = JSFunction::createBuiltinFunction(vm, BuiltinExecutables::createExecutable(vm, source, Identifier::fromString(&vm, "foo"), ConstructorKind::None, ConstructAbility::CannotConstruct)->link(vm, source), exec->lexicalGlobalObject());1766 1767 return JSValue::encode(func);1768 1722 } 1769 1723
Note:
See TracChangeset
for help on using the changeset viewer.