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

Side by Side Diff: src/x64/full-codegen-x64.cc

Issue 1235983002: [strong] class objects created in strong mode have their prototype frozen (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X64 7 #if V8_TARGET_ARCH_X64
8 8
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 default: 2560 default:
2561 UNREACHABLE(); 2561 UNREACHABLE();
2562 } 2562 }
2563 } 2563 }
2564 2564
2565 // prototype 2565 // prototype
2566 __ CallRuntime(Runtime::kToFastProperties, 1); 2566 __ CallRuntime(Runtime::kToFastProperties, 1);
2567 2567
2568 // constructor 2568 // constructor
2569 __ CallRuntime(Runtime::kToFastProperties, 1); 2569 __ CallRuntime(Runtime::kToFastProperties, 1);
2570
2571 if (is_strong(language_mode())) {
2572 __ movp(scratch,
2573 FieldOperand(rax, JSFunction::kPrototypeOrInitialMapOffset));
2574 __ Push(rax);
2575 __ Push(scratch);
2576 __ CallRuntime(Runtime::kObjectFreeze, 1);
2577 // TODO(conradw): It would be more efficient to define the properties with
2578 // the right attributes the first time round.
2579 __ CallRuntime(Runtime::kObjectFreeze, 1);
2580 }
2570 } 2581 }
2571 2582
2572 2583
2573 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2584 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2574 __ Pop(rdx); 2585 __ Pop(rdx);
2575 Handle<Code> code = 2586 Handle<Code> code =
2576 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); 2587 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2577 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2588 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2578 CallIC(code, expr->BinaryOperationFeedbackId()); 2589 CallIC(code, expr->BinaryOperationFeedbackId());
2579 patch_site.EmitPatchInfo(); 2590 patch_site.EmitPatchInfo();
(...skipping 2936 matching lines...) Expand 10 before | Expand all | Expand 10 after
5516 Assembler::target_address_at(call_target_address, 5527 Assembler::target_address_at(call_target_address,
5517 unoptimized_code)); 5528 unoptimized_code));
5518 return OSR_AFTER_STACK_CHECK; 5529 return OSR_AFTER_STACK_CHECK;
5519 } 5530 }
5520 5531
5521 5532
5522 } // namespace internal 5533 } // namespace internal
5523 } // namespace v8 5534 } // namespace v8
5524 5535
5525 #endif // V8_TARGET_ARCH_X64 5536 #endif // V8_TARGET_ARCH_X64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698