OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 __ j(not_equal, &loop); | 2687 __ j(not_equal, &loop); |
2688 | 2688 |
2689 // Reload map as register ebx was used as temporary above. | 2689 // Reload map as register ebx was used as temporary above. |
2690 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); | 2690 __ mov(ebx, FieldOperand(eax, HeapObject::kMapOffset)); |
2691 | 2691 |
2692 // If a valueOf property is not found on the object check that it's | 2692 // If a valueOf property is not found on the object check that it's |
2693 // prototype is the un-modified String prototype. If not result is false. | 2693 // prototype is the un-modified String prototype. If not result is false. |
2694 __ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); | 2694 __ mov(ecx, FieldOperand(ebx, Map::kPrototypeOffset)); |
2695 __ JumpIfSmi(ecx, if_false); | 2695 __ JumpIfSmi(ecx, if_false); |
2696 __ mov(ecx, FieldOperand(ecx, HeapObject::kMapOffset)); | 2696 __ mov(ecx, FieldOperand(ecx, HeapObject::kMapOffset)); |
2697 __ mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX))); | 2697 __ mov(edx, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
2698 __ mov(edx, | 2698 __ mov(edx, |
2699 FieldOperand(edx, GlobalObject::kNativeContextOffset)); | 2699 FieldOperand(edx, GlobalObject::kNativeContextOffset)); |
2700 __ cmp(ecx, | 2700 __ cmp(ecx, |
2701 ContextOperand(edx, | 2701 ContextOperand(edx, |
2702 Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); | 2702 Context::STRING_FUNCTION_PROTOTYPE_MAP_INDEX)); |
2703 __ j(not_equal, if_false); | 2703 __ j(not_equal, if_false); |
2704 // Set the bit in the map to indicate that it has been checked safe for | 2704 // Set the bit in the map to indicate that it has been checked safe for |
2705 // default valueOf and set true result. | 2705 // default valueOf and set true result. |
2706 __ or_(FieldOperand(ebx, Map::kBitField2Offset), | 2706 __ or_(FieldOperand(ebx, Map::kBitField2Offset), |
2707 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); | 2707 Immediate(1 << Map::kStringWrapperSafeForDefaultValueOf)); |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2964 __ jmp(&heapnumber_allocated); | 2964 __ jmp(&heapnumber_allocated); |
2965 | 2965 |
2966 __ bind(&slow_allocate_heapnumber); | 2966 __ bind(&slow_allocate_heapnumber); |
2967 // Allocate a heap number. | 2967 // Allocate a heap number. |
2968 __ CallRuntime(Runtime::kNumberAlloc, 0); | 2968 __ CallRuntime(Runtime::kNumberAlloc, 0); |
2969 __ mov(edi, eax); | 2969 __ mov(edi, eax); |
2970 | 2970 |
2971 __ bind(&heapnumber_allocated); | 2971 __ bind(&heapnumber_allocated); |
2972 | 2972 |
2973 __ PrepareCallCFunction(1, ebx); | 2973 __ PrepareCallCFunction(1, ebx); |
2974 __ mov(eax, ContextOperand(context_register(), Context::GLOBAL_INDEX)); | 2974 __ mov(eax, ContextOperand(context_register(), Context::GLOBAL_OBJECT_INDEX)); |
2975 __ mov(eax, FieldOperand(eax, GlobalObject::kNativeContextOffset)); | 2975 __ mov(eax, FieldOperand(eax, GlobalObject::kNativeContextOffset)); |
2976 __ mov(Operand(esp, 0), eax); | 2976 __ mov(Operand(esp, 0), eax); |
2977 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); | 2977 __ CallCFunction(ExternalReference::random_uint32_function(isolate()), 1); |
2978 | 2978 |
2979 // Convert 32 random bits in eax to 0.(32 random bits) in a double | 2979 // Convert 32 random bits in eax to 0.(32 random bits) in a double |
2980 // by computing: | 2980 // by computing: |
2981 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). | 2981 // ( 1.(20 0s)(32 random bits) x 2^20 ) - (1.0 x 2^20)). |
2982 // This is implemented on both SSE2 and FPU. | 2982 // This is implemented on both SSE2 and FPU. |
2983 if (CpuFeatures::IsSupported(SSE2)) { | 2983 if (CpuFeatures::IsSupported(SSE2)) { |
2984 CpuFeatures::Scope fscope(SSE2); | 2984 CpuFeatures::Scope fscope(SSE2); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3409 __ mov(eax, isolate()->factory()->undefined_value()); | 3409 __ mov(eax, isolate()->factory()->undefined_value()); |
3410 context()->Plug(eax); | 3410 context()->Plug(eax); |
3411 return; | 3411 return; |
3412 } | 3412 } |
3413 | 3413 |
3414 VisitForAccumulatorValue(args->at(1)); | 3414 VisitForAccumulatorValue(args->at(1)); |
3415 | 3415 |
3416 Register key = eax; | 3416 Register key = eax; |
3417 Register cache = ebx; | 3417 Register cache = ebx; |
3418 Register tmp = ecx; | 3418 Register tmp = ecx; |
3419 __ mov(cache, ContextOperand(esi, Context::GLOBAL_INDEX)); | 3419 __ mov(cache, ContextOperand(esi, Context::GLOBAL_OBJECT_INDEX)); |
3420 __ mov(cache, | 3420 __ mov(cache, |
3421 FieldOperand(cache, GlobalObject::kNativeContextOffset)); | 3421 FieldOperand(cache, GlobalObject::kNativeContextOffset)); |
3422 __ mov(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); | 3422 __ mov(cache, ContextOperand(cache, Context::JSFUNCTION_RESULT_CACHES_INDEX)); |
3423 __ mov(cache, | 3423 __ mov(cache, |
3424 FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); | 3424 FieldOperand(cache, FixedArray::OffsetOfElementAt(cache_id))); |
3425 | 3425 |
3426 Label done, not_found; | 3426 Label done, not_found; |
3427 // tmp now holds finger offset as a smi. | 3427 // tmp now holds finger offset as a smi. |
3428 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1); | 3428 STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1); |
3429 __ mov(tmp, FieldOperand(cache, JSFunctionResultCache::kFingerOffset)); | 3429 __ mov(tmp, FieldOperand(cache, JSFunctionResultCache::kFingerOffset)); |
(...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4545 *stack_depth = 0; | 4545 *stack_depth = 0; |
4546 *context_length = 0; | 4546 *context_length = 0; |
4547 return previous_; | 4547 return previous_; |
4548 } | 4548 } |
4549 | 4549 |
4550 #undef __ | 4550 #undef __ |
4551 | 4551 |
4552 } } // namespace v8::internal | 4552 } } // namespace v8::internal |
4553 | 4553 |
4554 #endif // V8_TARGET_ARCH_IA32 | 4554 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |