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

Side by Side Diff: src/arm/macro-assembler-arm.cc

Issue 1406113007: Merge GlobalObject with JSGlobalObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm64/builtins-arm64.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 // 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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 // In debug mode, make sure the lexical context is set. 1470 // In debug mode, make sure the lexical context is set.
1471 #ifdef DEBUG 1471 #ifdef DEBUG
1472 cmp(scratch, Operand::Zero()); 1472 cmp(scratch, Operand::Zero());
1473 Check(ne, kWeShouldNotHaveAnEmptyLexicalContext); 1473 Check(ne, kWeShouldNotHaveAnEmptyLexicalContext);
1474 #endif 1474 #endif
1475 1475
1476 // Load the native context of the current context. 1476 // Load the native context of the current context.
1477 int offset = 1477 int offset =
1478 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; 1478 Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
1479 ldr(scratch, FieldMemOperand(scratch, offset)); 1479 ldr(scratch, FieldMemOperand(scratch, offset));
1480 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 1480 ldr(scratch, FieldMemOperand(scratch, JSGlobalObject::kNativeContextOffset));
1481 1481
1482 // Check the context is a native context. 1482 // Check the context is a native context.
1483 if (emit_debug_code()) { 1483 if (emit_debug_code()) {
1484 // Cannot use ip as a temporary in this verification code. Due to the fact 1484 // Cannot use ip as a temporary in this verification code. Due to the fact
1485 // that ip is clobbered as part of cmp with an object Operand. 1485 // that ip is clobbered as part of cmp with an object Operand.
1486 push(holder_reg); // Temporarily save holder on the stack. 1486 push(holder_reg); // Temporarily save holder on the stack.
1487 // Read the first word and compare to the native_context_map. 1487 // Read the first word and compare to the native_context_map.
1488 ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset)); 1488 ldr(holder_reg, FieldMemOperand(scratch, HeapObject::kMapOffset));
1489 LoadRoot(ip, Heap::kNativeContextMapRootIndex); 1489 LoadRoot(ip, Heap::kNativeContextMapRootIndex);
1490 cmp(holder_reg, ip); 1490 cmp(holder_reg, ip);
(...skipping 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after
2499 Jump(r2); 2499 Jump(r2);
2500 } 2500 }
2501 } 2501 }
2502 2502
2503 2503
2504 void MacroAssembler::GetBuiltinFunction(Register target, 2504 void MacroAssembler::GetBuiltinFunction(Register target,
2505 int native_context_index) { 2505 int native_context_index) {
2506 // Load the builtins object into target register. 2506 // Load the builtins object into target register.
2507 ldr(target, 2507 ldr(target,
2508 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 2508 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
2509 ldr(target, FieldMemOperand(target, GlobalObject::kNativeContextOffset)); 2509 ldr(target, FieldMemOperand(target, JSGlobalObject::kNativeContextOffset));
2510 // Load the JavaScript builtin function from the builtins object. 2510 // Load the JavaScript builtin function from the builtins object.
2511 ldr(target, ContextOperand(target, native_context_index)); 2511 ldr(target, ContextOperand(target, native_context_index));
2512 } 2512 }
2513 2513
2514 2514
2515 void MacroAssembler::GetBuiltinEntry(Register target, 2515 void MacroAssembler::GetBuiltinEntry(Register target,
2516 int native_context_index) { 2516 int native_context_index) {
2517 DCHECK(!target.is(r1)); 2517 DCHECK(!target.is(r1));
2518 GetBuiltinFunction(r1, native_context_index); 2518 GetBuiltinFunction(r1, native_context_index);
2519 // Load the code entry point from the builtins object. 2519 // Load the code entry point from the builtins object.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2646 // Slot is in the current function context. Move it into the 2646 // Slot is in the current function context. Move it into the
2647 // destination register in case we store into it (the write barrier 2647 // destination register in case we store into it (the write barrier
2648 // cannot be allowed to destroy the context in esi). 2648 // cannot be allowed to destroy the context in esi).
2649 mov(dst, cp); 2649 mov(dst, cp);
2650 } 2650 }
2651 } 2651 }
2652 2652
2653 2653
2654 void MacroAssembler::LoadGlobalProxy(Register dst) { 2654 void MacroAssembler::LoadGlobalProxy(Register dst) {
2655 ldr(dst, GlobalObjectOperand()); 2655 ldr(dst, GlobalObjectOperand());
2656 ldr(dst, FieldMemOperand(dst, GlobalObject::kGlobalProxyOffset)); 2656 ldr(dst, FieldMemOperand(dst, JSGlobalObject::kGlobalProxyOffset));
2657 } 2657 }
2658 2658
2659 2659
2660 void MacroAssembler::LoadTransitionedArrayMapConditional( 2660 void MacroAssembler::LoadTransitionedArrayMapConditional(
2661 ElementsKind expected_kind, 2661 ElementsKind expected_kind,
2662 ElementsKind transitioned_kind, 2662 ElementsKind transitioned_kind,
2663 Register map_in_out, 2663 Register map_in_out,
2664 Register scratch, 2664 Register scratch,
2665 Label* no_map_match) { 2665 Label* no_map_match) {
2666 // Load the global or builtins object from the current context. 2666 // Load the global or builtins object from the current context.
2667 ldr(scratch, 2667 ldr(scratch,
2668 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 2668 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
2669 ldr(scratch, FieldMemOperand(scratch, GlobalObject::kNativeContextOffset)); 2669 ldr(scratch, FieldMemOperand(scratch, JSGlobalObject::kNativeContextOffset));
2670 2670
2671 // Check that the function's map is the same as the expected cached map. 2671 // Check that the function's map is the same as the expected cached map.
2672 ldr(scratch, 2672 ldr(scratch,
2673 MemOperand(scratch, 2673 MemOperand(scratch,
2674 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); 2674 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX)));
2675 size_t offset = expected_kind * kPointerSize + 2675 size_t offset = expected_kind * kPointerSize +
2676 FixedArrayBase::kHeaderSize; 2676 FixedArrayBase::kHeaderSize;
2677 ldr(ip, FieldMemOperand(scratch, offset)); 2677 ldr(ip, FieldMemOperand(scratch, offset));
2678 cmp(map_in_out, ip); 2678 cmp(map_in_out, ip);
2679 b(ne, no_map_match); 2679 b(ne, no_map_match);
2680 2680
2681 // Use the transitioned cached map. 2681 // Use the transitioned cached map.
2682 offset = transitioned_kind * kPointerSize + 2682 offset = transitioned_kind * kPointerSize +
2683 FixedArrayBase::kHeaderSize; 2683 FixedArrayBase::kHeaderSize;
2684 ldr(map_in_out, FieldMemOperand(scratch, offset)); 2684 ldr(map_in_out, FieldMemOperand(scratch, offset));
2685 } 2685 }
2686 2686
2687 2687
2688 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 2688 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2689 // Load the global or builtins object from the current context. 2689 // Load the global or builtins object from the current context.
2690 ldr(function, 2690 ldr(function,
2691 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 2691 MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
2692 // Load the native context from the global or builtins object. 2692 // Load the native context from the global or builtins object.
2693 ldr(function, FieldMemOperand(function, 2693 ldr(function,
2694 GlobalObject::kNativeContextOffset)); 2694 FieldMemOperand(function, JSGlobalObject::kNativeContextOffset));
2695 // Load the function from the native context. 2695 // Load the function from the native context.
2696 ldr(function, MemOperand(function, Context::SlotOffset(index))); 2696 ldr(function, MemOperand(function, Context::SlotOffset(index)));
2697 } 2697 }
2698 2698
2699 2699
2700 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function, 2700 void MacroAssembler::LoadGlobalFunctionInitialMap(Register function,
2701 Register map, 2701 Register map,
2702 Register scratch) { 2702 Register scratch) {
2703 // Load the initial map. The global functions all have initial maps. 2703 // Load the initial map. The global functions all have initial maps.
2704 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset)); 2704 ldr(map, FieldMemOperand(function, JSFunction::kPrototypeOrInitialMapOffset));
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3723 } 3723 }
3724 } 3724 }
3725 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift)); 3725 if (mag.shift > 0) mov(result, Operand(result, ASR, mag.shift));
3726 add(result, result, Operand(dividend, LSR, 31)); 3726 add(result, result, Operand(dividend, LSR, 31));
3727 } 3727 }
3728 3728
3729 } // namespace internal 3729 } // namespace internal
3730 } // namespace v8 3730 } // namespace v8
3731 3731
3732 #endif // V8_TARGET_ARCH_ARM 3732 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698