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

Unified Diff: src/code-stubs.cc

Issue 4695003: Removing redundant stubs for API functions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 1 month 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
Index: src/code-stubs.cc
===================================================================
--- src/code-stubs.cc (revision 5816)
+++ src/code-stubs.cc (working copy)
@@ -37,7 +37,6 @@
namespace internal {
bool CodeStub::FindCodeInCache(Code** code_out) {
- if (has_custom_cache()) return GetCustomCache(code_out);
int index = Heap::code_stubs()->FindEntry(GetKey());
if (index != NumberDictionary::kNotFound) {
*code_out = Code::cast(Heap::code_stubs()->ValueAt(index));
@@ -105,17 +104,14 @@
Handle<Code> new_object = Factory::NewCode(desc, flags, masm.CodeObject());
RecordCodeGeneration(*new_object, &masm);
- if (has_custom_cache()) {
- SetCustomCache(*new_object);
- } else {
- // Update the dictionary and the root in Heap.
- Handle<NumberDictionary> dict =
- Factory::DictionaryAtNumberPut(
- Handle<NumberDictionary>(Heap::code_stubs()),
- GetKey(),
- new_object);
- Heap::public_set_code_stubs(*dict);
- }
+ // Update the dictionary and the root in Heap.
+ Handle<NumberDictionary> dict =
+ Factory::DictionaryAtNumberPut(
+ Handle<NumberDictionary>(Heap::code_stubs()),
+ GetKey(),
+ new_object);
+ Heap::public_set_code_stubs(*dict);
+
code = *new_object;
}
@@ -147,15 +143,11 @@
code = Code::cast(new_object);
RecordCodeGeneration(code, &masm);
- if (has_custom_cache()) {
- SetCustomCache(code);
- } else {
- // Try to update the code cache but do not fail if unable.
- MaybeObject* maybe_new_object =
- Heap::code_stubs()->AtNumberPut(GetKey(), code);
- if (maybe_new_object->ToObject(&new_object)) {
- Heap::public_set_code_stubs(NumberDictionary::cast(new_object));
- }
+ // Try to update the code cache but do not fail if unable.
+ MaybeObject* maybe_new_object =
+ Heap::code_stubs()->AtNumberPut(GetKey(), code);
antonm 2010/11/15 16:22:06 [cosmetic nit] just asking: can this fit one line
SeRya 2010/11/15 16:37:50 It can't (only if shorten the var name).
+ if (maybe_new_object->ToObject(&new_object)) {
+ Heap::public_set_code_stubs(NumberDictionary::cast(new_object));
}
}
« no previous file with comments | « src/code-stubs.h ('k') | src/codegen.cc » ('j') | src/x64/macro-assembler-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698