OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/ic/accessor-assembler.h" | 5 #include "src/ic/accessor-assembler.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/ic/handler-configuration.h" | 10 #include "src/ic/handler-configuration.h" |
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 Comment("KeyedLoadIC_miss"); | 2083 Comment("KeyedLoadIC_miss"); |
2084 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, | 2084 TailCallRuntime(Runtime::kKeyedLoadIC_Miss, p->context, p->receiver, |
2085 p->name, p->slot, p->vector); | 2085 p->name, p->slot, p->vector); |
2086 } | 2086 } |
2087 } | 2087 } |
2088 | 2088 |
2089 void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) { | 2089 void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) { |
2090 VARIABLE(var_index, MachineType::PointerRepresentation()); | 2090 VARIABLE(var_index, MachineType::PointerRepresentation()); |
2091 VARIABLE(var_unique, MachineRepresentation::kTagged); | 2091 VARIABLE(var_unique, MachineRepresentation::kTagged); |
2092 var_unique.Bind(p->name); // Dummy initialization. | 2092 var_unique.Bind(p->name); // Dummy initialization. |
2093 Label if_index(this), if_unique_name(this), slow(this); | 2093 Label if_index(this), if_unique_name(this), if_notunique(this), slow(this); |
2094 | 2094 |
2095 Node* receiver = p->receiver; | 2095 Node* receiver = p->receiver; |
2096 GotoIf(TaggedIsSmi(receiver), &slow); | 2096 GotoIf(TaggedIsSmi(receiver), &slow); |
2097 Node* receiver_map = LoadMap(receiver); | 2097 Node* receiver_map = LoadMap(receiver); |
2098 Node* instance_type = LoadMapInstanceType(receiver_map); | 2098 Node* instance_type = LoadMapInstanceType(receiver_map); |
2099 | 2099 |
2100 TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, | 2100 TryToName(p->name, &if_index, &var_index, &if_unique_name, &var_unique, &slow, |
2101 &slow); | 2101 &if_notunique); |
2102 | 2102 |
2103 BIND(&if_index); | 2103 BIND(&if_index); |
2104 { | 2104 { |
2105 GenericElementLoad(receiver, receiver_map, instance_type, var_index.value(), | 2105 GenericElementLoad(receiver, receiver_map, instance_type, var_index.value(), |
2106 &slow); | 2106 &slow); |
2107 } | 2107 } |
2108 | 2108 |
2109 BIND(&if_unique_name); | 2109 BIND(&if_unique_name); |
2110 { | 2110 { |
2111 GenericPropertyLoad(receiver, receiver_map, instance_type, | 2111 GenericPropertyLoad(receiver, receiver_map, instance_type, |
2112 var_unique.value(), p, &slow); | 2112 var_unique.value(), p, &slow); |
2113 } | 2113 } |
2114 | 2114 |
| 2115 BIND(&if_notunique); |
| 2116 { |
| 2117 if (FLAG_internalize_on_the_fly) { |
| 2118 Label not_in_string_table(this); |
| 2119 TryInternalizeString(p->name, &if_index, &var_index, &if_unique_name, |
| 2120 &var_unique, ¬_in_string_table, &slow); |
| 2121 |
| 2122 BIND(¬_in_string_table); |
| 2123 // If the string was not found in the string table, then no object can |
| 2124 // have a property with that name. |
| 2125 Return(UndefinedConstant()); |
| 2126 } else { |
| 2127 Goto(&slow); |
| 2128 } |
| 2129 } |
| 2130 |
2115 BIND(&slow); | 2131 BIND(&slow); |
2116 { | 2132 { |
2117 Comment("KeyedLoadGeneric_slow"); | 2133 Comment("KeyedLoadGeneric_slow"); |
2118 IncrementCounter(isolate()->counters()->ic_keyed_load_generic_slow(), 1); | 2134 IncrementCounter(isolate()->counters()->ic_keyed_load_generic_slow(), 1); |
2119 // TODO(jkummerow): Should we use the GetProperty TF stub instead? | 2135 // TODO(jkummerow): Should we use the GetProperty TF stub instead? |
2120 TailCallRuntime(Runtime::kKeyedGetProperty, p->context, p->receiver, | 2136 TailCallRuntime(Runtime::kKeyedGetProperty, p->context, p->receiver, |
2121 p->name); | 2137 p->name); |
2122 } | 2138 } |
2123 } | 2139 } |
2124 | 2140 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 Node* context = Parameter(Descriptor::kContext); | 2489 Node* context = Parameter(Descriptor::kContext); |
2474 Node* vector = LoadFeedbackVectorForStub(); | 2490 Node* vector = LoadFeedbackVectorForStub(); |
2475 | 2491 |
2476 Callable callable = | 2492 Callable callable = |
2477 CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode); | 2493 CodeFactory::KeyedStoreICInOptimizedCode(isolate(), language_mode); |
2478 TailCallStub(callable, context, receiver, name, value, slot, vector); | 2494 TailCallStub(callable, context, receiver, name, value, slot, vector); |
2479 } | 2495 } |
2480 | 2496 |
2481 } // namespace internal | 2497 } // namespace internal |
2482 } // namespace v8 | 2498 } // namespace v8 |
OLD | NEW |