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

Side by Side Diff: src/bootstrapper.cc

Issue 1226203011: Remove unused byte from Map::instance_sizes field. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported to all architectures. Created 5 years, 5 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/bailout-reason.h ('k') | src/deoptimizer.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/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 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1183 PropertyAttributes writable = 1183 PropertyAttributes writable =
1184 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); 1184 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
1185 DataDescriptor field(factory->last_index_string(), 1185 DataDescriptor field(factory->last_index_string(),
1186 JSRegExp::kLastIndexFieldIndex, writable, 1186 JSRegExp::kLastIndexFieldIndex, writable,
1187 Representation::Tagged()); 1187 Representation::Tagged());
1188 initial_map->AppendDescriptor(&field); 1188 initial_map->AppendDescriptor(&field);
1189 } 1189 }
1190 1190
1191 static const int num_fields = JSRegExp::kInObjectFieldCount; 1191 static const int num_fields = JSRegExp::kInObjectFieldCount;
1192 initial_map->set_inobject_properties(num_fields); 1192 initial_map->set_inobject_properties(num_fields);
1193 initial_map->set_pre_allocated_property_fields(num_fields);
1194 initial_map->set_unused_property_fields(0); 1193 initial_map->set_unused_property_fields(0);
1195 initial_map->set_instance_size(initial_map->instance_size() + 1194 initial_map->set_instance_size(initial_map->instance_size() +
1196 num_fields * kPointerSize); 1195 num_fields * kPointerSize);
1197 1196
1198 // RegExp prototype object is itself a RegExp. 1197 // RegExp prototype object is itself a RegExp.
1199 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype"); 1198 Handle<Map> proto_map = Map::Copy(initial_map, "RegExpPrototype");
1200 DCHECK(proto_map->prototype() == *isolate->initial_object_prototype()); 1199 DCHECK(proto_map->prototype() == *isolate->initial_object_prototype());
1201 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map); 1200 Handle<JSObject> proto = factory->NewJSObjectFromMap(proto_map);
1202 proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex, 1201 proto->InObjectPropertyAtPut(JSRegExp::kSourceFieldIndex,
1203 heap->query_colon_string()); 1202 heap->query_colon_string());
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 JSGeneratorObject::kResultValuePropertyIndex, 1292 JSGeneratorObject::kResultValuePropertyIndex,
1294 NONE, Representation::Tagged()); 1293 NONE, Representation::Tagged());
1295 iterator_result_map->AppendDescriptor(&value_descr); 1294 iterator_result_map->AppendDescriptor(&value_descr);
1296 1295
1297 DataDescriptor done_descr(factory->done_string(), 1296 DataDescriptor done_descr(factory->done_string(),
1298 JSGeneratorObject::kResultDonePropertyIndex, NONE, 1297 JSGeneratorObject::kResultDonePropertyIndex, NONE,
1299 Representation::Tagged()); 1298 Representation::Tagged());
1300 iterator_result_map->AppendDescriptor(&done_descr); 1299 iterator_result_map->AppendDescriptor(&done_descr);
1301 1300
1302 iterator_result_map->set_unused_property_fields(0); 1301 iterator_result_map->set_unused_property_fields(0);
1303 iterator_result_map->set_pre_allocated_property_fields(
1304 JSGeneratorObject::kResultPropertyCount);
1305 DCHECK_EQ(JSGeneratorObject::kResultSize, 1302 DCHECK_EQ(JSGeneratorObject::kResultSize,
1306 iterator_result_map->instance_size()); 1303 iterator_result_map->instance_size());
1307 native_context()->set_iterator_result_map(*iterator_result_map); 1304 native_context()->set_iterator_result_map(*iterator_result_map);
1308 } 1305 }
1309 1306
1310 // -- W e a k M a p 1307 // -- W e a k M a p
1311 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize, 1308 InstallFunction(global, "WeakMap", JS_WEAK_MAP_TYPE, JSWeakMap::kSize,
1312 isolate->initial_object_prototype(), Builtins::kIllegal); 1309 isolate->initial_object_prototype(), Builtins::kIllegal);
1313 // -- W e a k S e t 1310 // -- W e a k S e t
1314 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize, 1311 InstallFunction(global, "WeakSet", JS_WEAK_SET_TYPE, JSWeakSet::kSize,
(...skipping 20 matching lines...) Expand all
1335 map->AppendDescriptor(&d); 1332 map->AppendDescriptor(&d);
1336 } 1333 }
1337 { // callee 1334 { // callee
1338 DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex, 1335 DataDescriptor d(factory->callee_string(), Heap::kArgumentsCalleeIndex,
1339 DONT_ENUM, Representation::Tagged()); 1336 DONT_ENUM, Representation::Tagged());
1340 map->AppendDescriptor(&d); 1337 map->AppendDescriptor(&d);
1341 } 1338 }
1342 // @@iterator method is added later. 1339 // @@iterator method is added later.
1343 1340
1344 map->set_function_with_prototype(true); 1341 map->set_function_with_prototype(true);
1345 map->set_pre_allocated_property_fields(2);
1346 map->set_inobject_properties(2); 1342 map->set_inobject_properties(2);
1347 native_context()->set_sloppy_arguments_map(*map); 1343 native_context()->set_sloppy_arguments_map(*map);
1348 1344
1349 DCHECK(!function->has_initial_map()); 1345 DCHECK(!function->has_initial_map());
1350 JSFunction::SetInitialMap(function, map, 1346 JSFunction::SetInitialMap(function, map,
1351 isolate->initial_object_prototype()); 1347 isolate->initial_object_prototype());
1352 1348
1353 DCHECK(map->inobject_properties() > Heap::kArgumentsCalleeIndex); 1349 DCHECK(map->inobject_properties() > Heap::kArgumentsCalleeIndex);
1354 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex); 1350 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex);
1355 DCHECK(!map->is_dictionary_map()); 1351 DCHECK(!map->is_dictionary_map());
1356 DCHECK(IsFastObjectElementsKind(map->elements_kind())); 1352 DCHECK(IsFastObjectElementsKind(map->elements_kind()));
1357 } 1353 }
1358 1354
1359 { // --- fast and slow aliased arguments map 1355 { // --- fast and slow aliased arguments map
1360 Handle<Map> map = isolate->sloppy_arguments_map(); 1356 Handle<Map> map = isolate->sloppy_arguments_map();
1361 map = Map::Copy(map, "FastAliasedArguments"); 1357 map = Map::Copy(map, "FastAliasedArguments");
1362 map->set_elements_kind(FAST_SLOPPY_ARGUMENTS_ELEMENTS); 1358 map->set_elements_kind(FAST_SLOPPY_ARGUMENTS_ELEMENTS);
1363 DCHECK_EQ(2, map->pre_allocated_property_fields()); 1359 DCHECK_EQ(2, map->inobject_properties());
1364 native_context()->set_fast_aliased_arguments_map(*map); 1360 native_context()->set_fast_aliased_arguments_map(*map);
1365 1361
1366 map = Map::Copy(map, "SlowAliasedArguments"); 1362 map = Map::Copy(map, "SlowAliasedArguments");
1367 map->set_elements_kind(SLOW_SLOPPY_ARGUMENTS_ELEMENTS); 1363 map->set_elements_kind(SLOW_SLOPPY_ARGUMENTS_ELEMENTS);
1368 DCHECK_EQ(2, map->pre_allocated_property_fields()); 1364 DCHECK_EQ(2, map->inobject_properties());
1369 native_context()->set_slow_aliased_arguments_map(*map); 1365 native_context()->set_slow_aliased_arguments_map(*map);
1370 } 1366 }
1371 1367
1372 { // --- strict mode arguments map 1368 { // --- strict mode arguments map
1373 const PropertyAttributes attributes = 1369 const PropertyAttributes attributes =
1374 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); 1370 static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
1375 1371
1376 // Create the ThrowTypeError functions. 1372 // Create the ThrowTypeError functions.
1377 Handle<AccessorPair> callee = factory->NewAccessorPair(); 1373 Handle<AccessorPair> callee = factory->NewAccessorPair();
1378 Handle<AccessorPair> caller = factory->NewAccessorPair(); 1374 Handle<AccessorPair> caller = factory->NewAccessorPair();
(...skipping 26 matching lines...) Expand all
1405 AccessorConstantDescriptor d(factory->caller_string(), caller, 1401 AccessorConstantDescriptor d(factory->caller_string(), caller,
1406 attributes); 1402 attributes);
1407 map->AppendDescriptor(&d); 1403 map->AppendDescriptor(&d);
1408 } 1404 }
1409 // @@iterator method is added later. 1405 // @@iterator method is added later.
1410 1406
1411 map->set_function_with_prototype(true); 1407 map->set_function_with_prototype(true);
1412 DCHECK_EQ(native_context()->object_function()->prototype(), 1408 DCHECK_EQ(native_context()->object_function()->prototype(),
1413 *isolate->initial_object_prototype()); 1409 *isolate->initial_object_prototype());
1414 Map::SetPrototype(map, isolate->initial_object_prototype()); 1410 Map::SetPrototype(map, isolate->initial_object_prototype());
1415 map->set_pre_allocated_property_fields(1);
1416 map->set_inobject_properties(1); 1411 map->set_inobject_properties(1);
1417 1412
1418 // Copy constructor from the sloppy arguments boilerplate. 1413 // Copy constructor from the sloppy arguments boilerplate.
1419 map->SetConstructor( 1414 map->SetConstructor(
1420 native_context()->sloppy_arguments_map()->GetConstructor()); 1415 native_context()->sloppy_arguments_map()->GetConstructor());
1421 1416
1422 native_context()->set_strict_arguments_map(*map); 1417 native_context()->set_strict_arguments_map(*map);
1423 1418
1424 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex); 1419 DCHECK(map->inobject_properties() > Heap::kArgumentsLengthIndex);
1425 DCHECK(!map->is_dictionary_map()); 1420 DCHECK(!map->is_dictionary_map());
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 } 2411 }
2417 2412
2418 { 2413 {
2419 DataDescriptor input_field(factory()->input_string(), 2414 DataDescriptor input_field(factory()->input_string(),
2420 JSRegExpResult::kInputIndex, NONE, 2415 JSRegExpResult::kInputIndex, NONE,
2421 Representation::Tagged()); 2416 Representation::Tagged());
2422 initial_map->AppendDescriptor(&input_field); 2417 initial_map->AppendDescriptor(&input_field);
2423 } 2418 }
2424 2419
2425 initial_map->set_inobject_properties(2); 2420 initial_map->set_inobject_properties(2);
2426 initial_map->set_pre_allocated_property_fields(2);
2427 initial_map->set_unused_property_fields(0); 2421 initial_map->set_unused_property_fields(0);
2428 2422
2429 native_context()->set_regexp_result_map(*initial_map); 2423 native_context()->set_regexp_result_map(*initial_map);
2430 } 2424 }
2431 2425
2432 // Add @@iterator method to the arguments object maps. 2426 // Add @@iterator method to the arguments object maps.
2433 { 2427 {
2434 PropertyAttributes attribs = DONT_ENUM; 2428 PropertyAttributes attribs = DONT_ENUM;
2435 Handle<AccessorInfo> arguments_iterator = 2429 Handle<AccessorInfo> arguments_iterator =
2436 Accessors::ArgumentsIteratorInfo(isolate(), attribs); 2430 Accessors::ArgumentsIteratorInfo(isolate(), attribs);
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 } 3196 }
3203 3197
3204 3198
3205 // Called when the top-level V8 mutex is destroyed. 3199 // Called when the top-level V8 mutex is destroyed.
3206 void Bootstrapper::FreeThreadResources() { 3200 void Bootstrapper::FreeThreadResources() {
3207 DCHECK(!IsActive()); 3201 DCHECK(!IsActive());
3208 } 3202 }
3209 3203
3210 } // namespace internal 3204 } // namespace internal
3211 } // namespace v8 3205 } // namespace v8
OLDNEW
« no previous file with comments | « src/bailout-reason.h ('k') | src/deoptimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698