| 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/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/cpu-profiler.h" | 9 #include "src/cpu-profiler.h" |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 os << "_CheckLeft"; | 261 os << "_CheckLeft"; |
| 262 } else if ((flags() & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) { | 262 } else if ((flags() & STRING_ADD_CHECK_RIGHT) == STRING_ADD_CHECK_RIGHT) { |
| 263 os << "_CheckRight"; | 263 os << "_CheckRight"; |
| 264 } | 264 } |
| 265 if (pretenure_flag() == TENURED) { | 265 if (pretenure_flag() == TENURED) { |
| 266 os << "_Tenured"; | 266 os << "_Tenured"; |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 InlineCacheState ICCompareStub::GetICState() const { | 271 InlineCacheState CompareICStub::GetICState() const { |
| 272 CompareIC::State state = Max(left(), right()); | 272 CompareIC::State state = Max(left(), right()); |
| 273 switch (state) { | 273 switch (state) { |
| 274 case CompareIC::UNINITIALIZED: | 274 case CompareIC::UNINITIALIZED: |
| 275 return ::v8::internal::UNINITIALIZED; | 275 return ::v8::internal::UNINITIALIZED; |
| 276 case CompareIC::SMI: | 276 case CompareIC::SMI: |
| 277 case CompareIC::NUMBER: | 277 case CompareIC::NUMBER: |
| 278 case CompareIC::INTERNALIZED_STRING: | 278 case CompareIC::INTERNALIZED_STRING: |
| 279 case CompareIC::STRING: | 279 case CompareIC::STRING: |
| 280 case CompareIC::UNIQUE_NAME: | 280 case CompareIC::UNIQUE_NAME: |
| 281 case CompareIC::OBJECT: | 281 case CompareIC::OBJECT: |
| 282 case CompareIC::KNOWN_OBJECT: | 282 case CompareIC::KNOWN_OBJECT: |
| 283 return MONOMORPHIC; | 283 return MONOMORPHIC; |
| 284 case CompareIC::GENERIC: | 284 case CompareIC::GENERIC: |
| 285 return ::v8::internal::GENERIC; | 285 return ::v8::internal::GENERIC; |
| 286 } | 286 } |
| 287 UNREACHABLE(); | 287 UNREACHABLE(); |
| 288 return ::v8::internal::UNINITIALIZED; | 288 return ::v8::internal::UNINITIALIZED; |
| 289 } | 289 } |
| 290 | 290 |
| 291 | 291 |
| 292 void ICCompareStub::AddToSpecialCache(Handle<Code> new_object) { | 292 void CompareICStub::AddToSpecialCache(Handle<Code> new_object) { |
| 293 DCHECK(*known_map_ != NULL); | 293 DCHECK(*known_map_ != NULL); |
| 294 Isolate* isolate = new_object->GetIsolate(); | 294 Isolate* isolate = new_object->GetIsolate(); |
| 295 Factory* factory = isolate->factory(); | 295 Factory* factory = isolate->factory(); |
| 296 return Map::UpdateCodeCache(known_map_, | 296 return Map::UpdateCodeCache(known_map_, |
| 297 strict() ? | 297 strict() ? |
| 298 factory->strict_compare_ic_string() : | 298 factory->strict_compare_ic_string() : |
| 299 factory->compare_ic_string(), | 299 factory->compare_ic_string(), |
| 300 new_object); | 300 new_object); |
| 301 } | 301 } |
| 302 | 302 |
| 303 | 303 |
| 304 bool ICCompareStub::FindCodeInSpecialCache(Code** code_out) { | 304 bool CompareICStub::FindCodeInSpecialCache(Code** code_out) { |
| 305 Factory* factory = isolate()->factory(); | 305 Factory* factory = isolate()->factory(); |
| 306 Code::Flags flags = Code::ComputeFlags( | 306 Code::Flags flags = Code::ComputeFlags( |
| 307 GetCodeKind(), | 307 GetCodeKind(), |
| 308 UNINITIALIZED); | 308 UNINITIALIZED); |
| 309 DCHECK(op() == Token::EQ || op() == Token::EQ_STRICT); | 309 DCHECK(op() == Token::EQ || op() == Token::EQ_STRICT); |
| 310 Handle<Object> probe( | 310 Handle<Object> probe( |
| 311 known_map_->FindInCodeCache( | 311 known_map_->FindInCodeCache( |
| 312 strict() ? | 312 strict() ? |
| 313 *factory->strict_compare_ic_string() : | 313 *factory->strict_compare_ic_string() : |
| 314 *factory->compare_ic_string(), | 314 *factory->compare_ic_string(), |
| 315 flags), | 315 flags), |
| 316 isolate()); | 316 isolate()); |
| 317 if (probe->IsCode()) { | 317 if (probe->IsCode()) { |
| 318 *code_out = Code::cast(*probe); | 318 *code_out = Code::cast(*probe); |
| 319 #ifdef DEBUG | 319 #ifdef DEBUG |
| 320 ICCompareStub decode((*code_out)->stub_key()); | 320 CompareICStub decode((*code_out)->stub_key()); |
| 321 DCHECK(op() == decode.op()); | 321 DCHECK(op() == decode.op()); |
| 322 DCHECK(left() == decode.left()); | 322 DCHECK(left() == decode.left()); |
| 323 DCHECK(right() == decode.right()); | 323 DCHECK(right() == decode.right()); |
| 324 DCHECK(state() == decode.state()); | 324 DCHECK(state() == decode.state()); |
| 325 #endif | 325 #endif |
| 326 return true; | 326 return true; |
| 327 } | 327 } |
| 328 return false; | 328 return false; |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 |
| 332 void ICCompareStub::Generate(MacroAssembler* masm) { | 332 void CompareICStub::Generate(MacroAssembler* masm) { |
| 333 switch (state()) { | 333 switch (state()) { |
| 334 case CompareIC::UNINITIALIZED: | 334 case CompareIC::UNINITIALIZED: |
| 335 GenerateMiss(masm); | 335 GenerateMiss(masm); |
| 336 break; | 336 break; |
| 337 case CompareIC::SMI: | 337 case CompareIC::SMI: |
| 338 GenerateSmis(masm); | 338 GenerateSmis(masm); |
| 339 break; | 339 break; |
| 340 case CompareIC::NUMBER: | 340 case CompareIC::NUMBER: |
| 341 GenerateNumbers(masm); | 341 GenerateNumbers(masm); |
| 342 break; | 342 break; |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 | 712 |
| 713 | 713 |
| 714 void StringAddStub::InitializeInterfaceDescriptor( | 714 void StringAddStub::InitializeInterfaceDescriptor( |
| 715 CodeStubInterfaceDescriptor* descriptor) { | 715 CodeStubInterfaceDescriptor* descriptor) { |
| 716 StringAddDescriptor call_descriptor(isolate()); | 716 StringAddDescriptor call_descriptor(isolate()); |
| 717 descriptor->Initialize(MajorKey(), call_descriptor, | 717 descriptor->Initialize(MajorKey(), call_descriptor, |
| 718 Runtime::FunctionForId(Runtime::kStringAdd)->entry); | 718 Runtime::FunctionForId(Runtime::kStringAdd)->entry); |
| 719 } | 719 } |
| 720 | 720 |
| 721 | 721 |
| 722 void LoadDictionaryElementPlatformStub::Generate(MacroAssembler* masm) { | |
| 723 ElementHandlerCompiler::GenerateLoadDictionaryElement(masm); | |
| 724 } | |
| 725 | |
| 726 | |
| 727 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { | 722 void CreateAllocationSiteStub::GenerateAheadOfTime(Isolate* isolate) { |
| 728 CreateAllocationSiteStub stub(isolate); | 723 CreateAllocationSiteStub stub(isolate); |
| 729 stub.GetCode(); | 724 stub.GetCode(); |
| 730 } | 725 } |
| 731 | 726 |
| 732 | 727 |
| 733 void StoreElementStub::Generate(MacroAssembler* masm) { | 728 void StoreElementStub::Generate(MacroAssembler* masm) { |
| 734 switch (elements_kind()) { | 729 switch (elements_kind()) { |
| 735 case FAST_ELEMENTS: | 730 case FAST_ELEMENTS: |
| 736 case FAST_HOLEY_ELEMENTS: | 731 case FAST_HOLEY_ELEMENTS: |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 InstallDescriptor(isolate, &stub3); | 1056 InstallDescriptor(isolate, &stub3); |
| 1062 } | 1057 } |
| 1063 | 1058 |
| 1064 InternalArrayConstructorStub::InternalArrayConstructorStub( | 1059 InternalArrayConstructorStub::InternalArrayConstructorStub( |
| 1065 Isolate* isolate) : PlatformCodeStub(isolate) { | 1060 Isolate* isolate) : PlatformCodeStub(isolate) { |
| 1066 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); | 1061 InternalArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
| 1067 } | 1062 } |
| 1068 | 1063 |
| 1069 | 1064 |
| 1070 } } // namespace v8::internal | 1065 } } // namespace v8::internal |
| OLD | NEW |