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

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

Issue 1847543002: Expose a lower bound of malloc'd memory via heap statistics (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates 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
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | src/wasm/wasm-js.cc » ('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/module-decoder.h" 5 #include "src/wasm/module-decoder.h"
6 6
7 #include "src/base/functional.h" 7 #include "src/base/functional.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 WasmFunction* function) { 568 WasmFunction* function) {
569 if (FLAG_trace_wasm_decode_time) { 569 if (FLAG_trace_wasm_decode_time) {
570 OFStream os(stdout); 570 OFStream os(stdout);
571 os << "Verifying WASM function " << WasmFunctionName(function, menv) 571 os << "Verifying WASM function " << WasmFunctionName(function, menv)
572 << std::endl; 572 << std::endl;
573 os << std::endl; 573 os << std::endl;
574 } 574 }
575 FunctionBody body = {menv, function->sig, start_, 575 FunctionBody body = {menv, function->sig, start_,
576 start_ + function->code_start_offset, 576 start_ + function->code_start_offset,
577 start_ + function->code_end_offset}; 577 start_ + function->code_end_offset};
578 TreeResult result = VerifyWasmCode(body); 578 TreeResult result = VerifyWasmCode(module_zone->allocator(), body);
579 if (result.failed()) { 579 if (result.failed()) {
580 // Wrap the error message from the function decoder. 580 // Wrap the error message from the function decoder.
581 std::ostringstream str; 581 std::ostringstream str;
582 str << "in function " << WasmFunctionName(function, menv) << ": "; 582 str << "in function " << WasmFunctionName(function, menv) << ": ";
583 str << result; 583 str << result;
584 std::string strval = str.str(); 584 std::string strval = str.str();
585 const char* raw = strval.c_str(); 585 const char* raw = strval.c_str();
586 size_t len = strlen(raw); 586 size_t len = strlen(raw);
587 char* buffer = new char[len]; 587 char* buffer = new char[len];
588 strncpy(buffer, raw, len); 588 strncpy(buffer, raw, len);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 if (function_start > function_end) return FunctionError("start > end"); 791 if (function_start > function_end) return FunctionError("start > end");
792 if (size > kMaxFunctionSize) 792 if (size > kMaxFunctionSize)
793 return FunctionError("size > maximum function size"); 793 return FunctionError("size > maximum function size");
794 WasmFunction* function = new WasmFunction(); 794 WasmFunction* function = new WasmFunction();
795 ModuleDecoder decoder(zone, function_start, function_end, kWasmOrigin); 795 ModuleDecoder decoder(zone, function_start, function_end, kWasmOrigin);
796 return decoder.DecodeSingleFunction(module_env, function); 796 return decoder.DecodeSingleFunction(module_env, function);
797 } 797 }
798 } // namespace wasm 798 } // namespace wasm
799 } // namespace internal 799 } // namespace internal
800 } // namespace v8 800 } // namespace v8
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | src/wasm/wasm-js.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698