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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 1846683006: [stubs] Introduce ToIntegerStub and unify the handling of %_ToInteger. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-factory.h" 8 #include "src/code-factory.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2974 matching lines...) Expand 10 before | Expand all | Expand 10 after
2985 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; 2985 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2986 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); 2986 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
2987 } 2987 }
2988 2988
2989 __ movw(FieldOperand(string, index, times_2, SeqTwoByteString::kHeaderSize), 2989 __ movw(FieldOperand(string, index, times_2, SeqTwoByteString::kHeaderSize),
2990 value); 2990 value);
2991 context()->Plug(rax); 2991 context()->Plug(rax);
2992 } 2992 }
2993 2993
2994 2994
2995 void FullCodeGenerator::EmitToInteger(CallRuntime* expr) {
2996 ZoneList<Expression*>* args = expr->arguments();
2997 DCHECK_EQ(1, args->length());
2998
2999 // Load the argument into rax and convert it.
3000 VisitForAccumulatorValue(args->at(0));
3001
3002 // Convert the object to an integer.
3003 Label done_convert;
3004 __ JumpIfSmi(rax, &done_convert, Label::kNear);
3005 __ Push(rax);
3006 __ CallRuntime(Runtime::kToInteger);
3007 __ bind(&done_convert);
3008 context()->Plug(rax);
3009 }
3010
3011
3012 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2995 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
3013 ZoneList<Expression*>* args = expr->arguments(); 2996 ZoneList<Expression*>* args = expr->arguments();
3014 DCHECK(args->length() == 1); 2997 DCHECK(args->length() == 1);
3015 2998
3016 VisitForAccumulatorValue(args->at(0)); 2999 VisitForAccumulatorValue(args->at(0));
3017 3000
3018 Label done; 3001 Label done;
3019 StringCharFromCodeGenerator generator(rax, rbx); 3002 StringCharFromCodeGenerator generator(rax, rbx);
3020 generator.GenerateFast(masm_); 3003 generator.GenerateFast(masm_);
3021 __ jmp(&done); 3004 __ jmp(&done);
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
3987 DCHECK_EQ( 3970 DCHECK_EQ(
3988 isolate->builtins()->OnStackReplacement()->entry(), 3971 isolate->builtins()->OnStackReplacement()->entry(),
3989 Assembler::target_address_at(call_target_address, unoptimized_code)); 3972 Assembler::target_address_at(call_target_address, unoptimized_code));
3990 return ON_STACK_REPLACEMENT; 3973 return ON_STACK_REPLACEMENT;
3991 } 3974 }
3992 3975
3993 } // namespace internal 3976 } // namespace internal
3994 } // namespace v8 3977 } // namespace v8
3995 3978
3996 #endif // V8_TARGET_ARCH_X64 3979 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/s390/full-codegen-s390.cc ('k') | src/full-codegen/x87/full-codegen-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698