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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 void LCodeGen::WriteTranslation(LEnvironment* environment, | 471 void LCodeGen::WriteTranslation(LEnvironment* environment, |
472 Translation* translation) { | 472 Translation* translation) { |
473 if (environment == NULL) return; | 473 if (environment == NULL) return; |
474 | 474 |
475 // The translation includes one command per value in the environment. | 475 // The translation includes one command per value in the environment. |
476 int translation_size = environment->values()->length(); | 476 int translation_size = environment->values()->length(); |
477 // The output frame height does not include the parameters. | 477 // The output frame height does not include the parameters. |
478 int height = translation_size - environment->parameter_count(); | 478 int height = translation_size - environment->parameter_count(); |
479 | 479 |
480 WriteTranslation(environment->outer(), translation); | 480 WriteTranslation(environment->outer(), translation); |
481 int closure_id = DefineDeoptimizationLiteral(environment->closure()); | 481 int closure_id = *info()->closure() != *environment->closure() |
| 482 ? DefineDeoptimizationLiteral(environment->closure()) |
| 483 : Translation::kSelfLiteralId; |
| 484 |
482 switch (environment->frame_type()) { | 485 switch (environment->frame_type()) { |
483 case JS_FUNCTION: | 486 case JS_FUNCTION: |
484 translation->BeginJSFrame(environment->ast_id(), closure_id, height); | 487 translation->BeginJSFrame(environment->ast_id(), closure_id, height); |
485 break; | 488 break; |
486 case JS_CONSTRUCT: | 489 case JS_CONSTRUCT: |
487 translation->BeginConstructStubFrame(closure_id, translation_size); | 490 translation->BeginConstructStubFrame(closure_id, translation_size); |
488 break; | 491 break; |
489 case ARGUMENTS_ADAPTOR: | 492 case ARGUMENTS_ADAPTOR: |
490 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); | 493 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
491 break; | 494 break; |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3032 } | 3035 } |
3033 | 3036 |
3034 | 3037 |
3035 void LCodeGen::DoDrop(LDrop* instr) { | 3038 void LCodeGen::DoDrop(LDrop* instr) { |
3036 __ Drop(instr->count()); | 3039 __ Drop(instr->count()); |
3037 } | 3040 } |
3038 | 3041 |
3039 | 3042 |
3040 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 3043 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
3041 Register result = ToRegister(instr->result()); | 3044 Register result = ToRegister(instr->result()); |
3042 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 3045 __ ldr(result, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
3043 } | 3046 } |
3044 | 3047 |
3045 | 3048 |
3046 void LCodeGen::DoContext(LContext* instr) { | 3049 void LCodeGen::DoContext(LContext* instr) { |
3047 Register result = ToRegister(instr->result()); | 3050 Register result = ToRegister(instr->result()); |
3048 __ mov(result, cp); | 3051 __ mov(result, cp); |
3049 } | 3052 } |
3050 | 3053 |
3051 | 3054 |
3052 void LCodeGen::DoOuterContext(LOuterContext* instr) { | 3055 void LCodeGen::DoOuterContext(LOuterContext* instr) { |
(...skipping 2258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5311 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5314 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
5312 __ ldr(result, FieldMemOperand(scratch, | 5315 __ ldr(result, FieldMemOperand(scratch, |
5313 FixedArray::kHeaderSize - kPointerSize)); | 5316 FixedArray::kHeaderSize - kPointerSize)); |
5314 __ bind(&done); | 5317 __ bind(&done); |
5315 } | 5318 } |
5316 | 5319 |
5317 | 5320 |
5318 #undef __ | 5321 #undef __ |
5319 | 5322 |
5320 } } // namespace v8::internal | 5323 } } // namespace v8::internal |
OLD | NEW |