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 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); | 587 HObjectAccess::ForBackingStoreOffset(casted_stub()->offset(), rep); |
588 return AddLoadNamedField(GetParameter(0), access); | 588 return AddLoadNamedField(GetParameter(0), access); |
589 } | 589 } |
590 | 590 |
591 | 591 |
592 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { | 592 Handle<Code> KeyedLoadFieldStub::GenerateCode(Isolate* isolate) { |
593 return DoGenerateCode(isolate, this); | 593 return DoGenerateCode(isolate, this); |
594 } | 594 } |
595 | 595 |
596 | 596 |
| 597 template<> |
| 598 HValue* CodeStubGraphBuilder<KeyedArrayCallStub>::BuildCodeStub() { |
| 599 int argc = casted_stub()->argc() + 1; |
| 600 info()->set_parameter_count(argc); |
| 601 |
| 602 HValue* receiver = Add<HParameter>(1); |
| 603 |
| 604 // Load the expected initial array map from the context. |
| 605 JSArrayBuilder array_builder(this, casted_stub()->elements_kind()); |
| 606 HValue* map = array_builder.EmitMapCode(); |
| 607 |
| 608 HValue* checked_receiver = Add<HCheckMapValue>(receiver, map); |
| 609 |
| 610 HValue* function = BuildUncheckedMonomorphicElementAccess( |
| 611 checked_receiver, GetParameter(0), |
| 612 NULL, true, casted_stub()->elements_kind(), |
| 613 false, NEVER_RETURN_HOLE, STANDARD_STORE); |
| 614 return Add<HCallFunction>(function, argc, TAIL_CALL); |
| 615 } |
| 616 |
| 617 |
| 618 Handle<Code> KeyedArrayCallStub::GenerateCode(Isolate* isolate) { |
| 619 return DoGenerateCode(isolate, this); |
| 620 } |
| 621 |
| 622 |
597 template <> | 623 template <> |
598 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { | 624 HValue* CodeStubGraphBuilder<KeyedStoreFastElementStub>::BuildCodeStub() { |
599 BuildUncheckedMonomorphicElementAccess( | 625 BuildUncheckedMonomorphicElementAccess( |
600 GetParameter(0), GetParameter(1), GetParameter(2), | 626 GetParameter(0), GetParameter(1), GetParameter(2), |
601 casted_stub()->is_js_array(), casted_stub()->elements_kind(), | 627 casted_stub()->is_js_array(), casted_stub()->elements_kind(), |
602 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); | 628 true, NEVER_RETURN_HOLE, casted_stub()->store_mode()); |
603 | 629 |
604 return GetParameter(2); | 630 return GetParameter(2); |
605 } | 631 } |
606 | 632 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 return js_function; | 1312 return js_function; |
1287 } | 1313 } |
1288 | 1314 |
1289 | 1315 |
1290 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { | 1316 Handle<Code> FastNewClosureStub::GenerateCode(Isolate* isolate) { |
1291 return DoGenerateCode(isolate, this); | 1317 return DoGenerateCode(isolate, this); |
1292 } | 1318 } |
1293 | 1319 |
1294 | 1320 |
1295 } } // namespace v8::internal | 1321 } } // namespace v8::internal |
OLD | NEW |