| 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 2360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2371 Label success; | 2371 Label success; |
| 2372 // Check that the object is a boolean. | 2372 // Check that the object is a boolean. |
| 2373 __ CompareRoot(object, Heap::kTrueValueRootIndex); | 2373 __ CompareRoot(object, Heap::kTrueValueRootIndex); |
| 2374 __ j(equal, &success); | 2374 __ j(equal, &success); |
| 2375 __ CompareRoot(object, Heap::kFalseValueRootIndex); | 2375 __ CompareRoot(object, Heap::kFalseValueRootIndex); |
| 2376 __ j(not_equal, miss); | 2376 __ j(not_equal, miss); |
| 2377 __ bind(&success); | 2377 __ bind(&success); |
| 2378 } | 2378 } |
| 2379 | 2379 |
| 2380 | 2380 |
| 2381 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object) { | 2381 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object, |
| 2382 Handle<JSFunction> function) { |
| 2382 if (object->IsGlobalObject()) { | 2383 if (object->IsGlobalObject()) { |
| 2383 StackArgumentsAccessor args(rsp, arguments()); | 2384 StackArgumentsAccessor args(rsp, arguments()); |
| 2384 __ movq(rdx, FieldOperand(rdx, GlobalObject::kGlobalReceiverOffset)); | 2385 __ MoveHeapObject(rdx, handle(function->context()->global_proxy())); |
| 2385 __ movq(args.GetReceiverOperand(), rdx); | 2386 __ movq(args.GetReceiverOperand(), rdx); |
| 2386 } | 2387 } |
| 2387 } | 2388 } |
| 2389 |
| 2390 |
| 2391 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object, |
| 2392 Register function) { |
| 2393 if (object->IsGlobalObject()) { |
| 2394 FetchGlobalProxy(masm(), rdx, function); |
| 2395 StackArgumentsAccessor args(rsp, arguments().immediate()); |
| 2396 __ movq(args.GetReceiverOperand(), rdx); |
| 2397 } |
| 2398 } |
| 2388 | 2399 |
| 2389 | 2400 |
| 2390 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, | 2401 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, |
| 2391 Handle<JSObject> holder, | 2402 Handle<JSObject> holder, |
| 2392 Handle<Name> name, | 2403 Handle<Name> name, |
| 2393 CheckType check, | 2404 CheckType check, |
| 2394 Label* miss) { | 2405 Label* miss) { |
| 2395 GenerateNameCheck(name, miss); | 2406 GenerateNameCheck(name, miss); |
| 2396 | 2407 |
| 2397 Register reg = rdx; | 2408 Register reg = rdx; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2468 } | 2479 } |
| 2469 | 2480 |
| 2470 | 2481 |
| 2471 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, | 2482 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, |
| 2472 Register function, | 2483 Register function, |
| 2473 Label* miss) { | 2484 Label* miss) { |
| 2474 // Check that the function really is a function. | 2485 // Check that the function really is a function. |
| 2475 GenerateFunctionCheck(function, rbx, miss); | 2486 GenerateFunctionCheck(function, rbx, miss); |
| 2476 | 2487 |
| 2477 if (!function.is(rdi)) __ movq(rdi, function); | 2488 if (!function.is(rdi)) __ movq(rdi, function); |
| 2478 PatchGlobalProxy(object); | 2489 PatchGlobalProxy(object, function); |
| 2479 | 2490 |
| 2480 // Invoke the function. | 2491 // Invoke the function. |
| 2481 __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION, | 2492 __ InvokeFunction(rdi, arguments(), JUMP_FUNCTION, |
| 2482 NullCallWrapper(), call_kind()); | 2493 NullCallWrapper(), call_kind()); |
| 2483 } | 2494 } |
| 2484 | 2495 |
| 2485 | 2496 |
| 2486 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, | 2497 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
| 2487 Handle<JSObject> holder, | 2498 Handle<JSObject> holder, |
| 2488 Handle<Name> name) { | 2499 Handle<Name> name) { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 | 2592 |
| 2582 // Return the generated code. | 2593 // Return the generated code. |
| 2583 return GetCode(kind(), Code::FAST, name); | 2594 return GetCode(kind(), Code::FAST, name); |
| 2584 } | 2595 } |
| 2585 | 2596 |
| 2586 | 2597 |
| 2587 #undef __ | 2598 #undef __ |
| 2588 #define __ ACCESS_MASM(masm) | 2599 #define __ ACCESS_MASM(masm) |
| 2589 | 2600 |
| 2590 | 2601 |
| 2602 void CallStubCompiler::FetchGlobalProxy(MacroAssembler* masm, |
| 2603 Register target, |
| 2604 Register function) { |
| 2605 __ movq(target, FieldOperand(function, JSFunction::kContextOffset)); |
| 2606 __ movq(target, ContextOperand(target, Context::GLOBAL_OBJECT_INDEX)); |
| 2607 __ movq(target, FieldOperand(target, GlobalObject::kGlobalReceiverOffset)); |
| 2608 } |
| 2609 |
| 2610 |
| 2591 void StoreStubCompiler::GenerateStoreViaSetter( | 2611 void StoreStubCompiler::GenerateStoreViaSetter( |
| 2592 MacroAssembler* masm, | 2612 MacroAssembler* masm, |
| 2593 Handle<JSFunction> setter) { | 2613 Handle<JSFunction> setter) { |
| 2594 // ----------- S t a t e ------------- | 2614 // ----------- S t a t e ------------- |
| 2595 // -- rax : value | 2615 // -- rax : value |
| 2596 // -- rcx : name | 2616 // -- rcx : name |
| 2597 // -- rdx : receiver | 2617 // -- rdx : receiver |
| 2598 // -- rsp[0] : return address | 2618 // -- rsp[0] : return address |
| 2599 // ----------------------------------- | 2619 // ----------------------------------- |
| 2600 { | 2620 { |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2910 // ----------------------------------- | 2930 // ----------------------------------- |
| 2911 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2931 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 2912 } | 2932 } |
| 2913 | 2933 |
| 2914 | 2934 |
| 2915 #undef __ | 2935 #undef __ |
| 2916 | 2936 |
| 2917 } } // namespace v8::internal | 2937 } } // namespace v8::internal |
| 2918 | 2938 |
| 2919 #endif // V8_TARGET_ARCH_X64 | 2939 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |