| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 } | 54 } |
| 55 | 55 |
| 56 RUNTIME_FUNCTION(Runtime_GeneratorGetReceiver) { | 56 RUNTIME_FUNCTION(Runtime_GeneratorGetReceiver) { |
| 57 HandleScope scope(isolate); | 57 HandleScope scope(isolate); |
| 58 DCHECK_EQ(1, args.length()); | 58 DCHECK_EQ(1, args.length()); |
| 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) { |
| 65 HandleScope scope(isolate); |
| 66 DCHECK_EQ(1, args.length()); |
| 67 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
| 68 |
| 69 return generator->context(); |
| 70 } |
| 71 |
| 64 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { | 72 RUNTIME_FUNCTION(Runtime_GeneratorGetInputOrDebugPos) { |
| 65 HandleScope scope(isolate); | 73 HandleScope scope(isolate); |
| 66 DCHECK_EQ(1, args.length()); | 74 DCHECK_EQ(1, args.length()); |
| 67 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); | 75 CONVERT_ARG_HANDLE_CHECKED(JSGeneratorObject, generator, 0); |
| 68 | 76 |
| 69 return generator->input_or_debug_pos(); | 77 return generator->input_or_debug_pos(); |
| 70 } | 78 } |
| 71 | 79 |
| 72 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { | 80 RUNTIME_FUNCTION(Runtime_GeneratorGetResumeMode) { |
| 73 HandleScope scope(isolate); | 81 HandleScope scope(isolate); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 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 |