| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 3155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3166 // edx: from index (smi) | 3166 // edx: from index (smi) |
| 3167 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, | 3167 StringCharAtGenerator generator(eax, edx, ecx, eax, &runtime, &runtime, |
| 3168 &runtime, STRING_INDEX_IS_NUMBER, | 3168 &runtime, STRING_INDEX_IS_NUMBER, |
| 3169 RECEIVER_IS_STRING); | 3169 RECEIVER_IS_STRING); |
| 3170 generator.GenerateFast(masm); | 3170 generator.GenerateFast(masm); |
| 3171 __ ret(3 * kPointerSize); | 3171 __ ret(3 * kPointerSize); |
| 3172 generator.SkipSlow(masm, &runtime); | 3172 generator.SkipSlow(masm, &runtime); |
| 3173 } | 3173 } |
| 3174 | 3174 |
| 3175 | 3175 |
| 3176 void ToNumberStub::Generate(MacroAssembler* masm) { |
| 3177 // The ToNumber stub takes one argument in eax. |
| 3178 Label check_heap_number, call_builtin; |
| 3179 __ JumpIfNotSmi(eax, &check_heap_number, Label::kNear); |
| 3180 __ Ret(); |
| 3181 |
| 3182 __ bind(&check_heap_number); |
| 3183 __ CompareMap(eax, masm->isolate()->factory()->heap_number_map()); |
| 3184 __ j(not_equal, &call_builtin, Label::kNear); |
| 3185 __ Ret(); |
| 3186 |
| 3187 __ bind(&call_builtin); |
| 3188 __ pop(ecx); // Pop return address. |
| 3189 __ push(eax); |
| 3190 __ push(ecx); // Push return address. |
| 3191 __ InvokeBuiltin(Builtins::TO_NUMBER, JUMP_FUNCTION); |
| 3192 } |
| 3193 |
| 3194 |
| 3176 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 3195 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, |
| 3177 Register left, | 3196 Register left, |
| 3178 Register right, | 3197 Register right, |
| 3179 Register scratch1, | 3198 Register scratch1, |
| 3180 Register scratch2) { | 3199 Register scratch2) { |
| 3181 Register length = scratch1; | 3200 Register length = scratch1; |
| 3182 | 3201 |
| 3183 // Compare lengths. | 3202 // Compare lengths. |
| 3184 Label strings_not_equal, check_zero_length; | 3203 Label strings_not_equal, check_zero_length; |
| 3185 __ mov(length, FieldOperand(left, String::kLengthOffset)); | 3204 __ mov(length, FieldOperand(left, String::kLengthOffset)); |
| (...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4741 Operand(ebp, 7 * kPointerSize), | 4760 Operand(ebp, 7 * kPointerSize), |
| 4742 NULL); | 4761 NULL); |
| 4743 } | 4762 } |
| 4744 | 4763 |
| 4745 | 4764 |
| 4746 #undef __ | 4765 #undef __ |
| 4747 | 4766 |
| 4748 } } // namespace v8::internal | 4767 } } // namespace v8::internal |
| 4749 | 4768 |
| 4750 #endif // V8_TARGET_ARCH_IA32 | 4769 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |