OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/bailout-reason.h" | 7 #include "src/bailout-reason.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/field-index.h" | 9 #include "src/field-index.h" |
10 #include "src/hydrogen.h" | 10 #include "src/hydrogen.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 return feedback_vector; | 507 return feedback_vector; |
508 } | 508 } |
509 | 509 |
510 | 510 |
511 Handle<Code> CreateAllocationSiteStub::GenerateCode() { | 511 Handle<Code> CreateAllocationSiteStub::GenerateCode() { |
512 return DoGenerateCode(this); | 512 return DoGenerateCode(this); |
513 } | 513 } |
514 | 514 |
515 | 515 |
516 template <> | 516 template <> |
| 517 HValue* CodeStubGraphBuilder<LoadGlobalContextFieldStub>::BuildCodeStub() { |
| 518 int context_index = casted_stub()->context_index(); |
| 519 int slot_index = casted_stub()->slot_index(); |
| 520 |
| 521 HValue* native_context = BuildGetNativeContext(); |
| 522 HValue* global_context_table = Add<HLoadNamedField>( |
| 523 native_context, static_cast<HValue*>(NULL), |
| 524 HObjectAccess::ForContextSlot(Context::GLOBAL_CONTEXT_TABLE_INDEX)); |
| 525 HValue* global_context = |
| 526 Add<HLoadNamedField>(global_context_table, static_cast<HValue*>(NULL), |
| 527 HObjectAccess::ForGlobalContext(context_index)); |
| 528 return Add<HLoadNamedField>(global_context, static_cast<HValue*>(NULL), |
| 529 HObjectAccess::ForContextSlot(slot_index)); |
| 530 } |
| 531 |
| 532 |
| 533 Handle<Code> LoadGlobalContextFieldStub::GenerateCode() { |
| 534 return DoGenerateCode(this); |
| 535 } |
| 536 |
| 537 |
| 538 template <> |
517 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 539 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
518 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 540 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
519 GetParameter(LoadDescriptor::kReceiverIndex), | 541 GetParameter(LoadDescriptor::kReceiverIndex), |
520 GetParameter(LoadDescriptor::kNameIndex), NULL, | 542 GetParameter(LoadDescriptor::kNameIndex), NULL, |
521 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 543 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
522 NEVER_RETURN_HOLE, STANDARD_STORE); | 544 NEVER_RETURN_HOLE, STANDARD_STORE); |
523 return load; | 545 return load; |
524 } | 546 } |
525 | 547 |
526 | 548 |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 | 2029 |
2008 // Probe the stub cache. | 2030 // Probe the stub cache. |
2009 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 2031 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
2010 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 2032 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
2011 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); | 2033 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); |
2012 | 2034 |
2013 // We never continue. | 2035 // We never continue. |
2014 return graph()->GetConstant0(); | 2036 return graph()->GetConstant0(); |
2015 } | 2037 } |
2016 } } // namespace v8::internal | 2038 } } // namespace v8::internal |
OLD | NEW |