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

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

Issue 686063002: EmitCreateIteratorResult loads map from function's context (Closed) Base URL: https://v8.googlecode.com/svn/branches/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 | Annotate | Revision Log
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
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 2227 matching lines...) Expand 10 before | Expand all | Expand 10 after
2238 2238
2239 __ bind(&done); 2239 __ bind(&done);
2240 context()->Plug(result_register()); 2240 context()->Plug(result_register());
2241 } 2241 }
2242 2242
2243 2243
2244 void FullCodeGenerator::EmitCreateIteratorResult(bool done) { 2244 void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
2245 Label gc_required; 2245 Label gc_required;
2246 Label allocated; 2246 Label allocated;
2247 2247
2248 Handle<Map> map(isolate()->native_context()->iterator_result_map()); 2248 const int instance_size = 5 * kPointerSize;
2249 DCHECK_EQ(isolate()->native_context()->iterator_result_map()->instance_size(),
2250 instance_size);
2249 2251
2250 __ Allocate(map->instance_size(), eax, ecx, edx, &gc_required, TAG_OBJECT); 2252 __ Allocate(instance_size, eax, ecx, edx, &gc_required, TAG_OBJECT);
2251 __ jmp(&allocated); 2253 __ jmp(&allocated);
2252 2254
2253 __ bind(&gc_required); 2255 __ bind(&gc_required);
2254 __ Push(Smi::FromInt(map->instance_size())); 2256 __ Push(Smi::FromInt(instance_size));
2255 __ CallRuntime(Runtime::kAllocateInNewSpace, 1); 2257 __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
2256 __ mov(context_register(), 2258 __ mov(context_register(),
2257 Operand(ebp, StandardFrameConstants::kContextOffset)); 2259 Operand(ebp, StandardFrameConstants::kContextOffset));
2258 2260
2259 __ bind(&allocated); 2261 __ bind(&allocated);
2260 __ mov(ebx, map); 2262 __ mov(ebx, Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
2263 __ mov(ebx, FieldOperand(ebx, GlobalObject::kNativeContextOffset));
2264 __ mov(ebx, ContextOperand(ebx, Context::ITERATOR_RESULT_MAP_INDEX));
2261 __ pop(ecx); 2265 __ pop(ecx);
2262 __ mov(edx, isolate()->factory()->ToBoolean(done)); 2266 __ mov(edx, isolate()->factory()->ToBoolean(done));
2263 DCHECK_EQ(map->instance_size(), 5 * kPointerSize);
2264 __ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx); 2267 __ mov(FieldOperand(eax, HeapObject::kMapOffset), ebx);
2265 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset), 2268 __ mov(FieldOperand(eax, JSObject::kPropertiesOffset),
2266 isolate()->factory()->empty_fixed_array()); 2269 isolate()->factory()->empty_fixed_array());
2267 __ mov(FieldOperand(eax, JSObject::kElementsOffset), 2270 __ mov(FieldOperand(eax, JSObject::kElementsOffset),
2268 isolate()->factory()->empty_fixed_array()); 2271 isolate()->factory()->empty_fixed_array());
2269 __ mov(FieldOperand(eax, JSGeneratorObject::kResultValuePropertyOffset), ecx); 2272 __ mov(FieldOperand(eax, JSGeneratorObject::kResultValuePropertyOffset), ecx);
2270 __ mov(FieldOperand(eax, JSGeneratorObject::kResultDonePropertyOffset), edx); 2273 __ mov(FieldOperand(eax, JSGeneratorObject::kResultDonePropertyOffset), edx);
2271 2274
2272 // Only the value field needs a write barrier, as the other values are in the 2275 // Only the value field needs a write barrier, as the other values are in the
2273 // root set. 2276 // root set.
(...skipping 2948 matching lines...) Expand 10 before | Expand all | Expand 10 after
5222 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5225 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5223 Assembler::target_address_at(call_target_address, 5226 Assembler::target_address_at(call_target_address,
5224 unoptimized_code)); 5227 unoptimized_code));
5225 return OSR_AFTER_STACK_CHECK; 5228 return OSR_AFTER_STACK_CHECK;
5226 } 5229 }
5227 5230
5228 5231
5229 } } // namespace v8::internal 5232 } } // namespace v8::internal
5230 5233
5231 #endif // V8_TARGET_ARCH_IA32 5234 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698