Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: src/runtime/runtime-generator.cc

Issue 2639533002: [generators] Always call function with closure context when resuming. (Closed)
Patch Set: Ports. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime.h ('k') | test/cctest/interpreter/bytecode_expectations/Generators.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698