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 2813843002: [string] Add a fast path to String.p.replace (Closed)
Patch Set: Don't scan twice Created 3 years, 8 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/objects.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 2991 matching lines...) Expand 10 before | Expand all | Expand 10 after
3002 Int32Constant(kOneByteStringTag)); 3002 Int32Constant(kOneByteStringTag));
3003 } 3003 }
3004 3004
3005 Node* CodeStubAssembler::IsSequentialStringInstanceType(Node* instance_type) { 3005 Node* CodeStubAssembler::IsSequentialStringInstanceType(Node* instance_type) {
3006 CSA_ASSERT(this, IsStringInstanceType(instance_type)); 3006 CSA_ASSERT(this, IsStringInstanceType(instance_type));
3007 return Word32Equal( 3007 return Word32Equal(
3008 Word32And(instance_type, Int32Constant(kStringRepresentationMask)), 3008 Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
3009 Int32Constant(kSeqStringTag)); 3009 Int32Constant(kSeqStringTag));
3010 } 3010 }
3011 3011
3012 Node* CodeStubAssembler::IsConsStringInstanceType(Node* instance_type) {
3013 CSA_ASSERT(this, IsStringInstanceType(instance_type));
3014 return Word32Equal(
3015 Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
3016 Int32Constant(kConsStringTag));
3017 }
3018
3012 Node* CodeStubAssembler::IsExternalStringInstanceType(Node* instance_type) { 3019 Node* CodeStubAssembler::IsExternalStringInstanceType(Node* instance_type) {
3013 CSA_ASSERT(this, IsStringInstanceType(instance_type)); 3020 CSA_ASSERT(this, IsStringInstanceType(instance_type));
3014 return Word32Equal( 3021 return Word32Equal(
3015 Word32And(instance_type, Int32Constant(kStringRepresentationMask)), 3022 Word32And(instance_type, Int32Constant(kStringRepresentationMask)),
3016 Int32Constant(kExternalStringTag)); 3023 Int32Constant(kExternalStringTag));
3017 } 3024 }
3018 3025
3019 Node* CodeStubAssembler::IsShortExternalStringInstanceType( 3026 Node* CodeStubAssembler::IsShortExternalStringInstanceType(
3020 Node* instance_type) { 3027 Node* instance_type) {
3021 CSA_ASSERT(this, IsStringInstanceType(instance_type)); 3028 CSA_ASSERT(this, IsStringInstanceType(instance_type));
(...skipping 5487 matching lines...) Expand 10 before | Expand all | Expand 10 after
8509 formatted.c_str(), TENURED); 8516 formatted.c_str(), TENURED);
8510 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(), 8517 CallRuntime(Runtime::kGlobalPrint, NoContextConstant(),
8511 HeapConstant(string)); 8518 HeapConstant(string));
8512 } 8519 }
8513 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value); 8520 CallRuntime(Runtime::kDebugPrint, NoContextConstant(), tagged_value);
8514 #endif 8521 #endif
8515 } 8522 }
8516 8523
8517 } // namespace internal 8524 } // namespace internal
8518 } // namespace v8 8525 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698