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

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

Issue 1622793006: X87: [stubs] Introduce ToNameStub to implement %_ToName. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/x87/full-codegen-x87.cc ('k') | src/x87/interface-descriptors-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_X87 5 #if V8_TARGET_ARCH_X87
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/bootstrapper.h" 8 #include "src/bootstrapper.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 __ Ret(); 2861 __ Ret();
2862 __ bind(&not_oddball); 2862 __ bind(&not_oddball);
2863 2863
2864 __ pop(ecx); // Pop return address. 2864 __ pop(ecx); // Pop return address.
2865 __ push(eax); // Push argument. 2865 __ push(eax); // Push argument.
2866 __ push(ecx); // Push return address. 2866 __ push(ecx); // Push return address.
2867 __ TailCallRuntime(Runtime::kToString); 2867 __ TailCallRuntime(Runtime::kToString);
2868 } 2868 }
2869 2869
2870 2870
2871 void ToNameStub::Generate(MacroAssembler* masm) {
2872 // The ToName stub takes one argument in eax.
2873 Label is_number;
2874 __ JumpIfSmi(eax, &is_number, Label::kNear);
2875
2876 Label not_name;
2877 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE);
2878 __ CmpObjectType(eax, LAST_NAME_TYPE, edi);
2879 // eax: receiver
2880 // edi: receiver map
2881 __ j(above, &not_name, Label::kNear);
2882 __ Ret();
2883 __ bind(&not_name);
2884
2885 Label not_heap_number;
2886 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map());
2887 __ j(not_equal, &not_heap_number, Label::kNear);
2888 __ bind(&is_number);
2889 NumberToStringStub stub(isolate());
2890 __ TailCallStub(&stub);
2891 __ bind(&not_heap_number);
2892
2893 Label not_oddball;
2894 __ CmpInstanceType(edi, ODDBALL_TYPE);
2895 __ j(not_equal, &not_oddball, Label::kNear);
2896 __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset));
2897 __ Ret();
2898 __ bind(&not_oddball);
2899
2900 __ pop(ecx); // Pop return address.
2901 __ push(eax); // Push argument.
2902 __ push(ecx); // Push return address.
2903 __ TailCallRuntime(Runtime::kToName);
2904 }
2905
2906
2871 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, 2907 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm,
2872 Register left, 2908 Register left,
2873 Register right, 2909 Register right,
2874 Register scratch1, 2910 Register scratch1,
2875 Register scratch2) { 2911 Register scratch2) {
2876 Register length = scratch1; 2912 Register length = scratch1;
2877 2913
2878 // Compare lengths. 2914 // Compare lengths.
2879 Label strings_not_equal, check_zero_length; 2915 Label strings_not_equal, check_zero_length;
2880 __ mov(length, FieldOperand(left, String::kLengthOffset)); 2916 __ mov(length, FieldOperand(left, String::kLengthOffset));
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
5390 return_value_operand, NULL); 5426 return_value_operand, NULL);
5391 } 5427 }
5392 5428
5393 5429
5394 #undef __ 5430 #undef __
5395 5431
5396 } // namespace internal 5432 } // namespace internal
5397 } // namespace v8 5433 } // namespace v8
5398 5434
5399 #endif // V8_TARGET_ARCH_X87 5435 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/full-codegen/x87/full-codegen-x87.cc ('k') | src/x87/interface-descriptors-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698