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

Side by Side Diff: src/bootstrapper.cc

Issue 993073002: [es6] Function length property should be configurable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix status file again Created 5 years, 9 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/accessors.cc ('k') | test/mjsunit/es6/function-length-configurable.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/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/extensions/externalize-string-extension.h" 10 #include "src/extensions/externalize-string-extension.h"
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 Handle<Map> map, FunctionMode function_mode) { 381 Handle<Map> map, FunctionMode function_mode) {
382 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4; 382 int size = IsFunctionModeWithPrototype(function_mode) ? 5 : 4;
383 Map::EnsureDescriptorSlack(map, size); 383 Map::EnsureDescriptorSlack(map, size);
384 384
385 PropertyAttributes ro_attribs = 385 PropertyAttributes ro_attribs =
386 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 386 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
387 PropertyAttributes roc_attribs = 387 PropertyAttributes roc_attribs =
388 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); 388 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
389 389
390 Handle<AccessorInfo> length = 390 Handle<AccessorInfo> length =
391 Accessors::FunctionLengthInfo(isolate(), ro_attribs); 391 Accessors::FunctionLengthInfo(isolate(), roc_attribs);
392 { // Add length. 392 { // Add length.
393 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), 393 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
394 length, ro_attribs); 394 length, roc_attribs);
395 map->AppendDescriptor(&d); 395 map->AppendDescriptor(&d);
396 } 396 }
397 Handle<AccessorInfo> name = 397 Handle<AccessorInfo> name =
398 Accessors::FunctionNameInfo(isolate(), ro_attribs); 398 Accessors::FunctionNameInfo(isolate(), ro_attribs);
399 { // Add name. 399 { // Add name.
400 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, 400 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
401 roc_attribs); 401 roc_attribs);
402 map->AppendDescriptor(&d); 402 map->AppendDescriptor(&d);
403 } 403 }
404 Handle<AccessorInfo> args = 404 Handle<AccessorInfo> args =
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 // Add length. 548 // Add length.
549 if (function_mode == BOUND_FUNCTION) { 549 if (function_mode == BOUND_FUNCTION) {
550 Handle<String> length_string = isolate()->factory()->length_string(); 550 Handle<String> length_string = isolate()->factory()->length_string();
551 DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged()); 551 DataDescriptor d(length_string, 0, ro_attribs, Representation::Tagged());
552 map->AppendDescriptor(&d); 552 map->AppendDescriptor(&d);
553 } else { 553 } else {
554 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE || 554 DCHECK(function_mode == FUNCTION_WITH_WRITEABLE_PROTOTYPE ||
555 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE || 555 function_mode == FUNCTION_WITH_READONLY_PROTOTYPE ||
556 function_mode == FUNCTION_WITHOUT_PROTOTYPE); 556 function_mode == FUNCTION_WITHOUT_PROTOTYPE);
557 Handle<AccessorInfo> length = 557 Handle<AccessorInfo> length =
558 Accessors::FunctionLengthInfo(isolate(), ro_attribs); 558 Accessors::FunctionLengthInfo(isolate(), roc_attribs);
559 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())), 559 AccessorConstantDescriptor d(Handle<Name>(Name::cast(length->name())),
560 length, ro_attribs); 560 length, roc_attribs);
561 map->AppendDescriptor(&d); 561 map->AppendDescriptor(&d);
562 } 562 }
563 Handle<AccessorInfo> name = 563 Handle<AccessorInfo> name =
564 Accessors::FunctionNameInfo(isolate(), roc_attribs); 564 Accessors::FunctionNameInfo(isolate(), roc_attribs);
565 { // Add name. 565 { // Add name.
566 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name, 566 AccessorConstantDescriptor d(Handle<Name>(Name::cast(name->name())), name,
567 roc_attribs); 567 roc_attribs);
568 map->AppendDescriptor(&d); 568 map->AppendDescriptor(&d);
569 } 569 }
570 { // Add arguments. 570 { // Add arguments.
(...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2922 return from + sizeof(NestingCounterType); 2922 return from + sizeof(NestingCounterType);
2923 } 2923 }
2924 2924
2925 2925
2926 // Called when the top-level V8 mutex is destroyed. 2926 // Called when the top-level V8 mutex is destroyed.
2927 void Bootstrapper::FreeThreadResources() { 2927 void Bootstrapper::FreeThreadResources() {
2928 DCHECK(!IsActive()); 2928 DCHECK(!IsActive());
2929 } 2929 }
2930 2930
2931 } } // namespace v8::internal 2931 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/accessors.cc ('k') | test/mjsunit/es6/function-length-configurable.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698