| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } else { | 44 } else { |
| 45 return Handle<Object>(value, isolate()); | 45 return Handle<Object>(value, isolate()); |
| 46 } | 46 } |
| 47 } | 47 } |
| 48 return Handle<Object>::cast(isolate()->factory()->undefined_value()); | 48 return Handle<Object>::cast(isolate()->factory()->undefined_value()); |
| 49 } | 49 } |
| 50 | 50 |
| 51 | 51 |
| 52 Handle<Object> TypeFeedbackOracle::GetInfo(FeedbackVectorSlot slot) { | 52 Handle<Object> TypeFeedbackOracle::GetInfo(FeedbackVectorSlot slot) { |
| 53 DCHECK(slot.ToInt() >= 0 && slot.ToInt() < feedback_vector_->length()); | 53 DCHECK(slot.ToInt() >= 0 && slot.ToInt() < feedback_vector_->length()); |
| 54 Handle<Object> undefined = |
| 55 Handle<Object>::cast(isolate()->factory()->undefined_value()); |
| 54 Object* obj = feedback_vector_->Get(slot); | 56 Object* obj = feedback_vector_->Get(slot); |
| 57 |
| 58 // Slots do not embed direct pointers to functions. Instead a WeakCell is |
| 59 // always used. |
| 60 if (obj->IsWeakCell()) { |
| 61 WeakCell* cell = WeakCell::cast(obj); |
| 62 if (cell->cleared()) return undefined; |
| 63 obj = cell->value(); |
| 64 } |
| 65 |
| 55 if (!obj->IsJSFunction() || | 66 if (!obj->IsJSFunction() || |
| 56 !CanRetainOtherContext(JSFunction::cast(obj), *native_context_)) { | 67 !CanRetainOtherContext(JSFunction::cast(obj), *native_context_)) { |
| 57 DCHECK(!obj->IsMap()); | 68 DCHECK(!obj->IsMap()); |
| 58 return Handle<Object>(obj, isolate()); | 69 return Handle<Object>(obj, isolate()); |
| 59 } | 70 } |
| 60 return Handle<Object>::cast(isolate()->factory()->undefined_value()); | 71 |
| 72 return undefined; |
| 61 } | 73 } |
| 62 | 74 |
| 63 | 75 |
| 64 Handle<Object> TypeFeedbackOracle::GetInfo(FeedbackVectorICSlot slot) { | 76 Handle<Object> TypeFeedbackOracle::GetInfo(FeedbackVectorICSlot slot) { |
| 65 DCHECK(slot.ToInt() >= 0 && slot.ToInt() < feedback_vector_->length()); | 77 DCHECK(slot.ToInt() >= 0 && slot.ToInt() < feedback_vector_->length()); |
| 66 Handle<Object> undefined = | 78 Handle<Object> undefined = |
| 67 Handle<Object>::cast(isolate()->factory()->undefined_value()); | 79 Handle<Object>::cast(isolate()->factory()->undefined_value()); |
| 68 Object* obj = feedback_vector_->Get(slot); | 80 Object* obj = feedback_vector_->Get(slot); |
| 69 | 81 |
| 70 // Vector-based ICs do not embed direct pointers to maps, functions. | 82 // Vector-based ICs do not embed direct pointers to maps, functions. |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 UnseededNumberDictionary::kNotFound); | 581 UnseededNumberDictionary::kNotFound); |
| 570 // Dictionary has been allocated with sufficient size for all elements. | 582 // Dictionary has been allocated with sufficient size for all elements. |
| 571 DisallowHeapAllocation no_need_to_resize_dictionary; | 583 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 572 HandleScope scope(isolate()); | 584 HandleScope scope(isolate()); |
| 573 USE(UnseededNumberDictionary::AtNumberPut( | 585 USE(UnseededNumberDictionary::AtNumberPut( |
| 574 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 586 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 575 } | 587 } |
| 576 | 588 |
| 577 | 589 |
| 578 } } // namespace v8::internal | 590 } } // namespace v8::internal |
| OLD | NEW |