| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 LEnvironment* LChunkBuilder::CreateEnvironment( | 870 LEnvironment* LChunkBuilder::CreateEnvironment( |
| 871 HEnvironment* hydrogen_env, | 871 HEnvironment* hydrogen_env, |
| 872 int* argument_index_accumulator) { | 872 int* argument_index_accumulator) { |
| 873 if (hydrogen_env == NULL) return NULL; | 873 if (hydrogen_env == NULL) return NULL; |
| 874 | 874 |
| 875 LEnvironment* outer = | 875 LEnvironment* outer = |
| 876 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); | 876 CreateEnvironment(hydrogen_env->outer(), argument_index_accumulator); |
| 877 BailoutId ast_id = hydrogen_env->ast_id(); | 877 BailoutId ast_id = hydrogen_env->ast_id(); |
| 878 ASSERT(!ast_id.IsNone() || | 878 ASSERT(!ast_id.IsNone() || |
| 879 hydrogen_env->frame_type() != JS_FUNCTION); | 879 hydrogen_env->frame_type() != JS_FUNCTION); |
| 880 LEnvironment* result = |
| 881 new(zone()) LEnvironment(hydrogen_env, argument_count_, outer, zone()); |
| 882 int argument_index = *argument_index_accumulator; |
| 880 int value_count = hydrogen_env->length(); | 883 int value_count = hydrogen_env->length(); |
| 881 LEnvironment* result = | |
| 882 new(zone()) LEnvironment(hydrogen_env->closure(), | |
| 883 hydrogen_env->frame_type(), | |
| 884 ast_id, | |
| 885 hydrogen_env->parameter_count(), | |
| 886 argument_count_, | |
| 887 value_count, | |
| 888 outer, | |
| 889 zone()); | |
| 890 int argument_index = *argument_index_accumulator; | |
| 891 for (int i = 0; i < value_count; ++i) { | 884 for (int i = 0; i < value_count; ++i) { |
| 892 if (hydrogen_env->is_special_index(i)) continue; | 885 if (hydrogen_env->is_special_index(i)) continue; |
| 893 | 886 |
| 894 HValue* value = hydrogen_env->values()->at(i); | 887 HValue* value = hydrogen_env->values()->at(i); |
| 895 LOperand* op = NULL; | 888 LOperand* op = NULL; |
| 896 if (value->IsArgumentsObject()) { | 889 if (value->IsArgumentsObject()) { |
| 897 op = NULL; | 890 op = NULL; |
| 898 } else if (value->IsPushArgument()) { | 891 } else if (value->IsPushArgument()) { |
| 899 op = new(zone()) LArgument(argument_index++); | 892 op = new(zone()) LArgument(argument_index++); |
| 900 } else { | 893 } else { |
| (...skipping 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2351 return MarkAsCall(new(zone()) LStackCheck(context), instr); | 2344 return MarkAsCall(new(zone()) LStackCheck(context), instr); |
| 2352 } else { | 2345 } else { |
| 2353 ASSERT(instr->is_backwards_branch()); | 2346 ASSERT(instr->is_backwards_branch()); |
| 2354 LOperand* context = UseAny(instr->context()); | 2347 LOperand* context = UseAny(instr->context()); |
| 2355 return AssignEnvironment( | 2348 return AssignEnvironment( |
| 2356 AssignPointerMap(new(zone()) LStackCheck(context))); | 2349 AssignPointerMap(new(zone()) LStackCheck(context))); |
| 2357 } | 2350 } |
| 2358 } | 2351 } |
| 2359 | 2352 |
| 2360 | 2353 |
| 2354 LInstruction* LChunkBuilder::DoEnterTry(HEnterTry* instr) { |
| 2355 current_block_->last_environment()->AddExceptionHandler(); |
| 2356 return new(zone()) LEnterTry; |
| 2357 } |
| 2358 |
| 2359 |
| 2360 LInstruction* LChunkBuilder::DoLeaveTry(HLeaveTry* instr) { |
| 2361 current_block_->last_environment()->RemoveExceptionHandler(); |
| 2362 return new(zone()) LLeaveTry; |
| 2363 } |
| 2364 |
| 2365 |
| 2361 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { | 2366 LInstruction* LChunkBuilder::DoEnterInlined(HEnterInlined* instr) { |
| 2362 HEnvironment* outer = current_block_->last_environment(); | 2367 HEnvironment* outer = current_block_->last_environment(); |
| 2363 HConstant* undefined = graph()->GetConstantUndefined(); | 2368 HConstant* undefined = graph()->GetConstantUndefined(); |
| 2364 HEnvironment* inner = outer->CopyForInlining(instr->closure(), | 2369 HEnvironment* inner = outer->CopyForInlining(instr->closure(), |
| 2365 instr->arguments_count(), | 2370 instr->arguments_count(), |
| 2366 instr->function(), | 2371 instr->function(), |
| 2367 undefined, | 2372 undefined, |
| 2368 instr->call_kind(), | 2373 instr->call_kind(), |
| 2369 instr->inlining_kind()); | 2374 instr->inlining_kind()); |
| 2370 if (instr->arguments_var() != NULL) { | 2375 if (instr->arguments_var() != NULL) { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2428 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2433 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2429 LOperand* object = UseRegister(instr->object()); | 2434 LOperand* object = UseRegister(instr->object()); |
| 2430 LOperand* index = UseTempRegister(instr->index()); | 2435 LOperand* index = UseTempRegister(instr->index()); |
| 2431 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2436 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2432 } | 2437 } |
| 2433 | 2438 |
| 2434 | 2439 |
| 2435 } } // namespace v8::internal | 2440 } } // namespace v8::internal |
| 2436 | 2441 |
| 2437 #endif // V8_TARGET_ARCH_IA32 | 2442 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |