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

Unified Diff: src/code-stubs.h

Issue 12217071: Combine %_SubString and %_StringCharAt. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.h
diff --git a/src/code-stubs.h b/src/code-stubs.h
index 5eea0a4fe0e4eed8695246e018d2b7c052856cf2..c06502aa2294ba9e8549d50905e501ce4625373a 100644
--- a/src/code-stubs.h
+++ b/src/code-stubs.h
@@ -1060,6 +1060,13 @@ class StringCharCodeAtGenerator {
void GenerateSlow(MacroAssembler* masm,
const RuntimeCallHelper& call_helper);
+ // Skip handling slow case and directly jump to bailout.
+ void SkipSlow(MacroAssembler* masm, Label* bailout) {
+ masm->bind(&index_not_smi_);
+ masm->bind(&call_runtime_);
+ masm->jmp(bailout);
+ }
+
private:
Register object_;
Register index_;
@@ -1100,6 +1107,12 @@ class StringCharFromCodeGenerator {
void GenerateSlow(MacroAssembler* masm,
const RuntimeCallHelper& call_helper);
+ // Skip handling slow case and directly jump to bailout.
+ void SkipSlow(MacroAssembler* masm, Label* bailout) {
+ masm->bind(&slow_case_);
+ masm->jmp(bailout);
+ }
+
private:
Register code_;
Register result_;
@@ -1142,13 +1155,25 @@ class StringCharAtGenerator {
// Generates the fast case code. On the fallthrough path |result|
// register contains the result.
- void GenerateFast(MacroAssembler* masm);
+ void GenerateFast(MacroAssembler* masm) {
+ char_code_at_generator_.GenerateFast(masm);
+ char_from_code_generator_.GenerateFast(masm);
+ }
// Generates the slow case code. Must not be naturally
// reachable. Expected to be put after a ret instruction (e.g., in
// deferred code). Always jumps back to the fast case.
void GenerateSlow(MacroAssembler* masm,
- const RuntimeCallHelper& call_helper);
+ const RuntimeCallHelper& call_helper) {
+ char_code_at_generator_.GenerateSlow(masm, call_helper);
+ char_from_code_generator_.GenerateSlow(masm, call_helper);
+ }
+
+ // Skip handling slow case and directly jump to bailout.
+ void SkipSlow(MacroAssembler* masm, Label* bailout) {
+ char_code_at_generator_.SkipSlow(masm, bailout);
+ char_from_code_generator_.SkipSlow(masm, bailout);
+ }
private:
StringCharCodeAtGenerator char_code_at_generator_;
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698