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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); | 559 v8::ReturnValue<v8::Value> return_value = args.GetReturnValue(); |
560 return_value.Set(Utils::ToLocal(buffer)); | 560 return_value.Set(Utils::ToLocal(buffer)); |
561 } | 561 } |
562 } // namespace | 562 } // namespace |
563 | 563 |
564 // TODO(titzer): we use the API to create the function template because the | 564 // TODO(titzer): we use the API to create the function template because the |
565 // internal guts are too ugly to replicate here. | 565 // internal guts are too ugly to replicate here. |
566 static i::Handle<i::FunctionTemplateInfo> NewTemplate(i::Isolate* i_isolate, | 566 static i::Handle<i::FunctionTemplateInfo> NewTemplate(i::Isolate* i_isolate, |
567 FunctionCallback func) { | 567 FunctionCallback func) { |
568 Isolate* isolate = reinterpret_cast<Isolate*>(i_isolate); | 568 Isolate* isolate = reinterpret_cast<Isolate*>(i_isolate); |
569 Local<FunctionTemplate> local = FunctionTemplate::New(isolate, func); | 569 Local<FunctionTemplate> templ = FunctionTemplate::New(isolate, func); |
570 return v8::Utils::OpenHandle(*local); | 570 templ->ReadOnlyPrototype(); |
| 571 return v8::Utils::OpenHandle(*templ); |
571 } | 572 } |
572 | 573 |
573 namespace internal { | 574 namespace internal { |
574 | 575 |
575 Handle<JSFunction> InstallFunc(Isolate* isolate, Handle<JSObject> object, | 576 Handle<JSFunction> InstallFunc(Isolate* isolate, Handle<JSObject> object, |
576 const char* str, FunctionCallback func, | 577 const char* str, FunctionCallback func, |
577 int length = 0) { | 578 int length = 0) { |
578 Handle<String> name = v8_str(isolate, str); | 579 Handle<String> name = v8_str(isolate, str); |
579 Handle<FunctionTemplateInfo> temp = NewTemplate(isolate, func); | 580 Handle<FunctionTemplateInfo> temp = NewTemplate(isolate, func); |
580 Handle<JSFunction> function = | 581 Handle<JSFunction> function = |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); | 768 i::Handle<i::Symbol> symbol(isolate->context()->wasm_memory_sym(), isolate); |
768 return HasBrand(value, symbol); | 769 return HasBrand(value, symbol); |
769 } | 770 } |
770 | 771 |
771 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { | 772 bool WasmJs::IsWasmTableObject(Isolate* isolate, Handle<Object> value) { |
772 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); | 773 i::Handle<i::Symbol> symbol(isolate->context()->wasm_table_sym(), isolate); |
773 return HasBrand(value, symbol); | 774 return HasBrand(value, symbol); |
774 } | 775 } |
775 } // namespace internal | 776 } // namespace internal |
776 } // namespace v8 | 777 } // namespace v8 |
OLD | NEW |