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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 current_block_->last_environment()->outer() != NULL)); | |
1088 } | 1087 } |
1089 | 1088 |
1090 | 1089 |
1091 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { | 1090 LInstruction* LChunkBuilder::DoInstanceOf(HInstanceOf* instr) { |
1092 LOperand* left = UseFixed(instr->left(), InstanceofStub::left()); | 1091 LOperand* left = UseFixed(instr->left(), InstanceofStub::left()); |
1093 LOperand* right = UseFixed(instr->right(), InstanceofStub::right()); | 1092 LOperand* right = UseFixed(instr->right(), InstanceofStub::right()); |
1094 LOperand* context = UseFixed(instr->context(), esi); | 1093 LOperand* context = UseFixed(instr->context(), esi); |
1095 LInstanceOf* result = new(zone()) LInstanceOf(context, left, right); | 1094 LInstanceOf* result = new(zone()) LInstanceOf(context, left, right); |
1096 return MarkAsCall(DefineFixed(result, eax), instr); | 1095 return MarkAsCall(DefineFixed(result, eax), instr); |
1097 } | 1096 } |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 | 2373 |
2375 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2374 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
2376 HEnvironment* outer = current_block_->last_environment(); | 2375 HEnvironment* outer = current_block_->last_environment(); |
2377 HConstant* undefined = graph()->GetConstantUndefined(); | 2376 HConstant* undefined = graph()->GetConstantUndefined(); |
2378 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2377 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
2379 instr->arguments_count(), | 2378 instr->arguments_count(), |
2380 instr->function(), | 2379 instr->function(), |
2381 undefined, | 2380 undefined, |
2382 instr->call_kind(), | 2381 instr->call_kind(), |
2383 instr->is_construct()); | 2382 instr->is_construct()); |
2384 if (instr->materializes_arguments()) { | |
2385 inner->Bind(instr->arguments(), graph()->GetArgumentsObject()); | |
2386 } | |
2387 current_block_->UpdateEnvironment(inner); | 2383 current_block_->UpdateEnvironment(inner); |
2388 chunk_->AddInlinedClosure(instr->closure()); | 2384 chunk_->AddInlinedClosure(instr->closure()); |
2389 return NULL; | 2385 return NULL; |
2390 } | 2386 } |
2391 | 2387 |
2392 | 2388 |
2393 LInstruction* LChunkBuilder::DoLeaveInlined(HLeaveInlined* instr) { | 2389 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()) LPop(argument_count); | |
2401 argument_count_ -= argument_count; | |
2402 } | |
2403 | |
2404 HEnvironment* outer = current_block_->last_environment()-> | 2390 HEnvironment* outer = current_block_->last_environment()-> |
2405 DiscardInlined(false); | 2391 DiscardInlined(false); |
2406 current_block_->UpdateEnvironment(outer); | 2392 current_block_->UpdateEnvironment(outer); |
2407 return pop; | 2393 return NULL; |
2408 } | 2394 } |
2409 | 2395 |
2410 | 2396 |
2411 LInstruction* LChunkBuilder::DoIn(HIn* instr) { | 2397 LInstruction* LChunkBuilder::DoIn(HIn* instr) { |
2412 LOperand* context = UseFixed(instr->context(), esi); | 2398 LOperand* context = UseFixed(instr->context(), esi); |
2413 LOperand* key = UseOrConstantAtStart(instr->key()); | 2399 LOperand* key = UseOrConstantAtStart(instr->key()); |
2414 LOperand* object = UseOrConstantAtStart(instr->object()); | 2400 LOperand* object = UseOrConstantAtStart(instr->object()); |
2415 LIn* result = new(zone()) LIn(context, key, object); | 2401 LIn* result = new(zone()) LIn(context, key, object); |
2416 return MarkAsCall(DefineFixed(result, eax), instr); | 2402 return MarkAsCall(DefineFixed(result, eax), instr); |
2417 } | 2403 } |
(...skipping 24 matching lines...) Expand all Loading... |
2442 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2428 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2443 LOperand* object = UseRegister(instr->object()); | 2429 LOperand* object = UseRegister(instr->object()); |
2444 LOperand* index = UseTempRegister(instr->index()); | 2430 LOperand* index = UseTempRegister(instr->index()); |
2445 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2431 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
2446 } | 2432 } |
2447 | 2433 |
2448 | 2434 |
2449 } } // namespace v8::internal | 2435 } } // namespace v8::internal |
2450 | 2436 |
2451 #endif // V8_TARGET_ARCH_IA32 | 2437 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |