| 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 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3132 // originating from two different native contexts. | 3132 // originating from two different native contexts. |
| 3133 CcTest::global()->Set(v8_str("fun1"), fun1); | 3133 CcTest::global()->Set(v8_str("fun1"), fun1); |
| 3134 CcTest::global()->Set(v8_str("fun2"), fun2); | 3134 CcTest::global()->Set(v8_str("fun2"), fun2); |
| 3135 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);"); | 3135 CompileRun("function f(a, b) { a(); b(); } f(fun1, fun2);"); |
| 3136 | 3136 |
| 3137 Handle<JSFunction> f = | 3137 Handle<JSFunction> f = |
| 3138 v8::Utils::OpenHandle( | 3138 v8::Utils::OpenHandle( |
| 3139 *v8::Handle<v8::Function>::Cast( | 3139 *v8::Handle<v8::Function>::Cast( |
| 3140 CcTest::global()->Get(v8_str("f")))); | 3140 CcTest::global()->Get(v8_str("f")))); |
| 3141 | 3141 |
| 3142 Handle<FixedArray> feedback_vector(f->shared()->feedback_vector()); | 3142 Handle<TypeFeedbackVector> feedback_vector(f->shared()->feedback_vector()); |
| 3143 | 3143 |
| 3144 int expected_length = FLAG_vector_ics ? 4 : 2; | 3144 int expected_length = FLAG_vector_ics ? 4 : 2; |
| 3145 CHECK_EQ(expected_length, feedback_vector->length()); | 3145 CHECK_EQ(expected_length, feedback_vector->length()); |
| 3146 for (int i = 0; i < expected_length; i++) { | 3146 for (int i = 0; i < expected_length; i++) { |
| 3147 if ((i % 2) == 1) { | 3147 if ((i % 2) == 1) { |
| 3148 CHECK(feedback_vector->get(i)->IsJSFunction()); | 3148 CHECK(feedback_vector->get(i)->IsJSFunction()); |
| 3149 } | 3149 } |
| 3150 } | 3150 } |
| 3151 | 3151 |
| 3152 SimulateIncrementalMarking(CcTest::heap()); | 3152 SimulateIncrementalMarking(CcTest::heap()); |
| 3153 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); | 3153 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
| 3154 | 3154 |
| 3155 CHECK_EQ(expected_length, feedback_vector->length()); | 3155 CHECK_EQ(expected_length, feedback_vector->length()); |
| 3156 for (int i = 0; i < expected_length; i++) { | 3156 for (int i = 0; i < expected_length; i++) { |
| 3157 CHECK_EQ(feedback_vector->get(i), | 3157 CHECK_EQ(feedback_vector->get(i), |
| 3158 *TypeFeedbackInfo::UninitializedSentinel(CcTest::i_isolate())); | 3158 *TypeFeedbackVector::UninitializedSentinel(CcTest::i_isolate())); |
| 3159 } | 3159 } |
| 3160 } | 3160 } |
| 3161 | 3161 |
| 3162 | 3162 |
| 3163 static Code* FindFirstIC(Code* code, Code::Kind kind) { | 3163 static Code* FindFirstIC(Code* code, Code::Kind kind) { |
| 3164 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | | 3164 int mask = RelocInfo::ModeMask(RelocInfo::CODE_TARGET) | |
| 3165 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | | 3165 RelocInfo::ModeMask(RelocInfo::CONSTRUCT_CALL) | |
| 3166 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID); | 3166 RelocInfo::ModeMask(RelocInfo::CODE_TARGET_WITH_ID); |
| 3167 for (RelocIterator it(code, mask); !it.done(); it.next()) { | 3167 for (RelocIterator it(code, mask); !it.done(); it.next()) { |
| 3168 RelocInfo* info = it.rinfo(); | 3168 RelocInfo* info = it.rinfo(); |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4479 #ifdef DEBUG | 4479 #ifdef DEBUG |
| 4480 TEST(PathTracer) { | 4480 TEST(PathTracer) { |
| 4481 CcTest::InitializeVM(); | 4481 CcTest::InitializeVM(); |
| 4482 v8::HandleScope scope(CcTest::isolate()); | 4482 v8::HandleScope scope(CcTest::isolate()); |
| 4483 | 4483 |
| 4484 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4484 v8::Local<v8::Value> result = CompileRun("'abc'"); |
| 4485 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4485 Handle<Object> o = v8::Utils::OpenHandle(*result); |
| 4486 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4486 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
| 4487 } | 4487 } |
| 4488 #endif // DEBUG | 4488 #endif // DEBUG |
| OLD | NEW |