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/liveobjectlist.cc

Issue 7901016: Basic support for tracking smi-only arrays on ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ready to land Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1318 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 Handle<String> first_sym = factory->LookupAsciiSymbol("first_index"); 1329 Handle<String> first_sym = factory->LookupAsciiSymbol("first_index");
1330 maybe_result = body->SetProperty(*first_sym, 1330 maybe_result = body->SetProperty(*first_sym,
1331 Smi::FromInt(start), 1331 Smi::FromInt(start),
1332 NONE, 1332 NONE,
1333 kNonStrictMode); 1333 kNonStrictMode);
1334 if (maybe_result->IsFailure()) return maybe_result; 1334 if (maybe_result->IsFailure()) return maybe_result;
1335 1335
1336 // Allocate the JSArray of the elements. 1336 // Allocate the JSArray of the elements.
1337 Handle<JSObject> elements = factory->NewJSObject(isolate->array_function()); 1337 Handle<JSObject> elements = factory->NewJSObject(isolate->array_function());
1338 if (elements->IsFailure()) return Object::cast(*elements); 1338 if (elements->IsFailure()) return Object::cast(*elements);
1339 Handle<JSArray>::cast(elements)->SetContent(*elements_arr); 1339
1340 maybe_result = Handle<JSArray>::cast(elements)->SetContent(*elements_arr);
1341 if (maybe_result->IsFailure()) return maybe_result;
1340 1342
1341 // Set body.elements. 1343 // Set body.elements.
1342 Handle<String> elements_sym = factory->LookupAsciiSymbol("elements"); 1344 Handle<String> elements_sym = factory->LookupAsciiSymbol("elements");
1343 maybe_result = body->SetProperty(*elements_sym, 1345 maybe_result = body->SetProperty(*elements_sym,
1344 *elements, 1346 *elements,
1345 NONE, 1347 NONE,
1346 kNonStrictMode); 1348 kNonStrictMode);
1347 if (maybe_result->IsFailure()) return maybe_result; 1349 if (maybe_result->IsFailure()) return maybe_result;
1348 1350
1349 return *body; 1351 return *body;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 if (maybe_result->IsFailure()) return maybe_result; 1457 if (maybe_result->IsFailure()) return maybe_result;
1456 1458
1457 summary_arr->set(idx++, *detail); 1459 summary_arr->set(idx++, *detail);
1458 } 1460 }
1459 } 1461 }
1460 1462
1461 // Wrap the summary fixed array in a JS array. 1463 // Wrap the summary fixed array in a JS array.
1462 Handle<JSObject> summary_obj = 1464 Handle<JSObject> summary_obj =
1463 factory->NewJSObject(isolate->array_function()); 1465 factory->NewJSObject(isolate->array_function());
1464 if (summary_obj->IsFailure()) return Object::cast(*summary_obj); 1466 if (summary_obj->IsFailure()) return Object::cast(*summary_obj);
1465 Handle<JSArray>::cast(summary_obj)->SetContent(*summary_arr); 1467
1468 maybe_result = Handle<JSArray>::cast(summary_obj)->SetContent(*summary_arr);
1469 if (maybe_result->IsFailure()) return maybe_result;
1466 1470
1467 // Create the body object. 1471 // Create the body object.
1468 Handle<JSObject> body = factory->NewJSObject(isolate->object_function()); 1472 Handle<JSObject> body = factory->NewJSObject(isolate->object_function());
1469 if (body->IsFailure()) return Object::cast(*body); 1473 if (body->IsFailure()) return Object::cast(*body);
1470 1474
1471 // Fill out the body object. 1475 // Fill out the body object.
1472 int total_count = summary.total_count(); 1476 int total_count = summary.total_count();
1473 int total_size = summary.total_size(); 1477 int total_size = summary.total_size();
1474 maybe_result = body->SetProperty(*count_sym, 1478 maybe_result = body->SetProperty(*count_sym,
1475 Smi::FromInt(total_count), 1479 Smi::FromInt(total_count),
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 kNonStrictMode); 1586 kNonStrictMode);
1583 if (maybe_result->IsFailure()) return maybe_result; 1587 if (maybe_result->IsFailure()) return maybe_result;
1584 list->set(idx++, *detail); 1588 list->set(idx++, *detail);
1585 dump_limit--; 1589 dump_limit--;
1586 } 1590 }
1587 lol = lol->next(); 1591 lol = lol->next();
1588 } 1592 }
1589 1593
1590 // Return the result as a JS array. 1594 // Return the result as a JS array.
1591 Handle<JSObject> lols = factory->NewJSObject(isolate->array_function()); 1595 Handle<JSObject> lols = factory->NewJSObject(isolate->array_function());
1592 Handle<JSArray>::cast(lols)->SetContent(*list); 1596
1597 maybe_result = Handle<JSArray>::cast(lols)->SetContent(*list);
1598 if (maybe_result->IsFailure()) return maybe_result;
1593 1599
1594 Handle<JSObject> result = factory->NewJSObject(isolate->object_function()); 1600 Handle<JSObject> result = factory->NewJSObject(isolate->object_function());
1595 if (result->IsFailure()) return Object::cast(*result); 1601 if (result->IsFailure()) return Object::cast(*result);
1596 1602
1597 maybe_result = result->SetProperty(*count_sym, 1603 maybe_result = result->SetProperty(*count_sym,
1598 Smi::FromInt(total_count), 1604 Smi::FromInt(total_count),
1599 NONE, 1605 NONE,
1600 kNonStrictMode); 1606 kNonStrictMode);
1601 if (maybe_result->IsFailure()) return maybe_result; 1607 if (maybe_result->IsFailure()) return maybe_result;
1602 1608
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
2616 i++, heap_obj, Heap::new_space()->FromSpaceStart()); 2622 i++, heap_obj, Heap::new_space()->FromSpaceStart());
2617 } 2623 }
2618 } 2624 }
2619 } 2625 }
2620 #endif // VERIFY_LOL 2626 #endif // VERIFY_LOL
2621 2627
2622 2628
2623 } } // namespace v8::internal 2629 } } // namespace v8::internal
2624 2630
2625 #endif // LIVE_OBJECT_LIST 2631 #endif // LIVE_OBJECT_LIST
OLDNEW
« src/bootstrapper.cc ('K') | « src/lithium.cc ('k') | src/mips/macro-assembler-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698