summaryrefslogtreecommitdiff
path: root/deps/v8/src/objects/debug-objects.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-08-01 08:38:30 +0200
committerMichaël Zasso <targos@protonmail.com>2019-08-01 12:53:56 +0200
commit2dcc3665abf57c3607cebffdeeca062f5894885d (patch)
tree4f560748132edcfb4c22d6f967a7e80d23d7ea2c /deps/v8/src/objects/debug-objects.cc
parent1ee47d550c6de132f06110aa13eceb7551d643b3 (diff)
downloadnode-new-2dcc3665abf57c3607cebffdeeca062f5894885d.tar.gz
deps: update V8 to 7.6.303.28
PR-URL: https://github.com/nodejs/node/pull/28016 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann (רפאל פלחי) <refack@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Diffstat (limited to 'deps/v8/src/objects/debug-objects.cc')
-rw-r--r--deps/v8/src/objects/debug-objects.cc75
1 files changed, 37 insertions, 38 deletions
diff --git a/deps/v8/src/objects/debug-objects.cc b/deps/v8/src/objects/debug-objects.cc
index 760edbfbcf..5087918e75 100644
--- a/deps/v8/src/objects/debug-objects.cc
+++ b/deps/v8/src/objects/debug-objects.cc
@@ -5,9 +5,9 @@
#include "src/objects/debug-objects.h"
#include "src/debug/debug-evaluate.h"
-#include "src/handles-inl.h"
+#include "src/handles/handles-inl.h"
#include "src/objects/debug-objects-inl.h"
-#include "src/ostreams.h"
+#include "src/utils/ostreams.h"
namespace v8 {
namespace internal {
@@ -31,7 +31,7 @@ void DebugInfo::ClearBreakInfo(Isolate* isolate) {
if (HasInstrumentedBytecodeArray()) {
// Reset function's bytecode array field to point to the original bytecode
// array.
- shared()->SetDebugBytecodeArray(OriginalBytecodeArray());
+ shared().SetDebugBytecodeArray(OriginalBytecodeArray());
// If the function is currently running on the stack, we need to update the
// bytecode pointers on the stack so they point to the original
@@ -80,19 +80,18 @@ bool DebugInfo::HasBreakPoint(Isolate* isolate, int source_position) {
// If there is no break point info object or no break points in the break
// point info object there is no break point at this code offset.
- if (break_point_info->IsUndefined(isolate)) return false;
- return BreakPointInfo::cast(break_point_info)->GetBreakPointCount(isolate) >
- 0;
+ if (break_point_info.IsUndefined(isolate)) return false;
+ return BreakPointInfo::cast(break_point_info).GetBreakPointCount(isolate) > 0;
}
// Get the break point info object for this source position.
Object DebugInfo::GetBreakPointInfo(Isolate* isolate, int source_position) {
DCHECK(HasBreakInfo());
- for (int i = 0; i < break_points()->length(); i++) {
- if (!break_points()->get(i)->IsUndefined(isolate)) {
+ for (int i = 0; i < break_points().length(); i++) {
+ if (!break_points().get(i).IsUndefined(isolate)) {
BreakPointInfo break_point_info =
- BreakPointInfo::cast(break_points()->get(i));
- if (break_point_info->source_position() == source_position) {
+ BreakPointInfo::cast(break_points().get(i));
+ if (break_point_info.source_position() == source_position) {
return break_point_info;
}
}
@@ -103,10 +102,10 @@ Object DebugInfo::GetBreakPointInfo(Isolate* isolate, int source_position) {
bool DebugInfo::ClearBreakPoint(Isolate* isolate, Handle<DebugInfo> debug_info,
Handle<BreakPoint> break_point) {
DCHECK(debug_info->HasBreakInfo());
- for (int i = 0; i < debug_info->break_points()->length(); i++) {
- if (debug_info->break_points()->get(i)->IsUndefined(isolate)) continue;
+ for (int i = 0; i < debug_info->break_points().length(); i++) {
+ if (debug_info->break_points().get(i).IsUndefined(isolate)) continue;
Handle<BreakPointInfo> break_point_info = Handle<BreakPointInfo>(
- BreakPointInfo::cast(debug_info->break_points()->get(i)), isolate);
+ BreakPointInfo::cast(debug_info->break_points().get(i)), isolate);
if (BreakPointInfo::HasBreakPoint(isolate, break_point_info, break_point)) {
BreakPointInfo::ClearBreakPoint(isolate, break_point_info, break_point);
return true;
@@ -131,8 +130,8 @@ void DebugInfo::SetBreakPoint(Isolate* isolate, Handle<DebugInfo> debug_info,
// break points before. Try to find a free slot.
static const int kNoBreakPointInfo = -1;
int index = kNoBreakPointInfo;
- for (int i = 0; i < debug_info->break_points()->length(); i++) {
- if (debug_info->break_points()->get(i)->IsUndefined(isolate)) {
+ for (int i = 0; i < debug_info->break_points().length(); i++) {
+ if (debug_info->break_points().get(i).IsUndefined(isolate)) {
index = i;
break;
}
@@ -157,7 +156,7 @@ void DebugInfo::SetBreakPoint(Isolate* isolate, Handle<DebugInfo> debug_info,
Handle<BreakPointInfo> new_break_point_info =
isolate->factory()->NewBreakPointInfo(source_position);
BreakPointInfo::SetBreakPoint(isolate, new_break_point_info, break_point);
- debug_info->break_points()->set(index, *new_break_point_info);
+ debug_info->break_points().set(index, *new_break_point_info);
}
// Get the break point objects for a source position.
@@ -165,10 +164,10 @@ Handle<Object> DebugInfo::GetBreakPoints(Isolate* isolate,
int source_position) {
DCHECK(HasBreakInfo());
Object break_point_info = GetBreakPointInfo(isolate, source_position);
- if (break_point_info->IsUndefined(isolate)) {
+ if (break_point_info.IsUndefined(isolate)) {
return isolate->factory()->undefined_value();
}
- return Handle<Object>(BreakPointInfo::cast(break_point_info)->break_points(),
+ return Handle<Object>(BreakPointInfo::cast(break_point_info).break_points(),
isolate);
}
@@ -176,11 +175,11 @@ Handle<Object> DebugInfo::GetBreakPoints(Isolate* isolate,
int DebugInfo::GetBreakPointCount(Isolate* isolate) {
DCHECK(HasBreakInfo());
int count = 0;
- for (int i = 0; i < break_points()->length(); i++) {
- if (!break_points()->get(i)->IsUndefined(isolate)) {
+ for (int i = 0; i < break_points().length(); i++) {
+ if (!break_points().get(i).IsUndefined(isolate)) {
BreakPointInfo break_point_info =
- BreakPointInfo::cast(break_points()->get(i));
- count += break_point_info->GetBreakPointCount(isolate);
+ BreakPointInfo::cast(break_points().get(i));
+ count += break_point_info.GetBreakPointCount(isolate);
}
}
return count;
@@ -190,10 +189,10 @@ Handle<Object> DebugInfo::FindBreakPointInfo(Isolate* isolate,
Handle<DebugInfo> debug_info,
Handle<BreakPoint> break_point) {
DCHECK(debug_info->HasBreakInfo());
- for (int i = 0; i < debug_info->break_points()->length(); i++) {
- if (!debug_info->break_points()->get(i)->IsUndefined(isolate)) {
+ for (int i = 0; i < debug_info->break_points().length(); i++) {
+ if (!debug_info->break_points().get(i).IsUndefined(isolate)) {
Handle<BreakPointInfo> break_point_info = Handle<BreakPointInfo>(
- BreakPointInfo::cast(debug_info->break_points()->get(i)), isolate);
+ BreakPointInfo::cast(debug_info->break_points().get(i)), isolate);
if (BreakPointInfo::HasBreakPoint(isolate, break_point_info,
break_point)) {
return break_point_info;
@@ -228,7 +227,7 @@ DebugInfo::SideEffectState DebugInfo::GetSideEffectState(Isolate* isolate) {
namespace {
bool IsEqual(BreakPoint break_point1, BreakPoint break_point2) {
- return break_point1->id() == break_point2->id();
+ return break_point1.id() == break_point2.id();
}
} // namespace
@@ -237,9 +236,9 @@ void BreakPointInfo::ClearBreakPoint(Isolate* isolate,
Handle<BreakPointInfo> break_point_info,
Handle<BreakPoint> break_point) {
// If there are no break points just ignore.
- if (break_point_info->break_points()->IsUndefined(isolate)) return;
+ if (break_point_info->break_points().IsUndefined(isolate)) return;
// If there is a single break point clear it if it is the same.
- if (!break_point_info->break_points()->IsFixedArray()) {
+ if (!break_point_info->break_points().IsFixedArray()) {
if (IsEqual(BreakPoint::cast(break_point_info->break_points()),
*break_point)) {
break_point_info->set_break_points(
@@ -248,7 +247,7 @@ void BreakPointInfo::ClearBreakPoint(Isolate* isolate,
return;
}
// If there are multiple break points shrink the array
- DCHECK(break_point_info->break_points()->IsFixedArray());
+ DCHECK(break_point_info->break_points().IsFixedArray());
Handle<FixedArray> old_array = Handle<FixedArray>(
FixedArray::cast(break_point_info->break_points()), isolate);
Handle<FixedArray> new_array =
@@ -271,14 +270,14 @@ void BreakPointInfo::SetBreakPoint(Isolate* isolate,
Handle<BreakPointInfo> break_point_info,
Handle<BreakPoint> break_point) {
// If there was no break point objects before just set it.
- if (break_point_info->break_points()->IsUndefined(isolate)) {
+ if (break_point_info->break_points().IsUndefined(isolate)) {
break_point_info->set_break_points(*break_point);
return;
}
// If the break point object is the same as before just ignore.
if (break_point_info->break_points() == *break_point) return;
// If there was one break point object before replace with array.
- if (!break_point_info->break_points()->IsFixedArray()) {
+ if (!break_point_info->break_points().IsFixedArray()) {
Handle<FixedArray> array = isolate->factory()->NewFixedArray(2);
array->set(0, break_point_info->break_points());
array->set(1, *break_point);
@@ -304,18 +303,18 @@ bool BreakPointInfo::HasBreakPoint(Isolate* isolate,
Handle<BreakPointInfo> break_point_info,
Handle<BreakPoint> break_point) {
// No break point.
- if (break_point_info->break_points()->IsUndefined(isolate)) {
+ if (break_point_info->break_points().IsUndefined(isolate)) {
return false;
}
// Single break point.
- if (!break_point_info->break_points()->IsFixedArray()) {
+ if (!break_point_info->break_points().IsFixedArray()) {
return IsEqual(BreakPoint::cast(break_point_info->break_points()),
*break_point);
}
// Multiple break points.
FixedArray array = FixedArray::cast(break_point_info->break_points());
- for (int i = 0; i < array->length(); i++) {
- if (IsEqual(BreakPoint::cast(array->get(i)), *break_point)) {
+ for (int i = 0; i < array.length(); i++) {
+ if (IsEqual(BreakPoint::cast(array.get(i)), *break_point)) {
return true;
}
}
@@ -325,11 +324,11 @@ bool BreakPointInfo::HasBreakPoint(Isolate* isolate,
// Get the number of break points.
int BreakPointInfo::GetBreakPointCount(Isolate* isolate) {
// No break point.
- if (break_points()->IsUndefined(isolate)) return 0;
+ if (break_points().IsUndefined(isolate)) return 0;
// Single break point.
- if (!break_points()->IsFixedArray()) return 1;
+ if (!break_points().IsFixedArray()) return 1;
// Multiple break points.
- return FixedArray::cast(break_points())->length();
+ return FixedArray::cast(break_points()).length();
}
int CoverageInfo::SlotCount() const {