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 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3364 // Deoptimize if the receiver is not a JS object. | 3364 // Deoptimize if the receiver is not a JS object. |
3365 __ SmiTst(receiver, scratch); | 3365 __ SmiTst(receiver, scratch); |
3366 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); | 3366 DeoptimizeIf(eq, instr->environment(), scratch, Operand(zero_reg)); |
3367 | 3367 |
3368 __ GetObjectType(receiver, scratch, scratch); | 3368 __ GetObjectType(receiver, scratch, scratch); |
3369 DeoptimizeIf(lt, instr->environment(), | 3369 DeoptimizeIf(lt, instr->environment(), |
3370 scratch, Operand(FIRST_SPEC_OBJECT_TYPE)); | 3370 scratch, Operand(FIRST_SPEC_OBJECT_TYPE)); |
3371 __ Branch(&result_in_receiver); | 3371 __ Branch(&result_in_receiver); |
3372 | 3372 |
3373 __ bind(&global_object); | 3373 __ bind(&global_object); |
3374 __ lw(result, GlobalObjectOperand()); | 3374 |
| 3375 __ lw(result, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 3376 __ lw(result, ContextOperand(result, Context::GLOBAL_OBJECT_INDEX)); |
3375 __ lw(result, | 3377 __ lw(result, |
3376 FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset)); | 3378 FieldMemOperand(result, JSGlobalObject::kGlobalReceiverOffset)); |
3377 if (result.is(receiver)) { | 3379 if (result.is(receiver)) { |
3378 __ bind(&result_in_receiver); | 3380 __ bind(&result_in_receiver); |
3379 } else { | 3381 } else { |
3380 Label result_ok; | 3382 Label result_ok; |
3381 __ Branch(&result_ok); | 3383 __ Branch(&result_ok); |
3382 __ bind(&result_in_receiver); | 3384 __ bind(&result_in_receiver); |
3383 __ mov(result, receiver); | 3385 __ mov(result, receiver); |
3384 __ bind(&result_ok); | 3386 __ bind(&result_ok); |
(...skipping 2424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5809 __ Subu(scratch, result, scratch); | 5811 __ Subu(scratch, result, scratch); |
5810 __ lw(result, FieldMemOperand(scratch, | 5812 __ lw(result, FieldMemOperand(scratch, |
5811 FixedArray::kHeaderSize - kPointerSize)); | 5813 FixedArray::kHeaderSize - kPointerSize)); |
5812 __ bind(&done); | 5814 __ bind(&done); |
5813 } | 5815 } |
5814 | 5816 |
5815 | 5817 |
5816 #undef __ | 5818 #undef __ |
5817 | 5819 |
5818 } } // namespace v8::internal | 5820 } } // namespace v8::internal |
OLD | NEW |