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 #include "src/code-stub-assembler.h" | 4 #include "src/code-stub-assembler.h" |
5 #include "src/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/frames-inl.h" | 6 #include "src/frames-inl.h" |
7 #include "src/frames.h" | 7 #include "src/frames.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 7905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7916 Label if_notcallable(this, Label::kDeferred), | 7916 Label if_notcallable(this, Label::kDeferred), |
7917 if_notreceiver(this, Label::kDeferred), if_otherhandler(this), | 7917 if_notreceiver(this, Label::kDeferred), if_otherhandler(this), |
7918 if_nohandler(this, Label::kDeferred), return_true(this), | 7918 if_nohandler(this, Label::kDeferred), return_true(this), |
7919 return_false(this), return_result(this, &var_result); | 7919 return_false(this), return_result(this, &var_result); |
7920 | 7920 |
7921 // Ensure that the {callable} is actually a JSReceiver. | 7921 // Ensure that the {callable} is actually a JSReceiver. |
7922 GotoIf(TaggedIsSmi(callable), &if_notreceiver); | 7922 GotoIf(TaggedIsSmi(callable), &if_notreceiver); |
7923 GotoIfNot(IsJSReceiver(callable), &if_notreceiver); | 7923 GotoIfNot(IsJSReceiver(callable), &if_notreceiver); |
7924 | 7924 |
7925 // Load the @@hasInstance property from {callable}. | 7925 // Load the @@hasInstance property from {callable}. |
7926 Node* inst_of_handler = CallStub(CodeFactory::GetProperty(isolate()), context, | 7926 Node* inst_of_handler = |
7927 callable, HasInstanceSymbolConstant()); | 7927 GetProperty(context, callable, HasInstanceSymbolConstant()); |
7928 | 7928 |
7929 // Optimize for the likely case where {inst_of_handler} is the builtin | 7929 // Optimize for the likely case where {inst_of_handler} is the builtin |
7930 // Function.prototype[@@hasInstance] method, and emit a direct call in | 7930 // Function.prototype[@@hasInstance] method, and emit a direct call in |
7931 // that case without any additional checking. | 7931 // that case without any additional checking. |
7932 Node* native_context = LoadNativeContext(context); | 7932 Node* native_context = LoadNativeContext(context); |
7933 Node* function_has_instance = | 7933 Node* function_has_instance = |
7934 LoadContextElement(native_context, Context::FUNCTION_HAS_INSTANCE_INDEX); | 7934 LoadContextElement(native_context, Context::FUNCTION_HAS_INSTANCE_INDEX); |
7935 GotoIfNot(WordEqual(inst_of_handler, function_has_instance), | 7935 GotoIfNot(WordEqual(inst_of_handler, function_has_instance), |
7936 &if_otherhandler); | 7936 &if_otherhandler); |
7937 { | 7937 { |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8463 formatted.c_str(), TENURED); | 8463 formatted.c_str(), TENURED); |
8464 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8464 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8465 HeapConstant(string)); | 8465 HeapConstant(string)); |
8466 } | 8466 } |
8467 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8467 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8468 #endif | 8468 #endif |
8469 } | 8469 } |
8470 | 8470 |
8471 } // namespace internal | 8471 } // namespace internal |
8472 } // namespace v8 | 8472 } // namespace v8 |
OLD | NEW |