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

Side by Side Diff: src/js/generator.js

Issue 1419813010: [runtime] Remove the very dangerous %_CallFunction intrinsic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/js/date.js ('k') | src/js/i18n.js » ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 throw MakeTypeError(kGeneratorRunning); 77 throw MakeTypeError(kGeneratorRunning);
78 } 78 }
79 } 79 }
80 80
81 81
82 function GeneratorFunctionConstructor(arg1) { // length == 1 82 function GeneratorFunctionConstructor(arg1) { // length == 1
83 var source = NewFunctionString(arguments, 'function*'); 83 var source = NewFunctionString(arguments, 'function*');
84 var global_proxy = %GlobalProxy(GeneratorFunctionConstructor); 84 var global_proxy = %GlobalProxy(GeneratorFunctionConstructor);
85 // Compile the string in the constructor and not a helper so that errors 85 // Compile the string in the constructor and not a helper so that errors
86 // appear to come from here. 86 // appear to come from here.
87 var func = %_CallFunction(global_proxy, %CompileString(source, true)); 87 var func = %_Call(%CompileString(source, true), global_proxy);
88 // Set name-should-print-as-anonymous flag on the ShareFunctionInfo and 88 // Set name-should-print-as-anonymous flag on the ShareFunctionInfo and
89 // ensure that |func| uses correct initial map from |new.target| if 89 // ensure that |func| uses correct initial map from |new.target| if
90 // it's available. 90 // it's available.
91 return %CompleteFunctionConstruction(func, GeneratorFunction, new.target); 91 return %CompleteFunctionConstruction(func, GeneratorFunction, new.target);
92 } 92 }
93 93
94 // ---------------------------------------------------------------------------- 94 // ----------------------------------------------------------------------------
95 95
96 // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by 96 // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by
97 // neither Crankshaft nor TurboFan, disable optimization of wrappers here. 97 // neither Crankshaft nor TurboFan, disable optimization of wrappers here.
(...skipping 13 matching lines...) Expand all
111 toStringTagSymbol, "Generator", DONT_ENUM | READ_ONLY); 111 toStringTagSymbol, "Generator", DONT_ENUM | READ_ONLY);
112 %InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype); 112 %InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype);
113 %AddNamedProperty(GeneratorFunctionPrototype, 113 %AddNamedProperty(GeneratorFunctionPrototype,
114 toStringTagSymbol, "GeneratorFunction", DONT_ENUM | READ_ONLY); 114 toStringTagSymbol, "GeneratorFunction", DONT_ENUM | READ_ONLY);
115 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", 115 %AddNamedProperty(GeneratorFunctionPrototype, "constructor",
116 GeneratorFunction, DONT_ENUM | READ_ONLY); 116 GeneratorFunction, DONT_ENUM | READ_ONLY);
117 %InternalSetPrototype(GeneratorFunction, GlobalFunction); 117 %InternalSetPrototype(GeneratorFunction, GlobalFunction);
118 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); 118 %SetCode(GeneratorFunction, GeneratorFunctionConstructor);
119 119
120 }) 120 })
OLDNEW
« no previous file with comments | « src/js/date.js ('k') | src/js/i18n.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698