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

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

Issue 2302923002: [stubs] Port ToName stub to TurboFan. (Closed)
Patch Set: Addressed nits. Created 4 years, 3 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/x64/code-stubs-x64.cc ('k') | no next file » | 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/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 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after
2158 __ Ret(); 2158 __ Ret();
2159 __ bind(&not_oddball); 2159 __ bind(&not_oddball);
2160 2160
2161 __ pop(ecx); // Pop return address. 2161 __ pop(ecx); // Pop return address.
2162 __ push(eax); // Push argument. 2162 __ push(eax); // Push argument.
2163 __ push(ecx); // Push return address. 2163 __ push(ecx); // Push return address.
2164 __ TailCallRuntime(Runtime::kToString); 2164 __ TailCallRuntime(Runtime::kToString);
2165 } 2165 }
2166 2166
2167 2167
2168 void ToNameStub::Generate(MacroAssembler* masm) {
2169 // The ToName stub takes one argument in eax.
2170 Label is_number;
2171 __ JumpIfSmi(eax, &is_number, Label::kNear);
2172
2173 Label not_name;
2174 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2175 __ CmpObjectType(eax, LAST_NAME_TYPE, edi);
2176 // eax: receiver
2177 // edi: receiver map
2178 __ j(above, &not_name, Label::kNear);
2179 __ Ret();
2180 __ bind(&not_name);
2181
2182 Label not_heap_number;
2183 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
2184 __ j(not_equal, &not_heap_number, Label::kNear);
2185 __ bind(&is_number);
2186 NumberToStringStub stub(isolate());
2187 __ TailCallStub(&stub);
2188 __ bind(&not_heap_number);
2189
2190 Label not_oddball;
2191 __ CmpInstanceType(edi, ODDBALL_TYPE);
2192 __ j(not_equal, &not_oddball, Label::kNear);
2193 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
2194 __ Ret();
2195 __ bind(&not_oddball);
2196
2197 __ pop(ecx); // Pop return address.
2198 __ push(eax); // Push argument.
2199 __ push(ecx); // Push return address.
2200 __ TailCallRuntime(Runtime::kToName);
2201 }
2202
2203
2204 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2168 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2205 Register left, 2169 Register left,
2206 Register right, 2170 Register right,
2207 Register scratch1, 2171 Register scratch1,
2208 Register scratch2) { 2172 Register scratch2) {
2209 Register length = scratch1; 2173 Register length = scratch1;
2210 2174
2211 // Compare lengths. 2175 // Compare lengths.
2212 Label strings_not_equal, check_zero_length; 2176 Label strings_not_equal, check_zero_length;
2213 __ mov(length, FieldOperand(left, String::kLengthOffset)); 2177 __ mov(length, FieldOperand(left, String::kLengthOffset));
(...skipping 3063 matching lines...) Expand 10 before | Expand all | Expand 10 after
5277 kStackUnwindSpace, nullptr, return_value_operand, 5241 kStackUnwindSpace, nullptr, return_value_operand,
5278 NULL); 5242 NULL);
5279 } 5243 }
5280 5244
5281 #undef __ 5245 #undef __
5282 5246
5283 } // namespace internal 5247 } // namespace internal
5284 } // namespace v8 5248 } // namespace v8
5285 5249
5286 #endif // V8_TARGET_ARCH_X87 5250 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698