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

Side by Side Diff: src/bootstrapper.cc

Issue 1153633003: [es6] Define generator prototype as writable prop (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | test/mjsunit/es6/generators-runtime.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 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/bootstrapper.h" 5 #include "src/bootstrapper.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/base/utils/random-number-generator.h" 9 #include "src/base/utils/random-number-generator.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2159 matching lines...) Expand 10 before | Expand all | Expand 10 after
2170 factory()->InternalizeUtf8String("prototype"), 2170 factory()->InternalizeUtf8String("prototype"),
2171 generator_object_prototype, 2171 generator_object_prototype,
2172 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 2172 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
2173 2173
2174 static const bool kUseStrictFunctionMap = true; 2174 static const bool kUseStrictFunctionMap = true;
2175 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE, 2175 InstallFunction(builtins, "GeneratorFunction", JS_FUNCTION_TYPE,
2176 JSFunction::kSize, generator_function_prototype, 2176 JSFunction::kSize, generator_function_prototype,
2177 Builtins::kIllegal, kUseStrictFunctionMap); 2177 Builtins::kIllegal, kUseStrictFunctionMap);
2178 2178
2179 // Create maps for generator functions and their prototypes. Store those 2179 // Create maps for generator functions and their prototypes. Store those
2180 // maps in the native context. Generator functions do not have writable 2180 // maps in the native context. Generator functions do not have "caller" or
2181 // prototypes, nor do they have "caller" or "arguments" accessors. 2181 // "arguments" accessors.
2182 Handle<Map> strict_function_map(native_context()->strict_function_map()); 2182 Handle<Map> strict_function_map(strict_function_map_writable_prototype_);
caitp (gmail) 2015/05/22 21:11:23 Can you add a note here about the `{ [[Writable]]:
2183 Handle<Map> sloppy_generator_function_map = 2183 Handle<Map> sloppy_generator_function_map =
2184 Map::Copy(strict_function_map, "SloppyGeneratorFunction"); 2184 Map::Copy(strict_function_map, "SloppyGeneratorFunction");
2185 Map::SetPrototype(sloppy_generator_function_map, 2185 Map::SetPrototype(sloppy_generator_function_map,
2186 generator_function_prototype); 2186 generator_function_prototype);
2187 native_context()->set_sloppy_generator_function_map( 2187 native_context()->set_sloppy_generator_function_map(
2188 *sloppy_generator_function_map); 2188 *sloppy_generator_function_map);
2189 2189
2190 Handle<Map> strict_generator_function_map = 2190 Handle<Map> strict_generator_function_map =
2191 Map::Copy(strict_function_map, "StrictGeneratorFunction"); 2191 Map::Copy(strict_function_map, "StrictGeneratorFunction");
2192 Map::SetPrototype(strict_generator_function_map, 2192 Map::SetPrototype(strict_generator_function_map,
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
3045 return from + sizeof(NestingCounterType); 3045 return from + sizeof(NestingCounterType);
3046 } 3046 }
3047 3047
3048 3048
3049 // Called when the top-level V8 mutex is destroyed. 3049 // Called when the top-level V8 mutex is destroyed.
3050 void Bootstrapper::FreeThreadResources() { 3050 void Bootstrapper::FreeThreadResources() {
3051 DCHECK(!IsActive()); 3051 DCHECK(!IsActive());
3052 } 3052 }
3053 3053
3054 } } // namespace v8::internal 3054 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698