OLD | NEW |
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 9961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9972 // getters on the arrays increasing the length of later arrays | 9972 // getters on the arrays increasing the length of later arrays |
9973 // during iteration. | 9973 // during iteration. |
9974 // This shouldn't happen in anything but pathological cases. | 9974 // This shouldn't happen in anything but pathological cases. |
9975 SetDictionaryMode(index); | 9975 SetDictionaryMode(index); |
9976 // Fall-through to dictionary mode. | 9976 // Fall-through to dictionary mode. |
9977 } | 9977 } |
9978 ASSERT(!fast_elements_); | 9978 ASSERT(!fast_elements_); |
9979 Handle<SeededNumberDictionary> dict( | 9979 Handle<SeededNumberDictionary> dict( |
9980 SeededNumberDictionary::cast(*storage_)); | 9980 SeededNumberDictionary::cast(*storage_)); |
9981 Handle<SeededNumberDictionary> result = | 9981 Handle<SeededNumberDictionary> result = |
9982 isolate_->factory()->DictionaryAtNumberPut(dict, index, elm); | 9982 SeededNumberDictionary::AtNumberPut(dict, index, elm); |
9983 if (!result.is_identical_to(dict)) { | 9983 if (!result.is_identical_to(dict)) { |
9984 // Dictionary needed to grow. | 9984 // Dictionary needed to grow. |
9985 clear_storage(); | 9985 clear_storage(); |
9986 set_storage(*result); | 9986 set_storage(*result); |
9987 } | 9987 } |
9988 } | 9988 } |
9989 | 9989 |
9990 void increase_index_offset(uint32_t delta) { | 9990 void increase_index_offset(uint32_t delta) { |
9991 if (JSObject::kMaxElementCount - index_offset_ < delta) { | 9991 if (JSObject::kMaxElementCount - index_offset_ < delta) { |
9992 index_offset_ = JSObject::kMaxElementCount; | 9992 index_offset_ = JSObject::kMaxElementCount; |
(...skipping 29 matching lines...) Expand all Loading... |
10022 Handle<FixedArray> current_storage(*storage_); | 10022 Handle<FixedArray> current_storage(*storage_); |
10023 Handle<SeededNumberDictionary> slow_storage( | 10023 Handle<SeededNumberDictionary> slow_storage( |
10024 isolate_->factory()->NewSeededNumberDictionary( | 10024 isolate_->factory()->NewSeededNumberDictionary( |
10025 current_storage->length())); | 10025 current_storage->length())); |
10026 uint32_t current_length = static_cast<uint32_t>(current_storage->length()); | 10026 uint32_t current_length = static_cast<uint32_t>(current_storage->length()); |
10027 for (uint32_t i = 0; i < current_length; i++) { | 10027 for (uint32_t i = 0; i < current_length; i++) { |
10028 HandleScope loop_scope(isolate_); | 10028 HandleScope loop_scope(isolate_); |
10029 Handle<Object> element(current_storage->get(i), isolate_); | 10029 Handle<Object> element(current_storage->get(i), isolate_); |
10030 if (!element->IsTheHole()) { | 10030 if (!element->IsTheHole()) { |
10031 Handle<SeededNumberDictionary> new_storage = | 10031 Handle<SeededNumberDictionary> new_storage = |
10032 isolate_->factory()->DictionaryAtNumberPut(slow_storage, i, element); | 10032 SeededNumberDictionary::AtNumberPut(slow_storage, i, element); |
10033 if (!new_storage.is_identical_to(slow_storage)) { | 10033 if (!new_storage.is_identical_to(slow_storage)) { |
10034 slow_storage = loop_scope.CloseAndEscape(new_storage); | 10034 slow_storage = loop_scope.CloseAndEscape(new_storage); |
10035 } | 10035 } |
10036 } | 10036 } |
10037 } | 10037 } |
10038 clear_storage(); | 10038 clear_storage(); |
10039 set_storage(*slow_storage); | 10039 set_storage(*slow_storage); |
10040 fast_elements_ = false; | 10040 fast_elements_ = false; |
10041 } | 10041 } |
10042 | 10042 |
(...skipping 5076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15119 } | 15119 } |
15120 return NULL; | 15120 return NULL; |
15121 } | 15121 } |
15122 | 15122 |
15123 | 15123 |
15124 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15124 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15125 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15125 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15126 } | 15126 } |
15127 | 15127 |
15128 } } // namespace v8::internal | 15128 } } // namespace v8::internal |
OLD | NEW |