| 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 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2334 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 2334 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
| 2335 __ cmp(object, ip); | 2335 __ cmp(object, ip); |
| 2336 __ b(eq, &success); | 2336 __ b(eq, &success); |
| 2337 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 2337 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
| 2338 __ cmp(object, ip); | 2338 __ cmp(object, ip); |
| 2339 __ b(ne, miss); | 2339 __ b(ne, miss); |
| 2340 __ bind(&success); | 2340 __ bind(&success); |
| 2341 } | 2341 } |
| 2342 | 2342 |
| 2343 | 2343 |
| 2344 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object, | 2344 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object) { |
| 2345 Handle<JSFunction> function) { | |
| 2346 if (object->IsGlobalObject()) { | 2345 if (object->IsGlobalObject()) { |
| 2347 const int argc = arguments().immediate(); | 2346 const int argc = arguments().immediate(); |
| 2348 const int receiver_offset = argc * kPointerSize; | 2347 const int receiver_offset = argc * kPointerSize; |
| 2349 __ Move(r3, handle(function->context()->global_proxy())); | 2348 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
| 2350 __ str(r3, MemOperand(sp, receiver_offset)); | 2349 __ str(r3, MemOperand(sp, receiver_offset)); |
| 2351 } | 2350 } |
| 2352 } | 2351 } |
| 2353 | |
| 2354 | |
| 2355 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object, | |
| 2356 Register function) { | |
| 2357 if (object->IsGlobalObject()) { | |
| 2358 FetchGlobalProxy(masm(), r3, function); | |
| 2359 const int argc = arguments().immediate(); | |
| 2360 const int receiver_offset = argc * kPointerSize; | |
| 2361 __ str(r3, MemOperand(sp, receiver_offset)); | |
| 2362 } | |
| 2363 } | |
| 2364 | 2352 |
| 2365 | 2353 |
| 2366 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, | 2354 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, |
| 2367 Handle<JSObject> holder, | 2355 Handle<JSObject> holder, |
| 2368 Handle<Name> name, | 2356 Handle<Name> name, |
| 2369 CheckType check, | 2357 CheckType check, |
| 2370 Label* miss) { | 2358 Label* miss) { |
| 2371 // ----------- S t a t e ------------- | 2359 // ----------- S t a t e ------------- |
| 2372 // -- r2 : name | 2360 // -- r2 : name |
| 2373 // -- lr : return address | 2361 // -- lr : return address |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2449 return reg; | 2437 return reg; |
| 2450 } | 2438 } |
| 2451 | 2439 |
| 2452 | 2440 |
| 2453 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, | 2441 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, |
| 2454 Register function, | 2442 Register function, |
| 2455 Label* miss) { | 2443 Label* miss) { |
| 2456 ASSERT(function.is(r1)); | 2444 ASSERT(function.is(r1)); |
| 2457 // Check that the function really is a function. | 2445 // Check that the function really is a function. |
| 2458 GenerateFunctionCheck(function, r3, miss); | 2446 GenerateFunctionCheck(function, r3, miss); |
| 2459 PatchGlobalProxy(object, function); | 2447 PatchGlobalProxy(object); |
| 2460 | 2448 |
| 2461 // Invoke the function. | 2449 // Invoke the function. |
| 2462 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION, | 2450 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION, |
| 2463 NullCallWrapper(), call_kind()); | 2451 NullCallWrapper(), call_kind()); |
| 2464 } | 2452 } |
| 2465 | 2453 |
| 2466 | 2454 |
| 2467 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, | 2455 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
| 2468 Handle<JSObject> holder, | 2456 Handle<JSObject> holder, |
| 2469 Handle<Name> name) { | 2457 Handle<Name> name) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2567 | 2555 |
| 2568 // Return the generated code. | 2556 // Return the generated code. |
| 2569 return GetCode(kind(), Code::FAST, name); | 2557 return GetCode(kind(), Code::FAST, name); |
| 2570 } | 2558 } |
| 2571 | 2559 |
| 2572 | 2560 |
| 2573 #undef __ | 2561 #undef __ |
| 2574 #define __ ACCESS_MASM(masm) | 2562 #define __ ACCESS_MASM(masm) |
| 2575 | 2563 |
| 2576 | 2564 |
| 2577 void CallStubCompiler::FetchGlobalProxy(MacroAssembler* masm, | |
| 2578 Register target, | |
| 2579 Register function) { | |
| 2580 __ ldr(target, FieldMemOperand(function, JSFunction::kContextOffset)); | |
| 2581 __ ldr(target, ContextOperand(target, Context::GLOBAL_OBJECT_INDEX)); | |
| 2582 __ ldr(target, FieldMemOperand(target, GlobalObject::kGlobalReceiverOffset)); | |
| 2583 } | |
| 2584 | |
| 2585 | |
| 2586 void StoreStubCompiler::GenerateStoreViaSetter( | 2565 void StoreStubCompiler::GenerateStoreViaSetter( |
| 2587 MacroAssembler* masm, | 2566 MacroAssembler* masm, |
| 2588 Handle<JSFunction> setter) { | 2567 Handle<JSFunction> setter) { |
| 2589 // ----------- S t a t e ------------- | 2568 // ----------- S t a t e ------------- |
| 2590 // -- r0 : value | 2569 // -- r0 : value |
| 2591 // -- r1 : receiver | 2570 // -- r1 : receiver |
| 2592 // -- r2 : name | 2571 // -- r2 : name |
| 2593 // -- lr : return address | 2572 // -- lr : return address |
| 2594 // ----------------------------------- | 2573 // ----------------------------------- |
| 2595 { | 2574 { |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 // ----------------------------------- | 2891 // ----------------------------------- |
| 2913 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2892 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
| 2914 } | 2893 } |
| 2915 | 2894 |
| 2916 | 2895 |
| 2917 #undef __ | 2896 #undef __ |
| 2918 | 2897 |
| 2919 } } // namespace v8::internal | 2898 } } // namespace v8::internal |
| 2920 | 2899 |
| 2921 #endif // V8_TARGET_ARCH_ARM | 2900 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |