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

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

Issue 10033028: Reland arguments access support for inlined functions (r11109,r11118). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix Kevin's comments Created 8 years, 8 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
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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 return new(zone()) LCmpMapAndBranch(value); 1076 return new(zone()) LCmpMapAndBranch(value);
1077 } 1077 }
1078 1078
1079 1079
1080 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) { 1080 LInstruction* LChunkBuilder::DoArgumentsLength(HArgumentsLength* length) {
1081 return DefineAsRegister(new(zone()) LArgumentsLength(Use(length->value()))); 1081 return DefineAsRegister(new(zone()) LArgumentsLength(Use(length->value())));
1082 } 1082 }
1083 1083
1084 1084
1085 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) { 1085 LInstruction* LChunkBuilder::DoArgumentsElements(HArgumentsElements* elems) {
1086 return DefineAsRegister(new(zone()) LArgumentsElements); 1086 return DefineAsRegister(new(zone()) LArgumentsElements(
1087 elems->from_inlined()));
1087 } 1088 }
1088 1089
1089 1090
1090 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { 1091 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) {
1091 LOperand* left = UseFixed(instr->left(), InstanceofStub::left()); 1092 LOperand* left = UseFixed(instr->left(), InstanceofStub::left());
1092 LOperand* right = UseFixed(instr->right(), InstanceofStub::right()); 1093 LOperand* right = UseFixed(instr->right(), InstanceofStub::right());
1093 LOperand* context = UseFixed(instr->context(), esi); 1094 LOperand* context = UseFixed(instr->context(), esi);
1094 LInstanceOf* result = new(zone()) LInstanceOf(context, left, right); 1095 LInstanceOf* result = new(zone()) LInstanceOf(context, left, right);
1095 return MarkAsCall(DefineFixed(result, eax), instr); 1096 return MarkAsCall(DefineFixed(result, eax), instr);
1096 } 1097 }
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 2374
2374 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { 2375 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) {
2375 HEnvironment* outer = current_block_->last_environment(); 2376 HEnvironment* outer = current_block_->last_environment();
2376 HConstant* undefined = graph()->GetConstantUndefined(); 2377 HConstant* undefined = graph()->GetConstantUndefined();
2377 HEnvironment* inner = outer->CopyForInlining(instr->closure(), 2378 HEnvironment* inner = outer->CopyForInlining(instr->closure(),
2378 instr->arguments_count(), 2379 instr->arguments_count(),
2379 instr->function(), 2380 instr->function(),
2380 undefined, 2381 undefined,
2381 instr->call_kind(), 2382 instr->call_kind(),
2382 instr->is_construct()); 2383 instr->is_construct());
2383 if (instr->arguments() != NULL) { 2384 if (instr->arguments_var() != NULL) {
2384 inner->Bind(instr->arguments(), graph()->GetArgumentsObject()); 2385 inner->Bind(instr->arguments_var(), graph()->GetArgumentsObject());
2385 } 2386 }
2386 current_block_->UpdateEnvironment(inner); 2387 current_block_->UpdateEnvironment(inner);
2387 chunk_->AddInlinedClosure(instr->closure()); 2388 chunk_->AddInlinedClosure(instr->closure());
2388 return NULL; 2389 return NULL;
2389 } 2390 }
2390 2391
2391 2392
2392 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { 2393 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) {
2394 LInstruction* pop = NULL;
2395
2396 HEnvironment* env = current_block_->last_environment();
2397
2398 if (instr->arguments_pushed()) {
2399 int argument_count = env->arguments_environment()->parameter_count();
2400 pop = new(zone()) LDrop(argument_count);
2401 argument_count_ -= argument_count;
2402 }
2403
2393 HEnvironment* outer = current_block_->last_environment()-> 2404 HEnvironment* outer = current_block_->last_environment()->
2394 DiscardInlined(false); 2405 DiscardInlined(false);
2395 current_block_->UpdateEnvironment(outer); 2406 current_block_->UpdateEnvironment(outer);
2396 return NULL; 2407 return pop;
2397 } 2408 }
2398 2409
2399 2410
2400 LInstruction* LChunkBuilder::DoIn(HIn* instr) { 2411 LInstruction* LChunkBuilder::DoIn(HIn* instr) {
2401 LOperand* context = UseFixed(instr->context(), esi); 2412 LOperand* context = UseFixed(instr->context(), esi);
2402 LOperand* key = UseOrConstantAtStart(instr->key()); 2413 LOperand* key = UseOrConstantAtStart(instr->key());
2403 LOperand* object = UseOrConstantAtStart(instr->object()); 2414 LOperand* object = UseOrConstantAtStart(instr->object());
2404 LIn* result = new(zone()) LIn(context, key, object); 2415 LIn* result = new(zone()) LIn(context, key, object);
2405 return MarkAsCall(DefineFixed(result, eax), instr); 2416 return MarkAsCall(DefineFixed(result, eax), instr);
2406 } 2417 }
(...skipping 24 matching lines...) Expand all
2431 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { 2442 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) {
2432 LOperand* object = UseRegister(instr->object()); 2443 LOperand* object = UseRegister(instr->object());
2433 LOperand* index = UseTempRegister(instr->index()); 2444 LOperand* index = UseTempRegister(instr->index());
2434 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); 2445 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index));
2435 } 2446 }
2436 2447
2437 2448
2438 } } // namespace v8::internal 2449 } } // namespace v8::internal
2439 2450
2440 #endif // V8_TARGET_ARCH_IA32 2451 #endif // V8_TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698