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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 2380973002: [stubs] replaced ToString MacroAssembler Stub with CodeStubAssembler builtin (Closed)
Patch Set: Merge branch 'master' of https://chromium.googlesource.com/v8/v8 into ToStringTFStub Created 4 years, 2 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-stubs-hydrogen.cc ('k') | src/mips/code-stubs-mips.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/api-arguments.h" 8 #include "src/api-arguments.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 __ mov_b(scratch, Operand(src, 0)); 2058 __ mov_b(scratch, Operand(src, 0));
2059 __ mov_b(Operand(dest, 0), scratch); 2059 __ mov_b(Operand(dest, 0), scratch);
2060 __ inc(src); 2060 __ inc(src);
2061 __ inc(dest); 2061 __ inc(dest);
2062 __ dec(count); 2062 __ dec(count);
2063 __ j(not_zero, &loop); 2063 __ j(not_zero, &loop);
2064 2064
2065 __ bind(&done); 2065 __ bind(&done);
2066 } 2066 }
2067 2067
2068 void ToStringStub::Generate(MacroAssembler* masm) {
2069 // The ToString stub takes one argument in eax.
2070 Label is_number;
2071 __ JumpIfSmi(eax, &is_number, Label::kNear);
2072
2073 Label not_string;
2074 __ CmpObjectType(eax, FIRST_NONSTRING_TYPE, edi);
2075 // eax: receiver
2076 // edi: receiver map
2077 __ j(above_equal, &not_string, Label::kNear);
2078 __ Ret();
2079 __ bind(&not_string);
2080
2081 Label not_heap_number;
2082 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
2083 __ j(not_equal, &not_heap_number, Label::kNear);
2084 __ bind(&is_number);
2085 NumberToStringStub stub(isolate());
2086 __ TailCallStub(&stub);
2087 __ bind(&not_heap_number);
2088
2089 Label not_oddball;
2090 __ CmpInstanceType(edi, ODDBALL_TYPE);
2091 __ j(not_equal, &not_oddball, Label::kNear);
2092 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
2093 __ Ret();
2094 __ bind(&not_oddball);
2095
2096 __ pop(ecx); // Pop return address.
2097 __ push(eax); // Push argument.
2098 __ push(ecx); // Push return address.
2099 __ TailCallRuntime(Runtime::kToString);
2100 }
2101
2102 2068
2103 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2069 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2104 Register left, 2070 Register left,
2105 Register right, 2071 Register right,
2106 Register scratch1, 2072 Register scratch1,
2107 Register scratch2) { 2073 Register scratch2) {
2108 Register length = scratch1; 2074 Register length = scratch1;
2109 2075
2110 // Compare lengths. 2076 // Compare lengths.
2111 Label strings_not_equal, check_zero_length; 2077 Label strings_not_equal, check_zero_length;
(...skipping 3126 matching lines...) Expand 10 before | Expand all | Expand 10 after
5238 kStackUnwindSpace, nullptr, return_value_operand, 5204 kStackUnwindSpace, nullptr, return_value_operand,
5239 NULL); 5205 NULL);
5240 } 5206 }
5241 5207
5242 #undef __ 5208 #undef __
5243 5209
5244 } // namespace internal 5210 } // namespace internal
5245 } // namespace v8 5211 } // namespace v8
5246 5212
5247 #endif // V8_TARGET_ARCH_IA32 5213 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/code-stubs-hydrogen.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698