| 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/wasm/wasm-objects.h" | 5 #include "src/wasm/wasm-objects.h" |
| 6 #include "src/utils.h" | 6 #include "src/utils.h" |
| 7 | 7 |
| 8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
| 9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
| 10 #include "src/wasm/module-decoder.h" | 10 #include "src/wasm/module-decoder.h" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 int func_index, int offset_in_func) { | 198 int func_index, int offset_in_func) { |
| 199 DisallowHeapAllocation no_gc; | 199 DisallowHeapAllocation no_gc; |
| 200 AccountingAllocator alloc; | 200 AccountingAllocator alloc; |
| 201 Zone tmp(&alloc, ZONE_NAME); | 201 Zone tmp(&alloc, ZONE_NAME); |
| 202 BodyLocalDecls locals(&tmp); | 202 BodyLocalDecls locals(&tmp); |
| 203 const byte* module_start = compiled_module->module_bytes()->GetChars(); | 203 const byte* module_start = compiled_module->module_bytes()->GetChars(); |
| 204 WasmFunction& func = compiled_module->module()->functions[func_index]; | 204 WasmFunction& func = compiled_module->module()->functions[func_index]; |
| 205 BytecodeIterator iterator(module_start + func.code_start_offset, | 205 BytecodeIterator iterator(module_start + func.code_start_offset, |
| 206 module_start + func.code_end_offset, &locals); | 206 module_start + func.code_end_offset, &locals); |
| 207 DCHECK_LT(0, locals.encoded_size); | 207 DCHECK_LT(0, locals.encoded_size); |
| 208 uint32_t found_position = 0; | |
| 209 for (uint32_t offset : iterator.offsets()) { | 208 for (uint32_t offset : iterator.offsets()) { |
| 210 if (offset > static_cast<uint32_t>(offset_in_func)) break; | 209 if (offset > static_cast<uint32_t>(offset_in_func)) break; |
| 211 if (offset == static_cast<uint32_t>(offset_in_func)) return true; | 210 if (offset == static_cast<uint32_t>(offset_in_func)) return true; |
| 212 } | 211 } |
| 213 return false; | 212 return false; |
| 214 } | 213 } |
| 215 #endif // DEBUG | 214 #endif // DEBUG |
| 216 | 215 |
| 217 } // namespace | 216 } // namespace |
| 218 | 217 |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1146 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
| 1148 return false; | 1147 return false; |
| 1149 return true; | 1148 return true; |
| 1150 } | 1149 } |
| 1151 | 1150 |
| 1152 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance, | 1151 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance, |
| 1153 Isolate* isolate) { | 1152 Isolate* isolate) { |
| 1154 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance); | 1153 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance); |
| 1155 set(kWrapperInstanceObject, *cell); | 1154 set(kWrapperInstanceObject, *cell); |
| 1156 } | 1155 } |
| OLD | NEW |