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

Side by Side Diff: src/objects-inl.h

Issue 55933002: Inline array constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added comment to CreateArrayDispatchOneArgument Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 } 1323 }
1324 1324
1325 return AllocationSite::GetMode(GetElementsKind()) == 1325 return AllocationSite::GetMode(GetElementsKind()) ==
1326 TRACK_ALLOCATION_SITE; 1326 TRACK_ALLOCATION_SITE;
1327 } 1327 }
1328 return false; 1328 return false;
1329 } 1329 }
1330 1330
1331 1331
1332 void AllocationSite::Initialize() { 1332 void AllocationSite::Initialize() {
1333 set_transition_info(Smi::FromInt(0));
1333 SetElementsKind(GetInitialFastElementsKind()); 1334 SetElementsKind(GetInitialFastElementsKind());
1334 set_nested_site(Smi::FromInt(0)); 1335 set_nested_site(Smi::FromInt(0));
1335 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()), 1336 set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()),
1336 SKIP_WRITE_BARRIER); 1337 SKIP_WRITE_BARRIER);
1337 } 1338 }
1338 1339
1339 1340
1340 // Heuristic: We only need to create allocation site info if the boilerplate 1341 // Heuristic: We only need to create allocation site info if the boilerplate
1341 // elements kind is the initial elements kind. 1342 // elements kind is the initial elements kind.
1342 AllocationSiteMode AllocationSite::GetMode( 1343 AllocationSiteMode AllocationSite::GetMode(
(...skipping 17 matching lines...) Expand all
1360 1361
1361 return DONT_TRACK_ALLOCATION_SITE; 1362 return DONT_TRACK_ALLOCATION_SITE;
1362 } 1363 }
1363 1364
1364 1365
1365 inline bool AllocationSite::CanTrack(InstanceType type) { 1366 inline bool AllocationSite::CanTrack(InstanceType type) {
1366 return type == JS_ARRAY_TYPE; 1367 return type == JS_ARRAY_TYPE;
1367 } 1368 }
1368 1369
1369 1370
1371 inline DependentCode::DependencyGroup AllocationSite::ToDependencyGroup(
1372 Reason reason) {
1373 switch (reason) {
1374 case TENURING:
1375 return DependentCode::kAllocationSiteTenuringChangedGroup;
1376 break;
1377 case TRANSITIONS:
1378 return DependentCode::kAllocationSiteTransitionChangedGroup;
1379 break;
1380 }
1381 UNREACHABLE();
1382 return DependentCode::kAllocationSiteTransitionChangedGroup;
1383 }
1384
1385
1370 void JSObject::EnsureCanContainHeapObjectElements(Handle<JSObject> object) { 1386 void JSObject::EnsureCanContainHeapObjectElements(Handle<JSObject> object) {
1371 object->ValidateElements(); 1387 object->ValidateElements();
1372 ElementsKind elements_kind = object->map()->elements_kind(); 1388 ElementsKind elements_kind = object->map()->elements_kind();
1373 if (!IsFastObjectElementsKind(elements_kind)) { 1389 if (!IsFastObjectElementsKind(elements_kind)) {
1374 if (IsFastHoleyElementsKind(elements_kind)) { 1390 if (IsFastHoleyElementsKind(elements_kind)) {
1375 TransitionElementsKind(object, FAST_HOLEY_ELEMENTS); 1391 TransitionElementsKind(object, FAST_HOLEY_ELEMENTS);
1376 } else { 1392 } else {
1377 TransitionElementsKind(object, FAST_ELEMENTS); 1393 TransitionElementsKind(object, FAST_ELEMENTS);
1378 } 1394 }
1379 } 1395 }
(...skipping 5035 matching lines...) Expand 10 before | Expand all | Expand 10 after
6415 #undef WRITE_UINT32_FIELD 6431 #undef WRITE_UINT32_FIELD
6416 #undef READ_SHORT_FIELD 6432 #undef READ_SHORT_FIELD
6417 #undef WRITE_SHORT_FIELD 6433 #undef WRITE_SHORT_FIELD
6418 #undef READ_BYTE_FIELD 6434 #undef READ_BYTE_FIELD
6419 #undef WRITE_BYTE_FIELD 6435 #undef WRITE_BYTE_FIELD
6420 6436
6421 6437
6422 } } // namespace v8::internal 6438 } } // namespace v8::internal
6423 6439
6424 #endif // V8_OBJECTS_INL_H_ 6440 #endif // V8_OBJECTS_INL_H_
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698