OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/accessors.h" | 9 #include "src/accessors.h" |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 13547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13558 // Check to see if we need to update the length. For now, we make | 13558 // Check to see if we need to update the length. For now, we make |
13559 // sure that the length stays within 32-bits (unsigned). | 13559 // sure that the length stays within 32-bits (unsigned). |
13560 if (index >= old_len && index != 0xffffffff) { | 13560 if (index >= old_len && index != 0xffffffff) { |
13561 Handle<Object> len = array->GetIsolate()->factory()->NewNumber( | 13561 Handle<Object> len = array->GetIsolate()->factory()->NewNumber( |
13562 static_cast<double>(index) + 1); | 13562 static_cast<double>(index) + 1); |
13563 array->set_length(*len); | 13563 array->set_length(*len); |
13564 } | 13564 } |
13565 } | 13565 } |
13566 | 13566 |
13567 | 13567 |
13568 bool JSArray::IsReadOnlyLengthDescriptor(Handle<Map> jsarray_map) { | |
13569 Isolate* isolate = jsarray_map->GetIsolate(); | |
13570 DCHECK(!jsarray_map->is_dictionary_map()); | |
13571 LookupResult lookup(isolate); | |
13572 Handle<Name> length_string = isolate->factory()->length_string(); | |
13573 jsarray_map->LookupDescriptor(*length_string, &lookup); | |
13574 return lookup.IsReadOnly(); | |
13575 } | |
13576 | |
13577 | |
13578 bool JSArray::HasReadOnlyLength(Handle<JSArray> array) { | 13568 bool JSArray::HasReadOnlyLength(Handle<JSArray> array) { |
13579 LookupIterator it(array, array->GetIsolate()->factory()->length_string(), | 13569 LookupIterator it(array, array->GetIsolate()->factory()->length_string(), |
13580 LookupIterator::OWN_SKIP_INTERCEPTOR); | 13570 LookupIterator::OWN_SKIP_INTERCEPTOR); |
13581 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 13571 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
13582 CHECK(it.IsFound()); | 13572 CHECK(it.IsFound()); |
13583 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); | 13573 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); |
13584 return it.IsReadOnly(); | 13574 return it.IsReadOnly(); |
13585 } | 13575 } |
13586 | 13576 |
13587 | 13577 |
(...skipping 3624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17212 CompilationInfo* info) { | 17202 CompilationInfo* info) { |
17213 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( | 17203 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( |
17214 handle(cell->dependent_code(), info->isolate()), | 17204 handle(cell->dependent_code(), info->isolate()), |
17215 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); | 17205 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); |
17216 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 17206 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
17217 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 17207 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
17218 cell, info->zone()); | 17208 cell, info->zone()); |
17219 } | 17209 } |
17220 | 17210 |
17221 } } // namespace v8::internal | 17211 } } // namespace v8::internal |
OLD | NEW |