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

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

Issue 1293493004: Unify symbols sharing across native scripts and runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 4 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/runtime/runtime.h ('k') | src/runtime/runtime-internal.cc » ('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 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.h" 8 #include "src/debug/debug.h"
9 #include "src/debug/debug-evaluate.h" 9 #include "src/debug/debug-evaluate.h"
10 #include "src/debug/debug-frames.h" 10 #include "src/debug/debug-frames.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 Handle<String> receiver = 215 Handle<String> receiver =
216 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]"); 216 factory->NewStringFromAsciiChecked("[[GeneratorReceiver]]");
217 result->set(4, *receiver); 217 result->set(4, *receiver);
218 result->set(5, generator->receiver()); 218 result->set(5, generator->receiver());
219 return factory->NewJSArrayWithElements(result); 219 return factory->NewJSArrayWithElements(result);
220 } else if (Object::IsPromise(object)) { 220 } else if (Object::IsPromise(object)) {
221 Handle<JSObject> promise = Handle<JSObject>::cast(object); 221 Handle<JSObject> promise = Handle<JSObject>::cast(object);
222 222
223 Handle<Object> status_obj = 223 Handle<Object> status_obj =
224 DebugGetProperty(promise, isolate->promise_status()); 224 DebugGetProperty(promise, isolate->factory()->promise_status_symbol());
225 RUNTIME_ASSERT_HANDLIFIED(status_obj->IsSmi(), JSArray); 225 RUNTIME_ASSERT_HANDLIFIED(status_obj->IsSmi(), JSArray);
226 const char* status = "rejected"; 226 const char* status = "rejected";
227 int status_val = Handle<Smi>::cast(status_obj)->value(); 227 int status_val = Handle<Smi>::cast(status_obj)->value();
228 switch (status_val) { 228 switch (status_val) {
229 case +1: 229 case +1:
230 status = "resolved"; 230 status = "resolved";
231 break; 231 break;
232 case 0: 232 case 0:
233 status = "pending"; 233 status = "pending";
234 break; 234 break;
235 default: 235 default:
236 DCHECK_EQ(-1, status_val); 236 DCHECK_EQ(-1, status_val);
237 } 237 }
238 238
239 Handle<FixedArray> result = factory->NewFixedArray(2 * 2); 239 Handle<FixedArray> result = factory->NewFixedArray(2 * 2);
240 Handle<String> promise_status = 240 Handle<String> promise_status =
241 factory->NewStringFromAsciiChecked("[[PromiseStatus]]"); 241 factory->NewStringFromAsciiChecked("[[PromiseStatus]]");
242 result->set(0, *promise_status); 242 result->set(0, *promise_status);
243 Handle<String> status_str = factory->NewStringFromAsciiChecked(status); 243 Handle<String> status_str = factory->NewStringFromAsciiChecked(status);
244 result->set(1, *status_str); 244 result->set(1, *status_str);
245 245
246 Handle<Object> value_obj = 246 Handle<Object> value_obj =
247 DebugGetProperty(promise, isolate->promise_value()); 247 DebugGetProperty(promise, isolate->factory()->promise_value_symbol());
248 Handle<String> promise_value = 248 Handle<String> promise_value =
249 factory->NewStringFromAsciiChecked("[[PromiseValue]]"); 249 factory->NewStringFromAsciiChecked("[[PromiseValue]]");
250 result->set(2, *promise_value); 250 result->set(2, *promise_value);
251 result->set(3, *value_obj); 251 result->set(3, *value_obj);
252 return factory->NewJSArrayWithElements(result); 252 return factory->NewJSArrayWithElements(result);
253 } else if (object->IsJSValue()) { 253 } else if (object->IsJSValue()) {
254 Handle<JSValue> js_value = Handle<JSValue>::cast(object); 254 Handle<JSValue> js_value = Handle<JSValue>::cast(object);
255 255
256 Handle<FixedArray> result = factory->NewFixedArray(2); 256 Handle<FixedArray> result = factory->NewFixedArray(2);
257 Handle<String> primitive_value = 257 Handle<String> primitive_value =
(...skipping 1464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 return *isolate->factory()->undefined_value(); 1722 return *isolate->factory()->undefined_value();
1723 } 1723 }
1724 1724
1725 1725
1726 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { 1726 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) {
1727 UNIMPLEMENTED(); 1727 UNIMPLEMENTED();
1728 return NULL; 1728 return NULL;
1729 } 1729 }
1730 } // namespace internal 1730 } // namespace internal
1731 } // namespace v8 1731 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698