Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: src/wasm/wasm-js.cc

Issue 1943313002: [wasm] Fix for 608630: allow proxies as FFI. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/api.h" 5 #include "src/api.h"
6 #include "src/api-natives.h" 6 #include "src/api-natives.h"
7 #include "src/assert-scope.h" 7 #include "src/assert-scope.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 i::Zone zone(isolate->allocator()); 178 i::Zone zone(isolate->allocator());
179 internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule( 179 internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule(
180 isolate, &zone, start, end, false, origin); 180 isolate, &zone, start, end, false, origin);
181 181
182 if (result.failed() && origin == internal::wasm::kAsmJsOrigin) { 182 if (result.failed() && origin == internal::wasm::kAsmJsOrigin) {
183 thrower->Error("Asm.js converted module failed to decode"); 183 thrower->Error("Asm.js converted module failed to decode");
184 } else if (result.failed()) { 184 } else if (result.failed()) {
185 thrower->Failed("", result); 185 thrower->Failed("", result);
186 } else { 186 } else {
187 // Success. Instantiate the module and return the object. 187 // Success. Instantiate the module and return the object.
188 i::Handle<i::JSObject> ffi = i::Handle<i::JSObject>::null(); 188 i::Handle<i::JSReceiver> ffi = i::Handle<i::JSObject>::null();
189 if (args.Length() > 1 && args[1]->IsObject()) { 189 if (args.Length() > 1 && args[1]->IsObject()) {
190 Local<Object> obj = Local<Object>::Cast(args[1]); 190 Local<Object> obj = Local<Object>::Cast(args[1]);
191 ffi = i::Handle<i::JSObject>::cast(v8::Utils::OpenHandle(*obj)); 191 ffi = i::Handle<i::JSReceiver>::cast(v8::Utils::OpenHandle(*obj));
192 } 192 }
193 193
194 i::MaybeHandle<i::JSObject> object = 194 i::MaybeHandle<i::JSObject> object =
195 result.val->Instantiate(isolate, ffi, memory); 195 result.val->Instantiate(isolate, ffi, memory);
196 196
197 if (!object.is_null()) { 197 if (!object.is_null()) {
198 args.GetReturnValue().Set(v8::Utils::ToLocal(object.ToHandleChecked())); 198 args.GetReturnValue().Set(v8::Utils::ToLocal(object.ToHandleChecked()));
199 } 199 }
200 } 200 }
201 201
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 int unused_property_fields = in_object_properties - pre_allocated; 331 int unused_property_fields = in_object_properties - pre_allocated;
332 Handle<Map> map = Map::CopyInitialMap( 332 Handle<Map> map = Map::CopyInitialMap(
333 prev_map, instance_size, in_object_properties, unused_property_fields); 333 prev_map, instance_size, in_object_properties, unused_property_fields);
334 334
335 context->set_wasm_function_map(*map); 335 context->set_wasm_function_map(*map);
336 } 336 }
337 } 337 }
338 338
339 } // namespace internal 339 } // namespace internal
340 } // namespace v8 340 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698