Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: src/code-stub-assembler.cc

Issue 2599683002: [turbofan] Introduce a dedicated StringCharAt operator. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/compiler/effect-control-linearizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698