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

Side by Side Diff: runtime/vm/object.cc

Issue 1201383002: Port irregexp bytecode compiler and interpreter from V8 r24065. (Closed) Base URL: git@github.com:dart-lang/sdk.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
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 20824 matching lines...) Expand 10 before | Expand all | Expand 10 after
20835 void JSRegExp::set_pattern(const String& pattern) const { 20835 void JSRegExp::set_pattern(const String& pattern) const {
20836 StorePointer(&raw_ptr()->pattern_, pattern.raw()); 20836 StorePointer(&raw_ptr()->pattern_, pattern.raw());
20837 } 20837 }
20838 20838
20839 20839
20840 void JSRegExp::set_function(intptr_t cid, const Function& value) const { 20840 void JSRegExp::set_function(intptr_t cid, const Function& value) const {
20841 StorePointer(FunctionAddr(cid), value.raw()); 20841 StorePointer(FunctionAddr(cid), value.raw());
20842 } 20842 }
20843 20843
20844 20844
20845 void JSRegExp::set_bytecode(bool is_one_byte, const TypedData& bytecode) const {
20846 if (is_one_byte) {
20847 StorePointer(&raw_ptr()->one_byte_bytecode_, bytecode.raw());
20848 } else {
20849 StorePointer(&raw_ptr()->two_byte_bytecode_, bytecode.raw());
20850 }
20851 }
20852
20853
20845 void JSRegExp::set_num_bracket_expressions(intptr_t value) const { 20854 void JSRegExp::set_num_bracket_expressions(intptr_t value) const {
20846 StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value)); 20855 StoreSmi(&raw_ptr()->num_bracket_expressions_, Smi::New(value));
20847 } 20856 }
20848 20857
20849 20858
20850 RawJSRegExp* JSRegExp::New(Heap::Space space) { 20859 RawJSRegExp* JSRegExp::New(Heap::Space space) {
20851 JSRegExp& result = JSRegExp::Handle(); 20860 JSRegExp& result = JSRegExp::Handle();
20852 { 20861 {
20853 RawObject* raw = Object::Allocate(JSRegExp::kClassId, 20862 RawObject* raw = Object::Allocate(JSRegExp::kClassId,
20854 JSRegExp::InstanceSize(), 20863 JSRegExp::InstanceSize(),
20855 space); 20864 space);
20856 NoSafepointScope no_safepoint; 20865 NoSafepointScope no_safepoint;
20857 result ^= raw; 20866 result ^= raw;
20858 result.set_type(kUnitialized); 20867 result.set_type(kUnitialized);
20859 result.set_flags(0); 20868 result.set_flags(0);
20869 result.set_num_registers(-1);
20860 } 20870 }
20861 return result.raw(); 20871 return result.raw();
20862 } 20872 }
20863 20873
20864 20874
20865 void* JSRegExp::GetDataStartAddress() const { 20875 void* JSRegExp::GetDataStartAddress() const {
20866 intptr_t addr = reinterpret_cast<intptr_t>(raw_ptr()); 20876 intptr_t addr = reinterpret_cast<intptr_t>(raw_ptr());
20867 return reinterpret_cast<void*>(addr + sizeof(RawJSRegExp)); 20877 return reinterpret_cast<void*>(addr + sizeof(RawJSRegExp));
20868 } 20878 }
20869 20879
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
21180 return tag_label.ToCString(); 21190 return tag_label.ToCString();
21181 } 21191 }
21182 21192
21183 21193
21184 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21194 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21185 Instance::PrintJSONImpl(stream, ref); 21195 Instance::PrintJSONImpl(stream, ref);
21186 } 21196 }
21187 21197
21188 21198
21189 } // namespace dart 21199 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698