OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 if (IsElement()) { | 322 if (IsElement()) { |
323 // TODO(verwaest): Optimize. | 323 // TODO(verwaest): Optimize. |
324 if (holder->IsStringObjectWithCharacterAt(index_)) { | 324 if (holder->IsStringObjectWithCharacterAt(index_)) { |
325 Handle<JSValue> js_value = Handle<JSValue>::cast(holder); | 325 Handle<JSValue> js_value = Handle<JSValue>::cast(holder); |
326 Handle<String> string(String::cast(js_value->value())); | 326 Handle<String> string(String::cast(js_value->value())); |
327 return factory()->LookupSingleCharacterStringFromCode( | 327 return factory()->LookupSingleCharacterStringFromCode( |
328 String::Flatten(string)->Get(index_)); | 328 String::Flatten(string)->Get(index_)); |
329 } | 329 } |
330 | 330 |
331 ElementsAccessor* accessor = holder->GetElementsAccessor(); | 331 ElementsAccessor* accessor = holder->GetElementsAccessor(); |
332 return accessor->Get(holder, index_); | 332 return accessor->Get(handle(holder->elements()), number_); |
333 } else if (holder_map_->IsGlobalObjectMap()) { | 333 } else if (holder_map_->IsGlobalObjectMap()) { |
334 result = holder->global_dictionary()->ValueAt(number_); | 334 result = holder->global_dictionary()->ValueAt(number_); |
335 DCHECK(result->IsPropertyCell()); | 335 DCHECK(result->IsPropertyCell()); |
336 result = PropertyCell::cast(result)->value(); | 336 result = PropertyCell::cast(result)->value(); |
337 } else if (holder_map_->is_dictionary_map()) { | 337 } else if (holder_map_->is_dictionary_map()) { |
338 result = holder->property_dictionary()->ValueAt(number_); | 338 result = holder->property_dictionary()->ValueAt(number_); |
339 } else if (property_details_.type() == v8::internal::DATA) { | 339 } else if (property_details_.type() == v8::internal::DATA) { |
340 FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_); | 340 FieldIndex field_index = FieldIndex::ForDescriptor(*holder_map_, number_); |
341 return JSObject::FastPropertyAt(holder, property_details_.representation(), | 341 return JSObject::FastPropertyAt(holder, property_details_.representation(), |
342 field_index); | 342 field_index); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 case InterceptorState::kSkipNonMasking: | 492 case InterceptorState::kSkipNonMasking: |
493 return true; | 493 return true; |
494 case InterceptorState::kProcessNonMasking: | 494 case InterceptorState::kProcessNonMasking: |
495 return false; | 495 return false; |
496 } | 496 } |
497 } | 497 } |
498 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 498 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
499 } | 499 } |
500 } // namespace internal | 500 } // namespace internal |
501 } // namespace v8 | 501 } // namespace v8 |
OLD | NEW |