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 "src/crankshaft/hydrogen.h" | 5 #include "src/crankshaft/hydrogen.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/allocation-site-scopes.h" | 10 #include "src/allocation-site-scopes.h" |
(...skipping 11191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11202 } | 11202 } |
11203 | 11203 |
11204 if (op == Token::INSTANCEOF) { | 11204 if (op == Token::INSTANCEOF) { |
11205 // Check to see if the rhs of the instanceof is a known function. | 11205 // Check to see if the rhs of the instanceof is a known function. |
11206 if (right->IsConstant() && | 11206 if (right->IsConstant() && |
11207 HConstant::cast(right)->handle(isolate())->IsJSFunction()) { | 11207 HConstant::cast(right)->handle(isolate())->IsJSFunction()) { |
11208 Handle<JSFunction> function = | 11208 Handle<JSFunction> function = |
11209 Handle<JSFunction>::cast(HConstant::cast(right)->handle(isolate())); | 11209 Handle<JSFunction>::cast(HConstant::cast(right)->handle(isolate())); |
11210 // Make sure that the {function} already has a meaningful initial map | 11210 // Make sure that the {function} already has a meaningful initial map |
11211 // (i.e. we constructed at least one instance using the constructor | 11211 // (i.e. we constructed at least one instance using the constructor |
11212 // {function}). | 11212 // {function}), and has an instance as .prototype. |
11213 if (function->has_initial_map()) { | 11213 if (function->has_initial_map() && |
| 11214 !function->map()->has_non_instance_prototype()) { |
11214 // Lookup @@hasInstance on the {function}. | 11215 // Lookup @@hasInstance on the {function}. |
11215 Handle<Map> function_map(function->map(), isolate()); | 11216 Handle<Map> function_map(function->map(), isolate()); |
11216 PropertyAccessInfo has_instance( | 11217 PropertyAccessInfo has_instance( |
11217 this, LOAD, function_map, | 11218 this, LOAD, function_map, |
11218 isolate()->factory()->has_instance_symbol()); | 11219 isolate()->factory()->has_instance_symbol()); |
11219 // Check if we are using the Function.prototype[@@hasInstance]. | 11220 // Check if we are using the Function.prototype[@@hasInstance]. |
11220 if (has_instance.CanAccessMonomorphic() && | 11221 if (has_instance.CanAccessMonomorphic() && |
11221 has_instance.IsDataConstant() && | 11222 has_instance.IsDataConstant() && |
11222 has_instance.constant().is_identical_to( | 11223 has_instance.constant().is_identical_to( |
11223 isolate()->function_has_instance())) { | 11224 isolate()->function_has_instance())) { |
(...skipping 1799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13023 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 13024 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
13024 } | 13025 } |
13025 | 13026 |
13026 #ifdef DEBUG | 13027 #ifdef DEBUG |
13027 graph_->Verify(false); // No full verify. | 13028 graph_->Verify(false); // No full verify. |
13028 #endif | 13029 #endif |
13029 } | 13030 } |
13030 | 13031 |
13031 } // namespace internal | 13032 } // namespace internal |
13032 } // namespace v8 | 13033 } // namespace v8 |
OLD | NEW |