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

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

Issue 2536463002: Create JSPromise (Closed)
Patch Set: rebase Created 4 years 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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/objects.h" 5 #include "src/objects.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/disasm.h" 8 #include "src/disasm.h"
9 #include "src/disassembler.h" 9 #include "src/disassembler.h"
10 #include "src/field-type.h" 10 #include "src/field-type.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 break; 97 break;
98 case ODDBALL_TYPE: 98 case ODDBALL_TYPE:
99 Oddball::cast(this)->OddballVerify(); 99 Oddball::cast(this)->OddballVerify();
100 break; 100 break;
101 case JS_OBJECT_TYPE: 101 case JS_OBJECT_TYPE:
102 case JS_ERROR_TYPE: 102 case JS_ERROR_TYPE:
103 case JS_ARGUMENTS_TYPE: 103 case JS_ARGUMENTS_TYPE:
104 case JS_API_OBJECT_TYPE: 104 case JS_API_OBJECT_TYPE:
105 case JS_SPECIAL_API_OBJECT_TYPE: 105 case JS_SPECIAL_API_OBJECT_TYPE:
106 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: 106 case JS_CONTEXT_EXTENSION_OBJECT_TYPE:
107 case JS_PROMISE_TYPE:
108 JSObject::cast(this)->JSObjectVerify(); 107 JSObject::cast(this)->JSObjectVerify();
109 break; 108 break;
110 case JS_GENERATOR_OBJECT_TYPE: 109 case JS_GENERATOR_OBJECT_TYPE:
111 JSGeneratorObject::cast(this)->JSGeneratorObjectVerify(); 110 JSGeneratorObject::cast(this)->JSGeneratorObjectVerify();
112 break; 111 break;
113 case JS_VALUE_TYPE: 112 case JS_VALUE_TYPE:
114 JSValue::cast(this)->JSValueVerify(); 113 JSValue::cast(this)->JSValueVerify();
115 break; 114 break;
116 case JS_DATE_TYPE: 115 case JS_DATE_TYPE:
117 JSDate::cast(this)->JSDateVerify(); 116 JSDate::cast(this)->JSDateVerify();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 197
199 case JS_STRING_ITERATOR_TYPE: 198 case JS_STRING_ITERATOR_TYPE:
200 JSStringIterator::cast(this)->JSStringIteratorVerify(); 199 JSStringIterator::cast(this)->JSStringIteratorVerify();
201 break; 200 break;
202 case JS_WEAK_MAP_TYPE: 201 case JS_WEAK_MAP_TYPE:
203 JSWeakMap::cast(this)->JSWeakMapVerify(); 202 JSWeakMap::cast(this)->JSWeakMapVerify();
204 break; 203 break;
205 case JS_WEAK_SET_TYPE: 204 case JS_WEAK_SET_TYPE:
206 JSWeakSet::cast(this)->JSWeakSetVerify(); 205 JSWeakSet::cast(this)->JSWeakSetVerify();
207 break; 206 break;
207 case JS_PROMISE_TYPE:
208 JSPromise::cast(this)->JSPromiseVerify();
209 break;
208 case JS_REGEXP_TYPE: 210 case JS_REGEXP_TYPE:
209 JSRegExp::cast(this)->JSRegExpVerify(); 211 JSRegExp::cast(this)->JSRegExpVerify();
210 break; 212 break;
211 case FILLER_TYPE: 213 case FILLER_TYPE:
212 break; 214 break;
213 case JS_PROXY_TYPE: 215 case JS_PROXY_TYPE:
214 JSProxy::cast(this)->JSProxyVerify(); 216 JSProxy::cast(this)->JSProxyVerify();
215 break; 217 break;
216 case FOREIGN_TYPE: 218 case FOREIGN_TYPE:
217 Foreign::cast(this)->ForeignVerify(); 219 Foreign::cast(this)->ForeignVerify();
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 CHECK_LE(index(), String::kMaxLength); 879 CHECK_LE(index(), String::kMaxLength);
878 } 880 }
879 881
880 void JSWeakSet::JSWeakSetVerify() { 882 void JSWeakSet::JSWeakSetVerify() {
881 CHECK(IsJSWeakSet()); 883 CHECK(IsJSWeakSet());
882 JSObjectVerify(); 884 JSObjectVerify();
883 VerifyHeapPointer(table()); 885 VerifyHeapPointer(table());
884 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate())); 886 CHECK(table()->IsHashTable() || table()->IsUndefined(GetIsolate()));
885 } 887 }
886 888
889 void JSPromise::JSPromiseVerify() {
890 CHECK(IsJSPromise());
891 JSObjectVerify();
892 Isolate* isolate = GetIsolate();
893 CHECK(result()->IsUndefined(isolate) || result()->IsObject());
894 CHECK(deferred()->IsUndefined(isolate) || deferred()->IsJSObject() ||
895 deferred()->IsFixedArray());
896 CHECK(fulfill_reactions()->IsUndefined(isolate) ||
897 fulfill_reactions()->IsCallable() ||
898 fulfill_reactions()->IsFixedArray());
899 CHECK(reject_reactions()->IsUndefined(isolate) ||
900 reject_reactions()->IsCallable() || reject_reactions()->IsFixedArray());
901 }
887 902
888 void JSRegExp::JSRegExpVerify() { 903 void JSRegExp::JSRegExpVerify() {
889 JSObjectVerify(); 904 JSObjectVerify();
890 Isolate* isolate = GetIsolate(); 905 Isolate* isolate = GetIsolate();
891 CHECK(data()->IsUndefined(isolate) || data()->IsFixedArray()); 906 CHECK(data()->IsUndefined(isolate) || data()->IsFixedArray());
892 switch (TypeTag()) { 907 switch (TypeTag()) {
893 case JSRegExp::ATOM: { 908 case JSRegExp::ATOM: {
894 FixedArray* arr = FixedArray::cast(data()); 909 FixedArray* arr = FixedArray::cast(data());
895 CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString()); 910 CHECK(arr->get(JSRegExp::kAtomPatternIndex)->IsString());
896 break; 911 break;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 CHECK(reject()->IsJSFunction()); 1019 CHECK(reject()->IsJSFunction());
1005 CHECK(debug_id()->IsNumber() || debug_id()->IsUndefined(isolate)); 1020 CHECK(debug_id()->IsNumber() || debug_id()->IsUndefined(isolate));
1006 CHECK(debug_name()->IsString() || debug_name()->IsUndefined(isolate)); 1021 CHECK(debug_name()->IsString() || debug_name()->IsUndefined(isolate));
1007 CHECK(context()->IsContext()); 1022 CHECK(context()->IsContext());
1008 } 1023 }
1009 1024
1010 void PromiseReactionJobInfo::PromiseReactionJobInfoVerify() { 1025 void PromiseReactionJobInfo::PromiseReactionJobInfoVerify() {
1011 Isolate* isolate = GetIsolate(); 1026 Isolate* isolate = GetIsolate();
1012 CHECK(IsPromiseReactionJobInfo()); 1027 CHECK(IsPromiseReactionJobInfo());
1013 CHECK(value()->IsObject()); 1028 CHECK(value()->IsObject());
1014 CHECK(tasks()->IsJSArray() || tasks()->IsCallable()); 1029 CHECK(tasks()->IsFixedArray() || tasks()->IsCallable());
1015 CHECK(deferred()->IsJSObject() || deferred()->IsUndefined(isolate)); 1030 CHECK(deferred()->IsFixedArray() || deferred()->IsJSObject());
1016 CHECK(debug_id()->IsNumber() || debug_id()->IsUndefined(isolate)); 1031 CHECK(debug_id()->IsNumber() || debug_id()->IsUndefined(isolate));
1017 CHECK(debug_name()->IsString() || debug_name()->IsUndefined(isolate)); 1032 CHECK(debug_name()->IsString() || debug_name()->IsUndefined(isolate));
1018 CHECK(context()->IsContext()); 1033 CHECK(context()->IsContext());
1019 } 1034 }
1020 1035
1021 void JSModuleNamespace::JSModuleNamespaceVerify() { 1036 void JSModuleNamespace::JSModuleNamespaceVerify() {
1022 CHECK(IsJSModuleNamespace()); 1037 CHECK(IsJSModuleNamespace());
1023 VerifyPointer(module()); 1038 VerifyPointer(module());
1024 } 1039 }
1025 1040
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 1536
1522 // Both are done at the same time. 1537 // Both are done at the same time.
1523 CHECK_EQ(new_it.done(), old_it.done()); 1538 CHECK_EQ(new_it.done(), old_it.done());
1524 } 1539 }
1525 1540
1526 1541
1527 #endif // DEBUG 1542 #endif // DEBUG
1528 1543
1529 } // namespace internal 1544 } // namespace internal
1530 } // namespace v8 1545 } // namespace v8
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