OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/ic.h" | 5 #include "src/ic/ic.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 | 1152 |
1153 if (receiver->IsStringWrapper() && | 1153 if (receiver->IsStringWrapper() && |
1154 Name::Equals(isolate()->factory()->length_string(), lookup->name())) { | 1154 Name::Equals(isolate()->factory()->length_string(), lookup->name())) { |
1155 StringLengthStub string_length_stub(isolate()); | 1155 StringLengthStub string_length_stub(isolate()); |
1156 return string_length_stub.GetCode(); | 1156 return string_length_stub.GetCode(); |
1157 } | 1157 } |
1158 | 1158 |
1159 // Use specialized code for getting prototype of functions. | 1159 // Use specialized code for getting prototype of functions. |
1160 if (receiver->IsJSFunction() && | 1160 if (receiver->IsJSFunction() && |
1161 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && | 1161 Name::Equals(isolate()->factory()->prototype_string(), lookup->name()) && |
1162 Handle<JSFunction>::cast(receiver)->should_have_prototype() && | 1162 receiver->IsConstructor() && |
1163 !Handle<JSFunction>::cast(receiver) | 1163 !Handle<JSFunction>::cast(receiver) |
1164 ->map() | 1164 ->map() |
1165 ->has_non_instance_prototype()) { | 1165 ->has_non_instance_prototype()) { |
1166 Handle<Code> stub; | 1166 Handle<Code> stub; |
1167 FunctionPrototypeStub function_prototype_stub(isolate()); | 1167 FunctionPrototypeStub function_prototype_stub(isolate()); |
1168 return function_prototype_stub.GetCode(); | 1168 return function_prototype_stub.GetCode(); |
1169 } | 1169 } |
1170 | 1170 |
1171 Handle<Map> map = receiver_map(); | 1171 Handle<Map> map = receiver_map(); |
1172 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); | 1172 Handle<JSObject> holder = lookup->GetHolder<JSObject>(); |
(...skipping 1947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3120 KeyedLoadICNexus nexus(vector, vector_slot); | 3120 KeyedLoadICNexus nexus(vector, vector_slot); |
3121 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 3121 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
3122 ic.UpdateState(receiver, key); | 3122 ic.UpdateState(receiver, key); |
3123 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 3123 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
3124 } | 3124 } |
3125 | 3125 |
3126 return *result; | 3126 return *result; |
3127 } | 3127 } |
3128 } // namespace internal | 3128 } // namespace internal |
3129 } // namespace v8 | 3129 } // namespace v8 |
OLD | NEW |