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/ast.h" | 7 #include "src/ast.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
10 #include "src/ic/ic.h" | 10 #include "src/ic/ic.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 types->Reserve(maps.length(), zone()); | 423 types->Reserve(maps.length(), zone()); |
424 for (int i = 0; i < maps.length(); i++) { | 424 for (int i = 0; i < maps.length(); i++) { |
425 Handle<Map> map(maps.at(i)); | 425 Handle<Map> map(maps.at(i)); |
426 if (IsRelevantFeedback(*map, *native_context_)) { | 426 if (IsRelevantFeedback(*map, *native_context_)) { |
427 types->AddMapIfMissing(maps.at(i), zone()); | 427 types->AddMapIfMissing(maps.at(i), zone()); |
428 } | 428 } |
429 } | 429 } |
430 } | 430 } |
431 | 431 |
432 | 432 |
433 byte TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) { | 433 uint16_t TypeFeedbackOracle::ToBooleanTypes(TypeFeedbackId id) { |
434 Handle<Object> object = GetInfo(id); | 434 Handle<Object> object = GetInfo(id); |
435 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0; | 435 return object->IsCode() ? Handle<Code>::cast(object)->to_boolean_state() : 0; |
436 } | 436 } |
437 | 437 |
438 | 438 |
439 // Things are a bit tricky here: The iterator for the RelocInfos and the infos | 439 // Things are a bit tricky here: The iterator for the RelocInfos and the infos |
440 // themselves are not GC-safe, so we first get all infos, then we create the | 440 // themselves are not GC-safe, so we first get all infos, then we create the |
441 // dictionary (possibly triggering GC), and finally we relocate the collected | 441 // dictionary (possibly triggering GC), and finally we relocate the collected |
442 // infos before we process them. | 442 // infos before we process them. |
443 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) { | 443 void TypeFeedbackOracle::BuildDictionary(Handle<Code> code) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 // Dictionary has been allocated with sufficient size for all elements. | 514 // Dictionary has been allocated with sufficient size for all elements. |
515 DisallowHeapAllocation no_need_to_resize_dictionary; | 515 DisallowHeapAllocation no_need_to_resize_dictionary; |
516 HandleScope scope(isolate()); | 516 HandleScope scope(isolate()); |
517 USE(UnseededNumberDictionary::AtNumberPut( | 517 USE(UnseededNumberDictionary::AtNumberPut( |
518 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 518 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
519 } | 519 } |
520 | 520 |
521 | 521 |
522 } // namespace internal | 522 } // namespace internal |
523 } // namespace v8 | 523 } // namespace v8 |
OLD | NEW |