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

Side by Side Diff: runtime/vm/assembler_ia32.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: Address review comments. Created 5 years, 6 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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" // NOLINT 5 #include "vm/globals.h" // NOLINT
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/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 2106 matching lines...) Expand 10 before | Expand all | Expand 10 after
2117 2117
2118 void Assembler::Drop(intptr_t stack_elements) { 2118 void Assembler::Drop(intptr_t stack_elements) {
2119 ASSERT(stack_elements >= 0); 2119 ASSERT(stack_elements >= 0);
2120 if (stack_elements > 0) { 2120 if (stack_elements > 0) {
2121 addl(ESP, Immediate(stack_elements * kWordSize)); 2121 addl(ESP, Immediate(stack_elements * kWordSize));
2122 } 2122 }
2123 } 2123 }
2124 2124
2125 2125
2126 void Assembler::LoadIsolate(Register dst) { 2126 void Assembler::LoadIsolate(Register dst) {
2127 movl(dst, Immediate(reinterpret_cast<uword>(Isolate::Current()))); 2127 movl(dst, Address(THR, Thread::isolate_offset()));
2128 } 2128 }
2129 2129
2130 2130
2131 void Assembler::LoadObject(Register dst, const Object& object) { 2131 void Assembler::LoadObject(Register dst, const Object& object) {
2132 if (object.IsSmi() || object.InVMHeap()) { 2132 if (object.IsSmi() || object.InVMHeap()) {
2133 movl(dst, Immediate(reinterpret_cast<int32_t>(object.raw()))); 2133 movl(dst, Immediate(reinterpret_cast<int32_t>(object.raw())));
2134 } else { 2134 } else {
2135 ASSERT(object.IsNotTemporaryScopedHandle()); 2135 ASSERT(object.IsNotTemporaryScopedHandle());
2136 ASSERT(object.IsOld()); 2136 ASSERT(object.IsOld());
2137 AssemblerBuffer::EnsureCapacity ensured(&buffer_); 2137 AssemblerBuffer::EnsureCapacity ensured(&buffer_);
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 3105
3106 const char* Assembler::FpuRegisterName(FpuRegister reg) { 3106 const char* Assembler::FpuRegisterName(FpuRegister reg) {
3107 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters)); 3107 ASSERT((0 <= reg) && (reg < kNumberOfXmmRegisters));
3108 return xmm_reg_names[reg]; 3108 return xmm_reg_names[reg];
3109 } 3109 }
3110 3110
3111 3111
3112 } // namespace dart 3112 } // namespace dart
3113 3113
3114 #endif // defined TARGET_ARCH_IA32 3114 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698