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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 } | 1370 } |
1371 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), | 1371 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
1372 RelocInfo::CODE_TARGET); | 1372 RelocInfo::CODE_TARGET); |
1373 | 1373 |
1374 __ bind(&ok); | 1374 __ bind(&ok); |
1375 __ Ret(); | 1375 __ Ret(); |
1376 } | 1376 } |
1377 | 1377 |
1378 | 1378 |
1379 // static | 1379 // static |
| 1380 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
| 1381 int field_index) { |
| 1382 // ----------- S t a t e ------------- |
| 1383 // -- sp[0] : receiver |
| 1384 // ----------------------------------- |
| 1385 |
| 1386 // 1. Pop receiver into a0 and check that it's actually a JSDate object. |
| 1387 Label receiver_not_date; |
| 1388 { |
| 1389 __ Pop(a0); |
| 1390 __ JumpIfSmi(a0, &receiver_not_date); |
| 1391 __ GetObjectType(a0, t0, t0); |
| 1392 __ Branch(&receiver_not_date, ne, t0, Operand(JS_DATE_TYPE)); |
| 1393 } |
| 1394 |
| 1395 // 2. Load the specified date field, falling back to the runtime as necessary. |
| 1396 if (field_index == JSDate::kDateValue) { |
| 1397 __ Ret(USE_DELAY_SLOT); |
| 1398 __ ld(v0, FieldMemOperand(a0, JSDate::kValueOffset)); // In delay slot. |
| 1399 } else { |
| 1400 if (field_index < JSDate::kFirstUncachedField) { |
| 1401 Label stamp_mismatch; |
| 1402 __ li(a1, Operand(ExternalReference::date_cache_stamp(masm->isolate()))); |
| 1403 __ ld(a1, MemOperand(a1)); |
| 1404 __ ld(t0, FieldMemOperand(a0, JSDate::kCacheStampOffset)); |
| 1405 __ Branch(&stamp_mismatch, ne, t0, Operand(a1)); |
| 1406 __ Ret(USE_DELAY_SLOT); |
| 1407 __ ld(v0, FieldMemOperand( |
| 1408 a0, JSDate::kValueOffset + |
| 1409 field_index * kPointerSize)); // In delay slot. |
| 1410 __ bind(&stamp_mismatch); |
| 1411 } |
| 1412 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1413 __ PrepareCallCFunction(2, t0); |
| 1414 __ li(a1, Operand(Smi::FromInt(field_index))); |
| 1415 __ CallCFunction( |
| 1416 ExternalReference::get_date_field_function(masm->isolate()), 2); |
| 1417 __ Ret(); |
| 1418 } |
| 1419 |
| 1420 // 3. Raise a TypeError if the receiver is not a date. |
| 1421 __ bind(&receiver_not_date); |
| 1422 __ TailCallRuntime(Runtime::kThrowNotDateError); |
| 1423 } |
| 1424 |
| 1425 |
| 1426 // static |
1380 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1427 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1381 // ----------- S t a t e ------------- | 1428 // ----------- S t a t e ------------- |
1382 // -- a0 : argc | 1429 // -- a0 : argc |
1383 // -- sp[0] : argArray | 1430 // -- sp[0] : argArray |
1384 // -- sp[4] : thisArg | 1431 // -- sp[4] : thisArg |
1385 // -- sp[8] : receiver | 1432 // -- sp[8] : receiver |
1386 // ----------------------------------- | 1433 // ----------------------------------- |
1387 | 1434 |
1388 // 1. Load receiver into a1, argArray into a0 (if present), remove all | 1435 // 1. Load receiver into a1, argArray into a0 (if present), remove all |
1389 // arguments from the stack (including the receiver), and push thisArg (if | 1436 // arguments from the stack (including the receiver), and push thisArg (if |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 } | 2456 } |
2410 } | 2457 } |
2411 | 2458 |
2412 | 2459 |
2413 #undef __ | 2460 #undef __ |
2414 | 2461 |
2415 } // namespace internal | 2462 } // namespace internal |
2416 } // namespace v8 | 2463 } // namespace v8 |
2417 | 2464 |
2418 #endif // V8_TARGET_ARCH_MIPS64 | 2465 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |