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

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

Issue 104013008: Reland v8:18458 "Load the global proxy from the context of the target function." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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/lithium-ia32.cc ('k') | src/runtime.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 2450 matching lines...) Expand 10 before | Expand all | Expand 10 after
2461 Label success; 2461 Label success;
2462 // Check that the object is a boolean. 2462 // Check that the object is a boolean.
2463 __ cmp(object, factory()->true_value()); 2463 __ cmp(object, factory()->true_value());
2464 __ j(equal, &success); 2464 __ j(equal, &success);
2465 __ cmp(object, factory()->false_value()); 2465 __ cmp(object, factory()->false_value());
2466 __ j(not_equal, miss); 2466 __ j(not_equal, miss);
2467 __ bind(&success); 2467 __ bind(&success);
2468 } 2468 }
2469 2469
2470 2470
2471 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object) { 2471 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object,
2472 Handle<JSFunction> function) {
2472 if (object->IsGlobalObject()) { 2473 if (object->IsGlobalObject()) {
2473 const int argc = arguments().immediate(); 2474 const int argc = arguments().immediate();
2474 const int receiver_offset = (argc + 1) * kPointerSize; 2475 const int receiver_offset = (argc + 1) * kPointerSize;
2475 __ mov(edx, FieldOperand(edx, GlobalObject::kGlobalReceiverOffset)); 2476 __ LoadHeapObject(edx, handle(function->context()->global_proxy()));
2476 __ mov(Operand(esp, receiver_offset), edx); 2477 __ mov(Operand(esp, receiver_offset), edx);
2477 } 2478 }
2478 } 2479 }
2480
2481
2482 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object,
2483 Register function) {
2484 if (object->IsGlobalObject()) {
2485 FetchGlobalProxy(masm(), edx, function);
2486 const int argc = arguments().immediate();
2487 const int receiver_offset = (argc + 1) * kPointerSize;
2488 __ mov(Operand(esp, receiver_offset), edx);
2489 }
2490 }
2479 2491
2480 2492
2481 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, 2493 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object,
2482 Handle<JSObject> holder, 2494 Handle<JSObject> holder,
2483 Handle<Name> name, 2495 Handle<Name> name,
2484 CheckType check, 2496 CheckType check,
2485 Label* miss) { 2497 Label* miss) {
2486 GenerateNameCheck(name, miss); 2498 GenerateNameCheck(name, miss);
2487 2499
2488 Register reg = edx; 2500 Register reg = edx;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
2559 } 2571 }
2560 2572
2561 2573
2562 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, 2574 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object,
2563 Register function, 2575 Register function,
2564 Label* miss) { 2576 Label* miss) {
2565 // Check that the function really is a function. 2577 // Check that the function really is a function.
2566 GenerateFunctionCheck(function, ebx, miss); 2578 GenerateFunctionCheck(function, ebx, miss);
2567 2579
2568 if (!function.is(edi)) __ mov(edi, function); 2580 if (!function.is(edi)) __ mov(edi, function);
2569 PatchGlobalProxy(object); 2581 PatchGlobalProxy(object, function);
2570 2582
2571 // Invoke the function. 2583 // Invoke the function.
2572 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION, 2584 __ InvokeFunction(edi, arguments(), JUMP_FUNCTION,
2573 NullCallWrapper(), call_kind()); 2585 NullCallWrapper(), call_kind());
2574 } 2586 }
2575 2587
2576 2588
2577 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, 2589 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object,
2578 Handle<JSObject> holder, 2590 Handle<JSObject> holder,
2579 Handle<Name> name) { 2591 Handle<Name> name) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2674 2686
2675 // Return the generated code. 2687 // Return the generated code.
2676 return GetCode(kind(), Code::FAST, name); 2688 return GetCode(kind(), Code::FAST, name);
2677 } 2689 }
2678 2690
2679 2691
2680 #undef __ 2692 #undef __
2681 #define __ ACCESS_MASM(masm) 2693 #define __ ACCESS_MASM(masm)
2682 2694
2683 2695
2696 void CallStubCompiler::FetchGlobalProxy(MacroAssembler* masm,
2697 Register target,
2698 Register function) {
2699 __ mov(target, FieldOperand(function, JSFunction::kContextOffset));
2700 __ mov(target, ContextOperand(target, Context::GLOBAL_OBJECT_INDEX));
2701 __ mov(target, FieldOperand(target, GlobalObject::kGlobalReceiverOffset));
2702 }
2703
2704
2684 void StoreStubCompiler::GenerateStoreViaSetter( 2705 void StoreStubCompiler::GenerateStoreViaSetter(
2685 MacroAssembler* masm, 2706 MacroAssembler* masm,
2686 Handle<JSFunction> setter) { 2707 Handle<JSFunction> setter) {
2687 // ----------- S t a t e ------------- 2708 // ----------- S t a t e -------------
2688 // -- eax : value 2709 // -- eax : value
2689 // -- ecx : name 2710 // -- ecx : name
2690 // -- edx : receiver 2711 // -- edx : receiver
2691 // -- esp[0] : return address 2712 // -- esp[0] : return address
2692 // ----------------------------------- 2713 // -----------------------------------
2693 { 2714 {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 // ----------------------------------- 3014 // -----------------------------------
2994 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 3015 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
2995 } 3016 }
2996 3017
2997 3018
2998 #undef __ 3019 #undef __
2999 3020
3000 } } // namespace v8::internal 3021 } } // namespace v8::internal
3001 3022
3002 #endif // V8_TARGET_ARCH_IA32 3023 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/lithium-ia32.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698