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

Side by Side Diff: runtime/vm/assembler_x64_test.cc

Issue 1156593002: Cache current thread in a reserved register and use it in LoadIsolate (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added more comments. Created 5 years, 7 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_ARCH_X64) 6 #if defined(TARGET_ARCH_X64)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/unit_test.h" 10 #include "vm/unit_test.h"
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after
3301 double res = 3301 double res =
3302 reinterpret_cast<SquareRootDoubleCode>(test->entry())(kDoubleConst); 3302 reinterpret_cast<SquareRootDoubleCode>(test->entry())(kDoubleConst);
3303 EXPECT_FLOAT_EQ(sqrt(kDoubleConst), res, 0.0001); 3303 EXPECT_FLOAT_EQ(sqrt(kDoubleConst), res, 0.0001);
3304 } 3304 }
3305 3305
3306 3306
3307 // Called from assembler_test.cc. 3307 // Called from assembler_test.cc.
3308 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { 3308 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
3309 __ pushq(PP); // Save caller's pool pointer and load a new one here. 3309 __ pushq(PP); // Save caller's pool pointer and load a new one here.
3310 __ LoadPoolPointer(PP); 3310 __ LoadPoolPointer(PP);
3311 __ pushq(THR);
3312 __ movq(THR, CallingConventions::kArg4Reg);
3311 __ pushq(CTX); 3313 __ pushq(CTX);
3312 __ movq(CTX, CallingConventions::kArg1Reg); 3314 __ movq(CTX, CallingConventions::kArg1Reg);
3313 __ StoreIntoObject(CallingConventions::kArg3Reg, 3315 __ StoreIntoObject(CallingConventions::kArg3Reg,
3314 FieldAddress(CallingConventions::kArg3Reg, 3316 FieldAddress(CallingConventions::kArg3Reg,
3315 GrowableObjectArray::data_offset()), 3317 GrowableObjectArray::data_offset()),
3316 CallingConventions::kArg2Reg); 3318 CallingConventions::kArg2Reg);
3317 __ popq(CTX); 3319 __ popq(CTX);
3320 __ popq(THR);
3318 __ popq(PP); // Restore caller's pool pointer. 3321 __ popq(PP); // Restore caller's pool pointer.
3319 __ ret(); 3322 __ ret();
3320 } 3323 }
3321 3324
3322 3325
3323 ASSEMBLER_TEST_GENERATE(DoubleFPUStackMoves, assembler) { 3326 ASSEMBLER_TEST_GENERATE(DoubleFPUStackMoves, assembler) {
3324 int64_t l = bit_cast<int64_t, double>(1024.67); 3327 int64_t l = bit_cast<int64_t, double>(1024.67);
3325 __ movq(RAX, Immediate(l)); 3328 __ movq(RAX, Immediate(l));
3326 __ pushq(RAX); 3329 __ pushq(RAX);
3327 __ fldl(Address(RSP, 0)); 3330 __ fldl(Address(RSP, 0));
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
3639 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); 3642 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64)));
3640 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); 3643 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64)));
3641 3644
3642 EXPECT_EQ(0, range_of(Bool::True().raw())); 3645 EXPECT_EQ(0, range_of(Bool::True().raw()));
3643 } 3646 }
3644 3647
3645 3648
3646 } // namespace dart 3649 } // namespace dart
3647 3650
3648 #endif // defined TARGET_ARCH_X64 3651 #endif // defined TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698