OLD | NEW |
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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 return *isolate->factory()->NewJSArrayWithElements(result); | 1442 return *isolate->factory()->NewJSArrayWithElements(result); |
1443 } | 1443 } |
1444 | 1444 |
1445 | 1445 |
1446 // Find the effective prototype object as returned by __proto__. | 1446 // Find the effective prototype object as returned by __proto__. |
1447 // args[0]: the object to find the prototype for. | 1447 // args[0]: the object to find the prototype for. |
1448 RUNTIME_FUNCTION(Runtime_DebugGetPrototype) { | 1448 RUNTIME_FUNCTION(Runtime_DebugGetPrototype) { |
1449 HandleScope shs(isolate); | 1449 HandleScope shs(isolate); |
1450 DCHECK(args.length() == 1); | 1450 DCHECK(args.length() == 1); |
1451 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); | 1451 CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0); |
1452 return *Object::GetPrototype(isolate, obj); | 1452 Handle<Object> prototype; |
| 1453 // TODO(1543): Come up with a solution for clients to handle potential errors |
| 1454 // thrown by an intermediate proxy. |
| 1455 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, prototype, |
| 1456 Object::GetPrototype(isolate, obj)); |
| 1457 return *prototype; |
1453 } | 1458 } |
1454 | 1459 |
1455 | 1460 |
1456 // Patches script source (should be called upon BeforeCompile event). | 1461 // Patches script source (should be called upon BeforeCompile event). |
1457 RUNTIME_FUNCTION(Runtime_DebugSetScriptSource) { | 1462 RUNTIME_FUNCTION(Runtime_DebugSetScriptSource) { |
1458 HandleScope scope(isolate); | 1463 HandleScope scope(isolate); |
1459 DCHECK(args.length() == 2); | 1464 DCHECK(args.length() == 2); |
1460 | 1465 |
1461 CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0); | 1466 CONVERT_ARG_HANDLE_CHECKED(JSValue, script_wrapper, 0); |
1462 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); | 1467 CONVERT_ARG_HANDLE_CHECKED(String, source, 1); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1736 return *isolate->factory()->undefined_value(); | 1741 return *isolate->factory()->undefined_value(); |
1737 } | 1742 } |
1738 | 1743 |
1739 | 1744 |
1740 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { | 1745 RUNTIME_FUNCTION(Runtime_DebugBreakInOptimizedCode) { |
1741 UNIMPLEMENTED(); | 1746 UNIMPLEMENTED(); |
1742 return NULL; | 1747 return NULL; |
1743 } | 1748 } |
1744 } // namespace internal | 1749 } // namespace internal |
1745 } // namespace v8 | 1750 } // namespace v8 |
OLD | NEW |