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

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

Issue 1569173003: PPC: [date] Migrate Date field accessors to native builtins. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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_PPC 5 #if V8_TARGET_ARCH_PPC
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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1380 } 1380 }
1381 __ Jump(masm->isolate()->builtins()->OnStackReplacement(), 1381 __ Jump(masm->isolate()->builtins()->OnStackReplacement(),
1382 RelocInfo::CODE_TARGET); 1382 RelocInfo::CODE_TARGET);
1383 1383
1384 __ bind(&ok); 1384 __ bind(&ok);
1385 __ Ret(); 1385 __ Ret();
1386 } 1386 }
1387 1387
1388 1388
1389 // static 1389 // static
1390 void Builtins::Generate_DatePrototype_GetField(MacroAssembler* masm,
1391 int field_index) {
1392 // ----------- S t a t e -------------
1393 // -- lr : return address
1394 // -- sp[0] : receiver
1395 // -----------------------------------
1396
1397 // 1. Pop receiver into r3 and check that it's actually a JSDate object.
1398 Label receiver_not_date;
1399 {
1400 __ Pop(r3);
1401 __ JumpIfSmi(r3, &receiver_not_date);
1402 __ CompareObjectType(r3, r4, r5, JS_DATE_TYPE);
1403 __ bne(&receiver_not_date);
1404 }
1405
1406 // 2. Load the specified date field, falling back to the runtime as necessary.
1407 if (field_index == JSDate::kDateValue) {
1408 __ LoadP(r3, FieldMemOperand(r3, JSDate::kValueOffset));
1409 } else {
1410 if (field_index < JSDate::kFirstUncachedField) {
1411 Label stamp_mismatch;
1412 __ mov(r4, Operand(ExternalReference::date_cache_stamp(masm->isolate())));
1413 __ LoadP(r4, MemOperand(r4));
1414 __ LoadP(ip, FieldMemOperand(r3, JSDate::kCacheStampOffset));
1415 __ cmp(r4, ip);
1416 __ bne(&stamp_mismatch);
1417 __ LoadP(r3, FieldMemOperand(
1418 r3, JSDate::kValueOffset + field_index * kPointerSize));
1419 __ Ret();
1420 __ bind(&stamp_mismatch);
1421 }
1422 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
1423 __ PrepareCallCFunction(2, r4);
1424 __ LoadSmiLiteral(r4, Smi::FromInt(field_index));
1425 __ CallCFunction(
1426 ExternalReference::get_date_field_function(masm->isolate()), 2);
1427 }
1428 __ Ret();
1429
1430 // 3. Raise a TypeError if the receiver is not a date.
1431 __ bind(&receiver_not_date);
1432 __ TailCallRuntime(Runtime::kThrowNotDateError);
1433 }
1434
1435
1436 // static
1390 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) { 1437 void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
1391 // ----------- S t a t e ------------- 1438 // ----------- S t a t e -------------
1392 // -- r3 : argc 1439 // -- r3 : argc
1393 // -- sp[0] : argArray 1440 // -- sp[0] : argArray
1394 // -- sp[4] : thisArg 1441 // -- sp[4] : thisArg
1395 // -- sp[8] : receiver 1442 // -- sp[8] : receiver
1396 // ----------------------------------- 1443 // -----------------------------------
1397 1444
1398 // 1. Load receiver into r4, argArray into r3 (if present), remove all 1445 // 1. Load receiver into r4, argArray into r3 (if present), remove all
1399 // arguments from the stack (including the receiver), and push thisArg (if 1446 // arguments from the stack (including the receiver), and push thisArg (if
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 __ bkpt(0); 2422 __ bkpt(0);
2376 } 2423 }
2377 } 2424 }
2378 2425
2379 2426
2380 #undef __ 2427 #undef __
2381 } // namespace internal 2428 } // namespace internal
2382 } // namespace v8 2429 } // namespace v8
2383 2430
2384 #endif // V8_TARGET_ARCH_PPC 2431 #endif // V8_TARGET_ARCH_PPC
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698