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 3136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3147 Int32LessThanOrEqual(instance_type, | 3147 Int32LessThanOrEqual(instance_type, |
3148 Int32Constant(LAST_FIXED_TYPED_ARRAY_TYPE))); | 3148 Int32Constant(LAST_FIXED_TYPED_ARRAY_TYPE))); |
3149 } | 3149 } |
3150 | 3150 |
3151 Node* CodeStubAssembler::IsJSRegExp(Node* object) { | 3151 Node* CodeStubAssembler::IsJSRegExp(Node* object) { |
3152 return HasInstanceType(object, JS_REGEXP_TYPE); | 3152 return HasInstanceType(object, JS_REGEXP_TYPE); |
3153 } | 3153 } |
3154 | 3154 |
3155 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, | 3155 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, |
3156 ParameterMode parameter_mode) { | 3156 ParameterMode parameter_mode) { |
| 3157 if (parameter_mode == SMI_PARAMETERS) CSA_ASSERT(this, TaggedIsSmi(index)); |
3157 CSA_ASSERT(this, IsString(string)); | 3158 CSA_ASSERT(this, IsString(string)); |
3158 | 3159 |
3159 // Translate the {index} into a Word. | 3160 // Translate the {index} into a Word. |
3160 Node* const int_index = ParameterToWord(index, parameter_mode); | 3161 Node* const int_index = ParameterToWord(index, parameter_mode); |
| 3162 CSA_ASSERT(this, IntPtrGreaterThanOrEqual(int_index, IntPtrConstant(0))); |
3161 | 3163 |
3162 VARIABLE(var_result, MachineRepresentation::kWord32); | 3164 VARIABLE(var_result, MachineRepresentation::kWord32); |
3163 | 3165 |
3164 Label out(this, &var_result), runtime_generic(this), runtime_external(this); | 3166 Label out(this, &var_result), runtime_generic(this), runtime_external(this); |
3165 | 3167 |
3166 ToDirectStringAssembler to_direct(state(), string); | 3168 ToDirectStringAssembler to_direct(state(), string); |
3167 Node* const direct_string = to_direct.TryToDirect(&runtime_generic); | 3169 Node* const direct_string = to_direct.TryToDirect(&runtime_generic); |
3168 Node* const offset = IntPtrAdd(int_index, to_direct.offset()); | 3170 Node* const offset = IntPtrAdd(int_index, to_direct.offset()); |
3169 Node* const instance_type = to_direct.instance_type(); | 3171 Node* const instance_type = to_direct.instance_type(); |
3170 | 3172 |
(...skipping 5338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8509 formatted.c_str(), TENURED); | 8511 formatted.c_str(), TENURED); |
8510 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), | 8512 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), |
8511 HeapConstant(string)); | 8513 HeapConstant(string)); |
8512 } | 8514 } |
8513 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); | 8515 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); |
8514 #endif | 8516 #endif |
8515 } | 8517 } |
8516 | 8518 |
8517 } // namespace internal | 8519 } // namespace internal |
8518 } // namespace v8 | 8520 } // namespace v8 |
OLD | NEW |