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-js.cc

Issue 1866873002: [wasm] Adding metrics for Asm/Wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 8 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 "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
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
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
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | src/wasm/wasm-module.cc » ('j') | src/wasm/wasm-module.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698