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

Side by Side Diff: src/ia32/full-codegen-ia32.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: cl feedback 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
« no previous file with comments | « src/full-codegen.cc ('k') | src/mips/full-codegen-mips.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 // 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_IA32 7 #if V8_TARGET_ARCH_IA32
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 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after
2557 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4); 2557 __ CallRuntime(Runtime::kDefineSetterPropertyUnchecked, 4);
2558 break; 2558 break;
2559 } 2559 }
2560 } 2560 }
2561 2561
2562 // prototype 2562 // prototype
2563 __ CallRuntime(Runtime::kToFastProperties, 1); 2563 __ CallRuntime(Runtime::kToFastProperties, 1);
2564 2564
2565 // constructor 2565 // constructor
2566 __ CallRuntime(Runtime::kToFastProperties, 1); 2566 __ CallRuntime(Runtime::kToFastProperties, 1);
2567
2568 if (is_strong(language_mode())) {
2569 __ mov(scratch,
2570 FieldOperand(eax, JSFunction::kPrototypeOrInitialMapOffset));
2571 __ push(eax);
2572 __ Push(scratch);
2573 // TODO(conradw): It would be more efficient to define the properties with
2574 // the right attributes the first time round.
2575 // Freeze the prototype.
2576 __ CallRuntime(Runtime::kObjectFreeze, 1);
2577 // Freeze the constructor.
2578 __ CallRuntime(Runtime::kObjectFreeze, 1);
2579 }
2567 } 2580 }
2568 2581
2569 2582
2570 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) { 2583 void FullCodeGenerator::EmitBinaryOp(BinaryOperation* expr, Token::Value op) {
2571 __ pop(edx); 2584 __ pop(edx);
2572 Handle<Code> code = 2585 Handle<Code> code =
2573 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code(); 2586 CodeFactory::BinaryOpIC(isolate(), op, strength(language_mode())).code();
2574 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code. 2587 JumpPatchSite patch_site(masm_); // unbound, signals no inlined smi code.
2575 CallIC(code, expr->BinaryOperationFeedbackId()); 2588 CallIC(code, expr->BinaryOperationFeedbackId());
2576 patch_site.EmitPatchInfo(); 2589 patch_site.EmitPatchInfo();
(...skipping 2914 matching lines...) Expand 10 before | Expand all | Expand 10 after
5491 Assembler::target_address_at(call_target_address, 5504 Assembler::target_address_at(call_target_address,
5492 unoptimized_code)); 5505 unoptimized_code));
5493 return OSR_AFTER_STACK_CHECK; 5506 return OSR_AFTER_STACK_CHECK;
5494 } 5507 }
5495 5508
5496 5509
5497 } // namespace internal 5510 } // namespace internal
5498 } // namespace v8 5511 } // namespace v8
5499 5512
5500 #endif // V8_TARGET_ARCH_IA32 5513 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/full-codegen.cc ('k') | src/mips/full-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698