OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4272 } | 4272 } |
4273 } else { | 4273 } else { |
4274 // Slot is in the current function context. Move it into the | 4274 // Slot is in the current function context. Move it into the |
4275 // destination register in case we store into it (the write barrier | 4275 // destination register in case we store into it (the write barrier |
4276 // cannot be allowed to destroy the context in esi). | 4276 // cannot be allowed to destroy the context in esi). |
4277 Move(dst, cp); | 4277 Move(dst, cp); |
4278 } | 4278 } |
4279 } | 4279 } |
4280 | 4280 |
4281 | 4281 |
4282 void MacroAssembler::LoadGlobalInitialConstructedArrayMap( | 4282 void MacroAssembler::LoadTransitionedArrayMapConditional( |
| 4283 ElementsKind expected_kind, |
| 4284 ElementsKind transitioned_kind, |
| 4285 Register map_in_out, |
| 4286 Register scratch, |
| 4287 Label* no_map_match) { |
| 4288 // Load the global or builtins object from the current context. |
| 4289 lw(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
| 4290 lw(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); |
| 4291 |
| 4292 // Check that the function's map is the same as the expected cached map. |
| 4293 int expected_index = |
| 4294 Context::GetContextMapIndexFromElementsKind(expected_kind); |
| 4295 lw(at, MemOperand(scratch, Context::SlotOffset(expected_index))); |
| 4296 Branch(no_map_match, ne, map_in_out, Operand(at)); |
| 4297 |
| 4298 // Use the transitioned cached map. |
| 4299 int trans_index = |
| 4300 Context::GetContextMapIndexFromElementsKind(transitioned_kind); |
| 4301 lw(map_in_out, MemOperand(scratch, Context::SlotOffset(trans_index))); |
| 4302 } |
| 4303 |
| 4304 |
| 4305 void MacroAssembler::LoadInitialArrayMap( |
4283 Register function_in, Register scratch, Register map_out) { | 4306 Register function_in, Register scratch, Register map_out) { |
4284 ASSERT(!function_in.is(map_out)); | 4307 ASSERT(!function_in.is(map_out)); |
4285 Label done; | 4308 Label done; |
4286 lw(map_out, FieldMemOperand(function_in, | 4309 lw(map_out, FieldMemOperand(function_in, |
4287 JSFunction::kPrototypeOrInitialMapOffset)); | 4310 JSFunction::kPrototypeOrInitialMapOffset)); |
4288 if (!FLAG_smi_only_arrays) { | 4311 if (!FLAG_smi_only_arrays) { |
4289 // Load the global or builtins object from the current context. | 4312 LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
4290 lw(scratch, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 4313 FAST_ELEMENTS, |
4291 lw(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); | 4314 map_out, |
4292 | 4315 scratch, |
4293 // Check that the function's map is same as the cached map. | 4316 &done); |
4294 lw(at, MemOperand( | |
4295 scratch, Context::SlotOffset(Context::SMI_JS_ARRAY_MAP_INDEX))); | |
4296 Branch(&done, ne, map_out, Operand(at)); | |
4297 | |
4298 // Use the cached transitioned map. | |
4299 lw(map_out, | |
4300 MemOperand(scratch, | |
4301 Context::SlotOffset(Context::OBJECT_JS_ARRAY_MAP_INDEX))); | |
4302 } | 4317 } |
4303 bind(&done); | 4318 bind(&done); |
4304 } | 4319 } |
4305 | 4320 |
4306 | 4321 |
4307 void MacroAssembler::LoadGlobalFunction(int index, Register function) { | 4322 void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
4308 // Load the global or builtins object from the current context. | 4323 // Load the global or builtins object from the current context. |
4309 lw(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); | 4324 lw(function, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
4310 // Load the global context from the global or builtins object. | 4325 // Load the global context from the global or builtins object. |
4311 lw(function, FieldMemOperand(function, | 4326 lw(function, FieldMemOperand(function, |
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5206 opcode == BGTZL); | 5221 opcode == BGTZL); |
5207 opcode = (cond == eq) ? BEQ : BNE; | 5222 opcode = (cond == eq) ? BEQ : BNE; |
5208 instr = (instr & ~kOpcodeMask) | opcode; | 5223 instr = (instr & ~kOpcodeMask) | opcode; |
5209 masm_.emit(instr); | 5224 masm_.emit(instr); |
5210 } | 5225 } |
5211 | 5226 |
5212 | 5227 |
5213 } } // namespace v8::internal | 5228 } } // namespace v8::internal |
5214 | 5229 |
5215 #endif // V8_TARGET_ARCH_MIPS | 5230 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |