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

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

Issue 10878047: Revert to code state of 3.13.1 plus r12350 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 8 years, 4 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/x64/macro-assembler-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 __ bind(&miss); 221 __ bind(&miss);
222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); 222 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
223 } 223 }
224 224
225 225
226 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 226 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
227 int index, 227 int index,
228 Register prototype) { 228 Register prototype) {
229 // Load the global or builtins object from the current context. 229 // Load the global or builtins object from the current context.
230 __ movq(prototype, 230 __ movq(prototype,
231 Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); 231 Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)));
232 // Load the native context from the global or builtins object. 232 // Load the global context from the global or builtins object.
233 __ movq(prototype, 233 __ movq(prototype,
234 FieldOperand(prototype, GlobalObject::kNativeContextOffset)); 234 FieldOperand(prototype, GlobalObject::kGlobalContextOffset));
235 // Load the function from the native context. 235 // Load the function from the global context.
236 __ movq(prototype, Operand(prototype, Context::SlotOffset(index))); 236 __ movq(prototype, Operand(prototype, Context::SlotOffset(index)));
237 // Load the initial map. The global functions all have initial maps. 237 // Load the initial map. The global functions all have initial maps.
238 __ movq(prototype, 238 __ movq(prototype,
239 FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset)); 239 FieldOperand(prototype, JSFunction::kPrototypeOrInitialMapOffset));
240 // Load the prototype from the initial map. 240 // Load the prototype from the initial map.
241 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 241 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
242 } 242 }
243 243
244 244
245 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( 245 void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
246 MacroAssembler* masm, 246 MacroAssembler* masm,
247 int index, 247 int index,
248 Register prototype, 248 Register prototype,
249 Label* miss) { 249 Label* miss) {
250 Isolate* isolate = masm->isolate(); 250 Isolate* isolate = masm->isolate();
251 // Check we're still in the same context. 251 // Check we're still in the same context.
252 __ Move(prototype, isolate->global_object()); 252 __ Move(prototype, isolate->global());
253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)), 253 __ cmpq(Operand(rsi, Context::SlotOffset(Context::GLOBAL_INDEX)),
254 prototype); 254 prototype);
255 __ j(not_equal, miss); 255 __ j(not_equal, miss);
256 // Get the global function with the given index. 256 // Get the global function with the given index.
257 Handle<JSFunction> function( 257 Handle<JSFunction> function(
258 JSFunction::cast(isolate->native_context()->get(index))); 258 JSFunction::cast(isolate->global_context()->get(index)));
259 // Load its initial map. The global functions all have initial maps. 259 // Load its initial map. The global functions all have initial maps.
260 __ Move(prototype, Handle<Map>(function->initial_map())); 260 __ Move(prototype, Handle<Map>(function->initial_map()));
261 // Load the prototype from the initial map. 261 // Load the prototype from the initial map.
262 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset)); 262 __ movq(prototype, FieldOperand(prototype, Map::kPrototypeOffset));
263 } 263 }
264 264
265 265
266 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm, 266 void StubCompiler::GenerateLoadArrayLength(MacroAssembler* masm,
267 Register receiver, 267 Register receiver,
268 Register scratch, 268 Register scratch,
(...skipping 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2468 // Handle store cache miss. 2468 // Handle store cache miss.
2469 __ bind(&miss); 2469 __ bind(&miss);
2470 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2470 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2471 __ Jump(ic, RelocInfo::CODE_TARGET); 2471 __ Jump(ic, RelocInfo::CODE_TARGET);
2472 2472
2473 // Return the generated code. 2473 // Return the generated code.
2474 return GetCode(Code::CALLBACKS, name); 2474 return GetCode(Code::CALLBACKS, name);
2475 } 2475 }
2476 2476
2477 2477
2478 #undef __ 2478 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2479 #define __ ACCESS_MASM(masm) 2479 Handle<String> name,
2480 2480 Handle<JSObject> receiver,
2481 2481 Handle<JSObject> holder,
2482 void StoreStubCompiler::GenerateStoreViaSetter(
2483 MacroAssembler* masm,
2484 Handle<JSFunction> setter) { 2482 Handle<JSFunction> setter) {
2485 // ----------- S t a t e ------------- 2483 // ----------- S t a t e -------------
2486 // -- rax : value 2484 // -- rax : value
2487 // -- rcx : name 2485 // -- rcx : name
2488 // -- rdx : receiver 2486 // -- rdx : receiver
2489 // -- rsp[0] : return address 2487 // -- rsp[0] : return address
2490 // ----------------------------------- 2488 // -----------------------------------
2489 Label miss;
2490
2491 // Check that the maps haven't changed.
2492 __ JumpIfSmi(rdx, &miss);
2493 CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss);
2494
2491 { 2495 {
2492 FrameScope scope(masm, StackFrame::INTERNAL); 2496 FrameScope scope(masm(), StackFrame::INTERNAL);
2493 2497
2494 // Save value register, so we can restore it later. 2498 // Save value register, so we can restore it later.
2495 __ push(rax); 2499 __ push(rax);
2496 2500
2497 if (!setter.is_null()) { 2501 // Call the JavaScript setter with the receiver and the value on the stack.
2498 // Call the JavaScript setter with receiver and value on the stack. 2502 __ push(rdx);
2499 __ push(rdx); 2503 __ push(rax);
2500 __ push(rax); 2504 ParameterCount actual(1);
2501 ParameterCount actual(1); 2505 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(),
2502 __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), 2506 CALL_AS_METHOD);
2503 CALL_AS_METHOD);
2504 } else {
2505 // If we generate a global code snippet for deoptimization only, remember
2506 // the place to continue after deoptimization.
2507 masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset());
2508 }
2509 2507
2510 // We have to return the passed value, not the return value of the setter. 2508 // We have to return the passed value, not the return value of the setter.
2511 __ pop(rax); 2509 __ pop(rax);
2512 2510
2513 // Restore context register. 2511 // Restore context register.
2514 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); 2512 __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
2515 } 2513 }
2516 __ ret(0); 2514 __ ret(0);
2517 }
2518
2519
2520 #undef __
2521 #define __ ACCESS_MASM(masm())
2522
2523
2524 Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
2525 Handle<String> name,
2526 Handle<JSObject> receiver,
2527 Handle<JSObject> holder,
2528 Handle<JSFunction> setter) {
2529 // ----------- S t a t e -------------
2530 // -- rax : value
2531 // -- rcx : name
2532 // -- rdx : receiver
2533 // -- rsp[0] : return address
2534 // -----------------------------------
2535 Label miss;
2536
2537 // Check that the maps haven't changed.
2538 __ JumpIfSmi(rdx, &miss);
2539 CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss);
2540
2541 GenerateStoreViaSetter(masm(), setter);
2542 2515
2543 __ bind(&miss); 2516 __ bind(&miss);
2544 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); 2517 Handle<Code> ic = isolate()->builtins()->StoreIC_Miss();
2545 __ Jump(ic, RelocInfo::CODE_TARGET); 2518 __ Jump(ic, RelocInfo::CODE_TARGET);
2546 2519
2547 // Return the generated code. 2520 // Return the generated code.
2548 return GetCode(Code::CALLBACKS, name); 2521 return GetCode(Code::CALLBACKS, name);
2549 } 2522 }
2550 2523
2551 2524
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
4077 __ jmp(ic_slow, RelocInfo::CODE_TARGET); 4050 __ jmp(ic_slow, RelocInfo::CODE_TARGET);
4078 } 4051 }
4079 } 4052 }
4080 4053
4081 4054
4082 #undef __ 4055 #undef __
4083 4056
4084 } } // namespace v8::internal 4057 } } // namespace v8::internal
4085 4058
4086 #endif // V8_TARGET_ARCH_X64 4059 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698