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

Unified Diff: src/trusted/validator_arm/dgen_core.py

Issue 9960043: Finish separation of testing from sel_ldr validation. Also, automate (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: src/trusted/validator_arm/dgen_core.py
===================================================================
--- src/trusted/validator_arm/dgen_core.py (revision 8201)
+++ src/trusted/validator_arm/dgen_core.py (working copy)
@@ -1,9 +1,8 @@
#!/usr/bin/python
#
-# Copyright 2009 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can
-# be found in the LICENSE file.
-# Copyright 2009, Google Inc.
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
#
"""
@@ -228,6 +227,22 @@
parsed.append(BitPattern.parse(col_patterns[i], col[1], col[2]))
self.rows.append(Row(parsed, action_string, arch))
+ def rows_filtered(self, num_actions):
+ """Returns rows for building runtime tables. Automatically filters
+ actions down to the specified number of actions. Typically this
+ is done to remove unwanted testing data that would minimize the
+ effect of optimizing the rows of a table.
+ """
+ rows = []
+ for r in self.rows:
+ count = 1
+ reduced_actions = []
+ for a in r.action.split():
robertm 2012/04/11 01:28:43 could this be simplified with array slicing, e.g.
Karl 2012/04/16 23:18:10 This code simplified once I removed parsing from t
+ if count > num_actions: break;
+ reduced_actions.append(a)
+ count += 1
+ rows.append(Row(r.patterns, ' '.join(reduced_actions), r.arch))
+ return rows
class Row(object):
""" A row in a Table."""

Powered by Google App Engine
This is Rietveld 408576698