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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 59 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
60 | 60 |
61 return generator->receiver(); | 61 return generator->receiver(); |
62 } | 62 } |
63 | 63 |
64 RUNTIME_FUNCTION(Runtime_GeneratorGetContext) { | 64 RUNTIME_FUNCTION(Runtime_GeneratorGetContext) { |
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 // Runtime call is implemented in InterpreterIntrinsics and lowered in |
| 70 // JSIntrinsicLowering |
| 71 UNREACHABLE(); |
| 72 |
69 return generator->context(); | 73 return generator->context(); |
70 } | 74 } |
71 | 75 |
72 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { | 76 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { |
73 HandleScope scope(isolate); | 77 HandleScope scope(isolate); |
74 DCHECK_EQ(1, args.length()); | 78 DCHECK_EQ(1, args.length()); |
75 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 79 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
76 | 80 |
| 81 // Runtime call is implemented in InterpreterIntrinsics and lowered in |
| 82 // JSIntrinsicLowering |
| 83 UNREACHABLE(); |
| 84 |
77 return generator->input_or_debug_pos(); | 85 return generator->input_or_debug_pos(); |
78 } | 86 } |
79 | 87 |
80 RUNTIME_FUNCTION(Runtime_AsyncGeneratorGetAwaitInputOrDebugPos) { | 88 RUNTIME_FUNCTION(Runtime_AsyncGeneratorGetAwaitInputOrDebugPos) { |
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(JSAsyncGeneratorObject, generator, 0); | 91 CONVERT_ARG_HANDLE_CHECKED(JSAsyncGeneratorObject, generator, 0); |
84 | |
85 return generator->await_input_or_debug_pos(); | 92 return generator->await_input_or_debug_pos(); |
86 } | 93 } |
87 | 94 |
88 RUNTIME_FUNCTION(Runtime_AsyncGeneratorResolve) { | 95 RUNTIME_FUNCTION(Runtime_AsyncGeneratorResolve) { |
89 HandleScope scope(isolate); | 96 HandleScope scope(isolate); |
90 DCHECK_EQ(3, args.length()); | 97 DCHECK_EQ(3, args.length()); |
91 | 98 |
92 // Runtime call is implemented in InterpreterIntrinsics and lowered in | 99 // Runtime call is implemented in InterpreterIntrinsics and lowered in |
93 // JSIntrinsicLowering | 100 // JSIntrinsicLowering |
94 UNREACHABLE(); | 101 UNREACHABLE(); |
(...skipping 10 matching lines...) Expand all Loading... |
105 UNREACHABLE(); | 112 UNREACHABLE(); |
106 | 113 |
107 return isolate->heap()->undefined_value(); | 114 return isolate->heap()->undefined_value(); |
108 } | 115 } |
109 | 116 |
110 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { | 117 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { |
111 HandleScope scope(isolate); | 118 HandleScope scope(isolate); |
112 DCHECK_EQ(1, args.length()); | 119 DCHECK_EQ(1, args.length()); |
113 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 120 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
114 | 121 |
| 122 // Runtime call is implemented in InterpreterIntrinsics and lowered in |
| 123 // JSIntrinsicLowering |
| 124 UNREACHABLE(); |
| 125 |
115 return Smi::FromInt(generator->resume_mode()); | 126 return Smi::FromInt(generator->resume_mode()); |
116 } | 127 } |
117 | 128 |
118 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { | 129 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { |
119 HandleScope scope(isolate); | 130 HandleScope scope(isolate); |
120 DCHECK_EQ(1, args.length()); | 131 DCHECK_EQ(1, args.length()); |
121 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 132 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
122 | 133 |
123 return Smi::FromInt(generator->continuation()); | 134 return Smi::FromInt(generator->continuation()); |
124 } | 135 } |
125 | 136 |
126 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) { | 137 RUNTIME_FUNCTION(Runtime_GeneratorGetSourcePosition) { |
127 HandleScope scope(isolate); | 138 HandleScope scope(isolate); |
128 DCHECK_EQ(1, args.length()); | 139 DCHECK_EQ(1, args.length()); |
129 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 140 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
130 | 141 |
131 if (!generator->is_suspended()) return isolate->heap()->undefined_value(); | 142 if (!generator->is_suspended()) return isolate->heap()->undefined_value(); |
132 return Smi::FromInt(generator->source_position()); | 143 return Smi::FromInt(generator->source_position()); |
133 } | 144 } |
134 | 145 |
135 } // namespace internal | 146 } // namespace internal |
136 } // namespace v8 | 147 } // namespace v8 |
OLD | NEW |