v8/src/find-and-replace-pattern.h
Georg Neis e1fde26608 Make explicit that RelocInfo's target_object is always a HeapObject.
BUG=v8:6048

Change-Id: Iecca35fa73d036ca6043712e3b14bf449ff2e457
Reviewed-on: https://chromium-review.googlesource.com/449734
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43633}
2017-03-07 10:42:55 +00:00

38 lines
856 B
C++

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_FIND_AND_REPLACE_PATTERN_H_
#define V8_FIND_AND_REPLACE_PATTERN_H_
#include "src/handles.h"
namespace v8 {
namespace internal {
class Map;
class Object;
class FindAndReplacePattern {
public:
FindAndReplacePattern() : count_(0) {}
void Add(Handle<Map> map_to_find, Handle<HeapObject> obj_to_replace) {
DCHECK(count_ < kMaxCount);
find_[count_] = map_to_find;
replace_[count_] = obj_to_replace;
++count_;
}
private:
static const int kMaxCount = 4;
int count_;
Handle<Map> find_[kMaxCount];
Handle<HeapObject> replace_[kMaxCount];
friend class Code;
};
} // namespace internal
} // namespace v8
#endif // V8_FIND_AND_REPLACE_PATTERN_H_