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

Unified Diff: src/code-stubs.cc

Issue 352583002: The IC exposes a register definition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: CodeStubDescriptor is beefed up to encapsulate an owned pointer and other fields. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: src/code-stubs.cc
diff --git a/src/code-stubs.cc b/src/code-stubs.cc
index f61035e248a2c11a21b563696d40910337bd602a..66236b0c01b191ff2a62acf1cd06fb452795215d 100644
--- a/src/code-stubs.cc
+++ b/src/code-stubs.cc
@@ -21,7 +21,6 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
stack_parameter_count_(no_reg),
hint_stack_parameter_count_(-1),
function_mode_(NOT_JS_FUNCTION_STUB_MODE),
- register_params_(NULL),
register_param_representations_(NULL),
deoptimization_handler_(NULL),
handler_arguments_mode_(DONT_PASS_ARGUMENTS),
@@ -29,6 +28,40 @@ CodeStubInterfaceDescriptor::CodeStubInterfaceDescriptor()
has_miss_handler_(false) { }
+void CodeStubInterfaceDescriptor::Initialize(
+ int register_parameter_count,
+ Register* registers,
+ Address deoptimization_handler,
+ Representation* register_param_representations,
+ int hint_stack_parameter_count,
+ StubFunctionMode function_mode) {
+ InitializeRegisterParams(register_parameter_count, registers);
+ deoptimization_handler_ = deoptimization_handler;
+ register_param_representations_ = register_param_representations;
+ hint_stack_parameter_count_ = hint_stack_parameter_count;
+ function_mode_ = function_mode;
+}
+
+
+void CodeStubInterfaceDescriptor::Initialize(
+ int register_parameter_count,
+ Register* registers,
+ Register stack_parameter_count,
+ Address deoptimization_handler,
+ Representation* register_param_representations,
+ int hint_stack_parameter_count,
+ StubFunctionMode function_mode,
+ HandlerArgumentsMode handler_mode) {
+ Initialize(register_parameter_count, registers,
+ deoptimization_handler,
+ register_param_representations,
+ hint_stack_parameter_count,
+ function_mode);
+ stack_parameter_count_ = stack_parameter_count;
+ handler_arguments_mode_ = handler_mode;
+}
+
+
bool CodeStub::FindCodeInCache(Code** code_out) {
UnseededNumberDictionary* stubs = isolate()->heap()->code_stubs();
int index = stubs->FindEntry(GetKey());
@@ -512,6 +545,34 @@ void JSEntryStub::FinishCode(Handle<Code> code) {
}
+void KeyedLoadFastElementStub::InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) {
+ Register registers[] = { KeyedLoadIC::ReceiverRegister(),
+ KeyedLoadIC::NameRegister() };
+ descriptor->Initialize(KeyedLoadIC::kRegisterArgumentCount, registers,
+ FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
+}
+
+
+void KeyedLoadDictionaryElementStub::InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) {
+ Register registers[] = { KeyedLoadIC::ReceiverRegister(),
+ KeyedLoadIC::NameRegister() };
+ descriptor->Initialize(KeyedLoadIC::kRegisterArgumentCount, registers,
+ FUNCTION_ADDR(KeyedLoadIC_MissFromStubFailure));
+}
+
+
+void KeyedLoadGenericElementStub::InitializeInterfaceDescriptor(
+ CodeStubInterfaceDescriptor* descriptor) {
+ Register registers[] = { KeyedLoadIC::ReceiverRegister(),
+ KeyedLoadIC::NameRegister() };
+ descriptor->Initialize(
+ KeyedLoadIC::kRegisterArgumentCount, registers,
+ Runtime::FunctionForId(Runtime::kKeyedGetProperty)->entry);
+}
+
+
void KeyedLoadDictionaryElementPlatformStub::Generate(
MacroAssembler* masm) {
KeyedLoadStubCompiler::GenerateLoadDictionaryElement(masm);

Powered by Google App Engine
This is Rietveld 408576698