| 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() { | 517 HValue* CodeStubGraphBuilder<LoadScriptContextFieldStub>::BuildCodeStub() { |
| 518 int context_index = casted_stub()->context_index(); | 518 int context_index = casted_stub()->context_index(); |
| 519 int slot_index = casted_stub()->slot_index(); | 519 int slot_index = casted_stub()->slot_index(); |
| 520 | 520 |
| 521 HValue* global_context = BuildGetGlobalContext(context_index); | 521 HValue* script_context = BuildGetScriptContext(context_index); |
| 522 return Add<HLoadNamedField>(global_context, static_cast<HValue*>(NULL), | 522 return Add<HLoadNamedField>(script_context, static_cast<HValue*>(NULL), |
| 523 HObjectAccess::ForContextSlot(slot_index)); | 523 HObjectAccess::ForContextSlot(slot_index)); |
| 524 } | 524 } |
| 525 | 525 |
| 526 | 526 |
| 527 Handle<Code> LoadGlobalContextFieldStub::GenerateCode() { | 527 Handle<Code> LoadScriptContextFieldStub::GenerateCode() { |
| 528 return DoGenerateCode(this); | 528 return DoGenerateCode(this); |
| 529 } | 529 } |
| 530 | 530 |
| 531 | 531 |
| 532 template <> | 532 template <> |
| 533 HValue* CodeStubGraphBuilder<StoreGlobalContextFieldStub>::BuildCodeStub() { | 533 HValue* CodeStubGraphBuilder<StoreScriptContextFieldStub>::BuildCodeStub() { |
| 534 int context_index = casted_stub()->context_index(); | 534 int context_index = casted_stub()->context_index(); |
| 535 int slot_index = casted_stub()->slot_index(); | 535 int slot_index = casted_stub()->slot_index(); |
| 536 | 536 |
| 537 HValue* global_context = BuildGetGlobalContext(context_index); | 537 HValue* script_context = BuildGetScriptContext(context_index); |
| 538 Add<HStoreNamedField>(global_context, | 538 Add<HStoreNamedField>(script_context, |
| 539 HObjectAccess::ForContextSlot(slot_index), | 539 HObjectAccess::ForContextSlot(slot_index), |
| 540 GetParameter(2), STORE_TO_INITIALIZED_ENTRY); | 540 GetParameter(2), STORE_TO_INITIALIZED_ENTRY); |
| 541 return GetParameter(2); | 541 return GetParameter(2); |
| 542 } | 542 } |
| 543 | 543 |
| 544 | 544 |
| 545 Handle<Code> StoreGlobalContextFieldStub::GenerateCode() { | 545 Handle<Code> StoreScriptContextFieldStub::GenerateCode() { |
| 546 return DoGenerateCode(this); | 546 return DoGenerateCode(this); |
| 547 } | 547 } |
| 548 | 548 |
| 549 | 549 |
| 550 template <> | 550 template <> |
| 551 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { | 551 HValue* CodeStubGraphBuilder<LoadFastElementStub>::BuildCodeStub() { |
| 552 HInstruction* load = BuildUncheckedMonomorphicElementAccess( | 552 HInstruction* load = BuildUncheckedMonomorphicElementAccess( |
| 553 GetParameter(LoadDescriptor::kReceiverIndex), | 553 GetParameter(LoadDescriptor::kReceiverIndex), |
| 554 GetParameter(LoadDescriptor::kNameIndex), NULL, | 554 GetParameter(LoadDescriptor::kNameIndex), NULL, |
| 555 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, | 555 casted_stub()->is_js_array(), casted_stub()->elements_kind(), LOAD, |
| (...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 | 2041 |
| 2042 // Probe the stub cache. | 2042 // Probe the stub cache. |
| 2043 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( | 2043 Code::Flags flags = Code::RemoveTypeAndHolderFromFlags( |
| 2044 Code::ComputeHandlerFlags(Code::LOAD_IC)); | 2044 Code::ComputeHandlerFlags(Code::LOAD_IC)); |
| 2045 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); | 2045 Add<HTailCallThroughMegamorphicCache>(receiver, name, flags); |
| 2046 | 2046 |
| 2047 // We never continue. | 2047 // We never continue. |
| 2048 return graph()->GetConstant0(); | 2048 return graph()->GetConstant0(); |
| 2049 } | 2049 } |
| 2050 } } // namespace v8::internal | 2050 } } // namespace v8::internal |
| OLD | NEW |