| 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 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3148 Word32And(instance_type, Int32Constant(kShortExternalStringMask)), | 3148 Word32And(instance_type, Int32Constant(kShortExternalStringMask)), |
| 3149 Int32Constant(0)); | 3149 Int32Constant(0)); |
| 3150 } | 3150 } |
| 3151 | 3151 |
| 3152 Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) { | 3152 Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) { |
| 3153 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3153 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 3154 return Int32GreaterThanOrEqual(instance_type, | 3154 return Int32GreaterThanOrEqual(instance_type, |
| 3155 Int32Constant(FIRST_JS_RECEIVER_TYPE)); | 3155 Int32Constant(FIRST_JS_RECEIVER_TYPE)); |
| 3156 } | 3156 } |
| 3157 | 3157 |
| 3158 Node* CodeStubAssembler::IsJSReceiver(Node* object) { | |
| 3159 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | |
| 3160 return IsJSReceiverInstanceType(LoadInstanceType(object)); | |
| 3161 } | |
| 3162 | |
| 3163 Node* CodeStubAssembler::IsJSReceiverMap(Node* map) { | 3158 Node* CodeStubAssembler::IsJSReceiverMap(Node* map) { |
| 3164 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | |
| 3165 return IsJSReceiverInstanceType(LoadMapInstanceType(map)); | 3159 return IsJSReceiverInstanceType(LoadMapInstanceType(map)); |
| 3166 } | 3160 } |
| 3167 | 3161 |
| 3162 Node* CodeStubAssembler::IsJSReceiver(Node* object) { |
| 3163 return IsJSReceiverMap(LoadMap(object)); |
| 3164 } |
| 3165 |
| 3166 Node* CodeStubAssembler::IsJSObjectMap(Node* map) { |
| 3167 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
| 3168 CSA_ASSERT(this, IsMap(map)); |
| 3169 return Int32GreaterThanOrEqual(LoadMapInstanceType(map), |
| 3170 Int32Constant(FIRST_JS_OBJECT_TYPE)); |
| 3171 } |
| 3172 |
| 3168 Node* CodeStubAssembler::IsJSObject(Node* object) { | 3173 Node* CodeStubAssembler::IsJSObject(Node* object) { |
| 3169 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | 3174 return IsJSObjectMap(LoadMap(object)); |
| 3170 return Int32GreaterThanOrEqual(LoadInstanceType(object), | |
| 3171 Int32Constant(FIRST_JS_RECEIVER_TYPE)); | |
| 3172 } | 3175 } |
| 3173 | 3176 |
| 3174 Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) { | 3177 Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) { |
| 3175 return Word32Equal(LoadInstanceType(object), | 3178 return Word32Equal(LoadInstanceType(object), |
| 3176 Int32Constant(JS_GLOBAL_PROXY_TYPE)); | 3179 Int32Constant(JS_GLOBAL_PROXY_TYPE)); |
| 3177 } | 3180 } |
| 3178 | 3181 |
| 3179 Node* CodeStubAssembler::IsMap(Node* map) { | 3182 Node* CodeStubAssembler::IsMap(Node* map) { |
| 3180 return HasInstanceType(map, MAP_TYPE); | 3183 return HasInstanceType(map, MAP_TYPE); |
| 3181 } | 3184 } |
| (...skipping 5700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8882 formatted.c_str(), TENURED); | 8885 formatted.c_str(), TENURED); |
| 8883 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8886 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
| 8884 HeapConstant(string)); | 8887 HeapConstant(string)); |
| 8885 } | 8888 } |
| 8886 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8889 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
| 8887 #endif | 8890 #endif |
| 8888 } | 8891 } |
| 8889 | 8892 |
| 8890 } // namespace internal | 8893 } // namespace internal |
| 8891 } // namespace v8 | 8894 } // namespace v8 |
| OLD | NEW |