Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 10878047: Revert to code state of 3.13.1 plus r12350 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/incremental-marking.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 269 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
270 } 270 }
271 271
272 272
273 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 273 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
274 MacroAssembler* masm, 274 MacroAssembler* masm,
275 int index, 275 int index,
276 Register prototype, 276 Register prototype,
277 Label* miss) { 277 Label* miss) {
278 // Check we're still in the same context. 278 // Check we're still in the same context.
279 __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)), 279 __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)),
280 masm->isolate()->global_object()); 280 masm->isolate()->global());
281 __ j(not_equal, miss); 281 __ j(not_equal, miss);
282 // Get the global function with the given index. 282 // Get the global function with the given index.
283 Handle<JSFunction> function( 283 Handle<JSFunction> function(
284 JSFunction::cast(masm->isolate()->native_context()->get(index))); 284 JSFunction::cast(masm->isolate()->global_context()->get(index)));
285 // Load its initial map. The global functions all have initial maps. 285 // Load its initial map. The global functions all have initial maps.
286 __ Set(prototype, Immediate(Handle<Map>(function->initial_map()))); 286 __ Set(prototype, Immediate(Handle<Map>(function->initial_map())));
287 // Load the prototype from the initial map. 287 // Load the prototype from the initial map.
288 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 288 __ mov(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
289 } 289 }
290 290
291 291
292 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, 292 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
293 Register receiver, 293 Register receiver,
294 Register scratch, 294 Register scratch,
(...skipping 2345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2640 // Handle store cache miss. 2640 // Handle store cache miss.
2641 __ bind(&miss); 2641 __ bind(&miss);
2642 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2642 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2643 __ jmp(ic, RelocInfo::CODE_TARGET); 2643 __ jmp(ic, RelocInfo::CODE_TARGET);
2644 2644
2645 // Return the generated code. 2645 // Return the generated code.
2646 return GetCode(Code::CALLBACKS, name); 2646 return GetCode(Code::CALLBACKS, name);
2647 } 2647 }
2648 2648
2649 2649
2650 #undef __ 2650 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2651 #define __ ACCESS_MASM(masm) 2651 Handle<String> name,
2652 2652 Handle<JSObject> receiver,
2653 2653 Handle<JSObject> holder,
2654 void StoreStubCompiler::GenerateStoreViaSetter(
2655 MacroAssembler* masm,
2656 Handle<JSFunction> setter) { 2654 Handle<JSFunction> setter) {
2657 // ----------- S t a t e ------------- 2655 // ----------- S t a t e -------------
2658 // -- eax : value 2656 // -- eax : value
2659 // -- ecx : name 2657 // -- ecx : name
2660 // -- edx : receiver 2658 // -- edx : receiver
2661 // -- esp[0] : return address 2659 // -- esp[0] : return address
2662 // ----------------------------------- 2660 // -----------------------------------
2661 Label miss;
2662
2663 // Check that the maps haven't changed, preserving the name register.
2664 __ push(ecx);
2665 __ JumpIfSmi(edx, &miss);
2666 CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss);
2667 __ pop(ecx);
2668
2663 { 2669 {
2664 FrameScope scope(masm, StackFrame::INTERNAL); 2670 FrameScope scope(masm(), StackFrame::INTERNAL);
2665 2671
2666 // Save value register, so we can restore it later. 2672 // Save value register, so we can restore it later.
2667 __ push(eax); 2673 __ push(eax);
2668 2674
2669 if (!setter.is_null()) { 2675 // Call the JavaScript setter with the receiver and the value on the stack.
2670 // Call the JavaScript setter with receiver and value on the stack. 2676 __ push(edx);
2671 __ push(edx); 2677 __ push(eax);
2672 __ push(eax); 2678 ParameterCount actual(1);
2673 ParameterCount actual(1); 2679 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2674 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), 2680 CALL_AS_METHOD);
2675 CALL_AS_METHOD);
2676 } else {
2677 // If we generate a global code snippet for deoptimization only, remember
2678 // the place to continue after deoptimization.
2679 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2680 }
2681 2681
2682 // We have to return the passed value, not the return value of the setter. 2682 // We have to return the passed value, not the return value of the setter.
2683 __ pop(eax); 2683 __ pop(eax);
2684 2684
2685 // Restore context register. 2685 // Restore context register.
2686 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); 2686 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset));
2687 } 2687 }
2688 __ ret(0); 2688 __ ret(0);
2689 }
2690
2691
2692 #undef __
2693 #define __ ACCESS_MASM(masm())
2694
2695
2696 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2697 Handle<String> name,
2698 Handle<JSObject> receiver,
2699 Handle<JSObject> holder,
2700 Handle<JSFunction> setter) {
2701 // ----------- S t a t e -------------
2702 // -- eax : value
2703 // -- ecx : name
2704 // -- edx : receiver
2705 // -- esp[0] : return address
2706 // -----------------------------------
2707 Label miss;
2708
2709 // Check that the maps haven't changed, preserving the name register.
2710 __ push(ecx);
2711 __ JumpIfSmi(edx, &miss);
2712 CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss);
2713 __ pop(ecx);
2714
2715 GenerateStoreViaSetter(masm(), setter);
2716 2689
2717 __ bind(&miss); 2690 __ bind(&miss);
2718 __ pop(ecx); 2691 __ pop(ecx);
2719 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2692 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2720 __ jmp(ic, RelocInfo::CODE_TARGET); 2693 __ jmp(ic, RelocInfo::CODE_TARGET);
2721 2694
2722 // Return the generated code. 2695 // Return the generated code.
2723 return GetCode(Code::CALLBACKS, name); 2696 return GetCode(Code::CALLBACKS, name);
2724 } 2697 }
2725 2698
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
4331 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4304 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4332 } 4305 }
4333 } 4306 }
4334 4307
4335 4308
4336 #undef __ 4309 #undef __
4337 4310
4338 } } // namespace v8::internal 4311 } } // namespace v8::internal
4339 4312
4340 #endif // V8_TARGET_ARCH_IA32 4313 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | src/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698