| OLD | NEW | 
|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "src/base/atomic-utils.h" | 5 #include "src/base/atomic-utils.h" | 
| 6 #include "src/macro-assembler.h" | 6 #include "src/macro-assembler.h" | 
| 7 #include "src/objects.h" | 7 #include "src/objects.h" | 
| 8 #include "src/property-descriptor.h" | 8 #include "src/property-descriptor.h" | 
| 9 #include "src/v8.h" | 9 #include "src/v8.h" | 
| 10 | 10 | 
| (...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1019 } | 1019 } | 
| 1020 | 1020 | 
| 1021 WasmDebugInfo* GetDebugInfo(JSObject* wasm) { | 1021 WasmDebugInfo* GetDebugInfo(JSObject* wasm) { | 
| 1022   Object* info = wasm->GetInternalField(kWasmDebugInfo); | 1022   Object* info = wasm->GetInternalField(kWasmDebugInfo); | 
| 1023   if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); | 1023   if (!info->IsUndefined(wasm->GetIsolate())) return WasmDebugInfo::cast(info); | 
| 1024   Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); | 1024   Handle<WasmDebugInfo> new_info = WasmDebugInfo::New(handle(wasm)); | 
| 1025   wasm->SetInternalField(kWasmDebugInfo, *new_info); | 1025   wasm->SetInternalField(kWasmDebugInfo, *new_info); | 
| 1026   return *new_info; | 1026   return *new_info; | 
| 1027 } | 1027 } | 
| 1028 | 1028 | 
|  | 1029 int GetNumberOfFunctions(JSObject* wasm) { | 
|  | 1030   Object* func_names_obj = wasm->GetInternalField(kWasmFunctionNamesArray); | 
|  | 1031   // TODO(clemensh): this looks inside an array constructed elsewhere. Refactor. | 
|  | 1032   return ByteArray::cast(func_names_obj)->get_int(0); | 
|  | 1033 } | 
|  | 1034 | 
| 1029 namespace testing { | 1035 namespace testing { | 
| 1030 | 1036 | 
| 1031 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 1037 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 
| 1032                                 const byte* module_end, bool asm_js) { | 1038                                 const byte* module_end, bool asm_js) { | 
| 1033   HandleScope scope(isolate); | 1039   HandleScope scope(isolate); | 
| 1034   Zone zone(isolate->allocator()); | 1040   Zone zone(isolate->allocator()); | 
| 1035   ErrorThrower thrower(isolate, "CompileAndRunWasmModule"); | 1041   ErrorThrower thrower(isolate, "CompileAndRunWasmModule"); | 
| 1036 | 1042 | 
| 1037   // Decode the module, but don't verify function bodies, since we'll | 1043   // Decode the module, but don't verify function bodies, since we'll | 
| 1038   // be compiling them anyway. | 1044   // be compiling them anyway. | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1092     return static_cast<int32_t>(HeapNumber::cast(*result)->value()); | 1098     return static_cast<int32_t>(HeapNumber::cast(*result)->value()); | 
| 1093   } | 1099   } | 
| 1094   thrower.Error("WASM.compileRun() failed: Return value should be number"); | 1100   thrower.Error("WASM.compileRun() failed: Return value should be number"); | 
| 1095   return -1; | 1101   return -1; | 
| 1096 } | 1102 } | 
| 1097 | 1103 | 
| 1098 }  // namespace testing | 1104 }  // namespace testing | 
| 1099 }  // namespace wasm | 1105 }  // namespace wasm | 
| 1100 }  // namespace internal | 1106 }  // namespace internal | 
| 1101 }  // namespace v8 | 1107 }  // namespace v8 | 
| OLD | NEW | 
|---|