OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils-gen.h" |
6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 typedef compiler::CodeAssemblerState CodeAssemblerState; | |
16 | |
17 class GeneratorBuiltinsAssembler : public CodeStubAssembler { | 15 class GeneratorBuiltinsAssembler : public CodeStubAssembler { |
18 public: | 16 public: |
19 explicit GeneratorBuiltinsAssembler(CodeAssemblerState* state) | 17 explicit GeneratorBuiltinsAssembler(compiler::CodeAssemblerState* state) |
20 : CodeStubAssembler(state) {} | 18 : CodeStubAssembler(state) {} |
21 | 19 |
22 protected: | 20 protected: |
23 void GeneratorPrototypeResume(JSGeneratorObject::ResumeMode resume_mode, | 21 void GeneratorPrototypeResume(JSGeneratorObject::ResumeMode resume_mode, |
24 char const* const method_name); | 22 char const* const method_name); |
25 }; | 23 }; |
26 | 24 |
27 void GeneratorBuiltinsAssembler::GeneratorPrototypeResume( | 25 void GeneratorBuiltinsAssembler::GeneratorPrototypeResume( |
28 JSGeneratorObject::ResumeMode resume_mode, char const* const method_name) { | 26 JSGeneratorObject::ResumeMode resume_mode, char const* const method_name) { |
29 Node* receiver = Parameter(0); | 27 Node* receiver = Parameter(0); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 105 } |
108 | 106 |
109 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception ) | 107 // ES6 section 25.3.1.4 Generator.prototype.throw ( exception ) |
110 TF_BUILTIN(GeneratorPrototypeThrow, GeneratorBuiltinsAssembler) { | 108 TF_BUILTIN(GeneratorPrototypeThrow, GeneratorBuiltinsAssembler) { |
111 GeneratorPrototypeResume(JSGeneratorObject::kThrow, | 109 GeneratorPrototypeResume(JSGeneratorObject::kThrow, |
112 "[Generator].prototype.throw"); | 110 "[Generator].prototype.throw"); |
113 } | 111 } |
114 | 112 |
115 } // namespace internal | 113 } // namespace internal |
116 } // namespace v8 | 114 } // namespace v8 |
OLD | NEW |