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

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 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 unified diff | Download patch
« no previous file with comments | « src/objects.cc ('k') | src/objects-inl.h » ('j') | src/parser.cc » ('J')
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 VerifyObjectField(kFunctionOffset);
412 VerifyObjectField(kContextOffset);
413 VerifyObjectField(kOperandStackOffset);
414 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
415 // Uninitialized object from constructor.
416 CHECK(context()->IsUndefined());
417 CHECK(operand_stack()->IsUndefined());
418 } else {
419 CHECK(context() == Smi::FromInt(0) || context()->IsContext());
420 VerifySmiField(kContinuationOffset);
421 CHECK_GE(continuation(), 0);
422 CHECK(operand_stack() == Smi::FromInt(0) ||
423 operand_stack()->IsFixedArray());
424 }
425 }
426
427
407 void JSModule::JSModuleVerify() { 428 void JSModule::JSModuleVerify() {
408 VerifyObjectField(kContextOffset); 429 VerifyObjectField(kContextOffset);
409 VerifyObjectField(kScopeInfoOffset); 430 VerifyObjectField(kScopeInfoOffset);
410 CHECK(context()->IsUndefined() || 431 CHECK(context()->IsUndefined() ||
411 Context::cast(context())->IsModuleContext()); 432 Context::cast(context())->IsModuleContext());
412 } 433 }
413 434
414 435
415 void JSValue::JSValueVerify() { 436 void JSValue::JSValueVerify() {
416 Object* v = value(); 437 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) { 1092 for (int i = 0; i < number_of_transitions(); ++i) {
1072 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; 1093 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false;
1073 } 1094 }
1074 return true; 1095 return true;
1075 } 1096 }
1076 1097
1077 1098
1078 #endif // DEBUG 1099 #endif // DEBUG
1079 1100
1080 } } // namespace v8::internal 1101 } } // namespace v8::internal
OLDNEW
« 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