diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-12-05 16:41:55 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-12-06 12:52:07 +0100 |
commit | 1854ba04e9a68f062beb299dd6e1479279b26363 (patch) | |
tree | d5b2df9b8c1deb6388f7a728fca8e1c98c779abe /deps/v8/src/gdb-jit.cc | |
parent | b52c23b75f96e1c9d2c7b3a7e5619170d0a0d8e1 (diff) | |
download | android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.tar.gz android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.tar.bz2 android-node-v8-1854ba04e9a68f062beb299dd6e1479279b26363.zip |
deps: update V8 to 6.3.292.46
PR-URL: https://github.com/nodejs/node/pull/16271
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/gdb-jit.cc')
-rw-r--r-- | deps/v8/src/gdb-jit.cc | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/deps/v8/src/gdb-jit.cc b/deps/v8/src/gdb-jit.cc index d0395330c2..57c8100325 100644 --- a/deps/v8/src/gdb-jit.cc +++ b/deps/v8/src/gdb-jit.cc @@ -5,7 +5,9 @@ #include "src/gdb-jit.h" #include <memory> +#include <vector> +#include "src/api.h" #include "src/base/bits.h" #include "src/base/platform/platform.h" #include "src/bootstrapper.h" @@ -923,8 +925,6 @@ class ELFSymbolTable : public ELFSection { class LineInfo : public Malloced { public: - LineInfo() : pc_info_(10) {} - void SetPosition(intptr_t pc, int pos, bool is_statement) { AddPCInfo(PCInfo(pc, pos, is_statement)); } @@ -938,12 +938,12 @@ class LineInfo : public Malloced { bool is_statement_; }; - List<PCInfo>* pc_info() { return &pc_info_; } + std::vector<PCInfo>* pc_info() { return &pc_info_; } private: - void AddPCInfo(const PCInfo& pc_info) { pc_info_.Add(pc_info); } + void AddPCInfo(const PCInfo& pc_info) { pc_info_.push_back(pc_info); } - List<PCInfo> pc_info_; + std::vector<PCInfo> pc_info_; }; @@ -970,7 +970,7 @@ class CodeDescription BASE_EMBEDDED { bool is_function() const { Code::Kind kind = code_->kind(); - return kind == Code::FUNCTION || kind == Code::OPTIMIZED_FUNCTION; + return kind == Code::OPTIMIZED_FUNCTION; } bool has_scope_info() const { return shared_info_ != NULL; } @@ -1512,11 +1512,10 @@ class DebugLineSection : public DebugSection { intptr_t line = 1; bool is_statement = true; - List<LineInfo::PCInfo>* pc_info = desc_->lineinfo()->pc_info(); - pc_info->Sort(&ComparePCInfo); + std::vector<LineInfo::PCInfo>* pc_info = desc_->lineinfo()->pc_info(); + std::sort(pc_info->begin(), pc_info->end(), &ComparePCInfo); - int pc_info_length = pc_info->length(); - for (int i = 0; i < pc_info_length; i++) { + for (size_t i = 0; i < pc_info->size(); i++) { LineInfo::PCInfo* info = &pc_info->at(i); DCHECK(info->pc_ >= pc); @@ -1531,7 +1530,7 @@ class DebugLineSection : public DebugSection { // the last pc address in the function as a statement (e.g. "}"), so that // a user can see the result of the last line executed in the function, // should control reach the end. - if ((i+1) == pc_info_length) { + if ((i + 1) == pc_info->size()) { if (!is_statement) { w->Write<uint8_t>(DW_LNS_NEGATE_STMT); } @@ -1588,18 +1587,15 @@ class DebugLineSection : public DebugSection { w->Write<uint8_t>(op); } - static int ComparePCInfo(const LineInfo::PCInfo* a, - const LineInfo::PCInfo* b) { - if (a->pc_ == b->pc_) { - if (a->is_statement_ != b->is_statement_) { - return b->is_statement_ ? +1 : -1; + static bool ComparePCInfo(const LineInfo::PCInfo& a, + const LineInfo::PCInfo& b) { + if (a.pc_ == b.pc_) { + if (a.is_statement_ != b.is_statement_) { + return !b.is_statement_; } - return 0; - } else if (a->pc_ > b->pc_) { - return +1; - } else { - return -1; + return false; } + return a.pc_ < b.pc_; } CodeDescription* desc_; |