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

Side by Side Diff: src/ia32/stub-cache-ia32.cc

Issue 7307004: Fix ABI for API calls on ia32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review feedback Created 9 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 Object* callback = optimization.api_call_info()->callback(); 452 Object* callback = optimization.api_call_info()->callback();
453 Address api_function_address = v8::ToCData<Address>(callback); 453 Address api_function_address = v8::ToCData<Address>(callback);
454 ApiFunction fun(api_function_address); 454 ApiFunction fun(api_function_address);
455 455
456 const int kApiArgc = 1; // API function gets reference to the v8::Arguments. 456 const int kApiArgc = 1; // API function gets reference to the v8::Arguments.
457 457
458 // Allocate the v8::Arguments structure in the arguments' space since 458 // Allocate the v8::Arguments structure in the arguments' space since
459 // it's not controlled by GC. 459 // it's not controlled by GC.
460 const int kApiStackSpace = 4; 460 const int kApiStackSpace = 4;
461 461
462 __ PrepareCallApiFunction(kApiArgc + kApiStackSpace, ebx); 462 __ PrepareCallApiFunction(kApiArgc + kApiStackSpace);
463 463
464 __ mov(ApiParameterOperand(1), eax); // v8::Arguments::implicit_args_. 464 __ mov(ApiParameterOperand(1), eax); // v8::Arguments::implicit_args_.
465 __ add(Operand(eax), Immediate(argc * kPointerSize)); 465 __ add(Operand(eax), Immediate(argc * kPointerSize));
466 __ mov(ApiParameterOperand(2), eax); // v8::Arguments::values_. 466 __ mov(ApiParameterOperand(2), eax); // v8::Arguments::values_.
467 __ Set(ApiParameterOperand(3), Immediate(argc)); // v8::Arguments::length_. 467 __ Set(ApiParameterOperand(3), Immediate(argc)); // v8::Arguments::length_.
468 // v8::Arguments::is_construct_call_. 468 // v8::Arguments::is_construct_call_.
469 __ Set(ApiParameterOperand(4), Immediate(0)); 469 __ Set(ApiParameterOperand(4), Immediate(0));
470 470
471 // v8::InvocationCallback's argument. 471 // v8::InvocationCallback's argument.
472 __ lea(eax, ApiParameterOperand(1)); 472 __ lea(eax, ApiParameterOperand(1));
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 1075
1076 // Do call through the api. 1076 // Do call through the api.
1077 Address getter_address = v8::ToCData<Address>(callback->getter()); 1077 Address getter_address = v8::ToCData<Address>(callback->getter());
1078 ApiFunction fun(getter_address); 1078 ApiFunction fun(getter_address);
1079 1079
1080 // 3 elements array for v8::Agruments::values_, handler for name and pointer 1080 // 3 elements array for v8::Agruments::values_, handler for name and pointer
1081 // to the values (it considered as smi in GC). 1081 // to the values (it considered as smi in GC).
1082 const int kStackSpace = 5; 1082 const int kStackSpace = 5;
1083 const int kApiArgc = 2; 1083 const int kApiArgc = 2;
1084 1084
1085 __ PrepareCallApiFunction(kApiArgc, eax); 1085 __ PrepareCallApiFunction(kApiArgc);
1086 __ mov(ApiParameterOperand(0), ebx); // name. 1086 __ mov(ApiParameterOperand(0), ebx); // name.
1087 __ add(Operand(ebx), Immediate(kPointerSize)); 1087 __ add(Operand(ebx), Immediate(kPointerSize));
1088 __ mov(ApiParameterOperand(1), ebx); // arguments pointer. 1088 __ mov(ApiParameterOperand(1), ebx); // arguments pointer.
1089 1089
1090 // Emitting a stub call may try to allocate (if the code is not 1090 // Emitting a stub call may try to allocate (if the code is not
1091 // already generated). Do not allow the assembler to perform a 1091 // already generated). Do not allow the assembler to perform a
1092 // garbage collection but instead return the allocation failure 1092 // garbage collection but instead return the allocation failure
1093 // object. 1093 // object.
1094 return masm()->TryCallApiFunctionAndReturn(&fun, kStackSpace); 1094 return masm()->TryCallApiFunctionAndReturn(&fun, kStackSpace);
1095 } 1095 }
(...skipping 2678 matching lines...) Expand 10 before | Expand all | Expand 10 after
3774 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 3774 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
3775 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET); 3775 __ jmp(ic_force_generic, RelocInfo::CODE_TARGET);
3776 } 3776 }
3777 3777
3778 3778
3779 #undef __ 3779 #undef __
3780 3780
3781 } } // namespace v8::internal 3781 } } // namespace v8::internal
3782 3782
3783 #endif // V8_TARGET_ARCH_IA32 3783 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/macro-assembler-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698