Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: src/stub-cache.cc

Issue 6723014: Avoid TLS access for counters. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix lint Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/spaces.cc ('k') | src/v8-counters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 if (kind == Code::CALL_IC) { 1493 if (kind == Code::CALL_IC) {
1494 CallIC::GenerateInitialize(masm(), argc); 1494 CallIC::GenerateInitialize(masm(), argc);
1495 } else { 1495 } else {
1496 KeyedCallIC::GenerateInitialize(masm(), argc); 1496 KeyedCallIC::GenerateInitialize(masm(), argc);
1497 } 1497 }
1498 Object* result; 1498 Object* result;
1499 { MaybeObject* maybe_result = 1499 { MaybeObject* maybe_result =
1500 GetCodeWithFlags(flags, "CompileCallInitialize"); 1500 GetCodeWithFlags(flags, "CompileCallInitialize");
1501 if (!maybe_result->ToObject(&result)) return maybe_result; 1501 if (!maybe_result->ToObject(&result)) return maybe_result;
1502 } 1502 }
1503 COUNTERS->call_initialize_stubs()->Increment(); 1503 isolate()->counters()->call_initialize_stubs()->Increment();
1504 Code* code = Code::cast(result); 1504 Code* code = Code::cast(result);
1505 USE(code); 1505 USE(code);
1506 PROFILE(isolate(), 1506 PROFILE(isolate(),
1507 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG), 1507 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_INITIALIZE_TAG),
1508 code, code->arguments_count())); 1508 code, code->arguments_count()));
1509 GDBJIT(AddCode(GDBJITInterface::CALL_INITIALIZE, Code::cast(code))); 1509 GDBJIT(AddCode(GDBJITInterface::CALL_INITIALIZE, Code::cast(code)));
1510 return result; 1510 return result;
1511 } 1511 }
1512 1512
1513 1513
1514 MaybeObject* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) { 1514 MaybeObject* StubCompiler::CompileCallPreMonomorphic(Code::Flags flags) {
1515 HandleScope scope(isolate()); 1515 HandleScope scope(isolate());
1516 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1516 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1517 // The code of the PreMonomorphic stub is the same as the code 1517 // The code of the PreMonomorphic stub is the same as the code
1518 // of the Initialized stub. They just differ on the code object flags. 1518 // of the Initialized stub. They just differ on the code object flags.
1519 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1519 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1520 if (kind == Code::CALL_IC) { 1520 if (kind == Code::CALL_IC) {
1521 CallIC::GenerateInitialize(masm(), argc); 1521 CallIC::GenerateInitialize(masm(), argc);
1522 } else { 1522 } else {
1523 KeyedCallIC::GenerateInitialize(masm(), argc); 1523 KeyedCallIC::GenerateInitialize(masm(), argc);
1524 } 1524 }
1525 Object* result; 1525 Object* result;
1526 { MaybeObject* maybe_result = 1526 { MaybeObject* maybe_result =
1527 GetCodeWithFlags(flags, "CompileCallPreMonomorphic"); 1527 GetCodeWithFlags(flags, "CompileCallPreMonomorphic");
1528 if (!maybe_result->ToObject(&result)) return maybe_result; 1528 if (!maybe_result->ToObject(&result)) return maybe_result;
1529 } 1529 }
1530 COUNTERS->call_premonomorphic_stubs()->Increment(); 1530 isolate()->counters()->call_premonomorphic_stubs()->Increment();
1531 Code* code = Code::cast(result); 1531 Code* code = Code::cast(result);
1532 USE(code); 1532 USE(code);
1533 PROFILE(isolate(), 1533 PROFILE(isolate(),
1534 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG), 1534 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_PRE_MONOMORPHIC_TAG),
1535 code, code->arguments_count())); 1535 code, code->arguments_count()));
1536 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, Code::cast(code))); 1536 GDBJIT(AddCode(GDBJITInterface::CALL_PRE_MONOMORPHIC, Code::cast(code)));
1537 return result; 1537 return result;
1538 } 1538 }
1539 1539
1540 1540
1541 MaybeObject* StubCompiler::CompileCallNormal(Code::Flags flags) { 1541 MaybeObject* StubCompiler::CompileCallNormal(Code::Flags flags) {
1542 HandleScope scope(isolate()); 1542 HandleScope scope(isolate());
1543 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1543 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1544 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1544 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1545 if (kind == Code::CALL_IC) { 1545 if (kind == Code::CALL_IC) {
1546 CallIC::GenerateNormal(masm(), argc); 1546 CallIC::GenerateNormal(masm(), argc);
1547 } else { 1547 } else {
1548 KeyedCallIC::GenerateNormal(masm(), argc); 1548 KeyedCallIC::GenerateNormal(masm(), argc);
1549 } 1549 }
1550 Object* result; 1550 Object* result;
1551 { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallNormal"); 1551 { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallNormal");
1552 if (!maybe_result->ToObject(&result)) return maybe_result; 1552 if (!maybe_result->ToObject(&result)) return maybe_result;
1553 } 1553 }
1554 COUNTERS->call_normal_stubs()->Increment(); 1554 isolate()->counters()->call_normal_stubs()->Increment();
1555 Code* code = Code::cast(result); 1555 Code* code = Code::cast(result);
1556 USE(code); 1556 USE(code);
1557 PROFILE(isolate(), 1557 PROFILE(isolate(),
1558 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG), 1558 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_NORMAL_TAG),
1559 code, code->arguments_count())); 1559 code, code->arguments_count()));
1560 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, Code::cast(code))); 1560 GDBJIT(AddCode(GDBJITInterface::CALL_NORMAL, Code::cast(code)));
1561 return result; 1561 return result;
1562 } 1562 }
1563 1563
1564 1564
1565 MaybeObject* StubCompiler::CompileCallMegamorphic(Code::Flags flags) { 1565 MaybeObject* StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
1566 HandleScope scope(isolate()); 1566 HandleScope scope(isolate());
1567 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1567 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1568 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1568 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1569 if (kind == Code::CALL_IC) { 1569 if (kind == Code::CALL_IC) {
1570 CallIC::GenerateMegamorphic(masm(), argc); 1570 CallIC::GenerateMegamorphic(masm(), argc);
1571 } else { 1571 } else {
1572 KeyedCallIC::GenerateMegamorphic(masm(), argc); 1572 KeyedCallIC::GenerateMegamorphic(masm(), argc);
1573 } 1573 }
1574 Object* result; 1574 Object* result;
1575 { MaybeObject* maybe_result = 1575 { MaybeObject* maybe_result =
1576 GetCodeWithFlags(flags, "CompileCallMegamorphic"); 1576 GetCodeWithFlags(flags, "CompileCallMegamorphic");
1577 if (!maybe_result->ToObject(&result)) return maybe_result; 1577 if (!maybe_result->ToObject(&result)) return maybe_result;
1578 } 1578 }
1579 COUNTERS->call_megamorphic_stubs()->Increment(); 1579 isolate()->counters()->call_megamorphic_stubs()->Increment();
1580 Code* code = Code::cast(result); 1580 Code* code = Code::cast(result);
1581 USE(code); 1581 USE(code);
1582 PROFILE(isolate(), 1582 PROFILE(isolate(),
1583 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG), 1583 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
1584 code, code->arguments_count())); 1584 code, code->arguments_count()));
1585 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code))); 1585 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
1586 return result; 1586 return result;
1587 } 1587 }
1588 1588
1589 1589
1590 MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) { 1590 MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) {
1591 HandleScope scope(isolate()); 1591 HandleScope scope(isolate());
1592 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1592 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1593 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1593 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1594 if (kind == Code::CALL_IC) { 1594 if (kind == Code::CALL_IC) {
1595 CallIC::GenerateMiss(masm(), argc); 1595 CallIC::GenerateMiss(masm(), argc);
1596 } else { 1596 } else {
1597 KeyedCallIC::GenerateMiss(masm(), argc); 1597 KeyedCallIC::GenerateMiss(masm(), argc);
1598 } 1598 }
1599 Object* result; 1599 Object* result;
1600 { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallMiss"); 1600 { MaybeObject* maybe_result = GetCodeWithFlags(flags, "CompileCallMiss");
1601 if (!maybe_result->ToObject(&result)) return maybe_result; 1601 if (!maybe_result->ToObject(&result)) return maybe_result;
1602 } 1602 }
1603 COUNTERS->call_megamorphic_stubs()->Increment(); 1603 isolate()->counters()->call_megamorphic_stubs()->Increment();
1604 Code* code = Code::cast(result); 1604 Code* code = Code::cast(result);
1605 USE(code); 1605 USE(code);
1606 PROFILE(isolate(), 1606 PROFILE(isolate(),
1607 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG), 1607 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MISS_TAG),
1608 code, code->arguments_count())); 1608 code, code->arguments_count()));
1609 GDBJIT(AddCode(GDBJITInterface::CALL_MISS, Code::cast(code))); 1609 GDBJIT(AddCode(GDBJITInterface::CALL_MISS, Code::cast(code)));
1610 return result; 1610 return result;
1611 } 1611 }
1612 1612
1613 1613
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 } 1937 }
1938 Code* code = Code::cast(result); 1938 Code* code = Code::cast(result);
1939 USE(code); 1939 USE(code);
1940 PROFILE(isolate(), 1940 PROFILE(isolate(),
1941 CodeCreateEvent(Logger::STUB_TAG, code, "ExternalArrayStub")); 1941 CodeCreateEvent(Logger::STUB_TAG, code, "ExternalArrayStub"));
1942 return result; 1942 return result;
1943 } 1943 }
1944 1944
1945 1945
1946 } } // namespace v8::internal 1946 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.cc ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698