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

Side by Side Diff: src/runtime.cc

Issue 207553005: TransitionElementsKind() and its recursive call chain handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing review notes Created 6 years, 9 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') | test/cctest/test-api.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 10007 matching lines...) Expand 10 before | Expand all | Expand 10 after
10018 bool exceeds_array_limit() { 10018 bool exceeds_array_limit() {
10019 return exceeds_array_limit_; 10019 return exceeds_array_limit_;
10020 } 10020 }
10021 10021
10022 Handle<JSArray> ToArray() { 10022 Handle<JSArray> ToArray() {
10023 Handle<JSArray> array = isolate_->factory()->NewJSArray(0); 10023 Handle<JSArray> array = isolate_->factory()->NewJSArray(0);
10024 Handle<Object> length = 10024 Handle<Object> length =
10025 isolate_->factory()->NewNumber(static_cast<double>(index_offset_)); 10025 isolate_->factory()->NewNumber(static_cast<double>(index_offset_));
10026 Handle<Map> map; 10026 Handle<Map> map;
10027 if (fast_elements_) { 10027 if (fast_elements_) {
10028 map = isolate_->factory()->GetElementsTransitionMap(array, 10028 map = JSObject::GetElementsTransitionMap(array, FAST_HOLEY_ELEMENTS);
10029 FAST_HOLEY_ELEMENTS);
10030 } else { 10029 } else {
10031 map = isolate_->factory()->GetElementsTransitionMap(array, 10030 map = JSObject::GetElementsTransitionMap(array, DICTIONARY_ELEMENTS);
10032 DICTIONARY_ELEMENTS);
10033 } 10031 }
10034 array->set_map(*map); 10032 array->set_map(*map);
10035 array->set_length(*length); 10033 array->set_length(*length);
10036 array->set_elements(*storage_); 10034 array->set_elements(*storage_);
10037 return array; 10035 return array;
10038 } 10036 }
10039 10037
10040 private: 10038 private:
10041 // Convert storage to dictionary mode. 10039 // Convert storage to dictionary mode.
10042 void SetDictionaryMode(uint32_t index) { 10040 void SetDictionaryMode(uint32_t index) {
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
10556 break; 10554 break;
10557 default: 10555 default:
10558 UNREACHABLE(); 10556 UNREACHABLE();
10559 } 10557 }
10560 } 10558 }
10561 if (failure) break; 10559 if (failure) break;
10562 } 10560 }
10563 Handle<JSArray> array = isolate->factory()->NewJSArray(0); 10561 Handle<JSArray> array = isolate->factory()->NewJSArray(0);
10564 Smi* length = Smi::FromInt(j); 10562 Smi* length = Smi::FromInt(j);
10565 Handle<Map> map; 10563 Handle<Map> map;
10566 map = isolate->factory()->GetElementsTransitionMap(array, kind); 10564 map = JSObject::GetElementsTransitionMap(array, kind);
10567 array->set_map(*map); 10565 array->set_map(*map);
10568 array->set_length(length); 10566 array->set_length(length);
10569 array->set_elements(*double_storage); 10567 array->set_elements(*double_storage);
10570 return *array; 10568 return *array;
10571 } 10569 }
10572 // The backing storage array must have non-existing elements to preserve 10570 // The backing storage array must have non-existing elements to preserve
10573 // holes across concat operations. 10571 // holes across concat operations.
10574 storage = isolate->factory()->NewFixedArrayWithHoles( 10572 storage = isolate->factory()->NewFixedArrayWithHoles(
10575 estimate_result_length); 10573 estimate_result_length);
10576 } else { 10574 } else {
(...skipping 4547 matching lines...) Expand 10 before | Expand all | Expand 10 after
15124 // Handle last resort GC and make sure to allow future allocations 15122 // Handle last resort GC and make sure to allow future allocations
15125 // to grow the heap without causing GCs (if possible). 15123 // to grow the heap without causing GCs (if possible).
15126 isolate->counters()->gc_last_resort_from_js()->Increment(); 15124 isolate->counters()->gc_last_resort_from_js()->Increment();
15127 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, 15125 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags,
15128 "Runtime::PerformGC"); 15126 "Runtime::PerformGC");
15129 } 15127 }
15130 } 15128 }
15131 15129
15132 15130
15133 } } // namespace v8::internal 15131 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698