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

Side by Side Diff: src/arm/builtins-arm.cc

Issue 1567353002: [date] Migrate Date field accessors to native builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Moar work. ports. Created 4 years, 11 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 | « no previous file | src/arm64/builtins-arm64.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 #if V8_TARGET_ARCH_ARM 5 #if V8_TARGET_ARCH_ARM
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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 } 1377 }
1378 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), 1378 __ Jump(masm->isolate()->builtins()->OnStackReplacement(),
1379 RelocInfo::CODE_TARGET); 1379 RelocInfo::CODE_TARGET);
1380 1380
1381 __ bind(&ok); 1381 __ bind(&ok);
1382 __ Ret(); 1382 __ Ret();
1383 } 1383 }
1384 1384
1385 1385
1386 // static 1386 // static
1387 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
1388 int field_index) {
1389 // ----------- S t a t e -------------
1390 // -- lr : return address
1391 // -- sp[0] : receiver
1392 // -----------------------------------
1393
1394 // 1. Pop receiver into r0 and check that it's actually a JSDate object.
1395 Label receiver_not_date;
1396 {
1397 __ Pop(r0);
1398 __ JumpIfSmi(r0, &receiver_not_date);
1399 __ CompareObjectType(r0, r1, r2, JS_DATE_TYPE);
1400 __ b(ne, &receiver_not_date);
1401 }
1402
1403 // 2. Load the specified date field, falling back to the runtime as necessary.
1404 if (field_index == JSDate::kDateValue) {
1405 __ ldr(r0, FieldMemOperand(r0, JSDate::kValueOffset));
1406 } else {
1407 if (field_index < JSDate::kFirstUncachedField) {
1408 Label stamp_mismatch;
1409 __ mov(r1, Operand(ExternalReference::date_cache_stamp(masm->isolate())));
1410 __ ldr(r1, MemOperand(r1));
1411 __ ldr(ip, FieldMemOperand(r0, JSDate::kCacheStampOffset));
1412 __ cmp(r1, ip);
1413 __ b(ne, &stamp_mismatch);
1414 __ ldr(r0, FieldMemOperand(
1415 r0, JSDate::kValueOffset + field_index * kPointerSize));
1416 __ Ret();
1417 __ bind(&stamp_mismatch);
1418 }
1419 FrameScope scope(masm, StackFrame::INTERNAL);
1420 __ PrepareCallCFunction(2, r1);
1421 __ mov(r1, Operand(Smi::FromInt(field_index)));
1422 __ CallCFunction(
1423 ExternalReference::get_date_field_function(masm->isolate()), 2);
1424 }
1425 __ Ret();
1426
1427 // 3. Raise a TypeError if the receiver is not a date.
1428 __ bind(&receiver_not_date);
1429 __ TailCallRuntime(Runtime::kThrowNotDateError);
1430 }
1431
1432
1433 // static
1387 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1434 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1388 // ----------- S t a t e ------------- 1435 // ----------- S t a t e -------------
1389 // -- r0 : argc 1436 // -- r0 : argc
1390 // -- sp[0] : argArray 1437 // -- sp[0] : argArray
1391 // -- sp[4] : thisArg 1438 // -- sp[4] : thisArg
1392 // -- sp[8] : receiver 1439 // -- sp[8] : receiver
1393 // ----------------------------------- 1440 // -----------------------------------
1394 1441
1395 // 1. Load receiver into r1, argArray into r0 (if present), remove all 1442 // 1. Load receiver into r1, argArray into r0 (if present), remove all
1396 // arguments from the stack (including the receiver), and push thisArg (if 1443 // arguments from the stack (including the receiver), and push thisArg (if
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
2314 } 2361 }
2315 } 2362 }
2316 2363
2317 2364
2318 #undef __ 2365 #undef __
2319 2366
2320 } // namespace internal 2367 } // namespace internal
2321 } // namespace v8 2368 } // namespace v8
2322 2369
2323 #endif // V8_TARGET_ARCH_ARM 2370 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698