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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/debug.h" | 10 #include "src/debug.h" |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 __ dd(back_edges_[i].id.ToInt()); | 360 __ dd(back_edges_[i].id.ToInt()); |
361 __ dd(back_edges_[i].pc); | 361 __ dd(back_edges_[i].pc); |
362 __ dd(back_edges_[i].loop_depth); | 362 __ dd(back_edges_[i].loop_depth); |
363 } | 363 } |
364 return offset; | 364 return offset; |
365 } | 365 } |
366 | 366 |
367 | 367 |
368 void FullCodeGenerator::EnsureSlotContainsAllocationSite( | 368 void FullCodeGenerator::EnsureSlotContainsAllocationSite( |
369 FeedbackVectorSlot slot) { | 369 FeedbackVectorSlot slot) { |
370 Handle<FixedArray> vector = FeedbackVector(); | 370 Handle<TypeFeedbackVector> vector = FeedbackVector(); |
371 if (!vector->get(slot.ToInt())->IsAllocationSite()) { | 371 if (!vector->Get(slot)->IsAllocationSite()) { |
372 Handle<AllocationSite> allocation_site = | 372 Handle<AllocationSite> allocation_site = |
373 isolate()->factory()->NewAllocationSite(); | 373 isolate()->factory()->NewAllocationSite(); |
374 vector->set(slot.ToInt(), *allocation_site); | 374 vector->Set(slot, *allocation_site); |
375 } | 375 } |
376 } | 376 } |
377 | 377 |
| 378 |
| 379 void FullCodeGenerator::EnsureSlotContainsAllocationSite( |
| 380 FeedbackVectorICSlot slot) { |
| 381 Handle<TypeFeedbackVector> vector = FeedbackVector(); |
| 382 if (!vector->Get(slot)->IsAllocationSite()) { |
| 383 Handle<AllocationSite> allocation_site = |
| 384 isolate()->factory()->NewAllocationSite(); |
| 385 vector->Set(slot, *allocation_site); |
| 386 } |
| 387 } |
| 388 |
378 | 389 |
379 void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) { | 390 void FullCodeGenerator::PopulateDeoptimizationData(Handle<Code> code) { |
380 // Fill in the deoptimization information. | 391 // Fill in the deoptimization information. |
381 DCHECK(info_->HasDeoptimizationSupport() || bailout_entries_.is_empty()); | 392 DCHECK(info_->HasDeoptimizationSupport() || bailout_entries_.is_empty()); |
382 if (!info_->HasDeoptimizationSupport()) return; | 393 if (!info_->HasDeoptimizationSupport()) return; |
383 int length = bailout_entries_.length(); | 394 int length = bailout_entries_.length(); |
384 Handle<DeoptimizationOutputData> data = | 395 Handle<DeoptimizationOutputData> data = |
385 DeoptimizationOutputData::New(isolate(), length, TENURED); | 396 DeoptimizationOutputData::New(isolate(), length, TENURED); |
386 for (int i = 0; i < length; i++) { | 397 for (int i = 0; i < length; i++) { |
387 data->SetAstId(i, bailout_entries_[i].id); | 398 data->SetAstId(i, bailout_entries_[i].id); |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 } | 1744 } |
1734 return true; | 1745 return true; |
1735 } | 1746 } |
1736 #endif // DEBUG | 1747 #endif // DEBUG |
1737 | 1748 |
1738 | 1749 |
1739 #undef __ | 1750 #undef __ |
1740 | 1751 |
1741 | 1752 |
1742 } } // namespace v8::internal | 1753 } } // namespace v8::internal |
OLD | NEW |