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

Unified 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 generator construction via `new' 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index 44cab53cc7ae90696e7c34929084e0e6e1e318bd..77c8075fe71eb6094743703d08981d3d0ffc6979 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -139,6 +139,9 @@ void HeapObject::HeapObjectVerify() {
case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
JSObject::cast(this)->JSObjectVerify();
break;
+ case JS_GENERATOR_OBJECT_TYPE:
+ JSGeneratorObject::cast(this)->JSGeneratorObjectVerify();
+ break;
case JS_MODULE_TYPE:
JSModule::cast(this)->JSModuleVerify();
break;
@@ -404,6 +407,24 @@ void FixedDoubleArray::FixedDoubleArrayVerify() {
}
+void JSGeneratorObject::JSGeneratorObjectVerify() {
+ VerifyObjectField(kFunctionOffset);
+ VerifyObjectField(kContextOffset);
+ VerifyObjectField(kOperandStackOffset);
+ if (function()->IsUndefined()) {
Michael Starzinger 2013/04/14 21:32:50 Just out of curiosity, is there a particular reaso
wingo 2013/04/15 09:24:57 Changed to use undefined. I also relaxed these ch
+ // Uninitialized object from constructor.
+ CHECK(context()->IsUndefined());
+ CHECK(operand_stack()->IsUndefined());
+ } else {
+ CHECK(context() == Smi::FromInt(0) || context()->IsContext());
+ VerifySmiField(kContinuationOffset);
+ CHECK_GE(continuation(), 0);
+ CHECK(operand_stack() == Smi::FromInt(0) ||
+ operand_stack()->IsFixedArray());
+ }
+}
+
+
void JSModule::JSModuleVerify() {
VerifyObjectField(kContextOffset);
VerifyObjectField(kScopeInfoOffset);
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698