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

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

Issue 1994733003: Rewrite decodeURL as builtin function, remove now unused runtime functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 7 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 2762 matching lines...) Expand 10 before | Expand all | Expand 10 after
2773 // If the object is not a value type, return the object. 2773 // If the object is not a value type, return the object.
2774 __ CmpObjectType(rax, JS_VALUE_TYPE, rbx); 2774 __ CmpObjectType(rax, JS_VALUE_TYPE, rbx);
2775 __ j(not_equal, &done); 2775 __ j(not_equal, &done);
2776 __ movp(rax, FieldOperand(rax, JSValue::kValueOffset)); 2776 __ movp(rax, FieldOperand(rax, JSValue::kValueOffset));
2777 2777
2778 __ bind(&done); 2778 __ bind(&done);
2779 context()->Plug(rax); 2779 context()->Plug(rax);
2780 } 2780 }
2781 2781
2782 2782
2783 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2784 ZoneList<Expression*>* args = expr->arguments();
2785 DCHECK_EQ(3, args->length());
2786
2787 Register string = rax;
2788 Register index = rbx;
2789 Register value = rcx;
2790
2791 VisitForStackValue(args->at(0)); // index
2792 VisitForStackValue(args->at(1)); // value
2793 VisitForAccumulatorValue(args->at(2)); // string
2794 PopOperand(value);
2795 PopOperand(index);
2796
2797 if (FLAG_debug_code) {
2798 __ Check(__ CheckSmi(value), kNonSmiValue);
2799 __ Check(__ CheckSmi(index), kNonSmiValue);
2800 }
2801
2802 __ SmiToInteger32(value, value);
2803 __ SmiToInteger32(index, index);
2804
2805 if (FLAG_debug_code) {
2806 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2807 __ EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
2808 }
2809
2810 __ movb(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize),
2811 value);
2812 context()->Plug(string);
2813 }
2814
2815
2816 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2817 ZoneList<Expression*>* args = expr->arguments();
2818 DCHECK_EQ(3, args->length());
2819
2820 Register string = rax;
2821 Register index = rbx;
2822 Register value = rcx;
2823
2824 VisitForStackValue(args->at(0)); // index
2825 VisitForStackValue(args->at(1)); // value
2826 VisitForAccumulatorValue(args->at(2)); // string
2827 PopOperand(value);
2828 PopOperand(index);
2829
2830 if (FLAG_debug_code) {
2831 __ Check(__ CheckSmi(value), kNonSmiValue);
2832 __ Check(__ CheckSmi(index), kNonSmiValue);
2833 }
2834
2835 __ SmiToInteger32(value, value);
2836 __ SmiToInteger32(index, index);
2837
2838 if (FLAG_debug_code) {
2839 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2840 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
2841 }
2842
2843 __ movw(FieldOperand(string, index, times_2, SeqTwoByteString::kHeaderSize),
2844 value);
2845 context()->Plug(rax);
2846 }
2847
2848
2849 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2783 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2850 ZoneList<Expression*>* args = expr->arguments(); 2784 ZoneList<Expression*>* args = expr->arguments();
2851 DCHECK(args->length() == 1); 2785 DCHECK(args->length() == 1);
2852 2786
2853 VisitForAccumulatorValue(args->at(0)); 2787 VisitForAccumulatorValue(args->at(0));
2854 2788
2855 Label done; 2789 Label done;
2856 StringCharFromCodeGenerator generator(rax, rbx); 2790 StringCharFromCodeGenerator generator(rax, rbx);
2857 generator.GenerateFast(masm_); 2791 generator.GenerateFast(masm_);
2858 __ jmp(&done); 2792 __ jmp(&done);
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 DCHECK_EQ( 3708 DCHECK_EQ(
3775 isolate->builtins()->OnStackReplacement()->entry(), 3709 isolate->builtins()->OnStackReplacement()->entry(),
3776 Assembler::target_address_at(call_target_address, unoptimized_code)); 3710 Assembler::target_address_at(call_target_address, unoptimized_code));
3777 return ON_STACK_REPLACEMENT; 3711 return ON_STACK_REPLACEMENT;
3778 } 3712 }
3779 3713
3780 } // namespace internal 3714 } // namespace internal
3781 } // namespace v8 3715 } // namespace v8
3782 3716
3783 #endif // V8_TARGET_ARCH_X64 3717 #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