Skip to content

Commit 4401ac4

Browse files
committed
Revert "inspector: return [[StableObjectId]] as internal property"
This reverts commit d9fbfeb. Reason for revert: see bug. Bug: 906847 Original change's description: > inspector: return [[StableObjectId]] as internal property > > This property might be useful for fast '===' check. > > R=​[email protected],[email protected] > > Bug: none > Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel > Change-Id: Iabc3555ce1ec2c14cf0ccd40b7d964ae144e7352 > Reviewed-on: https://chromium-review.googlesource.com/1226411 > Reviewed-by: Dmitry Gozman <[email protected]> > Reviewed-by: Yang Guo <[email protected]> > Reviewed-by: Jakob Gruber <[email protected]> > Commit-Queue: Aleksey Kozyatinskiy <[email protected]> > Cr-Commit-Position: refs/heads/master@{#56095} [email protected],[email protected],[email protected],[email protected] # Not skipping CQ checks because original CL landed > 1 day ago. Bug: none Change-Id: I68c700b7b8fd0a015f099460c15665d74e4da183 Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;luci.chromium.try:linux_chromium_rel_ng;master.tryserver.blink:linux_trusty_blink_rel Reviewed-on: https://chromium-review.googlesource.com/c/1363558 Reviewed-by: Dmitry Gozman <[email protected]> Reviewed-by: Alexei Filippov <[email protected]> Cr-Commit-Position: refs/heads/master@{#58077}
1 parent 8ed4e17 commit 4401ac4

14 files changed

+1
-400
lines changed

src/inspector/v8-debugger.cc

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -702,37 +702,11 @@ v8::MaybeLocal<v8::Array> V8Debugger::collectionsEntries(
702702
return wrappedEntries;
703703
}
704704

705-
v8::MaybeLocal<v8::Uint32> V8Debugger::stableObjectId(
706-
v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
707-
DCHECK(value->IsObject());
708-
if (m_stableObjectId.IsEmpty()) {
709-
m_stableObjectId.Reset(m_isolate, v8::debug::WeakMap::New(m_isolate));
710-
}
711-
v8::Local<v8::debug::WeakMap> stableObjectId =
712-
m_stableObjectId.Get(m_isolate);
713-
v8::Local<v8::Value> idValue;
714-
if (!stableObjectId->Get(context, value).ToLocal(&idValue) ||
715-
!idValue->IsUint32()) {
716-
idValue = v8::Integer::NewFromUnsigned(m_isolate, ++m_lastStableObjectId);
717-
stableObjectId->Set(context, value, idValue).ToLocalChecked();
718-
}
719-
return idValue.As<v8::Uint32>();
720-
}
721-
722705
v8::MaybeLocal<v8::Array> V8Debugger::internalProperties(
723706
v8::Local<v8::Context> context, v8::Local<v8::Value> value) {
724707
v8::Local<v8::Array> properties;
725708
if (!v8::debug::GetInternalProperties(m_isolate, value).ToLocal(&properties))
726709
return v8::MaybeLocal<v8::Array>();
727-
if (value->IsObject()) {
728-
v8::Local<v8::Uint32> id;
729-
if (stableObjectId(context, value).ToLocal(&id)) {
730-
createDataProperty(
731-
context, properties, properties->Length(),
732-
toV8StringInternalized(m_isolate, "[[StableObjectId]]"));
733-
createDataProperty(context, properties, properties->Length(), id);
734-
}
735-
}
736710
v8::Local<v8::Array> entries;
737711
if (collectionsEntries(context, value).ToLocal(&entries)) {
738712
createDataProperty(context, properties, properties->Length(),

src/inspector/v8-debugger.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
198198
int currentContextGroupId();
199199
bool asyncStepOutOfFunction(int targetContextGroupId, bool onlyAtReturn);
200200

201-
v8::MaybeLocal<v8::Uint32> stableObjectId(v8::Local<v8::Context>,
202-
v8::Local<v8::Value>);
203-
204201
v8::Isolate* m_isolate;
205202
V8InspectorImpl* m_inspector;
206203
int m_enableCount;
@@ -257,9 +254,6 @@ class V8Debugger : public v8::debug::DebugDelegate,
257254

258255
std::unique_ptr<TerminateExecutionCallback> m_terminateExecutionCallback;
259256

260-
uint32_t m_lastStableObjectId = 0;
261-
v8::Global<v8::debug::WeakMap> m_stableObjectId;
262-
263257
v8::Global<v8::debug::WeakMap> m_internalObjects;
264258

265259
WasmTranslation m_wasmTranslation;

test/inspector/debugger/eval-scopes-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ Tests that variables introduced in eval scopes are accessible
22
{
33
id : <messageId>
44
result : {
5-
internalProperties : [
6-
[0] : {
7-
name : [[StableObjectId]]
8-
value : <StablectObjectId>
9-
}
10-
]
115
result : [
126
[0] : {
137
configurable : true

test/inspector/debugger/scope-skip-variables-with-empty-name-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ Tests that scopes do not report variables with empty names
22
{
33
id : <messageId>
44
result : {
5-
internalProperties : [
6-
[0] : {
7-
name : [[StableObjectId]]
8-
value : <StablectObjectId>
9-
}
10-
]
115
result : [
126
[0] : {
137
configurable : true

test/inspector/runtime/es6-module-expected.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ console.log(239)
128128
{
129129
id : <messageId>
130130
result : {
131-
internalProperties : [
132-
[0] : {
133-
name : [[StableObjectId]]
134-
value : <StablectObjectId>
135-
}
136-
]
137131
result : [
138132
[0] : {
139133
configurable : true

test/inspector/runtime/get-properties-expected.txt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Running test: testObject5
55
foo own string cat
66
Internal properties
77
[[PrimitiveValue]] number 5
8-
[[StableObjectId]]: <stableObjectId>
98

109
Running test: testNotOwn
1110
__defineGetter__ inherited function undefined
@@ -24,8 +23,6 @@ Running test: testNotOwn
2423
toLocaleString inherited function undefined
2524
toString inherited function undefined
2625
valueOf inherited function undefined
27-
Internal properties
28-
[[StableObjectId]]: <stableObjectId>
2926

3027
Running test: testAccessorsOnly
3128
b own no value, getter, setter
@@ -37,8 +34,6 @@ Running test: testArray
3734
2 own string blue
3835
__proto__ own object undefined
3936
length own number 3
40-
Internal properties
41-
[[StableObjectId]]: <stableObjectId>
4237

4338
Running test: testBound
4439
__proto__ own function undefined
@@ -47,19 +42,14 @@ Running test: testBound
4742
Internal properties
4843
[[BoundArgs]] object undefined
4944
[[BoundThis]] object undefined
50-
[[StableObjectId]]: <stableObjectId>
5145
[[TargetFunction]] function undefined
5246

5347
Running test: testObjectThrowsLength
5448
__proto__ own object undefined
5549
length own no value, getter
56-
Internal properties
57-
[[StableObjectId]]: <stableObjectId>
5850

5951
Running test: testTypedArrayWithoutLength
6052
__proto__ own object undefined
61-
Internal properties
62-
[[StableObjectId]]: <stableObjectId>
6353

6454
Running test: testArrayBuffer
6555
[[Int8Array]]
@@ -72,8 +62,6 @@ Running test: testArrayBuffer
7262
6 own number 1
7363
7 own number 1
7464
__proto__ own object undefined
75-
Internal properties
76-
[[StableObjectId]]: <stableObjectId>
7765
[[Uint8Array]]
7866
0 own number 1
7967
1 own number 1
@@ -84,26 +72,18 @@ Internal properties
8472
6 own number 1
8573
7 own number 1
8674
__proto__ own object undefined
87-
Internal properties
88-
[[StableObjectId]]: <stableObjectId>
8975
[[Int16Array]]
9076
0 own number 257
9177
1 own number 257
9278
2 own number 257
9379
3 own number 257
9480
__proto__ own object undefined
95-
Internal properties
96-
[[StableObjectId]]: <stableObjectId>
9781
[[Int32Array]]
9882
0 own number 16843009
9983
1 own number 16843009
10084
__proto__ own object undefined
101-
Internal properties
102-
[[StableObjectId]]: <stableObjectId>
10385

10486
Running test: testArrayBufferWithBrokenUintCtor
10587
[[Int8Array]] own object undefined
10688
[[Uint8Array]] own object undefined
10789
__proto__ own object undefined
108-
Internal properties
109-
[[StableObjectId]]: <stableObjectId>

test/inspector/runtime/get-properties-on-proxy-expected.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ Testing regular Proxy
5454
value : false
5555
}
5656
}
57-
[3] : {
58-
name : [[StableObjectId]]
59-
value : <StablectObjectId>
60-
}
6157
]
6258
result : [
6359
]
@@ -118,10 +114,6 @@ Testing revocable Proxy
118114
value : false
119115
}
120116
}
121-
[3] : {
122-
name : [[StableObjectId]]
123-
value : <StablectObjectId>
124-
}
125117
]
126118
result : [
127119
]
@@ -174,10 +166,6 @@ Testing revocable Proxy
174166
value : true
175167
}
176168
}
177-
[3] : {
178-
name : [[StableObjectId]]
179-
value : <StablectObjectId>
180-
}
181169
]
182170
result : [
183171
]

test/inspector/runtime/get-properties.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ async function logGetPropertiesResult(objectId, flags = { ownProperties: true })
9494
for (var i = 0; i < internalPropertyArray.length; i++) {
9595
var p = internalPropertyArray[i];
9696
var v = p.value;
97-
if (p.name !== '[[StableObjectId]]')
98-
InspectorTest.log(" " + p.name + " " + v.type + " " + v.value);
99-
else
100-
InspectorTest.log(" [[StableObjectId]]: <stableObjectId>");
97+
InspectorTest.log(' ' + p.name + ' ' + v.type + ' ' + v.value);
10198
}
10299
}
103100

0 commit comments

Comments
 (0)