| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // operations covered by the BinaryOpIC we should always have them. | 248 // operations covered by the BinaryOpIC we should always have them. |
| 249 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN || | 249 ASSERT(op < BinaryOpIC::State::FIRST_TOKEN || |
| 250 op > BinaryOpIC::State::LAST_TOKEN); | 250 op > BinaryOpIC::State::LAST_TOKEN); |
| 251 *left = *right = *result = Type::None(zone()); | 251 *left = *right = *result = Type::None(zone()); |
| 252 *fixed_right_arg = Maybe<int>(); | 252 *fixed_right_arg = Maybe<int>(); |
| 253 *allocation_site = Handle<AllocationSite>::null(); | 253 *allocation_site = Handle<AllocationSite>::null(); |
| 254 return; | 254 return; |
| 255 } | 255 } |
| 256 Handle<Code> code = Handle<Code>::cast(object); | 256 Handle<Code> code = Handle<Code>::cast(object); |
| 257 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); | 257 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); |
| 258 BinaryOpIC::State state(code->extra_ic_state()); | 258 BinaryOpIC::State state(isolate(), code->extra_ic_state()); |
| 259 ASSERT_EQ(op, state.op()); | 259 ASSERT_EQ(op, state.op()); |
| 260 | 260 |
| 261 *left = state.GetLeftType(zone()); | 261 *left = state.GetLeftType(zone()); |
| 262 *right = state.GetRightType(zone()); | 262 *right = state.GetRightType(zone()); |
| 263 *result = state.GetResultType(zone()); | 263 *result = state.GetResultType(zone()); |
| 264 *fixed_right_arg = state.fixed_right_arg(); | 264 *fixed_right_arg = state.fixed_right_arg(); |
| 265 | 265 |
| 266 AllocationSite* first_allocation_site = code->FindFirstAllocationSite(); | 266 AllocationSite* first_allocation_site = code->FindFirstAllocationSite(); |
| 267 if (first_allocation_site != NULL) { | 267 if (first_allocation_site != NULL) { |
| 268 *allocation_site = handle(first_allocation_site); | 268 *allocation_site = handle(first_allocation_site); |
| 269 } else { | 269 } else { |
| 270 *allocation_site = Handle<AllocationSite>::null(); | 270 *allocation_site = Handle<AllocationSite>::null(); |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 | 274 |
| 275 Type* TypeFeedbackOracle::CountType(TypeFeedbackId id) { | 275 Type* TypeFeedbackOracle::CountType(TypeFeedbackId id) { |
| 276 Handle<Object> object = GetInfo(id); | 276 Handle<Object> object = GetInfo(id); |
| 277 if (!object->IsCode()) return Type::None(zone()); | 277 if (!object->IsCode()) return Type::None(zone()); |
| 278 Handle<Code> code = Handle<Code>::cast(object); | 278 Handle<Code> code = Handle<Code>::cast(object); |
| 279 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); | 279 ASSERT_EQ(Code::BINARY_OP_IC, code->kind()); |
| 280 BinaryOpIC::State state(code->extra_ic_state()); | 280 BinaryOpIC::State state(isolate(), code->extra_ic_state()); |
| 281 return state.GetLeftType(zone()); | 281 return state.GetLeftType(zone()); |
| 282 } | 282 } |
| 283 | 283 |
| 284 | 284 |
| 285 void TypeFeedbackOracle::PropertyReceiverTypes( | 285 void TypeFeedbackOracle::PropertyReceiverTypes( |
| 286 TypeFeedbackId id, Handle<String> name, | 286 TypeFeedbackId id, Handle<String> name, |
| 287 SmallMapList* receiver_types, bool* is_prototype) { | 287 SmallMapList* receiver_types, bool* is_prototype) { |
| 288 receiver_types->Clear(); | 288 receiver_types->Clear(); |
| 289 FunctionPrototypeStub proto_stub(isolate(), Code::LOAD_IC); | 289 FunctionPrototypeStub proto_stub(isolate(), Code::LOAD_IC); |
| 290 *is_prototype = LoadIsStub(id, &proto_stub); | 290 *is_prototype = LoadIsStub(id, &proto_stub); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 UnseededNumberDictionary::kNotFound); | 493 UnseededNumberDictionary::kNotFound); |
| 494 // Dictionary has been allocated with sufficient size for all elements. | 494 // Dictionary has been allocated with sufficient size for all elements. |
| 495 DisallowHeapAllocation no_need_to_resize_dictionary; | 495 DisallowHeapAllocation no_need_to_resize_dictionary; |
| 496 HandleScope scope(isolate()); | 496 HandleScope scope(isolate()); |
| 497 USE(UnseededNumberDictionary::AtNumberPut( | 497 USE(UnseededNumberDictionary::AtNumberPut( |
| 498 dictionary_, IdToKey(ast_id), handle(target, isolate()))); | 498 dictionary_, IdToKey(ast_id), handle(target, isolate()))); |
| 499 } | 499 } |
| 500 | 500 |
| 501 | 501 |
| 502 } } // namespace v8::internal | 502 } } // namespace v8::internal |
| OLD | NEW |