Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1100)

Unified Diff: src/string-stream.cc

Issue 1675223002: Mark maps having a hidden prototype rather than maps of hidden prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string-stream.cc
diff --git a/src/string-stream.cc b/src/string-stream.cc
index 2801d23cda088b784916aaf3ccdf5c30e7efcab6..43be8f1f1872e3a3581a5a81b51f70fb83ddc155 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -527,12 +527,18 @@ void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
Object* name = fun->shared()->name();
bool print_name = false;
Isolate* isolate = fun->GetIsolate();
- for (PrototypeIterator iter(isolate, receiver,
- PrototypeIterator::START_AT_RECEIVER);
- !iter.IsAtEnd(); iter.Advance()) {
- if (iter.GetCurrent()->IsJSObject()) {
+ if (receiver->IsNull() || receiver->IsUndefined() || receiver->IsJSProxy()) {
+ print_name = true;
+ } else {
+ if (!receiver->IsJSObject()) {
+ receiver = receiver->GetRootMap(isolate)->prototype();
+ }
+
+ for (PrototypeIterator iter(isolate, JSObject::cast(receiver),
+ PrototypeIterator::START_AT_RECEIVER);
+ !iter.IsAtEnd(); iter.Advance()) {
Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun);
- if (key != isolate->heap()->undefined_value()) {
+ if (!key->IsUndefined()) {
if (!name->IsString() ||
!key->IsString() ||
!String::cast(name)->Equals(String::cast(key))) {
@@ -542,9 +548,8 @@ void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
print_name = false;
}
name = key;
+ break;
}
- } else {
- print_name = true;
}
}
PrintName(name);
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698