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/ic/handler-compiler.h" | 7 #include "src/ic/handler-compiler.h" |
8 #include "src/ic/ic-inl.h" | 8 #include "src/ic/ic-inl.h" |
9 #include "src/ic/ic-compiler.h" | 9 #include "src/ic/ic-compiler.h" |
10 | 10 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC); | 89 Code::Flags flags = Code::ComputeMonomorphicFlags(Code::KEYED_LOAD_IC); |
90 Handle<Name> name = isolate->factory()->KeyedLoadMonomorphic_string(); | 90 Handle<Name> name = isolate->factory()->KeyedLoadMonomorphic_string(); |
91 | 91 |
92 Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate); | 92 Handle<Object> probe(receiver_map->FindInCodeCache(*name, flags), isolate); |
93 if (probe->IsCode()) return Handle<Code>::cast(probe); | 93 if (probe->IsCode()) return Handle<Code>::cast(probe); |
94 | 94 |
95 ElementsKind elements_kind = receiver_map->elements_kind(); | 95 ElementsKind elements_kind = receiver_map->elements_kind(); |
96 Handle<Code> stub; | 96 Handle<Code> stub; |
97 if (receiver_map->has_indexed_interceptor()) { | 97 if (receiver_map->has_indexed_interceptor()) { |
98 stub = LoadIndexedInterceptorStub(isolate).GetCode(); | 98 stub = LoadIndexedInterceptorStub(isolate).GetCode(); |
| 99 } else if (receiver_map->IsStringMap()) { |
| 100 // We have a string. |
| 101 stub = LoadIndexedStringStub(isolate).GetCode(); |
99 } else if (receiver_map->has_sloppy_arguments_elements()) { | 102 } else if (receiver_map->has_sloppy_arguments_elements()) { |
100 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); | 103 stub = KeyedLoadSloppyArgumentsStub(isolate).GetCode(); |
101 } else if (receiver_map->has_fast_elements() || | 104 } else if (receiver_map->has_fast_elements() || |
102 receiver_map->has_external_array_elements() || | 105 receiver_map->has_external_array_elements() || |
103 receiver_map->has_fixed_typed_array_elements()) { | 106 receiver_map->has_fixed_typed_array_elements()) { |
104 stub = LoadFastElementStub(isolate, | 107 stub = LoadFastElementStub(isolate, |
105 receiver_map->instance_type() == JS_ARRAY_TYPE, | 108 receiver_map->instance_type() == JS_ARRAY_TYPE, |
106 elements_kind).GetCode(); | 109 elements_kind).GetCode(); |
107 } else { | 110 } else { |
108 stub = LoadDictionaryElementStub(isolate).GetCode(); | 111 stub = LoadDictionaryElementStub(isolate).GetCode(); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 441 |
439 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); | 442 TailCallBuiltin(masm(), Builtins::kKeyedStoreIC_Miss); |
440 | 443 |
441 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); | 444 return GetCode(kind(), Code::NORMAL, factory()->empty_string()); |
442 } | 445 } |
443 | 446 |
444 | 447 |
445 #undef __ | 448 #undef __ |
446 } | 449 } |
447 } // namespace v8::internal | 450 } // namespace v8::internal |
OLD | NEW |