daf539e2f9
1. Instead of making a pass before the Marking phase, this change does not visit code pointers in functions during marking. Then after marking, if the code has still not been marked, code pointers in functions are nulled out. 2. Since code pointers in functions may be nulled out, functions are no longer used as proxies for code in deoptimization info. R=iposva@google.com, srdjan@google.com Review URL: https://codereview.chromium.org//70183010 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30600 260f80e4-7a28-3924-810f-c04153c831b5
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef VM_MEGAMORPHIC_CACHE_TABLE_H_
|
|
#define VM_MEGAMORPHIC_CACHE_TABLE_H_
|
|
|
|
#include "vm/allocation.h"
|
|
|
|
namespace dart {
|
|
|
|
class Array;
|
|
class Function;
|
|
class ObjectPointerVisitor;
|
|
class RawArray;
|
|
class RawFunction;
|
|
class RawCode;
|
|
class RawMegamorphicCache;
|
|
class RawString;
|
|
class String;
|
|
|
|
class MegamorphicCacheTable {
|
|
public:
|
|
MegamorphicCacheTable();
|
|
~MegamorphicCacheTable();
|
|
|
|
RawFunction* miss_handler() const { return miss_handler_function_; }
|
|
void InitMissHandler();
|
|
|
|
RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
|
|
|
|
void VisitObjectPointers(ObjectPointerVisitor* visitor);
|
|
|
|
void PrintSizes();
|
|
|
|
private:
|
|
struct Entry {
|
|
RawString* name;
|
|
RawArray* descriptor;
|
|
RawMegamorphicCache* cache;
|
|
};
|
|
|
|
static const int kCapacityIncrement = 128;
|
|
|
|
RawFunction* miss_handler_function_;
|
|
RawCode* miss_handler_code_;
|
|
intptr_t capacity_;
|
|
intptr_t length_;
|
|
Entry* table_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // VM_MEGAMORPHIC_CACHE_TABLE_H_
|