| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 void LCodeGen::WriteTranslation(LEnvironment* environment, | 360 void LCodeGen::WriteTranslation(LEnvironment* environment, |
| 361 Translation* translation) { | 361 Translation* translation) { |
| 362 if (environment == NULL) return; | 362 if (environment == NULL) return; |
| 363 | 363 |
| 364 // The translation includes one command per value in the environment. | 364 // The translation includes one command per value in the environment. |
| 365 int translation_size = environment->values()->length(); | 365 int translation_size = environment->values()->length(); |
| 366 // The output frame height does not include the parameters. | 366 // The output frame height does not include the parameters. |
| 367 int height = translation_size - environment->parameter_count(); | 367 int height = translation_size - environment->parameter_count(); |
| 368 | 368 |
| 369 WriteTranslation(environment->outer(), translation); | 369 WriteTranslation(environment->outer(), translation); |
| 370 int closure_id = DefineDeoptimizationLiteral(environment->closure()); | 370 int closure_id = *info()->closure() != *environment->closure() |
| 371 ? DefineDeoptimizationLiteral(environment->closure()) |
| 372 : Translation::kSelfLiteralId; |
| 373 |
| 371 switch (environment->frame_type()) { | 374 switch (environment->frame_type()) { |
| 372 case JS_FUNCTION: | 375 case JS_FUNCTION: |
| 373 translation->BeginJSFrame(environment->ast_id(), closure_id, height); | 376 translation->BeginJSFrame(environment->ast_id(), closure_id, height); |
| 374 break; | 377 break; |
| 375 case JS_CONSTRUCT: | 378 case JS_CONSTRUCT: |
| 376 translation->BeginConstructStubFrame(closure_id, translation_size); | 379 translation->BeginConstructStubFrame(closure_id, translation_size); |
| 377 break; | 380 break; |
| 378 case ARGUMENTS_ADAPTOR: | 381 case ARGUMENTS_ADAPTOR: |
| 379 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); | 382 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); |
| 380 break; | 383 break; |
| (...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2643 } | 2646 } |
| 2644 | 2647 |
| 2645 | 2648 |
| 2646 void LCodeGen::DoDrop(LDrop* instr) { | 2649 void LCodeGen::DoDrop(LDrop* instr) { |
| 2647 __ Drop(instr->count()); | 2650 __ Drop(instr->count()); |
| 2648 } | 2651 } |
| 2649 | 2652 |
| 2650 | 2653 |
| 2651 void LCodeGen::DoThisFunction(LThisFunction* instr) { | 2654 void LCodeGen::DoThisFunction(LThisFunction* instr) { |
| 2652 Register result = ToRegister(instr->result()); | 2655 Register result = ToRegister(instr->result()); |
| 2653 __ LoadHeapObject(result, instr->hydrogen()->closure()); | 2656 __ movq(result, Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| 2654 } | 2657 } |
| 2655 | 2658 |
| 2656 | 2659 |
| 2657 void LCodeGen::DoContext(LContext* instr) { | 2660 void LCodeGen::DoContext(LContext* instr) { |
| 2658 Register result = ToRegister(instr->result()); | 2661 Register result = ToRegister(instr->result()); |
| 2659 __ movq(result, rsi); | 2662 __ movq(result, rsi); |
| 2660 } | 2663 } |
| 2661 | 2664 |
| 2662 | 2665 |
| 2663 void LCodeGen::DoOuterContext(LOuterContext* instr) { | 2666 void LCodeGen::DoOuterContext(LOuterContext* instr) { |
| (...skipping 2153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4817 FixedArray::kHeaderSize - kPointerSize)); | 4820 FixedArray::kHeaderSize - kPointerSize)); |
| 4818 __ bind(&done); | 4821 __ bind(&done); |
| 4819 } | 4822 } |
| 4820 | 4823 |
| 4821 | 4824 |
| 4822 #undef __ | 4825 #undef __ |
| 4823 | 4826 |
| 4824 } } // namespace v8::internal | 4827 } } // namespace v8::internal |
| 4825 | 4828 |
| 4826 #endif // V8_TARGET_ARCH_X64 | 4829 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |