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

Side by Side Diff: src/x87/full-codegen-x87.cc

Issue 674073004: X87: EmitCreateIteratorResult loads map from function's context (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@bleeding_edge
Patch Set: Created 6 years, 1 month 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 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 2225
2226 __ bind(&done); 2226 __ bind(&done);
2227 context()->Plug(result_register()); 2227 context()->Plug(result_register());
2228 } 2228 }
2229 2229
2230 2230
2231 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { 2231 void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
2232 Label gc_required; 2232 Label gc_required;
2233 Label allocated; 2233 Label allocated;
2234 2234
2235 Handle<Map> map(isolate()->native_context()->iterator_result_map()); 2235 const int instance_size = 5 * kPointerSize;
2236 DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(),
2237 instance_size);
2236 2238
2237 __ Allocate(map->instance_size(), eax, ecx, edx, &gc_required, TAG_OBJECT); 2239 __ Allocate(instance_size, eax, ecx, edx, &gc_required, TAG_OBJECT);
2238 __ jmp(&allocated); 2240 __ jmp(&allocated);
2239 2241
2240 __ bind(&gc_required); 2242 __ bind(&gc_required);
2241 __ Push(Smi::FromInt(map->instance_size())); 2243 __ Push(Smi::FromInt(instance_size));
2242 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); 2244 __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
2243 __ mov(context_register(), 2245 __ mov(context_register(),
2244 Operand(ebp, StandardFrameConstants::kContextOffset)); 2246 Operand(ebp, StandardFrameConstants::kContextOffset));
2245 2247
2246 __ bind(&allocated); 2248 __ bind(&allocated);
2247 __ mov(ebx, map); 2249 __ mov(ebx, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
2250 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset));
2251 __ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
2248 __ pop(ecx); 2252 __ pop(ecx);
2249 __ mov(edx, isolate()->factory()->ToBoolean(done)); 2253 __ mov(edx, isolate()->factory()->ToBoolean(done));
2250 DCHECK_EQ(map->instance_size(), 5 * kPointerSize);
2251 __ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx); 2254 __ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
2252 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), 2255 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
2253 isolate()->factory()->empty_fixed_array()); 2256 isolate()->factory()->empty_fixed_array());
2254 __ mov(FieldOperand(eax, JSObject::kElementsOffset), 2257 __ mov(FieldOperand(eax, JSObject::kElementsOffset),
2255 isolate()->factory()->empty_fixed_array()); 2258 isolate()->factory()->empty_fixed_array());
2256 __ mov(FieldOperand(eax, JSGeneratorObject::kResultValuePropertyOffset), ecx); 2259 __ mov(FieldOperand(eax, JSGeneratorObject::kResultValuePropertyOffset), ecx);
2257 __ mov(FieldOperand(eax, JSGeneratorObject::kResultDonePropertyOffset), edx); 2260 __ mov(FieldOperand(eax, JSGeneratorObject::kResultDonePropertyOffset), edx);
2258 2261
2259 // Only the value field needs a write barrier, as the other values are in the 2262 // Only the value field needs a write barrier, as the other values are in the
2260 // root set. 2263 // root set.
(...skipping 2940 matching lines...) Expand 10 before | Expand all | Expand 10 after
5201 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5204 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5202 Assembler::target_address_at(call_target_address, 5205 Assembler::target_address_at(call_target_address,
5203 unoptimized_code)); 5206 unoptimized_code));
5204 return OSR_AFTER_STACK_CHECK; 5207 return OSR_AFTER_STACK_CHECK;
5205 } 5208 }
5206 5209
5207 5210
5208 } } // namespace v8::internal 5211 } } // namespace v8::internal
5209 5212
5210 #endif // V8_TARGET_ARCH_X87 5213 #endif // V8_TARGET_ARCH_X87
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