| 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 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3169 Word32And(instance_type, Int32Constant(kShortExternalStringMask)), | 3169 Word32And(instance_type, Int32Constant(kShortExternalStringMask)), |
| 3170 Int32Constant(0)); | 3170 Int32Constant(0)); |
| 3171 } | 3171 } |
| 3172 | 3172 |
| 3173 Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) { | 3173 Node* CodeStubAssembler::IsJSReceiverInstanceType(Node* instance_type) { |
| 3174 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); | 3174 STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
| 3175 return Int32GreaterThanOrEqual(instance_type, | 3175 return Int32GreaterThanOrEqual(instance_type, |
| 3176 Int32Constant(FIRST_JS_RECEIVER_TYPE)); | 3176 Int32Constant(FIRST_JS_RECEIVER_TYPE)); |
| 3177 } | 3177 } |
| 3178 | 3178 |
| 3179 Node* CodeStubAssembler::IsJSReceiver(Node* object) { | |
| 3180 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | |
| 3181 return IsJSReceiverInstanceType(LoadInstanceType(object)); | |
| 3182 } | |
| 3183 | |
| 3184 Node* CodeStubAssembler::IsJSReceiverMap(Node* map) { | 3179 Node* CodeStubAssembler::IsJSReceiverMap(Node* map) { |
| 3185 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | |
| 3186 return IsJSReceiverInstanceType(LoadMapInstanceType(map)); | 3180 return IsJSReceiverInstanceType(LoadMapInstanceType(map)); |
| 3187 } | 3181 } |
| 3188 | 3182 |
| 3183 Node* CodeStubAssembler::IsJSReceiver(Node* object) { |
| 3184 return IsJSReceiverMap(LoadMap(object)); |
| 3185 } |
| 3186 |
| 3187 Node* CodeStubAssembler::IsJSObjectMap(Node* map) { |
| 3188 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); |
| 3189 CSA_ASSERT(this, IsMap(map)); |
| 3190 return Int32GreaterThanOrEqual(LoadMapInstanceType(map), |
| 3191 Int32Constant(FIRST_JS_OBJECT_TYPE)); |
| 3192 } |
| 3193 |
| 3189 Node* CodeStubAssembler::IsJSObject(Node* object) { | 3194 Node* CodeStubAssembler::IsJSObject(Node* object) { |
| 3190 STATIC_ASSERT(LAST_JS_OBJECT_TYPE == LAST_TYPE); | 3195 return IsJSObjectMap(LoadMap(object)); |
| 3191 return Int32GreaterThanOrEqual(LoadInstanceType(object), | |
| 3192 Int32Constant(FIRST_JS_RECEIVER_TYPE)); | |
| 3193 } | 3196 } |
| 3194 | 3197 |
| 3195 Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) { | 3198 Node* CodeStubAssembler::IsJSGlobalProxy(Node* object) { |
| 3196 return Word32Equal(LoadInstanceType(object), | 3199 return Word32Equal(LoadInstanceType(object), |
| 3197 Int32Constant(JS_GLOBAL_PROXY_TYPE)); | 3200 Int32Constant(JS_GLOBAL_PROXY_TYPE)); |
| 3198 } | 3201 } |
| 3199 | 3202 |
| 3200 Node* CodeStubAssembler::IsMap(Node* map) { | 3203 Node* CodeStubAssembler::IsMap(Node* map) { |
| 3201 return HasInstanceType(map, MAP_TYPE); | 3204 return HasInstanceType(map, MAP_TYPE); |
| 3202 } | 3205 } |
| (...skipping 5987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9190 formatted.c_str(), TENURED); | 9193 formatted.c_str(), TENURED); |
| 9191 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 9194 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
| 9192 HeapConstant(string)); | 9195 HeapConstant(string)); |
| 9193 } | 9196 } |
| 9194 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 9197 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
| 9195 #endif | 9198 #endif |
| 9196 } | 9199 } |
| 9197 | 9200 |
| 9198 } // namespace internal | 9201 } // namespace internal |
| 9199 } // namespace v8 | 9202 } // namespace v8 |
| OLD | NEW |