| 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); | 591 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); |
| 592 return AddLoadNamedField(GetParameter(0), access); | 592 return AddLoadNamedField(GetParameter(0), access); |
| 593 } | 593 } |
| 594 | 594 |
| 595 | 595 |
| 596 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { | 596 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { |
| 597 return DoGenerateCode(isolate, this); | 597 return DoGenerateCode(isolate, this); |
| 598 } | 598 } |
| 599 | 599 |
| 600 | 600 |
| 601 template<> | |
| 602 HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() { | |
| 603 int argc = casted_stub()->argc() + 1; | |
| 604 info()->set_parameter_count(argc); | |
| 605 | |
| 606 HValue* receiver = Add<HParameter>(1); | |
| 607 BuildCheckHeapObject(receiver); | |
| 608 | |
| 609 // Load the expected initial array map from the context. | |
| 610 JSArrayBuilder array_builder(this, casted_stub()->elements_kind()); | |
| 611 HValue* map = array_builder.EmitMapCode(); | |
| 612 | |
| 613 HValue* checked_receiver = Add<HCheckMapValue>(receiver, map); | |
| 614 | |
| 615 HValue* function = BuildUncheckedMonomorphicElementAccess( | |
| 616 checked_receiver, GetParameter(0), | |
| 617 NULL, true, casted_stub()->elements_kind(), | |
| 618 false, NEVER_RETURN_HOLE, STANDARD_STORE); | |
| 619 return Add<HCallFunction>(function, argc, TAIL_CALL); | |
| 620 } | |
| 621 | |
| 622 | |
| 623 Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) { | |
| 624 return DoGenerateCode(isolate, this); | |
| 625 } | |
| 626 | |
| 627 | |
| 628 template <> | 601 template <> |
| 629 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { | 602 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { |
| 630 BuildUncheckedMonomorphicElementAccess( | 603 BuildUncheckedMonomorphicElementAccess( |
| 631 GetParameter(0), GetParameter(1), GetParameter(2), | 604 GetParameter(0), GetParameter(1), GetParameter(2), |
| 632 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 605 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
| 633 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); | 606 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); |
| 634 | 607 |
| 635 return GetParameter(2); | 608 return GetParameter(2); |
| 636 } | 609 } |
| 637 | 610 |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 return BuildRegExpConstructResult(length, index, input); | 1408 return BuildRegExpConstructResult(length, index, input); |
| 1436 } | 1409 } |
| 1437 | 1410 |
| 1438 | 1411 |
| 1439 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { | 1412 Handle<Code> RegExpConstructResultStub::GenerateCode(Isolate* isolate) { |
| 1440 return DoGenerateCode(isolate, this); | 1413 return DoGenerateCode(isolate, this); |
| 1441 } | 1414 } |
| 1442 | 1415 |
| 1443 | 1416 |
| 1444 } } // namespace v8::internal | 1417 } } // namespace v8::internal |
| OLD | NEW |