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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 | 61 |
62 TypeFeedbackOracle::TypeFeedbackOracle(Handle<Code> code, | 62 TypeFeedbackOracle::TypeFeedbackOracle(Handle<Code> code, |
63 Handle<Context> native_context, | 63 Handle<Context> native_context, |
64 Isolate* isolate, | 64 Isolate* isolate, |
65 Zone* zone) | 65 Zone* zone) |
66 : native_context_(native_context), | 66 : native_context_(native_context), |
67 isolate_(isolate), | 67 isolate_(isolate), |
68 zone_(zone) { | 68 zone_(zone) { |
69 BuildDictionary(code); | 69 BuildDictionary(code); |
70 ASSERT(reinterpret_cast<Address>(*dictionary_.location()) != kHandleZapValue); | 70 ASSERT(dictionary_->IsDictionary()); |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 static uint32_t IdToKey(TypeFeedbackId ast_id) { | 74 static uint32_t IdToKey(TypeFeedbackId ast_id) { |
75 return static_cast<uint32_t>(ast_id.ToInt()); | 75 return static_cast<uint32_t>(ast_id.ToInt()); |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) { | 79 Handle<Object> TypeFeedbackOracle::GetInfo(TypeFeedbackId ast_id) { |
80 int entry = dictionary_->FindEntry(IdToKey(ast_id)); | 80 int entry = dictionary_->FindEntry(IdToKey(ast_id)); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 USE(maybe_result); | 773 USE(maybe_result); |
774 #ifdef DEBUG | 774 #ifdef DEBUG |
775 Object* result = NULL; | 775 Object* result = NULL; |
776 // Dictionary has been allocated with sufficient size for all elements. | 776 // Dictionary has been allocated with sufficient size for all elements. |
777 ASSERT(maybe_result->ToObject(&result)); | 777 ASSERT(maybe_result->ToObject(&result)); |
778 ASSERT(*dictionary_ == result); | 778 ASSERT(*dictionary_ == result); |
779 #endif | 779 #endif |
780 } | 780 } |
781 | 781 |
782 } } // namespace v8::internal | 782 } } // namespace v8::internal |
OLD | NEW |