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

Side by Side Diff: runtime/vm/assembler_ia32_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_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/cpu.h" 9 #include "vm/cpu.h"
10 #include "vm/os.h" 10 #include "vm/os.h"
(...skipping 3375 matching lines...) Expand 10 before | Expand all | Expand 10 after
3386 EXPECT_EQ(to[0], '0'); 3386 EXPECT_EQ(to[0], '0');
3387 for (int i = 0; i < 10; i++) { 3387 for (int i = 0; i < 10; i++) {
3388 EXPECT_EQ(from[i], to[i]); 3388 EXPECT_EQ(from[i], to[i]);
3389 } 3389 }
3390 delete [] to; 3390 delete [] to;
3391 } 3391 }
3392 3392
3393 3393
3394 // Called from assembler_test.cc. 3394 // Called from assembler_test.cc.
3395 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) { 3395 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
3396 __ pushl(THR);
3396 __ pushl(CTX); 3397 __ pushl(CTX);
3397 __ movl(CTX, Address(ESP, 2 * kWordSize)); 3398 __ movl(CTX, Address(ESP, 3 * kWordSize));
3398 __ movl(EAX, Address(ESP, 3 * kWordSize)); 3399 __ movl(EAX, Address(ESP, 4 * kWordSize));
3399 __ movl(ECX, Address(ESP, 4 * kWordSize)); 3400 __ movl(ECX, Address(ESP, 5 * kWordSize));
3401 __ movl(THR, Address(ESP, 6 * kWordSize));
3400 __ pushl(EAX); 3402 __ pushl(EAX);
3401 __ StoreIntoObject(ECX, 3403 __ StoreIntoObject(ECX,
3402 FieldAddress(ECX, GrowableObjectArray::data_offset()), 3404 FieldAddress(ECX, GrowableObjectArray::data_offset()),
3403 EAX); 3405 EAX);
3404 __ popl(EAX); 3406 __ popl(EAX);
3405 __ popl(CTX); 3407 __ popl(CTX);
3408 __ popl(THR);
3406 __ ret(); 3409 __ ret();
3407 } 3410 }
3408 3411
3409 3412
3410 ASSEMBLER_TEST_GENERATE(BitTest, assembler) { 3413 ASSEMBLER_TEST_GENERATE(BitTest, assembler) {
3411 __ movl(EAX, Immediate(4)); 3414 __ movl(EAX, Immediate(4));
3412 __ movl(ECX, Immediate(2)); 3415 __ movl(ECX, Immediate(2));
3413 __ bt(EAX, ECX); 3416 __ bt(EAX, ECX);
3414 Label ok; 3417 Label ok;
3415 __ j(CARRY, &ok); 3418 __ j(CARRY, &ok);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64))); 3476 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMaxInt64)));
3474 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64))); 3477 EXPECT_EQ(ICData::kInt64RangeBit, range_of(Integer::New(kMinInt64)));
3475 3478
3476 EXPECT_EQ(-1, range_of(Bool::True().raw())); 3479 EXPECT_EQ(-1, range_of(Bool::True().raw()));
3477 } 3480 }
3478 3481
3479 3482
3480 } // namespace dart 3483 } // namespace dart
3481 3484
3482 #endif // defined TARGET_ARCH_IA32 3485 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698