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

Side by Side Diff: src/runtime.cc

Issue 7464032: Improve fast to slow elements conversion: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review fixes and tweaks Created 9 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 | Annotate | Revision Log
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 index, 1659 index,
1660 last_match_info); 1660 last_match_info);
1661 if (result.is_null()) return Failure::Exception(); 1661 if (result.is_null()) return Failure::Exception();
1662 return *result; 1662 return *result;
1663 } 1663 }
1664 1664
1665 1665
1666 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) { 1666 RUNTIME_FUNCTION(MaybeObject*, Runtime_RegExpConstructResult) {
1667 ASSERT(args.length() == 3); 1667 ASSERT(args.length() == 3);
1668 CONVERT_SMI_ARG_CHECKED(elements_count, 0); 1668 CONVERT_SMI_ARG_CHECKED(elements_count, 0);
1669 if (elements_count > JSArray::kMaxFastElementsLength) { 1669 if (elements_count < 0 ||
1670 elements_count > FixedArray::kMaxLength ||
1671 !Smi::IsValid(elements_count)) {
1670 return isolate->ThrowIllegalOperation(); 1672 return isolate->ThrowIllegalOperation();
1671 } 1673 }
1672 Object* new_object; 1674 Object* new_object;
1673 { MaybeObject* maybe_new_object = 1675 { MaybeObject* maybe_new_object =
1674 isolate->heap()->AllocateFixedArrayWithHoles(elements_count); 1676 isolate->heap()->AllocateFixedArrayWithHoles(elements_count);
1675 if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object; 1677 if (!maybe_new_object->ToObject(&new_object)) return maybe_new_object;
1676 } 1678 }
1677 FixedArray* elements = FixedArray::cast(new_object); 1679 FixedArray* elements = FixedArray::cast(new_object);
1678 { MaybeObject* maybe_new_object = isolate->heap()->AllocateRaw( 1680 { MaybeObject* maybe_new_object = isolate->heap()->AllocateRaw(
1679 JSRegExpResult::kSize, NEW_SPACE, OLD_POINTER_SPACE); 1681 JSRegExpResult::kSize, NEW_SPACE, OLD_POINTER_SPACE);
(...skipping 11014 matching lines...) Expand 10 before | Expand all | Expand 10 after
12694 } else { 12696 } else {
12695 // Handle last resort GC and make sure to allow future allocations 12697 // Handle last resort GC and make sure to allow future allocations
12696 // to grow the heap without causing GCs (if possible). 12698 // to grow the heap without causing GCs (if possible).
12697 isolate->counters()->gc_last_resort_from_js()->Increment(); 12699 isolate->counters()->gc_last_resort_from_js()->Increment();
12698 isolate->heap()->CollectAllGarbage(false); 12700 isolate->heap()->CollectAllGarbage(false);
12699 } 12701 }
12700 } 12702 }
12701 12703
12702 12704
12703 } } // namespace v8::internal 12705 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698