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

Side by Side Diff: src/wasm/signature-map.cc

Issue 2424623002: [wasm] Use a Managed<WasmModule> to hold metadata about modules. (Closed)
Patch Set: Review comments Created 4 years, 2 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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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/signature-map.h" 5 #include "src/wasm/signature-map.h"
6 6
7 namespace v8 { 7 namespace v8 {
8 namespace internal { 8 namespace internal {
9 namespace wasm { 9 namespace wasm {
10 10
(...skipping 28 matching lines...) Expand all
39 if (a->GetReturn(r) < b->GetReturn(r)) return true; 39 if (a->GetReturn(r) < b->GetReturn(r)) return true;
40 if (a->GetReturn(r) > b->GetReturn(r)) return false; 40 if (a->GetReturn(r) > b->GetReturn(r)) return false;
41 } 41 }
42 for (size_t p = 0; p < a->parameter_count(); p++) { 42 for (size_t p = 0; p < a->parameter_count(); p++) {
43 if (a->GetParam(p) < b->GetParam(p)) return true; 43 if (a->GetParam(p) < b->GetParam(p)) return true;
44 if (a->GetParam(p) > b->GetParam(p)) return false; 44 if (a->GetParam(p) > b->GetParam(p)) return false;
45 } 45 }
46 return false; 46 return false;
47 } 47 }
48 48
49 bool SignatureMap::Equal(FunctionSig* a, FunctionSig* b) {
50 if (a->parameter_count() != b->parameter_count()) return false;
51 if (a->return_count() != b->return_count()) return false;
52 for (size_t i = 0; i < a->parameter_count(); i++) {
Mircea Trofin 2016/10/19 05:28:55 This bottom part could be done blindly wrt what's
titzer 2016/10/19 09:54:41 Done.
53 if (a->GetParam(i) != b->GetParam(i)) return false;
54 }
55 for (size_t i = 0; i < a->return_count(); i++) {
56 if (a->GetReturn(i) != b->GetReturn(i)) return false;
57 }
58 return true;
59 }
60
49 } // namespace wasm 61 } // namespace wasm
50 } // namespace internal 62 } // namespace internal
51 } // namespace v8 63 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698