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 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3004 | 3004 |
3005 Node* CodeStubAssembler::IsUnseededNumberDictionary(Node* object) { | 3005 Node* CodeStubAssembler::IsUnseededNumberDictionary(Node* object) { |
3006 return WordEqual(LoadMap(object), | 3006 return WordEqual(LoadMap(object), |
3007 LoadRoot(Heap::kUnseededNumberDictionaryMapRootIndex)); | 3007 LoadRoot(Heap::kUnseededNumberDictionaryMapRootIndex)); |
3008 } | 3008 } |
3009 | 3009 |
3010 Node* CodeStubAssembler::IsJSFunction(Node* object) { | 3010 Node* CodeStubAssembler::IsJSFunction(Node* object) { |
3011 return HasInstanceType(object, JS_FUNCTION_TYPE); | 3011 return HasInstanceType(object, JS_FUNCTION_TYPE); |
3012 } | 3012 } |
3013 | 3013 |
3014 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index) { | 3014 Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, |
| 3015 ParameterMode parameter_mode) { |
3015 CSA_ASSERT(this, IsString(string)); | 3016 CSA_ASSERT(this, IsString(string)); |
3016 // Translate the {index} into a Word. | 3017 // Translate the {index} into a Word. |
3017 index = SmiToWord(index); | 3018 index = ParameterToWord(index, parameter_mode); |
3018 | 3019 |
3019 // We may need to loop in case of cons or sliced strings. | 3020 // We may need to loop in case of cons or sliced strings. |
3020 Variable var_index(this, MachineType::PointerRepresentation()); | 3021 Variable var_index(this, MachineType::PointerRepresentation()); |
3021 Variable var_result(this, MachineRepresentation::kWord32); | 3022 Variable var_result(this, MachineRepresentation::kWord32); |
3022 Variable var_string(this, MachineRepresentation::kTagged); | 3023 Variable var_string(this, MachineRepresentation::kTagged); |
3023 Variable* loop_vars[] = {&var_index, &var_string}; | 3024 Variable* loop_vars[] = {&var_index, &var_string}; |
3024 Label done_loop(this, &var_result), loop(this, 2, loop_vars); | 3025 Label done_loop(this, &var_result), loop(this, 2, loop_vars); |
3025 var_string.Bind(string); | 3026 var_string.Bind(string); |
3026 var_index.Bind(index); | 3027 var_index.Bind(index); |
3027 Goto(&loop); | 3028 Goto(&loop); |
(...skipping 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8367 Heap::kUndefinedValueRootIndex); | 8368 Heap::kUndefinedValueRootIndex); |
8368 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, | 8369 StoreObjectFieldRoot(result, PromiseReactionJobInfo::kDebugNameOffset, |
8369 Heap::kUndefinedValueRootIndex); | 8370 Heap::kUndefinedValueRootIndex); |
8370 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, | 8371 StoreObjectFieldNoWriteBarrier(result, PromiseReactionJobInfo::kContextOffset, |
8371 context); | 8372 context); |
8372 return result; | 8373 return result; |
8373 } | 8374 } |
8374 | 8375 |
8375 } // namespace internal | 8376 } // namespace internal |
8376 } // namespace v8 | 8377 } // namespace v8 |
OLD | NEW |