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

Unified Diff: src/stub-cache.cc

Issue 8372029: Handlify the remaining stub compiler functions for call ICs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/stub-cache.cc
diff --git a/src/stub-cache.cc b/src/stub-cache.cc
index 67e2a14dac824cb05fb1ed7bbfa6cd942dd56a62..0c30a1d88e0e33662d3845f71182cc61eb970304 100644
--- a/src/stub-cache.cc
+++ b/src/stub-cache.cc
@@ -1508,14 +1508,6 @@ Handle<Code> StubCompiler::CompileCallNormal(Code::Flags flags) {
Handle<Code> StubCompiler::CompileCallMegamorphic(Code::Flags flags) {
- CALL_HEAP_FUNCTION(isolate(),
- (set_failure(NULL), TryCompileCallMegamorphic(flags)),
- Code);
-}
-
-
-MaybeObject* StubCompiler::TryCompileCallMegamorphic(Code::Flags flags) {
- HandleScope scope(isolate());
int argc = Code::ExtractArgumentsCountFromFlags(flags);
Code::Kind kind = Code::ExtractKindFromFlags(flags);
Code::ExtraICState extra_state = Code::ExtractExtraICStateFromFlags(flags);
@@ -1524,46 +1516,26 @@ MaybeObject* StubCompiler::TryCompileCallMegamorphic(Code::Flags flags) {
} else {
KeyedCallIC::GenerateMegamorphic(masm(), argc);
}
- Object* result;
- { MaybeObject* maybe_result =
- TryGetCodeWithFlags(flags, "CompileCallMegamorphic");
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
+ Handle<Code> code = GetCodeWithFlags(flags, "CompileCallMegamorphic");
isolate()->counters()->call_megamorphic_stubs()->Increment();
- Code* code = Code::cast(result);
- USE(code);
PROFILE(isolate(),
CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
- code, code->arguments_count()));
- GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
- return result;
+ *code, code->arguments_count()));
+ GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code));
+ return code;
}
Handle<Code> StubCompiler::CompileCallArguments(Code::Flags flags) {
- CALL_HEAP_FUNCTION(isolate(),
- (set_failure(NULL), TryCompileCallArguments(flags)),
- Code);
-}
-
-
-MaybeObject* StubCompiler::TryCompileCallArguments(Code::Flags flags) {
- HandleScope scope(isolate());
int argc = Code::ExtractArgumentsCountFromFlags(flags);
KeyedCallIC::GenerateNonStrictArguments(masm(), argc);
- Code::Kind kind = Code::ExtractKindFromFlags(flags);
- Object* result;
- { MaybeObject* maybe_result =
- TryGetCodeWithFlags(flags, "CompileCallArguments");
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Code* code = Code::cast(result);
- USE(code);
+ Handle<Code> code = GetCodeWithFlags(flags, "CompileCallArguments");
PROFILE(isolate(),
- CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_MEGAMORPHIC_TAG),
- code, code->arguments_count()));
- GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, Code::cast(code)));
- return result;
+ CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags),
+ CALL_MEGAMORPHIC_TAG),
+ *code, code->arguments_count()));
+ GDBJIT(AddCode(GDBJITInterface::CALL_MEGAMORPHIC, *code));
+ return code;
}
@@ -1615,43 +1587,19 @@ MaybeObject* StubCompiler::TryCompileCallMiss(Code::Flags flags) {
#ifdef ENABLE_DEBUGGER_SUPPORT
Handle<Code> StubCompiler::CompileCallDebugBreak(Code::Flags flags) {
- CALL_HEAP_FUNCTION(isolate(),
- (set_failure(NULL), TryCompileCallDebugBreak(flags)),
- Code);
-}
-
-
-MaybeObject* StubCompiler::TryCompileCallDebugBreak(Code::Flags flags) {
- HandleScope scope(isolate());
Debug::GenerateCallICDebugBreak(masm());
- Object* result;
- { MaybeObject* maybe_result =
- TryGetCodeWithFlags(flags, "CompileCallDebugBreak");
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Code* code = Code::cast(result);
- USE(code);
- Code::Kind kind = Code::ExtractKindFromFlags(flags);
- USE(kind);
+ Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugBreak");
PROFILE(isolate(),
- CodeCreateEvent(CALL_LOGGER_TAG(kind, CALL_DEBUG_BREAK_TAG),
- code, code->arguments_count()));
- return result;
+ CodeCreateEvent(CALL_LOGGER_TAG(Code::ExtractKindFromFlags(flags),
+ CALL_DEBUG_BREAK_TAG),
+ *code, code->arguments_count()));
+ return code;
}
Handle<Code> StubCompiler::CompileCallDebugPrepareStepIn(Code::Flags flags) {
- CALL_HEAP_FUNCTION(
- isolate(),
- (set_failure(NULL), TryCompileCallDebugPrepareStepIn(flags)),
- Code);
-}
-
-
-MaybeObject* StubCompiler::TryCompileCallDebugPrepareStepIn(Code::Flags flags) {
- HandleScope scope(isolate());
- // Use the same code for the the step in preparations as we do for
- // the miss case.
+ // Use the same code for the the step in preparations as we do for the
+ // miss case.
int argc = Code::ExtractArgumentsCountFromFlags(flags);
Code::Kind kind = Code::ExtractKindFromFlags(flags);
if (kind == Code::CALL_IC) {
@@ -1660,24 +1608,19 @@ MaybeObject* StubCompiler::TryCompileCallDebugPrepareStepIn(Code::Flags flags) {
} else {
KeyedCallIC::GenerateMiss(masm(), argc);
}
- Object* result;
- { MaybeObject* maybe_result =
- TryGetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn");
- if (!maybe_result->ToObject(&result)) return maybe_result;
- }
- Code* code = Code::cast(result);
- USE(code);
+ Handle<Code> code = GetCodeWithFlags(flags, "CompileCallDebugPrepareStepIn");
PROFILE(isolate(),
CodeCreateEvent(
CALL_LOGGER_TAG(kind, CALL_DEBUG_PREPARE_STEP_IN_TAG),
- code,
+ *code,
code->arguments_count()));
- return result;
+ return code;
}
-#endif
+#endif // ENABLE_DEBUGGER_SUPPORT
#undef CALL_LOGGER_TAG
+
Handle<Code> StubCompiler::GetCodeWithFlags(Code::Flags flags,
const char* name) {
// Create code object in the heap.
« no previous file with comments | « src/stub-cache.h ('k') | src/x64/ic-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698