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

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

Issue 7187007: Merge arguments branch to bleeding edge (second try). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Undelete external-array test. Created 9 years, 6 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/stub-cache.h ('k') | src/variables.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 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 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 Object* probe; 1033 Object* probe;
1034 { MaybeObject* maybe_probe = ProbeCache(isolate_, flags); 1034 { MaybeObject* maybe_probe = ProbeCache(isolate_, flags);
1035 if (!maybe_probe->ToObject(&probe)) return maybe_probe; 1035 if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1036 } 1036 }
1037 if (!probe->IsUndefined()) return probe; 1037 if (!probe->IsUndefined()) return probe;
1038 StubCompiler compiler; 1038 StubCompiler compiler;
1039 return FillCache(isolate_, compiler.CompileCallNormal(flags)); 1039 return FillCache(isolate_, compiler.CompileCallNormal(flags));
1040 } 1040 }
1041 1041
1042 1042
1043 MaybeObject* StubCache::ComputeCallArguments(int argc,
1044 InLoopFlag in_loop,
1045 Code::Kind kind) {
1046 ASSERT(kind == Code::KEYED_CALL_IC);
1047 Code::Flags flags = Code::ComputeFlags(kind,
1048 in_loop,
1049 MEGAMORPHIC,
1050 Code::kNoExtraICState,
1051 NORMAL,
1052 argc);
1053 Object* probe;
1054 { MaybeObject* maybe_probe = ProbeCache(isolate_, flags);
1055 if (!maybe_probe->ToObject(&probe)) return maybe_probe;
1056 }
1057 if (!probe->IsUndefined()) return probe;
1058 StubCompiler compiler;
1059 return FillCache(isolate_, compiler.CompileCallArguments(flags));
1060 }
1061
1062
1043 MaybeObject* StubCache::ComputeCallMegamorphic( 1063 MaybeObject* StubCache::ComputeCallMegamorphic(
1044 int argc, 1064 int argc,
1045 InLoopFlag in_loop, 1065 InLoopFlag in_loop,
1046 Code::Kind kind, 1066 Code::Kind kind,
1047 Code::ExtraICState extra_ic_state) { 1067 Code::ExtraICState extra_ic_state) {
1048 Code::Flags flags = Code::ComputeFlags(kind, 1068 Code::Flags flags = Code::ComputeFlags(kind,
1049 in_loop, 1069 in_loop,
1050 MEGAMORPHIC, 1070 MEGAMORPHIC,
1051 extra_ic_state, 1071 extra_ic_state,
1052 NORMAL, 1072 NORMAL,
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 Code* code = Code::cast(result); 1508 Code* code = Code::cast(result);
1489 USE(code); 1509 USE(code);
1490 PROFILE(isolate(), 1510 PROFILE(isolate(),
1491 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG), 1511 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
1492 code, code->arguments_count())); 1512 code, code->arguments_count()));
1493 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code))); 1513 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
1494 return result; 1514 return result;
1495 } 1515 }
1496 1516
1497 1517
1518 MaybeObject* StubCompiler::CompileCallArguments(Code::Flags flags) {
1519 HandleScope scope(isolate());
1520 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1521 KeyedCallIC::GenerateNonStrictArguments(masm(), argc);
1522 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1523 Object* result;
1524 { MaybeObject* maybe_result =
1525 GetCodeWithFlags(flags, "CompileCallArguments");
1526 if (!maybe_result->ToObject(&result)) return maybe_result;
1527 }
1528 Code* code = Code::cast(result);
1529 USE(code);
1530 PROFILE(isolate(),
1531 CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
1532 code, code->arguments_count()));
1533 GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
1534 return result;
1535 }
1536
1537
1498 MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) { 1538 MaybeObject* StubCompiler::CompileCallMiss(Code::Flags flags) {
1499 HandleScope scope(isolate()); 1539 HandleScope scope(isolate());
1500 int argc = Code::ExtractArgumentsCountFromFlags(flags); 1540 int argc = Code::ExtractArgumentsCountFromFlags(flags);
1501 Code::Kind kind = Code::ExtractKindFromFlags(flags); 1541 Code::Kind kind = Code::ExtractKindFromFlags(flags);
1502 Code::ExtraICState extra_ic_state = Code::ExtractExtraICStateFromFlags(flags); 1542 Code::ExtraICState extra_ic_state = Code::ExtractExtraICStateFromFlags(flags);
1503 if (kind == Code::CALL_IC) { 1543 if (kind == Code::CALL_IC) {
1504 CallIC::GenerateMiss(masm(), argc, extra_ic_state); 1544 CallIC::GenerateMiss(masm(), argc, extra_ic_state);
1505 } else { 1545 } else {
1506 KeyedCallIC::GenerateMiss(masm(), argc); 1546 KeyedCallIC::GenerateMiss(masm(), argc);
1507 } 1547 }
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1870 expected_receiver_type_ = 1910 expected_receiver_type_ =
1871 FunctionTemplateInfo::cast(signature->receiver()); 1911 FunctionTemplateInfo::cast(signature->receiver());
1872 } 1912 }
1873 } 1913 }
1874 1914
1875 is_simple_api_call_ = true; 1915 is_simple_api_call_ = true;
1876 } 1916 }
1877 1917
1878 1918
1879 } } // namespace v8::internal 1919 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/stub-cache.h ('k') | src/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698