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

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

Issue 142693005: A64: Synchronize with r16918. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.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 // 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 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1330 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, 1330 void MacroAssembler::PushTryHandler(StackHandler::Kind kind,
1331 int handler_index) { 1331 int handler_index) {
1332 // Adjust this code if not the case. 1332 // Adjust this code if not the case.
1333 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize); 1333 STATIC_ASSERT(StackHandlerConstants::kSize == 5 * kPointerSize);
1334 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); 1334 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
1335 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize); 1335 STATIC_ASSERT(StackHandlerConstants::kCodeOffset == 1 * kPointerSize);
1336 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize); 1336 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 2 * kPointerSize);
1337 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize); 1337 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 3 * kPointerSize);
1338 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize); 1338 STATIC_ASSERT(StackHandlerConstants::kFPOffset == 4 * kPointerSize);
1339 1339
1340 // For the JSEntry handler, we must preserve r0-r4, r5-r7 are available. 1340 // For the JSEntry handler, we must preserve r0-r4, r5-r6 are available.
1341 // We will build up the handler from the bottom by pushing on the stack. 1341 // We will build up the handler from the bottom by pushing on the stack.
1342 // Set up the code object (r5) and the state (r6) for pushing. 1342 // Set up the code object (r5) and the state (r6) for pushing.
1343 unsigned state = 1343 unsigned state =
1344 StackHandler::IndexField::encode(handler_index) | 1344 StackHandler::IndexField::encode(handler_index) |
1345 StackHandler::KindField::encode(kind); 1345 StackHandler::KindField::encode(kind);
1346 mov(r5, Operand(CodeObject())); 1346 mov(r5, Operand(CodeObject()));
1347 mov(r6, Operand(state)); 1347 mov(r6, Operand(state));
1348 1348
1349 // Push the frame pointer, context, state, and code object. 1349 // Push the frame pointer, context, state, and code object.
1350 if (kind == StackHandler::JS_ENTRY) { 1350 if (kind == StackHandler::JS_ENTRY) {
1351 mov(r7, Operand(Smi::FromInt(0))); // Indicates no context. 1351 mov(cp, Operand(Smi::FromInt(0))); // Indicates no context.
1352 mov(ip, Operand::Zero()); // NULL frame pointer. 1352 mov(ip, Operand::Zero()); // NULL frame pointer.
1353 stm(db_w, sp, r5.bit() | r6.bit() | r7.bit() | ip.bit()); 1353 stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | ip.bit());
1354 } else { 1354 } else {
1355 stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | fp.bit()); 1355 stm(db_w, sp, r5.bit() | r6.bit() | cp.bit() | fp.bit());
1356 } 1356 }
1357 1357
1358 // Link the current handler as the next handler. 1358 // Link the current handler as the next handler.
1359 mov(r6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); 1359 mov(r6, Operand(ExternalReference(Isolate::kHandlerAddress, isolate())));
1360 ldr(r5, MemOperand(r6)); 1360 ldr(r5, MemOperand(r6));
1361 push(r5); 1361 push(r5);
1362 // Set this new handler as the current one. 1362 // Set this new handler as the current one.
1363 str(sp, MemOperand(r6)); 1363 str(sp, MemOperand(r6));
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 ExternalReference next_address = 2298 ExternalReference next_address =
2299 ExternalReference::handle_scope_next_address(isolate()); 2299 ExternalReference::handle_scope_next_address(isolate());
2300 const int kNextOffset = 0; 2300 const int kNextOffset = 0;
2301 const int kLimitOffset = AddressOffset( 2301 const int kLimitOffset = AddressOffset(
2302 ExternalReference::handle_scope_limit_address(isolate()), 2302 ExternalReference::handle_scope_limit_address(isolate()),
2303 next_address); 2303 next_address);
2304 const int kLevelOffset = AddressOffset( 2304 const int kLevelOffset = AddressOffset(
2305 ExternalReference::handle_scope_level_address(isolate()), 2305 ExternalReference::handle_scope_level_address(isolate()),
2306 next_address); 2306 next_address);
2307 2307
2308 ASSERT(!thunk_last_arg.is(r3));
2309
2308 // Allocate HandleScope in callee-save registers. 2310 // Allocate HandleScope in callee-save registers.
2309 mov(r7, Operand(next_address)); 2311 mov(r9, Operand(next_address));
2310 ldr(r4, MemOperand(r7, kNextOffset)); 2312 ldr(r4, MemOperand(r9, kNextOffset));
2311 ldr(r5, MemOperand(r7, kLimitOffset)); 2313 ldr(r5, MemOperand(r9, kLimitOffset));
2312 ldr(r6, MemOperand(r7, kLevelOffset)); 2314 ldr(r6, MemOperand(r9, kLevelOffset));
2313 add(r6, r6, Operand(1)); 2315 add(r6, r6, Operand(1));
2314 str(r6, MemOperand(r7, kLevelOffset)); 2316 str(r6, MemOperand(r9, kLevelOffset));
2315 2317
2316 if (FLAG_log_timer_events) { 2318 if (FLAG_log_timer_events) {
2317 FrameScope frame(this, StackFrame::MANUAL); 2319 FrameScope frame(this, StackFrame::MANUAL);
2318 PushSafepointRegisters(); 2320 PushSafepointRegisters();
2319 PrepareCallCFunction(1, r0); 2321 PrepareCallCFunction(1, r0);
2320 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); 2322 mov(r0, Operand(ExternalReference::isolate_address(isolate())));
2321 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1); 2323 CallCFunction(ExternalReference::log_enter_external_function(isolate()), 1);
2322 PopSafepointRegisters(); 2324 PopSafepointRegisters();
2323 } 2325 }
2324 2326
2325 ASSERT(!thunk_last_arg.is(r3));
2326 Label profiler_disabled; 2327 Label profiler_disabled;
2327 Label end_profiler_check; 2328 Label end_profiler_check;
2328 bool* is_profiling_flag = 2329 bool* is_profiling_flag =
2329 isolate()->cpu_profiler()->is_profiling_address(); 2330 isolate()->cpu_profiler()->is_profiling_address();
2330 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1); 2331 STATIC_ASSERT(sizeof(*is_profiling_flag) == 1);
2331 mov(r3, Operand(reinterpret_cast<int32_t>(is_profiling_flag))); 2332 mov(r3, Operand(reinterpret_cast<int32_t>(is_profiling_flag)));
2332 ldrb(r3, MemOperand(r3, 0)); 2333 ldrb(r3, MemOperand(r3, 0));
2333 cmp(r3, Operand(0)); 2334 cmp(r3, Operand(0));
2334 b(eq, &profiler_disabled); 2335 b(eq, &profiler_disabled);
2335 2336
(...skipping 25 matching lines...) Expand all
2361 Label exception_handled; 2362 Label exception_handled;
2362 Label delete_allocated_handles; 2363 Label delete_allocated_handles;
2363 Label leave_exit_frame; 2364 Label leave_exit_frame;
2364 Label return_value_loaded; 2365 Label return_value_loaded;
2365 2366
2366 // load value from ReturnValue 2367 // load value from ReturnValue
2367 ldr(r0, return_value_operand); 2368 ldr(r0, return_value_operand);
2368 bind(&return_value_loaded); 2369 bind(&return_value_loaded);
2369 // No more valid handles (the result handle was the last one). Restore 2370 // No more valid handles (the result handle was the last one). Restore
2370 // previous handle scope. 2371 // previous handle scope.
2371 str(r4, MemOperand(r7, kNextOffset)); 2372 str(r4, MemOperand(r9, kNextOffset));
2372 if (emit_debug_code()) { 2373 if (emit_debug_code()) {
2373 ldr(r1, MemOperand(r7, kLevelOffset)); 2374 ldr(r1, MemOperand(r9, kLevelOffset));
2374 cmp(r1, r6); 2375 cmp(r1, r6);
2375 Check(eq, kUnexpectedLevelAfterReturnFromApiCall); 2376 Check(eq, kUnexpectedLevelAfterReturnFromApiCall);
2376 } 2377 }
2377 sub(r6, r6, Operand(1)); 2378 sub(r6, r6, Operand(1));
2378 str(r6, MemOperand(r7, kLevelOffset)); 2379 str(r6, MemOperand(r9, kLevelOffset));
2379 ldr(ip, MemOperand(r7, kLimitOffset)); 2380 ldr(ip, MemOperand(r9, kLimitOffset));
2380 cmp(r5, ip); 2381 cmp(r5, ip);
2381 b(ne, &delete_allocated_handles); 2382 b(ne, &delete_allocated_handles);
2382 2383
2383 // Check if the function scheduled an exception. 2384 // Check if the function scheduled an exception.
2384 bind(&leave_exit_frame); 2385 bind(&leave_exit_frame);
2385 LoadRoot(r4, Heap::kTheHoleValueRootIndex); 2386 LoadRoot(r4, Heap::kTheHoleValueRootIndex);
2386 mov(ip, Operand(ExternalReference::scheduled_exception_address(isolate()))); 2387 mov(ip, Operand(ExternalReference::scheduled_exception_address(isolate())));
2387 ldr(r5, MemOperand(ip)); 2388 ldr(r5, MemOperand(ip));
2388 cmp(r4, r5); 2389 cmp(r4, r5);
2389 b(ne, &promote_scheduled_exception); 2390 b(ne, &promote_scheduled_exception);
(...skipping 12 matching lines...) Expand all
2402 { 2403 {
2403 FrameScope frame(this, StackFrame::INTERNAL); 2404 FrameScope frame(this, StackFrame::INTERNAL);
2404 CallExternalReference( 2405 CallExternalReference(
2405 ExternalReference(Runtime::kPromoteScheduledException, isolate()), 2406 ExternalReference(Runtime::kPromoteScheduledException, isolate()),
2406 0); 2407 0);
2407 } 2408 }
2408 jmp(&exception_handled); 2409 jmp(&exception_handled);
2409 2410
2410 // HandleScope limit has changed. Delete allocated extensions. 2411 // HandleScope limit has changed. Delete allocated extensions.
2411 bind(&delete_allocated_handles); 2412 bind(&delete_allocated_handles);
2412 str(r5, MemOperand(r7, kLimitOffset)); 2413 str(r5, MemOperand(r9, kLimitOffset));
2413 mov(r4, r0); 2414 mov(r4, r0);
2414 PrepareCallCFunction(1, r5); 2415 PrepareCallCFunction(1, r5);
2415 mov(r0, Operand(ExternalReference::isolate_address(isolate()))); 2416 mov(r0, Operand(ExternalReference::isolate_address(isolate())));
2416 CallCFunction( 2417 CallCFunction(
2417 ExternalReference::delete_handle_scope_extensions(isolate()), 1); 2418 ExternalReference::delete_handle_scope_extensions(isolate()), 1);
2418 mov(r0, r4); 2419 mov(r0, r4);
2419 jmp(&leave_exit_frame); 2420 jmp(&leave_exit_frame);
2420 } 2421 }
2421 2422
2422 2423
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
3284 vstr(double_scratch.low(), 3285 vstr(double_scratch.low(),
3285 FieldMemOperand(dst, (field_count - 1) * kPointerSize)); 3286 FieldMemOperand(dst, (field_count - 1) * kPointerSize));
3286 } 3287 }
3287 } 3288 }
3288 3289
3289 3290
3290 void MacroAssembler::CopyBytes(Register src, 3291 void MacroAssembler::CopyBytes(Register src,
3291 Register dst, 3292 Register dst,
3292 Register length, 3293 Register length,
3293 Register scratch) { 3294 Register scratch) {
3294 Label align_loop, align_loop_1, word_loop, byte_loop, byte_loop_1, done; 3295 Label align_loop_1, word_loop, byte_loop, byte_loop_1, done;
3295 3296
3296 // Align src before copying in word size chunks. 3297 // Align src before copying in word size chunks.
3297 bind(&align_loop); 3298 cmp(length, Operand(kPointerSize));
3298 cmp(length, Operand::Zero()); 3299 b(le, &byte_loop);
3299 b(eq, &done); 3300
3300 bind(&align_loop_1); 3301 bind(&align_loop_1);
3301 tst(src, Operand(kPointerSize - 1)); 3302 tst(src, Operand(kPointerSize - 1));
3302 b(eq, &word_loop); 3303 b(eq, &word_loop);
3303 ldrb(scratch, MemOperand(src, 1, PostIndex)); 3304 ldrb(scratch, MemOperand(src, 1, PostIndex));
3304 strb(scratch, MemOperand(dst, 1, PostIndex)); 3305 strb(scratch, MemOperand(dst, 1, PostIndex));
3305 sub(length, length, Operand(1), SetCC); 3306 sub(length, length, Operand(1), SetCC);
3306 b(ne, &byte_loop_1); 3307 b(&align_loop_1);
3307
3308 // Copy bytes in word size chunks. 3308 // Copy bytes in word size chunks.
3309 bind(&word_loop); 3309 bind(&word_loop);
3310 if (emit_debug_code()) { 3310 if (emit_debug_code()) {
3311 tst(src, Operand(kPointerSize - 1)); 3311 tst(src, Operand(kPointerSize - 1));
3312 Assert(eq, kExpectingAlignmentForCopyBytes); 3312 Assert(eq, kExpectingAlignmentForCopyBytes);
3313 } 3313 }
3314 cmp(length, Operand(kPointerSize)); 3314 cmp(length, Operand(kPointerSize));
3315 b(lt, &byte_loop); 3315 b(lt, &byte_loop);
3316 ldr(scratch, MemOperand(src, kPointerSize, PostIndex)); 3316 ldr(scratch, MemOperand(src, kPointerSize, PostIndex));
3317 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) { 3317 if (CpuFeatures::IsSupported(UNALIGNED_ACCESSES)) {
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
3885 add(scratch_reg, receiver_reg, 3885 add(scratch_reg, receiver_reg,
3886 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag)); 3886 Operand(JSArray::kSize + AllocationMemento::kSize - kHeapObjectTag));
3887 cmp(scratch_reg, Operand(new_space_start)); 3887 cmp(scratch_reg, Operand(new_space_start));
3888 b(lt, &no_memento_available); 3888 b(lt, &no_memento_available);
3889 mov(ip, Operand(new_space_allocation_top)); 3889 mov(ip, Operand(new_space_allocation_top));
3890 ldr(ip, MemOperand(ip)); 3890 ldr(ip, MemOperand(ip));
3891 cmp(scratch_reg, ip); 3891 cmp(scratch_reg, ip);
3892 b(gt, &no_memento_available); 3892 b(gt, &no_memento_available);
3893 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize)); 3893 ldr(scratch_reg, MemOperand(scratch_reg, -AllocationMemento::kSize));
3894 cmp(scratch_reg, 3894 cmp(scratch_reg,
3895 Operand(Handle<Map>(isolate()->heap()->allocation_memento_map()))); 3895 Operand(isolate()->factory()->allocation_memento_map()));
3896 bind(&no_memento_available); 3896 bind(&no_memento_available);
3897 } 3897 }
3898 3898
3899 3899
3900 Register GetRegisterThatIsNotOneOf(Register reg1, 3900 Register GetRegisterThatIsNotOneOf(Register reg1,
3901 Register reg2, 3901 Register reg2,
3902 Register reg3, 3902 Register reg3,
3903 Register reg4, 3903 Register reg4,
3904 Register reg5, 3904 Register reg5,
3905 Register reg6) { 3905 Register reg6) {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
3984 void CodePatcher::EmitCondition(Condition cond) { 3984 void CodePatcher::EmitCondition(Condition cond) {
3985 Instr instr = Assembler::instr_at(masm_.pc_); 3985 Instr instr = Assembler::instr_at(masm_.pc_);
3986 instr = (instr & ~kCondMask) | cond; 3986 instr = (instr & ~kCondMask) | cond;
3987 masm_.emit(instr); 3987 masm_.emit(instr);
3988 } 3988 }
3989 3989
3990 3990
3991 } } // namespace v8::internal 3991 } } // namespace v8::internal
3992 3992
3993 #endif // V8_TARGET_ARCH_ARM 3993 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm/stub-cache-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698