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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // Returns receiver of generator activation. | 170 // Returns receiver of generator activation. |
171 RUNTIME_FUNCTION(Runtime_GeneratorGetReceiver) { | 171 RUNTIME_FUNCTION(Runtime_GeneratorGetReceiver) { |
172 HandleScope scope(isolate); | 172 HandleScope scope(isolate); |
173 DCHECK(args.length() == 1); | 173 DCHECK(args.length() == 1); |
174 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 174 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
175 | 175 |
176 return generator->receiver(); | 176 return generator->receiver(); |
177 } | 177 } |
178 | 178 |
179 | 179 |
| 180 // Returns input of generator activation. |
| 181 RUNTIME_FUNCTION(Runtime_GeneratorGetInput) { |
| 182 HandleScope scope(isolate); |
| 183 DCHECK(args.length() == 1); |
| 184 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
| 185 |
| 186 return generator->input(); |
| 187 } |
| 188 |
| 189 |
180 // Returns generator continuation as a PC offset, or the magic -1 or 0 values. | 190 // Returns generator continuation as a PC offset, or the magic -1 or 0 values. |
181 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { | 191 RUNTIME_FUNCTION(Runtime_GeneratorGetContinuation) { |
182 HandleScope scope(isolate); | 192 HandleScope scope(isolate); |
183 DCHECK(args.length() == 1); | 193 DCHECK(args.length() == 1); |
184 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 194 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
185 | 195 |
186 return Smi::FromInt(generator->continuation()); | 196 return Smi::FromInt(generator->continuation()); |
187 } | 197 } |
188 | 198 |
189 | 199 |
(...skipping 21 matching lines...) Expand all Loading... |
211 return NULL; | 221 return NULL; |
212 } | 222 } |
213 | 223 |
214 | 224 |
215 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { | 225 RUNTIME_FUNCTION(Runtime_GeneratorThrow) { |
216 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). | 226 UNREACHABLE(); // Optimization disabled in SetUpGenerators(). |
217 return NULL; | 227 return NULL; |
218 } | 228 } |
219 } // namespace internal | 229 } // namespace internal |
220 } // namespace v8 | 230 } // namespace v8 |
OLD | NEW |