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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 548523003: MIPS: Unify JSEntryStub and JSConstructEntryStub, and some more code stub cleanups. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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/code-stubs-mips.h ('k') | src/mips64/code-stubs-mips64.h » ('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 "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 __ Branch(&throw_termination_exception, eq, v0, Operand(t0)); 1248 __ Branch(&throw_termination_exception, eq, v0, Operand(t0));
1249 1249
1250 // Handle normal exception. 1250 // Handle normal exception.
1251 __ Throw(v0); 1251 __ Throw(v0);
1252 1252
1253 __ bind(&throw_termination_exception); 1253 __ bind(&throw_termination_exception);
1254 __ ThrowUncatchable(v0); 1254 __ ThrowUncatchable(v0);
1255 } 1255 }
1256 1256
1257 1257
1258 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { 1258 void JSEntryStub::Generate(MacroAssembler* masm) {
1259 Label invoke, handler_entry, exit; 1259 Label invoke, handler_entry, exit;
1260 Isolate* isolate = masm->isolate(); 1260 Isolate* isolate = masm->isolate();
1261 1261
1262 // Registers: 1262 // Registers:
1263 // a0: entry address 1263 // a0: entry address
1264 // a1: function 1264 // a1: function
1265 // a2: receiver 1265 // a2: receiver
1266 // a3: argc 1266 // a3: argc
1267 // 1267 //
1268 // Stack: 1268 // Stack:
(...skipping 13 matching lines...) Expand all
1282 1282
1283 // Load argv in s0 register. 1283 // Load argv in s0 register.
1284 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; 1284 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize;
1285 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; 1285 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize;
1286 1286
1287 __ InitializeRootRegister(); 1287 __ InitializeRootRegister();
1288 __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize)); 1288 __ lw(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize));
1289 1289
1290 // We build an EntryFrame. 1290 // We build an EntryFrame.
1291 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used. 1291 __ li(t3, Operand(-1)); // Push a bad frame pointer to fail if it is used.
1292 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; 1292 int marker = type();
1293 __ li(t2, Operand(Smi::FromInt(marker))); 1293 __ li(t2, Operand(Smi::FromInt(marker)));
1294 __ li(t1, Operand(Smi::FromInt(marker))); 1294 __ li(t1, Operand(Smi::FromInt(marker)));
1295 __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress, 1295 __ li(t0, Operand(ExternalReference(Isolate::kCEntryFPAddress,
1296 isolate))); 1296 isolate)));
1297 __ lw(t0, MemOperand(t0)); 1297 __ lw(t0, MemOperand(t0));
1298 __ Push(t3, t2, t1, t0); 1298 __ Push(t3, t2, t1, t0);
1299 // Set up frame pointer for the frame to be pushed. 1299 // Set up frame pointer for the frame to be pushed.
1300 __ addiu(fp, sp, -EntryFrameConstants::kCallerFPOffset); 1300 __ addiu(fp, sp, -EntryFrameConstants::kCallerFPOffset);
1301 1301
1302 // Registers: 1302 // Registers:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 // a3: argc 1373 // a3: argc
1374 // s0: argv 1374 // s0: argv
1375 // 1375 //
1376 // Stack: 1376 // Stack:
1377 // handler frame 1377 // handler frame
1378 // entry frame 1378 // entry frame
1379 // callee saved registers + ra 1379 // callee saved registers + ra
1380 // 4 args slots 1380 // 4 args slots
1381 // args 1381 // args
1382 1382
1383 if (is_construct) { 1383 if (type() == StackFrame::ENTRY_CONSTRUCT) {
1384 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, 1384 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline,
1385 isolate); 1385 isolate);
1386 __ li(t0, Operand(construct_entry)); 1386 __ li(t0, Operand(construct_entry));
1387 } else { 1387 } else {
1388 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); 1388 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate());
1389 __ li(t0, Operand(entry)); 1389 __ li(t0, Operand(entry));
1390 } 1390 }
1391 __ lw(t9, MemOperand(t0)); // Deref address. 1391 __ lw(t9, MemOperand(t0)); // Deref address.
1392 1392
1393 // Call JSEntryTrampoline. 1393 // Call JSEntryTrampoline.
(...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after
4887 MemOperand(fp, 6 * kPointerSize), 4887 MemOperand(fp, 6 * kPointerSize),
4888 NULL); 4888 NULL);
4889 } 4889 }
4890 4890
4891 4891
4892 #undef __ 4892 #undef __
4893 4893
4894 } } // namespace v8::internal 4894 } } // namespace v8::internal
4895 4895
4896 #endif // V8_TARGET_ARCH_MIPS 4896 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/code-stubs-mips.h ('k') | src/mips64/code-stubs-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698