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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 static_cast<v8::PropertyAttribute>(v8::DontEnum); | 755 static_cast<v8::PropertyAttribute>(v8::DontEnum); |
756 Utils::ToLocal(object)->SetAccessorProperty(Utils::ToLocal(name), | 756 Utils::ToLocal(object)->SetAccessorProperty(Utils::ToLocal(name), |
757 Utils::ToLocal(function), | 757 Utils::ToLocal(function), |
758 Local<Function>(), attributes); | 758 Local<Function>(), attributes); |
759 return function; | 759 return function; |
760 } | 760 } |
761 | 761 |
762 void WasmJs::Install(Isolate* isolate) { | 762 void WasmJs::Install(Isolate* isolate) { |
763 Handle<JSGlobalObject> global = isolate->global_object(); | 763 Handle<JSGlobalObject> global = isolate->global_object(); |
764 Handle<Context> context(global->native_context(), isolate); | 764 Handle<Context> context(global->native_context(), isolate); |
765 Handle<Context> native_context = isolate->native_context(); | |
jbroman
2017/03/13 18:53:38
remove separate change (I assume debugging code)?
Mircea Trofin
2017/03/15 18:02:28
yup! thanks for the catch.
| |
766 USE(native_context); | |
765 // TODO(titzer): once FLAG_expose_wasm is gone, this should become a DCHECK. | 767 // TODO(titzer): once FLAG_expose_wasm is gone, this should become a DCHECK. |
766 if (context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) return; | 768 if (context->get(Context::WASM_FUNCTION_MAP_INDEX)->IsMap()) return; |
767 | 769 |
768 // Install Maps. | 770 // Install Maps. |
769 | 771 |
770 // TODO(titzer): Also make one for strict mode functions? | 772 // TODO(titzer): Also make one for strict mode functions? |
771 Handle<Map> prev_map = Handle<Map>(context->sloppy_function_map(), isolate); | 773 Handle<Map> prev_map = Handle<Map>(context->sloppy_function_map(), isolate); |
772 | 774 |
773 InstanceType instance_type = prev_map->instance_type(); | 775 InstanceType instance_type = prev_map->instance_type(); |
774 int internal_fields = JSObject::GetInternalFieldCount(*prev_map); | 776 int internal_fields = JSObject::GetInternalFieldCount(*prev_map); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
918 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); | 920 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); |
919 return HasBrand(value, symbol); | 921 return HasBrand(value, symbol); |
920 } | 922 } |
921 | 923 |
922 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { | 924 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { |
923 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); | 925 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); |
924 return HasBrand(value, symbol); | 926 return HasBrand(value, symbol); |
925 } | 927 } |
926 } // namespace internal | 928 } // namespace internal |
927 } // namespace v8 | 929 } // namespace v8 |
OLD | NEW |