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

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

Issue 1919143004: Renaming cleanup of Promises (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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') | 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 237
238 Handle<String> receiver = 238 Handle<String> receiver =
239 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]"); 239 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]");
240 result->set(4, *receiver); 240 result->set(4, *receiver);
241 result->set(5, generator->receiver()); 241 result->set(5, generator->receiver());
242 return factory->NewJSArrayWithElements(result); 242 return factory->NewJSArrayWithElements(result);
243 } else if (Object::IsPromise(object)) { 243 } else if (Object::IsPromise(object)) {
244 Handle<JSObject> promise = Handle<JSObject>::cast(object); 244 Handle<JSObject> promise = Handle<JSObject>::cast(object);
245 245
246 Handle<Object> status_obj = 246 Handle<Object> status_obj =
247 DebugGetProperty(promise, isolate->factory()->promise_status_symbol()); 247 DebugGetProperty(promise, isolate->factory()->promise_state_symbol());
248 RUNTIME_ASSERT_HANDLIFIED(status_obj->IsSmi(), JSArray); 248 RUNTIME_ASSERT_HANDLIFIED(status_obj->IsSmi(), JSArray);
249 const char* status = "rejected"; 249 const char* status = "rejected";
250 int status_val = Handle<Smi>::cast(status_obj)->value(); 250 int status_val = Handle<Smi>::cast(status_obj)->value();
251 switch (status_val) { 251 switch (status_val) {
252 case +1: 252 case +1:
253 status = "resolved"; 253 status = "resolved";
254 break; 254 break;
255 case 0: 255 case 0:
256 status = "pending"; 256 status = "pending";
257 break; 257 break;
258 default: 258 default:
259 DCHECK_EQ(-1, status_val); 259 DCHECK_EQ(-1, status_val);
260 } 260 }
261 261
262 Handle<FixedArray> result = factory->NewFixedArray(2 * 2); 262 Handle<FixedArray> result = factory->NewFixedArray(2 * 2);
263 Handle<String> promise_status = 263 Handle<String> promise_status =
264 factory->NewStringFromAsciiChecked("[[PromiseStatus]]"); 264 factory->NewStringFromAsciiChecked("[[PromiseStatus]]");
265 result->set(0, *promise_status); 265 result->set(0, *promise_status);
266 Handle<String> status_str = factory->NewStringFromAsciiChecked(status); 266 Handle<String> status_str = factory->NewStringFromAsciiChecked(status);
267 result->set(1, *status_str); 267 result->set(1, *status_str);
268 268
269 Handle<Object> value_obj = 269 Handle<Object> value_obj =
270 DebugGetProperty(promise, isolate->factory()->promise_value_symbol()); 270 DebugGetProperty(promise, isolate->factory()->promise_result_symbol());
271 Handle<String> promise_value = 271 Handle<String> promise_value =
272 factory->NewStringFromAsciiChecked("[[PromiseValue]]"); 272 factory->NewStringFromAsciiChecked("[[PromiseValue]]");
273 result->set(2, *promise_value); 273 result->set(2, *promise_value);
274 result->set(3, *value_obj); 274 result->set(3, *value_obj);
275 return factory->NewJSArrayWithElements(result); 275 return factory->NewJSArrayWithElements(result);
276 } else if (object->IsJSValue()) { 276 } else if (object->IsJSValue()) {
277 Handle<JSValue> js_value = Handle<JSValue>::cast(object); 277 Handle<JSValue> js_value = Handle<JSValue>::cast(object);
278 278
279 Handle<FixedArray> result = factory->NewFixedArray(2); 279 Handle<FixedArray> result = factory->NewFixedArray(2);
280 Handle<String> primitive_value = 280 Handle<String> primitive_value =
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1643 return Smi::FromInt(isolate->debug()->is_active()); 1643 return Smi::FromInt(isolate->debug()->is_active());
1644 } 1644 }
1645 1645
1646 1646
1647 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1647 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1648 UNIMPLEMENTED(); 1648 UNIMPLEMENTED();
1649 return NULL; 1649 return NULL;
1650 } 1650 }
1651 } // namespace internal 1651 } // namespace internal
1652 } // namespace v8 1652 } // namespace v8
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698