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

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

Issue 2091243002: Use the instance type to determine if an object is a promise. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@SimplifyIsError
Patch Set: Rebase Created 4 years, 5 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-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/debug/debug-evaluate.h" 8 #include "src/debug/debug-evaluate.h"
9 #include "src/debug/debug-frames.h" 9 #include "src/debug/debug-frames.h"
10 #include "src/debug/debug-scopes.h" 10 #include "src/debug/debug-scopes.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 Handle<String> function = 236 Handle<String> function =
237 factory->NewStringFromAsciiChecked("[[GeneratorFunction]]"); 237 factory->NewStringFromAsciiChecked("[[GeneratorFunction]]");
238 result->set(2, *function); 238 result->set(2, *function);
239 result->set(3, generator->function()); 239 result->set(3, generator->function());
240 240
241 Handle<String> receiver = 241 Handle<String> receiver =
242 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]"); 242 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]");
243 result->set(4, *receiver); 243 result->set(4, *receiver);
244 result->set(5, generator->receiver()); 244 result->set(5, generator->receiver());
245 return factory->NewJSArrayWithElements(result); 245 return factory->NewJSArrayWithElements(result);
246 } else if (Object::IsPromise(object)) { 246 } else if (object->IsJSPromise()) {
247 Handle<JSObject> promise = Handle<JSObject>::cast(object); 247 Handle<JSObject> promise = Handle<JSObject>::cast(object);
248 248
249 Handle<Object> status_obj = 249 Handle<Object> status_obj =
250 DebugGetProperty(promise, isolate->factory()->promise_state_symbol()); 250 DebugGetProperty(promise, isolate->factory()->promise_state_symbol());
251 CHECK(status_obj->IsSmi()); 251 CHECK(status_obj->IsSmi());
252 const char* status = "rejected"; 252 const char* status = "rejected";
253 int status_val = Handle<Smi>::cast(status_obj)->value(); 253 int status_val = Handle<Smi>::cast(status_obj)->value();
254 switch (status_val) { 254 switch (status_val) {
255 case +1: 255 case +1:
256 status = "resolved"; 256 status = "resolved";
(...skipping 1495 matching lines...) Expand 10 before | Expand all | Expand 10 after
1752 return Smi::FromInt(isolate->debug()->is_active()); 1752 return Smi::FromInt(isolate->debug()->is_active());
1753 } 1753 }
1754 1754
1755 1755
1756 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1756 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1757 UNIMPLEMENTED(); 1757 UNIMPLEMENTED();
1758 return NULL; 1758 return NULL;
1759 } 1759 }
1760 } // namespace internal 1760 } // namespace internal
1761 } // namespace v8 1761 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698