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/factory.h" | 8 #include "src/factory.h" |
9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 } | 62 } |
63 | 63 |
64 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { | 64 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { |
65 HandleScope scope(isolate); | 65 HandleScope scope(isolate); |
66 DCHECK_EQ(1, args.length()); | 66 DCHECK_EQ(1, args.length()); |
67 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 67 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
68 | 68 |
69 return generator->input_or_debug_pos(); | 69 return generator->input_or_debug_pos(); |
70 } | 70 } |
71 | 71 |
| 72 RUNTIME_FUNCTION(Runtime_AsyncGeneratorGetAwaitInput) { |
| 73 HandleScope scope(isolate); |
| 74 DCHECK_EQ(1, args.length()); |
| 75 CONVERT_ARG_HANDLE_CHECKED(JSAsyncGeneratorObject, generator, 0); |
| 76 |
| 77 return generator->await_input(); |
| 78 } |
| 79 |
72 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { | 80 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { |
73 HandleScope scope(isolate); | 81 HandleScope scope(isolate); |
74 DCHECK_EQ(1, args.length()); | 82 DCHECK_EQ(1, args.length()); |
75 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 83 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
76 | 84 |
77 return Smi::FromInt(generator->resume_mode()); | 85 return Smi::FromInt(generator->resume_mode()); |
78 } | 86 } |
79 | 87 |
80 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { | 88 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { |
81 HandleScope scope(isolate); | 89 HandleScope scope(isolate); |
82 DCHECK_EQ(1, args.length()); | 90 DCHECK_EQ(1, args.length()); |
83 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 91 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
84 | 92 |
85 return Smi::FromInt(generator->continuation()); | 93 return Smi::FromInt(generator->continuation()); |
86 } | 94 } |
87 | 95 |
88 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) { | 96 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) { |
89 HandleScope scope(isolate); | 97 HandleScope scope(isolate); |
90 DCHECK_EQ(1, args.length()); | 98 DCHECK_EQ(1, args.length()); |
91 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 99 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
92 | 100 |
93 if (!generator->is_suspended()) return isolate->heap()->undefined_value(); | 101 if (!generator->is_suspended()) return isolate->heap()->undefined_value(); |
94 return Smi::FromInt(generator->source_position()); | 102 return Smi::FromInt(generator->source_position()); |
95 } | 103 } |
96 | 104 |
97 } // namespace internal | 105 } // namespace internal |
98 } // namespace v8 | 106 } // namespace v8 |
OLD | NEW |