| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
| 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 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2273 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); | 2273 __ JumpIfSmi(input, instr->FalseLabel(chunk_)); |
| 2274 } | 2274 } |
| 2275 | 2275 |
| 2276 __ GetObjectType(input, scratch, scratch); | 2276 __ GetObjectType(input, scratch, scratch); |
| 2277 EmitBranch(instr, | 2277 EmitBranch(instr, |
| 2278 BranchCondition(instr->hydrogen()), | 2278 BranchCondition(instr->hydrogen()), |
| 2279 scratch, | 2279 scratch, |
| 2280 Operand(TestType(instr->hydrogen()))); | 2280 Operand(TestType(instr->hydrogen()))); |
| 2281 } | 2281 } |
| 2282 | 2282 |
| 2283 | |
| 2284 void LCodeGen::DoGetCachedArrayIndex(LGetCachedArrayIndex* instr) { | |
| 2285 Register input = ToRegister(instr->value()); | |
| 2286 Register result = ToRegister(instr->result()); | |
| 2287 | |
| 2288 __ AssertString(input); | |
| 2289 | |
| 2290 __ lw(result, FieldMemOperand(input, String::kHashFieldOffset)); | |
| 2291 __ IndexFromHash(result, result); | |
| 2292 } | |
| 2293 | |
| 2294 | |
| 2295 void LCodeGen::DoHasCachedArrayIndexAndBranch( | |
| 2296 LHasCachedArrayIndexAndBranch* instr) { | |
| 2297 Register input = ToRegister(instr->value()); | |
| 2298 Register scratch = scratch0(); | |
| 2299 | |
| 2300 __ lw(scratch, | |
| 2301 FieldMemOperand(input, String::kHashFieldOffset)); | |
| 2302 __ And(at, scratch, Operand(String::kContainsCachedArrayIndexMask)); | |
| 2303 EmitBranch(instr, eq, at, Operand(zero_reg)); | |
| 2304 } | |
| 2305 | |
| 2306 | |
| 2307 // Branches to a label or falls through with the answer in flags. Trashes | 2283 // Branches to a label or falls through with the answer in flags. Trashes |
| 2308 // the temp registers, but not the input. | 2284 // the temp registers, but not the input. |
| 2309 void LCodeGen::EmitClassOfTest(Label* is_true, | 2285 void LCodeGen::EmitClassOfTest(Label* is_true, |
| 2310 Label* is_false, | 2286 Label* is_false, |
| 2311 Handle<String>class_name, | 2287 Handle<String>class_name, |
| 2312 Register input, | 2288 Register input, |
| 2313 Register temp, | 2289 Register temp, |
| 2314 Register temp2) { | 2290 Register temp2) { |
| 2315 DCHECK(!input.is(temp)); | 2291 DCHECK(!input.is(temp)); |
| 2316 DCHECK(!input.is(temp2)); | 2292 DCHECK(!input.is(temp2)); |
| (...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5438 __ lw(result, FieldMemOperand(scratch, | 5414 __ lw(result, FieldMemOperand(scratch, |
| 5439 FixedArray::kHeaderSize - kPointerSize)); | 5415 FixedArray::kHeaderSize - kPointerSize)); |
| 5440 __ bind(deferred->exit()); | 5416 __ bind(deferred->exit()); |
| 5441 __ bind(&done); | 5417 __ bind(&done); |
| 5442 } | 5418 } |
| 5443 | 5419 |
| 5444 #undef __ | 5420 #undef __ |
| 5445 | 5421 |
| 5446 } // namespace internal | 5422 } // namespace internal |
| 5447 } // namespace v8 | 5423 } // namespace v8 |
| OLD | NEW |