| 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/type-info.h" | 5 #include "src/type-info.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 *left = *right = *result = Type::None(zone()); | 238 *left = *right = *result = Type::None(zone()); |
| 239 *fixed_right_arg = Nothing<int>(); | 239 *fixed_right_arg = Nothing<int>(); |
| 240 *allocation_site = Handle<AllocationSite>::null(); | 240 *allocation_site = Handle<AllocationSite>::null(); |
| 241 return; | 241 return; |
| 242 } | 242 } |
| 243 Handle<Code> code = Handle<Code>::cast(object); | 243 Handle<Code> code = Handle<Code>::cast(object); |
| 244 DCHECK_EQ(Code::BINARY_OP_IC, code->kind()); | 244 DCHECK_EQ(Code::BINARY_OP_IC, code->kind()); |
| 245 BinaryOpICState state(isolate(), code->extra_ic_state()); | 245 BinaryOpICState state(isolate(), code->extra_ic_state()); |
| 246 DCHECK_EQ(op, state.op()); | 246 DCHECK_EQ(op, state.op()); |
| 247 | 247 |
| 248 *left = state.GetLeftType(zone()); | 248 *left = state.GetLeftType(); |
| 249 *right = state.GetRightType(zone()); | 249 *right = state.GetRightType(); |
| 250 *result = state.GetResultType(zone()); | 250 *result = state.GetResultType(); |
| 251 *fixed_right_arg = state.fixed_right_arg(); | 251 *fixed_right_arg = state.fixed_right_arg(); |
| 252 | 252 |
| 253 AllocationSite* first_allocation_site = code->FindFirstAllocationSite(); | 253 AllocationSite* first_allocation_site = code->FindFirstAllocationSite(); |
| 254 if (first_allocation_site != NULL) { | 254 if (first_allocation_site != NULL) { |
| 255 *allocation_site = handle(first_allocation_site); | 255 *allocation_site = handle(first_allocation_site); |
| 256 } else { | 256 } else { |
| 257 *allocation_site = Handle<AllocationSite>::null(); | 257 *allocation_site = Handle<AllocationSite>::null(); |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 | 261 |
| 262 Type* TypeFeedbackOracle::CountType(TypeFeedbackId id) { | 262 Type* TypeFeedbackOracle::CountType(TypeFeedbackId id) { |
| 263 Handle<Object> object = GetInfo(id); | 263 Handle<Object> object = GetInfo(id); |
| 264 if (!object->IsCode()) return Type::None(zone()); | 264 if (!object->IsCode()) return Type::None(zone()); |
| 265 Handle<Code> code = Handle<Code>::cast(object); | 265 Handle<Code> code = Handle<Code>::cast(object); |
| 266 DCHECK_EQ(Code::BINARY_OP_IC, code->kind()); | 266 DCHECK_EQ(Code::BINARY_OP_IC, code->kind()); |
| 267 BinaryOpICState state(isolate(), code->extra_ic_state()); | 267 BinaryOpICState state(isolate(), code->extra_ic_state()); |
| 268 return state.GetLeftType(zone()); | 268 return state.GetLeftType(); |
| 269 } | 269 } |
| 270 | 270 |
| 271 | 271 |
| 272 bool TypeFeedbackOracle::HasOnlyStringMaps(SmallMapList* receiver_types) { | 272 bool TypeFeedbackOracle::HasOnlyStringMaps(SmallMapList* receiver_types) { |
| 273 bool all_strings = receiver_types->length() > 0; | 273 bool all_strings = receiver_types->length() > 0; |
| 274 for (int i = 0; i < receiver_types->length(); i++) { | 274 for (int i = 0; i < receiver_types->length(); i++) { |
| 275 all_strings &= receiver_types->at(i)->IsStringMap(); | 275 all_strings &= receiver_types->at(i)->IsStringMap(); |
| 276 } | 276 } |
| 277 return all_strings; | 277 return all_strings; |
| 278 } | 278 } |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 // Dictionary has been allocated with sufficient size for all elements. | 474 // Dictionary has been allocated with sufficient size for all elements. |
| 475 DisallowHeapAllocation no_need_to_resize_dictionary; | 475 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 476 HandleScope scope(isolate()); | 476 HandleScope scope(isolate()); |
| 477 USE(UnseededNumberDictionary::AtNumberPut( | 477 USE(UnseededNumberDictionary::AtNumberPut( |
| 478 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 478 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 479 } | 479 } |
| 480 | 480 |
| 481 | 481 |
| 482 } // namespace internal | 482 } // namespace internal |
| 483 } // namespace v8 | 483 } // namespace v8 |
| OLD | NEW |