OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 Handle<Code> ConstructStubCompiler::GetCode() { | 1445 Handle<Code> ConstructStubCompiler::GetCode() { |
1446 Code::Flags flags = Code::ComputeFlags(Code::STUB); | 1446 Code::Flags flags = Code::ComputeFlags(Code::STUB); |
1447 Handle<Code> code = GetCodeWithFlags(flags, "ConstructStub"); | 1447 Handle<Code> code = GetCodeWithFlags(flags, "ConstructStub"); |
1448 PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, "ConstructStub")); | 1448 PROFILE(isolate(), CodeCreateEvent(Logger::STUB_TAG, *code, "ConstructStub")); |
1449 GDBJIT(AddCode(GDBJITInterface::STUB, "ConstructStub", *code)); | 1449 GDBJIT(AddCode(GDBJITInterface::STUB, "ConstructStub", *code)); |
1450 return code; | 1450 return code; |
1451 } | 1451 } |
1452 | 1452 |
1453 | 1453 |
1454 CallOptimization::CallOptimization(LookupResult* lookup) { | 1454 CallOptimization::CallOptimization(LookupResult* lookup) { |
1455 if (!lookup->IsProperty() || | 1455 if (lookup->IsFound() && |
1456 !lookup->IsCacheable() || | 1456 lookup->IsCacheable() && |
1457 lookup->type() != CONSTANT_FUNCTION) { | 1457 lookup->type() == CONSTANT_FUNCTION) { |
1458 Initialize(Handle<JSFunction>::null()); | |
1459 } else { | |
1460 // We only optimize constant function calls. | 1458 // We only optimize constant function calls. |
1461 Initialize(Handle<JSFunction>(lookup->GetConstantFunction())); | 1459 Initialize(Handle<JSFunction>(lookup->GetConstantFunction())); |
| 1460 } else { |
| 1461 Initialize(Handle<JSFunction>::null()); |
1462 } | 1462 } |
1463 } | 1463 } |
1464 | 1464 |
1465 CallOptimization::CallOptimization(Handle<JSFunction> function) { | 1465 CallOptimization::CallOptimization(Handle<JSFunction> function) { |
1466 Initialize(function); | 1466 Initialize(function); |
1467 } | 1467 } |
1468 | 1468 |
1469 | 1469 |
1470 int CallOptimization::GetPrototypeDepthOfExpectedType( | 1470 int CallOptimization::GetPrototypeDepthOfExpectedType( |
1471 Handle<JSObject> object, | 1471 Handle<JSObject> object, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 Handle<FunctionTemplateInfo>( | 1516 Handle<FunctionTemplateInfo>( |
1517 FunctionTemplateInfo::cast(signature->receiver())); | 1517 FunctionTemplateInfo::cast(signature->receiver())); |
1518 } | 1518 } |
1519 } | 1519 } |
1520 | 1520 |
1521 is_simple_api_call_ = true; | 1521 is_simple_api_call_ = true; |
1522 } | 1522 } |
1523 | 1523 |
1524 | 1524 |
1525 } } // namespace v8::internal | 1525 } } // namespace v8::internal |
OLD | NEW |