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

Unified Diff: src/code-stubs.cc

Issue 8355035: Refactor elements kind conversion. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Bugfix 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/code-stubs.h ('k') | src/codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index f1b918b4fd75a5136b795b5e7398c4e9c510215d..b4374360c60ebbbe7ceb86a6cf0a6644eb4352ae 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -415,24 +415,29 @@ bool ToBooleanStub::Types::CanBeUndetectable() const {
}
-void FastElementsConversionStub::Generate(MacroAssembler* masm) {
- if (to_ == FAST_ELEMENTS) {
- if (from_ == FAST_SMI_ONLY_ELEMENTS) {
- GenerateSmiOnlyToObject(masm, strict_mode_);
- } else if (from_ == FAST_DOUBLE_ELEMENTS) {
- GenerateDoubleToObject(masm, strict_mode_);
+void ElementsTransitionAndStoreStub::Generate(MacroAssembler* masm) {
+ Label fail;
+ if (!FLAG_trace_elements_transitions) {
+ if (to_ == FAST_ELEMENTS) {
+ if (from_ == FAST_SMI_ONLY_ELEMENTS) {
+ ElementsTransitionGenerator::GenerateSmiOnlyToObject(masm);
+ } else if (from_ == FAST_DOUBLE_ELEMENTS) {
+ ElementsTransitionGenerator::GenerateDoubleToObject(masm, &fail);
+ } else {
+ UNREACHABLE();
+ }
+ KeyedStoreStubCompiler::GenerateStoreFastElement(masm,
+ is_jsarray_,
+ FAST_ELEMENTS);
+ } else if (from_ == FAST_SMI_ONLY_ELEMENTS && to_ == FAST_DOUBLE_ELEMENTS) {
+ ElementsTransitionGenerator::GenerateSmiOnlyToDouble(masm, &fail);
+ KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, is_jsarray_);
} else {
UNREACHABLE();
}
- KeyedStoreStubCompiler::GenerateStoreFastElement(masm,
- is_jsarray_,
- FAST_ELEMENTS);
- } else if (from_ == FAST_SMI_ONLY_ELEMENTS && to_ == FAST_DOUBLE_ELEMENTS) {
- GenerateSmiOnlyToDouble(masm, strict_mode_);
- KeyedStoreStubCompiler::GenerateStoreFastDoubleElement(masm, is_jsarray_);
- } else {
- UNREACHABLE();
}
+ masm->bind(&fail);
+ KeyedStoreIC::GenerateRuntimeSetProperty(masm, strict_mode_);
}
} } // namespace v8::internal
« no previous file with comments | « src/code-stubs.h ('k') | src/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698