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 5352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5363 | 5363 |
5364 Handle<JSFunction> GetFunctionByName(Isolate* isolate, const char* name) { | 5364 Handle<JSFunction> GetFunctionByName(Isolate* isolate, const char* name) { |
5365 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); | 5365 Handle<String> str = isolate->factory()->InternalizeUtf8String(name); |
5366 Handle<Object> obj = | 5366 Handle<Object> obj = |
5367 Object::GetProperty(isolate->global_object(), str).ToHandleChecked(); | 5367 Object::GetProperty(isolate->global_object(), str).ToHandleChecked(); |
5368 return Handle<JSFunction>::cast(obj); | 5368 return Handle<JSFunction>::cast(obj); |
5369 } | 5369 } |
5370 | 5370 |
5371 void CheckIC(Handle<JSFunction> function, Code::Kind kind, int slot_index, | 5371 void CheckIC(Handle<JSFunction> function, Code::Kind kind, int slot_index, |
5372 InlineCacheState state) { | 5372 InlineCacheState state) { |
5373 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC || | 5373 if (kind == Code::LOAD_IC || kind == Code::KEYED_LOAD_IC) { |
5374 kind == Code::CALL_IC) { | |
5375 TypeFeedbackVector* vector = function->feedback_vector(); | 5374 TypeFeedbackVector* vector = function->feedback_vector(); |
5376 FeedbackVectorSlot slot(slot_index); | 5375 FeedbackVectorSlot slot(slot_index); |
5377 if (kind == Code::LOAD_IC) { | 5376 if (kind == Code::LOAD_IC) { |
5378 LoadICNexus nexus(vector, slot); | 5377 LoadICNexus nexus(vector, slot); |
5379 CHECK_EQ(nexus.StateFromFeedback(), state); | 5378 CHECK_EQ(nexus.StateFromFeedback(), state); |
5380 } else if (kind == Code::KEYED_LOAD_IC) { | 5379 } else if (kind == Code::KEYED_LOAD_IC) { |
5381 KeyedLoadICNexus nexus(vector, slot); | 5380 KeyedLoadICNexus nexus(vector, slot); |
5382 CHECK_EQ(nexus.StateFromFeedback(), state); | 5381 CHECK_EQ(nexus.StateFromFeedback(), state); |
5383 } else if (kind == Code::CALL_IC) { | |
5384 CallICNexus nexus(vector, slot); | |
5385 CHECK_EQ(nexus.StateFromFeedback(), state); | |
5386 } | 5382 } |
5387 } else { | 5383 } else { |
5388 Code* ic = FindFirstIC(function->code(), kind); | 5384 Code* ic = FindFirstIC(function->code(), kind); |
5389 CHECK(ic->is_inline_cache_stub()); | 5385 CHECK(ic->is_inline_cache_stub()); |
5390 CHECK(!IC::ICUseVector(kind)); | 5386 CHECK(!IC::ICUseVector(kind)); |
5391 CHECK_EQ(state, IC::StateFromCode(ic)); | 5387 CHECK_EQ(state, IC::StateFromCode(ic)); |
5392 } | 5388 } |
5393 } | 5389 } |
5394 | 5390 |
5395 | 5391 |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7125 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); | 7121 CHECK(!heap->code_space()->FirstPage()->Contains(code->address())); |
7126 | 7122 |
7127 // Ensure it's not in large object space. | 7123 // Ensure it's not in large object space. |
7128 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); | 7124 MemoryChunk* chunk = MemoryChunk::FromAddress(code->address()); |
7129 CHECK(chunk->owner()->identity() != LO_SPACE); | 7125 CHECK(chunk->owner()->identity() != LO_SPACE); |
7130 CHECK(chunk->NeverEvacuate()); | 7126 CHECK(chunk->NeverEvacuate()); |
7131 } | 7127 } |
7132 | 7128 |
7133 } // namespace internal | 7129 } // namespace internal |
7134 } // namespace v8 | 7130 } // namespace v8 |
OLD | NEW |