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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 } else { | 171 } else { |
172 ASSERT(descriptor_->environment_length() == param_count); | 172 ASSERT(descriptor_->environment_length() == param_count); |
173 stack_parameter_count = graph()->GetConstantMinus1(); | 173 stack_parameter_count = graph()->GetConstantMinus1(); |
174 arguments_length_ = graph()->GetConstant0(); | 174 arguments_length_ = graph()->GetConstant0(); |
175 } | 175 } |
176 | 176 |
177 context_ = new(zone) HContext(); | 177 context_ = new(zone) HContext(); |
178 AddInstruction(context_); | 178 AddInstruction(context_); |
179 start_environment->BindContext(context_); | 179 start_environment->BindContext(context_); |
180 | 180 |
181 AddSimulate(BailoutId::StubEntry()); | 181 Add<HSimulate>(BailoutId::StubEntry()); |
182 | 182 |
183 NoObservableSideEffectsScope no_effects(this); | 183 NoObservableSideEffectsScope no_effects(this); |
184 | 184 |
185 HValue* return_value = BuildCodeStub(); | 185 HValue* return_value = BuildCodeStub(); |
186 | 186 |
187 // We might have extra expressions to pop from the stack in addition to the | 187 // We might have extra expressions to pop from the stack in addition to the |
188 // arguments above. | 188 // arguments above. |
189 HInstruction* stack_pop_count = stack_parameter_count; | 189 HInstruction* stack_pop_count = stack_parameter_count; |
190 if (descriptor_->function_mode_ == JS_FUNCTION_STUB_MODE) { | 190 if (descriptor_->function_mode_ == JS_FUNCTION_STUB_MODE) { |
191 if (!stack_parameter_count->IsConstant() && | 191 if (!stack_parameter_count->IsConstant() && |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 } else { | 359 } else { |
360 ElementsKind elements_kind = casted_stub()->ComputeElementsKind(); | 360 ElementsKind elements_kind = casted_stub()->ComputeElementsKind(); |
361 environment()->Push(BuildCloneShallowArray(context(), | 361 environment()->Push(BuildCloneShallowArray(context(), |
362 boilerplate, | 362 boilerplate, |
363 allocation_site, | 363 allocation_site, |
364 alloc_site_mode, | 364 alloc_site_mode, |
365 elements_kind, | 365 elements_kind, |
366 length)); | 366 length)); |
367 } | 367 } |
368 | 368 |
369 HValue* result = environment()->Pop(); | |
370 checker.ElseDeopt(); | 369 checker.ElseDeopt(); |
371 return result; | 370 checker.End(); |
| 371 |
| 372 return environment()->Pop(); |
372 } | 373 } |
373 | 374 |
374 | 375 |
375 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { | 376 Handle<Code> FastCloneShallowArrayStub::GenerateCode() { |
376 return DoGenerateCode(this); | 377 return DoGenerateCode(this); |
377 } | 378 } |
378 | 379 |
379 | 380 |
380 template <> | 381 template <> |
381 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { | 382 HValue* CodeStubGraphBuilder<FastCloneShallowObjectStub>::BuildCodeStub() { |
(...skipping 27 matching lines...) Expand all Loading... |
409 } | 410 } |
410 | 411 |
411 HInstruction* object = AddInstruction(new(zone) | 412 HInstruction* object = AddInstruction(new(zone) |
412 HAllocate(context(), size_in_bytes, HType::JSObject(), flags)); | 413 HAllocate(context(), size_in_bytes, HType::JSObject(), flags)); |
413 | 414 |
414 for (int i = 0; i < size; i += kPointerSize) { | 415 for (int i = 0; i < size; i += kPointerSize) { |
415 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); | 416 HObjectAccess access = HObjectAccess::ForJSObjectOffset(i); |
416 AddStore(object, access, AddLoad(boilerplate, access)); | 417 AddStore(object, access, AddLoad(boilerplate, access)); |
417 } | 418 } |
418 | 419 |
| 420 environment()->Push(object); |
419 checker.ElseDeopt(); | 421 checker.ElseDeopt(); |
420 return object; | 422 checker.End(); |
| 423 |
| 424 return environment()->Pop(); |
421 } | 425 } |
422 | 426 |
423 | 427 |
424 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { | 428 Handle<Code> FastCloneShallowObjectStub::GenerateCode() { |
425 return DoGenerateCode(this); | 429 return DoGenerateCode(this); |
426 } | 430 } |
427 | 431 |
428 | 432 |
429 template <> | 433 template <> |
430 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { | 434 HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() { |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 | 894 |
891 template<> | 895 template<> |
892 HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() { | 896 HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() { |
893 HValue* value = GetParameter(0); | 897 HValue* value = GetParameter(0); |
894 HValue* map = GetParameter(1); | 898 HValue* map = GetParameter(1); |
895 HValue* key = GetParameter(2); | 899 HValue* key = GetParameter(2); |
896 HValue* object = GetParameter(3); | 900 HValue* object = GetParameter(3); |
897 | 901 |
898 if (FLAG_trace_elements_transitions) { | 902 if (FLAG_trace_elements_transitions) { |
899 // Tracing elements transitions is the job of the runtime. | 903 // Tracing elements transitions is the job of the runtime. |
900 current_block()->FinishExitWithDeoptimization(HDeoptimize::kUseAll); | 904 Add<HDeoptimize>(Deoptimizer::EAGER); |
901 set_current_block(NULL); | |
902 } else { | 905 } else { |
903 info()->MarkAsSavesCallerDoubles(); | 906 info()->MarkAsSavesCallerDoubles(); |
904 | 907 |
905 BuildTransitionElementsKind(object, map, | 908 BuildTransitionElementsKind(object, map, |
906 casted_stub()->from_kind(), | 909 casted_stub()->from_kind(), |
907 casted_stub()->to_kind(), | 910 casted_stub()->to_kind(), |
908 casted_stub()->is_jsarray()); | 911 casted_stub()->is_jsarray()); |
909 | 912 |
910 BuildUncheckedMonomorphicElementAccess(object, key, value, NULL, | 913 BuildUncheckedMonomorphicElementAccess(object, key, value, NULL, |
911 casted_stub()->is_jsarray(), | 914 casted_stub()->is_jsarray(), |
912 casted_stub()->to_kind(), | 915 casted_stub()->to_kind(), |
913 true, ALLOW_RETURN_HOLE, | 916 true, ALLOW_RETURN_HOLE, |
914 casted_stub()->store_mode()); | 917 casted_stub()->store_mode()); |
915 } | 918 } |
916 | 919 |
917 return value; | 920 return value; |
918 } | 921 } |
919 | 922 |
920 | 923 |
921 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { | 924 Handle<Code> ElementsTransitionAndStoreStub::GenerateCode() { |
922 return DoGenerateCode(this); | 925 return DoGenerateCode(this); |
923 } | 926 } |
924 | 927 |
925 | 928 |
926 } } // namespace v8::internal | 929 } } // namespace v8::internal |
OLD | NEW |