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 <memory> | 5 #include <memory> |
6 | 6 |
7 #include "src/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/base/adapters.h" | 8 #include "src/base/adapters.h" |
9 #include "src/base/atomic-utils.h" | 9 #include "src/base/atomic-utils.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 if (cached_idx >= 0) { | 167 if (cached_idx >= 0) { |
168 Handle<Code> code = isolate->factory()->CopyCode(code_cache_[cached_idx]); | 168 Handle<Code> code = isolate->factory()->CopyCode(code_cache_[cached_idx]); |
169 // Now patch the call to wasm code. | 169 // Now patch the call to wasm code. |
170 for (RelocIterator it(*code, RelocInfo::kCodeTargetMask);; it.next()) { | 170 for (RelocIterator it(*code, RelocInfo::kCodeTargetMask);; it.next()) { |
171 DCHECK(!it.done()); | 171 DCHECK(!it.done()); |
172 Code* target = | 172 Code* target = |
173 Code::GetCodeFromTargetAddress(it.rinfo()->target_address()); | 173 Code::GetCodeFromTargetAddress(it.rinfo()->target_address()); |
174 if (target->kind() == Code::WASM_FUNCTION || | 174 if (target->kind() == Code::WASM_FUNCTION || |
175 target->kind() == Code::WASM_TO_JS_FUNCTION || | 175 target->kind() == Code::WASM_TO_JS_FUNCTION || |
176 target->builtin_index() == Builtins::kIllegal) { | 176 target->builtin_index() == Builtins::kIllegal) { |
177 it.rinfo()->set_target_address(wasm_code->instruction_start()); | 177 it.rinfo()->set_target_address(isolate, |
| 178 wasm_code->instruction_start()); |
178 break; | 179 break; |
179 } | 180 } |
180 } | 181 } |
181 return code; | 182 return code; |
182 } | 183 } |
183 | 184 |
184 Handle<Code> code = | 185 Handle<Code> code = |
185 compiler::CompileJSToWasmWrapper(isolate, module, wasm_code, index); | 186 compiler::CompileJSToWasmWrapper(isolate, module, wasm_code, index); |
186 uint32_t new_cache_idx = sig_map_.FindOrInsert(func->sig); | 187 uint32_t new_cache_idx = sig_map_.FindOrInsert(func->sig); |
187 DCHECK_EQ(code_cache_.size(), new_cache_idx); | 188 DCHECK_EQ(code_cache_.size(), new_cache_idx); |
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2750 Handle<String> module_property_name = | 2751 Handle<String> module_property_name = |
2751 isolate->factory()->InternalizeUtf8String("module"); | 2752 isolate->factory()->InternalizeUtf8String("module"); |
2752 Handle<String> instance_property_name = | 2753 Handle<String> instance_property_name = |
2753 isolate->factory()->InternalizeUtf8String("instance"); | 2754 isolate->factory()->InternalizeUtf8String("instance"); |
2754 JSObject::AddProperty(ret, module_property_name, module, NONE); | 2755 JSObject::AddProperty(ret, module_property_name, module, NONE); |
2755 JSObject::AddProperty(ret, instance_property_name, | 2756 JSObject::AddProperty(ret, instance_property_name, |
2756 instance_object.ToHandleChecked(), NONE); | 2757 instance_object.ToHandleChecked(), NONE); |
2757 | 2758 |
2758 ResolvePromise(isolate, promise, ret); | 2759 ResolvePromise(isolate, promise, ret); |
2759 } | 2760 } |
OLD | NEW |