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

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

Issue 2640403004: [wasm] Instance exports object should be iterable (Closed)
Patch Set: Created 3 years, 11 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
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 <memory> 5 #include <memory>
6 6
7 #include "src/assembler-inl.h" 7 #include "src/assembler-inl.h"
8 #include "src/base/adapters.h" 8 #include "src/base/adapters.h"
9 #include "src/base/atomic-utils.h" 9 #include "src/base/atomic-utils.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1864 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 isolate_->native_context()->object_function(), isolate_); 1875 isolate_->native_context()->object_function(), isolate_);
1876 exports_object = 1876 exports_object =
1877 isolate_->factory()->NewJSObject(object_function, TENURED); 1877 isolate_->factory()->NewJSObject(object_function, TENURED);
1878 Handle<String> exports_name = 1878 Handle<String> exports_name =
1879 isolate_->factory()->InternalizeUtf8String("exports"); 1879 isolate_->factory()->InternalizeUtf8String("exports");
1880 JSObject::AddProperty(instance, exports_name, exports_object, NONE); 1880 JSObject::AddProperty(instance, exports_name, exports_object, NONE);
1881 } 1881 }
1882 1882
1883 PropertyDescriptor desc; 1883 PropertyDescriptor desc;
1884 desc.set_writable(false); 1884 desc.set_writable(false);
1885 desc.set_enumerable(true);
1885 1886
1886 // Count up export indexes. 1887 // Count up export indexes.
1887 int export_index = 0; 1888 int export_index = 0;
1888 for (auto exp : module_->export_table) { 1889 for (auto exp : module_->export_table) {
1889 if (exp.kind == kExternalFunction) { 1890 if (exp.kind == kExternalFunction) {
1890 ++export_index; 1891 ++export_index;
1891 } 1892 }
1892 } 1893 }
1893 1894
1894 // Store weak references to all exported functions. 1895 // Store weak references to all exported functions.
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 2640
2640 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(), 2641 JSObject::AddProperty(entry, name_string, export_name.ToHandleChecked(),
2641 NONE); 2642 NONE);
2642 JSObject::AddProperty(entry, kind_string, export_kind, NONE); 2643 JSObject::AddProperty(entry, kind_string, export_kind, NONE);
2643 2644
2644 storage->set(index, *entry); 2645 storage->set(index, *entry);
2645 } 2646 }
2646 2647
2647 return array_object; 2648 return array_object;
2648 } 2649 }
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regression-5863.js » ('j') | test/mjsunit/regress/wasm/regression-5863.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698