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

Side by Side Diff: src/runtime.cc

Issue 525025: Merge r3536 and r3538 to trunk to fix performance issue with (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 11 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.cc ('k') | src/version.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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after
5402 Factory::DictionaryAtNumberPut(dict, index, elm); 5402 Factory::DictionaryAtNumberPut(dict, index, elm);
5403 if (!result.is_identical_to(dict)) 5403 if (!result.is_identical_to(dict))
5404 storage_ = result; 5404 storage_ = result;
5405 } 5405 }
5406 } 5406 }
5407 5407
5408 void increase_index_offset(uint32_t delta) { 5408 void increase_index_offset(uint32_t delta) {
5409 index_offset_ += delta; 5409 index_offset_ += delta;
5410 } 5410 }
5411 5411
5412 Handle<FixedArray> storage() { return storage_; }
5413
5412 private: 5414 private:
5413 Handle<FixedArray> storage_; 5415 Handle<FixedArray> storage_;
5414 uint32_t index_limit_; 5416 uint32_t index_limit_;
5415 bool fast_elements_; 5417 bool fast_elements_;
5416 uint32_t index_offset_; 5418 uint32_t index_offset_;
5417 }; 5419 };
5418 5420
5419 5421
5420 template<class ExternalArrayClass, class ElementType> 5422 template<class ExternalArrayClass, class ElementType>
5421 static uint32_t IterateExternalArrayElements(Handle<JSObject> receiver, 5423 static uint32_t IterateExternalArrayElements(Handle<JSObject> receiver,
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
5711 Factory::NewNumberDictionary(at_least_space_for)); 5713 Factory::NewNumberDictionary(at_least_space_for));
5712 } 5714 }
5713 5715
5714 Handle<Object> len = Factory::NewNumber(static_cast<double>(result_length)); 5716 Handle<Object> len = Factory::NewNumber(static_cast<double>(result_length));
5715 5717
5716 ArrayConcatVisitor visitor(storage, result_length, fast_case); 5718 ArrayConcatVisitor visitor(storage, result_length, fast_case);
5717 5719
5718 IterateArguments(arguments, &visitor); 5720 IterateArguments(arguments, &visitor);
5719 5721
5720 result->set_length(*len); 5722 result->set_length(*len);
5721 result->set_elements(*storage); 5723 // Please note the storage might have changed in the visitor.
5724 result->set_elements(*visitor.storage());
5722 5725
5723 return *result; 5726 return *result;
5724 } 5727 }
5725 5728
5726 5729
5727 // This will not allocate (flatten the string), but it may run 5730 // This will not allocate (flatten the string), but it may run
5728 // very slowly for very deeply nested ConsStrings. For debugging use only. 5731 // very slowly for very deeply nested ConsStrings. For debugging use only.
5729 static Object* Runtime_GlobalPrint(Arguments args) { 5732 static Object* Runtime_GlobalPrint(Arguments args) {
5730 NoHandleAllocation ha; 5733 NoHandleAllocation ha;
5731 ASSERT(args.length() == 1); 5734 ASSERT(args.length() == 1);
(...skipping 2310 matching lines...) Expand 10 before | Expand all | Expand 10 after
8042 } else { 8045 } else {
8043 // Handle last resort GC and make sure to allow future allocations 8046 // Handle last resort GC and make sure to allow future allocations
8044 // to grow the heap without causing GCs (if possible). 8047 // to grow the heap without causing GCs (if possible).
8045 Counters::gc_last_resort_from_js.Increment(); 8048 Counters::gc_last_resort_from_js.Increment();
8046 Heap::CollectAllGarbage(false); 8049 Heap::CollectAllGarbage(false);
8047 } 8050 }
8048 } 8051 }
8049 8052
8050 8053
8051 } } // namespace v8::internal 8054 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698