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

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

Issue 683893002: Classes: Add super support in methods and accessors (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change test slightly Created 6 years, 1 month 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/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/classes.js » ('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_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 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after
2436 Literal* key = property->key()->AsLiteral(); 2436 Literal* key = property->key()->AsLiteral();
2437 Expression* value = property->value(); 2437 Expression* value = property->value();
2438 DCHECK(key != NULL); 2438 DCHECK(key != NULL);
2439 2439
2440 if (property->is_static()) { 2440 if (property->is_static()) {
2441 __ Push(Operand(rsp, kPointerSize)); // constructor 2441 __ Push(Operand(rsp, kPointerSize)); // constructor
2442 } else { 2442 } else {
2443 __ Push(Operand(rsp, 0)); // prototype 2443 __ Push(Operand(rsp, 0)); // prototype
2444 } 2444 }
2445 VisitForStackValue(key); 2445 VisitForStackValue(key);
2446 VisitForStackValue(value);
2446 2447
2447 switch (property->kind()) { 2448 switch (property->kind()) {
2448 case ObjectLiteral::Property::CONSTANT: 2449 case ObjectLiteral::Property::CONSTANT:
2449 case ObjectLiteral::Property::MATERIALIZED_LITERAL: 2450 case ObjectLiteral::Property::MATERIALIZED_LITERAL:
2450 case ObjectLiteral::Property::COMPUTED: 2451 case ObjectLiteral::Property::COMPUTED:
2451 case ObjectLiteral::Property::PROTOTYPE: 2452 case ObjectLiteral::Property::PROTOTYPE:
2452 VisitForStackValue(value); 2453 __ CallRuntime(Runtime::kDefineClassMethod, 3);
2453 __ Push(Smi::FromInt(NONE));
2454 __ CallRuntime(Runtime::kDefineDataPropertyUnchecked, 4);
2455 break; 2454 break;
2456 2455
2457 case ObjectLiteral::Property::GETTER: 2456 case ObjectLiteral::Property::GETTER:
2458 VisitForStackValue(value); 2457 __ CallRuntime(Runtime::kDefineClassGetter, 3);
2459 __ Push(isolate()->factory()->null_value());
2460 __ Push(Smi::FromInt(NONE));
2461 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
2462 break; 2458 break;
2463 2459
2464 case ObjectLiteral::Property::SETTER: 2460 case ObjectLiteral::Property::SETTER:
2465 __ Push(isolate()->factory()->null_value()); 2461 __ CallRuntime(Runtime::kDefineClassSetter, 3);
2466 VisitForStackValue(value);
2467 __ Push(Smi::FromInt(NONE));
2468 __ CallRuntime(Runtime::kDefineAccessorPropertyUnchecked, 5);
2469 break; 2462 break;
2470 2463
2471 default: 2464 default:
2472 UNREACHABLE(); 2465 UNREACHABLE();
2473 } 2466 }
2474 } 2467 }
2475 2468
2476 // prototype 2469 // prototype
2477 __ CallRuntime(Runtime::kToFastProperties, 1); 2470 __ CallRuntime(Runtime::kToFastProperties, 1);
2478 2471
(...skipping 2759 matching lines...) Expand 10 before | Expand all | Expand 10 after
5238 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(), 5231 DCHECK_EQ(isolate->builtins()->OsrAfterStackCheck()->entry(),
5239 Assembler::target_address_at(call_target_address, 5232 Assembler::target_address_at(call_target_address,
5240 unoptimized_code)); 5233 unoptimized_code));
5241 return OSR_AFTER_STACK_CHECK; 5234 return OSR_AFTER_STACK_CHECK;
5242 } 5235 }
5243 5236
5244 5237
5245 } } // namespace v8::internal 5238 } } // namespace v8::internal
5246 5239
5247 #endif // V8_TARGET_ARCH_X64 5240 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/runtime/runtime-classes.cc ('k') | test/mjsunit/harmony/classes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698