Chromium Code Reviews| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 descriptor->register_param_count_ = 4; | 93 descriptor->register_param_count_ = 4; |
| 94 descriptor->register_params_ = registers; | 94 descriptor->register_params_ = registers; |
| 95 descriptor->deoptimization_handler_ = | 95 descriptor->deoptimization_handler_ = |
| 96 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; | 96 Runtime::FunctionForId(Runtime::kCreateObjectLiteral)->entry; |
| 97 } | 97 } |
| 98 | 98 |
| 99 | 99 |
| 100 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( | 100 void CreateAllocationSiteStub::InitializeInterfaceDescriptor( |
| 101 Isolate* isolate, | 101 Isolate* isolate, |
| 102 CodeStubInterfaceDescriptor* descriptor) { | 102 CodeStubInterfaceDescriptor* descriptor) { |
| 103 static Register registers[] = { ebx }; | 103 static Register registers[] = { ebx, edx }; |
| 104 descriptor->register_param_count_ = 1; | 104 descriptor->register_param_count_ = 2; |
| 105 descriptor->register_params_ = registers; | 105 descriptor->register_params_ = registers; |
| 106 descriptor->deoptimization_handler_ = NULL; | 106 descriptor->deoptimization_handler_ = NULL; |
| 107 } | 107 } |
| 108 | 108 |
| 109 | 109 |
| 110 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( | 110 void KeyedLoadFastElementStub::InitializeInterfaceDescriptor( |
| 111 Isolate* isolate, | 111 Isolate* isolate, |
| 112 CodeStubInterfaceDescriptor* descriptor) { | 112 CodeStubInterfaceDescriptor* descriptor) { |
| 113 static Register registers[] = { edx, ecx }; | 113 static Register registers[] = { edx, ecx }; |
| 114 descriptor->register_param_count_ = 2; | 114 descriptor->register_param_count_ = 2; |
| (...skipping 2356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2471 __ bind(&miss); | 2471 __ bind(&miss); |
| 2472 GenerateMiss(masm); | 2472 GenerateMiss(masm); |
| 2473 } | 2473 } |
| 2474 | 2474 |
| 2475 | 2475 |
| 2476 static void GenerateRecordCallTarget(MacroAssembler* masm) { | 2476 static void GenerateRecordCallTarget(MacroAssembler* masm) { |
| 2477 // Cache the called function in a global property cell. Cache states | 2477 // Cache the called function in a global property cell. Cache states |
| 2478 // are uninitialized, monomorphic (indicated by a JSFunction), and | 2478 // are uninitialized, monomorphic (indicated by a JSFunction), and |
| 2479 // megamorphic. | 2479 // megamorphic. |
| 2480 // eax : number of arguments to the construct function | 2480 // eax : number of arguments to the construct function |
| 2481 // ebx : cache cell for call target | 2481 // ebx : Feedback vector |
| 2482 // edx : slot in feedback vector (Smi) | |
| 2482 // edi : the function to call | 2483 // edi : the function to call |
| 2483 Isolate* isolate = masm->isolate(); | 2484 Isolate* isolate = masm->isolate(); |
| 2484 Label initialize, done, miss, megamorphic, not_array_function; | 2485 Label initialize, done, miss, megamorphic, not_array_function; |
| 2485 | 2486 |
| 2486 // Load the cache state into ecx. | 2487 // Load the cache state into ecx. |
| 2487 __ mov(ecx, FieldOperand(ebx, Cell::kValueOffset)); | 2488 __ mov(ecx, FieldOperand(ebx, edx, times_half_pointer_size, |
| 2489 FixedArray::kHeaderSize)); | |
| 2488 | 2490 |
| 2489 // A monomorphic cache hit or an already megamorphic state: invoke the | 2491 // A monomorphic cache hit or an already megamorphic state: invoke the |
| 2490 // function without changing the state. | 2492 // function without changing the state. |
| 2491 __ cmp(ecx, edi); | 2493 __ cmp(ecx, edi); |
| 2492 __ j(equal, &done); | 2494 __ j(equal, &done, Label::kFar); |
| 2493 __ cmp(ecx, Immediate(TypeFeedbackCells::MegamorphicSentinel(isolate))); | 2495 __ cmp(ecx, Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
| 2494 __ j(equal, &done); | 2496 __ j(equal, &done, Label::kFar); |
| 2495 | 2497 |
| 2496 // If we came here, we need to see if we are the array function. | 2498 // If we came here, we need to see if we are the array function. |
| 2497 // If we didn't have a matching function, and we didn't find the megamorph | 2499 // If we didn't have a matching function, and we didn't find the megamorph |
| 2498 // sentinel, then we have in the cell either some other function or an | 2500 // sentinel, then we have in the cell either some other function or an |
| 2499 // AllocationSite. Do a map check on the object in ecx. | 2501 // AllocationSite. Do a map check on the object in ecx. |
| 2500 Handle<Map> allocation_site_map = | 2502 Handle<Map> allocation_site_map = |
| 2501 masm->isolate()->factory()->allocation_site_map(); | 2503 masm->isolate()->factory()->allocation_site_map(); |
| 2502 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); | 2504 __ cmp(FieldOperand(ecx, 0), Immediate(allocation_site_map)); |
| 2503 __ j(not_equal, &miss); | 2505 __ j(not_equal, &miss); |
| 2504 | 2506 |
| 2505 // Load the global or builtins object from the current context | 2507 // Load the global or builtins object from the current context |
| 2506 __ LoadGlobalContext(ecx); | 2508 __ LoadGlobalContext(ecx); |
| 2507 // Make sure the function is the Array() function | 2509 // Make sure the function is the Array() function |
| 2508 __ cmp(edi, Operand(ecx, | 2510 __ cmp(edi, Operand(ecx, |
| 2509 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); | 2511 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
| 2510 __ j(not_equal, &megamorphic); | 2512 __ j(not_equal, &megamorphic); |
| 2511 __ jmp(&done); | 2513 __ jmp(&done, Label::kFar); |
| 2512 | 2514 |
| 2513 __ bind(&miss); | 2515 __ bind(&miss); |
| 2514 | 2516 |
| 2515 // A monomorphic miss (i.e, here the cache is not uninitialized) goes | 2517 // A monomorphic miss (i.e, here the cache is not uninitialized) goes |
| 2516 // megamorphic. | 2518 // megamorphic. |
| 2517 __ cmp(ecx, Immediate(TypeFeedbackCells::UninitializedSentinel(isolate))); | 2519 __ cmp(ecx, Immediate(TypeFeedbackInfo::UninitializedSentinel(isolate))); |
| 2518 __ j(equal, &initialize); | 2520 __ j(equal, &initialize); |
| 2519 // MegamorphicSentinel is an immortal immovable object (undefined) so no | 2521 // MegamorphicSentinel is an immortal immovable object (undefined) so no |
| 2520 // write-barrier is needed. | 2522 // write-barrier is needed. |
| 2521 __ bind(&megamorphic); | 2523 __ bind(&megamorphic); |
| 2522 __ mov(FieldOperand(ebx, Cell::kValueOffset), | 2524 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
| 2523 Immediate(TypeFeedbackCells::MegamorphicSentinel(isolate))); | 2525 FixedArray::kHeaderSize), |
| 2524 __ jmp(&done, Label::kNear); | 2526 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); |
| 2527 __ jmp(&done, Label::kFar); | |
| 2525 | 2528 |
| 2526 // An uninitialized cache is patched with the function or sentinel to | 2529 // An uninitialized cache is patched with the function or sentinel to |
| 2527 // indicate the ElementsKind if function is the Array constructor. | 2530 // indicate the ElementsKind if function is the Array constructor. |
| 2528 __ bind(&initialize); | 2531 __ bind(&initialize); |
| 2529 __ LoadGlobalContext(ecx); | 2532 __ LoadGlobalContext(ecx); |
| 2530 // Make sure the function is the Array() function | 2533 // Make sure the function is the Array() function |
| 2531 __ cmp(edi, Operand(ecx, | 2534 __ cmp(edi, Operand(ecx, |
| 2532 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); | 2535 Context::SlotOffset(Context::ARRAY_FUNCTION_INDEX))); |
| 2533 __ j(not_equal, ¬_array_function); | 2536 __ j(not_equal, ¬_array_function); |
| 2534 | 2537 |
| 2535 // The target function is the Array constructor, | 2538 // The target function is the Array constructor, |
| 2536 // Create an AllocationSite if we don't already have it, store it in the cell | 2539 // Create an AllocationSite if we don't already have it, store it in the cell |
| 2537 { | 2540 { |
| 2538 FrameScope scope(masm, StackFrame::INTERNAL); | 2541 FrameScope scope(masm, StackFrame::INTERNAL); |
| 2539 | 2542 |
| 2540 // Arguments register must be smi-tagged to call out. | 2543 // Arguments register must be smi-tagged to call out. |
| 2541 __ SmiTag(eax); | 2544 __ SmiTag(eax); |
| 2542 __ push(eax); | 2545 __ push(eax); |
| 2543 __ push(edi); | 2546 __ push(edi); |
| 2547 __ push(edx); | |
| 2544 __ push(ebx); | 2548 __ push(ebx); |
| 2545 | 2549 |
| 2546 CreateAllocationSiteStub create_stub; | 2550 CreateAllocationSiteStub create_stub; |
| 2547 __ CallStub(&create_stub); | 2551 __ CallStub(&create_stub); |
| 2548 | 2552 |
| 2549 __ pop(ebx); | 2553 __ pop(ebx); |
| 2554 __ pop(edx); | |
| 2550 __ pop(edi); | 2555 __ pop(edi); |
| 2551 __ pop(eax); | 2556 __ pop(eax); |
| 2552 __ SmiUntag(eax); | 2557 __ SmiUntag(eax); |
| 2553 } | 2558 } |
| 2554 __ jmp(&done); | 2559 __ jmp(&done); |
| 2555 | 2560 |
| 2556 __ bind(¬_array_function); | 2561 __ bind(¬_array_function); |
| 2557 __ mov(FieldOperand(ebx, Cell::kValueOffset), edi); | 2562 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
| 2558 // No need for a write barrier here - cells are rescanned. | 2563 FixedArray::kHeaderSize), |
| 2564 edi); | |
| 2565 // We won't need edx or ebx anymore, just save edi | |
| 2566 __ push(edi); | |
| 2567 __ push(ebx); | |
| 2568 __ push(edx); | |
| 2569 __ RecordWriteArray(ebx, edi, edx, kDontSaveFPRegs, | |
| 2570 EMIT_REMEMBERED_SET, OMIT_SMI_CHECK); | |
| 2571 __ pop(edx); | |
| 2572 __ pop(ebx); | |
| 2573 __ pop(edi); | |
| 2559 | 2574 |
| 2560 __ bind(&done); | 2575 __ bind(&done); |
| 2561 } | 2576 } |
| 2562 | 2577 |
| 2563 | 2578 |
| 2564 void CallFunctionStub::Generate(MacroAssembler* masm) { | 2579 void CallFunctionStub::Generate(MacroAssembler* masm) { |
| 2565 // ebx : cache cell for call target | 2580 // ebx : feedback vector |
| 2581 // edx : (only if ebx is not undefined) slot in feedback vector (Smi) | |
| 2566 // edi : the function to call | 2582 // edi : the function to call |
| 2567 Isolate* isolate = masm->isolate(); | 2583 Isolate* isolate = masm->isolate(); |
| 2568 Label slow, non_function; | 2584 Label slow, non_function; |
| 2569 | 2585 |
| 2570 // Check that the function really is a JavaScript function. | 2586 // Check that the function really is a JavaScript function. |
| 2571 __ JumpIfSmi(edi, &non_function); | 2587 __ JumpIfSmi(edi, &non_function); |
| 2572 | 2588 |
| 2573 // Goto slow case if we do not have a function. | 2589 // Goto slow case if we do not have a function. |
| 2574 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 2590 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| 2575 __ j(not_equal, &slow); | 2591 __ j(not_equal, &slow); |
| 2576 | 2592 |
| 2577 if (RecordCallTarget()) { | 2593 if (RecordCallTarget()) { |
| 2578 GenerateRecordCallTarget(masm); | 2594 GenerateRecordCallTarget(masm); |
| 2579 } | 2595 } |
| 2580 | 2596 |
| 2581 // Fast-case: Just invoke the function. | 2597 // Fast-case: Just invoke the function. |
| 2582 ParameterCount actual(argc_); | 2598 ParameterCount actual(argc_); |
| 2583 | 2599 |
| 2584 __ InvokeFunction(edi, actual, JUMP_FUNCTION, NullCallWrapper()); | 2600 __ InvokeFunction(edi, actual, JUMP_FUNCTION, NullCallWrapper()); |
| 2585 | 2601 |
| 2586 // Slow-case: Non-function called. | 2602 // Slow-case: Non-function called. |
| 2587 __ bind(&slow); | 2603 __ bind(&slow); |
| 2588 if (RecordCallTarget()) { | 2604 if (RecordCallTarget()) { |
| 2589 // If there is a call target cache, mark it megamorphic in the | 2605 // If there is a call target cache, mark it megamorphic in the |
| 2590 // non-function case. MegamorphicSentinel is an immortal immovable | 2606 // non-function case. MegamorphicSentinel is an immortal immovable |
| 2591 // object (undefined) so no write barrier is needed. | 2607 // object (undefined) so no write barrier is needed. |
| 2592 __ mov(FieldOperand(ebx, Cell::kValueOffset), | 2608 __ mov(FieldOperand(ebx, edx, times_half_pointer_size, |
| 2593 Immediate(TypeFeedbackCells::MegamorphicSentinel(isolate))); | 2609 FixedArray::kHeaderSize), |
| 2610 Immediate(TypeFeedbackInfo::MegamorphicSentinel(isolate))); | |
| 2594 } | 2611 } |
| 2595 // Check for function proxy. | 2612 // Check for function proxy. |
| 2596 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); | 2613 __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); |
| 2597 __ j(not_equal, &non_function); | 2614 __ j(not_equal, &non_function); |
| 2598 __ pop(ecx); | 2615 __ pop(ecx); |
| 2599 __ push(edi); // put proxy as additional argument under return address | 2616 __ push(edi); // put proxy as additional argument under return address |
| 2600 __ push(ecx); | 2617 __ push(ecx); |
| 2601 __ Set(eax, Immediate(argc_ + 1)); | 2618 __ Set(eax, Immediate(argc_ + 1)); |
| 2602 __ Set(ebx, Immediate(0)); | 2619 __ Set(ebx, Immediate(0)); |
| 2603 __ GetBuiltinEntry(edx, Builtins::CALL_FUNCTION_PROXY); | 2620 __ GetBuiltinEntry(edx, Builtins::CALL_FUNCTION_PROXY); |
| 2604 { | 2621 { |
| 2605 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); | 2622 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); |
| 2606 __ jmp(adaptor, RelocInfo::CODE_TARGET); | 2623 __ jmp(adaptor, RelocInfo::CODE_TARGET); |
| 2607 } | 2624 } |
| 2608 | 2625 |
| 2609 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead | 2626 // CALL_NON_FUNCTION expects the non-function callee as receiver (instead |
| 2610 // of the original receiver from the call site). | 2627 // of the original receiver from the call site). |
| 2611 __ bind(&non_function); | 2628 __ bind(&non_function); |
| 2612 __ mov(Operand(esp, (argc_ + 1) * kPointerSize), edi); | 2629 __ mov(Operand(esp, (argc_ + 1) * kPointerSize), edi); |
| 2613 __ Set(eax, Immediate(argc_)); | 2630 __ Set(eax, Immediate(argc_)); |
| 2614 __ Set(ebx, Immediate(0)); | 2631 __ Set(ebx, Immediate(0)); |
| 2615 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); | 2632 __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); |
| 2616 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); | 2633 Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); |
| 2617 __ jmp(adaptor, RelocInfo::CODE_TARGET); | 2634 __ jmp(adaptor, RelocInfo::CODE_TARGET); |
| 2618 } | 2635 } |
| 2619 | 2636 |
| 2620 | 2637 |
| 2621 void CallConstructStub::Generate(MacroAssembler* masm) { | 2638 void CallConstructStub::Generate(MacroAssembler* masm) { |
| 2622 // eax : number of arguments | 2639 // eax : number of arguments |
| 2623 // ebx : cache cell for call target | 2640 // ebx : feedback vector |
| 2641 // edx : (only if ebx is not undefined) slot in feedback vector (Smi) | |
| 2624 // edi : constructor function | 2642 // edi : constructor function |
| 2625 Label slow, non_function_call; | 2643 Label slow, non_function_call; |
| 2626 | 2644 |
| 2627 // Check that function is not a smi. | 2645 // Check that function is not a smi. |
| 2628 __ JumpIfSmi(edi, &non_function_call); | 2646 __ JumpIfSmi(edi, &non_function_call); |
| 2629 // Check that function is a JSFunction. | 2647 // Check that function is a JSFunction. |
| 2630 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); | 2648 __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| 2631 __ j(not_equal, &slow); | 2649 __ j(not_equal, &slow); |
| 2632 | 2650 |
| 2633 if (RecordCallTarget()) { | 2651 if (RecordCallTarget()) { |
| (...skipping 3131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5765 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); | 5783 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); |
| 5766 } else { | 5784 } else { |
| 5767 UNREACHABLE(); | 5785 UNREACHABLE(); |
| 5768 } | 5786 } |
| 5769 } | 5787 } |
| 5770 | 5788 |
| 5771 | 5789 |
| 5772 void ArrayConstructorStub::Generate(MacroAssembler* masm) { | 5790 void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
| 5773 // ----------- S t a t e ------------- | 5791 // ----------- S t a t e ------------- |
| 5774 // -- eax : argc (only if argument_count_ == ANY) | 5792 // -- eax : argc (only if argument_count_ == ANY) |
| 5775 // -- ebx : type info cell | 5793 // -- ebx : feedback vector |
| 5794 // -- edx : slot index | |
| 5776 // -- edi : constructor | 5795 // -- edi : constructor |
| 5777 // -- esp[0] : return address | 5796 // -- esp[0] : return address |
| 5778 // -- esp[4] : last argument | 5797 // -- esp[4] : last argument |
| 5779 // ----------------------------------- | 5798 // ----------------------------------- |
| 5780 Handle<Object> undefined_sentinel( | 5799 Handle<Object> undefined_sentinel( |
| 5781 masm->isolate()->heap()->undefined_value(), | 5800 masm->isolate()->heap()->undefined_value(), |
| 5782 masm->isolate()); | 5801 masm->isolate()); |
| 5783 | 5802 |
| 5784 if (FLAG_debug_code) { | 5803 if (FLAG_debug_code) { |
| 5785 // The array construct code is only set for the global and natives | 5804 // The array construct code is only set for the global and natives |
| 5786 // builtin Array functions which always have maps. | 5805 // builtin Array functions which always have maps. |
| 5787 | 5806 |
| 5788 // Initial map for the builtin Array function should be a map. | 5807 // Initial map for the builtin Array function should be a map. |
| 5789 __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); | 5808 __ mov(ecx, FieldOperand(edi, JSFunction::kPrototypeOrInitialMapOffset)); |
| 5790 // Will both indicate a NULL and a Smi. | 5809 // Will both indicate a NULL and a Smi. |
| 5791 __ test(ecx, Immediate(kSmiTagMask)); | 5810 __ test(ecx, Immediate(kSmiTagMask)); |
| 5792 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); | 5811 __ Assert(not_zero, kUnexpectedInitialMapForArrayFunction); |
| 5793 __ CmpObjectType(ecx, MAP_TYPE, ecx); | 5812 __ CmpObjectType(ecx, MAP_TYPE, ecx); |
| 5794 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); | 5813 __ Assert(equal, kUnexpectedInitialMapForArrayFunction); |
| 5795 | 5814 |
|
Benedikt Meurer
2014/01/24 11:29:54
Add an AssertIsSmi(edx).
mvstanton
2014/01/30 15:13:41
Done.
| |
| 5796 // We should either have undefined in ebx or a valid cell | 5815 // We should either have undefined in ebx or a valid cell |
| 5797 Label okay_here; | 5816 Label okay_here; |
| 5798 Handle<Map> cell_map = masm->isolate()->factory()->cell_map(); | 5817 Handle<Map> fixed_array_map = masm->isolate()->factory()->fixed_array_map(); |
| 5799 __ cmp(ebx, Immediate(undefined_sentinel)); | 5818 __ cmp(ebx, Immediate(undefined_sentinel)); |
| 5800 __ j(equal, &okay_here); | 5819 __ j(equal, &okay_here); |
| 5801 __ cmp(FieldOperand(ebx, 0), Immediate(cell_map)); | 5820 __ cmp(FieldOperand(ebx, 0), Immediate(fixed_array_map)); |
| 5821 // TODO(mvstanton): change this message below. | |
|
Benedikt Meurer
2014/01/24 11:29:54
Please fix this TODO.
mvstanton
2014/01/30 15:13:41
Done.
| |
| 5802 __ Assert(equal, kExpectedPropertyCellInRegisterEbx); | 5822 __ Assert(equal, kExpectedPropertyCellInRegisterEbx); |
| 5803 __ bind(&okay_here); | 5823 __ bind(&okay_here); |
| 5804 } | 5824 } |
| 5805 | 5825 |
| 5806 Label no_info; | 5826 Label no_info; |
| 5807 // If the type cell is undefined, or contains anything other than an | 5827 // If the type cell is undefined, or contains anything other than an |
| 5808 // AllocationSite, call an array constructor that doesn't use AllocationSites. | 5828 // AllocationSite, call an array constructor that doesn't use AllocationSites. |
| 5809 __ cmp(ebx, Immediate(undefined_sentinel)); | 5829 __ cmp(ebx, Immediate(undefined_sentinel)); |
| 5810 __ j(equal, &no_info); | 5830 __ j(equal, &no_info); |
| 5811 __ mov(ebx, FieldOperand(ebx, Cell::kValueOffset)); | 5831 __ mov(ebx, FieldOperand(ebx, edx, times_half_pointer_size, |
| 5832 FixedArray::kHeaderSize)); | |
| 5812 __ cmp(FieldOperand(ebx, 0), Immediate( | 5833 __ cmp(FieldOperand(ebx, 0), Immediate( |
| 5813 masm->isolate()->factory()->allocation_site_map())); | 5834 masm->isolate()->factory()->allocation_site_map())); |
| 5814 __ j(not_equal, &no_info); | 5835 __ j(not_equal, &no_info); |
| 5815 | 5836 |
| 5816 // Only look at the lower 16 bits of the transition info. | 5837 // Only look at the lower 16 bits of the transition info. |
| 5817 __ mov(edx, FieldOperand(ebx, AllocationSite::kTransitionInfoOffset)); | 5838 __ mov(edx, FieldOperand(ebx, AllocationSite::kTransitionInfoOffset)); |
| 5818 __ SmiUntag(edx); | 5839 __ SmiUntag(edx); |
| 5819 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 5840 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 5820 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask)); | 5841 __ and_(edx, Immediate(AllocationSite::ElementsKindBits::kMask)); |
| 5821 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 5842 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5911 __ bind(&fast_elements_case); | 5932 __ bind(&fast_elements_case); |
| 5912 GenerateCase(masm, FAST_ELEMENTS); | 5933 GenerateCase(masm, FAST_ELEMENTS); |
| 5913 } | 5934 } |
| 5914 | 5935 |
| 5915 | 5936 |
| 5916 #undef __ | 5937 #undef __ |
| 5917 | 5938 |
| 5918 } } // namespace v8::internal | 5939 } } // namespace v8::internal |
| 5919 | 5940 |
| 5920 #endif // V8_TARGET_ARCH_IA32 | 5941 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |