| 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 2590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3082 } | 3085 } |
| 3083 | 3086 |
| 3084 | 3087 |
| 3085 void LCodeGen::DoDrop(LDrop* instr) { | 3088 void LCodeGen::DoDrop(LDrop* instr) { |
| 3086 __ Drop(instr->count()); | 3089 __ Drop(instr->count()); |
| 3087 } | 3090 } |
| 3088 | 3091 |
| 3089 | 3092 |
| 3090 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 3093 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
| 3091 Register result = ToRegister(instr->result()); | 3094 Register result = ToRegister(instr->result()); |
| 3092 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 3095 __ ldr(result, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 3093 } | 3096 } |
| 3094 | 3097 |
| 3095 | 3098 |
| 3096 void LCodeGen::DoContext(LContext* instr) { | 3099 void LCodeGen::DoContext(LContext* instr) { |
| 3097 Register result = ToRegister(instr->result()); | 3100 Register result = ToRegister(instr->result()); |
| 3098 __ mov(result, cp); | 3101 __ mov(result, cp); |
| 3099 } | 3102 } |
| 3100 | 3103 |
| 3101 | 3104 |
| 3102 void LCodeGen::DoOuterContext(LOuterContext* instr) { | 3105 void LCodeGen::DoOuterContext(LOuterContext* instr) { |
| (...skipping 2294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5397 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); | 5400 __ sub(scratch, result, Operand(index, LSL, kPointerSizeLog2 - kSmiTagSize)); |
| 5398 __ ldr(result, FieldMemOperand(scratch, | 5401 __ ldr(result, FieldMemOperand(scratch, |
| 5399 FixedArray::kHeaderSize - kPointerSize)); | 5402 FixedArray::kHeaderSize - kPointerSize)); |
| 5400 __ bind(&done); | 5403 __ bind(&done); |
| 5401 } | 5404 } |
| 5402 | 5405 |
| 5403 | 5406 |
| 5404 #undef __ | 5407 #undef __ |
| 5405 | 5408 |
| 5406 } } // namespace v8::internal | 5409 } } // namespace v8::internal |
| OLD | NEW |