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

Side by Side Diff: src/bootstrapper.cc

Issue 1433133003: [runtime] Make elements backing store for arguments non-holey. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix another case. 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 | « no previous file | src/elements.cc » ('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 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 { // --- sloppy arguments map 1347 { // --- sloppy arguments map
1348 // Make sure we can recognize argument objects at runtime. 1348 // Make sure we can recognize argument objects at runtime.
1349 // This is done by introducing an anonymous function with 1349 // This is done by introducing an anonymous function with
1350 // class_name equals 'Arguments'. 1350 // class_name equals 'Arguments'.
1351 Handle<String> arguments_string = factory->Arguments_string(); 1351 Handle<String> arguments_string = factory->Arguments_string();
1352 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal)); 1352 Handle<Code> code(isolate->builtins()->builtin(Builtins::kIllegal));
1353 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype( 1353 Handle<JSFunction> function = factory->NewFunctionWithoutPrototype(
1354 arguments_string, code); 1354 arguments_string, code);
1355 function->shared()->set_instance_class_name(*arguments_string); 1355 function->shared()->set_instance_class_name(*arguments_string);
1356 1356
1357 Handle<Map> map = 1357 Handle<Map> map = factory->NewMap(
1358 factory->NewMap(JS_OBJECT_TYPE, Heap::kSloppyArgumentsObjectSize); 1358 JS_OBJECT_TYPE, Heap::kSloppyArgumentsObjectSize, FAST_ELEMENTS);
1359 // Create the descriptor array for the arguments object. 1359 // Create the descriptor array for the arguments object.
1360 Map::EnsureDescriptorSlack(map, 2); 1360 Map::EnsureDescriptorSlack(map, 2);
1361 1361
1362 { // length 1362 { // length
1363 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex, 1363 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
1364 DONT_ENUM, Representation::Tagged()); 1364 DONT_ENUM, Representation::Tagged());
1365 map->AppendDescriptor(&d); 1365 map->AppendDescriptor(&d);
1366 } 1366 }
1367 { // callee 1367 { // callee
1368 DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex, 1368 DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1407 1407
1408 Handle<JSFunction> poison = GetStrictArgumentsPoisonFunction(); 1408 Handle<JSFunction> poison = GetStrictArgumentsPoisonFunction();
1409 1409
1410 // Install the ThrowTypeError functions. 1410 // Install the ThrowTypeError functions.
1411 callee->set_getter(*poison); 1411 callee->set_getter(*poison);
1412 callee->set_setter(*poison); 1412 callee->set_setter(*poison);
1413 caller->set_getter(*poison); 1413 caller->set_getter(*poison);
1414 caller->set_setter(*poison); 1414 caller->set_setter(*poison);
1415 1415
1416 // Create the map. Allocate one in-object field for length. 1416 // Create the map. Allocate one in-object field for length.
1417 Handle<Map> map = factory->NewMap(JS_OBJECT_TYPE, 1417 Handle<Map> map = factory->NewMap(
1418 Heap::kStrictArgumentsObjectSize); 1418 JS_OBJECT_TYPE, Heap::kStrictArgumentsObjectSize, FAST_ELEMENTS);
1419 // Create the descriptor array for the arguments object. 1419 // Create the descriptor array for the arguments object.
1420 Map::EnsureDescriptorSlack(map, 3); 1420 Map::EnsureDescriptorSlack(map, 3);
1421 1421
1422 { // length 1422 { // length
1423 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex, 1423 DataDescriptor d(factory->length_string(), Heap::kArgumentsLengthIndex,
1424 DONT_ENUM, Representation::Tagged()); 1424 DONT_ENUM, Representation::Tagged());
1425 map->AppendDescriptor(&d); 1425 map->AppendDescriptor(&d);
1426 } 1426 }
1427 { // callee 1427 { // callee
1428 AccessorConstantDescriptor d(factory->callee_string(), callee, 1428 AccessorConstantDescriptor d(factory->callee_string(), callee,
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3234 } 3234 }
3235 3235
3236 3236
3237 // Called when the top-level V8 mutex is destroyed. 3237 // Called when the top-level V8 mutex is destroyed.
3238 void Bootstrapper::FreeThreadResources() { 3238 void Bootstrapper::FreeThreadResources() {
3239 DCHECK(!IsActive()); 3239 DCHECK(!IsActive());
3240 } 3240 }
3241 3241
3242 } // namespace internal 3242 } // namespace internal
3243 } // namespace v8 3243 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/elements.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698