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

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

Issue 2637643002: [wasm] Table.Grow should grow dispatch tables (Closed)
Patch Set: Rebase + review 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
« no previous file with comments | « src/wasm/wasm-objects.h ('k') | test/mjsunit/wasm/indirect-tables.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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/debug/debug-interface.h" 8 #include "src/debug/debug-interface.h"
9 #include "src/wasm/module-decoder.h" 9 #include "src/wasm/module-decoder.h"
10 #include "src/wasm/wasm-module.h" 10 #include "src/wasm/wasm-module.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 uint32_t WasmTableObject::maximum_length() { 179 uint32_t WasmTableObject::maximum_length() {
180 return SafeUint32(GetInternalField(kMaximum)); 180 return SafeUint32(GetInternalField(kMaximum));
181 } 181 }
182 182
183 WasmTableObject* WasmTableObject::cast(Object* object) { 183 WasmTableObject* WasmTableObject::cast(Object* object) {
184 DCHECK(object && object->IsJSObject()); 184 DCHECK(object && object->IsJSObject());
185 // TODO(titzer): brand check for WasmTableObject. 185 // TODO(titzer): brand check for WasmTableObject.
186 return reinterpret_cast<WasmTableObject*>(object); 186 return reinterpret_cast<WasmTableObject*>(object);
187 } 187 }
188 188
189 void WasmTableObject::Grow(Isolate* isolate, Handle<WasmTableObject> table,
190 uint32_t count) {
191 Handle<FixedArray> dispatch_tables(table->dispatch_tables());
192 wasm::GrowDispatchTables(isolate, dispatch_tables,
193 table->functions()->length(), count);
194 }
195
189 Handle<WasmMemoryObject> WasmMemoryObject::New(Isolate* isolate, 196 Handle<WasmMemoryObject> WasmMemoryObject::New(Isolate* isolate,
190 Handle<JSArrayBuffer> buffer, 197 Handle<JSArrayBuffer> buffer,
191 int maximum) { 198 int maximum) {
192 Handle<JSFunction> memory_ctor( 199 Handle<JSFunction> memory_ctor(
193 isolate->native_context()->wasm_memory_constructor()); 200 isolate->native_context()->wasm_memory_constructor());
194 Handle<JSObject> memory_obj = 201 Handle<JSObject> memory_obj =
195 isolate->factory()->NewJSObject(memory_ctor, TENURED); 202 isolate->factory()->NewJSObject(memory_ctor, TENURED);
196 memory_obj->SetInternalField(kArrayBuffer, *buffer); 203 memory_obj->SetInternalField(kArrayBuffer, *buffer);
197 memory_obj->SetInternalField(kMaximum, 204 memory_obj->SetInternalField(kMaximum,
198 static_cast<Object*>(Smi::FromInt(maximum))); 205 static_cast<Object*>(Smi::FromInt(maximum)));
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 !array->get(kPreviousInstanceWrapper)->IsFixedArray()) 847 !array->get(kPreviousInstanceWrapper)->IsFixedArray())
841 return false; 848 return false;
842 return true; 849 return true;
843 } 850 }
844 851
845 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance, 852 void WasmInstanceWrapper::set_instance_object(Handle<JSObject> instance,
846 Isolate* isolate) { 853 Isolate* isolate) {
847 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance); 854 Handle<WeakCell> cell = isolate->factory()->NewWeakCell(instance);
848 set(kWrapperInstanceObject, *cell); 855 set(kWrapperInstanceObject, *cell);
849 } 856 }
OLDNEW
« no previous file with comments | « src/wasm/wasm-objects.h ('k') | test/mjsunit/wasm/indirect-tables.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698