PTAL

http://codereview.chromium.org/7839030/diff/2001/src/debug.cc
File src/debug.cc (right):

http://codereview.chromium.org/7839030/diff/2001/src/debug.cc#newcode1686
src/debug.cc:1686: bool SortedListContains(List<JSFunction*>* functions,
JSFunction* function) {
On 2011/09/08 08:07:59, Sven wrote:
Perhaps this should be moved to the List template class, probably with
a
different signature (something like C's bsearch)

Added the following template functions to list.h. I decided against
adding bsearch directly to list as I did not want to add a flag for
bookkeeping whether the list is currently sorted.

// Perform binary search for an element in an already sorted
// list. Returns the index of the element of -1 if it was not found.
template <typename T>
int SortedListBSearch(List<T>& list, T elem, int (*cmp)(const T* x,
const T* y));
template <typename T>
int SortedListBSearch(List<T>& list, T elem);

http://codereview.chromium.org/7839030/diff/2001/src/debug.cc#newcode1720
src/debug.cc:1720: List<JSFunction*> functions(100);
On 2011/09/08 08:07:59, Sven wrote:
functions => active_functions

Done.

http://codereview.chromium.org/7839030/diff/2001/src/objects-inl.h
File src/objects-inl.h (right):

http://codereview.chromium.org/7839030/diff/2001/src/objects-inl.h#newcode2950
src/objects-inl.h:2950: kFullCodeFlagsHasDeoptimizationSupportShift) ==
1;
On 2011/09/08 08:07:59, Sven wrote:
Why do we need both a mask and a shift? A single bit mask/flag
(whatever you
call it) seems to be sufficient. Same for other places like this
below.

This pattern is used for all the other flags (at lease for class Code),
as some flags are more than one bit. However I changed the
initialization of the Mask values in objects.h to

  static const int kFullCodeFlagsHasDeoptimizationSupportMask =
      1 << kFullCodeFlagsHasDeoptimizationSupportShift;
  static const int kFullCodeFlagsHasDebugBreakSlotsMask =
      1 << kFullCodeFlagsHasDebugBreakSlotsShift;

http://codereview.chromium.org/7839030/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to