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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 1587073003: Array length reduction should throw in strict mode if it can't delete an element. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebasing for relanding Created 4 years, 11 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/runtime/runtime.h ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 7f976940b5a2213e505c3af0005405d9efb1dc8b..476724335d2602159b4927def4f7c5c6da7adc68 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -5368,11 +5368,11 @@ void CallApiAccessorStub::Generate(MacroAssembler* masm) {
void CallApiGetterStub::Generate(MacroAssembler* masm) {
// ----------- S t a t e -------------
- // -- rsp[0] : return address
- // -- rsp[8] : name
- // -- rsp[16 - kArgsLength*8] : PropertyCallbackArguments object
+ // -- rsp[0] : return address
+ // -- rsp[8] : name
+ // -- rsp[16 .. (16 + kArgsLength*8)] : v8::PropertyCallbackInfo::args_
// -- ...
- // -- r8 : api_function_address
+ // -- r8 : api_function_address
// -----------------------------------
#if defined(__MINGW64__) || defined(_WIN64)
@@ -5388,23 +5388,25 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
DCHECK(api_function_address.is(r8));
Register scratch = rax;
- // v8::Arguments::values_ and handler for name.
- const int kStackSpace = PropertyCallbackArguments::kArgsLength + 1;
+ // v8::PropertyCallbackInfo::args_ array and name handle.
+ const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1;
- // Allocate v8::AccessorInfo in non-GCed stack space.
+ // Allocate v8::PropertyCallbackInfo in non-GCed stack space.
const int kArgStackSpace = 1;
- __ leap(name_arg, Operand(rsp, kPCOnStackSize));
+ // Load address of v8::PropertyAccessorInfo::args_ array.
+ __ leap(scratch, Operand(rsp, 2 * kPointerSize));
PrepareCallApiFunction(masm, kArgStackSpace);
- __ leap(scratch, Operand(name_arg, 1 * kPointerSize));
-
- // v8::PropertyAccessorInfo::args_.
- __ movp(StackSpaceOperand(0), scratch);
+ // Create v8::PropertyCallbackInfo object on the stack and initialize
+ // it's args_ field.
+ Operand info_object = StackSpaceOperand(0);
+ __ movp(info_object, scratch);
+ __ leap(name_arg, Operand(scratch, -kPointerSize));
// The context register (rsi) has been saved in PrepareCallApiFunction and
// could be used to pass arguments.
- __ leap(accessor_info_arg, StackSpaceOperand(0));
+ __ leap(accessor_info_arg, info_object);
ExternalReference thunk_ref =
ExternalReference::invoke_accessor_getter_callback(isolate());
@@ -5414,13 +5416,12 @@ void CallApiGetterStub::Generate(MacroAssembler* masm) {
DCHECK(!api_function_address.is(accessor_info_arg) &&
!api_function_address.is(name_arg));
- // The name handler is counted as an argument.
- StackArgumentsAccessor args(rbp, PropertyCallbackArguments::kArgsLength);
- Operand return_value_operand = args.GetArgumentOperand(
- PropertyCallbackArguments::kArgsLength - 1 -
- PropertyCallbackArguments::kReturnValueOffset);
+ // +3 is to skip prolog, return address and name handle.
+ Operand return_value_operand(
+ rbp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize);
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, getter_arg,
- kStackSpace, nullptr, return_value_operand, NULL);
+ kStackUnwindSpace, nullptr, return_value_operand,
+ NULL);
}
« no previous file with comments | « src/runtime/runtime.h ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698