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/wasm/wasm-objects.h" | 5 #include "src/wasm/wasm-objects.h" |
6 #include "src/utils.h" | 6 #include "src/utils.h" |
7 | 7 |
8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
9 #include "src/debug/debug-interface.h" | 9 #include "src/debug/debug-interface.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 | 485 |
486 Handle<WasmExportedFunction> WasmExportedFunction::New( | 486 Handle<WasmExportedFunction> WasmExportedFunction::New( |
487 Isolate* isolate, Handle<WasmInstanceObject> instance, | 487 Isolate* isolate, Handle<WasmInstanceObject> instance, |
488 MaybeHandle<String> maybe_name, int func_index, int arity, | 488 MaybeHandle<String> maybe_name, int func_index, int arity, |
489 Handle<Code> export_wrapper) { | 489 Handle<Code> export_wrapper) { |
490 Handle<String> name; | 490 Handle<String> name; |
491 if (maybe_name.is_null()) { | 491 if (maybe_name.is_null()) { |
492 EmbeddedVector<char, 16> buffer; | 492 EmbeddedVector<char, 16> buffer; |
493 int length = SNPrintF(buffer, "%d", func_index); | 493 int length = SNPrintF(buffer, "%d", func_index); |
494 name = isolate->factory() | 494 name = isolate->factory() |
495 ->NewStringFromAscii( | 495 ->NewStringFromOneByte( |
496 Vector<const char>::cast(buffer.SubVector(0, length))) | 496 Vector<uint8_t>::cast(buffer.SubVector(0, length))) |
497 .ToHandleChecked(); | 497 .ToHandleChecked(); |
498 } else { | 498 } else { |
499 name = maybe_name.ToHandleChecked(); | 499 name = maybe_name.ToHandleChecked(); |
500 } | 500 } |
501 DCHECK_EQ(Code::JS_TO_WASM_FUNCTION, export_wrapper->kind()); | 501 DCHECK_EQ(Code::JS_TO_WASM_FUNCTION, export_wrapper->kind()); |
502 Handle<SharedFunctionInfo> shared = | 502 Handle<SharedFunctionInfo> shared = |
503 isolate->factory()->NewSharedFunctionInfo(name, export_wrapper, false); | 503 isolate->factory()->NewSharedFunctionInfo(name, export_wrapper, false); |
504 shared->set_length(arity); | 504 shared->set_length(arity); |
505 shared->set_internal_formal_parameter_count(arity); | 505 shared->set_internal_formal_parameter_count(arity); |
506 Handle<JSFunction> function = isolate->factory()->NewFunction( | 506 Handle<JSFunction> function = isolate->factory()->NewFunction( |
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; | 1188 if (!array->get(kWrapperInstanceObject)->IsWeakCell()) return false; |
1189 Isolate* isolate = array->GetIsolate(); | 1189 Isolate* isolate = array->GetIsolate(); |
1190 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && | 1190 if (!array->get(kNextInstanceWrapper)->IsUndefined(isolate) && |
1191 !array->get(kNextInstanceWrapper)->IsFixedArray()) | 1191 !array->get(kNextInstanceWrapper)->IsFixedArray()) |
1192 return false; | 1192 return false; |
1193 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && | 1193 if (!array->get(kPreviousInstanceWrapper)->IsUndefined(isolate) && |
1194 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) | 1194 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) |
1195 return false; | 1195 return false; |
1196 return true; | 1196 return true; |
1197 } | 1197 } |
OLD | NEW |