OLD | NEW |
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 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2316 __ Ret(); | 2316 __ Ret(); |
2317 __ bind(¬_oddball); | 2317 __ bind(¬_oddball); |
2318 | 2318 |
2319 __ pop(ecx); // Pop return address. | 2319 __ pop(ecx); // Pop return address. |
2320 __ push(eax); // Push argument. | 2320 __ push(eax); // Push argument. |
2321 __ push(ecx); // Push return address. | 2321 __ push(ecx); // Push return address. |
2322 __ TailCallRuntime(Runtime::kToString); | 2322 __ TailCallRuntime(Runtime::kToString); |
2323 } | 2323 } |
2324 | 2324 |
2325 | 2325 |
2326 void ToNameStub::Generate(MacroAssembler* masm) { | |
2327 // The ToName stub takes one argument in eax. | |
2328 Label is_number; | |
2329 __ JumpIfSmi(eax, &is_number, Label::kNear); | |
2330 | |
2331 Label not_name; | |
2332 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | |
2333 __ CmpObjectType(eax, LAST_NAME_TYPE, edi); | |
2334 // eax: receiver | |
2335 // edi: receiver map | |
2336 __ j(above, ¬_name, Label::kNear); | |
2337 __ Ret(); | |
2338 __ bind(¬_name); | |
2339 | |
2340 Label not_heap_number; | |
2341 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map()); | |
2342 __ j(not_equal, ¬_heap_number, Label::kNear); | |
2343 __ bind(&is_number); | |
2344 NumberToStringStub stub(isolate()); | |
2345 __ TailCallStub(&stub); | |
2346 __ bind(¬_heap_number); | |
2347 | |
2348 Label not_oddball; | |
2349 __ CmpInstanceType(edi, ODDBALL_TYPE); | |
2350 __ j(not_equal, ¬_oddball, Label::kNear); | |
2351 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset)); | |
2352 __ Ret(); | |
2353 __ bind(¬_oddball); | |
2354 | |
2355 __ pop(ecx); // Pop return address. | |
2356 __ push(eax); // Push argument. | |
2357 __ push(ecx); // Push return address. | |
2358 __ TailCallRuntime(Runtime::kToName); | |
2359 } | |
2360 | |
2361 | |
2362 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 2326 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
2363 Register left, | 2327 Register left, |
2364 Register right, | 2328 Register right, |
2365 Register scratch1, | 2329 Register scratch1, |
2366 Register scratch2) { | 2330 Register scratch2) { |
2367 Register length = scratch1; | 2331 Register length = scratch1; |
2368 | 2332 |
2369 // Compare lengths. | 2333 // Compare lengths. |
2370 Label strings_not_equal, check_zero_length; | 2334 Label strings_not_equal, check_zero_length; |
2371 __ mov(length, FieldOperand(left, String::kLengthOffset)); | 2335 __ mov(length, FieldOperand(left, String::kLengthOffset)); |
(...skipping 3114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5486 kStackUnwindSpace, nullptr, return_value_operand, | 5450 kStackUnwindSpace, nullptr, return_value_operand, |
5487 NULL); | 5451 NULL); |
5488 } | 5452 } |
5489 | 5453 |
5490 #undef __ | 5454 #undef __ |
5491 | 5455 |
5492 } // namespace internal | 5456 } // namespace internal |
5493 } // namespace v8 | 5457 } // namespace v8 |
5494 | 5458 |
5495 #endif // V8_TARGET_ARCH_IA32 | 5459 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |