| 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/api-natives.h" | 5 #include "src/api-natives.h" |
| 6 #include "src/api.h" | 6 #include "src/api.h" |
| 7 #include "src/asmjs/asm-js.h" | 7 #include "src/asmjs/asm-js.h" |
| 8 #include "src/asmjs/asm-typer.h" | 8 #include "src/asmjs/asm-typer.h" |
| 9 #include "src/asmjs/asm-wasm-builder.h" | 9 #include "src/asmjs/asm-wasm-builder.h" |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 Handle<String> name = v8_str(isolate, str); | 309 Handle<String> name = v8_str(isolate, str); |
| 310 Handle<FunctionTemplateInfo> temp = NewTemplate(isolate, func); | 310 Handle<FunctionTemplateInfo> temp = NewTemplate(isolate, func); |
| 311 Handle<JSFunction> function = | 311 Handle<JSFunction> function = |
| 312 ApiNatives::InstantiateFunction(temp).ToHandleChecked(); | 312 ApiNatives::InstantiateFunction(temp).ToHandleChecked(); |
| 313 PropertyAttributes attributes = | 313 PropertyAttributes attributes = |
| 314 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); | 314 static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY); |
| 315 JSObject::AddProperty(object, name, function, attributes); | 315 JSObject::AddProperty(object, name, function, attributes); |
| 316 return function; | 316 return function; |
| 317 } | 317 } |
| 318 | 318 |
| 319 void WasmJs::SetupIsolateForWasm(Isolate* isolate) { | |
| 320 InstallWasmFunctionMap(isolate, isolate->native_context()); | |
| 321 InstallWasmModuleSymbol(isolate, isolate->global_object(), | |
| 322 isolate->native_context()); | |
| 323 } | |
| 324 | |
| 325 void WasmJs::InstallWasmModuleSymbol(Isolate* isolate, | 319 void WasmJs::InstallWasmModuleSymbol(Isolate* isolate, |
| 326 Handle<JSGlobalObject> global, | 320 Handle<JSGlobalObject> global, |
| 327 Handle<Context> context) { | 321 Handle<Context> context) { |
| 328 Factory* factory = isolate->factory(); | 322 Factory* factory = isolate->factory(); |
| 329 // Create private symbols. | 323 // Create private symbols. |
| 330 Handle<Symbol> module_sym = factory->NewPrivateSymbol(); | 324 Handle<Symbol> module_sym = factory->NewPrivateSymbol(); |
| 331 Handle<Symbol> instance_sym = factory->NewPrivateSymbol(); | 325 Handle<Symbol> instance_sym = factory->NewPrivateSymbol(); |
| 332 context->set_wasm_module_sym(*module_sym); | 326 context->set_wasm_module_sym(*module_sym); |
| 333 context->set_wasm_instance_sym(*instance_sym); | 327 context->set_wasm_instance_sym(*instance_sym); |
| 334 | 328 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 int unused_property_fields = in_object_properties - pre_allocated; | 419 int unused_property_fields = in_object_properties - pre_allocated; |
| 426 Handle<Map> map = Map::CopyInitialMap( | 420 Handle<Map> map = Map::CopyInitialMap( |
| 427 prev_map, instance_size, in_object_properties, unused_property_fields); | 421 prev_map, instance_size, in_object_properties, unused_property_fields); |
| 428 | 422 |
| 429 context->set_wasm_function_map(*map); | 423 context->set_wasm_function_map(*map); |
| 430 } | 424 } |
| 431 } | 425 } |
| 432 | 426 |
| 433 } // namespace internal | 427 } // namespace internal |
| 434 } // namespace v8 | 428 } // namespace v8 |
| OLD | NEW |