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

Side by Side Diff: src/ia32/macro-assembler-ia32.cc

Issue 1516433005: [contexts] Place the initial JSArray maps on the native context directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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 | « src/factory.cc ('k') | src/isolate.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_IA32 5 #if V8_TARGET_ARCH_IA32
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/division-by-constant.h" 8 #include "src/base/division-by-constant.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 2151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX)); 2162 mov(dst, ContextOperand(dst, Context::GLOBAL_PROXY_INDEX));
2163 } 2163 }
2164 2164
2165 2165
2166 void MacroAssembler::LoadTransitionedArrayMapConditional( 2166 void MacroAssembler::LoadTransitionedArrayMapConditional(
2167 ElementsKind expected_kind, 2167 ElementsKind expected_kind,
2168 ElementsKind transitioned_kind, 2168 ElementsKind transitioned_kind,
2169 Register map_in_out, 2169 Register map_in_out,
2170 Register scratch, 2170 Register scratch,
2171 Label* no_map_match) { 2171 Label* no_map_match) {
2172 // Load the global or builtins object from the current context. 2172 DCHECK(IsFastElementsKind(expected_kind));
2173 mov(scratch, NativeContextOperand()); 2173 DCHECK(IsFastElementsKind(transitioned_kind));
2174 2174
2175 // Check that the function's map is the same as the expected cached map. 2175 // Check that the function's map is the same as the expected cached map.
2176 mov(scratch, Operand(scratch, 2176 mov(scratch, NativeContextOperand());
2177 Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); 2177 cmp(map_in_out,
2178 2178 ContextOperand(scratch, Context::ArrayMapIndex(expected_kind)));
2179 size_t offset = expected_kind * kPointerSize +
2180 FixedArrayBase::kHeaderSize;
2181 cmp(map_in_out, FieldOperand(scratch, offset));
2182 j(not_equal, no_map_match); 2179 j(not_equal, no_map_match);
2183 2180
2184 // Use the transitioned cached map. 2181 // Use the transitioned cached map.
2185 offset = transitioned_kind * kPointerSize + 2182 mov(map_in_out,
2186 FixedArrayBase::kHeaderSize; 2183 ContextOperand(scratch, Context::ArrayMapIndex(transitioned_kind)));
2187 mov(map_in_out, FieldOperand(scratch, offset));
2188 } 2184 }
2189 2185
2190 2186
2191 void MacroAssembler::LoadGlobalFunction(int index, Register function) { 2187 void MacroAssembler::LoadGlobalFunction(int index, Register function) {
2192 // Load the native context from the current context. 2188 // Load the native context from the current context.
2193 mov(function, NativeContextOperand()); 2189 mov(function, NativeContextOperand());
2194 // Load the function from the native context. 2190 // Load the function from the native context.
2195 mov(function, ContextOperand(function, index)); 2191 mov(function, ContextOperand(function, index));
2196 } 2192 }
2197 2193
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 mov(eax, dividend); 3169 mov(eax, dividend);
3174 shr(eax, 31); 3170 shr(eax, 31);
3175 add(edx, eax); 3171 add(edx, eax);
3176 } 3172 }
3177 3173
3178 3174
3179 } // namespace internal 3175 } // namespace internal
3180 } // namespace v8 3176 } // namespace v8
3181 3177
3182 #endif // V8_TARGET_ARCH_IA32 3178 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698