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

Side by Side Diff: src/mips/simulator-mips.cc

Issue 7860035: Merge bleeding edge up to 9192 into the GC branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 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/mips/regexp-macro-assembler-mips.cc ('k') | src/mips/stub-cache-mips.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 int32_t func = instr->FunctionFieldRaw(); 1402 int32_t func = instr->FunctionFieldRaw();
1403 uint32_t code = (func == BREAK) ? instr->Bits(25, 6) : -1; 1403 uint32_t code = (func == BREAK) ? instr->Bits(25, 6) : -1;
1404 1404
1405 // We first check if we met a call_rt_redirected. 1405 // We first check if we met a call_rt_redirected.
1406 if (instr->InstructionBits() == rtCallRedirInstr) { 1406 if (instr->InstructionBits() == rtCallRedirInstr) {
1407 Redirection* redirection = Redirection::FromSwiInstruction(instr); 1407 Redirection* redirection = Redirection::FromSwiInstruction(instr);
1408 int32_t arg0 = get_register(a0); 1408 int32_t arg0 = get_register(a0);
1409 int32_t arg1 = get_register(a1); 1409 int32_t arg1 = get_register(a1);
1410 int32_t arg2 = get_register(a2); 1410 int32_t arg2 = get_register(a2);
1411 int32_t arg3 = get_register(a3); 1411 int32_t arg3 = get_register(a3);
1412 int32_t arg4 = 0;
1413 int32_t arg5 = 0;
1414 1412
1415 // Need to check if sp is valid before assigning arg4, arg5.
1416 // This is a fix for cctest test-api/CatchStackOverflow which causes
1417 // the stack to overflow. For some reason arm doesn't need this
1418 // stack check here.
1419 int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp)); 1413 int32_t* stack_pointer = reinterpret_cast<int32_t*>(get_register(sp));
1420 int32_t* stack = reinterpret_cast<int32_t*>(stack_); 1414 // Args 4 and 5 are on the stack after the reserved space for args 0..3.
1421 if (stack_pointer >= stack && stack_pointer < stack + stack_size_ - 5) { 1415 int32_t arg4 = stack_pointer[4];
1422 // Args 4 and 5 are on the stack after the reserved space for args 0..3. 1416 int32_t arg5 = stack_pointer[5];
1423 arg4 = stack_pointer[4];
1424 arg5 = stack_pointer[5];
1425 }
1426 1417
1427 bool fp_call = 1418 bool fp_call =
1428 (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) || 1419 (redirection->type() == ExternalReference::BUILTIN_FP_FP_CALL) ||
1429 (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) || 1420 (redirection->type() == ExternalReference::BUILTIN_COMPARE_CALL) ||
1430 (redirection->type() == ExternalReference::BUILTIN_FP_CALL) || 1421 (redirection->type() == ExternalReference::BUILTIN_FP_CALL) ||
1431 (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL); 1422 (redirection->type() == ExternalReference::BUILTIN_FP_INT_CALL);
1432 1423
1433 if (!IsMipsSoftFloatABI) { 1424 if (!IsMipsSoftFloatABI) {
1434 // With the hard floating point calling convention, double 1425 // With the hard floating point calling convention, double
1435 // arguments are passed in FPU registers. Fetch the arguments 1426 // arguments are passed in FPU registers. Fetch the arguments
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
2718 int original_stack = get_register(sp); 2709 int original_stack = get_register(sp);
2719 // Compute position of stack on entry to generated code. 2710 // Compute position of stack on entry to generated code.
2720 int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t) 2711 int entry_stack = (original_stack - (argument_count - 4) * sizeof(int32_t)
2721 - kCArgsSlotsSize); 2712 - kCArgsSlotsSize);
2722 if (OS::ActivationFrameAlignment() != 0) { 2713 if (OS::ActivationFrameAlignment() != 0) {
2723 entry_stack &= -OS::ActivationFrameAlignment(); 2714 entry_stack &= -OS::ActivationFrameAlignment();
2724 } 2715 }
2725 // Store remaining arguments on stack, from low to high memory. 2716 // Store remaining arguments on stack, from low to high memory.
2726 intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack); 2717 intptr_t* stack_argument = reinterpret_cast<intptr_t*>(entry_stack);
2727 for (int i = 4; i < argument_count; i++) { 2718 for (int i = 4; i < argument_count; i++) {
2728 stack_argument[i - 4 + kArgsSlotsNum] = va_arg(parameters, int32_t); 2719 stack_argument[i - 4 + kCArgSlotCount] = va_arg(parameters, int32_t);
2729 } 2720 }
2730 va_end(parameters); 2721 va_end(parameters);
2731 set_register(sp, entry_stack); 2722 set_register(sp, entry_stack);
2732 2723
2733 // Prepare to execute the code at entry. 2724 // Prepare to execute the code at entry.
2734 set_register(pc, reinterpret_cast<int32_t>(entry)); 2725 set_register(pc, reinterpret_cast<int32_t>(entry));
2735 // Put down marker for end of simulation. The simulator will stop simulation 2726 // Put down marker for end of simulation. The simulator will stop simulation
2736 // when the PC reaches this value. By saving the "end simulation" value into 2727 // when the PC reaches this value. By saving the "end simulation" value into
2737 // the LR the simulation stops when returning to this call point. 2728 // the LR the simulation stops when returning to this call point.
2738 set_register(ra, end_sim_pc); 2729 set_register(ra, end_sim_pc);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
2821 } 2812 }
2822 2813
2823 2814
2824 #undef UNSUPPORTED 2815 #undef UNSUPPORTED
2825 2816
2826 } } // namespace v8::internal 2817 } } // namespace v8::internal
2827 2818
2828 #endif // USE_SIMULATOR 2819 #endif // USE_SIMULATOR
2829 2820
2830 #endif // V8_TARGET_ARCH_MIPS 2821 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/regexp-macro-assembler-mips.cc ('k') | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698