Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 10103035: Share optimized code for closures. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 void LCodeGen::WriteTranslation(LEnvironment* environment, 413 void LCodeGen::WriteTranslation(LEnvironment* environment,
414 Translation* translation) { 414 Translation* translation) {
415 if (environment == NULL) return; 415 if (environment == NULL) return;
416 416
417 // The translation includes one command per value in the environment. 417 // The translation includes one command per value in the environment.
418 int translation_size = environment->values()->length(); 418 int translation_size = environment->values()->length();
419 // The output frame height does not include the parameters. 419 // The output frame height does not include the parameters.
420 int height = translation_size - environment->parameter_count(); 420 int height = translation_size - environment->parameter_count();
421 421
422 WriteTranslation(environment->outer(), translation); 422 WriteTranslation(environment->outer(), translation);
423 int closure_id = DefineDeoptimizationLiteral(environment->closure()); 423 int closure_id = *info()->closure() != *environment->closure()
424 ? DefineDeoptimizationLiteral(environment->closure())
425 : Translation::kSelfLiteralId;
424 switch (environment->frame_type()) { 426 switch (environment->frame_type()) {
425 case JS_FUNCTION: 427 case JS_FUNCTION:
426 translation->BeginJSFrame(environment->ast_id(), closure_id, height); 428 translation->BeginJSFrame(environment->ast_id(), closure_id, height);
427 break; 429 break;
428 case JS_CONSTRUCT: 430 case JS_CONSTRUCT:
429 translation->BeginConstructStubFrame(closure_id, translation_size); 431 translation->BeginConstructStubFrame(closure_id, translation_size);
430 break; 432 break;
431 case ARGUMENTS_ADAPTOR: 433 case ARGUMENTS_ADAPTOR:
432 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size); 434 translation->BeginArgumentsAdaptorFrame(closure_id, translation_size);
433 break; 435 break;
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after
2823 } 2825 }
2824 2826
2825 2827
2826 void LCodeGen::DoDrop(LDrop* instr) { 2828 void LCodeGen::DoDrop(LDrop* instr) {
2827 __ Drop(instr->count()); 2829 __ Drop(instr->count());
2828 } 2830 }
2829 2831
2830 2832
2831 void LCodeGen::DoThisFunction(LThisFunction* instr) { 2833 void LCodeGen::DoThisFunction(LThisFunction* instr) {
2832 Register result = ToRegister(instr->result()); 2834 Register result = ToRegister(instr->result());
2833 __ LoadHeapObject(result, instr->hydrogen()->closure()); 2835 __ mov(result, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
2834 } 2836 }
2835 2837
2836 2838
2837 void LCodeGen::DoContext(LContext* instr) { 2839 void LCodeGen::DoContext(LContext* instr) {
2838 Register result = ToRegister(instr->result()); 2840 Register result = ToRegister(instr->result());
2839 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset)); 2841 __ mov(result, Operand(ebp, StandardFrameConstants::kContextOffset));
2840 } 2842 }
2841 2843
2842 2844
2843 void LCodeGen::DoOuterContext(LOuterContext* instr) { 2845 void LCodeGen::DoOuterContext(LOuterContext* instr) {
(...skipping 2383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5227 FixedArray::kHeaderSize - kPointerSize)); 5229 FixedArray::kHeaderSize - kPointerSize));
5228 __ bind(&done); 5230 __ bind(&done);
5229 } 5231 }
5230 5232
5231 5233
5232 #undef __ 5234 #undef __
5233 5235
5234 } } // namespace v8::internal 5236 } } // namespace v8::internal
5235 5237
5236 #endif // V8_TARGET_ARCH_IA32 5238 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/deoptimizer-ia32.cc ('k') | src/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698