OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 10041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10052 void increase_index_offset(uint32_t delta) { | 10052 void increase_index_offset(uint32_t delta) { |
10053 if (JSObject::kMaxElementCount - index_offset_ < delta) { | 10053 if (JSObject::kMaxElementCount - index_offset_ < delta) { |
10054 index_offset_ = JSObject::kMaxElementCount; | 10054 index_offset_ = JSObject::kMaxElementCount; |
10055 } else { | 10055 } else { |
10056 index_offset_ += delta; | 10056 index_offset_ += delta; |
10057 } | 10057 } |
10058 // If the initial length estimate was off (see special case in visit()), | 10058 // If the initial length estimate was off (see special case in visit()), |
10059 // but the array blowing the limit didn't contain elements beyond the | 10059 // but the array blowing the limit didn't contain elements beyond the |
10060 // provided-for index range, go to dictionary mode now. | 10060 // provided-for index range, go to dictionary mode now. |
10061 if (fast_elements_ && | 10061 if (fast_elements_ && |
10062 index_offset_ >= static_cast<uint32_t>( | 10062 index_offset_ > |
10063 FixedArrayBase::cast(*storage_)->length())) { | 10063 static_cast<uint32_t>(FixedArrayBase::cast(*storage_)->length())) { |
10064 SetDictionaryMode(); | 10064 SetDictionaryMode(); |
10065 } | 10065 } |
10066 } | 10066 } |
10067 | 10067 |
10068 bool exceeds_array_limit() { | 10068 bool exceeds_array_limit() { |
10069 return exceeds_array_limit_; | 10069 return exceeds_array_limit_; |
10070 } | 10070 } |
10071 | 10071 |
10072 Handle<JSArray> ToArray() { | 10072 Handle<JSArray> ToArray() { |
10073 Handle<JSArray> array = isolate_->factory()->NewJSArray(0); | 10073 Handle<JSArray> array = isolate_->factory()->NewJSArray(0); |
(...skipping 5147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15221 } | 15221 } |
15222 return NULL; | 15222 return NULL; |
15223 } | 15223 } |
15224 | 15224 |
15225 | 15225 |
15226 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15226 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
15227 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15227 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
15228 } | 15228 } |
15229 | 15229 |
15230 } } // namespace v8::internal | 15230 } } // namespace v8::internal |
OLD | NEW |