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

Side by Side Diff: src/objects-debug.cc

Issue 13542002: Calling a generator function returns a generator object (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix nits; generator object fields are undefined if not set Created 7 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 case CODE_TYPE: 132 case CODE_TYPE:
133 Code::cast(this)->CodeVerify(); 133 Code::cast(this)->CodeVerify();
134 break; 134 break;
135 case ODDBALL_TYPE: 135 case ODDBALL_TYPE:
136 Oddball::cast(this)->OddballVerify(); 136 Oddball::cast(this)->OddballVerify();
137 break; 137 break;
138 case JS_OBJECT_TYPE: 138 case JS_OBJECT_TYPE:
139 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 139 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
140 JSObject::cast(this)->JSObjectVerify(); 140 JSObject::cast(this)->JSObjectVerify();
141 break; 141 break;
142 case JS_GENERATOR_OBJECT_TYPE:
143 JSGeneratorObject::cast(this)->JSGeneratorObjectVerify();
144 break;
142 case JS_MODULE_TYPE: 145 case JS_MODULE_TYPE:
143 JSModule::cast(this)->JSModuleVerify(); 146 JSModule::cast(this)->JSModuleVerify();
144 break; 147 break;
145 case JS_VALUE_TYPE: 148 case JS_VALUE_TYPE:
146 JSValue::cast(this)->JSValueVerify(); 149 JSValue::cast(this)->JSValueVerify();
147 break; 150 break;
148 case JS_DATE_TYPE: 151 case JS_DATE_TYPE:
149 JSDate::cast(this)->JSDateVerify(); 152 JSDate::cast(this)->JSDateVerify();
150 break; 153 break;
151 case JS_FUNCTION_TYPE: 154 case JS_FUNCTION_TYPE:
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 double value = get_scalar(i); 400 double value = get_scalar(i);
398 CHECK(!isnan(value) || 401 CHECK(!isnan(value) ||
399 (BitCast<uint64_t>(value) == 402 (BitCast<uint64_t>(value) ==
400 BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) || 403 BitCast<uint64_t>(canonical_not_the_hole_nan_as_double())) ||
401 ((BitCast<uint64_t>(value) & Double::kSignMask) != 0)); 404 ((BitCast<uint64_t>(value) & Double::kSignMask) != 0));
402 } 405 }
403 } 406 }
404 } 407 }
405 408
406 409
410 void JSGeneratorObject::JSGeneratorObjectVerify() {
411 // In an expression like "new g()", there can be a point where a generator
412 // object is allocated but its fields are all undefined, as it hasn't yet been
413 // initialized by the generator. Hence these weak checks.
414 VerifyObjectField(kFunctionOffset);
415 VerifyObjectField(kContextOffset);
416 VerifyObjectField(kOperandStackOffset);
417 VerifyObjectField(kContinuationOffset);
418 }
419
420
407 void JSModule::JSModuleVerify() { 421 void JSModule::JSModuleVerify() {
408 VerifyObjectField(kContextOffset); 422 VerifyObjectField(kContextOffset);
409 VerifyObjectField(kScopeInfoOffset); 423 VerifyObjectField(kScopeInfoOffset);
410 CHECK(context()->IsUndefined() || 424 CHECK(context()->IsUndefined() ||
411 Context::cast(context())->IsModuleContext()); 425 Context::cast(context())->IsModuleContext());
412 } 426 }
413 427
414 428
415 void JSValue::JSValueVerify() { 429 void JSValue::JSValueVerify() {
416 Object* v = value(); 430 Object* v = value();
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 for (int i = 0; i < number_of_transitions(); ++i) { 1085 for (int i = 0; i < number_of_transitions(); ++i) {
1072 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1086 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1073 } 1087 }
1074 return true; 1088 return true;
1075 } 1089 }
1076 1090
1077 1091
1078 #endif // DEBUG 1092 #endif // DEBUG
1079 1093
1080 } } // namespace v8::internal 1094 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698