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

Side by Side Diff: src/arm/lithium-codegen-arm.cc

Issue 6390003: Introduce a hydrogen value for contexts, support context slot assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sorted Lithium instructions names. Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 __ cmp(scratch2, ip); 2205 __ cmp(scratch2, ip);
2206 DeoptimizeIf(eq, instr->environment()); 2206 DeoptimizeIf(eq, instr->environment());
2207 } 2207 }
2208 2208
2209 // Store the value. 2209 // Store the value.
2210 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset)); 2210 __ str(value, FieldMemOperand(scratch, JSGlobalPropertyCell::kValueOffset));
2211 } 2211 }
2212 2212
2213 2213
2214 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { 2214 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) {
2215 // TODO(antonm): load a context with a separate instruction. 2215 Register context = ToRegister(instr->context());
2216 Register result = ToRegister(instr->result()); 2216 Register result = ToRegister(instr->result());
2217 __ LoadContext(result, instr->context_chain_length()); 2217 __ ldr(result,
2218 MemOperand(context, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2218 __ ldr(result, ContextOperand(result, instr->slot_index())); 2219 __ ldr(result, ContextOperand(result, instr->slot_index()));
2219 } 2220 }
2220 2221
2221 2222
2223 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) {
2224 Register context = ToRegister(instr->context());
2225 Register value = ToRegister(instr->value());
2226 __ ldr(context,
2227 MemOperand(context, Context::SlotOffset(Context::FCONTEXT_INDEX)));
2228 __ str(value, ContextOperand(context, instr->slot_index()));
2229 if (instr->needs_write_barrier()) {
2230 int offset = Context::SlotOffset(instr->slot_index());
2231 __ RecordWrite(context, Operand(offset), value, scratch0());
2232 }
2233 }
2234
2235
2222 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { 2236 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
2223 Register object = ToRegister(instr->InputAt(0)); 2237 Register object = ToRegister(instr->InputAt(0));
2224 Register result = ToRegister(instr->result()); 2238 Register result = ToRegister(instr->result());
2225 if (instr->hydrogen()->is_in_object()) { 2239 if (instr->hydrogen()->is_in_object()) {
2226 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset())); 2240 __ ldr(result, FieldMemOperand(object, instr->hydrogen()->offset()));
2227 } else { 2241 } else {
2228 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset)); 2242 __ ldr(result, FieldMemOperand(object, JSObject::kPropertiesOffset));
2229 __ ldr(result, FieldMemOperand(result, instr->hydrogen()->offset())); 2243 __ ldr(result, FieldMemOperand(result, instr->hydrogen()->offset()));
2230 } 2244 }
2231 } 2245 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2462 LOperand* argument = instr->InputAt(0); 2476 LOperand* argument = instr->InputAt(0);
2463 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) { 2477 if (argument->IsDoubleRegister() || argument->IsDoubleStackSlot()) {
2464 Abort("DoPushArgument not implemented for double type."); 2478 Abort("DoPushArgument not implemented for double type.");
2465 } else { 2479 } else {
2466 Register argument_reg = EmitLoadRegister(argument, ip); 2480 Register argument_reg = EmitLoadRegister(argument, ip);
2467 __ push(argument_reg); 2481 __ push(argument_reg);
2468 } 2482 }
2469 } 2483 }
2470 2484
2471 2485
2486 void LCodeGen::DoContext(LContext* instr) {
2487 Register result = ToRegister(instr->result());
2488 __ mov(result, cp);
2489 }
2490
2491
2492 void LCodeGen::DoOuterContext(LOuterContext* instr) {
2493 Register context = ToRegister(instr->context());
2494 Register result = ToRegister(instr->result());
2495 __ ldr(result,
2496 MemOperand(context, Context::SlotOffset(Context::CLOSURE_INDEX)));
2497 __ ldr(result, FieldMemOperand(result, JSFunction::kContextOffset));
2498 }
2499
2500
2472 void LCodeGen::DoGlobalObject(LGlobalObject* instr) { 2501 void LCodeGen::DoGlobalObject(LGlobalObject* instr) {
2502 Register context = ToRegister(instr->context());
2473 Register result = ToRegister(instr->result()); 2503 Register result = ToRegister(instr->result());
2474 __ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX)); 2504 __ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX));
2475 } 2505 }
2476 2506
2477 2507
2478 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) { 2508 void LCodeGen::DoGlobalReceiver(LGlobalReceiver* instr) {
2509 Register global = ToRegister(instr->global());
2479 Register result = ToRegister(instr->result()); 2510 Register result = ToRegister(instr->result());
2480 __ ldr(result, ContextOperand(cp, Context::GLOBAL_INDEX)); 2511 __ ldr(result, FieldMemOperand(global, GlobalObject::kGlobalReceiverOffset));
2481 __ ldr(result, FieldMemOperand(result, GlobalObject::kGlobalReceiverOffset));
2482 } 2512 }
2483 2513
2484 2514
2485 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, 2515 void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
2486 int arity, 2516 int arity,
2487 LInstruction* instr) { 2517 LInstruction* instr) {
2488 // Change context if needed. 2518 // Change context if needed.
2489 bool change_context = 2519 bool change_context =
2490 (graph()->info()->closure()->context() != function->context()) || 2520 (graph()->info()->closure()->context() != function->context()) ||
2491 scope()->contains_with() || 2521 scope()->contains_with() ||
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after
3693 3723
3694 3724
3695 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { 3725 void LCodeGen::DoOsrEntry(LOsrEntry* instr) {
3696 Abort("DoOsrEntry unimplemented."); 3726 Abort("DoOsrEntry unimplemented.");
3697 } 3727 }
3698 3728
3699 3729
3700 #undef __ 3730 #undef __
3701 3731
3702 } } // namespace v8::internal 3732 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/arm/lithium-arm.cc ('k') | src/hydrogen.h » ('j') | src/hydrogen.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698