OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 3057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3068 __ Ret(); | 3068 __ Ret(); |
3069 __ bind(¬_oddball); | 3069 __ bind(¬_oddball); |
3070 | 3070 |
3071 __ PopReturnAddressTo(rcx); // Pop return address. | 3071 __ PopReturnAddressTo(rcx); // Pop return address. |
3072 __ Push(rax); // Push argument. | 3072 __ Push(rax); // Push argument. |
3073 __ PushReturnAddressFrom(rcx); // Push return address. | 3073 __ PushReturnAddressFrom(rcx); // Push return address. |
3074 __ TailCallRuntime(Runtime::kToString); | 3074 __ TailCallRuntime(Runtime::kToString); |
3075 } | 3075 } |
3076 | 3076 |
3077 | 3077 |
| 3078 void ToNameStub::Generate(MacroAssembler* masm) { |
| 3079 // The ToName stub takes one argument in rax. |
| 3080 Label is_number; |
| 3081 __ JumpIfSmi(rax, &is_number, Label::kNear); |
| 3082 |
| 3083 Label not_name; |
| 3084 STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); |
| 3085 __ CmpObjectType(rax, LAST_NAME_TYPE, rdi); |
| 3086 // rax: receiver |
| 3087 // rdi: receiver map |
| 3088 __ j(above, ¬_name, Label::kNear); |
| 3089 __ Ret(); |
| 3090 __ bind(¬_name); |
| 3091 |
| 3092 Label not_heap_number; |
| 3093 __ CompareRoot(rdi, Heap::kHeapNumberMapRootIndex); |
| 3094 __ j(not_equal, ¬_heap_number, Label::kNear); |
| 3095 __ bind(&is_number); |
| 3096 NumberToStringStub stub(isolate()); |
| 3097 __ TailCallStub(&stub); |
| 3098 __ bind(¬_heap_number); |
| 3099 |
| 3100 Label not_oddball; |
| 3101 __ CmpInstanceType(rdi, ODDBALL_TYPE); |
| 3102 __ j(not_equal, ¬_oddball, Label::kNear); |
| 3103 __ movp(rax, FieldOperand(rax, Oddball::kToStringOffset)); |
| 3104 __ Ret(); |
| 3105 __ bind(¬_oddball); |
| 3106 |
| 3107 __ PopReturnAddressTo(rcx); // Pop return address. |
| 3108 __ Push(rax); // Push argument. |
| 3109 __ PushReturnAddressFrom(rcx); // Push return address. |
| 3110 __ TailCallRuntime(Runtime::kToName); |
| 3111 } |
| 3112 |
| 3113 |
3078 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 3114 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
3079 Register left, | 3115 Register left, |
3080 Register right, | 3116 Register right, |
3081 Register scratch1, | 3117 Register scratch1, |
3082 Register scratch2) { | 3118 Register scratch2) { |
3083 Register length = scratch1; | 3119 Register length = scratch1; |
3084 | 3120 |
3085 // Compare lengths. | 3121 // Compare lengths. |
3086 Label check_zero_length; | 3122 Label check_zero_length; |
3087 __ movp(length, FieldOperand(left, String::kLengthOffset)); | 3123 __ movp(length, FieldOperand(left, String::kLengthOffset)); |
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 kStackSpace, nullptr, return_value_operand, NULL); | 5459 kStackSpace, nullptr, return_value_operand, NULL); |
5424 } | 5460 } |
5425 | 5461 |
5426 | 5462 |
5427 #undef __ | 5463 #undef __ |
5428 | 5464 |
5429 } // namespace internal | 5465 } // namespace internal |
5430 } // namespace v8 | 5466 } // namespace v8 |
5431 | 5467 |
5432 #endif // V8_TARGET_ARCH_X64 | 5468 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |