| 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/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 3140 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 3151   __ Ret(); | 3151   __ Ret(); | 
| 3152   __ bind(¬_oddball); | 3152   __ bind(¬_oddball); | 
| 3153 | 3153 | 
| 3154   __ pop(ecx);   // Pop return address. | 3154   __ pop(ecx);   // Pop return address. | 
| 3155   __ push(eax);  // Push argument. | 3155   __ push(eax);  // Push argument. | 
| 3156   __ push(ecx);  // Push return address. | 3156   __ push(ecx);  // Push return address. | 
| 3157   __ TailCallRuntime(Runtime::kToString); | 3157   __ TailCallRuntime(Runtime::kToString); | 
| 3158 } | 3158 } | 
| 3159 | 3159 | 
| 3160 | 3160 | 
|  | 3161 void ToNameStub::Generate(MacroAssembler* masm) { | 
|  | 3162   // The ToName stub takes one argument in eax. | 
|  | 3163   Label is_number; | 
|  | 3164   __ JumpIfSmi(eax, &is_number, Label::kNear); | 
|  | 3165 | 
|  | 3166   Label not_name; | 
|  | 3167   STATIC_ASSERT(FIRST_NAME_TYPE == FIRST_TYPE); | 
|  | 3168   __ CmpObjectType(eax, LAST_NAME_TYPE, edi); | 
|  | 3169   // eax: receiver | 
|  | 3170   // edi: receiver map | 
|  | 3171   __ j(above, ¬_name, Label::kNear); | 
|  | 3172   __ Ret(); | 
|  | 3173   __ bind(¬_name); | 
|  | 3174 | 
|  | 3175   Label not_heap_number; | 
|  | 3176   __ CompareMap(eax, masm->isolate()->factory()->heap_number_map()); | 
|  | 3177   __ j(not_equal, ¬_heap_number, Label::kNear); | 
|  | 3178   __ bind(&is_number); | 
|  | 3179   NumberToStringStub stub(isolate()); | 
|  | 3180   __ TailCallStub(&stub); | 
|  | 3181   __ bind(¬_heap_number); | 
|  | 3182 | 
|  | 3183   Label not_oddball; | 
|  | 3184   __ CmpInstanceType(edi, ODDBALL_TYPE); | 
|  | 3185   __ j(not_equal, ¬_oddball, Label::kNear); | 
|  | 3186   __ mov(eax, FieldOperand(eax, Oddball::kToStringOffset)); | 
|  | 3187   __ Ret(); | 
|  | 3188   __ bind(¬_oddball); | 
|  | 3189 | 
|  | 3190   __ pop(ecx);   // Pop return address. | 
|  | 3191   __ push(eax);  // Push argument. | 
|  | 3192   __ push(ecx);  // Push return address. | 
|  | 3193   __ TailCallRuntime(Runtime::kToName); | 
|  | 3194 } | 
|  | 3195 | 
|  | 3196 | 
| 3161 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 3197 void StringHelper::GenerateFlatOneByteStringEquals(MacroAssembler* masm, | 
| 3162                                                    Register left, | 3198                                                    Register left, | 
| 3163                                                    Register right, | 3199                                                    Register right, | 
| 3164                                                    Register scratch1, | 3200                                                    Register scratch1, | 
| 3165                                                    Register scratch2) { | 3201                                                    Register scratch2) { | 
| 3166   Register length = scratch1; | 3202   Register length = scratch1; | 
| 3167 | 3203 | 
| 3168   // Compare lengths. | 3204   // Compare lengths. | 
| 3169   Label strings_not_equal, check_zero_length; | 3205   Label strings_not_equal, check_zero_length; | 
| 3170   __ mov(length, FieldOperand(left, String::kLengthOffset)); | 3206   __ mov(length, FieldOperand(left, String::kLengthOffset)); | 
| (...skipping 2527 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5698                            Operand(ebp, 7 * kPointerSize), NULL); | 5734                            Operand(ebp, 7 * kPointerSize), NULL); | 
| 5699 } | 5735 } | 
| 5700 | 5736 | 
| 5701 | 5737 | 
| 5702 #undef __ | 5738 #undef __ | 
| 5703 | 5739 | 
| 5704 }  // namespace internal | 5740 }  // namespace internal | 
| 5705 }  // namespace v8 | 5741 }  // namespace v8 | 
| 5706 | 5742 | 
| 5707 #endif  // V8_TARGET_ARCH_IA32 | 5743 #endif  // V8_TARGET_ARCH_IA32 | 
| OLD | NEW | 
|---|