OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2416 ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); | 2416 ldr(result, FieldMemOperand(map, Map::kConstructorOrBackPointerOffset)); |
2417 bind(&loop); | 2417 bind(&loop); |
2418 JumpIfSmi(result, &done); | 2418 JumpIfSmi(result, &done); |
2419 CompareObjectType(result, temp, temp2, MAP_TYPE); | 2419 CompareObjectType(result, temp, temp2, MAP_TYPE); |
2420 b(ne, &done); | 2420 b(ne, &done); |
2421 ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); | 2421 ldr(result, FieldMemOperand(result, Map::kConstructorOrBackPointerOffset)); |
2422 b(&loop); | 2422 b(&loop); |
2423 bind(&done); | 2423 bind(&done); |
2424 } | 2424 } |
2425 | 2425 |
2426 | |
2427 void MacroAssembler::TryGetFunctionPrototype(Register function, Register result, | |
2428 Register scratch, Label* miss) { | |
2429 // Get the prototype or initial map from the function. | |
2430 ldr(result, | |
2431 FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); | |
2432 | |
2433 // If the prototype or initial map is the hole, don't return it and | |
2434 // simply miss the cache instead. This will allow us to allocate a | |
2435 // prototype object on-demand in the runtime system. | |
2436 LoadRoot(ip, Heap::kTheHoleValueRootIndex); | |
2437 cmp(result, ip); | |
2438 b(eq, miss); | |
2439 | |
2440 // If the function does not have an initial map, we're done. | |
2441 Label done; | |
2442 CompareObjectType(result, scratch, scratch, MAP_TYPE); | |
2443 b(ne, &done); | |
2444 | |
2445 // Get the prototype from the initial map. | |
2446 ldr(result, FieldMemOperand(result, Map::kPrototypeOffset)); | |
2447 | |
2448 // All done. | |
2449 bind(&done); | |
2450 } | |
2451 | |
2452 | |
2453 void MacroAssembler::CallStub(CodeStub* stub, | 2426 void MacroAssembler::CallStub(CodeStub* stub, |
2454 TypeFeedbackId ast_id, | 2427 TypeFeedbackId ast_id, |
2455 Condition cond) { | 2428 Condition cond) { |
2456 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. | 2429 DCHECK(AllowThisStubCall(stub)); // Stub calls are not allowed in some stubs. |
2457 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond); | 2430 Call(stub->GetCode(), RelocInfo::CODE_TARGET, ast_id, cond); |
2458 } | 2431 } |
2459 | 2432 |
2460 | 2433 |
2461 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { | 2434 void MacroAssembler::TailCallStub(CodeStub* stub, Condition cond) { |
2462 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); | 2435 Jump(stub->GetCode(), RelocInfo::CODE_TARGET, cond); |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3862 } | 3835 } |
3863 } | 3836 } |
3864 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); | 3837 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); |
3865 add(result, result, Operand(dividend, LSR, 31)); | 3838 add(result, result, Operand(dividend, LSR, 31)); |
3866 } | 3839 } |
3867 | 3840 |
3868 } // namespace internal | 3841 } // namespace internal |
3869 } // namespace v8 | 3842 } // namespace v8 |
3870 | 3843 |
3871 #endif // V8_TARGET_ARCH_ARM | 3844 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |