OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 } | 1348 } |
1349 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), | 1349 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), |
1350 RelocInfo::CODE_TARGET); | 1350 RelocInfo::CODE_TARGET); |
1351 | 1351 |
1352 __ Bind(&ok); | 1352 __ Bind(&ok); |
1353 __ Ret(); | 1353 __ Ret(); |
1354 } | 1354 } |
1355 | 1355 |
1356 | 1356 |
1357 // static | 1357 // static |
| 1358 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm, |
| 1359 int field_index) { |
| 1360 // ----------- S t a t e ------------- |
| 1361 // -- lr : return address |
| 1362 // -- jssp[0] : receiver |
| 1363 // ----------------------------------- |
| 1364 ASM_LOCATION("Builtins::Generate_DatePrototype_GetField"); |
| 1365 |
| 1366 // 1. Pop receiver into x0 and check that it's actually a JSDate object. |
| 1367 Label receiver_not_date; |
| 1368 { |
| 1369 __ Pop(x0); |
| 1370 __ JumpIfSmi(x0, &receiver_not_date); |
| 1371 __ JumpIfNotObjectType(x0, x1, x2, JS_DATE_TYPE, &receiver_not_date); |
| 1372 } |
| 1373 |
| 1374 // 2. Load the specified date field, falling back to the runtime as necessary. |
| 1375 if (field_index == JSDate::kDateValue) { |
| 1376 __ Ldr(x0, FieldMemOperand(x0, JSDate::kValueOffset)); |
| 1377 } else { |
| 1378 if (field_index < JSDate::kFirstUncachedField) { |
| 1379 Label stamp_mismatch; |
| 1380 __ Mov(x1, ExternalReference::date_cache_stamp(masm->isolate())); |
| 1381 __ Ldr(x1, MemOperand(x1)); |
| 1382 __ Ldr(x2, FieldMemOperand(x0, JSDate::kCacheStampOffset)); |
| 1383 __ Cmp(x1, x2); |
| 1384 __ B(ne, &stamp_mismatch); |
| 1385 __ Ldr(x0, FieldMemOperand( |
| 1386 x0, JSDate::kValueOffset + field_index * kPointerSize)); |
| 1387 __ Ret(); |
| 1388 __ Bind(&stamp_mismatch); |
| 1389 } |
| 1390 FrameScope scope(masm, StackFrame::INTERNAL); |
| 1391 __ Mov(x1, Smi::FromInt(field_index)); |
| 1392 __ CallCFunction( |
| 1393 ExternalReference::get_date_field_function(masm->isolate()), 2); |
| 1394 } |
| 1395 __ Ret(); |
| 1396 |
| 1397 // 3. Raise a TypeError if the receiver is not a date. |
| 1398 __ Bind(&receiver_not_date); |
| 1399 __ TailCallRuntime(Runtime::kThrowNotDateError); |
| 1400 } |
| 1401 |
| 1402 |
| 1403 // static |
1358 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { | 1404 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { |
1359 // ----------- S t a t e ------------- | 1405 // ----------- S t a t e ------------- |
1360 // -- r0 : argc | 1406 // -- r0 : argc |
1361 // -- sp[0] : argArray | 1407 // -- sp[0] : argArray |
1362 // -- sp[8] : thisArg | 1408 // -- sp[8] : thisArg |
1363 // -- sp[16] : receiver | 1409 // -- sp[16] : receiver |
1364 // ----------------------------------- | 1410 // ----------------------------------- |
1365 ASM_LOCATION("Builtins::Generate_FunctionPrototypeApply"); | 1411 ASM_LOCATION("Builtins::Generate_FunctionPrototypeApply"); |
1366 | 1412 |
1367 // 1. Load receiver into x1, argArray into x0 (if present), remove all | 1413 // 1. Load receiver into x1, argArray into x0 (if present), remove all |
(...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2400 } | 2446 } |
2401 } | 2447 } |
2402 | 2448 |
2403 | 2449 |
2404 #undef __ | 2450 #undef __ |
2405 | 2451 |
2406 } // namespace internal | 2452 } // namespace internal |
2407 } // namespace v8 | 2453 } // namespace v8 |
2408 | 2454 |
2409 #endif // V8_TARGET_ARCH_ARM | 2455 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |