Commit ab43c76d authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Replace List with std::vector in uri, debug, and others.

Bug: v8:6333
Change-Id: Ibc704172ebc796977b8d8cfae6976666d186f12c
Reviewed-on: https://chromium-review.googlesource.com/652450
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47890}
parent 408f252b
......@@ -168,7 +168,7 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate,
if (it.HasContext()) {
context_chain_element.wrapped_context = it.CurrentContext();
}
context_chain_.Add(context_chain_element);
context_chain_.push_back(context_chain_element);
evaluation_context_ = outer_context;
break;
} else if (scope_type == ScopeIterator::ScopeTypeCatch ||
......@@ -179,7 +179,7 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate,
if (!current_context->IsDebugEvaluateContext()) {
context_chain_element.wrapped_context = current_context;
}
context_chain_.Add(context_chain_element);
context_chain_.push_back(context_chain_element);
} else if (scope_type == ScopeIterator::ScopeTypeBlock ||
scope_type == ScopeIterator::ScopeTypeEval) {
Handle<JSObject> materialized = factory->NewJSObjectWithNullProto();
......@@ -191,28 +191,29 @@ DebugEvaluate::ContextBuilder::ContextBuilder(Isolate* isolate,
if (it.HasContext()) {
context_chain_element.wrapped_context = it.CurrentContext();
}
context_chain_.Add(context_chain_element);
context_chain_.push_back(context_chain_element);
} else {
break;
}
}
for (int i = context_chain_.length() - 1; i >= 0; i--) {
for (auto rit = context_chain_.rbegin(); rit != context_chain_.rend();
rit++) {
ContextChainElement element = *rit;
Handle<ScopeInfo> scope_info(ScopeInfo::CreateForWithScope(
isolate, evaluation_context_->IsNativeContext()
? Handle<ScopeInfo>::null()
: Handle<ScopeInfo>(evaluation_context_->scope_info())));
scope_info->SetIsDebugEvaluateScope();
evaluation_context_ = factory->NewDebugEvaluateContext(
evaluation_context_, scope_info, context_chain_[i].materialized_object,
context_chain_[i].wrapped_context, context_chain_[i].whitelist);
evaluation_context_, scope_info, element.materialized_object,
element.wrapped_context, element.whitelist);
}
}
void DebugEvaluate::ContextBuilder::UpdateValues() {
for (int i = 0; i < context_chain_.length(); i++) {
ContextChainElement element = context_chain_[i];
for (ContextChainElement& element : context_chain_) {
if (!element.materialized_object.is_null()) {
// Write back potential changes to materialized stack locals to the stack.
FrameInspector(frame_, inlined_jsframe_index_, isolate_)
......
......@@ -5,6 +5,8 @@
#ifndef V8_DEBUG_DEBUG_EVALUATE_H_
#define V8_DEBUG_DEBUG_EVALUATE_H_
#include <vector>
#include "src/frames.h"
#include "src/objects.h"
#include "src/objects/string-table.h"
......@@ -73,7 +75,7 @@ class DebugEvaluate : public AllStatic {
Handle<SharedFunctionInfo> outer_info_;
Handle<Context> evaluation_context_;
List<ContextChainElement> context_chain_;
std::vector<ContextChainElement> context_chain_;
Isolate* isolate_;
JavaScriptFrame* frame_;
int inlined_jsframe_index_;
......
......@@ -23,7 +23,6 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
ScopeIterator::Option option)
: isolate_(isolate),
frame_inspector_(frame_inspector),
nested_scope_chain_(4),
seen_script_scope_(false) {
if (!frame_inspector->GetContext()->IsContext()) {
// Optimized frame, context or function cannot be materialized. Give up.
......@@ -83,9 +82,9 @@ void ScopeIterator::TryParseAndRetrieveScopes(ScopeIterator::Option option) {
}
}
if (scope_info->scope_type() == FUNCTION_SCOPE) {
nested_scope_chain_.Add(ExtendedScopeInfo(scope_info,
shared_info->start_position(),
shared_info->end_position()));
nested_scope_chain_.emplace_back(scope_info,
shared_info->start_position(),
shared_info->end_position());
}
if (!collect_non_locals) return;
}
......@@ -245,7 +244,7 @@ void ScopeIterator::Next() {
}
if (HasNestedScopeChain()) {
DCHECK_EQ(LastNestedScopeChain().scope_info->scope_type(), SCRIPT_SCOPE);
nested_scope_chain_.RemoveLast();
nested_scope_chain_.pop_back();
DCHECK(!HasNestedScopeChain());
}
CHECK(context_->IsNativeContext());
......@@ -257,7 +256,7 @@ void ScopeIterator::Next() {
DCHECK(context_->previous() != NULL);
context_ = Handle<Context>(context_->previous(), isolate_);
}
nested_scope_chain_.RemoveLast();
nested_scope_chain_.pop_back();
if (!HasNestedScopeChain()) break;
// Repeat to skip hidden scopes.
} while (LastNestedScopeChain().is_hidden());
......@@ -331,7 +330,7 @@ MaybeHandle<JSObject> ScopeIterator::ScopeObject() {
return MaterializeScriptScope();
case ScopeIterator::ScopeTypeLocal:
// Materialize the content of the local scope into a JSObject.
DCHECK(nested_scope_chain_.length() == 1);
DCHECK_EQ(1, nested_scope_chain_.size());
return MaterializeLocalScope();
case ScopeIterator::ScopeTypeWith:
return WithContextExtension();
......@@ -965,10 +964,10 @@ void ScopeIterator::GetNestedScopeChain(Isolate* isolate, Scope* scope,
if (scope->is_hidden()) {
// We need to add this chain element in case the scope has a context
// associated. We need to keep the scope chain and context chain in sync.
nested_scope_chain_.Add(ExtendedScopeInfo(scope->scope_info()));
nested_scope_chain_.emplace_back(scope->scope_info());
} else {
nested_scope_chain_.Add(ExtendedScopeInfo(
scope->scope_info(), scope->start_position(), scope->end_position()));
nested_scope_chain_.emplace_back(
scope->scope_info(), scope->start_position(), scope->end_position());
}
for (Scope* inner_scope = scope->inner_scope(); inner_scope != nullptr;
inner_scope = inner_scope->sibling()) {
......@@ -983,12 +982,12 @@ void ScopeIterator::GetNestedScopeChain(Isolate* isolate, Scope* scope,
}
bool ScopeIterator::HasNestedScopeChain() {
return !nested_scope_chain_.is_empty();
return !nested_scope_chain_.empty();
}
ScopeIterator::ExtendedScopeInfo& ScopeIterator::LastNestedScopeChain() {
DCHECK(HasNestedScopeChain());
return nested_scope_chain_.last();
return nested_scope_chain_.back();
}
} // namespace internal
......
......@@ -5,6 +5,8 @@
#ifndef V8_DEBUG_DEBUG_SCOPES_H_
#define V8_DEBUG_DEBUG_SCOPES_H_
#include <vector>
#include "src/debug/debug-frames.h"
#include "src/frames.h"
......@@ -101,7 +103,7 @@ class ScopeIterator {
FrameInspector* const frame_inspector_ = nullptr;
Handle<JSGeneratorObject> generator_;
Handle<Context> context_;
List<ExtendedScopeInfo> nested_scope_chain_;
std::vector<ExtendedScopeInfo> nested_scope_chain_;
Handle<StringSet> non_locals_;
bool seen_script_scope_;
......
......@@ -22,14 +22,13 @@ AllocationTraceNode::AllocationTraceNode(
AllocationTraceNode::~AllocationTraceNode() {
for (int i = 0; i < children_.length(); i++) delete children_[i];
for (AllocationTraceNode* node : children_) delete node;
}
AllocationTraceNode* AllocationTraceNode::FindChild(
unsigned function_info_index) {
for (int i = 0; i < children_.length(); i++) {
AllocationTraceNode* node = children_[i];
for (AllocationTraceNode* node : children_) {
if (node->function_info_index() == function_info_index) return node;
}
return NULL;
......@@ -41,7 +40,7 @@ AllocationTraceNode* AllocationTraceNode::FindOrAddChild(
AllocationTraceNode* child = FindChild(function_info_index);
if (child == NULL) {
child = new AllocationTraceNode(tree_, function_info_index);
children_.Add(child);
children_.push_back(child);
}
return child;
}
......@@ -64,8 +63,8 @@ void AllocationTraceNode::Print(int indent, AllocationTracker* tracker) {
}
base::OS::Print("\n");
indent += 2;
for (int i = 0; i < children_.length(); i++) {
children_[i]->Print(indent, tracker);
for (AllocationTraceNode* node : children_) {
node->Print(indent, tracker);
}
}
......@@ -98,13 +97,6 @@ void AllocationTraceTree::Print(AllocationTracker* tracker) {
root()->Print(0, tracker);
}
void AllocationTracker::DeleteUnresolvedLocation(
UnresolvedLocation** location) {
delete *location;
}
AllocationTracker::FunctionInfo::FunctionInfo()
: name(""),
function_id(0),
......@@ -185,11 +177,6 @@ void AddressToTraceMap::RemoveRange(Address start, Address end) {
}
}
void AllocationTracker::DeleteFunctionInfo(FunctionInfo** info) {
delete *info;
}
AllocationTracker::AllocationTracker(HeapObjectsMap* ids, StringsStorage* names)
: ids_(ids),
names_(names),
......@@ -197,24 +184,23 @@ AllocationTracker::AllocationTracker(HeapObjectsMap* ids, StringsStorage* names)
info_index_for_other_state_(0) {
FunctionInfo* info = new FunctionInfo();
info->name = "(root)";
function_info_list_.Add(info);
function_info_list_.push_back(info);
}
AllocationTracker::~AllocationTracker() {
unresolved_locations_.Iterate(DeleteUnresolvedLocation);
function_info_list_.Iterate(&DeleteFunctionInfo);
for (UnresolvedLocation* location : unresolved_locations_) delete location;
for (FunctionInfo* info : function_info_list_) delete info;
}
void AllocationTracker::PrepareForSerialization() {
List<UnresolvedLocation*> copy(unresolved_locations_.length());
copy.AddAll(unresolved_locations_);
unresolved_locations_.Clear();
for (int i = 0; i < copy.length(); i++) {
copy[i]->Resolve();
delete copy[i];
for (UnresolvedLocation* location : unresolved_locations_) {
location->Resolve();
delete location;
}
unresolved_locations_.clear();
unresolved_locations_.shrink_to_fit();
}
......@@ -273,13 +259,11 @@ unsigned AllocationTracker::AddFunctionInfo(SharedFunctionInfo* shared,
info->script_id = script->id();
// Converting start offset into line and column may cause heap
// allocations so we postpone them until snapshot serialization.
unresolved_locations_.Add(new UnresolvedLocation(
script,
shared->start_position(),
info));
unresolved_locations_.push_back(
new UnresolvedLocation(script, shared->start_position(), info));
}
entry->value = reinterpret_cast<void*>(function_info_list_.length());
function_info_list_.Add(info);
entry->value = reinterpret_cast<void*>(function_info_list_.size());
function_info_list_.push_back(info);
}
return static_cast<unsigned>(reinterpret_cast<intptr_t>((entry->value)));
}
......@@ -290,8 +274,9 @@ unsigned AllocationTracker::functionInfoIndexForVMState(StateTag state) {
if (info_index_for_other_state_ == 0) {
FunctionInfo* info = new FunctionInfo();
info->name = "(V8 API)";
info_index_for_other_state_ = function_info_list_.length();
function_info_list_.Add(info);
info_index_for_other_state_ =
static_cast<unsigned>(function_info_list_.size());
function_info_list_.push_back(info);
}
return info_index_for_other_state_;
}
......
......@@ -6,11 +6,11 @@
#define V8_PROFILER_ALLOCATION_TRACKER_H_
#include <map>
#include <vector>
#include "include/v8-profiler.h"
#include "src/base/hashmap.h"
#include "src/handles.h"
#include "src/list.h"
#include "src/vector.h"
namespace v8 {
......@@ -36,7 +36,9 @@ class AllocationTraceNode {
unsigned allocation_size() const { return total_size_; }
unsigned allocation_count() const { return allocation_count_; }
unsigned id() const { return id_; }
Vector<AllocationTraceNode*> children() const { return children_.ToVector(); }
const std::vector<AllocationTraceNode*>& children() const {
return children_;
}
void Print(int indent, AllocationTracker* tracker);
......@@ -46,7 +48,7 @@ class AllocationTraceNode {
unsigned total_size_;
unsigned allocation_count_;
unsigned id_;
List<AllocationTraceNode*> children_;
std::vector<AllocationTraceNode*> children_;
DISALLOW_COPY_AND_ASSIGN(AllocationTraceNode);
};
......@@ -112,14 +114,13 @@ class AllocationTracker {
void AllocationEvent(Address addr, int size);
AllocationTraceTree* trace_tree() { return &trace_tree_; }
const List<FunctionInfo*>& function_info_list() const {
const std::vector<FunctionInfo*>& function_info_list() const {
return function_info_list_;
}
AddressToTraceMap* address_to_trace() { return &address_to_trace_; }
private:
unsigned AddFunctionInfo(SharedFunctionInfo* info, SnapshotObjectId id);
static void DeleteFunctionInfo(FunctionInfo** info);
unsigned functionInfoIndexForVMState(StateTag state);
class UnresolvedLocation {
......@@ -135,16 +136,15 @@ class AllocationTracker {
int start_position_;
FunctionInfo* info_;
};
static void DeleteUnresolvedLocation(UnresolvedLocation** location);
static const int kMaxAllocationTraceLength = 64;
HeapObjectsMap* ids_;
StringsStorage* names_;
AllocationTraceTree trace_tree_;
unsigned allocation_trace_buffer_[kMaxAllocationTraceLength];
List<FunctionInfo*> function_info_list_;
std::vector<FunctionInfo*> function_info_list_;
base::HashMap id_to_function_info_index_;
List<UnresolvedLocation*> unresolved_locations_;
std::vector<UnresolvedLocation*> unresolved_locations_;
unsigned info_index_for_other_state_;
AddressToTraceMap address_to_trace_;
......
......@@ -197,7 +197,7 @@ void ProfilerEventsProcessor::operator delete(void* ptr) {
int CpuProfiler::GetProfilesCount() {
// The count of profiles doesn't depend on a security token.
return profiles_->profiles()->length();
return static_cast<int>(profiles_->profiles()->size());
}
......@@ -215,7 +215,7 @@ void CpuProfiler::DeleteAllProfiles() {
void CpuProfiler::DeleteProfile(CpuProfile* profile) {
profiles_->RemoveProfile(profile);
delete profile;
if (profiles_->profiles()->is_empty() && !is_profiling_) {
if (profiles_->profiles()->empty() && !is_profiling_) {
// If this was the last profile, clean up all accessory data as well.
ResetProfiles();
}
......
This diff is collapsed.
......@@ -7,6 +7,7 @@
#include <deque>
#include <unordered_map>
#include <vector>
#include "include/v8-profiler.h"
#include "src/base/platform/time.h"
......@@ -233,7 +234,7 @@ class HeapObjectsMap {
void StopHeapObjectsTracking();
SnapshotObjectId PushHeapObjectsStats(OutputStream* stream,
int64_t* timestamp_us);
const List<TimeInterval>& samples() const { return time_intervals_; }
const std::vector<TimeInterval>& samples() const { return time_intervals_; }
SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
......@@ -260,7 +261,7 @@ class HeapObjectsMap {
SnapshotObjectId next_id_;
base::HashMap entries_map_;
std::vector<EntryInfo> entries_;
List<TimeInterval> time_intervals_;
std::vector<TimeInterval> time_intervals_;
Heap* heap_;
DISALLOW_COPY_AND_ASSIGN(HeapObjectsMap);
......@@ -489,7 +490,8 @@ class NativeObjectsExplorer {
private:
void FillRetainedObjects();
void FillEdges();
List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info);
std::vector<HeapObject*>* GetVectorMaybeDisposeInfo(
v8::RetainedObjectInfo* info);
void SetNativeRootReference(v8::RetainedObjectInfo* info);
void SetRootNativeRootsReference();
void SetWrapperNativeReferences(HeapObject* wrapper,
......@@ -516,7 +518,7 @@ class NativeObjectsExplorer {
StringsStorage* names_;
bool embedder_queried_;
HeapObjectsSet in_groups_;
// RetainedObjectInfo* -> List<HeapObject*>*
// RetainedObjectInfo* -> std::vector<HeapObject*>*
base::CustomMatcherHashMap objects_by_info_;
base::CustomMatcherHashMap native_groups_;
HeapEntriesAllocator* synthetic_entries_allocator_;
......
......@@ -361,22 +361,22 @@ class Position {
// Non-recursive implementation of a depth-first post-order tree traversal.
template <typename Callback>
void ProfileTree::TraverseDepthFirst(Callback* callback) {
List<Position> stack(10);
stack.Add(Position(root_));
while (stack.length() > 0) {
Position& current = stack.last();
std::vector<Position> stack;
stack.emplace_back(root_);
while (stack.size() > 0) {
Position& current = stack.back();
if (current.has_current_child()) {
callback->BeforeTraversingChild(current.node, current.current_child());
stack.Add(Position(current.current_child()));
stack.emplace_back(current.current_child());
} else {
callback->AfterAllChildrenTraversed(current.node);
if (stack.length() > 1) {
Position& parent = stack[stack.length() - 2];
if (stack.size() > 1) {
Position& parent = stack[stack.size() - 2];
callback->AfterChildTraversed(parent.node, current.node);
parent.next_child();
}
// Remove child from the stack.
stack.RemoveLast();
stack.pop_back();
}
}
}
......@@ -404,12 +404,12 @@ void CpuProfile::AddPath(base::TimeTicks timestamp,
ProfileNode* top_frame_node =
top_down_.AddPathFromEnd(path, src_line, update_stats);
if (record_samples_ && !timestamp.IsNull()) {
timestamps_.Add(timestamp);
samples_.Add(top_frame_node);
timestamps_.push_back(timestamp);
samples_.push_back(top_frame_node);
}
const int kSamplesFlushCount = 100;
const int kNodesFlushCount = 10;
if (samples_.length() - streaming_next_sample_ >= kSamplesFlushCount ||
if (samples_.size() - streaming_next_sample_ >= kSamplesFlushCount ||
top_down_.pending_nodes_count() >= kNodesFlushCount) {
StreamPendingTraceEvents();
}
......@@ -446,10 +446,10 @@ void BuildNodeValue(const ProfileNode* node, TracedValue* value) {
void CpuProfile::StreamPendingTraceEvents() {
std::vector<const ProfileNode*> pending_nodes = top_down_.TakePendingNodes();
if (pending_nodes.empty() && !samples_.length()) return;
if (pending_nodes.empty() && samples_.empty()) return;
auto value = TracedValue::Create();
if (!pending_nodes.empty() || streaming_next_sample_ != samples_.length()) {
if (!pending_nodes.empty() || streaming_next_sample_ != samples_.size()) {
value->BeginDictionary("cpuProfile");
if (!pending_nodes.empty()) {
value->BeginArray("nodes");
......@@ -460,28 +460,28 @@ void CpuProfile::StreamPendingTraceEvents() {
}
value->EndArray();
}
if (streaming_next_sample_ != samples_.length()) {
if (streaming_next_sample_ != samples_.size()) {
value->BeginArray("samples");
for (int i = streaming_next_sample_; i < samples_.length(); ++i) {
for (size_t i = streaming_next_sample_; i < samples_.size(); ++i) {
value->AppendInteger(samples_[i]->id());
}
value->EndArray();
}
value->EndDictionary();
}
if (streaming_next_sample_ != samples_.length()) {
if (streaming_next_sample_ != samples_.size()) {
value->BeginArray("timeDeltas");
base::TimeTicks lastTimestamp =
streaming_next_sample_ ? timestamps_[streaming_next_sample_ - 1]
: start_time();
for (int i = streaming_next_sample_; i < timestamps_.length(); ++i) {
for (size_t i = streaming_next_sample_; i < timestamps_.size(); ++i) {
value->AppendInteger(
static_cast<int>((timestamps_[i] - lastTimestamp).InMicroseconds()));
lastTimestamp = timestamps_[i];
}
value->EndArray();
DCHECK(samples_.length() == timestamps_.length());
streaming_next_sample_ = samples_.length();
DCHECK_EQ(samples_.size(), timestamps_.size());
streaming_next_sample_ = samples_.size();
}
TRACE_EVENT_SAMPLE_WITH_ID1(TRACE_DISABLED_BY_DEFAULT("v8.cpu_profiler"),
......@@ -547,33 +547,28 @@ CpuProfilesCollection::CpuProfilesCollection(Isolate* isolate)
profiler_(nullptr),
current_profiles_semaphore_(1) {}
static void DeleteCpuProfile(CpuProfile** profile_ptr) {
delete *profile_ptr;
}
CpuProfilesCollection::~CpuProfilesCollection() {
finished_profiles_.Iterate(DeleteCpuProfile);
current_profiles_.Iterate(DeleteCpuProfile);
for (CpuProfile* profile : finished_profiles_) delete profile;
for (CpuProfile* profile : current_profiles_) delete profile;
}
bool CpuProfilesCollection::StartProfiling(const char* title,
bool record_samples) {
current_profiles_semaphore_.Wait();
if (current_profiles_.length() >= kMaxSimultaneousProfiles) {
if (static_cast<int>(current_profiles_.size()) >= kMaxSimultaneousProfiles) {
current_profiles_semaphore_.Signal();
return false;
}
for (int i = 0; i < current_profiles_.length(); ++i) {
if (strcmp(current_profiles_[i]->title(), title) == 0) {
for (CpuProfile* profile : current_profiles_) {
if (strcmp(profile->title(), title) == 0) {
// Ignore attempts to start profile with the same title...
current_profiles_semaphore_.Signal();
// ... though return true to force it collect a sample.
return true;
}
}
current_profiles_.Add(new CpuProfile(profiler_, title, record_samples));
current_profiles_.push_back(new CpuProfile(profiler_, title, record_samples));
current_profiles_semaphore_.Signal();
return true;
}
......@@ -583,9 +578,11 @@ CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) {
const int title_len = StrLength(title);
CpuProfile* profile = nullptr;
current_profiles_semaphore_.Wait();
for (int i = current_profiles_.length() - 1; i >= 0; --i) {
if (title_len == 0 || strcmp(current_profiles_[i]->title(), title) == 0) {
profile = current_profiles_.Remove(i);
for (size_t i = current_profiles_.size(); i != 0; --i) {
CpuProfile* current_profile = current_profiles_[i - 1];
if (title_len == 0 || strcmp(current_profile->title(), title) == 0) {
profile = current_profile;
current_profiles_.erase(current_profiles_.begin() + i - 1);
break;
}
}
......@@ -593,7 +590,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) {
if (!profile) return nullptr;
profile->FinishProfile();
finished_profiles_.Add(profile);
finished_profiles_.push_back(profile);
return profile;
}
......@@ -601,7 +598,7 @@ CpuProfile* CpuProfilesCollection::StopProfiling(const char* title) {
bool CpuProfilesCollection::IsLastProfile(const char* title) {
// Called from VM thread, and only it can mutate the list,
// so no locking is needed here.
if (current_profiles_.length() != 1) return false;
if (current_profiles_.size() != 1) return false;
return StrLength(title) == 0
|| strcmp(current_profiles_[0]->title(), title) == 0;
}
......@@ -609,13 +606,10 @@ bool CpuProfilesCollection::IsLastProfile(const char* title) {
void CpuProfilesCollection::RemoveProfile(CpuProfile* profile) {
// Called from VM thread for a completed profile.
for (int i = 0; i < finished_profiles_.length(); i++) {
if (profile == finished_profiles_[i]) {
finished_profiles_.Remove(i);
return;
}
}
UNREACHABLE();
auto pos =
std::find(finished_profiles_.begin(), finished_profiles_.end(), profile);
DCHECK(pos != finished_profiles_.end());
finished_profiles_.erase(pos);
}
void CpuProfilesCollection::AddPathToCurrentProfiles(
......@@ -625,8 +619,8 @@ void CpuProfilesCollection::AddPathToCurrentProfiles(
// method, we don't bother minimizing the duration of lock holding,
// e.g. copying contents of the list to a local vector.
current_profiles_semaphore_.Wait();
for (int i = 0; i < current_profiles_.length(); ++i) {
current_profiles_[i]->AddPath(timestamp, path, src_line, update_stats);
for (CpuProfile* profile : current_profiles_) {
profile->AddPath(timestamp, path, src_line, update_stats);
}
current_profiles_semaphore_.Signal();
}
......
......@@ -6,6 +6,8 @@
#define V8_PROFILER_PROFILE_GENERATOR_H_
#include <map>
#include <vector>
#include "src/allocation.h"
#include "src/base/hashmap.h"
#include "src/log.h"
......@@ -278,7 +280,7 @@ class CpuProfile {
const char* title() const { return title_; }
const ProfileTree* top_down() const { return &top_down_; }
int samples_count() const { return samples_.length(); }
int samples_count() const { return static_cast<int>(samples_.size()); }
ProfileNode* sample(int index) const { return samples_.at(index); }
base::TimeTicks sample_timestamp(int index) const {
return timestamps_.at(index);
......@@ -299,11 +301,11 @@ class CpuProfile {
bool record_samples_;
base::TimeTicks start_time_;
base::TimeTicks end_time_;
List<ProfileNode*> samples_;
List<base::TimeTicks> timestamps_;
std::vector<ProfileNode*> samples_;
std::vector<base::TimeTicks> timestamps_;
ProfileTree top_down_;
CpuProfiler* const profiler_;
int streaming_next_sample_;
size_t streaming_next_sample_;
DISALLOW_COPY_AND_ASSIGN(CpuProfile);
};
......@@ -340,7 +342,7 @@ class CpuProfilesCollection {
void set_cpu_profiler(CpuProfiler* profiler) { profiler_ = profiler; }
bool StartProfiling(const char* title, bool record_samples);
CpuProfile* StopProfiling(const char* title);
List<CpuProfile*>* profiles() { return &finished_profiles_; }
std::vector<CpuProfile*>* profiles() { return &finished_profiles_; }
const char* GetName(Name* name) { return resource_names_.GetName(name); }
bool IsLastProfile(const char* title);
void RemoveProfile(CpuProfile* profile);
......@@ -355,11 +357,11 @@ class CpuProfilesCollection {
private:
StringsStorage resource_names_;
List<CpuProfile*> finished_profiles_;
std::vector<CpuProfile*> finished_profiles_;
CpuProfiler* profiler_;
// Accessed by VM thread and profile generator thread.
List<CpuProfile*> current_profiles_;
std::vector<CpuProfile*> current_profiles_;
base::Semaphore current_profiles_semaphore_;
DISALLOW_COPY_AND_ASSIGN(CpuProfilesCollection);
......
......@@ -5,6 +5,7 @@
#include "src/regexp/jsregexp.h"
#include <memory>
#include <vector>
#include "src/base/platform/platform.h"
#include "src/compilation-cache.h"
......@@ -946,7 +947,7 @@ class RegExpCompiler {
inline void AddWork(RegExpNode* node) {
if (!node->on_work_list() && !node->label()->is_bound()) {
node->set_on_work_list(true);
work_list_->Add(node);
work_list_->push_back(node);
}
}
......@@ -997,7 +998,7 @@ class RegExpCompiler {
int next_register_;
int unicode_lookaround_stack_register_;
int unicode_lookaround_position_register_;
List<RegExpNode*>* work_list_;
std::vector<RegExpNode*>* work_list_;
int recursion_depth_;
RegExpMacroAssembler* macro_assembler_;
JSRegExp::Flags flags_;
......@@ -1067,7 +1068,7 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble(
#endif
macro_assembler_ = macro_assembler;
List <RegExpNode*> work_list(0);
std::vector<RegExpNode*> work_list;
work_list_ = &work_list;
Label fail;
macro_assembler_->PushBacktrack(&fail);
......@@ -1075,8 +1076,9 @@ RegExpEngine::CompilationResult RegExpCompiler::Assemble(
start->Emit(this, &new_trace);
macro_assembler_->Bind(&fail);
macro_assembler_->Fail();
while (!work_list.is_empty()) {
RegExpNode* node = work_list.RemoveLast();
while (!work_list.empty()) {
RegExpNode* node = work_list.back();
work_list.pop_back();
node->set_on_work_list(false);
if (!node->label()->is_bound()) node->Emit(this, &new_trace);
}
......
......@@ -4,6 +4,8 @@
#include "src/regexp/regexp-parser.h"
#include <vector>
#include "src/char-predicates-inl.h"
#include "src/factory.h"
#include "src/isolate.h"
......@@ -1276,30 +1278,30 @@ bool RegExpParser::ParsePropertyClass(ZoneList<CharacterRange>* result,
// and 'value' is interpreted as one of the available property value names.
// - Aliases in PropertyAlias.txt and PropertyValueAlias.txt can be used.
// - Loose matching is not applied.
List<char> first_part;
List<char> second_part;
std::vector<char> first_part;
std::vector<char> second_part;
if (current() == '{') {
// Parse \p{[PropertyName=]PropertyNameValue}
for (Advance(); current() != '}' && current() != '='; Advance()) {
if (!has_next()) return false;
first_part.Add(static_cast<char>(current()));
first_part.push_back(static_cast<char>(current()));
}
if (current() == '=') {
for (Advance(); current() != '}'; Advance()) {
if (!has_next()) return false;
second_part.Add(static_cast<char>(current()));
second_part.push_back(static_cast<char>(current()));
}
second_part.Add(0); // null-terminate string.
second_part.push_back(0); // null-terminate string.
}
} else {
return false;
}
Advance();
first_part.Add(0); // null-terminate string.
first_part.push_back(0); // null-terminate string.
if (second_part.is_empty()) {
if (second_part.empty()) {
// First attempt to interpret as general category property value name.
const char* name = first_part.ToConstVector().start();
const char* name = first_part.data();
if (LookupPropertyValueName(UCHAR_GENERAL_CATEGORY_MASK, name, negate,
result, zone())) {
return true;
......@@ -1317,8 +1319,8 @@ bool RegExpParser::ParsePropertyClass(ZoneList<CharacterRange>* result,
} else {
// Both property name and value name are specified. Attempt to interpret
// the property name as enumerated property.
const char* property_name = first_part.ToConstVector().start();
const char* value_name = second_part.ToConstVector().start();
const char* property_name = first_part.data();
const char* value_name = second_part.data();
UProperty property = u_getPropertyEnum(property_name);
if (!IsExactPropertyAlias(property_name, property)) return false;
if (property == UCHAR_GENERAL_CATEGORY) {
......
......@@ -4,6 +4,8 @@
#include "src/runtime/runtime-utils.h"
#include <vector>
#include "src/arguments.h"
#include "src/compiler.h"
#include "src/debug/debug-coverage.h"
......@@ -586,13 +588,13 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
}
}
List<Handle<Object>> locals;
std::vector<Handle<Object>> locals;
// Fill in the values of the locals.
int i = 0;
for (; i < scope_info->StackLocalCount(); ++i) {
// Use the value from the stack.
if (ScopeInfo::VariableIsSynthetic(scope_info->LocalName(i))) continue;
locals.Add(Handle<String>(scope_info->LocalName(i), isolate));
locals.emplace_back(scope_info->LocalName(i), isolate);
Handle<Object> value =
frame_inspector.GetExpression(scope_info->StackLocalIndex(i));
// TODO(yangguo): We convert optimized out values to {undefined} when they
......@@ -600,9 +602,9 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
if (value->IsOptimizedOut(isolate)) {
value = isolate->factory()->undefined_value();
}
locals.Add(value);
locals.push_back(value);
}
if (locals.length() < local_count * 2) {
if (static_cast<int>(locals.size()) < local_count * 2) {
// Get the context containing declarations.
DCHECK(maybe_context->IsContext());
Handle<Context> context(Context::cast(*maybe_context)->closure_context());
......@@ -613,11 +615,11 @@ RUNTIME_FUNCTION(Runtime_GetFrameDetails) {
VariableMode mode;
InitializationFlag init_flag;
MaybeAssignedFlag maybe_assigned_flag;
locals.Add(name);
locals.push_back(name);
int context_slot_index = ScopeInfo::ContextSlotIndex(
scope_info, name, &mode, &init_flag, &maybe_assigned_flag);
Object* value = context->get(context_slot_index);
locals.Add(Handle<Object>(value, isolate));
locals.emplace_back(value, isolate);
}
}
......@@ -850,17 +852,18 @@ RUNTIME_FUNCTION(Runtime_GetAllScopesDetails) {
}
FrameInspector frame_inspector(frame, inlined_frame_index, isolate);
List<Handle<JSObject>> result(4);
std::vector<Handle<JSObject>> result;
ScopeIterator it(isolate, &frame_inspector, option);
for (; !it.Done(); it.Next()) {
Handle<JSObject> details;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, details,
it.MaterializeScopeDetails());
result.Add(details);
result.push_back(details);
}
Handle<FixedArray> array = isolate->factory()->NewFixedArray(result.length());
for (int i = 0; i < result.length(); ++i) {
int result_size = static_cast<int>(result.size());
Handle<FixedArray> array = isolate->factory()->NewFixedArray(result_size);
for (int i = 0; i < result_size; ++i) {
array->set(i, *result[i]);
}
return *isolate->factory()->NewJSArrayWithElements(array);
......@@ -1300,7 +1303,7 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
CONVERT_NUMBER_CHECKED(int32_t, max_references, Int32, args[2]);
CHECK(max_references >= 0);
List<Handle<JSObject> > instances;
std::vector<Handle<JSObject>> instances;
Heap* heap = isolate->heap();
{
HeapIterator iterator(heap, HeapIterator::kFilterUnreachable);
......@@ -1322,8 +1325,8 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
if (obj->IsJSGlobalObject()) {
obj = JSGlobalObject::cast(obj)->global_proxy();
}
instances.Add(Handle<JSObject>(obj));
if (instances.length() == max_references) break;
instances.emplace_back(obj);
if (static_cast<int32_t>(instances.size()) == max_references) break;
}
// Iterate the rest of the heap to satisfy HeapIterator constraints.
while (iterator.next()) {
......@@ -1331,15 +1334,16 @@ RUNTIME_FUNCTION(Runtime_DebugReferencedBy) {
}
Handle<FixedArray> result;
if (instances.length() == 1 && instances.last().is_identical_to(target)) {
if (instances.size() == 1 && instances.back().is_identical_to(target)) {
// Check for circular reference only. This can happen when the object is
// only referenced from mirrors and has a circular reference in which case
// the object is not really alive and would have been garbage collected if
// not referenced from the mirror.
result = isolate->factory()->empty_fixed_array();
} else {
result = isolate->factory()->NewFixedArray(instances.length());
for (int i = 0; i < instances.length(); ++i) result->set(i, *instances[i]);
int instances_size = static_cast<int>(instances.size());
result = isolate->factory()->NewFixedArray(instances_size);
for (int i = 0; i < instances_size; ++i) result->set(i, *instances[i]);
}
return *isolate->factory()->NewJSArrayWithElements(result);
}
......@@ -1355,7 +1359,7 @@ RUNTIME_FUNCTION(Runtime_DebugConstructedBy) {
CONVERT_NUMBER_CHECKED(int32_t, max_references, Int32, args[1]);
CHECK(max_references >= 0);
List<Handle<JSObject> > instances;
std::vector<Handle<JSObject>> instances;
Heap* heap = isolate->heap();
{
HeapIterator iterator(heap, HeapIterator::kFilterUnreachable);
......@@ -1364,17 +1368,17 @@ RUNTIME_FUNCTION(Runtime_DebugConstructedBy) {
if (!heap_obj->IsJSObject()) continue;
JSObject* obj = JSObject::cast(heap_obj);
if (obj->map()->GetConstructor() != *constructor) continue;
instances.Add(Handle<JSObject>(obj));
if (instances.length() == max_references) break;
instances.emplace_back(obj);
if (static_cast<int32_t>(instances.size()) == max_references) break;
}
// Iterate the rest of the heap to satisfy HeapIterator constraints.
while (iterator.next()) {
}
}
Handle<FixedArray> result =
isolate->factory()->NewFixedArray(instances.length());
for (int i = 0; i < instances.length(); ++i) result->set(i, *instances[i]);
int instances_size = static_cast<int>(instances.size());
Handle<FixedArray> result = isolate->factory()->NewFixedArray(instances_size);
for (int i = 0; i < instances_size; ++i) result->set(i, *instances[i]);
return *isolate->factory()->NewJSArrayWithElements(result);
}
......
......@@ -267,13 +267,13 @@ int32_t Assembler::emit_code_target(Handle<Code> target,
DCHECK(RelocInfo::IsCodeTarget(rmode));
RecordRelocInfo(rmode);
int current = code_targets_.length();
size_t current = code_targets_.size();
if (current > 0 && !target.is_null() &&
code_targets_.last().is_identical_to(target)) {
code_targets_.back().is_identical_to(target)) {
// Optimization if we keep jumping to the same code target.
current--;
} else {
code_targets_.Add(target);
code_targets_.push_back(target);
}
return current;
}
......
......@@ -349,9 +349,9 @@ void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
// Specific instructions, constants, and masks.
Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
: AssemblerBase(isolate_data, buffer, buffer_size),
code_targets_(100) {
: AssemblerBase(isolate_data, buffer, buffer_size) {
reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
code_targets_.reserve(100);
last_bound_pos_ = 0;
relocations_.reserve(128);
......
......@@ -48,6 +48,8 @@
#include <fcntl.h>
#include <unistd.h>
#include <vector>
#include "src/assembler.h"
#include "src/s390/constants-s390.h"
......@@ -1595,7 +1597,7 @@ class Assembler : public AssemblerBase {
friend class RelocInfo;
friend class CodePatcher;
List<Handle<Code> > code_targets_;
std::vector<Handle<Code>> code_targets_;
friend class EnsureSpace;
};
......
......@@ -4,10 +4,11 @@
#include "src/uri.h"
#include <vector>
#include "src/char-predicates-inl.h"
#include "src/handles.h"
#include "src/isolate-inl.h"
#include "src/list.h"
#include "src/string-search.h"
namespace v8 {
......@@ -43,7 +44,8 @@ bool IsReplacementCharacter(const uint8_t* octets, int length) {
return true;
}
bool DecodeOctets(const uint8_t* octets, int length, List<uc16>* buffer) {
bool DecodeOctets(const uint8_t* octets, int length,
std::vector<uc16>* buffer) {
size_t cursor = 0;
uc32 value = unibrow::Utf8::ValueOf(octets, length, &cursor);
if (value == unibrow::Utf8::kBadChar &&
......@@ -52,10 +54,10 @@ bool DecodeOctets(const uint8_t* octets, int length, List<uc16>* buffer) {
}
if (value <= static_cast<uc32>(unibrow::Utf16::kMaxNonSurrogateCharCode)) {
buffer->Add(value);
buffer->push_back(value);
} else {
buffer->Add(unibrow::Utf16::LeadSurrogate(value));
buffer->Add(unibrow::Utf16::TrailSurrogate(value));
buffer->push_back(unibrow::Utf16::LeadSurrogate(value));
buffer->push_back(unibrow::Utf16::TrailSurrogate(value));
}
return true;
}
......@@ -72,23 +74,23 @@ int TwoDigitHex(uc16 character1, uc16 character2) {
template <typename T>
void AddToBuffer(uc16 decoded, String::FlatContent* uri_content, int index,
bool is_uri, List<T>* buffer) {
bool is_uri, std::vector<T>* buffer) {
if (is_uri && IsReservedPredicate(decoded)) {
buffer->Add('%');
buffer->push_back('%');
uc16 first = uri_content->Get(index + 1);
uc16 second = uri_content->Get(index + 2);
DCHECK_GT(std::numeric_limits<T>::max(), first);
DCHECK_GT(std::numeric_limits<T>::max(), second);
buffer->Add(first);
buffer->Add(second);
buffer->push_back(first);
buffer->push_back(second);
} else {
buffer->Add(decoded);
buffer->push_back(decoded);
}
}
bool IntoTwoByte(int index, bool is_uri, int uri_length,
String::FlatContent* uri_content, List<uc16>* buffer) {
String::FlatContent* uri_content, std::vector<uc16>* buffer) {
for (int k = index; k < uri_length; k++) {
uc16 code = uri_content->Get(k);
if (code == '%') {
......@@ -126,15 +128,15 @@ bool IntoTwoByte(int index, bool is_uri, int uri_length,
AddToBuffer(decoded, uri_content, k - 2, is_uri, buffer);
}
} else {
buffer->Add(code);
buffer->push_back(code);
}
}
return true;
}
bool IntoOneAndTwoByte(Handle<String> uri, bool is_uri,
List<uint8_t>* one_byte_buffer,
List<uc16>* two_byte_buffer) {
std::vector<uint8_t>* one_byte_buffer,
std::vector<uc16>* two_byte_buffer) {
DisallowHeapAllocation no_gc;
String::FlatContent uri_content = uri->GetFlatContent();
......@@ -162,7 +164,7 @@ bool IntoOneAndTwoByte(Handle<String> uri, bool is_uri,
return IntoTwoByte(k, is_uri, uri_length, &uri_content,
two_byte_buffer);
}
one_byte_buffer->Add(code);
one_byte_buffer->push_back(code);
}
}
return true;
......@@ -173,28 +175,28 @@ bool IntoOneAndTwoByte(Handle<String> uri, bool is_uri,
MaybeHandle<String> Uri::Decode(Isolate* isolate, Handle<String> uri,
bool is_uri) {
uri = String::Flatten(uri);
List<uint8_t> one_byte_buffer;
List<uc16> two_byte_buffer;
std::vector<uint8_t> one_byte_buffer;
std::vector<uc16> two_byte_buffer;
if (!IntoOneAndTwoByte(uri, is_uri, &one_byte_buffer, &two_byte_buffer)) {
THROW_NEW_ERROR(isolate, NewURIError(), String);
}
if (two_byte_buffer.is_empty()) {
return isolate->factory()->NewStringFromOneByte(
one_byte_buffer.ToConstVector());
if (two_byte_buffer.empty()) {
return isolate->factory()->NewStringFromOneByte(Vector<const uint8_t>(
one_byte_buffer.data(), static_cast<int>(one_byte_buffer.size())));
}
Handle<SeqTwoByteString> result;
int result_length =
static_cast<int>(one_byte_buffer.size() + two_byte_buffer.size());
ASSIGN_RETURN_ON_EXCEPTION(
isolate, result, isolate->factory()->NewRawTwoByteString(
one_byte_buffer.length() + two_byte_buffer.length()),
isolate, result, isolate->factory()->NewRawTwoByteString(result_length),
String);
CopyChars(result->GetChars(), one_byte_buffer.ToConstVector().start(),
one_byte_buffer.length());
CopyChars(result->GetChars() + one_byte_buffer.length(),
two_byte_buffer.ToConstVector().start(), two_byte_buffer.length());
CopyChars(result->GetChars(), one_byte_buffer.data(), one_byte_buffer.size());
CopyChars(result->GetChars() + one_byte_buffer.size(), two_byte_buffer.data(),
two_byte_buffer.size());
return result;
}
......@@ -240,13 +242,13 @@ bool IsUriSeparator(uc16 c) {
}
}
void AddEncodedOctetToBuffer(uint8_t octet, List<uint8_t>* buffer) {
buffer->Add('%');
buffer->Add(HexCharOfValue(octet >> 4));
buffer->Add(HexCharOfValue(octet & 0x0F));
void AddEncodedOctetToBuffer(uint8_t octet, std::vector<uint8_t>* buffer) {
buffer->push_back('%');
buffer->push_back(HexCharOfValue(octet >> 4));
buffer->push_back(HexCharOfValue(octet & 0x0F));
}
void EncodeSingle(uc16 c, List<uint8_t>* buffer) {
void EncodeSingle(uc16 c, std::vector<uint8_t>* buffer) {
char s[4] = {};
int number_of_bytes;
number_of_bytes =
......@@ -256,7 +258,7 @@ void EncodeSingle(uc16 c, List<uint8_t>* buffer) {
}
}
void EncodePair(uc16 cc1, uc16 cc2, List<uint8_t>* buffer) {
void EncodePair(uc16 cc1, uc16 cc2, std::vector<uint8_t>* buffer) {
char s[4] = {};
int number_of_bytes =
unibrow::Utf8::Encode(s, unibrow::Utf16::CombineSurrogatePair(cc1, cc2),
......@@ -272,7 +274,8 @@ MaybeHandle<String> Uri::Encode(Isolate* isolate, Handle<String> uri,
bool is_uri) {
uri = String::Flatten(uri);
int uri_length = uri->length();
List<uint8_t> buffer(uri_length);
std::vector<uint8_t> buffer;
buffer.reserve(uri_length);
{
DisallowHeapAllocation no_gc;
......@@ -292,7 +295,7 @@ MaybeHandle<String> Uri::Encode(Isolate* isolate, Handle<String> uri,
} else if (!unibrow::Utf16::IsTrailSurrogate(cc1)) {
if (IsUnescapePredicateInUriComponent(cc1) ||
(is_uri && IsUriSeparator(cc1))) {
buffer.Add(cc1);
buffer.push_back(cc1);
} else {
EncodeSingle(cc1, &buffer);
}
......@@ -304,7 +307,8 @@ MaybeHandle<String> Uri::Encode(Isolate* isolate, Handle<String> uri,
}
}
return isolate->factory()->NewStringFromOneByte(buffer.ToConstVector());
return isolate->factory()->NewStringFromOneByte(
Vector<const uint8_t>(buffer.data(), static_cast<int>(buffer.size())));
}
namespace { // Anonymous namespace for Escape and Unescape
......
......@@ -56,13 +56,13 @@ void Assembler::emitw(uint16_t x) {
void Assembler::emit_code_target(Handle<Code> target, RelocInfo::Mode rmode) {
DCHECK(RelocInfo::IsCodeTarget(rmode));
RecordRelocInfo(rmode);
int current = code_targets_.length();
int current = static_cast<int>(code_targets_.size());
if (current > 0 && !target.is_null() &&
code_targets_.last().address() == target.address()) {
code_targets_.back().address() == target.address()) {
// Optimization if we keep jumping to the same code target.
emitl(current - 1);
} else {
code_targets_.Add(target);
code_targets_.push_back(target);
emitl(current);
}
}
......
......@@ -300,7 +300,7 @@ void Assembler::AllocateAndInstallRequestedHeapObjects(Isolate* isolate) {
// Implementation of Assembler.
Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
: AssemblerBase(isolate_data, buffer, buffer_size), code_targets_(100) {
: AssemblerBase(isolate_data, buffer, buffer_size) {
// Clear the buffer in debug mode unless it was provided by the
// caller in which case we can't be sure it's okay to overwrite
// existing code in it.
......@@ -310,6 +310,7 @@ Assembler::Assembler(IsolateData isolate_data, void* buffer, int buffer_size)
}
#endif
code_targets_.reserve(100);
reloc_info_writer.Reposition(buffer_ + buffer_size_, pc_);
}
......
......@@ -39,6 +39,7 @@
#include <deque>
#include <forward_list>
#include <vector>
#include "src/assembler.h"
#include "src/x64/sse-instr.h"
......@@ -2422,7 +2423,7 @@ class Assembler : public AssemblerBase {
// are already bound.
std::deque<int> internal_reference_positions_;
List< Handle<Code> > code_targets_;
std::vector<Handle<Code>> code_targets_;
// The following functions help with avoiding allocations of embedded heap
// objects during the code assembly phase. {RequestHeapObject} records the
......
......@@ -2433,14 +2433,14 @@ static AllocationTraceNode* FindNode(
AllocationTraceNode* node = tracker->trace_tree()->root();
for (int i = 0; node != NULL && i < names.length(); i++) {
const char* name = names[i];
Vector<AllocationTraceNode*> children = node->children();
const std::vector<AllocationTraceNode*>& children = node->children();
node = NULL;
for (int j = 0; j < children.length(); j++) {
unsigned index = children[j]->function_info_index();
for (AllocationTraceNode* child : children) {
unsigned index = child->function_info_index();
AllocationTracker::FunctionInfo* info =
tracker->function_info_list()[index];
if (info && strcmp(info->name, name) == 0) {
node = children[j];
node = child;
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment