Changeset 187538 in webkit for trunk/Source/JavaScriptCore/jsc.cpp
- Timestamp:
- Jul 28, 2015, 8:27:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jsc.cpp
r187531 r187538 44 44 #include "JSProxy.h" 45 45 #include "JSString.h" 46 #include "JSWASMModule.h"47 46 #include "ProfilerDatabase.h" 48 47 #include "SamplingTool.h" … … 52 51 #include "TestRunnerUtils.h" 53 52 #include "TypeProfilerLog.h" 54 #include "WASMModuleParser.h"55 53 #include <math.h> 56 54 #include <stdio.h> … … 495 493 static EncodedJSValue JSC_HOST_CALL functionHasBasicBlockExecuted(ExecState*); 496 494 static EncodedJSValue JSC_HOST_CALL functionEnableExceptionFuzz(ExecState*); 497 #if ENABLE(WEBASSEMBLY)498 static EncodedJSValue JSC_HOST_CALL functionLoadWebAssembly(ExecState*);499 #endif500 495 501 496 #if ENABLE(SAMPLING_FLAGS) … … 661 656 addFunction(vm, "enableExceptionFuzz", functionEnableExceptionFuzz, 0); 662 657 663 #if ENABLE(WEBASSEMBLY)664 addFunction(vm, "loadWebAssembly", functionLoadWebAssembly, 1);665 #endif666 667 658 JSArray* array = constructEmptyArray(globalExec(), 0); 668 659 for (size_t i = 0; i < arguments.size(); ++i) … … 1192 1183 return JSValue::encode(jsUndefined()); 1193 1184 } 1194 1195 #if ENABLE(WEBASSEMBLY)1196 EncodedJSValue JSC_HOST_CALL functionLoadWebAssembly(ExecState* exec)1197 {1198 String fileName = exec->argument(0).toString(exec)->value(exec);1199 Vector<char> buffer;1200 if (!fillBufferWithContentsOfFile(fileName, buffer))1201 return JSValue::encode(exec->vm().throwException(exec, createError(exec, ASCIILiteral("Could not open file."))));1202 RefPtr<WebAssemblySourceProvider> sourceProvider = WebAssemblySourceProvider::create(reinterpret_cast<Vector<uint8_t>&>(buffer), fileName);1203 SourceCode source(sourceProvider);1204 String errorMessage;1205 JSWASMModule* module = parseWebAssembly(exec, source, errorMessage);1206 if (!module)1207 return JSValue::encode(exec->vm().throwException(exec, createSyntaxError(exec, errorMessage)));1208 return JSValue::encode(module);1209 }1210 #endif1211 1185 1212 1186 // Use SEH for Release builds only to get rid of the crash report dialog
Note:
See TracChangeset
for help on using the changeset viewer.