OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 11261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11272 | 11272 |
11273 | 11273 |
11274 // static | 11274 // static |
11275 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { | 11275 void JSArray::Initialize(Handle<JSArray> array, int capacity, int length) { |
11276 ASSERT(capacity >= 0); | 11276 ASSERT(capacity >= 0); |
11277 array->GetIsolate()->factory()->NewJSArrayStorage( | 11277 array->GetIsolate()->factory()->NewJSArrayStorage( |
11278 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); | 11278 array, length, capacity, INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE); |
11279 } | 11279 } |
11280 | 11280 |
11281 | 11281 |
11282 void JSArray::Expand(int required_size) { | 11282 void JSArray::Expand(Handle<JSArray> array, int required_size) { |
11283 GetIsolate()->factory()->SetElementsCapacityAndLength( | 11283 ElementsAccessor* accessor = array->GetElementsAccessor(); |
11284 Handle<JSArray>(this), required_size, required_size); | 11284 accessor->SetCapacityAndLength(array, required_size, required_size); |
11285 } | 11285 } |
11286 | 11286 |
11287 | 11287 |
11288 // Returns false if the passed-in index is marked non-configurable, | 11288 // Returns false if the passed-in index is marked non-configurable, |
11289 // which will cause the ES5 truncation operation to halt, and thus | 11289 // which will cause the ES5 truncation operation to halt, and thus |
11290 // no further old values need be collected. | 11290 // no further old values need be collected. |
11291 static bool GetOldValue(Isolate* isolate, | 11291 static bool GetOldValue(Isolate* isolate, |
11292 Handle<JSObject> object, | 11292 Handle<JSObject> object, |
11293 uint32_t index, | 11293 uint32_t index, |
11294 List<Handle<Object> >* old_values, | 11294 List<Handle<Object> >* old_values, |
(...skipping 5124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16419 #define ERROR_MESSAGES_TEXTS(C, T) T, | 16419 #define ERROR_MESSAGES_TEXTS(C, T) T, |
16420 static const char* error_messages_[] = { | 16420 static const char* error_messages_[] = { |
16421 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) | 16421 ERROR_MESSAGES_LIST(ERROR_MESSAGES_TEXTS) |
16422 }; | 16422 }; |
16423 #undef ERROR_MESSAGES_TEXTS | 16423 #undef ERROR_MESSAGES_TEXTS |
16424 return error_messages_[reason]; | 16424 return error_messages_[reason]; |
16425 } | 16425 } |
16426 | 16426 |
16427 | 16427 |
16428 } } // namespace v8::internal | 16428 } } // namespace v8::internal |
OLD | NEW |