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 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 __ LoadRoot(ip, Heap::kTrueValueRootIndex); | 2333 __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
2334 __ cmp(object, ip); | 2334 __ cmp(object, ip); |
2335 __ b(eq, &success); | 2335 __ b(eq, &success); |
2336 __ LoadRoot(ip, Heap::kFalseValueRootIndex); | 2336 __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
2337 __ cmp(object, ip); | 2337 __ cmp(object, ip); |
2338 __ b(ne, miss); | 2338 __ b(ne, miss); |
2339 __ bind(&success); | 2339 __ bind(&success); |
2340 } | 2340 } |
2341 | 2341 |
2342 | 2342 |
2343 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object) { | 2343 void CallStubCompiler::PatchGlobalProxy(Handle<Object> object, |
| 2344 Handle<JSFunction> function) { |
2344 if (object->IsGlobalObject()) { | 2345 if (object->IsGlobalObject()) { |
2345 const int argc = arguments().immediate(); | 2346 const int argc = arguments().immediate(); |
2346 const int receiver_offset = argc * kPointerSize; | 2347 const int receiver_offset = argc * kPointerSize; |
2347 __ ldr(r3, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); | 2348 __ Move(r3, handle(function->context()->global_proxy())); |
2348 __ str(r3, MemOperand(sp, receiver_offset)); | 2349 __ str(r3, MemOperand(sp, receiver_offset)); |
2349 } | 2350 } |
2350 } | 2351 } |
2351 | 2352 |
2352 | 2353 |
2353 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, | 2354 Register CallStubCompiler::HandlerFrontendHeader(Handle<Object> object, |
2354 Handle<JSObject> holder, | 2355 Handle<JSObject> holder, |
2355 Handle<Name> name, | 2356 Handle<Name> name, |
2356 CheckType check, | 2357 CheckType check, |
2357 Label* miss) { | 2358 Label* miss) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 return reg; | 2437 return reg; |
2437 } | 2438 } |
2438 | 2439 |
2439 | 2440 |
2440 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, | 2441 void CallStubCompiler::GenerateJumpFunction(Handle<Object> object, |
2441 Register function, | 2442 Register function, |
2442 Label* miss) { | 2443 Label* miss) { |
2443 ASSERT(function.is(r1)); | 2444 ASSERT(function.is(r1)); |
2444 // Check that the function really is a function. | 2445 // Check that the function really is a function. |
2445 GenerateFunctionCheck(function, r3, miss); | 2446 GenerateFunctionCheck(function, r3, miss); |
2446 PatchGlobalProxy(object); | 2447 PatchGlobalProxy(object, function); |
2447 | 2448 |
2448 // Invoke the function. | 2449 // Invoke the function. |
2449 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION, | 2450 __ InvokeFunction(r1, arguments(), JUMP_FUNCTION, |
2450 NullCallWrapper(), call_kind()); | 2451 NullCallWrapper(), call_kind()); |
2451 } | 2452 } |
2452 | 2453 |
2453 | 2454 |
2454 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, | 2455 Handle<Code> CallStubCompiler::CompileCallInterceptor(Handle<JSObject> object, |
2455 Handle<JSObject> holder, | 2456 Handle<JSObject> holder, |
2456 Handle<Name> name) { | 2457 Handle<Name> name) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2554 | 2555 |
2555 // Return the generated code. | 2556 // Return the generated code. |
2556 return GetCode(kind(), Code::FAST, name); | 2557 return GetCode(kind(), Code::FAST, name); |
2557 } | 2558 } |
2558 | 2559 |
2559 | 2560 |
2560 #undef __ | 2561 #undef __ |
2561 #define __ ACCESS_MASM(masm) | 2562 #define __ ACCESS_MASM(masm) |
2562 | 2563 |
2563 | 2564 |
| 2565 void CallStubCompiler::PatchGlobalProxy(MacroAssembler* masm, |
| 2566 int argc, |
| 2567 Register function) { |
| 2568 const int receiver_offset = argc * kPointerSize; |
| 2569 __ ldr(r3, FieldMemOperand(r0, JSFunction::kContextOffset)); |
| 2570 __ ldr(r3, ContextOperand(r3, Context::GLOBAL_OBJECT_INDEX)); |
| 2571 __ ldr(r3, FieldMemOperand(r3, GlobalObject::kGlobalReceiverOffset)); |
| 2572 __ str(r3, MemOperand(sp, receiver_offset)); |
| 2573 } |
| 2574 |
| 2575 |
2564 void StoreStubCompiler::GenerateStoreViaSetter( | 2576 void StoreStubCompiler::GenerateStoreViaSetter( |
2565 MacroAssembler* masm, | 2577 MacroAssembler* masm, |
2566 Handle<JSFunction> setter) { | 2578 Handle<JSFunction> setter) { |
2567 // ----------- S t a t e ------------- | 2579 // ----------- S t a t e ------------- |
2568 // -- r0 : value | 2580 // -- r0 : value |
2569 // -- r1 : receiver | 2581 // -- r1 : receiver |
2570 // -- r2 : name | 2582 // -- r2 : name |
2571 // -- lr : return address | 2583 // -- lr : return address |
2572 // ----------------------------------- | 2584 // ----------------------------------- |
2573 { | 2585 { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2890 // ----------------------------------- | 2902 // ----------------------------------- |
2891 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2903 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2892 } | 2904 } |
2893 | 2905 |
2894 | 2906 |
2895 #undef __ | 2907 #undef __ |
2896 | 2908 |
2897 } } // namespace v8::internal | 2909 } } // namespace v8::internal |
2898 | 2910 |
2899 #endif // V8_TARGET_ARCH_ARM | 2911 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |