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

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

Issue 1037743002: MIPS: Switch full-codegen from StackHandlers to handler table. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/code-stubs-mips64.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 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #if V8_TARGET_ARCH_MIPS 9 #if V8_TARGET_ARCH_MIPS
10 10
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate())); 3228 PrepareCEntryFunction(ExternalReference(Runtime::kDebugBreak, isolate()));
3229 CEntryStub ces(isolate(), 1); 3229 CEntryStub ces(isolate(), 1);
3230 DCHECK(AllowThisStubCall(&ces)); 3230 DCHECK(AllowThisStubCall(&ces));
3231 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK); 3231 Call(ces.GetCode(), RelocInfo::DEBUG_BREAK);
3232 } 3232 }
3233 3233
3234 3234
3235 // --------------------------------------------------------------------------- 3235 // ---------------------------------------------------------------------------
3236 // Exception handling. 3236 // Exception handling.
3237 3237
3238 void MacroAssembler::PushTryHandler(StackHandler::Kind kind, 3238 void MacroAssembler::PushStackHandler() {
3239 int handler_index) {
3240 // Adjust this code if not the case. 3239 // Adjust this code if not the case.
3241 STATIC_ASSERT(StackHandlerConstants::kSize == 3 * kPointerSize); 3240 STATIC_ASSERT(StackHandlerConstants::kSize == 1 * kPointerSize);
3242 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize); 3241 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0 * kPointerSize);
3243 STATIC_ASSERT(StackHandlerConstants::kStateOffset == 1 * kPointerSize);
3244 STATIC_ASSERT(StackHandlerConstants::kContextOffset == 2 * kPointerSize);
3245
3246 // For the JSEntry handler, we must preserve a0-a3 and s0.
3247 // t1-t3 are available. We will build up the handler from the bottom by
3248 // pushing on the stack.
3249 // Set up the the index (t2) for pushing.
3250 li(t2, Operand(handler_index));
3251
3252 // Push the context and index.
3253 if (kind == StackHandler::JS_ENTRY) {
3254 DCHECK(Smi::FromInt(0) == 0);
3255 // The zero_reg indicates no context.
3256 // The operands are reversed to match the order of MultiPush/Pop.
3257 Push(zero_reg, t2);
3258 } else {
3259 MultiPush(t2.bit() | cp.bit());
3260 }
3261 3242
3262 // Link the current handler as the next handler. 3243 // Link the current handler as the next handler.
3263 li(t2, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); 3244 li(t2, Operand(ExternalReference(Isolate::kHandlerAddress, isolate())));
3264 lw(t1, MemOperand(t2)); 3245 lw(t1, MemOperand(t2));
3265 push(t1); 3246 push(t1);
3247
3266 // Set this new handler as the current one. 3248 // Set this new handler as the current one.
3267 sw(sp, MemOperand(t2)); 3249 sw(sp, MemOperand(t2));
3268 } 3250 }
3269 3251
3270 3252
3271 void MacroAssembler::PopTryHandler() { 3253 void MacroAssembler::PopStackHandler() {
3272 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0); 3254 STATIC_ASSERT(StackHandlerConstants::kNextOffset == 0);
3273 pop(a1); 3255 pop(a1);
3274 Addu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize)); 3256 Addu(sp, sp, Operand(StackHandlerConstants::kSize - kPointerSize));
3275 li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate()))); 3257 li(at, Operand(ExternalReference(Isolate::kHandlerAddress, isolate())));
3276 sw(a1, MemOperand(at)); 3258 sw(a1, MemOperand(at));
3277 } 3259 }
3278 3260
3279 3261
3280 void MacroAssembler::Allocate(int object_size, 3262 void MacroAssembler::Allocate(int object_size,
3281 Register result, 3263 Register result,
(...skipping 2801 matching lines...) Expand 10 before | Expand all | Expand 10 after
6083 } 6065 }
6084 if (mag.shift > 0) sra(result, result, mag.shift); 6066 if (mag.shift > 0) sra(result, result, mag.shift);
6085 srl(at, dividend, 31); 6067 srl(at, dividend, 31);
6086 Addu(result, result, Operand(at)); 6068 Addu(result, result, Operand(at));
6087 } 6069 }
6088 6070
6089 6071
6090 } } // namespace v8::internal 6072 } } // namespace v8::internal
6091 6073
6092 #endif // V8_TARGET_ARCH_MIPS 6074 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/macro-assembler-mips.h ('k') | src/mips64/code-stubs-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698