OLD | NEW |
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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 __ Branch(&throw_termination_exception, eq, v0, Operand(a4)); | 1241 __ Branch(&throw_termination_exception, eq, v0, Operand(a4)); |
1242 | 1242 |
1243 // Handle normal exception. | 1243 // Handle normal exception. |
1244 __ Throw(v0); | 1244 __ Throw(v0); |
1245 | 1245 |
1246 __ bind(&throw_termination_exception); | 1246 __ bind(&throw_termination_exception); |
1247 __ ThrowUncatchable(v0); | 1247 __ ThrowUncatchable(v0); |
1248 } | 1248 } |
1249 | 1249 |
1250 | 1250 |
1251 void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) { | 1251 void JSEntryStub::Generate(MacroAssembler* masm) { |
1252 Label invoke, handler_entry, exit; | 1252 Label invoke, handler_entry, exit; |
1253 Isolate* isolate = masm->isolate(); | 1253 Isolate* isolate = masm->isolate(); |
1254 | 1254 |
1255 // TODO(plind): unify the ABI description here. | 1255 // TODO(plind): unify the ABI description here. |
1256 // Registers: | 1256 // Registers: |
1257 // a0: entry address | 1257 // a0: entry address |
1258 // a1: function | 1258 // a1: function |
1259 // a2: receiver | 1259 // a2: receiver |
1260 // a3: argc | 1260 // a3: argc |
1261 // a4 (a4): on mips64 | 1261 // a4 (a4): on mips64 |
(...skipping 19 matching lines...) Expand all Loading... |
1281 // 5th parameter on stack for O32 abi. | 1281 // 5th parameter on stack for O32 abi. |
1282 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; | 1282 int offset_to_argv = (kNumCalleeSaved + 1) * kPointerSize; |
1283 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; | 1283 offset_to_argv += kNumCalleeSavedFPU * kDoubleSize; |
1284 __ ld(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize)); | 1284 __ ld(s0, MemOperand(sp, offset_to_argv + kCArgsSlotsSize)); |
1285 } | 1285 } |
1286 | 1286 |
1287 __ InitializeRootRegister(); | 1287 __ InitializeRootRegister(); |
1288 | 1288 |
1289 // We build an EntryFrame. | 1289 // We build an EntryFrame. |
1290 __ li(a7, Operand(-1)); // Push a bad frame pointer to fail if it is used. | 1290 __ li(a7, Operand(-1)); // Push a bad frame pointer to fail if it is used. |
1291 int marker = is_construct ? StackFrame::ENTRY_CONSTRUCT : StackFrame::ENTRY; | 1291 int marker = type(); |
1292 __ li(a6, Operand(Smi::FromInt(marker))); | 1292 __ li(a6, Operand(Smi::FromInt(marker))); |
1293 __ li(a5, Operand(Smi::FromInt(marker))); | 1293 __ li(a5, Operand(Smi::FromInt(marker))); |
1294 ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate); | 1294 ExternalReference c_entry_fp(Isolate::kCEntryFPAddress, isolate); |
1295 __ li(a4, Operand(c_entry_fp)); | 1295 __ li(a4, Operand(c_entry_fp)); |
1296 __ ld(a4, MemOperand(a4)); | 1296 __ ld(a4, MemOperand(a4)); |
1297 __ Push(a7, a6, a5, a4); | 1297 __ Push(a7, a6, a5, a4); |
1298 // Set up frame pointer for the frame to be pushed. | 1298 // Set up frame pointer for the frame to be pushed. |
1299 __ daddiu(fp, sp, -EntryFrameConstants::kCallerFPOffset); | 1299 __ daddiu(fp, sp, -EntryFrameConstants::kCallerFPOffset); |
1300 | 1300 |
1301 // Registers: | 1301 // Registers: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 // a3: argc | 1372 // a3: argc |
1373 // s0: argv | 1373 // s0: argv |
1374 // | 1374 // |
1375 // Stack: | 1375 // Stack: |
1376 // handler frame | 1376 // handler frame |
1377 // entry frame | 1377 // entry frame |
1378 // callee saved registers + ra | 1378 // callee saved registers + ra |
1379 // [ O32: 4 args slots] | 1379 // [ O32: 4 args slots] |
1380 // args | 1380 // args |
1381 | 1381 |
1382 if (is_construct) { | 1382 if (type() == StackFrame::ENTRY_CONSTRUCT) { |
1383 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, | 1383 ExternalReference construct_entry(Builtins::kJSConstructEntryTrampoline, |
1384 isolate); | 1384 isolate); |
1385 __ li(a4, Operand(construct_entry)); | 1385 __ li(a4, Operand(construct_entry)); |
1386 } else { | 1386 } else { |
1387 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); | 1387 ExternalReference entry(Builtins::kJSEntryTrampoline, masm->isolate()); |
1388 __ li(a4, Operand(entry)); | 1388 __ li(a4, Operand(entry)); |
1389 } | 1389 } |
1390 __ ld(t9, MemOperand(a4)); // Deref address. | 1390 __ ld(t9, MemOperand(a4)); // Deref address. |
1391 // Call JSEntryTrampoline. | 1391 // Call JSEntryTrampoline. |
1392 __ daddiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); | 1392 __ daddiu(t9, t9, Code::kHeaderSize - kHeapObjectTag); |
(...skipping 3531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4924 MemOperand(fp, 6 * kPointerSize), | 4924 MemOperand(fp, 6 * kPointerSize), |
4925 NULL); | 4925 NULL); |
4926 } | 4926 } |
4927 | 4927 |
4928 | 4928 |
4929 #undef __ | 4929 #undef __ |
4930 | 4930 |
4931 } } // namespace v8::internal | 4931 } } // namespace v8::internal |
4932 | 4932 |
4933 #endif // V8_TARGET_ARCH_MIPS64 | 4933 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |