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.h" | 5 #include "src/api.h" |
6 #include "src/api-natives.h" | 6 #include "src/api-natives.h" |
7 #include "src/assert-scope.h" | 7 #include "src/assert-scope.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 188 |
189 i::MaybeHandle<i::JSObject> object = | 189 i::MaybeHandle<i::JSObject> object = |
190 result.val->Instantiate(isolate, ffi, memory); | 190 result.val->Instantiate(isolate, ffi, memory); |
191 | 191 |
192 if (!object.is_null()) { | 192 if (!object.is_null()) { |
193 args.GetReturnValue().Set(v8::Utils::ToLocal(object.ToHandleChecked())); | 193 args.GetReturnValue().Set(v8::Utils::ToLocal(object.ToHandleChecked())); |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 if (result.val) delete result.val; | 197 if (result.val) delete result.val; |
198 isolate->counters()->wasm_instantiate_peak_memory()->AddSample( | |
199 static_cast<int>(zone.allocation_size())); | |
ahaas
2016/04/11 08:03:08
What exactly do you want to measure with this coun
bradn
2016/04/13 00:22:45
Erg, yeah this one doesn't make much sense.
Ideall
| |
198 } | 200 } |
199 | 201 |
200 | 202 |
201 void InstantiateModuleFromAsm(const v8::FunctionCallbackInfo<v8::Value>& args) { | 203 void InstantiateModuleFromAsm(const v8::FunctionCallbackInfo<v8::Value>& args) { |
202 HandleScope scope(args.GetIsolate()); | 204 HandleScope scope(args.GetIsolate()); |
203 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); | 205 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(args.GetIsolate()); |
204 ErrorThrower thrower(isolate, "WASM.instantiateModuleFromAsm()"); | 206 ErrorThrower thrower(isolate, "WASM.instantiateModuleFromAsm()"); |
205 | 207 |
206 if (!args[0]->IsString()) { | 208 if (!args[0]->IsString()) { |
207 thrower.Error("Asm module text should be a string"); | 209 thrower.Error("Asm module text should be a string"); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 int unused_property_fields = in_object_properties - pre_allocated; | 319 int unused_property_fields = in_object_properties - pre_allocated; |
318 Handle<Map> map = Map::CopyInitialMap( | 320 Handle<Map> map = Map::CopyInitialMap( |
319 prev_map, instance_size, in_object_properties, unused_property_fields); | 321 prev_map, instance_size, in_object_properties, unused_property_fields); |
320 | 322 |
321 context->set_wasm_function_map(*map); | 323 context->set_wasm_function_map(*map); |
322 } | 324 } |
323 } | 325 } |
324 | 326 |
325 } // namespace internal | 327 } // namespace internal |
326 } // namespace v8 | 328 } // namespace v8 |
OLD | NEW |