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

Side by Side Diff: src/full-codegen/x87/full-codegen-x87.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, 6 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/x64/full-codegen-x64.cc ('k') | src/js/uri.js » ('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_X87 5 #if V8_TARGET_ARCH_X87
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 2765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2776 // If the object is not a value type, return the object. 2776 // If the object is not a value type, return the object.
2777 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx); 2777 __ CmpObjectType(eax, JS_VALUE_TYPE, ebx);
2778 __ j(not_equal, &done, Label::kNear); 2778 __ j(not_equal, &done, Label::kNear);
2779 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset)); 2779 __ mov(eax, FieldOperand(eax, JSValue::kValueOffset));
2780 2780
2781 __ bind(&done); 2781 __ bind(&done);
2782 context()->Plug(eax); 2782 context()->Plug(eax);
2783 } 2783 }
2784 2784
2785 2785
2786 void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) {
2787 ZoneList<Expression*>* args = expr->arguments();
2788 DCHECK_EQ(3, args->length());
2789
2790 Register string = eax;
2791 Register index = ebx;
2792 Register value = ecx;
2793
2794 VisitForStackValue(args->at(0)); // index
2795 VisitForStackValue(args->at(1)); // value
2796 VisitForAccumulatorValue(args->at(2)); // string
2797
2798 PopOperand(value);
2799 PopOperand(index);
2800
2801 if (FLAG_debug_code) {
2802 __ test(value, Immediate(kSmiTagMask));
2803 __ Check(zero, kNonSmiValue);
2804 __ test(index, Immediate(kSmiTagMask));
2805 __ Check(zero, kNonSmiValue);
2806 }
2807
2808 __ SmiUntag(value);
2809 __ SmiUntag(index);
2810
2811 if (FLAG_debug_code) {
2812 static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
2813 __ EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type);
2814 }
2815
2816 __ mov_b(FieldOperand(string, index, times_1, SeqOneByteString::kHeaderSize),
2817 value);
2818 context()->Plug(string);
2819 }
2820
2821
2822 void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) {
2823 ZoneList<Expression*>* args = expr->arguments();
2824 DCHECK_EQ(3, args->length());
2825
2826 Register string = eax;
2827 Register index = ebx;
2828 Register value = ecx;
2829
2830 VisitForStackValue(args->at(0)); // index
2831 VisitForStackValue(args->at(1)); // value
2832 VisitForAccumulatorValue(args->at(2)); // string
2833 PopOperand(value);
2834 PopOperand(index);
2835
2836 if (FLAG_debug_code) {
2837 __ test(value, Immediate(kSmiTagMask));
2838 __ Check(zero, kNonSmiValue);
2839 __ test(index, Immediate(kSmiTagMask));
2840 __ Check(zero, kNonSmiValue);
2841 __ SmiUntag(index);
2842 static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
2843 __ EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type);
2844 __ SmiTag(index);
2845 }
2846
2847 __ SmiUntag(value);
2848 // No need to untag a smi for two-byte addressing.
2849 __ mov_w(FieldOperand(string, index, times_1, SeqTwoByteString::kHeaderSize),
2850 value);
2851 context()->Plug(string);
2852 }
2853
2854
2855 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) { 2786 void FullCodeGenerator::EmitStringCharFromCode(CallRuntime* expr) {
2856 ZoneList<Expression*>* args = expr->arguments(); 2787 ZoneList<Expression*>* args = expr->arguments();
2857 DCHECK(args->length() == 1); 2788 DCHECK(args->length() == 1);
2858 2789
2859 VisitForAccumulatorValue(args->at(0)); 2790 VisitForAccumulatorValue(args->at(0));
2860 2791
2861 Label done; 2792 Label done;
2862 StringCharFromCodeGenerator generator(eax, ebx); 2793 StringCharFromCodeGenerator generator(eax, ebx);
2863 generator.GenerateFast(masm_); 2794 generator.GenerateFast(masm_);
2864 __ jmp(&done); 2795 __ jmp(&done);
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after
3783 isolate->builtins()->OnStackReplacement()->entry(), 3714 isolate->builtins()->OnStackReplacement()->entry(),
3784 Assembler::target_address_at(call_target_address, unoptimized_code)); 3715 Assembler::target_address_at(call_target_address, unoptimized_code));
3785 return ON_STACK_REPLACEMENT; 3716 return ON_STACK_REPLACEMENT;
3786 } 3717 }
3787 3718
3788 3719
3789 } // namespace internal 3720 } // namespace internal
3790 } // namespace v8 3721 } // namespace v8
3791 3722
3792 #endif // V8_TARGET_ARCH_X87 3723 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x64/full-codegen-x64.cc ('k') | src/js/uri.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698