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

Unified Diff: src/string-stream.cc

Issue 2028983002: Introduce IsUndefined(Isolate*) and IsTheHole(Isolate*) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase master Created 4 years, 6 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/snapshot/serializer-common.cc ('k') | src/type-info.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 3a8ac34b3850d3c46fa292a3ac4158fc379a95be..18a38be0aab3458ee7cdd6258259ffba19f32798 100644
--- a/src/string-stream.cc
+++ b/src/string-stream.cc
@@ -378,14 +378,14 @@ void StringStream::PrintUsingMap(JSObject* js_object) {
void StringStream::PrintFixedArray(FixedArray* array, unsigned int limit) {
- Heap* heap = array->GetHeap();
+ Isolate* isolate = array->GetIsolate();
for (unsigned int i = 0; i < 10 && i < limit; i++) {
Object* element = array->get(i);
- if (element != heap->the_hole_value()) {
- for (int len = 1; len < 18; len++)
- Put(' ');
- Add("%d: %o\n", i, array->get(i));
+ if (element->IsTheHole(isolate)) continue;
+ for (int len = 1; len < 18; len++) {
+ Put(' ');
}
+ Add("%d: %o\n", i, array->get(i));
}
if (limit >= 10) {
Add(" ...\n");
@@ -527,7 +527,8 @@ void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
Object* name = fun->shared()->name();
bool print_name = false;
Isolate* isolate = fun->GetIsolate();
- if (receiver->IsNull() || receiver->IsUndefined() || receiver->IsJSProxy()) {
+ if (receiver->IsNull() || receiver->IsUndefined(isolate) ||
+ receiver->IsJSProxy()) {
print_name = true;
} else if (isolate->context() != nullptr) {
if (!receiver->IsJSObject()) {
@@ -539,7 +540,7 @@ void StringStream::PrintPrototype(JSFunction* fun, Object* receiver) {
!iter.IsAtEnd(); iter.Advance()) {
if (iter.GetCurrent()->IsJSProxy()) break;
Object* key = iter.GetCurrent<JSObject>()->SlowReverseLookup(fun);
- if (!key->IsUndefined()) {
+ if (!key->IsUndefined(isolate)) {
if (!name->IsString() ||
!key->IsString() ||
!String::cast(name)->Equals(String::cast(key))) {
« no previous file with comments | « src/snapshot/serializer-common.cc ('k') | src/type-info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698